]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
dbwrap: convert dbwrap_store_bystring() from TDB to DBWRAP flags
authorRalph Boehme <slow@samba.org>
Wed, 11 Apr 2018 15:07:54 +0000 (17:07 +0200)
committerRalph Boehme <slow@samba.org>
Fri, 17 Jul 2026 10:18:35 +0000 (10:18 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
libcli/auth/schannel_state_tdb.c
source3/lib/privileges.c
source3/param/loadparm.c
source3/printing/printer_list.c
source3/registry/reg_backend_db.c
source3/utils/dbwrap_tool.c
source3/utils/net_idmap.c
source3/winbindd/idmap_autorid_tdb.c
source3/winbindd/idmap_tdb2.c
source3/winbindd/idmap_tdb_common.c
source4/ntvfs/common/notify.c

index c7f38dfbb91e000b552cd7bfeae917890f8bd003..987ca7a3670493293b05424162fb71ad417b8621 100644 (file)
@@ -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",
index 05a4c9a1e76490584109087c9e133372c01e4065..e296fc7649307ced6b55e9ace038a88abe8f4345 100644 (file)
@@ -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));
 }
 
 /*********************************************************************
index 0b33373dcf9e6f691e6fe27272b64bae46ae5038..e2a7f4752427a31ecc880ef28c5ec221e4ea8276 100644 (file)
@@ -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);
 
index e63c658df2b4ce788633578b5605184ef7482b97..e39c8f2850f483ad808f8781c09119b25fd724f9 100644 (file)
@@ -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);
index 44b3b5f93dd34935d11c03c32d54b957db175447..fff041bd5b8984a5c7d4e2fb003a3ca0754e67ab 100644 (file)
@@ -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);
index eb97d641f6464e4b1b830bf76f4533290d29dc32..d9537a788e233de3e5ee1524243d4bc37965a94e 100644 (file)
@@ -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,
index 027b74131ddab16bc7f18957d08c4cf3ae1c883b..99994e0aef2f4a7ad2299e26e17f6420856da5fe 100644 (file)
@@ -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));
index 433716e237b8d7403a62c095c274ebb73fc2fd53..461dabaecec96c5604cc4a67f10425d96891e8e1 100644 (file)
@@ -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 "
index 97f151f42361244e05478cf2076652298dec456b..2b78b077c332ccba890baa6bd342e0831523bc49 100644 (file)
@@ -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 */
index 0df8f2f3103b0881cc4e16c1e9fa795f2e879d8b..3a43971cd34155ea17e4ae504aadc365bf30cc89 100644 (file)
@@ -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 */
index a434fab998c1bd90f42507bbfe562706566eb163..e6033fbea42808acf53bec185697ad3e1f2f4df2 100644 (file)
@@ -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;
 }