diff options
author | Jim McDonough <jmcd@samba.org> | 2010-08-12 17:51:02 -0400 |
---|---|---|
committer | Jim McDonough <jmcd@samba.org> | 2010-08-12 17:51:02 -0400 |
commit | c67b4ed3a406011d0fc7e1e2cbdc27ec4822e57c (patch) | |
tree | 8ffdcf65cc154d756ccb8b4985edbb5d8f876d8c | |
parent | 73a69e2d0f011327dddf2d0086e13b7b05397af7 (diff) | |
download | samba-c67b4ed3a406011d0fc7e1e2cbdc27ec4822e57c.tar.gz samba-c67b4ed3a406011d0fc7e1e2cbdc27ec4822e57c.tar.bz2 samba-c67b4ed3a406011d0fc7e1e2cbdc27ec4822e57c.zip |
s3-libnet: fix bug #6364: Pull realm from supplied username on libnet join
-rw-r--r-- | source3/libnet/libnet_join.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c index bff4e1ebc5..c710f9e1b1 100644 --- a/source3/libnet/libnet_join.c +++ b/source3/libnet/libnet_join.c @@ -113,6 +113,7 @@ static ADS_STATUS libnet_connect_ads(const char *dns_domain_name, { ADS_STATUS status; ADS_STRUCT *my_ads = NULL; + char *cp; my_ads = ads_init(dns_domain_name, netbios_domain_name, @@ -124,6 +125,12 @@ static ADS_STATUS libnet_connect_ads(const char *dns_domain_name, if (user_name) { SAFE_FREE(my_ads->auth.user_name); my_ads->auth.user_name = SMB_STRDUP(user_name); + if ((cp = strchr_m(my_ads->auth.user_name, '@'))!=0) { + *cp++ = '\0'; + SAFE_FREE(my_ads->auth.realm); + my_ads->auth.realm = smb_xstrdup(cp); + strupper_m(my_ads->auth.realm); + } } if (password) { |