From: Ralph Boehme Date: Wed, 11 Apr 2018 15:07:54 +0000 (+0200) Subject: dbwrap: convert dbwrap_store_bystring() from TDB to DBWRAP flags X-Git-Tag: talloc-2.5.0~242 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7260db714871b3fc9fec27f1df6ef8f11801f5a5;p=thirdparty%2Fsamba.git dbwrap: convert dbwrap_store_bystring() from TDB to DBWRAP flags Signed-off-by: Ralph Boehme Reviewed-by: Martin Schwenke --- diff --git a/libcli/auth/schannel_state_tdb.c b/libcli/auth/schannel_state_tdb.c index c7f38dfbb91..987ca7a3670 100644 --- a/libcli/auth/schannel_state_tdb.c +++ b/libcli/auth/schannel_state_tdb.c @@ -118,7 +118,7 @@ NTSTATUS schannel_store_session_key_tdb(struct db_context *db_sc, value.dptr = blob.data; value.dsize = blob.length; - status = dbwrap_store_bystring(db_sc, keystr, value, TDB_REPLACE); + status = dbwrap_store_bystring(db_sc, keystr, value, DBWRAP_REPLACE); if (!NT_STATUS_IS_OK(status)) { DEBUG(0,("Unable to add %s to session key db - %s\n", keystr, nt_errstr(status))); @@ -359,7 +359,7 @@ NTSTATUS schannel_store_challenge_tdb(struct db_context *db_sc, value.dptr = blob.data; value.dsize = blob.length; - status = dbwrap_store_bystring(db_sc, keystr, value, TDB_REPLACE); + status = dbwrap_store_bystring(db_sc, keystr, value, DBWRAP_REPLACE); if (!NT_STATUS_IS_OK(status)) { DEBUG(0,("%s: failed to stored challenge info for '%s' " "with key %s - %s\n", diff --git a/source3/lib/privileges.c b/source3/lib/privileges.c index 05a4c9a1e76..e296fc76493 100644 --- a/source3/lib/privileges.c +++ b/source3/lib/privileges.c @@ -150,7 +150,7 @@ static bool set_privileges( const struct dom_sid *sid, uint64_t mask ) SBVAL(privbuf,0,mask); return NT_STATUS_IS_OK(dbwrap_store_bystring(db, keystr, data, - TDB_REPLACE)); + DBWRAP_REPLACE)); } /********************************************************************* diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 0b33373dcf9..e2a7f475242 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1646,7 +1646,7 @@ static bool hash_a_service(const char *name, int idx) dbwrap_store_bystring(ServiceHash, canon_name, make_tdb_data((uint8_t *)&idx, sizeof(idx)), - TDB_REPLACE); + DBWRAP_REPLACE); TALLOC_FREE(canon_name); diff --git a/source3/printing/printer_list.c b/source3/printing/printer_list.c index e63c658df2b..e39c8f2850f 100644 --- a/source3/printing/printer_list.c +++ b/source3/printing/printer_list.c @@ -292,7 +292,7 @@ NTSTATUS printer_list_mark_reload(void) PL_TSTAMP_FORMAT, time_h, time_l); status = dbwrap_store_bystring(db, PL_TIMESTAMP_KEY, - data, TDB_REPLACE); + data, DBWRAP_REPLACE); done: TALLOC_FREE(data.dptr); diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c index 44b3b5f93dd..fff041bd5b8 100644 --- a/source3/registry/reg_backend_db.c +++ b/source3/registry/reg_backend_db.c @@ -468,7 +468,10 @@ static int regdb_normalize_keynames_fn(struct db_record *rec, return 1; } - status = dbwrap_store_bystring(db, keyname, value, TDB_REPLACE); + status = dbwrap_store_bystring(db, + keyname, + value, + DBWRAP_REPLACE); if (!NT_STATUS_IS_OK(status)) { DEBUG(0,("regdb_normalize_keynames_fn: " "failed to store new record for [%s]!\n", @@ -574,7 +577,7 @@ static bool upgrade_v2_to_v3_check_subkeylist(struct db_context *db, path)); status = dbwrap_store_bystring(db, path, empty_subkey_list, - TDB_INSERT); + DBWRAP_INSERT); if (!NT_STATUS_IS_OK(status)) { DEBUG(0, ("regdb_upgrade_v2_to_v3: writing subkey list " "[%s] failed\n", path)); @@ -1123,7 +1126,7 @@ static WERROR regdb_store_keys_internal2(struct db_context *db, dbuf.dptr = buffer; dbuf.dsize = len; werr = ntstatus_to_werror(dbwrap_store_bystring(db, keyname, dbuf, - TDB_REPLACE)); + DBWRAP_REPLACE)); done: TALLOC_FREE(ctx); diff --git a/source3/utils/dbwrap_tool.c b/source3/utils/dbwrap_tool.c index eb97d641f64..d9537a788e2 100644 --- a/source3/utils/dbwrap_tool.c +++ b/source3/utils/dbwrap_tool.c @@ -189,7 +189,7 @@ static int dbwrap_tool_store_string(struct db_context *db, } else { status = dbwrap_store_bystring(db, keyname, tdbdata, - TDB_REPLACE); + DBWRAP_REPLACE); } if (!NT_STATUS_IS_OK(status)) { d_fprintf(stderr, @@ -229,7 +229,7 @@ static int dbwrap_tool_store_hex(struct db_context *db, } else { status = dbwrap_store_bystring(db, keyname, tdbdata, - TDB_REPLACE); + DBWRAP_REPLACE); } if (!NT_STATUS_IS_OK(status)) { d_fprintf(stderr, diff --git a/source3/utils/net_idmap.c b/source3/utils/net_idmap.c index 027b74131dd..99994e0aef2 100644 --- a/source3/utils/net_idmap.c +++ b/source3/utils/net_idmap.c @@ -319,7 +319,7 @@ static int net_idmap_store_id_mapping(struct db_context *db, status = dbwrap_store_bystring(db, idstr, string_term_tdb_data(sid_string), - TDB_REPLACE); + DBWRAP_REPLACE); if (!NT_STATUS_IS_OK(status)) { d_fprintf(stderr, "Error storing ID -> SID: " "%s\n", nt_errstr(status)); @@ -328,7 +328,7 @@ static int net_idmap_store_id_mapping(struct db_context *db, } status = dbwrap_store_bystring(db, sid_string, string_term_tdb_data(idstr), - TDB_REPLACE); + DBWRAP_REPLACE); if (!NT_STATUS_IS_OK(status)) { d_fprintf(stderr, "Error storing SID -> ID: " "%s\n", nt_errstr(status)); diff --git a/source3/winbindd/idmap_autorid_tdb.c b/source3/winbindd/idmap_autorid_tdb.c index 433716e237b..461dabaecec 100644 --- a/source3/winbindd/idmap_autorid_tdb.c +++ b/source3/winbindd/idmap_autorid_tdb.c @@ -261,7 +261,7 @@ static NTSTATUS idmap_autorid_addrange_action(struct db_context *db, } ret = dbwrap_store_bystring(db, numstr, - string_term_tdb_data(keystr), TDB_INSERT); + string_term_tdb_data(keystr), DBWRAP_INSERT); if (!NT_STATUS_IS_OK(ret)) { DEBUG(1, ("Fatal error while storing new " diff --git a/source3/winbindd/idmap_tdb2.c b/source3/winbindd/idmap_tdb2.c index 97f151f4236..2b78b077c33 100644 --- a/source3/winbindd/idmap_tdb2.c +++ b/source3/winbindd/idmap_tdb2.c @@ -156,7 +156,7 @@ static NTSTATUS idmap_tdb2_set_mapping_action(struct db_context *db, ret = dbwrap_store_bystring(db, state->ksidstr, string_term_tdb_data(state->kidstr), - TDB_INSERT); + DBWRAP_INSERT); if (!NT_STATUS_IS_OK(ret)) { DEBUG(0, ("Error storing SID -> ID: %s\n", nt_errstr(ret))); goto done; @@ -164,7 +164,7 @@ static NTSTATUS idmap_tdb2_set_mapping_action(struct db_context *db, ret = dbwrap_store_bystring(db, state->kidstr, string_term_tdb_data(state->ksidstr), - TDB_INSERT); + DBWRAP_INSERT); if (!NT_STATUS_IS_OK(ret)) { DEBUG(0, ("Error storing ID -> SID: %s\n", nt_errstr(ret))); /* try to remove the previous stored SID -> ID map */ diff --git a/source3/winbindd/idmap_tdb_common.c b/source3/winbindd/idmap_tdb_common.c index 0df8f2f3103..3a43971cd34 100644 --- a/source3/winbindd/idmap_tdb_common.c +++ b/source3/winbindd/idmap_tdb_common.c @@ -203,7 +203,7 @@ static NTSTATUS idmap_tdb_common_set_mapping_action(struct db_context *db, ret = dbwrap_store_bystring(db, state->ksidstr, string_term_tdb_data(state->kidstr), - TDB_INSERT); + DBWRAP_INSERT); if (!NT_STATUS_IS_OK(ret)) { DEBUG(0, ("Error storing SID -> ID: %s\n", nt_errstr(ret))); goto done; @@ -211,7 +211,7 @@ static NTSTATUS idmap_tdb_common_set_mapping_action(struct db_context *db, ret = dbwrap_store_bystring(db, state->kidstr, string_term_tdb_data(state->ksidstr), - TDB_INSERT); + DBWRAP_INSERT); if (!NT_STATUS_IS_OK(ret)) { DEBUG(0, ("Error storing ID -> SID: %s\n", nt_errstr(ret))); /* try to remove the previous stored SID -> ID map */ diff --git a/source4/ntvfs/common/notify.c b/source4/ntvfs/common/notify.c index a434fab998c..e6033fbea42 100644 --- a/source4/ntvfs/common/notify.c +++ b/source4/ntvfs/common/notify.c @@ -232,7 +232,7 @@ static NTSTATUS notify_save(struct notify_context *notify) dbuf.dsize = blob.length; status = dbwrap_store_bystring(notify->db, NOTIFY_KEY, dbuf, - TDB_REPLACE); + DBWRAP_REPLACE); talloc_free(tmp_ctx); return status; }