diff options
author | Volker Lendecke <vl@samba.org> | 2012-06-14 20:30:16 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2012-06-15 12:14:27 +0200 |
commit | 749314fcf99cef4a1a162d622e10b6eb8998938f (patch) | |
tree | edb8bf82c76fb96ee4a125f147e33273641416fd | |
parent | 737c0a54731803c84f0f29d96dd40ac819aec3e8 (diff) | |
download | samba-749314fcf99cef4a1a162d622e10b6eb8998938f.tar.gz samba-749314fcf99cef4a1a162d622e10b6eb8998938f.tar.xz samba-749314fcf99cef4a1a162d622e10b6eb8998938f.zip |
dbwrap: dbwrap_store_int32->dbwrap_store_int32_bystring
Signed-off-by: Michael Adam <obnox@samba.org>
-rw-r--r-- | lib/dbwrap/dbwrap.h | 4 | ||||
-rw-r--r-- | lib/dbwrap/dbwrap_util.c | 4 | ||||
-rw-r--r-- | source3/lib/sharesec.c | 12 | ||||
-rw-r--r-- | source3/passdb/pdb_tdb.c | 8 | ||||
-rw-r--r-- | source3/torture/test_dbwrap_watch.c | 2 | ||||
-rw-r--r-- | source3/utils/net_idmap.c | 6 | ||||
-rw-r--r-- | source3/winbindd/idmap_tdb.c | 7 |
7 files changed, 23 insertions, 20 deletions
diff --git a/lib/dbwrap/dbwrap.h b/lib/dbwrap/dbwrap.h index 677dbed765..7123ca7a61 100644 --- a/lib/dbwrap/dbwrap.h +++ b/lib/dbwrap/dbwrap.h @@ -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, diff --git a/lib/dbwrap/dbwrap_util.c b/lib/dbwrap/dbwrap_util.c index 2865da0244..a3876064ad 100644 --- a/lib/dbwrap/dbwrap_util.c +++ b/lib/dbwrap/dbwrap_util.c @@ -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; diff --git a/source3/lib/sharesec.c b/source3/lib/sharesec.c index b53190d488..978edf2ece 100644 --- a/source3/lib/sharesec.c +++ b/source3/lib/sharesec.c @@ -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))); diff --git a/source3/passdb/pdb_tdb.c b/source3/passdb/pdb_tdb.c index 067c364370..3faa4cf75d 100644 --- a/source3/passdb/pdb_tdb.c +++ b/source3/passdb/pdb_tdb.c @@ -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))); diff --git a/source3/torture/test_dbwrap_watch.c b/source3/torture/test_dbwrap_watch.c index 8011c57951..2a21617fe3 100644 --- a/source3/torture/test_dbwrap_watch.c +++ b/source3/torture/test_dbwrap_watch.c @@ -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)); diff --git a/source3/utils/net_idmap.c b/source3/utils/net_idmap.c index 22734eecd8..28f9ed938e 100644 --- a/source3/utils/net_idmap.c +++ b/source3/utils/net_idmap.c @@ -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"), diff --git a/source3/winbindd/idmap_tdb.c b/source3/winbindd/idmap_tdb.c index a9a7e9c71a..3e46cf76b7 100644 --- a/source3/winbindd/idmap_tdb.c +++ b/source3/winbindd/idmap_tdb.c @@ -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))); |