summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2003-07-03 03:56:16 +0000
committerGerald Carter <jerry@samba.org>2003-07-03 03:56:16 +0000
commita31a2c159cd51112abdbe230c7a4df743fe14288 (patch)
tree6f699b3ca55f05125578a8a78ba19d85ac65a17d
parent230724d4e3137ffef8136c4cc0b1738833472c22 (diff)
downloadsamba-a31a2c159cd51112abdbe230c7a4df743fe14288.tar.gz
samba-a31a2c159cd51112abdbe230c7a4df743fe14288.tar.bz2
samba-a31a2c159cd51112abdbe230c7a4df743fe14288.zip
well this was easy...
When winbindd is running on a PDC the SAM_ACCOUNT for a trusted user has a username of DOMAIN\user. Make sure to trim the domain part from the username when filling in the net_sam_logon reply. This fixes the browsing issues i was seen across domain trusts. (This used to be commit 62e36e6ede067ace23f5473d04917c7eeedf07e2)
-rw-r--r--source3/rpc_parse/parse_net.c20
-rw-r--r--source3/rpc_server/srv_netlog_nt.c3
2 files changed, 19 insertions, 4 deletions
diff --git a/source3/rpc_parse/parse_net.c b/source3/rpc_parse/parse_net.c
index 7d04eace23..43bd8cd20e 100644
--- a/source3/rpc_parse/parse_net.c
+++ b/source3/rpc_parse/parse_net.c
@@ -1283,6 +1283,7 @@ void init_net_user_info3(TALLOC_CTX *ctx, NET_USER_INFO_3 *usr,
/* need to count the number of space-delimited sids */
unsigned int i;
int num_other_sids = 0;
+ char *username;
NTTIME logon_time, logoff_time, kickoff_time,
pass_last_set_time, pass_can_change_time,
@@ -1294,7 +1295,21 @@ void init_net_user_info3(TALLOC_CTX *ctx, NET_USER_INFO_3 *usr,
int len_logon_srv = strlen(logon_srv);
int len_logon_dom = strlen(logon_dom);
- len_user_name = strlen(user_name );
+
+ /* do some cleanup on the user name here to deal with users from a
+ trusted domain logging onto a client in our domain. If we are running
+ winbindd, the trusted users will be of the form DOMAIN\user so strip
+ out the domain portion. I noticed then when looking at an SMBsessionsetup&X.
+ The client was sending GLASS\Administrator as the username and GLASS as the
+ domain name -- jerry */
+
+ if ( (username = strchr( user_name, *lp_winbind_separator() )) != NULL )
+ username++;
+ else
+ username = user_name;
+
+
+ len_user_name = strlen(username );
len_full_name = strlen(full_name );
len_home_dir = strlen(home_dir );
len_dir_drive = strlen(dir_drive );
@@ -1306,6 +1321,7 @@ void init_net_user_info3(TALLOC_CTX *ctx, NET_USER_INFO_3 *usr,
usr->ptr_user_info = 1; /* yes, we're bothering to put USER_INFO data here */
+
/* Create NTTIME structs */
unix_to_nt_time (&logon_time, unix_logon_time);
@@ -1356,7 +1372,7 @@ void init_net_user_info3(TALLOC_CTX *ctx, NET_USER_INFO_3 *usr,
usr->num_other_sids = num_other_sids;
usr->buffer_other_sids = (num_other_sids != 0) ? 1 : 0;
- init_unistr2(&usr->uni_user_name, user_name, len_user_name);
+ init_unistr2(&usr->uni_user_name, username, len_user_name);
init_unistr2(&usr->uni_full_name, full_name, len_full_name);
init_unistr2(&usr->uni_logon_script, logon_script, len_logon_script);
init_unistr2(&usr->uni_profile_path, profile_path, len_profile_path);
diff --git a/source3/rpc_server/srv_netlog_nt.c b/source3/rpc_server/srv_netlog_nt.c
index fa19708773..0dcdf39158 100644
--- a/source3/rpc_server/srv_netlog_nt.c
+++ b/source3/rpc_server/srv_netlog_nt.c
@@ -732,8 +732,7 @@ NTSTATUS _net_sam_logon(pipes_struct *p, NET_Q_SAM_LOGON *q_u, NET_R_SAM_LOGON *
init_net_user_info3(p->mem_ctx, usr_info,
user_rid,
- group_rid,
-
+ group_rid,
pdb_get_username(sampw),
pdb_get_fullname(sampw),
pdb_get_homedir(sampw),