GNU bug report logs -
#15945
chown: accept "[NUMERIC-ID]:" syntax
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
On 11/21/2013 08:53 AM, Eric Blake wrote:
> If you provide a colon, you MUST also provide a group spec. Per 'chown
> --help', the syntax is:
> chown [OPTION]... [OWNER][:[GROUP]] FILE...
Hmm, on re-reading this, I think we have two bugs in our help syntax.
The major bug is that we document [GROUP] as optional, but in reality it
is mandatory if ':' is present. So we definitely need to change
'[:[GROUP]]' to '[:GROUP]'.
The minor group stems from a GNU extension. POSIX requires that the
OWNER portion is mandatory:
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/chown.html
But as a GNU extension, we allow it to be empty to allow for:
> chown :1001 /tmp/bla # change group only
But as written, the usage text implies that we can omit both OWNER and
:GROUP and still have a valid call, as in:
chown /tmp/bla
which isn't quite true. Alas, the only way I can see to rewrite the
fact that SOME spec is necessary, while still highlighting the GNU
extension of omitting OWNER, is to split the usage into two lines:
Usage: chown [OPTION]... OWNER[:[GROUP]] FILE...
or: chown [OPTION]... :GROUP FILE...
Thoughts? Should we reopen this bug to track the doc bug[s]?
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[signature.asc (application/pgp-signature, attachment)]
This bug report was last modified 6 years and 155 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.