diff options
author | Günther Deschner <gd@samba.org> | 2006-02-13 15:12:22 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:10:06 -0500 |
commit | f0ed0440c4d3b8736eb5e1ceba8b9257eb29cee3 (patch) | |
tree | 35bff7daa4d9c393e03eeb07bb2c2ac564330ff1 /source3/nsswitch/winbindd_util.c | |
parent | 6791180b8175a3f580b911f6b07a990d3559412d (diff) | |
download | samba-f0ed0440c4d3b8736eb5e1ceba8b9257eb29cee3.tar.gz samba-f0ed0440c4d3b8736eb5e1ceba8b9257eb29cee3.tar.bz2 samba-f0ed0440c4d3b8736eb5e1ceba8b9257eb29cee3.zip |
r13492: As noone objected on the mailing-list:
Fix parse_domain_user to fail when splitting a full name like "DOM\user"
when "winbind use default domain" and "winbind trusted domains only" are
not enabled.
This allows pam_winbind to behave correctly when more modules are
stacked in the "account" or "password" PAM facility. pam_winbindd calls
WINBINDD_GETPWNAM which can decide whether or not a user is a winbind
user and return correct PAM error codes.
Guenther
(This used to be commit e6d52c1e9d8cec7be6d552c2a67a392df21c3ec9)
Diffstat (limited to 'source3/nsswitch/winbindd_util.c')
-rw-r--r-- | source3/nsswitch/winbindd_util.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source3/nsswitch/winbindd_util.c b/source3/nsswitch/winbindd_util.c index b92ee0de82..349ca21652 100644 --- a/source3/nsswitch/winbindd_util.c +++ b/source3/nsswitch/winbindd_util.c @@ -835,10 +835,9 @@ BOOL parse_domain_user(const char *domuser, fstring domain, fstring user) if ( assume_domain(lp_workgroup())) { fstrcpy(domain, lp_workgroup()); } else { - fstrcpy( domain, get_global_sam_name() ); + return False; } - } - else { + } else { fstrcpy(user, p+1); fstrcpy(domain, domuser); domain[PTR_DIFF(p, domuser)] = 0; @@ -853,7 +852,9 @@ BOOL parse_domain_user_talloc(TALLOC_CTX *mem_ctx, const char *domuser, char **domain, char **user) { fstring fstr_domain, fstr_user; - parse_domain_user(domuser, fstr_domain, fstr_user); + if (!parse_domain_user(domuser, fstr_domain, fstr_user)) { + return False; + } *domain = talloc_strdup(mem_ctx, fstr_domain); *user = talloc_strdup(mem_ctx, fstr_user); return ((*domain != NULL) && (*user != NULL)); |