idmap_autorid: add a db_context argument to idmap_autorid_loadconfig()
authorMichael Adam <obnox@samba.org>
Wed, 28 Aug 2013 12:00:24 +0000 (14:00 +0200)
committerMichael Adam <obnox@samba.org>
Tue, 1 Oct 2013 08:49:09 +0000 (10:49 +0200)
Pair-Programmed-with: Atul Kulkarni <atul.kulkarni@in.ibm.com>

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Atul Kulkarni <atul.kulkarni@in.ibm.com>
source3/winbindd/idmap_autorid.c

index 2b81202767bd10788bf6e42ad06fbbc0cc23a769..6b9a472381f68d4449fba5b76bc19d02f37c5366 100644 (file)
@@ -751,7 +751,8 @@ static NTSTATUS idmap_autorid_db_init(void)
        return status;
 }
 
-static struct autorid_global_config *idmap_autorid_loadconfig(TALLOC_CTX * ctx)
+static struct autorid_global_config *idmap_autorid_loadconfig(struct db_context *db,
+                                                             TALLOC_CTX *ctx)
 {
 
        TDB_DATA data;
@@ -759,7 +760,7 @@ static struct autorid_global_config *idmap_autorid_loadconfig(TALLOC_CTX * ctx)
        unsigned long minvalue, rangesize, maxranges;
        NTSTATUS status;
 
-       status = dbwrap_fetch_bystring(autorid_db, ctx, CONFIGKEY, &data);
+       status = dbwrap_fetch_bystring(db, ctx, CONFIGKEY, &data);
 
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(10, ("No saved config found\n"));
@@ -937,7 +938,7 @@ static NTSTATUS idmap_autorid_initialize(struct idmap_domain *dom)
                   config->minvalue, config->rangesize, config->maxranges));
 
        /* read previously stored config and current HWM */
-       storedconfig = idmap_autorid_loadconfig(talloc_tos());
+       storedconfig = idmap_autorid_loadconfig(autorid_db, talloc_tos());
 
        status = dbwrap_fetch_uint32_bystring(autorid_db, HWM, &hwm);
        if (!NT_STATUS_IS_OK(status)) {