summaryrefslogtreecommitdiff
path: root/source3/libsmb/cliconnect.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-12-04 04:26:22 +0000
committerAndrew Tridgell <tridge@samba.org>2000-12-04 04:26:22 +0000
commitca784bb0280205cdbacca704f0b4c94d8e79e621 (patch)
tree690cea289a1fa6a9c20de601650ca0fa93e3baf8 /source3/libsmb/cliconnect.c
parent576a106d033337088b969a2a63dd7e5616cc1d72 (diff)
downloadsamba-ca784bb0280205cdbacca704f0b4c94d8e79e621.tar.gz
samba-ca784bb0280205cdbacca704f0b4c94d8e79e621.tar.bz2
samba-ca784bb0280205cdbacca704f0b4c94d8e79e621.zip
in cli_session_setup() accept usernames of the form DOMAIN/USER or
DOMAIN\USER this means all our tools can now put the domain name in the -U option (This used to be commit bac1c76f03b6b848fa2e942b12c646aed58bee12)
Diffstat (limited to 'source3/libsmb/cliconnect.c')
-rw-r--r--source3/libsmb/cliconnect.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index ff81d886b0..8a7c6da1af 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -56,6 +56,15 @@ BOOL cli_session_setup(struct cli_state *cli,
{
char *p;
fstring pword, ntpword;
+ fstring user2;
+
+ /* allow for workgroups as part of the username */
+ fstrcpy(user2, user);
+ if ((p=strchr(user2,'\\')) || (p=strchr(user2,'/'))) {
+ *p = 0;
+ user = p+1;
+ workgroup = user2;
+ }
if (cli->protocol < PROTOCOL_LANMAN1)
return True;