summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-10-27 14:59:25 +0100
committerGünther Deschner <gd@samba.org>2009-10-28 12:37:38 +0100
commitbda047afbc4188bce0538ad128bea000c9652388 (patch)
tree4aa9cc818119462f065b4d4608a48695e2df7397
parent7791d29c79e3bb7d4759ba9c31151d268df2d247 (diff)
downloadsamba-bda047afbc4188bce0538ad128bea000c9652388.tar.gz
samba-bda047afbc4188bce0538ad128bea000c9652388.tar.bz2
samba-bda047afbc4188bce0538ad128bea000c9652388.zip
s3-passdb: add secrets_delete_generic().
Guenther
-rw-r--r--source3/include/proto.h1
-rw-r--r--source3/passdb/secrets.c16
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.
******************************************************************/