Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

rsync-3.1.0 --chown, --usermap, and --groupmap ignored?

963 views
Skip to first unread message

Jed Brown

unread,
Oct 13, 2013, 10:50:17 PM10/13/13
to
The man page describes options --chown, --usermap, and --groupmap, but
these seem to be silently ignored beyond validating that the user and
groups do indeed exist. Is the following supposed to work?

$ touch a
$ rsync --chown=http:http a b
$ ls -l a b
-rw-r--r-- 1 jed jed 0 Oct 14 02:44 a
-rw-r--r-- 1 jed jed 0 Oct 14 02:45 b
$ chown http:http b
chown: changing ownership of 'b': Operation not permitted
$ rm b
$ rsync --chown=jed:http a b
$ ls -l b
-rw-r--r-- 1 jed jed 0 Oct 14 02:46 b
$ chown jed:http b
$ ls -l b
-rw-r--r-- 1 jed http 0 Oct 14 02:46 b
$ rsync --version
rsync version 3.1.0 protocol version 31
Copyright (C) 1996-2013 by Andrew Tridgell, Wayne Davison, and others.
Web site: http://rsync.samba.org/
Capabilities:
64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
append, ACLs, xattrs, iconv, symtimes, prealloc

rsync comes with ABSOLUTELY NO WARRANTY. This is free software, and you
are welcome to redistribute it under certain conditions. See the GNU
General Public Licence for details.

Paul Slootman

unread,
Oct 14, 2013, 4:46:45 AM10/14/13
to
On Sun 13 Oct 2013, Jed Brown wrote:

> The man page describes options --chown, --usermap, and --groupmap, but
> these seem to be silently ignored beyond validating that the user and
> groups do indeed exist. Is the following supposed to work?

No, because you're not running the rsync command as the superuser,
and not using the --owner / --group options.


Paul
--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Jed Brown

unread,
Oct 14, 2013, 10:46:47 AM10/14/13
to
Paul Slootman <paul+...@wurtel.net> writes:
> No, because you're not running the rsync command as the superuser,
> and not using the --owner / --group options.

Thanks, adding --group works, and --owner --super is sufficient to
generate an error when attempting to change the user permissions. I
would suggest that the docs for --chown would do well to mention that
--owner (--super) and --group are needed in order to have the effect
stated in the first sentence.

--chown=USER:GROUP
This option forces all files to be owned by USER with group
GROUP. This is a simpler interface than using --usermap and
--groupmap directly, but it is implemented using those options
internally, so you cannot mix them. If either the USER or GROUP
is empty, no mapping for the omitted user/group will occur. If
GROUP is empty, the trailing colon may be omitted, but if USER is
empty, a leading colon must be supplied.

If you specify "--chown=foo:bar, this is exactly the same as
specifying "--usermap=*:foo --groupmap=*:bar", only easier.
0 new messages