public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* 'rsync -a' not preserving ownership
@ 2022-01-03 16:17 cygwin
  2022-01-04  5:23 ` Wayne Davison
  0 siblings, 1 reply; 2+ messages in thread
From: cygwin @ 2022-01-03 16:17 UTC (permalink / raw)
  To: cygwin

I am running cygwin as Administrator and tried this under both Win7
and Win10.

# touch test
# chown Administrators.SYSTEM test
# rsync -a test test2
# cp -a test test3
# ls -al test*
-rw-r--r-- 1 Administrators SYSTEM 0 Jan  3 11:00 test
-rw-r--r-- 1 myname         None   0 Jan  3 11:00 test2
-rw-r--r-- 1 Administrators SYSTEM 0 Jan  3 11:00 test3

Note that perms are copied properly (which I validated by trying with
other perm combos)

So, why is 'cp -a' able to preserve ownership while 'rsync -a' fails
and sets ownership to the login name?




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: 'rsync -a' not preserving ownership
  2022-01-03 16:17 'rsync -a' not preserving ownership cygwin
@ 2022-01-04  5:23 ` Wayne Davison
  0 siblings, 0 replies; 2+ messages in thread
From: Wayne Davison @ 2022-01-04  5:23 UTC (permalink / raw)
  To: cygwin; +Cc: cygwin

On Mon, Jan 3, 2022 at 8:17 AM <cygwin@kosowsky.org> wrote:
> So, why is 'cp -a' able to preserve ownership while 'rsync -a' fails
> and sets ownership to the login name?

Rsync is rather old-school Unix-oriented, so it only checks if its uid
is 0 to see if it should try to chown things.  You can give it the
--super option to tell it to try root things when you're a non-0 user,
which works in my testing.

..wayne..

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-04  5:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-03 16:17 'rsync -a' not preserving ownership cygwin
2022-01-04  5:23 ` Wayne Davison

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).