diff options
Diffstat (limited to 'source3')
-rw-r--r-- | source3/include/proto.h | 2 | ||||
-rw-r--r-- | source3/lib/dbwrap_util.c | 17 |
2 files changed, 19 insertions, 0 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h index 4bc4cd197b..81892f294d 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -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 */ 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; +} |