s4:dsdb/common/util.c - samdb_is_pdc() - fail if the "fSMORoleOwner" attribute has...
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Fri, 20 Apr 2012 16:15:23 +0000 (18:15 +0200)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Sun, 29 Apr 2012 17:06:52 +0000 (19:06 +0200)
source4/dsdb/common/util.c

index 67589abed0bf72b6d54d2e616f8f7861e0737e64..6614507c50fa7111437e7aac48b070fc2e525bb2 100644 (file)
@@ -1792,7 +1792,11 @@ bool samdb_is_pdc(struct ldb_context *ldb)
                goto failed;
        }
 
-       pdc = ldb_msg_find_attr_as_dn(ldb, tmp_ctx, dom_res->msgs[0], "fSMORoleOwner");
+       pdc = ldb_msg_find_attr_as_dn(ldb, tmp_ctx, dom_res->msgs[0],
+                                     "fSMORoleOwner");
+       if (pdc == NULL) {
+               goto failed;
+       }
 
        if (ldb_dn_compare(samdb_ntds_settings_dn(ldb), pdc) == 0) {
                is_pdc = true;