From 0a66c9735456dbcee4b59e2bf8cd91402884b894 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 4 Nov 2019 13:10:54 +0100 Subject: [PATCH] smbd: Pass the db_record down to share_mode_data_store() Remove a dependency on share_mode_data->record Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- source3/locking/share_mode_lock.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/source3/locking/share_mode_lock.c b/source3/locking/share_mode_lock.c index fbf8f2b54bb..3046fe775a8 100644 --- a/source3/locking/share_mode_lock.c +++ b/source3/locking/share_mode_lock.c @@ -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)); -- 2.47.3