From 92345f49e3f9c18a21f8a0d5b9af86f383476c4c Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 28 Dec 2009 18:11:34 +0100 Subject: s3: Avoid adding a domain twice If we found a match with sid==NULL, we ended up adding the domain twice --- source3/winbindd/winbindd_util.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'source3/winbindd') diff --git a/source3/winbindd/winbindd_util.c b/source3/winbindd/winbindd_util.c index e56efa4c8c4..01440b678fe 100644 --- a/source3/winbindd/winbindd_util.c +++ b/source3/winbindd/winbindd_util.c @@ -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; } -- cgit