summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2002-01-21 02:51:23 +0000
committerAndrew Bartlett <abartlet@samba.org>2002-01-21 02:51:23 +0000
commit3723171ea652650f7b89aa76efdf12b15bba9774 (patch)
tree150e5a10eeba538f703564051ab4f2cf67b80290 /source3/passdb
parente1793bde612c499d08c6ecb9fdecb630a9cdf04d (diff)
downloadsamba-3723171ea652650f7b89aa76efdf12b15bba9774.tar.gz
samba-3723171ea652650f7b89aa76efdf12b15bba9774.tar.bz2
samba-3723171ea652650f7b89aa76efdf12b15bba9774.zip
getpwnam -> getpwnam_alloc
(This used to be commit 59905d44e51d83f2d4a7b6844e0ae764e0b35c0c)
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/pdb_tdb.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source3/passdb/pdb_tdb.c b/source3/passdb/pdb_tdb.c
index e05a9066cd..3d3b620f50 100644
--- a/source3/passdb/pdb_tdb.c
+++ b/source3/passdb/pdb_tdb.c
@@ -140,8 +140,8 @@ static BOOL init_sam_from_buffer (struct tdbsam_privates *tdb_state,
* getpwnam() is used instead of Get_Pwnam() as we do not need
* to try case permutations
*/
- if (!username || !(pw=getpwnam(username))) {
- DEBUG(0,("tdb_sam: getpwnam(%s) return NULL. User does not exist!\n",
+ if (!username || !(pw=getpwnam_alloc(username))) {
+ DEBUG(0,("tdb_sam: getpwnam_alloc(%s) return NULL. User does not exist!\n",
username?username:"NULL"));
ret = False;
goto done;
@@ -149,6 +149,7 @@ static BOOL init_sam_from_buffer (struct tdbsam_privates *tdb_state,
pdb_set_uid(sampass, pw->pw_uid);
gid = pw->pw_gid;
pdb_set_gid(sampass, gid);
+ passwd_free(&pw);
}
pdb_set_logon_time(sampass, logon_time);