mirror of
https://github.com/samba-team/samba.git
synced 2025-03-12 20:58:37 +03:00
hanle the case where the win2000 username is completely different from
the pre-win2000 username (This used to be commit aa139ba507e4b898377fdfc9b27f7febf029d5a4)
This commit is contained in:
parent
35bc06d35c
commit
58c7f38368
@ -398,14 +398,9 @@ static NTSTATUS name_to_sid(struct winbindd_domain *domain,
|
||||
ads = ads_cached_connection(domain);
|
||||
if (!ads) goto done;
|
||||
|
||||
/* when a name is longer than 20 characters, the sAMAccountName can
|
||||
be long or short! */
|
||||
if (strlen(name) > 20) {
|
||||
asprintf(&exp, "(|(sAMAccountName=%s)(sAMAccountName=%.20s))",
|
||||
name, name);
|
||||
} else {
|
||||
asprintf(&exp, "(sAMAccountName=%s)", name);
|
||||
}
|
||||
/* accept either the win2000 or the pre-win2000 username */
|
||||
asprintf(&exp, "(|(sAMAccountName=%s)(userPrincipalName=%s@%s))",
|
||||
name, name, ads->realm);
|
||||
rc = ads_search_retry(ads, &res, exp, attrs);
|
||||
free(exp);
|
||||
if (!ADS_ERR_OK(rc)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user