summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-08-14 22:58:19 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-08-14 15:37:22 +0200
commitff5d177a6938a0c486552db362a9e179fbc68b9c (patch)
treeb7899e5c36a2648f526a817dc26078561ebad6ee /source3/passdb
parent108c8b758ad23cd83630b2f8adf21171e815589a (diff)
downloadsamba-ff5d177a6938a0c486552db362a9e179fbc68b9c.tar.gz
samba-ff5d177a6938a0c486552db362a9e179fbc68b9c.tar.bz2
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')
-rw-r--r--source3/passdb/machine_account_secrets.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/source3/passdb/machine_account_secrets.c b/source3/passdb/machine_account_secrets.c
index a4b5709b28..ebd7b4cc56 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)