From 32a3275344819cfcbcb4540a1909617b8db6dc63 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 8 Jul 2009 16:08:41 +0200 Subject: s3:dbwrap: add dbwrap_store_bystring_upper(). This stores a key under the uppercase version of the given keyname. Michael --- source3/lib/dbwrap_util.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'source3/lib') diff --git a/source3/lib/dbwrap_util.c b/source3/lib/dbwrap_util.c index aca4b52697..154bf6b553 100644 --- a/source3/lib/dbwrap_util.c +++ b/source3/lib/dbwrap_util.c @@ -356,3 +356,20 @@ NTSTATUS dbwrap_delete_bystring_upper(struct db_context *db, const char *key) talloc_free(key_upper); return status; } + +NTSTATUS dbwrap_store_bystring_upper(struct db_context *db, const char *key, + TDB_DATA data, int flags) +{ + char *key_upper; + NTSTATUS status; + + key_upper = talloc_strdup_upper(talloc_tos(), key); + if (key_upper == NULL) { + return NT_STATUS_NO_MEMORY; + } + + status = dbwrap_store_bystring(db, key_upper, data, flags); + + talloc_free(key_upper); + return status; +} -- cgit