summaryrefslogtreecommitdiff
path: root/source3/smbd/reply.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-06-22 00:57:59 +0000
committerJeremy Allison <jra@samba.org>2001-06-22 00:57:59 +0000
commit100a54e221dd0712ab37daa5359b202d0a059090 (patch)
tree9d23a24097d7dbbeea9fa8918875305d47780220 /source3/smbd/reply.c
parent6fdffd9b6c6150793d86114f18c2239a53625e73 (diff)
downloadsamba-100a54e221dd0712ab37daa5359b202d0a059090.tar.gz
samba-100a54e221dd0712ab37daa5359b202d0a059090.tar.bz2
samba-100a54e221dd0712ab37daa5359b202d0a059090.zip
Andrew - please look this over. I've fixed a long standing (maybe 4-5
years old) bug when chainging a sessionsetup_and_X and tcon together. The wrong username was being entered into the tdb, even though the correct user was used for accessing files. This is related to the fact that authorise_login() is not used for sessionsetup, but only for tcon auths. Jeremy. (This used to be commit 0187cd6aef7586d7ad4bdc70c50f3f2e7c69519c)
Diffstat (limited to 'source3/smbd/reply.c')
-rw-r--r--source3/smbd/reply.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index e0b0cea2d3..cd7b3fe6fe 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -205,6 +205,14 @@ int reply_tcon(connection_struct *conn,
pstrcpy(service, p+1);
}
+ /*
+ * If the vuid is valid, we should be using that....
+ */
+
+ if (*user == '\0' && (lp_security() != SEC_SHARE) && validated_username(vuid)) {
+ pstrcpy(user,validated_username(vuid));
+ }
+
/*
* Ensure the user and password names are in UNIX codepage format.
*/
@@ -247,6 +255,7 @@ int reply_tcon(connection_struct *conn,
/****************************************************************************
Reply to a tcon and X.
****************************************************************************/
+
int reply_tcon_and_X(connection_struct *conn, char *inbuf,char *outbuf,int length,int bufsize)
{
fstring service;
@@ -298,6 +307,14 @@ int reply_tcon_and_X(connection_struct *conn, char *inbuf,char *outbuf,int lengt
DEBUG(4,("Got device type %s\n",devicename));
+ /*
+ * If the vuid is valid, we should be using that....
+ */
+
+ if (*user == '\0' && (lp_security() != SEC_SHARE) && validated_username(vuid)) {
+ pstrcpy(user,validated_username(vuid));
+ }
+
/*
* Pass the user through the NT -> unix user mapping
* function.
@@ -1066,7 +1083,6 @@ int reply_sesssetup_and_X(connection_struct *conn, char *inbuf,char *outbuf,int
return chain_reply(inbuf,outbuf,length,bufsize);
}
-
/****************************************************************************
reply to a chkpth
****************************************************************************/