mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: RFC - how to quota special characters in filenames in /proc files
@ 2001-09-03 14:01 Andries.Brouwer
  0 siblings, 0 replies; 2+ messages in thread
From: Andries.Brouwer @ 2001-09-03 14:01 UTC (permalink / raw)
  To: linux-kernel, neilb

    From: Neil Brown <neilb@cse.unsw.edu.au>

    I am interested in opinions that people might have on how to quote
    special characters in filenames in files in /proc.

    Is there any convention already used in some other part of the
    kernel?

/proc/mounts does what mount does - it uses octal escapes:

# mount /dev/sr0 "/a b" -r -t iso9660
# mount | tail -1
/dev/sr0 on /a b type iso9660 (ro)
# cat /proc/mounts | tail -1
/dev/sr0 /a\040b iso9660 ro 0 0
#

Andries




^ permalink raw reply	[flat|nested] 2+ messages in thread

* RFC - how to quota special characters in filenames in /proc files
@ 2001-09-03  4:04 Neil Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Neil Brown @ 2001-09-03  4:04 UTC (permalink / raw)
  To: linux-kernel


Greetings.

I am interested in opinions that people might have on how to quote
special characters in filenames in files in /proc.

The particular filenames of interest are those in
     /proc/fs/nfs/exports

This file lists the directories that have been exported, what hosts
they are exported to, and what export options apply.

The lines are made of space-sparated fields.  The first field is the
directory name.

So what happens when you export a directory which has a space in it's
name?  Currently this doesn't work too well.

My preference is to replace all control characters, spaces, DEL, and '%'
with a %hex string much like the special character quoting in
URLs.

Other alternatives that I don't like is to preceed special characters
with '\'  or to use =hex instead of %hex, like MIME encoding does.

So:
  is there any good reason why I should choose something other than %hex?  
  is there any convention already used in some other part of the
    kernel.

In the longer term it would probably be better to use a directory
rather than a file, and present all file names as symlinks so quoting
isn't needed.  However I don't see that as a short term solution and I
think a short term solution is needed.


Thankyou for your time.

NeilBrown

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-09-03 14:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-03 14:01 RFC - how to quota special characters in filenames in /proc files Andries.Brouwer
  -- strict thread matches above, loose matches on Subject: below --
2001-09-03  4:04 Neil Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®