diff options
author | Andrew Bartlett <abartlet@samba.org> | 2012-08-14 22:58:19 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2012-08-14 15:37:22 +0200 |
commit | ff5d177a6938a0c486552db362a9e179fbc68b9c (patch) | |
tree | b7899e5c36a2648f526a817dc26078561ebad6ee /source3/passdb/machine_account_secrets.c | |
parent | 108c8b758ad23cd83630b2f8adf21171e815589a (diff) | |
download | samba-ff5d177a6938a0c486552db362a9e179fbc68b9c.tar.gz samba-ff5d177a6938a0c486552db362a9e179fbc68b9c.tar.xz samba-ff5d177a6938a0c486552db362a9e179fbc68b9c.zip |
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
Diffstat (limited to 'source3/passdb/machine_account_secrets.c')
-rw-r--r-- | source3/passdb/machine_account_secrets.c | 15 |
1 files 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) |