From ff5d177a6938a0c486552db362a9e179fbc68b9c Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 14 Aug 2012 22:58:19 +1000 Subject: [PATCH] s3-passdb: Silence scary DEBUG(0) message on first use of secrets.tdb databases When pdb_samba4 first opens this databse, this message is printed. Andrew Bartlett --- source3/passdb/machine_account_secrets.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/source3/passdb/machine_account_secrets.c b/source3/passdb/machine_account_secrets.c index a4b5709b283..ebd7b4cc56d 100644 --- a/source3/passdb/machine_account_secrets.c +++ b/source3/passdb/machine_account_secrets.c @@ -75,12 +75,17 @@ bool secrets_mark_domain_protected(const char *domain) bool secrets_clear_domain_protection(const char *domain) { bool ret; - - ret = secrets_delete(protect_ids_keystr(domain)); - if (!ret) { - DEBUG(0, ("Failed to remove Domain IDs protection\n")); + void *protection = secrets_fetch(protect_ids_keystr(domain), NULL); + + if (protection) { + SAFE_FREE(protection); + ret = secrets_delete(protect_ids_keystr(domain)); + if (!ret) { + DEBUG(0, ("Failed to remove Domain IDs protection\n")); + } + return ret; } - return ret; + return true; } bool secrets_store_domain_sid(const char *domain, const struct dom_sid *sid) -- 2.11.4.GIT