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 | 731c7f2ecfe17651506ba05b88358360e4654a37 (patch) | |
tree | 57213f534b2bf1c8f53994a14884abbebfefde47 /source3/smbd | |
parent | eaa085e8a7106d595235b36d1592ca38b47ba53f (diff) | |
download | samba-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/smbd')
-rw-r--r-- | source3/smbd/chgpasswd.c | 2 | ||||
-rw-r--r-- | source3/smbd/password.c | 4 | ||||
-rw-r--r-- | source3/smbd/reply.c | 2 | ||||
-rw-r--r-- | source3/smbd/service.c | 2 | ||||
-rw-r--r-- | source3/smbd/uid.c | 2 |
5 files changed, 6 insertions, 6 deletions
diff --git a/source3/smbd/chgpasswd.c b/source3/smbd/chgpasswd.c index 734f72c08d..f84ae0ccb5 100644 --- a/source3/smbd/chgpasswd.c +++ b/source3/smbd/chgpasswd.c @@ -110,7 +110,7 @@ static int dochild(int master,char *slavedev, char *name, char *passwordprogram, { int slave; struct termios stermios; - struct passwd *pass = Get_Pwnam(name,True); + const struct passwd *pass = Get_Pwnam(name,True); int gid; int uid; diff --git a/source3/smbd/password.c b/source3/smbd/password.c index daead8bb82..c05b82ef15 100644 --- a/source3/smbd/password.c +++ b/source3/smbd/password.c @@ -415,7 +415,7 @@ BOOL pass_check_smb(char *user, char *domain, uchar *chal, uchar *lm_pwd, uchar *nt_pwd, struct passwd *pwd, uchar user_sess_key[16]) { - struct passwd *pass; + const struct passwd *pass; struct smb_passwd *smb_pass; if (!lm_pwd || !nt_pwd) @@ -877,7 +877,7 @@ BOOL check_hosts_equiv(char *user) { char *fname = NULL; pstring rhostsfile; - struct passwd *pass = Get_Pwnam(user,True); + const struct passwd *pass = Get_Pwnam(user,True); if (!pass) return(False); diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index b20236d6f4..faf9c051d2 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -774,7 +774,7 @@ int reply_sesssetup_and_X(connection_struct *conn, char *inbuf,char *outbuf,int user we should become. */ { - struct passwd *pw = Get_Pwnam(user,False); + const struct passwd *pw = Get_Pwnam(user,False); if (!pw) { DEBUG(1,("Username %s is invalid on this system\n",user)); return(ERROR(ERRSRV,ERRbadpw)); diff --git a/source3/smbd/service.c b/source3/smbd/service.c index 7628f9c8f0..becfd01504 100644 --- a/source3/smbd/service.c +++ b/source3/smbd/service.c @@ -194,7 +194,7 @@ int find_service(char *service) connection_struct *make_connection(char *service,char *user,char *password, int pwlen, char *dev,uint16 vuid, int *ecode) { int snum; - struct passwd *pass = NULL; + const struct passwd *pass = NULL; BOOL guest = False; BOOL force = False; extern int Client; diff --git a/source3/smbd/uid.c b/source3/smbd/uid.c index b2407ed5fc..92565b7507 100644 --- a/source3/smbd/uid.c +++ b/source3/smbd/uid.c @@ -163,7 +163,7 @@ become the guest user BOOL become_guest(void) { BOOL ret; - static struct passwd *pass=NULL; + static const struct passwd *pass=NULL; if (initial_uid != 0) return(True); |