summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-12-28 18:11:34 +0100
committerVolker Lendecke <vl@samba.org>2010-01-02 12:09:05 +0100
commit92345f49e3f9c18a21f8a0d5b9af86f383476c4c (patch)
treeb795b3a909edaa061e58e55c6650c9a63b5e5445
parent22a4a000cecb971a16a1303e8b16fb659f5ccdec (diff)
downloadsamba-92345f49e3f9c18a21f8a0d5b9af86f383476c4c.tar.gz
samba-92345f49e3f9c18a21f8a0d5b9af86f383476c4c.tar.bz2
samba-92345f49e3f9c18a21f8a0d5b9af86f383476c4c.zip
s3: Avoid adding a domain twice
If we found a match with sid==NULL, we ended up adding the domain twice
-rw-r--r--source3/winbindd/winbindd_util.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/source3/winbindd/winbindd_util.c b/source3/winbindd/winbindd_util.c
index e56efa4c8c..01440b678f 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;
}