diff options
author | Volker Lendecke <vlendec@samba.org> | 2004-04-21 15:04:05 +0000 |
---|---|---|
committer | Volker Lendecke <vlendec@samba.org> | 2004-04-21 15:04:05 +0000 |
commit | 35359943920231630054a5a0896bf3de13803ddf (patch) | |
tree | 14c8b35ca2d82d5ff33ca7ae724ea89f47e5e0c6 /source/lib | |
parent | 1a88560c45c2a3cd7faab6505af85b5a607585de (diff) | |
download | samba-35359943920231630054a5a0896bf3de13803ddf.tar.gz samba-35359943920231630054a5a0896bf3de13803ddf.tar.xz samba-35359943920231630054a5a0896bf3de13803ddf.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
Diffstat (limited to 'source/lib')
-rw-r--r-- | source/lib/util_sid.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/source/lib/util_sid.c b/source/lib/util_sid.c index e4043c4e927..6b27fc84ddb 100644 --- a/source/lib/util_sid.c +++ b/source/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); } |