summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2004-04-21 15:04:05 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:51:18 -0500
commit0d6acfe19a6bf09305ba9727a4f967199dfa29a1 (patch)
treef2932e5318f4144672d81e63297252a39480c313 /source3/lib
parent96ace9ae885de706f1d400d01471e2f2abb029b0 (diff)
downloadsamba-0d6acfe19a6bf09305ba9727a4f967199dfa29a1.tar.gz
samba-0d6acfe19a6bf09305ba9727a4f967199dfa29a1.tar.bz2
samba-0d6acfe19a6bf09305ba9727a4f967199dfa29a1.zip
r316: Fix split_domain_name. This defaulted to get_myname() instead of
get_global_sam_name(). Error case: Adding a domain user to a XP local group did a lsalookupname on the user without domain prefix, and this then failed. Jerry: This is a must-fix before 3.0.3. Volker (This used to be commit f35e353454b6825da1de138a3f0d8106787e938b)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/util_sid.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/source3/lib/util_sid.c b/source3/lib/util_sid.c
index e4043c4e92..6b27fc84dd 100644
--- a/source3/lib/util_sid.c
+++ b/source3/lib/util_sid.c
@@ -174,6 +174,19 @@ NT_USER_TOKEN *get_system_token(void)
return &system_token;
}
+/******************************************************************
+ get the default domain/netbios name to be used when dealing
+ with our passdb list of accounts
+******************************************************************/
+
+const char *get_global_sam_name(void)
+{
+ if ((lp_server_role() == ROLE_DOMAIN_PDC) || (lp_server_role() == ROLE_DOMAIN_BDC)) {
+ return lp_workgroup();
+ }
+ return global_myname();
+}
+
/**************************************************************************
Splits a name of format \DOMAIN\name or name into its two components.
Sets the DOMAIN name to global_myname() if it has not been specified.
@@ -201,14 +214,7 @@ void split_domain_name(const char *fullname, char *domain, char *name)
fstrcpy(domain, full_name);
fstrcpy(name, p+1);
} else {
- if(!lp_domain_logons()) {
- fstrcpy(domain, global_myname());
- fstrcpy(name, full_name);
- } else {
- fstrcpy(domain, lp_workgroup());
- fstrcpy(name, full_name);
- }
- fstrcpy(domain, global_myname());
+ fstrcpy(domain, get_global_sam_name());
fstrcpy(name, full_name);
}