1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

27 Commits

Author SHA1 Message Date
Volker Lendecke
80cd127b20 smbd: Remove sconn->using_smb2
We have the same information available via conn_using_smb2()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
2024-04-17 07:57:36 +00:00
Volker Lendecke
965fec3547 smbd: Give smbXsrv_session.c its own header file
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-03-12 13:31:31 +00:00
Joseph Sutton
68fb12cb79 Revert "smbd: Fix CID 1504457 Resource leak"
We cannot free ‘enc’ — it may be a copy of ‘buffer’, in which parameter
both construct_reply_chain() and smb_request_done() pass arrays of
automatic storage duration!

Fixes CID 1505354.

This reverts commit a395f752f0.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-10-13 02:18:31 +00:00
Andreas Schneider
7077ae4042 s3:smbd: Fix code spelling
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2023-07-19 09:58:37 +00:00
Volker Lendecke
9907fd3e29 smbd: Avoid a direct reference to smb_messages[]
That's what we have smb_fn_name() for

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2023-07-03 19:40:35 +00:00
Volker Lendecke
1a5ac20a23 smbd: Remove unused "pcd" from struct pending_message_list
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2023-06-05 17:17:36 +00:00
Volker Lendecke
d2dcc0fdf5 smbd: Remove unused "deferred_pcd" from process_smb()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2023-06-05 17:17:36 +00:00
Volker Lendecke
5adbc366de smbd: Remove unused "deferred_pcd" from process_smb1()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2023-06-05 17:17:35 +00:00
Volker Lendecke
1550356679 smbd: Remove unused "deferred_pcd" from construct_reply()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2023-06-05 17:17:35 +00:00
Volker Lendecke
43f64955dc smbd: Remove unused "pcd" from struct smb_request
After the macros went away, nobody read this anymore

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2023-06-05 17:17:35 +00:00
Volker Lendecke
625056af0b smbd: Remove unused "deferred_pcd" from construct_reply_chain()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2023-06-05 17:17:35 +00:00
Volker Lendecke
12f1d94a4e smbd: Remove unused "pcd" arg from smb1_srv_send()
Looks larger than it is, "git clang-format" added a few lines

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2023-06-05 17:17:35 +00:00
Volker Lendecke
5fa8a1e166 smbd: Remove SMB_PERFCOUNT_ macros
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2023-06-05 17:17:35 +00:00
Volker Lendecke
b94fd4229d smbd: Slightly simplify set_current_case_sensitive()
Remove a global cache of calculating case sensivity. The calculation
is really simple: It only references a bool per-share parameter and a
global variable. I really doubt there is any measurable benefit from
this cache, and if there was, I don't care if SMB1 gets a tiny bit
slower in response to reduced global state.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-12-14 22:54:29 +00:00
Volker Lendecke
d48481118b smbd: Slightly simplify set_current_case_sensitive()
Assert this isn't called from SMB2

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-12-14 22:54:29 +00:00
Volker Lendecke
49fdf8f9ec smbd: Make set_current_case_sensitive() static
This is a SMB1-only thing

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-12-14 22:54:29 +00:00
Ralph Boehme
38ba7d1476 smbd: remove process shortname arg from smbd_reinit_after_fork()
All callers already do this explicitly by calling process_set_title().

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-12-14 01:38:29 +00:00
Ralph Boehme
62cc0bbab0 smbd: explicitly call process_set_title()
Currently setting the shortname is achieved via the final arg to
smbd_reinit_after_fork(), but I'm going to remove that arg soon.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-12-14 01:38:29 +00:00
Volker Lendecke
a395f752f0 smbd: Fix CID 1504457 Resource leak
Highly likely that's a false positive because Coverity does not
understand that srv_encrypt_buffer() only allocates when
NT_STATUS_OK(status), but it does not hurt to make it happy this way.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-06-06 19:22:28 +00:00
Jeremy Allison
0de9144452 s3: smbd: Rename init_smb_request() -> init_smb1_request().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Mulder <dmulder@suse.com>
2022-04-07 17:37:30 +00:00
Jeremy Allison
97fd5e56c0 s3: smbd: Rename create_outbuf() -> create_smb1_outbuf()
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Mulder <dmulder@suse.com>
2022-04-07 17:37:30 +00:00
Jeremy Allison
d949073e0d s3: smbd: Rename valid_smb_header() -> valid_smb1_header()
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Mulder <dmulder@suse.com>
2022-04-07 17:37:30 +00:00
David Mulder
a48bf2431e smbd: Remove uses of srv_send_smb
Replace them with direct calls to smb1_srv_send
and smb2_srv_send.

Signed-off-by: David Mulder <dmulder@suse.com>
Signed-off-by: Jeremy Allison <jra@samba.org>
2022-04-07 17:37:30 +00:00
David Mulder
f0ae7fba87 smbd: Move init_smb_request to smb2_process.c
init_smb_request is needed for a multi-protocol
negotiation.

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-04-07 17:37:30 +00:00
David Mulder
ed23ce77d9 smbd: Move valid_smb_header to smb2_process.c
valid_smb_header is needed for a multi-protocol
negotiation.

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-04-07 17:37:30 +00:00
David Mulder
34feb41881 smbd: Move smb1_utils.h include to smbd.h
Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-04-07 17:37:30 +00:00
David Mulder
7e1ff0ff35 smbd: Move process.c -> smb1_process.c
Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-04-07 17:37:30 +00:00