From: Andrew Bartlett Date: Tue, 14 Aug 2012 12:58:19 +0000 (+1000) Subject: s3-passdb: Silence scary DEBUG(0) message on first use of secrets.tdb databases X-Git-Tag: tevent-0.9.17~69 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ff5d177a6938a0c486552db362a9e179fbc68b9c;p=thirdparty%2Fsamba.git 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 --- 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)