summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/lib/util_sid.c22
-rw-r--r--source3/passdb/passdb.c13
2 files changed, 14 insertions, 21 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);
}
diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c
index 04e41b7970..7ccb35c3f4 100644
--- a/source3/passdb/passdb.c
+++ b/source3/passdb/passdb.c
@@ -46,19 +46,6 @@ const char *get_default_sam_name(void)
return lp_workgroup();
}
-/******************************************************************
- 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();
-}
-
/************************************************************
Fill the SAM_ACCOUNT with default values.
***********************************************************/