]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Pass the db_record down to share_mode_data_store()
authorVolker Lendecke <vl@samba.org>
Mon, 4 Nov 2019 12:10:54 +0000 (13:10 +0100)
committerJeremy Allison <jra@samba.org>
Fri, 22 Nov 2019 23:57:47 +0000 (23:57 +0000)
Remove a dependency on share_mode_data->record

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/locking/share_mode_lock.c

index fbf8f2b54bbebae2267b5673f545b1c86fb2926b..3046fe775a85013c7a49bde53e6c5e4017ed0b3a 100644 (file)
@@ -414,7 +414,8 @@ fail:
  If modified, store the share_mode_data back into the database.
 ********************************************************************/
 
-static NTSTATUS share_mode_data_store(struct share_mode_data *d)
+static NTSTATUS share_mode_data_store(
+       struct share_mode_data *d, struct db_record *rec)
 {
        DATA_BLOB blob;
        enum ndr_err_code ndr_err;
@@ -440,7 +441,7 @@ static NTSTATUS share_mode_data_store(struct share_mode_data *d)
                        DBG_DEBUG("Ignoring fresh empty record\n");
                        return NT_STATUS_OK;
                }
-               status = dbwrap_record_delete(d->record);
+               status = dbwrap_record_delete(rec);
                return status;
        }
 
@@ -453,7 +454,7 @@ static NTSTATUS share_mode_data_store(struct share_mode_data *d)
        }
 
        status = dbwrap_record_store(
-               d->record,
+               rec,
                (TDB_DATA) { .dptr = blob.data, .dsize = blob.length },
                TDB_REPLACE);
        TALLOC_FREE(blob.data);
@@ -676,7 +677,8 @@ static int share_mode_lock_destructor(struct share_mode_lock *lck)
                return 0;
        }
 
-       status = share_mode_data_store(static_share_mode_data);
+       status = share_mode_data_store(
+               static_share_mode_data, static_share_mode_record);
        if (!NT_STATUS_IS_OK(status)) {
                DBG_ERR("share_mode_data_store failed: %s\n",
                        nt_errstr(status));