[patch] Samba 2.09: /etc/passwd.samba instead of /etc/passwd

Mayers, Philip J p.mayers at ic.ac.uk
Tue May 29 16:14:28 GMT 2001

No, not correct - Samba needs every user in /etc/smbpasswd to respond to a
getpwuid/getpwnam call (which I'll grant you is usually /etc/passwd on most
systems' defaults). This is so Samba knows which UID to setuid to, in order
for the in-kernel security mechanisms to work.

If you're just doing a read-only share, you can map the usernames to a
single username, and be done with it. If you're doing a write share - why
you'd want them to all have the same UID is beyond me, but you can do the
same trick.

This patch is nasty. See "man smb.conf" and the "username map" parameter.
How is this different from what you are proposing?


| Phil Mayers, Network Support     |
| Centre for Computing Services    |
| Imperial College                 |

-----Original Message-----
From: Thomas Jarosch [mailto:thomas.jarosch at styletec.de]
Sent: 29 May 2001 17:02
To: Gerald Carter
Cc: samba-technical at samba.org
Subject: Re: [patch] Samba 2.09: /etc/passwd.samba instead of

> > I've developed a short, dirty patch for Samba 2.09
> > that allows me to have a separate /etc/passwd for Samba.
> > (and so allows me to have virtual users running under 
> > the UID of "nobody")
> I don't understand.  Could you provide more explanation
> of why this patch would be necessary?  Why not just use
> a username map and distiguish between %U and %u?

The problem is quite simple:

Samba needs for every entry in /etc/smbpasswd 
a corresponding entry in /etc/passwd.

But I didn't want to use my system's /etc/passwd for Samba,
so I've made a patch to redirect samba to /etc/passwd.samba


More information about the samba-technical mailing list