[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: getopts security problem
From: |
Paul Eggert |
Subject: |
Re: getopts security problem |
Date: |
Wed, 27 Oct 2004 14:21:03 -0700 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) |
Nico Schottelius <address@hidden> writes:
> What I am asking you: Why does chown accept arguments, which are
> not at the beginning? Is that a glibc "bug" or "feature"?
It's a feature. To avoid the problem, prepend "./" to "*", e.g.,
"chown nico.nico ./*".
You'll run into similar problems with commands like "cat *" and
"rm *". Prepending "./" fixes the problem there too, e.g., "cat ./*",
"rm ./*".
> I know it from some other Unices, that only parameters allowed
> at first, not after arguments.
All Unixes have this problem to some extent. For example "cat *" will
mishandle a file whose name is the single character "-". Prepending
"./" solves this problem on all Unixes.