Samba: pdbedit reports wrong user id

sambauid

I have problem to localize the source of this error. I tried to google it out but couldn't find anything useful.

I have noticed that samba and the system using for some, but not for all, users different UIDs. Most of them are the same. Some as shown below are not.

grep billew /etc/passwd 
billew:x:596:100:Name Family:/home/billew:/bin/nologin

However:

pdbedit -e smbpasswd:/tmp/samba-users.backup | grep billew
getsmbfilepwent: returning passwd entry for user billew, uid 6

It happens for all the users that have UID higher than 589.
Can somebody explain this to me?

p.s. I'm using samba-3.5.10-125

Best Answer

Samba 3.x uses an algorithm to calculate RID and vice versa (see: http://www.samba.org/samba/docs/man/manpages-3/idmap_rid.8.html). This algorithm is based on uid and gid base. uid and gid base are parameters defined in your smb.conf (idmap uid, idmap gid).

An answer can be that during the time your smb.conf is changed, another answer can be that your server comes from samba v.2.x (uid/gid - RID algorithm is changed between v.2 and v.3)