Problem with GID being set to UID for Samba 2.2.2

Patrick Reid p.j.reid at
Wed Nov 7 09:34:02 GMT 2001

I wonder if this is at all similar to the problem I have been having. Ever
since I changed a Linux user name by hand-editing /etc/passwd, /etc/shadow
and smbpasswd, my Samba install has been unable to resolve user names in the
list it provides to a Windows 2000 client when that client is changing
access permissions on one of its directories to RID (unless that user has
logged on to that machine before).

This has stayed a problem through an upgrade from 2.2.1a to 2.2.2. I have
been unable to figure it out and am considering completely nuking my Samba
installation and restarting from scratch (youch).

So keep me posted on your efforts; maybe your solution will also work for


-----Original Message-----
From: samba-admin at [mailto:samba-admin at]On
Behalf Of Indulis Bernsteins
Sent: November 7, 2001 5:15 AM
To: samba at
Subject: Problem with GID being set to UID for Samba 2.2.2
Importance: High

Tony- thanks for the quick reply, but it probably doesn't solve the problem
(I will try the force group=users tonight at home but that still won't
explain where samba is getting nonexistent gid of 501 from..  501 is not a
group in my /etc/group file!)

>On Wed, 7 Nov 2001, Indulis Bernsteins wrote:

>> indulis:x:500:500:Indulis Bernsteins:/home/indulis:/bin/bash
>> pbabern:x:501:502::/home/pbabern:/bin/bash
              ^^^^^ This is why the GID is being set.  Thats what its
>to do :)

The GID should be set by Samba to 502 not 501, and it is being set to 501 in
samba according to the logs.

>If you want to set a users primary group do it in /etc/passwd.  secondary
>groups are done in /etc/group

Yep understand & agree... but if you look at the "ls" output which I
attached, you can see that the uid:gid for "New Folder" created by pbabern
as a samba client has an owner:gid of pbabern:501 *NOT* 502!!! (i.e. group
501 is not recognised by the system, & as it is not in /etc/group it doesn't
print a group name!).  Here is the "ls" again

total 3
drwxr-xr-x    2 pbabern  501          1024 Nov  4 18:05 Desktop
drwxr-xr-x    2 pbabern  501          1024 Nov  7 11:34 New Folder
drwxr-xr-x    2 pbabern  user         1024 Nov  7 11:40 smb_prob
-rw-r--r--    1 pbabern  user            0 Nov  7 11:42 unix_touch

...and from the sbmd log file
smbd/uid.c:become_user(201)  become_user uid=(0,501) gid=(0,501)

^^^               ^^^     should be 502 according to /etc/passwd

I created "New Folder" after I had deleted group 501, changed user pbabern
to be in primary group 502 (as per the /etc/passwd), and kicked xinetd in
the HUPs to force a daemon refresh (JIC).

unix_touch was created after "New Folder", by Linux root after su - pbabern,
then touch unix_touch.  I don't understand where 501 is coming from, gid=502
is what I *want* it to do! Is there anything that samba does that would
cause it to cache gid=501 for user pbabern?

I can bodge my ownerships on the directories to make it work, but I'm trying
to understand where samba is getting gid=501 from, when group 501 has been
exterminated from the system.  An interesting puzzle!


(in Perth)

PS maybe it is the Jean Genie... the so-called "Bowie Effect"?
PPS wanted to do a better joke tying together disintegration of group 501,
the bugs bunny martian, spiders from mars, and 501 jeans but at this time of
the day I'm witted out

More information about the samba mailing list