diff options
author | Tim Potter <tpot@samba.org> | 1999-06-13 04:14:24 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 1999-06-13 04:14:24 +0000 |
commit | 36d7cb4ccc42268e8e6a7b783c945d1853624958 (patch) | |
tree | c88a5771d7d903fca6dee44422122298b9adaff3 /source/lib/util.c | |
parent | afe5be3cf62b90100861e2433ea885f5d6f8708c (diff) | |
download | samba-36d7cb4ccc42268e8e6a7b783c945d1853624958.tar.gz samba-36d7cb4ccc42268e8e6a7b783c945d1853624958.tar.xz samba-36d7cb4ccc42268e8e6a7b783c945d1853624958.zip |
Moved code that changes the pw_passwd entry (i.e shadow password and
weird unixware stuff) into _Get_Pwnam() to fix a memory allocation bug.
Note that the Get_Pwnam() function now returns a const struct passwd *
as a hint to other developers not to change entries in the struct
passwd.
Diffstat (limited to 'source/lib/util.c')
-rw-r--r-- | source/lib/util.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/lib/util.c b/source/lib/util.c index d1519cd8d23..3211c6687ad 100644 --- a/source/lib/util.c +++ b/source/lib/util.c @@ -2125,7 +2125,7 @@ void standard_sub_basic(char *str) { char *s, *p; char pidstr[10]; - struct passwd *pass; + const struct passwd *pass; char *username = sam_logon_in_ssb ? samlogon_user : sesssetup_user; for (s = str ; s && *s && (p = strchr(s,'%')); s = p ) @@ -2498,7 +2498,7 @@ turn a user name into a uid ********************************************************************/ BOOL nametouid(const char *name, uid_t *uid) { - struct passwd *pass = Get_Pwnam((char *)name, False); + const struct passwd *pass = Get_Pwnam((char *)name, False); if (pass) { *uid = pass->pw_uid; |