From 6586062d1a803952d671f145de9373b08721dbb9 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 20 Mar 2002 01:46:40 +0000 Subject: [PATCH] Allow a zero rid in pdb_smbpasswd. When given a zero rid the pdb backend should chose the next available RID. For smbpasswd it just means using the algorithm, but other backends can do somthing more useful. Andrew Bartlett (This used to be commit 0f0f87e6c31b468368c5a4729db892622e616cac) --- source3/passdb/pdb_smbpasswd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source3/passdb/pdb_smbpasswd.c b/source3/passdb/pdb_smbpasswd.c index 6f3886a4b53..89a4217c3b1 100644 --- a/source3/passdb/pdb_smbpasswd.c +++ b/source3/passdb/pdb_smbpasswd.c @@ -1190,10 +1190,12 @@ static BOOL build_smb_pass (struct smb_passwd *smb_pw, const SAM_ACCOUNT *sampas smb_pw->smb_userid_set = False; DEBUG(5,("build_sam_pass: storing user without a UNIX uid or gid. \n")); } else { + uint32 rid = pdb_get_user_rid(sampass); smb_pw->smb_userid_set = True; uid = pdb_get_uid(sampass); - if (uid != pdb_user_rid_to_uid(pdb_get_user_rid(sampass))) { + /* If the user specified a RID, make sure its able to be both stored and retreived */ + if (rid && uid != pdb_user_rid_to_uid(rid)) { DEBUG(0,("build_sam_pass: Failing attempt to store user with non-uid based user RID. \n")); return False; }