summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2002-11-19 23:44:24 +0000
committerAndrew Tridgell <tridge@samba.org>2002-11-19 23:44:24 +0000
commit18e55a69ffd30a621484ccc9f5210da132067dc5 (patch)
treeb94a9f66fdaea41b59c9ca0cd2de972fcaa6e330 /source3/smbd
parent22a08a5b12c73b13b875bf39cc1b868f507b00ce (diff)
downloadsamba-18e55a69ffd30a621484ccc9f5210da132067dc5.tar.gz
samba-18e55a69ffd30a621484ccc9f5210da132067dc5.tar.bz2
samba-18e55a69ffd30a621484ccc9f5210da132067dc5.zip
a better for for using %U in smb.conf
this follows the method used for remote_machine and also fixes the problem of anonymous connections clobbering the string (This used to be commit 9ead4fc3c3f8b83f03c762a4dab77a64aabccbf9)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/service.c3
-rw-r--r--source3/smbd/sesssetup.c11
2 files changed, 11 insertions, 3 deletions
diff --git a/source3/smbd/service.c b/source3/smbd/service.c
index fe55345938..1f168dd3ff 100644
--- a/source3/smbd/service.c
+++ b/source3/smbd/service.c
@@ -612,9 +612,6 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser,
return NULL;
}
- /* the %U substitution may have changed */
- reload_services(True);
-
/* Remember that a different vuid can connect later without these checks... */
/* Preexecs are done here as they might make the dir we are to ChDir to below */
diff --git a/source3/smbd/sesssetup.c b/source3/smbd/sesssetup.c
index 4ab1063217..9d708bd5a0 100644
--- a/source3/smbd/sesssetup.c
+++ b/source3/smbd/sesssetup.c
@@ -159,6 +159,11 @@ static int reply_spnego_kerberos(connection_struct *conn,
}
ads_destroy(&ads);
+ /* setup the string used by %U */
+ sub_set_smb_name(user);
+
+ reload_services(True);
+
/* the password is good - let them in */
pw = Get_Pwnam(user);
if (!pw && !strstr(user, lp_winbind_separator())) {
@@ -423,6 +428,9 @@ static int reply_spnego_auth(connection_struct *conn, char *inbuf, char *outbuf,
set_remote_machine_name(machine);
+ /* setup the string used by %U */
+ sub_set_smb_name(user);
+
reload_services(True);
#if 0
@@ -749,6 +757,9 @@ int reply_sesssetup_and_X(connection_struct *conn, char *inbuf,char *outbuf,
return ERROR_NT(NT_STATUS_UNSUCCESSFUL);
}
pstrcpy(sub_user, user);
+
+ /* setup the string used by %U */
+ sub_set_smb_name(user);
} else {
pstrcpy(sub_user, lp_guestaccount());
}