diff options
author | Andrew Bartlett <abartlet@samba.org> | 2002-01-23 12:59:24 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2002-01-23 12:59:24 +0000 |
commit | 158efc3aa2060e21f40e231a1e8aa945b6a3ab71 (patch) | |
tree | 3d40e855783ac527f14c92ac64dcd96647267fab /source3/lib | |
parent | 44dd648a646e58ad69f250dcd23fe56d7885efd2 (diff) | |
download | samba-158efc3aa2060e21f40e231a1e8aa945b6a3ab71.tar.gz samba-158efc3aa2060e21f40e231a1e8aa945b6a3ab71.tar.bz2 samba-158efc3aa2060e21f40e231a1e8aa945b6a3ab71.zip |
getpwnam -> getpwnam_alloc.
idra has promised not to revert these this time :-)
(This used to be commit f556ad67e82518f5a024ffe9184ff9430ab5c541)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/genrand.c | 3 | ||||
-rw-r--r-- | source3/lib/util.c | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/source3/lib/genrand.c b/source3/lib/genrand.c index 39e56db960..4a56235c3d 100644 --- a/source3/lib/genrand.c +++ b/source3/lib/genrand.c @@ -158,13 +158,14 @@ static int do_reseed(BOOL use_fd, int fd) * seriously this will be secret. */ - pw = sys_getpwnam("root"); + pw = getpwnam_alloc("root"); if (pw && pw->pw_passwd) { size_t i; unsigned char md4_tmp[16]; mdfour(md4_tmp, (unsigned char *)pw->pw_passwd, strlen(pw->pw_passwd)); for (i=0;i<16;i++) seed_inbuf[8+i] ^= md4_tmp[i]; + passwd_free(&pw); } /* diff --git a/source3/lib/util.c b/source3/lib/util.c index f598f0aaa4..97ff4e24a0 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -1091,9 +1091,11 @@ uid_t nametouid(char *name) if (winbind_nametouid(&u, name)) return u; - pass = sys_getpwnam(name); - if (pass) + pass = getpwnam_alloc(name); + if (pass) { return(pass->pw_uid); + passwd_free(&pass); + } return (uid_t)-1; } |