diff options
author | Michael Adam <obnox@samba.org> | 2009-07-08 16:08:41 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2009-07-15 14:01:38 +0200 |
commit | 32a3275344819cfcbcb4540a1909617b8db6dc63 (patch) | |
tree | 0525db61b8e4ed3f5c63ef1af773ba991e4c9973 /source3 | |
parent | 804d3f897be01e9088deefe807cd06fe194c5d58 (diff) | |
download | samba-32a3275344819cfcbcb4540a1909617b8db6dc63.tar.gz samba-32a3275344819cfcbcb4540a1909617b8db6dc63.tar.bz2 samba-32a3275344819cfcbcb4540a1909617b8db6dc63.zip |
s3:dbwrap: add dbwrap_store_bystring_upper().
This stores a key under the uppercase version of the given keyname.
Michael
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; +} |