uid to RID mapping

Luke Kenneth Casson Leighton lkcl at switchboard.net
Fri Dec 4 16:33:43 GMT 1998

On Fri, 4 Dec 1998, Matt Chapman wrote:

> Luke,
> Looks to me like you've taken out pwdb_uid_to_user_rid and you are
> trying to use rid = 0xFFFFFFFF to mean unassigned?

> The problem is that add_new_user doesn't set the rid, so users added
> with smbpasswd will never be assigned rids - we need to do the uid->rid
> mapping there.

choice number 1)

no rid field (one a per-entry basis) in your database,leave it as it is
(unassigned, which pwdb_init_sam() and pwdb_init_smb() will do for you).  
then in pwdb_sam_names() and pwdb_smb_names() all unassigned fields will
be resolved.

choice number 2)

rid field (on a per-entry basis), read it in.  pwdb_sam_names() and
pwdb_smb_names will notice that is's assigned, and leave it alone.

if ldap (or any other database) does not allow "optional" fields like
this, then that leaves us with no alternative but to call
pwdb_unixid_to_sam_sid() which *AT THE MOMENT* does a mathematical
mapping.  DO NOT use this function for any SAM database for which samba is
not responsible, i.e if the sid != global_sam_sid, or if you already have
a uid/user-rid or gid/group-rid pair, DON'T call pwdb_unixid_to_sam_sid()
or pwdb_sam_sid_to_unixid(), ok?

basically, there's lots of stufff that will simply fall into place if you
follow the data paths correctly.


More information about the samba-technical mailing list