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 | 89675f8ae8f136fb587690b137f4413607d30c14 (patch) | |
tree | a7207afd326b8fd084f8aac2b60cbd2dde29c7ed /source | |
parent | 555f6cda319559ebcb0b566f7f4042cf6a734e01 (diff) | |
download | samba-89675f8ae8f136fb587690b137f4413607d30c14.tar.gz samba-89675f8ae8f136fb587690b137f4413607d30c14.tar.xz samba-89675f8ae8f136fb587690b137f4413607d30c14.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
Diffstat (limited to 'source')
-rw-r--r-- | source/smbd/uid.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/smbd/uid.c b/source/smbd/uid.c index f7005b53cf2..4fa0ed89da7 100644 --- a/source/smbd/uid.c +++ b/source/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())); |