GNU bug report logs - #15945
chown: accept "[NUMERIC-ID]:" syntax

Previous Next

Package: coreutils;

Reported by: Tormen <quickhelp <at> gmail.com>

Date: Thu, 21 Nov 2013 15:18:03 UTC

Severity: wishlist

Full log


View this message in rfc822 format

From: Eric Blake <eblake <at> redhat.com>
To: 15945 <at> debbugs.gnu.org, quickhelp <at> gmail.com
Subject: bug#15945: chown: Does now allow setting user and users login group with numerical user ID
Date: Thu, 21 Nov 2013 09:09:34 -0700
[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.