summaryrefslogtreecommitdiff
path: root/source3/libnet/libnet_join.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/libnet/libnet_join.c')
-rw-r--r--source3/libnet/libnet_join.c7
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) {