From a2bddb20ed078c3e1b9cb60a7420b3d107898f52 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 6 May 1998 01:34:51 +0000 Subject: Fixes for the %U and %G problems people have reported. Essentially, multiple session_setup_and_X's may be done to an smbd. As there is only one global variable containing the requested connection name (sessionsetup_user), then any subsequent sessionsetups overwrite this name (causing %U and %G to get the wrong name). This is particularly common when an NT client does a null session setup to get a browse list after the user has connected, but before a share has been mounted. These changes store the requested_name in the vuid structure (so this only really works for user level and above security) and copies this name back into the global variable before the standard_sub call. Jeremy. (This used to be commit b5187ad6a3b3af9fbbeee8bced0ab16b41e9825b) --- source3/include/proto.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/include/proto.h') diff --git a/source3/include/proto.h b/source3/include/proto.h index 639817c049..9c0de0024f 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1554,7 +1554,7 @@ char *validated_username(uint16 vuid); int setup_groups(char *user, int uid, int gid, int *p_ngroups, int **p_igroups, gid_t **p_groups, int **p_attrs); -uint16 register_vuid(int uid,int gid, char *name,BOOL guest); +uint16 register_vuid(int uid,int gid, char *unix_name, char *requested_name, BOOL guest); void add_session_user(char *user); BOOL update_smbpassword_file( char *user, fstring password); void dfs_unlogin(void); @@ -1726,7 +1726,7 @@ int reply_lanman2(char *outbuf); int reply_nt1(char *outbuf); void close_cnum(int cnum, uint16 vuid); void exit_server(char *reason); -void standard_sub(int cnum,char *str); +void standard_sub(int cnum,char *str,uint16 vuid); char *smb_fn_name(int type); int chain_reply(char *inbuf,char *outbuf,int size,int bufsize); int construct_reply(char *inbuf,char *outbuf,int size,int bufsize); -- cgit