filename hoopla
mark at laidbak.UUCP
mark at laidbak.UUCP
Fri Aug 5 17:24:10 AEST 1983
The Bourne shell mangles names with eight-bit characters by stripping
high-order bits. This is why "rm -i *" doesn't always work on garbage
filenames. Perhaps this (or the fact that ASCII is a seven-bit code)
is why USG disallows filenames containing eight-bit characters.
Assuming that only printable characters were allowed within filenames,
what about those characters which are special to the shell? For example,
I once created a file named "*". Imagine the consequences of a naive user's
attempts at removing this from a directory full of important files. What
about a dash ("-") at the beginning of a name? Just try to manipulate (or
remove) that with a program which recognizes options!
Also, let's not forget that the shell is just another user-level process
(as witnessed by users of csh, vsh, ...), and that each new shell defines
several additional special characters (such as "~" in csh).
Numerics are another special case. There are already several programs
(mkfs, icheck, dcheck and ncheck come to mind immediately) which
distinguish arguments from filenames by recognizing numeric characters.
Even such accepted punctuation as "_" and "." would have to go, since a
future shell might easily adopt them as special characters (don't laugh;
the designers of uucp's "...!..." syntax and the "C" shell's history
mechanism obviously weren't thinking of each other).
Personally, I dislike the idea of protecting users from themselves. The
only way to "cover all of the bases" would be to restrict qualifiers to
beginning with an alphabetic characters and containing nothing but alpha-
numerics. Many people would certainly find this solution unacceptable.
A proper solution probably lies in the tty handler, which now prevents
users from seeing things as they are. We must be wary of programs which
send escape sequences to terminals, as these frequenly contain unprintable
characters (beyond the escape itself). At least here we are dealing with
a single problem, rather than the untold number associated with filename
restrictions.
Mark Brukhartz
..!{ihnp4,allegra,trsvax}!laidbak!mark
More information about the Comp.unix.wizards
mailing list