diff options
-rw-r--r-- | source3/include/proto.h | 1 | ||||
-rw-r--r-- | source3/passdb/secrets.c | 16 |
2 files changed, 17 insertions, 0 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h index dd87ef0766..a450b73028 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -4712,6 +4712,7 @@ void secrets_fetch_ipc_userpass(char **username, char **domain, char **password) TDB_CONTEXT *open_schannel_session_store(TALLOC_CTX *mem_ctx); bool secrets_store_generic(const char *owner, const char *key, const char *secret); char *secrets_fetch_generic(const char *owner, const char *key); +bool secrets_delete_generic(const char *owner, const char *key); bool secrets_store_local_schannel_key(uint8_t schannel_key[16]); bool secrets_fetch_local_schannel_key(uint8_t schannel_key[16]); diff --git a/source3/passdb/secrets.c b/source3/passdb/secrets.c index 29e0662396..01919b76ef 100644 --- a/source3/passdb/secrets.c +++ b/source3/passdb/secrets.c @@ -1211,6 +1211,22 @@ bool secrets_store_generic(const char *owner, const char *key, const char *secre return ret; } +bool secrets_delete_generic(const char *owner, const char *key) +{ + char *tdbkey = NULL; + bool ret; + + if (asprintf(&tdbkey, "SECRETS/GENERIC/%s/%s", owner, key) < 0) { + DEBUG(0, ("asprintf failed!\n")); + return False; + } + + ret = secrets_delete(tdbkey); + + SAFE_FREE(tdbkey); + return ret; +} + /******************************************************************* Find the ldap password. ******************************************************************/ |