From cd5d282a466981ce87f180e4828fdef678409194 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Matthias=20Dieter=20Walln=C3=B6fer?= Date: Fri, 20 Apr 2012 18:15:23 +0200 Subject: [PATCH] s4:dsdb/common/util.c - samdb_is_pdc() - fail if the "fSMORoleOwner" attribute has not been set --- source4/dsdb/common/util.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c index 67589abed0b..6614507c50f 100644 --- a/source4/dsdb/common/util.c +++ b/source4/dsdb/common/util.c @@ -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; -- 2.34.1