s3:dbwrap: add dbwrap_store_bystring_upper().
authorMichael Adam <obnox@samba.org>
Wed, 8 Jul 2009 14:08:41 +0000 (16:08 +0200)
committerMichael Adam <obnox@samba.org>
Wed, 15 Jul 2009 12:01:38 +0000 (14:01 +0200)
This stores a key under the uppercase version of the given keyname.

Michael

source3/include/proto.h
source3/lib/dbwrap_util.c

index 4bc4cd197b6d12ea522bef3b56eb9a7e20069d57..81892f294d2fba649568f1a107b58a56fb2cede0 100644 (file)
@@ -458,6 +458,8 @@ 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);
+NTSTATUS dbwrap_store_bystring_upper(struct db_context *db, const char *key,
+                                    TDB_DATA data, int flags);
 
 /* The following definitions come from lib/debug.c  */
 
index aca4b52697467921574b4e0561cc8860199c82da..154bf6b553160e5d1072ad0c17b33192ad8553ef 100644 (file)
@@ -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;
+}