1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-20 22:50:26 +03:00

s3: Avoid adding a domain twice

If we found a match with sid==NULL, we ended up adding the domain twice
This commit is contained in:
Volker Lendecke 2009-12-28 18:11:34 +01:00
parent 22a4a000ce
commit 92345f49e3

View File

@ -143,13 +143,14 @@ static struct winbindd_domain *add_trusted_domain(const char *domain_name, const
}
}
/* See if we found a match. Check if we need to update the
SID. */
if ( domain && sid) {
if ( sid_equal( &domain->sid, &global_sid_NULL ) )
if (domain != NULL) {
/*
* We found a match. Possibly update the SID
*/
if ((sid != NULL)
&& sid_equal(&domain->sid, &global_sid_NULL)) {
sid_copy( &domain->sid, sid );
}
return domain;
}