pwdb_smb_map_names() and user_rid.

Steven Jones noyd at u.washington.edu
Wed May 26 19:09:08 GMT 1999


I'm trying to add some accounts to a Samba server built with the
"mysql" password database.  The version of Samba I have I got with
CVS about two weeks ago.

When adding an account (utils/smbpasswd.c), the function
"pwdb_smb_map_names()" is called in passdb.c prior to the lower level
database routine.

BOOL add_smbpwd_entry(struct smb_passwd *newpwd)
{
        return pwdb_ops->add_smbpwd_entry(pwdb_smb_map_names(newpwd));
}

The pwdb_smb_map_names() function is documented:

/*************************************************************
 fills in missing details.  one set of details _must_ exist.
 **************************************************************/
struct smb_passwd *pwdb_smb_map_names(struct smb_passwd *smb)

and the code in that routine goes on to set fields in the 
smb_passwd structure.  One thing it sets is:

        if (smb->user_rid  == 0xffffffff) 
		sid_split_rid(&gmep.sid,&smb->user_rid);

where "gmep" has been set thru calls to functions in lib/domain_namemap.c.


Looking at the code in the "ldap.c" module, I see that the 
code there allocates a new user_rid and ignores what was passed 
in to it.  The "mysql" code is respecting the "user_sid" it gets
from pwdb_smb_map_names() function.  

It seems to me that the "user_sid" should be assigned by a function
in the lower level database, not in  lib/domain_namemap.c.  
The place invoke such a call appears to me to be in the
add_smbpwd_entry() function prior to calling pwdb_smb_map_names().
That however would probably upset the assumptions in
the pwdb_smb_map_names() function.


--
  Steven Jones
  Computing & Communications 354843,  University of Washington
  E-mail:  noyd at u.washington.edu    Phone:  (206) 543-5852



More information about the samba-ntdom mailing list