[Samba] UID translation mystery or Festivus miracle?

Patrick Goetz pgoetz at math.utexas.edu
Wed Dec 22 16:49:39 UTC 2021


I'm guessing this is an rsync thing I wasn't aware of, but I've gotten 
useful tips from the rsync therapists on this list before.

I'm transferring data from an old Samba PDC system to a new Samba 4.15.3 
file server bound to a samba-ad-dc using the RID id mapping.  All the 
user ID's are changing as as result, so I was preparing to write a 
script to translate the file/directory owner uids/gids when I noticed 
something really odd.

On the old PDC/fileserver:

root at data:home# id pgoetz
uid=1004(pgoetz) gid=1004(pgoetz) 
groups=1004(pgoetz),27(sudo),100(users),5005(gco)

root at data:home# ls -ld pgoetz
drwxr-xr-x 10 pgoetz pgoetz 4096 Dec 10 06:20 pgoetz


Rsync the data over to the new file server:

root at data:/# cd home
root at data:home# rsync -axW * data2:/data/home-old/


And now on the new fileserver:

archives at data2:/data/home-old$ id pgoetz
uid=11103(pgoetz) gid=10513(domain users) groups=10513(domain 
users),11103(pgoetz),11112(ea-staff),11113(ea-admins),3001(BUILTIN\users)

archives at data2:/data/home-old$ ls -ld pgoetz
drwxr-xr-x 10 pgoetz pgoetz 4096 Dec 10 06:20 pgoetz

----

I'm only showing my home folder, but for every user account created in 
the new domain, the transferred files already have the correct file 
ownership on the new system.

My best guess is rsync is using the username to convert the UIDs?

A secondary mystery is that my group is still "pgoetz" even though there 
is no such group defined in the domain.  How does that work?



More information about the samba mailing list