Re: setuid rsync

2004-02-26 Thread Wayne Davison
On Thu, Feb 26, 2004 at 07:30:47PM -0600, Daniel S. Cohen wrote:
> Anyone have any ideas why the setuid rsync is not perserving ownership?

Because rsync doesn't realize it is root, so it doesn't try to chown
anything.  Try the CVS version -- I changed it recently to use geteuid()
and getegid() (when available), so it should work fine as a setuid
program.  Your other alternative would be to edit the 2.6.0 code to use
geteuid() instead of getuid().

..wayne..
-- 
To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


setuid rsync

2004-02-26 Thread Daniel S. Cohen
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hello,

I trying to create an automated backup from one machine to the other via
SSH.  I have setup ssh keys and so on, so everything is pretty much
working.  The only thing is, I am trying to perserve file ownership.  I
don't want to use ssh keys w/o a password (for obvious reasons), so I
what I did was this:
I setup a chrooted account called backup (using JAIL), and installed
rsync in the chrooted directory as setuid.  I changed some permissions
at the directory level so only backup has access to this directory (so
non-chrooted users can't access /backup/usr/local/, etc...).  Now, when
I run rsync from the remote server, it logins and creates all the files
with ownership "root" instead of "backup."
I am using rsync 2.6.0 with the following options:

rsync -a -v -e "ssh -l backup" --ignore-errors --delete --numeric-ids
- --link-dest=/backup/yesterday/  :/backup/machine/today/
Anyone have any ideas why the setuid rsync is not perserving ownership?
Any help or suggestions would be greatly appreciated.
Thanks,

Dan

- --
PGP Key: http://machine.technocraft.com/~dsc/pgpkey.html
- --
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFAPp3H4CrJ04+9SNURAhAlAJ9/uqPWNJVuW/6GyFYZcSGcexmI7ACfZ+wU
WM+defub6nIR2t3TjIVV/uU=
=GAFT
-END PGP SIGNATURE-
--
To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html