From 98010a076797f4d05d8c9bff45e65c076f30da3a Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Sun, 30 Dec 2001 00:03:47 +0000 Subject: pdb_getsampwnuid() merge from 2.2 (This used to be commit 54cbfc7ebcdf1bd2094407b689b0050f0abfa46f) --- source3/passdb/pdb_smbpasswd.c | 42 ------------------------------------------ 1 file changed, 42 deletions(-) (limited to 'source3/passdb/pdb_smbpasswd.c') diff --git a/source3/passdb/pdb_smbpasswd.c b/source3/passdb/pdb_smbpasswd.c index 8e942a60fb..e82e94dae5 100644 --- a/source3/passdb/pdb_smbpasswd.c +++ b/source3/passdb/pdb_smbpasswd.c @@ -1418,48 +1418,6 @@ BOOL pdb_getsampwnam(SAM_ACCOUNT *sam_acct, const char *username) } -BOOL pdb_getsampwuid (SAM_ACCOUNT *sam_acct, uid_t uid) -{ - struct smb_passwd *smb_pw; - void *fp = NULL; - - DEBUG(10, ("pdb_getsampwuid: search by uid: %d\n", (int)uid)); - - /* Open the sam password file - not for update. */ - fp = startsmbfilepwent(lp_smb_passwd_file(), PWF_READ, &pw_file_lock_depth); - - if (fp == NULL) { - DEBUG(0, ("unable to open passdb database.\n")); - return False; - } - - while ( ((smb_pw=getsmbfilepwent(fp)) != NULL) && (smb_pw->smb_userid != uid) ) - /* do nothing */ ; - - endsmbfilepwent(fp, &pw_file_lock_depth); - - /* did we locate the username in smbpasswd */ - if (smb_pw == NULL) - return False; - - DEBUG(10, ("pdb_getsampwuid: found by name: %s\n", smb_pw->smb_name)); - - if (!sam_acct) { - DEBUG(10,("pdb_getsampwuid:SAM_ACCOUNT is NULL\n")); -#if 0 - smb_panic("NULL pointer passed to pdb_getsampwuid\n"); -#endif - return False; - } - - /* now build the SAM_ACCOUNT */ - if (!build_sam_account(sam_acct, smb_pw)) - return False; - - /* success */ - return True; -} - BOOL pdb_getsampwrid(SAM_ACCOUNT *sam_acct,uint32 rid) { struct smb_passwd *smb_pw; -- cgit