diff options
author | Samba Release Account <samba-bugs@samba.org> | 1996-10-25 20:50:31 +0000 |
---|---|---|
committer | Samba Release Account <samba-bugs@samba.org> | 1996-10-25 20:50:31 +0000 |
commit | 697e46373c8fa7b07234f6611c93cf25fe9733ed (patch) | |
tree | 8b44624e2b7bd75ecac1ab79df7537ac2c6fe03e /source3/smbd | |
parent | 134c804497c24891fd7d75c07086cab131e91af9 (diff) | |
download | samba-697e46373c8fa7b07234f6611c93cf25fe9733ed.tar.gz samba-697e46373c8fa7b07234f6611c93cf25fe9733ed.tar.bz2 samba-697e46373c8fa7b07234f6611c93cf25fe9733ed.zip |
Changed become_user to take a vuid as second arg.
Consistent with other changes to make smb_uid an index+offset
into the validated_users table.
jra@cygnus.com
(This used to be commit 89675f8ae8f136fb587690b137f4413607d30c14)
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/uid.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source3/smbd/uid.c b/source3/smbd/uid.c index f7005b53cf..4fa0ed89da 100644 --- a/source3/smbd/uid.c +++ b/source3/smbd/uid.c @@ -204,13 +204,13 @@ static BOOL check_user_ok(int cnum,user_struct *vuser,int snum) /**************************************************************************** become the user of a connection number ****************************************************************************/ -BOOL become_user(int cnum, int uid) +BOOL become_user(int cnum, uint16 vuid) { - user_struct *vuser; + user_struct *vuser = get_valid_user_struct(vuid); int snum,gid; - int id = uid; + int uid; - if (current_user.cnum == cnum && current_user.id == id) { + if (current_user.cnum == cnum && vuser != 0 && current_user.id == vuser->uid) { DEBUG(4,("Skipping become_user - already user\n")); return(True); } @@ -226,7 +226,7 @@ BOOL become_user(int cnum, int uid) if (Connections[cnum].force_user || lp_security() == SEC_SHARE || - !(vuser = get_valid_user_struct(uid)) || + !(vuser) || (vuser->guest) || !check_user_ok(cnum,vuser,snum)) { uid = Connections[cnum].uid; gid = Connections[cnum].gid; @@ -235,7 +235,7 @@ BOOL become_user(int cnum, int uid) current_user.ngroups = Connections[cnum].ngroups; } else { if (!vuser) { - DEBUG(2,("Invalid vuid used %d\n",uid)); + DEBUG(2,("Invalid vuid used %d\n",vuid)); return(False); } uid = vuser->uid; @@ -266,7 +266,7 @@ BOOL become_user(int cnum, int uid) } current_user.cnum = cnum; - current_user.id = id; + current_user.id = uid; DEBUG(5,("become_user uid=(%d,%d) gid=(%d,%d)\n", getuid(),geteuid(),getgid(),getegid())); |