RFC - how to quota special characters in filenames in /proc files

Neil Brown (neilb@cse.unsw.edu.au)
Mon, 3 Sep 2001 14:04:13 +1000 (EST)


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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/