summaryrefslogtreecommitdiff
path: root/source3/lib/util.c
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>1999-06-13 04:14:24 +0000
committerTim Potter <tpot@samba.org>1999-06-13 04:14:24 +0000
commit731c7f2ecfe17651506ba05b88358360e4654a37 (patch)
tree57213f534b2bf1c8f53994a14884abbebfefde47 /source3/lib/util.c
parenteaa085e8a7106d595235b36d1592ca38b47ba53f (diff)
downloadsamba-731c7f2ecfe17651506ba05b88358360e4654a37.tar.gz
samba-731c7f2ecfe17651506ba05b88358360e4654a37.tar.bz2
samba-731c7f2ecfe17651506ba05b88358360e4654a37.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. (This used to be commit 36d7cb4ccc42268e8e6a7b783c945d1853624958)
Diffstat (limited to 'source3/lib/util.c')
-rw-r--r--source3/lib/util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index d1519cd8d2..3211c6687a 100644
--- a/source3/lib/util.c
+++ b/source3/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;