summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2017-06-20 13:07:15 +0200
committerStefan Metzmacher <metze@samba.org>2017-07-13 20:01:28 +0200
commit45ed7f339393e3d29e413087b12e898c37dd91a0 (patch)
treeff8954a5bc38204aa7980e5880a987cc39254a33
parente67bc70a04d6f3686ff690bc0711bc4480f54817 (diff)
downloadsamba-45ed7f339393e3d29e413087b12e898c37dd91a0.tar.gz
s3:secrets: rename secrets_delete() to secrets_delete_entry()
secrets_delete_entry() fails if the key doesn't exist. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12782 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> (cherry picked from commit cd1e888773c4fd3db63ce38a496fc3d54eb8e021)
-rw-r--r--source3/include/secrets.h2
-rw-r--r--source3/passdb/machine_account_secrets.c16
-rw-r--r--source3/passdb/secrets.c6
-rw-r--r--source3/passdb/secrets_lsa.c2
-rw-r--r--source3/utils/net.c6
5 files changed, 16 insertions, 16 deletions
diff --git a/source3/include/secrets.h b/source3/include/secrets.h
index 6f74494ea41..e7f87a9f673 100644
--- a/source3/include/secrets.h
+++ b/source3/include/secrets.h
@@ -88,7 +88,7 @@ struct db_context *secrets_db_ctx(void);
void secrets_shutdown(void);
void *secrets_fetch(const char *key, size_t *size);
bool secrets_store(const char *key, const void *data, size_t size);
-bool secrets_delete(const char *key);
+bool secrets_delete_entry(const char *key);
/* The following definitions come from passdb/machine_account_secrets.c */
bool secrets_mark_domain_protected(const char *domain);
diff --git a/source3/passdb/machine_account_secrets.c b/source3/passdb/machine_account_secrets.c
index 369f774e9cb..7f19c65392a 100644
--- a/source3/passdb/machine_account_secrets.c
+++ b/source3/passdb/machine_account_secrets.c
@@ -92,7 +92,7 @@ bool secrets_clear_domain_protection(const char *domain)
if (protection) {
SAFE_FREE(protection);
- ret = secrets_delete(protect_ids_keystr(domain));
+ ret = secrets_delete_entry(protect_ids_keystr(domain));
if (!ret) {
DEBUG(0, ("Failed to remove Domain IDs protection\n"));
}
@@ -381,7 +381,7 @@ static bool secrets_delete_prev_machine_password(const char *domain)
return true;
}
SAFE_FREE(oldpass);
- return secrets_delete(machine_prev_password_keystr(domain));
+ return secrets_delete_entry(machine_prev_password_keystr(domain));
}
/************************************************************************
@@ -394,13 +394,13 @@ bool secrets_delete_machine_password_ex(const char *domain)
if (!secrets_delete_prev_machine_password(domain)) {
return false;
}
- if (!secrets_delete(machine_password_keystr(domain))) {
+ if (!secrets_delete_entry(machine_password_keystr(domain))) {
return false;
}
- if (!secrets_delete(machine_sec_channel_type_keystr(domain))) {
+ if (!secrets_delete_entry(machine_sec_channel_type_keystr(domain))) {
return false;
}
- return secrets_delete(machine_last_change_time_keystr(domain));
+ return secrets_delete_entry(machine_last_change_time_keystr(domain));
}
/************************************************************************
@@ -409,7 +409,7 @@ bool secrets_delete_machine_password_ex(const char *domain)
bool secrets_delete_domain_sid(const char *domain)
{
- return secrets_delete(domain_sid_keystr(domain));
+ return secrets_delete_entry(domain_sid_keystr(domain));
}
/************************************************************************
@@ -514,7 +514,7 @@ bool secrets_store_machine_pw_sync(const char *pass, const char *oldpass, const
value = secrets_fetch(machine_sec_channel_type_keystr(domain), NULL);
if (value) {
SAFE_FREE(value);
- ret = secrets_delete(machine_sec_channel_type_keystr(domain));
+ ret = secrets_delete_entry(machine_sec_channel_type_keystr(domain));
if (!ret) {
TALLOC_FREE(frame);
return ret;
@@ -600,7 +600,7 @@ bool kerberos_secrets_store_des_salt( const char* salt )
if ( !salt ) {
DEBUG(8,("kerberos_secrets_store_des_salt: deleting salt\n"));
- secrets_delete( key );
+ secrets_delete_entry( key );
return True;
}
diff --git a/source3/passdb/secrets.c b/source3/passdb/secrets.c
index 4372c635f1c..ae00936948a 100644
--- a/source3/passdb/secrets.c
+++ b/source3/passdb/secrets.c
@@ -146,7 +146,7 @@ bool secrets_store(const char *key, const void *data, size_t size)
/* delete a secets database entry
*/
-bool secrets_delete(const char *key)
+bool secrets_delete_entry(const char *key)
{
NTSTATUS status;
if (!secrets_init()) {
@@ -277,7 +277,7 @@ bool secrets_store_trusted_domain_password(const char* domain, const char* pwd,
bool trusted_domain_password_delete(const char *domain)
{
- return secrets_delete(trustdom_keystr(domain));
+ return secrets_delete_entry(trustdom_keystr(domain));
}
bool secrets_store_ldap_pw(const char* dn, char* pw)
@@ -352,7 +352,7 @@ bool fetch_ldap_pw(char **dn, char** pw)
SAFE_FREE(*dn);
return False;
}
- if (!secrets_delete(old_style_key)) {
+ if (!secrets_delete_entry(old_style_key)) {
DEBUG(0,("fetch_ldap_pw: old ldap secret could not be deleted!\n"));
}
diff --git a/source3/passdb/secrets_lsa.c b/source3/passdb/secrets_lsa.c
index a40942cf7be..3ebaac4bb8e 100644
--- a/source3/passdb/secrets_lsa.c
+++ b/source3/passdb/secrets_lsa.c
@@ -223,7 +223,7 @@ NTSTATUS lsa_secret_delete(const char *secret_name)
return status;
}
- if (!secrets_delete(key)) {
+ if (!secrets_delete_entry(key)) {
talloc_free(key);
return NT_STATUS_ACCESS_DENIED;
}
diff --git a/source3/utils/net.c b/source3/utils/net.c
index beb8760bda8..6f7a7a4826e 100644
--- a/source3/utils/net.c
+++ b/source3/utils/net.c
@@ -156,9 +156,9 @@ static int net_setauthuser(struct net_context *c, int argc, const char **argv)
" Delete the auth user setting.\n"));
return 1;
}
- secrets_delete(SECRETS_AUTH_USER);
- secrets_delete(SECRETS_AUTH_DOMAIN);
- secrets_delete(SECRETS_AUTH_PASSWORD);
+ secrets_delete_entry(SECRETS_AUTH_USER);
+ secrets_delete_entry(SECRETS_AUTH_DOMAIN);
+ secrets_delete_entry(SECRETS_AUTH_PASSWORD);
return 0;
}