samba.git
3 years agoVERSION: Disable GIT_SNAPSHOT for the 4.14.0rc1 release. samba-4.14.0rc1
Karolin Seeger [Thu, 21 Jan 2021 12:48:52 +0000 (13:48 +0100)]
VERSION: Disable GIT_SNAPSHOT for the 4.14.0rc1 release.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
3 years agoWHATSNEW: Add release notes for Samba 4.14.0rc1.
Karolin Seeger [Thu, 21 Jan 2021 12:47:02 +0000 (13:47 +0100)]
WHATSNEW: Add release notes for Samba 4.14.0rc1.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
3 years agoReleaseKey: add GnuPG key transition statement for the Samba release key
Karolin Seeger [Thu, 21 Jan 2021 12:02:26 +0000 (13:02 +0100)]
ReleaseKey: add GnuPG key transition statement for the Samba release key

Signed-off-by: Karolin Seeger <kseeger@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
3 years agoscript/release.sh: always select the GPG key by it's ID
Karolin Seeger [Thu, 21 Jan 2021 12:03:44 +0000 (13:03 +0100)]
script/release.sh: always select the GPG key by it's ID

Signed-off-by: Karolin Seeger <kseeger@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
3 years agoWHATSNEW.txt: Miscellaneous samba-tool changes
Björn Baumbach [Mon, 18 Jan 2021 14:02:22 +0000 (15:02 +0100)]
WHATSNEW.txt: Miscellaneous samba-tool changes

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Karolin Seeger <kseeger@samba.org>
3 years agolibcli:smb: Fix a typo in a debug message
Andreas Schneider [Tue, 19 Jan 2021 14:50:24 +0000 (15:50 +0100)]
libcli:smb: Fix a typo in a debug message

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Jan 19 16:15:21 UTC 2021 on sn-devel-184

3 years agovfs: update status of SMB_VFS_SYMLINKAT()
Jeremy Allison [Fri, 15 Jan 2021 22:50:23 +0000 (14:50 -0800)]
vfs: update status of SMB_VFS_SYMLINKAT()

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sun Jan 17 05:48:14 UTC 2021 on sn-devel-184

3 years agos3: smbd: Change smb_set_file_unix_link() to use a real directory fsp for SMB_VFS_SYM...
Jeremy Allison [Fri, 15 Jan 2021 22:29:08 +0000 (14:29 -0800)]
s3: smbd: Change smb_set_file_unix_link() to use a real directory fsp for SMB_VFS_SYMLINKAT().

New VFS change.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3: VFS: glusterfs: Fix vfs_gluster_symlinkat() to cope with a real dirfsp.
Jeremy Allison [Fri, 15 Jan 2021 22:35:58 +0000 (14:35 -0800)]
s3: VFS: glusterfs: Fix vfs_gluster_symlinkat() to cope with a real dirfsp.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3: VFS: ceph: Fix cephwrap_symlinkat() to cope with real directory fsps.
Jeremy Allison [Fri, 15 Jan 2021 22:33:17 +0000 (14:33 -0800)]
s3: VFS: ceph: Fix cephwrap_symlinkat() to cope with real directory fsps.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agovfs: directory enumeration is now handle based
Ralph Boehme [Fri, 15 Jan 2021 15:37:56 +0000 (16:37 +0100)]
vfs: directory enumeration is now handle based

Remove obsolete description. Also remove SMB_VFS_STATX() as I don't see a need
for that atm.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jan 15 22:01:55 UTC 2021 on sn-devel-184

3 years agovfs: update status of SMB_VFS_MKDIRAT()
Ralph Boehme [Fri, 15 Jan 2021 09:13:36 +0000 (10:13 +0100)]
vfs: update status of SMB_VFS_MKDIRAT()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agopysmbd: use real dirfsp for SMB_VFS_MKDIRAT()
Ralph Boehme [Fri, 15 Jan 2021 09:12:29 +0000 (10:12 +0100)]
pysmbd: use real dirfsp for SMB_VFS_MKDIRAT()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agovfs: update status of SMB_VFS_MKNODAT()
Ralph Boehme [Fri, 15 Jan 2021 08:54:15 +0000 (09:54 +0100)]
vfs: update status of SMB_VFS_MKNODAT()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3: smbd: Change smb_unix_mknod() to use a real directory fsp for SMB_VFS_MKNODAT().
Jeremy Allison [Thu, 14 Jan 2021 20:18:50 +0000 (12:18 -0800)]
s3: smbd: Change smb_unix_mknod() to use a real directory fsp for SMB_VFS_MKNODAT().

New VFS change.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3: smbd: Move creation of parent_fname out of lp_inherit_permissions() clause in...
Jeremy Allison [Thu, 14 Jan 2021 19:50:39 +0000 (11:50 -0800)]
s3: smbd: Move creation of parent_fname out of lp_inherit_permissions() clause in smb_unix_mknod().

We will need this for the upcoming openat_pathref_fsp() use.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3: VFS: glusterfs: Fix vfs_gluster_mknodat() to cope with a real dirfsp.
Jeremy Allison [Thu, 14 Jan 2021 20:25:24 +0000 (12:25 -0800)]
s3: VFS: glusterfs: Fix vfs_gluster_mknodat() to cope with a real dirfsp.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3: VFS: glusterfs: Fix missing END_PROFILE() in mkdirat() return.
Jeremy Allison [Thu, 14 Jan 2021 20:26:48 +0000 (12:26 -0800)]
s3: VFS: glusterfs: Fix missing END_PROFILE() in mkdirat() return.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3: VFS: ceph: Fix cephwrap_mknodat() to cope with real directory fsps.
Jeremy Allison [Thu, 14 Jan 2021 20:35:29 +0000 (12:35 -0800)]
s3: VFS: ceph: Fix cephwrap_mknodat() to cope with real directory fsps.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3: VFS: ceph: Fix cephwrap_mkdirat() to cope with real directory fsps.
Jeremy Allison [Thu, 14 Jan 2021 20:31:24 +0000 (12:31 -0800)]
s3: VFS: ceph: Fix cephwrap_mkdirat() to cope with real directory fsps.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agosamba-tool: Optionally hide disabled/expired accounts in "group listmembers"
Björn Baumbach [Wed, 23 Dec 2020 14:51:12 +0000 (15:51 +0100)]
samba-tool: Optionally hide disabled/expired accounts in "group listmembers"

  --hide-expired        Do not list expired group members
  --hide-disabled       Do not list disabled group members

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Jan 15 16:34:11 UTC 2021 on sn-devel-184

3 years agosamba-tool: Optionally hide disabled/expired accounts in "user list"
Björn Baumbach [Wed, 23 Dec 2020 12:00:34 +0000 (13:00 +0100)]
samba-tool: Optionally hide disabled/expired accounts in "user list"

  --hide-expired        Do not list expired user accounts
  --hide-disabled       Do not list disabled user accounts

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agodoc/samba-tool: describe command parameters for "user list" command
Björn Baumbach [Wed, 23 Dec 2020 15:39:55 +0000 (16:39 +0100)]
doc/samba-tool: describe command parameters for "user list" command

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agodoc/samba-tool: describe command parameters for "group listmembers" command
Björn Baumbach [Wed, 23 Dec 2020 15:48:31 +0000 (16:48 +0100)]
doc/samba-tool: describe command parameters for "group listmembers" command

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agolibcli/smb: allow unexpected padding in SMB2 IOCTL responses
Stefan Metzmacher [Thu, 14 Jan 2021 16:32:15 +0000 (17:32 +0100)]
libcli/smb: allow unexpected padding in SMB2 IOCTL responses

A NetApp Ontap 7.3.7 SMB server add 8 padding bytes to an
offset that's already 8 byte aligned.

RN: Work around special SMB2 IOCTL response behavior of NetApp Ontap 7.3.7
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14607

Pair-Programmed-With: Volker Lendecke <vl@samba.org>

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Jan 15 08:36:34 UTC 2021 on sn-devel-184

3 years agosmbd: implement FSCTL_SMBTORTURE_IOCTL_RESPONSE_BODY_PADDING8 as reproducer for bug...
Stefan Metzmacher [Thu, 14 Jan 2021 16:39:01 +0000 (17:39 +0100)]
smbd: implement FSCTL_SMBTORTURE_IOCTL_RESPONSE_BODY_PADDING8 as reproducer for bug 14607

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14607

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos4:torture/smb2: add samba3.smb2.ioctl.bug14607
Stefan Metzmacher [Thu, 14 Jan 2021 16:39:18 +0000 (17:39 +0100)]
s4:torture/smb2: add samba3.smb2.ioctl.bug14607

FSCTL_SMBTORTURE_IOCTL_RESPONSE_BODY_PADDING8 will be used
to trigger an SMB2 IOCTL response with extra padding.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14607

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agolibcli/smb: split out smb2cli_ioctl_parse_buffer()
Stefan Metzmacher [Thu, 14 Jan 2021 16:27:21 +0000 (17:27 +0100)]
libcli/smb: split out smb2cli_ioctl_parse_buffer()

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14607

Pair-Programmed-With: Volker Lendecke <vl@samba.org>

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Volker Lendecke <vl@samba.org>
3 years agolibcli/smb: Allow smb2cli_validate_negotiate_info_done() to ignore NT_STATUS_INVALID_...
Jeremy Allison [Wed, 6 Jan 2021 17:03:05 +0000 (09:03 -0800)]
libcli/smb: Allow smb2cli_validate_negotiate_info_done() to ignore NT_STATUS_INVALID_PARAMETER.

This can be returned from NetApp Ontap 7.3.7 SMB server
implementations. Now we have ensured smb2_signing_check_pdu()
cannot return NT_STATUS_INVALID_PARAMETER on a signing error
it's safe to check this error code here. Windows 10
clients ignore this error from the NetApp.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14607

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 years agolibcli/smb: Change some checks to SMB_ASSERTS
Stefan Metzmacher [Mon, 11 Jan 2021 09:01:39 +0000 (10:01 +0100)]
libcli/smb: Change some checks to SMB_ASSERTS

If we end up here, it's definitely a programming error in the basic
parsing layer of the SMB2 packet.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14607

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agovfs: The New VFS
Ralph Boehme [Wed, 9 Dec 2020 21:04:31 +0000 (13:04 -0800)]
vfs: The New VFS

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jan 14 19:00:05 UTC 2021 on sn-devel-184

3 years agosmbd: inherit st_ex_mode to basename from stream name in create_file_unixpath()
Ralph Boehme [Tue, 12 Jan 2021 11:23:38 +0000 (12:23 +0100)]
smbd: inherit st_ex_mode to basename from stream name in create_file_unixpath()

This ensures smb_fname_base knows if it's a file or directory.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd: call vfs_stat() in mkdir_internal()
Ralph Boehme [Tue, 12 Jan 2021 11:03:33 +0000 (12:03 +0100)]
smbd: call vfs_stat() in mkdir_internal()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agoprinting: call vfs_stat() in driver_unlink_internals()
Ralph Boehme [Tue, 12 Jan 2021 11:03:02 +0000 (12:03 +0100)]
printing: call vfs_stat() in driver_unlink_internals()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibadouble: assert valid stat in ad_unconvert_get_streams()
Ralph Boehme [Tue, 12 Jan 2021 11:02:40 +0000 (12:02 +0100)]
libadouble: assert valid stat in ad_unconvert_get_streams()

All callers already stat the path, just add a check that asserts this.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibadouble: call vfs_stat() in ad_convert_finderinfo()
Ralph Boehme [Tue, 12 Jan 2021 10:59:33 +0000 (11:59 +0100)]
libadouble: call vfs_stat() in ad_convert_finderinfo()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibadouble: call vfs_stat() in ad_convert_xattr()
Ralph Boehme [Tue, 12 Jan 2021 10:59:02 +0000 (11:59 +0100)]
libadouble: call vfs_stat() in ad_convert_xattr()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agopysmbd: call vfs_stat() in set_sys_acl_conn()
Ralph Boehme [Tue, 12 Jan 2021 10:58:41 +0000 (11:58 +0100)]
pysmbd: call vfs_stat() in set_sys_acl_conn()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3/rpc_server: add deps of rpc_mdssvc_module
Ralph Boehme [Thu, 7 Jan 2021 14:51:26 +0000 (15:51 +0100)]
s3/rpc_server: add deps of rpc_mdssvc_module

This allows removing allow_undefined_symbols=True.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Jan 14 16:05:10 UTC 2021 on sn-devel-184

3 years agorpc_server: Remove protocol-specific dcerpc_setup_ routines
Volker Lendecke [Tue, 12 Jan 2021 16:53:57 +0000 (17:53 +0100)]
rpc_server: Remove protocol-specific dcerpc_setup_ routines

These are all just stream sockets, being taken care of by
dcesrv_setup_ncacn_listener()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Jan 14 14:35:58 UTC 2021 on sn-devel-184

3 years agorpc_server: Use dcesrv_setup_ncacn_listener() in dcesrv_setup_endpoint_sockets()
Volker Lendecke [Tue, 12 Jan 2021 16:36:44 +0000 (17:36 +0100)]
rpc_server: Use dcesrv_setup_ncacn_listener() in dcesrv_setup_endpoint_sockets()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
3 years agorpc_server: Add dcesrv_setup_ncacn_listener()
Volker Lendecke [Tue, 12 Jan 2021 15:48:25 +0000 (16:48 +0100)]
rpc_server: Add dcesrv_setup_ncacn_listener()

This is supposed to replace the protocol-specific dcerpc_setup_*
functions. They are all very similar except the way to create the
socket file descriptor. By handing out the anonymous structure
"listen_state" for an error path the listener tevent_fd structs can be
cancelled individually or handed over to other talloc parents.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
3 years agorpc_server: Move setting ip-based socket options
Volker Lendecke [Tue, 12 Jan 2021 16:03:42 +0000 (17:03 +0100)]
rpc_server: Move setting ip-based socket options

All ncacn_ip_tcp listener sockets are created via
dcesrv_create_ncacn_ip_tcp_socket(). Moving setting the socket options
out of dcesrv_setup_ncacn_ip_tcp_socket() to remove a special case for
TCP from the dcesrv_setup_* family of routines.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
3 years agorpc_server: Direct pointer initialization in dcesrv_ncacn_np_accept_done()
Volker Lendecke [Tue, 12 Jan 2021 15:57:59 +0000 (16:57 +0100)]
rpc_server: Direct pointer initialization in dcesrv_ncacn_np_accept_done()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
3 years agolib: Initialize variables in prefork_listen_accept_handler()
Volker Lendecke [Mon, 11 Jan 2021 14:36:11 +0000 (15:36 +0100)]
lib: Initialize variables in prefork_listen_accept_handler()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
3 years agolib: Fix typos
Volker Lendecke [Mon, 11 Jan 2021 14:23:41 +0000 (15:23 +0100)]
lib: Fix typos

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
3 years agorpc_server: Make dcerpc_ncacn_accept() take tsocket_address **
Volker Lendecke [Tue, 12 Jan 2021 08:26:24 +0000 (09:26 +0100)]
rpc_server: Make dcerpc_ncacn_accept() take tsocket_address **

dcerpc_ncacn_accept() talloc_move's the addresses away from the
caller's talloc hierarchy. Don't leave pointers around in the caller.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
3 years agotsocket: Fix a few typos
Volker Lendecke [Tue, 12 Jan 2021 08:25:45 +0000 (09:25 +0100)]
tsocket: Fix a few typos

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
3 years agorpc_server: Remove unused make_server_pipes_struct()
Volker Lendecke [Mon, 11 Jan 2021 20:37:08 +0000 (21:37 +0100)]
rpc_server: Remove unused make_server_pipes_struct()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
3 years agorpc_server: Use make_base_pipes_struct() in make_internal_rpc_pipe_socketpair()
Volker Lendecke [Mon, 11 Jan 2021 20:35:26 +0000 (21:35 +0100)]
rpc_server: Use make_base_pipes_struct() in make_internal_rpc_pipe_socketpair()

make_server_pipes_struct() is just a simple wrapper.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
3 years agorpc_server: Use make_base_pipes_struct() in dcesrv_ncacn_accept_step2()
Volker Lendecke [Mon, 11 Jan 2021 20:32:52 +0000 (21:32 +0100)]
rpc_server: Use make_base_pipes_struct() in dcesrv_ncacn_accept_step2()

make_server_pipes_struct() is just a simple wrapper.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
3 years agorpc_server: Simplify find_policy_by_hnd_internal()
Volker Lendecke [Mon, 11 Jan 2021 20:25:40 +0000 (21:25 +0100)]
rpc_server: Simplify find_policy_by_hnd_internal()

Best viewed with "git show -b". Use the typical pattern of an early
error return.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
3 years agovfs_fruit: Fix CID 1471764 Dereference null return value
Volker Lendecke [Tue, 12 Jan 2021 10:24:38 +0000 (11:24 +0100)]
vfs_fruit: Fix CID 1471764 Dereference null return value

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
3 years agovfs_fruit: Fix CID 1471760 Dereference null return value
Volker Lendecke [Tue, 12 Jan 2021 10:22:57 +0000 (11:22 +0100)]
vfs_fruit: Fix CID 1471760 Dereference null return value

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
3 years agotdb: Fix CID 1471761 String not null terminated
Volker Lendecke [Tue, 12 Jan 2021 10:19:54 +0000 (11:19 +0100)]
tdb: Fix CID 1471761 String not null terminated

This is a false positive (in is length 3 initialized to 0), but this
patch does not hurt

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
3 years agos3:smbd: simplify the error handling in create_file_unixpath()
Stefan Metzmacher [Mon, 21 Dec 2020 15:49:03 +0000 (16:49 +0100)]
s3:smbd: simplify the error handling in create_file_unixpath()

We can just call close_file(req, fsp, ERROR_CLOSE), as it handles
non-fsa fsp's and base_fsp's just fine.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Jan 14 12:40:56 UTC 2021 on sn-devel-184

3 years agos3:smbd: allow close_file() with a non-fsa fsp for {SHUTDOWN,ERROR}_CLOSE
Stefan Metzmacher [Wed, 23 Dec 2020 11:10:37 +0000 (12:10 +0100)]
s3:smbd: allow close_file() with a non-fsa fsp for {SHUTDOWN,ERROR}_CLOSE

Such an fsp was typically created via create_internal_fsp() and
opened via fd_openat() without going through SMB_VFS_CREATE_FILE(),
so they should be closed via fd_close().

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3:smbd: make sure a SHUTDOWN_CLOSE applies to a stream fsp before its base fsp
Stefan Metzmacher [Wed, 23 Dec 2020 10:50:34 +0000 (11:50 +0100)]
s3:smbd: make sure a SHUTDOWN_CLOSE applies to a stream fsp before its base fsp

Before we had open_pathref_fsp() we had the stream fsp before the base
fsp in the linked list we traverse for SHUTDOWN_CLOSE.

Now the order has changed. I could have used some DLIST_PROMOTE()
hacks, but that's still fragile.

Now we reference both fsp's via ->base_fsp and ->stream_fsp.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3:smbd: make use of fsp_set_base_fsp() when changing fsp->base_fsp
Stefan Metzmacher [Mon, 21 Dec 2020 15:35:11 +0000 (16:35 +0100)]
s3:smbd: make use of fsp_set_base_fsp() when changing fsp->base_fsp

This allows us to add some more logic for bi-directional linking between
base and stream fsp in the next commits.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3:smbd: add fsp_set_base_fsp() helper
Stefan Metzmacher [Mon, 21 Dec 2020 14:44:22 +0000 (15:44 +0100)]
s3:smbd: add fsp_set_base_fsp() helper

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3:smbd: remove duplicate assignment of base_fsp in create_file_unixpath()
Stefan Metzmacher [Mon, 4 Jan 2021 15:33:09 +0000 (16:33 +0100)]
s3:smbd: remove duplicate assignment of base_fsp in create_file_unixpath()

This has already been set a few lines above. The duplicate was the result of
restructuring create_file_unixpath() a few months ago, allocating fsp in
create_file_unixpath() instead of in the callees open_file_ntcreate() or
open_directory() respectively.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3:smbd: fix the error cleanup in create_file_unixpath()
Stefan Metzmacher [Mon, 21 Dec 2020 15:40:01 +0000 (16:40 +0100)]
s3:smbd: fix the error cleanup in create_file_unixpath()

We always need to cleanup the base_fsp!

Signed-off-by: Stefan Metzmacher <metze@samba.org>
3 years agos3:smbd: split out create_internal_fsp() from create_internal_dirfsp()
Stefan Metzmacher [Wed, 23 Dec 2020 10:50:34 +0000 (11:50 +0100)]
s3:smbd: split out create_internal_fsp() from create_internal_dirfsp()

That will be useful in other places as well.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3:smbd: make fsp_free() static, it should only ever be called by file_free()
Stefan Metzmacher [Mon, 21 Dec 2020 11:41:06 +0000 (12:41 +0100)]
s3:smbd: make fsp_free() static, it should only ever be called by file_free()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3:smbd: let vfs_default_durable_reconnect() use file_free()
Stefan Metzmacher [Mon, 21 Dec 2020 11:18:44 +0000 (12:18 +0100)]
s3:smbd: let vfs_default_durable_reconnect() use file_free()

We should always go through file_free(), which calls fsp_free() at the end.

Most things in file_free() may not apply to all
vfs_default_durable_reconnect() cases, but we want fsp_free() to become
static to files.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3:smbd: close pathref fsp in call_trans2findfirst()
Ralph Boehme [Tue, 12 Jan 2021 11:50:43 +0000 (12:50 +0100)]
s3:smbd: close pathref fsp in call_trans2findfirst()

Before freeing the fsp we have to close the handle.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 years agos3:smbd: turn assignment into assert check in call_trans2findfirst()
Ralph Boehme [Mon, 4 Jan 2021 15:09:43 +0000 (16:09 +0100)]
s3:smbd: turn assignment into assert check in call_trans2findfirst()

The pathref fsp link destructor will set smb_dname->fsp to NULL. Turning this
into an assert to give a hint at readers of the code trying to understand the
mechanics.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 years agos3:smbd: let call_trans2findfirst() use file_free() instead of fsp_free()
Stefan Metzmacher [Wed, 23 Dec 2020 12:28:40 +0000 (13:28 +0100)]
s3:smbd: let call_trans2findfirst() use file_free() instead of fsp_free()

This makes sure we call vfs_remove_all_fsp_extensions() before
fsp_free() is called from within file_free(). And allows us to
make 'fsp_free()' static in the next commits.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3:smbd: make sure openat_pathref_fsp() calls fd_close(fsp->base_fsp);
Stefan Metzmacher [Mon, 21 Dec 2020 14:31:25 +0000 (15:31 +0100)]
s3:smbd: make sure openat_pathref_fsp() calls fd_close(fsp->base_fsp);

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3:smbd: introduce a reopen_from_fsp() helper function
Stefan Metzmacher [Wed, 23 Dec 2020 14:48:36 +0000 (15:48 +0100)]
s3:smbd: introduce a reopen_from_fsp() helper function

In future we may move the reopen logic to the VFS,
but for now we just keep it in one place.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3:smbd: don't pass an unused smb_fname to reopen_from_procfd()
Stefan Metzmacher [Wed, 23 Dec 2020 15:03:37 +0000 (16:03 +0100)]
s3:smbd: don't pass an unused smb_fname to reopen_from_procfd()

Both callers pass in a helper variable that points to
fsp->fsp_name and it was only used for a debug message,
so we can simply use fsp_str_dgb() instead.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3:smbd: let open_directory() also use fd_open_atomic() as reopen_from_procfd() fallback
Stefan Metzmacher [Wed, 23 Dec 2020 14:38:03 +0000 (15:38 +0100)]
s3:smbd: let open_directory() also use fd_open_atomic() as reopen_from_procfd() fallback

Calling fd_open_atomic() without O_CREAT is the same as calling
fd_openat() directly, so we can also use it to open an existing
directory.

In the next step we'll move the reopen_from_procfd() fallback logic to
a single helper function.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3:smbd: let open_pathref_base_fsp() make use of smb_fname_fsp_unlink()
Stefan Metzmacher [Wed, 16 Dec 2020 14:12:46 +0000 (15:12 +0100)]
s3:smbd: let open_pathref_base_fsp() make use of smb_fname_fsp_unlink()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3:smbd: let openat_pathref_fsp() make use of fsp_attach_smb_fname()
Stefan Metzmacher [Wed, 16 Dec 2020 14:02:11 +0000 (15:02 +0100)]
s3:smbd: let openat_pathref_fsp() make use of fsp_attach_smb_fname()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3:smbd: let openat_pathref_fsp() allocate fsp->fsp_name directly on fsp
Stefan Metzmacher [Wed, 16 Dec 2020 13:50:08 +0000 (14:50 +0100)]
s3:smbd: let openat_pathref_fsp() allocate fsp->fsp_name directly on fsp

Otherwise we'll always keep the current talloc_stackframe arround.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3:smbd: split out a fsp_attach_smb_fname() helper function
Stefan Metzmacher [Wed, 16 Dec 2020 14:01:38 +0000 (15:01 +0100)]
s3:smbd: split out a fsp_attach_smb_fname() helper function

It's useful to watch this using: git show --histogram

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3:smbd: let fsp_set_smb_fname() always link fsp to fsp->fsp_name->fsp
Stefan Metzmacher [Wed, 16 Dec 2020 13:15:11 +0000 (14:15 +0100)]
s3:smbd: let fsp_set_smb_fname() always link fsp to fsp->fsp_name->fsp

This was only done if fsp->fsp_name already existed, but not the first time.

This also makes sure we modify fsp->fsp_name and fsp->name_hash only on success.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3:smbd: let fsp_smb_fname_link() set both sides of the link
Stefan Metzmacher [Wed, 16 Dec 2020 13:03:36 +0000 (14:03 +0100)]
s3:smbd: let fsp_smb_fname_link() set both sides of the link

We also need to be sure both sides were not linked before.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos3:smbd: rearrange move_smb_fname_fsp_link a bit
Stefan Metzmacher [Thu, 17 Dec 2020 10:05:21 +0000 (11:05 +0100)]
s3:smbd: rearrange move_smb_fname_fsp_link a bit

We only modify smb_fname_src on success.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agos4 auth ntlm: Fix integer overflow in authsam_password_check_and_record
Gary Lockyer [Tue, 12 Jan 2021 23:04:18 +0000 (12:04 +1300)]
s4 auth ntlm: Fix integer overflow in authsam_password_check_and_record

Fix a ubsan detected integer overflow.
../../source4/auth/ntlm/auth_sam.c:445:56: runtime error:
     signed integer overflow: 60 * 600000000
     cannot be represented in type 'int'

In practice this meant that the default for the smb.conf parameter
"old password allowed period" was approximately 16 seconds, rather than
the intended 60 minutes. Similarly the value used would be 22.5 times
less than the value specified in smd.conf.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jan 13 23:52:38 UTC 2021 on sn-devel-184

3 years agos3:libsmb: Use cli_credentials directly
Andreas Schneider [Wed, 13 Jan 2021 14:46:22 +0000 (15:46 +0100)]
s3:libsmb: Use cli_credentials directly

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Jan 13 21:32:52 UTC 2021 on sn-devel-184

3 years agos3:libsmb: Pass cli_credentials to get_ipc_connect_master_ip()
Andreas Schneider [Wed, 13 Jan 2021 14:40:08 +0000 (15:40 +0100)]
s3:libsmb: Pass cli_credentials to get_ipc_connect_master_ip()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3:libsmb: Pass cli_credentials to get_ipc_connect()
Andreas Schneider [Wed, 13 Jan 2021 14:35:11 +0000 (15:35 +0100)]
s3:libsmb: Pass cli_credentials to get_ipc_connect()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3:waf: Do not link tevent_glib_glue_test against popt_samba3
Andreas Schneider [Wed, 13 Jan 2021 13:59:20 +0000 (14:59 +0100)]
s3:waf: Do not link tevent_glib_glue_test against popt_samba3

This isn't used at all.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3:waf: Do not link smbspool against popt_samba3
Andreas Schneider [Wed, 13 Jan 2021 13:58:10 +0000 (14:58 +0100)]
s3:waf: Do not link smbspool against popt_samba3

This isn't used at all.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3:utils: Remove unused popt_common.h header from log2pcaphex.c
Andreas Schneider [Wed, 13 Jan 2021 12:35:20 +0000 (13:35 +0100)]
s3:utils: Remove unused popt_common.h header from log2pcaphex.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3:utils: Remove unused popt_common.h header from net_vfs.c
Andreas Schneider [Wed, 13 Jan 2021 12:23:47 +0000 (13:23 +0100)]
s3:utils: Remove unused popt_common.h header from net_vfs.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3:utils: Remove unused popt_common.h header from net_rpc_shell.c
Andreas Schneider [Wed, 13 Jan 2021 08:31:41 +0000 (09:31 +0100)]
s3:utils: Remove unused popt_common.h header from net_rpc_shell.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3:utils: Fix header and deps of mvxattr
Andreas Schneider [Wed, 13 Jan 2021 08:11:04 +0000 (09:11 +0100)]
s3:utils: Fix header and deps of mvxattr

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3:utils: Remove unused header and deps from destroy_netlogon_creds_cli
Andreas Schneider [Wed, 13 Jan 2021 08:04:01 +0000 (09:04 +0100)]
s3:utils: Remove unused header and deps from destroy_netlogon_creds_cli

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agos3: smbd: Add call to conn_setup_case_options() to create_conn_struct_as_root().
Jeremy Allison [Tue, 12 Jan 2021 19:44:44 +0000 (11:44 -0800)]
s3: smbd: Add call to conn_setup_case_options() to create_conn_struct_as_root().

Ensures temporary DFS share doesn't leave the case parameters set
as zero (i.e.:

conn->case sensitive = 0
conn->share_case_preserve = 0
and default case is lower

which can cause problems doing a DFS_GET_REFERRALS request).

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14612

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Wed Jan 13 18:14:31 UTC 2021 on sn-devel-184

3 years agos3: smbd: Factor out setting up case parameters for a share to a function - conn_setu...
Jeremy Allison [Tue, 12 Jan 2021 19:39:51 +0000 (11:39 -0800)]
s3: smbd: Factor out setting up case parameters for a share to a function - conn_setup_case_options().

Will allow it to be reused in the msdfs temporary share code.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14612

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 years agoWHATSNEW: Change order.
Karolin Seeger [Mon, 11 Jan 2021 11:51:20 +0000 (12:51 +0100)]
WHATSNEW: Change order.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
Autobuild-User(master): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(master): Tue Jan 12 10:12:02 UTC 2021 on sn-devel-184

3 years agoWHATSNEW: Add new parameters.
Karolin Seeger [Thu, 7 Jan 2021 08:04:50 +0000 (09:04 +0100)]
WHATSNEW: Add new parameters.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
3 years agopython/wscript: python3-asn1 -> python3-pyasn1
Karolin Seeger [Tue, 5 Jan 2021 08:33:30 +0000 (09:33 +0100)]
python/wscript: python3-asn1 -> python3-pyasn1

Signed-off-by: Karolin Seeger <kseeger@samba.org>
Reviewed-by: Björn Jacke <bjacke@samba.org>
3 years agolib: Fix 'charset' dependencies
Volker Lendecke [Sat, 9 Jan 2021 17:26:00 +0000 (18:26 +0100)]
lib: Fix 'charset' dependencies

With this, 'charset' could be a SAMBA_LIBRARY without any undefined symbols

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Jan 12 01:19:26 UTC 2021 on sn-devel-184

3 years agolib: Avoid "includes.h" in lib/util/charset/
Volker Lendecke [Sat, 9 Jan 2021 17:22:15 +0000 (18:22 +0100)]
lib: Avoid "includes.h" in lib/util/charset/

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolib: Remove using talloc_stack from lib/util/charset/
Volker Lendecke [Sat, 9 Jan 2021 17:20:34 +0000 (18:20 +0100)]
lib: Remove using talloc_stack from lib/util/charset/

'charset' should be as standalone as possible, and for this one use
talloc_stackframe() is not really necessary.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolib: lib/param/param.h references TALLOC_CTX
Volker Lendecke [Sun, 3 Jan 2021 20:52:06 +0000 (21:52 +0100)]
lib: lib/param/param.h references TALLOC_CTX

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agolibrpc: gen_ndr/dcerpc.h references DATA_BLOB
Volker Lendecke [Sun, 3 Jan 2021 20:51:34 +0000 (21:51 +0100)]
librpc: gen_ndr/dcerpc.h references DATA_BLOB

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>