s3:dbwrap: add dbwrap_delete_bystring_upper()
authorMichael Adam <obnox@samba.org>
Wed, 8 Jul 2009 14:02:19 +0000 (16:02 +0200)
committerMichael Adam <obnox@samba.org>
Wed, 15 Jul 2009 12:01:38 +0000 (14:01 +0200)
To delete a key whose name is not given in but stored in uppercase.

Michael

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

index 74cedcec184622ca32f9b7f07eba79bf5e9e2447..4bc4cd197b6d12ea522bef3b56eb9a7e20069d57 100644 (file)
@@ -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  */
 
index 67471b5c96843d77daf49ecb1f1479813130a339..aca4b52697467921574b4e0561cc8860199c82da 100644 (file)
@@ -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;
+}