From 804d3f897be01e9088deefe807cd06fe194c5d58 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 8 Jul 2009 16:02:19 +0200 Subject: s3:dbwrap: add dbwrap_delete_bystring_upper() To delete a key whose name is not given in but stored in uppercase. Michael --- source3/include/proto.h | 1 + source3/lib/dbwrap_util.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) (limited to 'source3') diff --git a/source3/include/proto.h b/source3/include/proto.h index 74cedcec18..4bc4cd197b 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -457,6 +457,7 @@ NTSTATUS dbwrap_trans_delete_bystring(struct db_context *db, const char *key); NTSTATUS dbwrap_trans_do(struct db_context *db, NTSTATUS (*action)(struct db_context *, void *), void *private_data); +NTSTATUS dbwrap_delete_bystring_upper(struct db_context *db, const char *key); /* The following definitions come from lib/debug.c */ diff --git a/source3/lib/dbwrap_util.c b/source3/lib/dbwrap_util.c index 67471b5c96..aca4b52697 100644 --- a/source3/lib/dbwrap_util.c +++ b/source3/lib/dbwrap_util.c @@ -340,3 +340,19 @@ NTSTATUS dbwrap_trans_do(struct db_context *db, DEBUG(2, ("transaction_commit failed\n")); return NT_STATUS_INTERNAL_DB_CORRUPTION; } + +NTSTATUS dbwrap_delete_bystring_upper(struct db_context *db, const char *key) +{ + char *key_upper; + NTSTATUS status; + + key_upper = talloc_strdup_upper(talloc_tos(), key); + if (key_upper == NULL) { + return NT_STATUS_NO_MEMORY; + } + + status = dbwrap_delete_bystring(db, key_upper); + + talloc_free(key_upper); + return status; +} -- cgit