Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Jul 2009 13:36:10 -0500
From:      Brooks Davis <brooks@FreeBSD.org>
To:        Tim Kientzle <kientzle@FreeBSD.org>
Cc:        svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org
Subject:   Re: svn commit: r195318 - head/usr.bin/cpio
Message-ID:  <20090703183609.GA45185@lor.one-eyed-alien.net>
In-Reply-To: <200907031754.n63HsXRn084493@svn.freebsd.org>
References:  <200907031754.n63HsXRn084493@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--r5Pyd7+fXNt84Ff3
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Fri, Jul 03, 2009 at 05:54:33PM +0000, Tim Kientzle wrote:
> Modified: head/usr.bin/cpio/cmdline.c
> ==============================================================================
> --- head/usr.bin/cpio/cmdline.c	Fri Jul  3 16:33:42 2009	(r195317)
> +++ head/usr.bin/cpio/cmdline.c	Fri Jul  3 17:54:33 2009	(r195318)
> @@ -268,16 +268,36 @@ cpio_getopt(struct cpio *cpio)
>   * Parse the argument to the -R or --owner flag.
>   *
>   * The format is one of the following:
> - *   <user>    - Override user but not group
> - *   <user>:   - Override both, group is user's default group
> - *   <user>:<group> - Override both
> - *   :<group>  - Override group but not user
> + *   <username|uid>    - Override user but not group
> + *   <username>:   - Override both, group is user's default group
> + *   <uid>:    - Override user but not group
> + *   <username|uid>:<groupname|gid> - Override both
> + *   :<groupname|gid>  - Override group but not user
> + *
> + * Where uid/gid are decimal representations and groupname/username
> + * are names to be looked up in system database.  Note that
> + * uid/gid parsing takes priority over username/groupname lookup,
> + * so this won't do a lookup for usernames or group names that
> + * consist entirely of digits.

Is this behavior specified somewhere?  It is counter to the usual rule
that the system should attempt to resolve all strings as a name first.
For example, the following is from the chown manpage in POSIX.1-2008

        If a numeric owner operand exists in the user database as a user
        name, the user ID number associated with that user name shall be
        used as the user ID.

Numeric usernames are a disaster, especially if they can't match the uid
for some reason, but following this rule consistently at least makes
things more sane if you're stuck with them.

-- Brooks

--r5Pyd7+fXNt84Ff3
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iD8DBQFKTk+ZXY6L6fI4GtQRAr05AKCfi+4Wh+5DqlwwG4RumKfgYHYoigCgj/ni
on202oO4v1XuEGyckC/9a6E=
=oewl
-----END PGP SIGNATURE-----

--r5Pyd7+fXNt84Ff3--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090703183609.GA45185>