Security Identifier (SID) to User Identifier (uid) ResolutionSystem

Nicolas Williams Nicolas.Williams at
Tue Dec 28 20:30:58 GMT 1999

On Wed, Dec 29, 1999 at 07:13:52AM +1100, Luke Kenneth Casson Leighton wrote:
> On Tue, 28 Dec 1999, Jeremy Allison wrote:
> > Luke Kenneth Casson Leighton wrote:
> > > 2) multiple samba servers as members of the same domain need
> > > same-user-name-same-smbpasswd locally on each server, and they _still_
> > > produce different SIDs for the same damn username, which i am sure is a
> > > security risk, i just can't think it through clearly, it's that brain-dead
> > > and complicated an issue.
> > 
> > They create different SIDs because they are *DIFFERENT USERS*. 
> if they are different users, then they should be in private/smbpasswd, not
> verified against the PDC.
> my question is, therefore, what the heck are we thinking, and what was it
> again that we were smoking when we discussed this fifteen months ago,
> jeremy?

While you know from the session setup the NT username's SID, as well as
the equivalent Unix username and UID and thus you can map that uid to
the NT username's SID, you can't do this for any other uids (or gids)
that you run into. Having a Unix username->NT username map as well as a
Unix groupname->NT groupname map would help. That's what you're
proposing. Incidentally, PAM_NTDOM needs such Unix->NT username map, so
if you use Samba and PAM_NTDOM you've got a Unix->NT map and an NT->Unix
map; but Samba won't use the Unix->NT map as of right now.

> if this were to be implemented, how would we create ACLs to distinguish a
> local user login (SID of local user = S-1-5-localsmbpasswd) from a remote
> user login (SID of remote user = S-1-5-passwordserver=someserver with
> security=domain set), when the algorithmic function we are using can only
> deal with one SID?

Hey, remember, you can't store SIDs in any *nix filesystem as of yet. So
how could you store a SID on a *nix file ACL then? You have to map the
SID to a UID/GID. If this mapping is not reversible things work, but
they look strange.

(Yes, there are some read-only NTFS drivers for FreeBSD).

> > If this is a security hole then NT security is *completely*
> > broken (hint. It's not :-).
> NT doesn't authenticate users against the remote PDC's SAM and then
> generate ACLs for those users from its local SAM database, which is what
> is implemented _right now_ in 2.0.X with "security = domain".
> this is what i am objecting to, more than anything else, and it's all due
> to the use of the pdb_group_rid_to_gid() etc functions.

Yes. I object to it as well, but only because there's a semantic
inconsistency and it's visible to users. But it does work as it stands.
Which is why I think you should make the uid/gid<->SID mapping

> luke

-DISCLAIMER: an automatically appended disclaimer may follow. By posting-
-to a public e-mail mailing list I hereby grant permission to distribute-
-and copy this message.-

This message contains confidential information and is intended only 
for the individual named.  If you are not the named addressee you 
should not disseminate, distribute or copy this e-mail.  Please 
notify the sender immediately by e-mail if you have received this 
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free 
as information could be intercepted, corrupted, lost, destroyed, 
arrive late or incomplete, or contain viruses.  The sender therefore 
does not accept liability for any errors or omissions in the contents 
of this message which arise as a result of e-mail transmission.  If 
verification is required please request a hard-copy version.  This 
message is provided for informational purposes and should not be 
construed as a solicitation or offer to buy or sell any securities or 
related financial instruments.

More information about the samba-technical mailing list