diff options
author | Volker Lendecke <vl@samba.org> | 2023-01-04 11:29:51 +0100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2023-01-10 00:28:37 +0000 |
commit | a71288e86bda43caf6feaff22a36942e6595a971 (patch) | |
tree | f65fc7bc70ff373027c607ffcfbe484dad40382b | |
parent | fdca0558efa7a22e98b851480509d2b7f11df2e0 (diff) | |
download | samba-a71288e86bda43caf6feaff22a36942e6595a971.tar.gz |
smbd: Remove smbXsrv_open->db_rec
This was only referenced in smbXsrv_open_close, but it was never
assigned anything but NULL.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r-- | source3/librpc/idl/smbXsrv.idl | 1 | ||||
-rw-r--r-- | source3/smbd/smbXsrv_open.c | 39 |
2 files changed, 16 insertions, 24 deletions
diff --git a/source3/librpc/idl/smbXsrv.idl b/source3/librpc/idl/smbXsrv.idl index ec65a5c1a61..e0a751f32de 100644 --- a/source3/librpc/idl/smbXsrv.idl +++ b/source3/librpc/idl/smbXsrv.idl @@ -514,7 +514,6 @@ interface smbXsrv */ typedef struct { [ignore] smbXsrv_open_table *table; - [ignore] db_record *db_rec; uint32 local_id; [ref] smbXsrv_open_global0 *global; NTSTATUS status; diff --git a/source3/smbd/smbXsrv_open.c b/source3/smbd/smbXsrv_open.c index 3b780267694..46e8b810e59 100644 --- a/source3/smbd/smbXsrv_open.c +++ b/source3/smbd/smbXsrv_open.c @@ -1163,34 +1163,27 @@ NTSTATUS smbXsrv_open_close(struct smbXsrv_open *op, NTTIME now) } TALLOC_FREE(global_rec); - local_rec = op->db_rec; + local_rec = smbXsrv_open_local_fetch_locked(table->local.db_ctx, + op->local_id, + op /* TALLOC_CTX*/); if (local_rec == NULL) { - local_rec = smbXsrv_open_local_fetch_locked(table->local.db_ctx, - op->local_id, - op /* TALLOC_CTX*/); - if (local_rec == NULL) { - error = NT_STATUS_INTERNAL_ERROR; - } + error = NT_STATUS_INTERNAL_ERROR; } - if (local_rec != NULL) { - status = dbwrap_record_delete(local_rec); - if (!NT_STATUS_IS_OK(status)) { - TDB_DATA key = dbwrap_record_get_key(local_rec); + status = dbwrap_record_delete(local_rec); + if (!NT_STATUS_IS_OK(status)) { + TDB_DATA key = dbwrap_record_get_key(local_rec); - DEBUG(0, ("smbXsrv_open_close(0x%08x): " - "failed to delete local key '%s': %s\n", - op->global->open_global_id, - tdb_data_dbg(key), - nt_errstr(status))); - error = status; - } - table->local.num_opens -= 1; - } - if (op->db_rec == NULL) { - TALLOC_FREE(local_rec); + DEBUG(0, ("smbXsrv_open_close(0x%08x): " + "failed to delete local key '%s': %s\n", + op->global->open_global_id, + tdb_data_dbg(key), + nt_errstr(status))); + error = status; } - op->db_rec = NULL; + table->local.num_opens -= 1; + + TALLOC_FREE(local_rec); if (op->compat) { op->compat->op = NULL; |