Re: Ownership
How can I check whether rsync uses /etc/nsswitch.conf or not? I'd suggest finding a Linux forum to ask that question (and first googling to see if the answer is already out there). I'd also suggest creating a simple test program that just tries to lookup testuser using getpwnam() (you could easily tweak the code I sent in a message just recently as a good start for such a program). Try running that, ensure that it fails in a similar manner, and then look for information on getting that test program to work. It seems to work correctly (warning, ugly piece of code ahead): #- #include stdio.h #include stdlib.h #include pwd.h #include sys/types.h int main(void) { char name[9] = testuser\0 ; uid_t *uid; struct passwd *pass; pass = getpwnam(name); if (pass) { *uid = pass-pw_uid; fprintf(stderr,Lookup of `%s' returned %ld\n,name,(long)*uid); return 1; } fprintf(stderr,Lookup of `%s' failed\n,name); return 0; } #- ./name2uid Lookup of `testuser' returned 1 -- To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Re: Ownership
I just thought of something else that I should have thought of earlier: if you're using a chroot=yes setup for an rsync daemon, you must put the appropriate files into the chroot area for rsync to do any mapping of UIDs and GIDs (as explained in the man rsyncd.conf manpage). For instance, create an etc subdir and put a (possibly stripped down) passwd and group file into it and see if that fixes the problem. If so, you can add an exclude = /etc config item to that module so that users can't copy those files. No, I'm not fond of chrooting (well, at least until every thing else is working...). -- To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Re: Ownership
All I get running with - is the gid... That is because rsync doesn't believe that it is root. I think I should modify rsync so that it outputs the uid when it is the sender even when it is not root. What your output doesn't show is what the receiver thinks the uid is (which will show if it believes it is root). This is because the receiver is a daemon, and it restricts how verbose it can get (since it logs its output into a log file it doesn't want users to be able to overflow the log files with large amounts of debugging info). There is an undocumented setting in the rsyncd.conf file called max verbosity that you can try setting to 9 and then re-run rsync. The daemon's log file should then contain what it knows about the file list. (Aside: the max verbosity setting is currently undocumented because it was supposed to be a very temporary debugging helper that was going to be superseded by a flexible logging configuration that J.W. was going to be working on, but no progress has been made in that area, alas). With this setting, I get this, both in the dameon's log and on the client output: ... uid 11385(testuser) maps to 11385 gid 10513(mkgroup_l_d) maps to 10513 [receiver] i=0 NULL NULL testdir mode=040777 len=0 uid=11385 gid=10513 [receiver] i=1 NULL testdir test.txt mode=0100777 len=4 uid=11385 gid=10513 ... set uid of testdir from 0 to 11385 set gid of testdir from 0 to 10513 ... set uid of testdir/.test.txt.IGJ6dO from 0 to 11385 set gid of testdir/.test.txt.IGJ6dO from 0 to 10513 renaming testdir/.test.txt.IGJ6dO to testdir/test.txt ... Reminder : On the client side, under cygwin : ls -l = testdir owned by testuser:mkgroup_ ls -ln = testdir owned by 11385:10513 On the server side, under linux: gentent passwd | grep testuser testuser:x:1:1:testuser:/home/DOMAIN/testuser:/bin/false Does the client side send 11385 or testuser? Or both? Which one of the client/server does the mapping? And why does testuser end up on beeing mapped to 11385 on the server side? -- To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Re: Ownership
On Thu, Sep 09, 2004 at 11:46:48AM +0200, Essyug wrote: Why does the rsync running on the client must be root ? It just has to send the name of the owner of the file to the server which will chown it. I misread it as the receiver at first glance, thus the confusion. You're right that the sender doesn't need to be root. However, this topic split into a parallel topic of allowing a receiving rsync on cygwin to be able to chown files in order to try to solve that deficiency. OK. Anyway, have I correctly understood the way rsync should work? i.e. send the string 'testuser' as the owner instead of 11385? If yes, what have I done wrong? Thanks ! -- To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Re: Ownership
Rsync seems to work as if I had used the --numeric-ids If rsync doesn't find a username match, it will fall-back to using the ID directly, so I would assume that the problem is that the ID names on your cygwin system aren't matching the ID names on your linux system (and perhaps they aren't what you think). On the client side, under cygwin : ls -l = testdir owned by testuser:mkgroup_ ls -ln = testdir owned by 11385:10513 On the server side, under linux, with winbind running with winbind use default domain = yes, a directory on which I run chown testuser: dir becomes: ls -l = directory owned by testuser:'Domain user' (group translated from French) ls -ln = directory owned by 1:1 Knowing that gentent passwd | grep testuser shows: testuser:x:1:1:testuser:/home/DOMAIN/testuser:/bin/false When I set winbind use default domain = no, I get th following: DOMAIN\testuser:x:1:1:testuser:/home/DOMAIN/testuser:/bin/false But, in both case, after a rsync -avP testdir $BACKUPSERVER::backuptest I get testdir owned by 11385:10513, which are unknow user/group on the server. I had originally misread your question as one wanting to get the cygwin rsync to set ownership of the files. Towards this goal, I think we need a better am I root check for cygwin. The attached patch attempts to provide this. Is anyone familiar enough with cygwin to be able to comment on the appropriateness of this idiom? Why does the rsync running on the client must be root ? It just has to send the name of the owner of the file to the server which will chown it. And my server is running as root on the linux machine. Thank you for the time you already spent on my problem ! -- To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Ownership
Hello, I'm setting up a Linux backup server for Windows Workstations, using rsync-2.6.3pre1+acl on the server and cygwin rsync-2.6.2-2 on the Workstations. At this point, I don't care about perserving the acls ; I only want to preserve the ownership of the files. My server is running in daemon mode as root, and winbindd (from samba 3.0.6) is running correctly : I can get all the users entries from my W2k PDC with gentent passwd, their uid beeing mapped to the 1-2 range. Here is my /etc/rsyncd.conf file : [backup] path = /backuptest uid = root gid = root read only = false My test directory on W2k and all its content are owned by DOMAIN\testuser, which is a domain administrator. When I run the following command under cygwin: rsync -avP testdir $BACKUPserver::backuptest ... the directory is owned by 544:root on the Linux server. Samba shows the owner as S-12345-etc. I've tried --numeric-ids with exactly the same result. This is annoying since a would like to use quota on the backup partition. Is there any way to work aroubnd this problem ? -- To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html