summaryrefslogtreecommitdiff
path: root/source3/include
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-05-06 01:34:51 +0000
committerJeremy Allison <jra@samba.org>1998-05-06 01:34:51 +0000
commita2bddb20ed078c3e1b9cb60a7420b3d107898f52 (patch)
tree4d79e33ce1cb534d287aa9ccbe8e6c10aa0ceb9b /source3/include
parent19f76f391b97b405879fd8574e711a6d59e4e60c (diff)
downloadsamba-a2bddb20ed078c3e1b9cb60a7420b3d107898f52.tar.gz
samba-a2bddb20ed078c3e1b9cb60a7420b3d107898f52.tar.bz2
samba-a2bddb20ed078c3e1b9cb60a7420b3d107898f52.zip
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)
Diffstat (limited to 'source3/include')
-rw-r--r--source3/include/proto.h4
-rw-r--r--source3/include/smb.h3
2 files changed, 4 insertions, 3 deletions
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);
diff --git a/source3/include/smb.h b/source3/include/smb.h
index 589a70879c..8b7ad6ea92 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -485,7 +485,8 @@ typedef struct
int uid; /* uid of a validated user */
int gid; /* gid of a validated user */
- fstring name; /* name of a validated user */
+ fstring requested_name; /* user name from the client */
+ fstring name; /* unix user name of a validated user */
fstring real_name; /* to store real name from password file - simeon */
BOOL guest;