dbwrap: dbwrap_store_int32->dbwrap_store_int32_bystring
authorVolker Lendecke <vl@samba.org>
Thu, 14 Jun 2012 18:30:16 +0000 (20:30 +0200)
committerMichael Adam <obnox@samba.org>
Fri, 15 Jun 2012 10:14:27 +0000 (12:14 +0200)
Signed-off-by: Michael Adam <obnox@samba.org>
lib/dbwrap/dbwrap.h
lib/dbwrap/dbwrap_util.c
source3/lib/sharesec.c
source3/passdb/pdb_tdb.c
source3/torture/test_dbwrap_watch.c
source3/utils/net_idmap.c
source3/winbindd/idmap_tdb.c

index 677dbed765287bd6f970ab32e973bb7aa80b97fc..7123ca7a6152005746a2747913fe1d548a833ef8 100644 (file)
@@ -87,8 +87,8 @@ NTSTATUS dbwrap_fetch_bystring(struct db_context *db, TALLOC_CTX *mem_ctx,
 
 NTSTATUS dbwrap_fetch_int32_bystring(struct db_context *db, const char *keystr,
                                     int32_t *result);
-NTSTATUS dbwrap_store_int32(struct db_context *db, const char *keystr,
-                           int32_t v);
+NTSTATUS dbwrap_store_int32_bystring(struct db_context *db, const char *keystr,
+                                    int32_t v);
 NTSTATUS dbwrap_fetch_uint32(struct db_context *db, const char *keystr,
                             uint32_t *val);
 NTSTATUS dbwrap_store_uint32(struct db_context *db, const char *keystr,
index 2865da024406c739decc8a3c8dfaf42aa6b500f6..a3876064ad5f0f1d46716d0827efaf9146c84312 100644 (file)
@@ -51,8 +51,8 @@ NTSTATUS dbwrap_fetch_int32_bystring(struct db_context *db, const char *keystr,
        return NT_STATUS_OK;
 }
 
-NTSTATUS dbwrap_store_int32(struct db_context *db, const char *keystr,
-                           int32_t v)
+NTSTATUS dbwrap_store_int32_bystring(struct db_context *db, const char *keystr,
+                                    int32_t v)
 {
        struct db_record *rec;
        int32_t v_store;
index b53190d488d27bec47ca2d7de346ab03065652b9..978edf2ece988bbb4be24b7105045cf6ce57e04b 100644 (file)
@@ -192,8 +192,8 @@ bool share_info_db_init(void)
        if ((vers_id == SHARE_DATABASE_VERSION_V1) || (IREV(vers_id) == SHARE_DATABASE_VERSION_V1)) {
                /* Written on a bigendian machine with old fetch_int code. Save as le. */
 
-               status = dbwrap_store_int32(share_db, vstring,
-                                           SHARE_DATABASE_VERSION_V2);
+               status = dbwrap_store_int32_bystring(
+                       share_db, vstring, SHARE_DATABASE_VERSION_V2);
                if (!NT_STATUS_IS_OK(status)) {
                        DEBUG(0, ("dbwrap_store_int32 failed: %s\n",
                                  nt_errstr(status)));
@@ -208,8 +208,8 @@ bool share_info_db_init(void)
                        DEBUG(0, ("traverse failed\n"));
                        goto cancel;
                }
-               status = dbwrap_store_int32(share_db, vstring,
-                                           SHARE_DATABASE_VERSION_V2);
+               status = dbwrap_store_int32_bystring(
+                       share_db, vstring, SHARE_DATABASE_VERSION_V2);
                if (!NT_STATUS_IS_OK(status)) {
                        DEBUG(0, ("dbwrap_store_int32 failed: %s\n",
                                  nt_errstr(status)));
@@ -224,8 +224,8 @@ bool share_info_db_init(void)
                DEBUG(0, ("traverse failed\n"));
                goto cancel;
        }
-       status = dbwrap_store_int32(share_db, vstring,
-                                   SHARE_DATABASE_VERSION_V3);
+       status = dbwrap_store_int32_bystring(
+               share_db, vstring, SHARE_DATABASE_VERSION_V3);
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(0, ("dbwrap_store_int32 failed: %s\n",
                          nt_errstr(status)));
index 067c36437031b5d3289c1cd0db466f41f65f3ad7..3faa4cf75ddbe33133a30bc599d203c38faf6f7a 100644 (file)
@@ -392,16 +392,16 @@ static bool tdbsam_convert(struct db_context **pp_db, const char *name, int32 fr
                goto cancel;
        }
 
-       status = dbwrap_store_int32(db, TDBSAM_VERSION_STRING,
-                                   TDBSAM_VERSION);
+       status = dbwrap_store_int32_bystring(db, TDBSAM_VERSION_STRING,
+                                            TDBSAM_VERSION);
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(0, ("tdbsam_convert: Could not store tdbsam version: "
                          "%s\n", nt_errstr(status)));
                goto cancel;
        }
 
-       status = dbwrap_store_int32(db, TDBSAM_MINOR_VERSION_STRING,
-                                   TDBSAM_MINOR_VERSION);
+       status = dbwrap_store_int32_bystring(db, TDBSAM_MINOR_VERSION_STRING,
+                                            TDBSAM_MINOR_VERSION);
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(0, ("tdbsam_convert: Could not store tdbsam minor "
                          "version: %s\n", nt_errstr(status)));
index 8011c579516da01c3ccd8b1ca673b4faf8f6addc..2a21617fe3c3840ffec016384182a751e1a85bd1 100644 (file)
@@ -66,7 +66,7 @@ bool run_dbwrap_watch1(int dummy)
        }
        TALLOC_FREE(rec);
 
-       status = dbwrap_store_int32(db, keystr, 1);
+       status = dbwrap_store_int32_bystring(db, keystr, 1);
        if (!NT_STATUS_IS_OK(status)) {
                fprintf(stderr, "dbwrap_store_int32 failed: %s\n",
                        nt_errstr(status));
index 22734eecd810b5e5584763cfc5d126868ab7ba5e..28f9ed938eeca636b774adef9ed8b1727abb3dfc 100644 (file)
@@ -285,7 +285,8 @@ static int net_idmap_restore(struct net_context *c, int argc, const char **argv)
                                break;
                        }
                } else if (sscanf(line, "USER HWM %lu", &idval) == 1) {
-                       status = dbwrap_store_int32(db, "USER HWM", idval);
+                       status = dbwrap_store_int32_bystring(
+                               db, "USER HWM", idval);
                        if (!NT_STATUS_IS_OK(status)) {
                                d_fprintf(stderr,
                                          _("Could not store USER HWM: %s\n"),
@@ -293,7 +294,8 @@ static int net_idmap_restore(struct net_context *c, int argc, const char **argv)
                                break;
                        }
                } else if (sscanf(line, "GROUP HWM %lu", &idval) == 1) {
-                       status = dbwrap_store_int32(db, "GROUP HWM", idval);
+                       status = dbwrap_store_int32_bystring(
+                               db, "GROUP HWM", idval);
                        if (!NT_STATUS_IS_OK(status)) {
                                d_fprintf(stderr,
                                          _("Could not store GROUP HWM: %s\n"),
index a9a7e9c71a64ebe692fa18203dae43a43040fc7c..3e46cf76b7888e8f09da3b1adfb4852bf8ab0f2f 100644 (file)
@@ -193,7 +193,7 @@ static bool idmap_tdb_upgrade(struct idmap_domain *dom, struct db_context *db)
                        wm = dom->low_id;
                }
 
-               status = dbwrap_store_int32(db, HWM_USER, wm);
+               status = dbwrap_store_int32_bystring(db, HWM_USER, wm);
                if (!NT_STATUS_IS_OK(status)) {
                        DEBUG(0, ("Unable to byteswap user hwm in idmap "
                                  "database: %s\n", nt_errstr(status)));
@@ -211,7 +211,7 @@ static bool idmap_tdb_upgrade(struct idmap_domain *dom, struct db_context *db)
                        wm = dom->low_id;
                }
 
-               status = dbwrap_store_int32(db, HWM_GROUP, wm);
+               status = dbwrap_store_int32_bystring(db, HWM_GROUP, wm);
                if (!NT_STATUS_IS_OK(status)) {
                        DEBUG(0, ("Unable to byteswap group hwm in idmap "
                                  "database: %s\n", nt_errstr(status)));
@@ -235,7 +235,8 @@ static bool idmap_tdb_upgrade(struct idmap_domain *dom, struct db_context *db)
                return False;
        }
 
-       status = dbwrap_store_int32(db, "IDMAP_VERSION", IDMAP_VERSION);
+       status = dbwrap_store_int32_bystring(db, "IDMAP_VERSION",
+                                            IDMAP_VERSION);
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(0, ("Unable to store idmap version in database: %s\n",
                          nt_errstr(status)));