From 3b3125fc23dc4b7a403d17af2ad2d5c592d3d090 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 8 Jul 2009 16:13:07 +0200 Subject: s3:dbwrap: add dbwrap_fetch_bystring_upper(). To fetch a key whose name is stored but not given in upper case. 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 154bf6b553..01c18439c3 100644 --- a/source3/lib/dbwrap_util.c +++ b/source3/lib/dbwrap_util.c @@ -373,3 +373,20 @@ NTSTATUS dbwrap_store_bystring_upper(struct db_context *db, const char *key, talloc_free(key_upper); return status; } + +TDB_DATA dbwrap_fetch_bystring_upper(struct db_context *db, TALLOC_CTX *mem_ctx, + const char *key) +{ + char *key_upper; + TDB_DATA result; + + key_upper = talloc_strdup_upper(talloc_tos(), key); + if (key_upper == NULL) { + return make_tdb_data(NULL, 0); + } + + result = dbwrap_fetch_bystring(db, mem_ctx, key_upper); + + talloc_free(key_upper); + return result; +} -- cgit