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

52734 Commits

Author SHA1 Message Date
Samuel Cabrero
5a54486424 s3:rpc_server: Return NTSTATUS for dcesrv_setup_ncalrpc_socket
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2019-07-22 16:49:13 +00:00
Samuel Cabrero
1a1f31e082 s3:rpc_server: Rename setup_dcerpc_ncalrpc_socket
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2019-07-22 16:49:13 +00:00
Samuel Cabrero
cbf497dc09 s3:rpc_server: Use new debug macros in dcesrv_setup_ncacn_ip_tcp_socket
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2019-07-22 16:49:13 +00:00
Samuel Cabrero
ae14c51080 s3:rpc_server: Return NTSTATUS for dcesrv_setup_ncacn_ip_tcp_socket
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2019-07-22 16:49:13 +00:00
Samuel Cabrero
a6b5899853 s3:rpc_server: Rename setup_dcerpc_ncacn_tcpip_socket
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2019-07-22 16:49:13 +00:00
Samuel Cabrero
3f4be0b9db s3:rpc_server: Rename rpc_create_tcpip_sockets
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2019-07-22 16:49:13 +00:00
Samuel Cabrero
edc8ef722c s3:rpc_server: Rename dcerpc_ncacn_tcpip_listener
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2019-07-22 16:49:13 +00:00
Samuel Cabrero
6b2aefc579 s3:rpc_server: Use new debug macros for dcesrv_create_ncacn_ip_tcp_socket
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2019-07-22 16:49:13 +00:00
Samuel Cabrero
e3999a14da s3:rpc_server: Return NTSTATUS for dcesrv_create_ncacn_ip_tcp_socket
Additionally to the fd number, check the port number has been correctly
assigned. This check was performed by the callers of this function.

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2019-07-22 16:49:13 +00:00
Samuel Cabrero
b7817eaf3d s3:rpc_server: Rename create_tcpip_socket
Additionally move function declaration from proto.h to rpc_server.h

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2019-07-22 16:49:13 +00:00
Stefan Metzmacher
5ed7ee7279 s3:rpc_server: simplify the error checking of create_tcpip_socket() callers
create_tcpip_socket() never returns a valid fd and left port as 0.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-07-22 16:49:13 +00:00
Samuel Cabrero
b52d58d6e1 s3:rpc_server: Rename named_pipe_listener
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2019-07-22 16:49:13 +00:00
Samuel Cabrero
fc3d582cca s3:rpc_server: Switch to new debug macros for dcesrv_setup_ncacn_np_socket
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2019-07-22 16:49:13 +00:00
Samuel Cabrero
e05ce7b9e7 s3:rpc_server: Return NTSTATUS for dcesrv_setup_ncacn_np_socket
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2019-07-22 16:49:12 +00:00
Samuel Cabrero
b6537c15c1 s3:rpc_server: Rename setup_named_pipe_socket
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2019-07-22 16:49:12 +00:00
Samuel Cabrero
3fdd4dc03a s3:rpc_server: Switch to new debug macros for dcesrv_create_ncacn_np_socket
Additionally messages are improved.

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2019-07-22 16:49:12 +00:00
Samuel Cabrero
4a5c440b08 s3:rpc_server: Return NTSTATUS for dcesrv_create_ncacn_np_socket
The 'fd' state struct member is initialized after allocation because it
is checked in the error path.

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2019-07-22 16:49:12 +00:00
Samuel Cabrero
7f8f857dfe s3:rpc_server: Rename create_named_pipe_socket
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2019-07-22 16:49:12 +00:00
Samuel Cabrero
af576d335a s3:rpc_server: Rename dcerpc_ncalrpc_listener
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2019-07-22 16:49:12 +00:00
Samuel Cabrero
05507d4d19 s3:rpc_server: Switch to new debug macros for dcesrv_create_ncalrpc_socket
Additionally new debug messages are added and the existing ones improved.

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2019-07-22 16:49:12 +00:00
Samuel Cabrero
3153814db4 s3:rpc_server: Return NTSTATUS for dcesrv_create_ncalrpc_socket
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2019-07-22 16:49:12 +00:00
Samuel Cabrero
c0b1884c99 s3:rpc_server: Rename create_dcerpc_ncalrpc_socket
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2019-07-22 16:49:12 +00:00
Volker Lendecke
b0fc1ca65a lib: Fix the 32-bit build
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Jul 18 12:55:30 UTC 2019 on sn-devel-184
2019-07-18 12:55:30 +00:00
Volker Lendecke
79e3b1c71f smbd: Increase a debug level
This is not a real error, it happens when the share mode record is not
around.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
2019-07-17 11:27:20 +00:00
Noel Power
c461352172 s3/lib/smbconf: clang: 'Value stored during its initialization is never read'
Fixes:

source3/lib/smbconf/smbconf_reg.c:123:9: warning: Value stored to 'werr' during its initialization is never read <--[clang]
        WERROR werr = WERR_OK;
               ^~~~   ~~~~~~~
source3/lib/smbconf/smbconf_reg.c:178:9: warning: Value stored to 'werr' during its initialization is never read <--[clang]
        WERROR werr = WERR_OK;
               ^~~~   ~~~~~~~
source3/lib/smbconf/smbconf_reg.c:444:9: warning: Value stored to 'werr' during its initialization is never read <--[clang]
        WERROR werr = WERR_OK;
               ^~~~   ~~~~~~~
source3/lib/smbconf/smbconf_reg.c:583:9: warning: Value stored to 'werr' during its initialization is never read <--[clang]
        WERROR werr = WERR_OK;
               ^~~~   ~~~~~~~
source3/lib/smbconf/smbconf_reg.c:712:9: warning: Value stored to 'werr' during its initialization is never read <--[clang]
        WERROR werr = WERR_OK;
               ^~~~   ~~~~~~~
source3/lib/smbconf/smbconf_reg.c:995:9: warning: Value stored to 'werr' during its initialization is never read <--[clang]
        WERROR werr = WERR_OK;
               ^~~~   ~~~~~~~
source3/lib/smbconf/smbconf_reg.c:1103:9: warning: Value stored to 'werr' during its initialization is never read <--[clang]
        WERROR werr = WERR_OK;
               ^~~~   ~~~~~~~
7 warnings generated.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>

Autobuild-User(master): Gary Lockyer <gary@samba.org>
Autobuild-Date(master): Wed Jul 17 00:07:48 UTC 2019 on sn-devel-184
2019-07-17 00:07:48 +00:00
Noel Power
b388c217d4 s3/lib: clang: 'Value stored to 'rta' is never read'
Fixes:
source3/lib/addrchange.c:217:2: warning: Value stored to 'rta' is never read <--[clang]
        rta = IFA_RTA(ifa);
        ^     ~~~~~~~~~~~~
1 warning generated.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2019-07-16 22:52:25 +00:00
Noel Power
963f58fb62 s3/registry: clang: Fix 'initialization value is never read'
Fixes:

source3/registry/reg_backend_db.c:853:9: warning: Value stored to 'result' during its initialization is never read <--[clang]
        WERROR result = WERR_OK;
               ^~~~~~   ~~~~~~~

source3/registry/reg_backend_db.c:1677:2: warning: Value stored to 'len' is never read <--[clang]
        len = 0;
        ^     ~
2 warnings generated.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2019-07-16 22:52:25 +00:00
Noel Power
80e57a1016 s3/registry: clang: Fix 'initialization value is never read'
Fixes:

source3/registry/reg_api.c:139:14: warning: Value stored to 'result' during its initialization is never read <--[clang]
        WERROR          result = WERR_OK;
                        ^~~~~~   ~~~~~~~
ource3/registry/reg_api.c:958:9: warning: Value stored to 'werr' during its initialization is never read <--[clang]
        WERROR werr = WERR_OK;
               ^~~~   ~~~~~~~
2 warnings generated.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2019-07-16 22:52:25 +00:00
Noel Power
e3e9330609 s3/lib: clang: Fix 'passed-by-value struct argument contains uninit-ed data'
Fixed:

g_lock.c:358:21: warning: Passed-by-value struct argument contains uninitialized data (e.g., field: 'pid') <--[clang]
        state->watch_req = dbwrap_watched_watch_send(
                           ^
1 warning generated.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2019-07-16 22:52:25 +00:00
Noel Power
4f61a9980d s3/param: clang: Fix 'Value stored to 'bRetval' is never read'
Fixes:

source3/param/loadparm.c:2770:2: warning: Value stored to 'bRetval' is never read <--[clang]
        bRetval = false;
        ^         ~~~~~
source3/param/loadparm.c:3868:2: warning: Value stored to 'bRetval' is never read <--[clang]
        bRetval = false;
        ^         ~~~~~
2 warnings generated.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2019-07-16 22:52:24 +00:00
Noel Power
80f5461ae6 s3/lib: clang: Fix 'Value stored to 'b' is never read'
Fixes:

source3/lib/substitute.c:516:7: warning: Value stored to 'b' is never read <--[clang]
        for (b = s = a_string; (p = strchr_m(s, '%')); s = a_string + (p - b)) {
             ^   ~~~~~~~~~~~~
source3/lib/substitute.c:709:7: warning: Value stored to 'b' is never read <--[clang]
        for (b = s = a_string; (p = strchr_m(s, '%')); s = a_string + (p - b)) {
             ^   ~~~~~~~~~~~~
source3/lib/substitute.c:811:7: warning: Value stored to 'b' is never read <--[clang]
        for (b = s = a_string; (p = strchr_m(s, '%')); s = a_string + (p - b)) {
             ^   ~~~~~~~~~~~~
3 warnings generated.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2019-07-16 22:52:24 +00:00
Noel Power
0ca6d34a69 s3/lib/dwrap: clang: Fix 'Array access results in a null pointer dereference'
Fixes:

source3/lib/dbwrap/dbwrap_watch.c:55:3: warning: Array access (from variable 'wkey') results in a null pointer dereference <--[clang]
                SIVAL(wkey, 0, db_id_len);
                ^
1 warning generated.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2019-07-16 22:52:24 +00:00
Noel Power
57e9b358ec s3/lib: clang: Fix 'Value stored during its initialization is never read'
Fixes:

source3/lib/messages.c:483:11: warning: Value stored to 'status' during its initialization is never read <--[clang]
        NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
                 ^~~~~~   ~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2019-07-16 22:52:24 +00:00
Michael Adam
5522aa1a4c vfs:glusterfs_fuse: ensure fileids are constant across nodes
Instead of adding a new gluster-specific mode to the fileid module,
this patches provides a fileid algorithm as part of the glusterfs_fuse
vfs module. This can not be configured further, simply adding the
glusterfs_fuse vfs module to the vfs objects configuration will enable
the new fileid mode.

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

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Guenther Deschner <gd@samba.org>

Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Sat Jul 13 22:54:56 UTC 2019 on sn-devel-184
2019-07-13 22:54:56 +00:00
Ralph Boehme
36b48aa783 s3:net: add 'net vfs getntacl' command
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 Jul 12 22:59:58 UTC 2019 on sn-devel-184
2019-07-12 22:59:58 +00:00
Ralph Boehme
bb37a88e63 s4/torture: add a vfs_fruit unconversion test
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-12 21:31:30 +00:00
Ralph Boehme
17496a39b1 s3:net: add 'vfs' hierarchy with 'stream2adouble' command
This adds a new top-level command hierarchy 'vfs' that can be used to add
commands that access the smbd VFS stack.

The first command to be implemented is 'stream2adouble' which can be used to
convert stream metadata to AppleDouble files.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-12 21:31:29 +00:00
Ralph Boehme
a331b15e2b adouble: add ad_unconvert()
This collects a file's stream data and packs it into a AppleDouble file.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-12 21:31:29 +00:00
Ralph Boehme
145c54e4de s3: move fruit catia string replace mappings to s3/lib/
This will be needed by another component soonish.

Signed-off-by: Ralph Boehme <slow@samba.org>
2019-07-12 21:31:29 +00:00
Ralph Boehme
cd3b418726 s3:{modules => lib}/string_replace.[c|h]
This is now also consumed by something outside source3/modules/.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-12 21:31:29 +00:00
Ralph Boehme
1acdca7519 vfs_fruit: remove duplicate catia mappings
0x0d:0xf00d is already given a few lines above.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-12 21:31:29 +00:00
Ralph Boehme
2bd926accd s3:modules: pass a TALLOC_CTX to string_replace_init_map()
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-12 21:31:29 +00:00
Ralph Boehme
f820647fa1 adouble: ensure stat info is marked invalid on new path
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-12 21:31:29 +00:00
Ralph Boehme
a2a30e63d5 adouble: remove xattrs after successfull conversion
This ensure the subsequent ad_fset() does not attempt to put back the xattrs on
disk in the AppleDouble file. It's not yet a problem as we don't have the code
that would do that, but that will be added in the next commit...

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-12 21:31:29 +00:00
Ralph Boehme
0f5fde7bed adouble: add some ASCII art
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-12 21:31:29 +00:00
Ralph Boehme
1c464232f8 adouble: use runtime size when writing out AppleDouble header
We're calling SMB_VFS_NEXT_PWRITE() to write out the AppleDouble header
data. Until now this header always had a fixed sizeof AD_DATASZ_DOT_UND bytes,
but a subsequent commit will change that. Use the correct size which is the
offset of the begining of the resource fork data.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-12 21:31:29 +00:00
Ralph Boehme
5e52d9ebf0 adouble: pass VFS handle and fsp to ad_pack()
Unused for now, that comes next.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-12 21:31:29 +00:00
Ralph Boehme
79e0110e46 adouble: remove redundant calls to ad_pack()
ad_fset() calls ad_pack() anyway...

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-12 21:31:29 +00:00
Ralph Boehme
3093c374f2 s3:lib: move Mac streams util functions to s3/lib
While at it, change the functions to work on the stream name directly instead of
struct smb_filename. A later commit wants to use the function on the resulting
stream names coming from vfs_streaminfo().

Also use the simple string compare version, not the multibyte ones, as the afp*
stream names are simple ASCII string, so there's no need to become fancy.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-12 21:31:29 +00:00
Ralph Boehme
dbc840e740 vfs_fruit: move AppleDouble functionality to a dedicated subsystem
It's still tied to the VFS, therefor it lives in source3/modules/. Reduces code
bloat in vfs_fruit and makes it possible to use it from other parts of the
codebase in future.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-12 21:31:29 +00:00
Ralph Boehme
f9df2b67ce vfs_fruit: pass catia mappings as argument to ad_convert()
This removes the direct use of fruit_catia_maps from ad_convert(), to make it
possible to move the whole AppleDouble functionality to a dedicated subsystem.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-12 21:31:29 +00:00
Ralph Boehme
1bf4175a23 vfs_fruit: add flags to ad_convert()
A subsequent commmit will move all AppleDouble related functionality, including
ad_convert(), to a different compilation unit. We must therefor remove the
dependency on struct fruit_config_data.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-12 21:31:29 +00:00
Ralph Boehme
c7bb524438 vfs_fruit: convert adouble accessor macros to functions
The functions will be moved to a different compilation unit in a subsequent
commit and struct adouble will become a private struct so callers can't access
it directly.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-12 21:31:29 +00:00
Jeremy Allison
09ddad6c14 s3: smbd: Remove ifdef'ed out dptr_close_oldest().
No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jul 10 00:28:51 UTC 2019 on sn-devel-184
2019-07-10 00:28:51 +00:00
Jeremy Allison
6134922f7b s3: smbd: Remove the 'close oldest' logic in SMB1 trans2 search processing.
Will be removed in next commit.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-07-09 23:12:17 +00:00
Jeremy Allison
1376dc3b84 s3: smbd: Remove the 'close oldest' logic in SMB1search processing.
Expect the client to manage their handles properly.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-07-09 23:12:17 +00:00
Jeremy Allison
ff8c8b34b9 s3: smbd: Remove now unused parameter 'forclose' to dptr_get().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-07-09 23:12:17 +00:00
Jeremy Allison
e21b75168d s3: smbd: globals - remove dirhandles_open from internal search struct.
It wasn't used for SMB2 anyway, and isn't useful for anything.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-07-09 23:12:17 +00:00
Jeremy Allison
d9d00ad068 s3: smbd: We no longer need to keep a count of dirhandles open.
It's not per-connection struct anyway, so doesn't
help for anything.

Remove now unused variable struct smbd_server_connection *sconn
otherwise we get compile errors.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-07-09 23:12:16 +00:00
Jeremy Allison
096a98f6ea s3: smbd: Add a note explaining MAX_DIRECTORY_HANDLES only applies to SMB1.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-07-09 23:12:16 +00:00
Jeremy Allison
ab65fa9af0 s3: smbd: Remove now unused MAX_OPEN_DIRECTORIES define.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-07-09 23:12:16 +00:00
Jeremy Allison
288d71678b s3: smbd: Remove unused dptr_idleoldest() and dptr_idle() functions.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-07-09 23:12:16 +00:00
Jeremy Allison
7b6129d14e s3: smbd: Remove SMB1 idle unused directory handles code.
This is only needed for broken SMB1 DOS clients, and
we're a long way from needing this anymore.

ifdef out dptr_idleoldest() and dptr_idle()
functions as otherwise we get "unused function"
compile errors. Remove in next commit.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-07-09 23:12:16 +00:00
Jeremy Allison
7b98319f30 s3: smbd: Remove MAX_OPEN_DIRECTORIES check in dptr_create().
This is a bug in that it's artificially limiting the number
of open directories an SMB2 client can have. If this code
was needed it should by SMB1 specific.

However we should allow the clients to decide for themselves
how many directory handles they need, not limit to MAX_OPEN_DIRECTORIES.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-07-09 23:12:16 +00:00
Jeremy Allison
a43e677134 s3: smbd: Remove now unused dptr_idlecnum().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-07-09 23:12:16 +00:00
Jeremy Allison
80ae1eba8c s3: smbd: Remove unused DPTR_IDLE_TIMEOUT.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-07-09 23:12:16 +00:00
Jeremy Allison
609c9a58ce s3: smbd: Don't idle SMB1 directory scans after DPTR_IDLE_TIMEOUT.
Only broken SMB1 clients leave directory scans hanging
and we shouldn't support that.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-07-09 23:12:16 +00:00
Jeremy Allison
461001cbc1 s3: smbd: Don't idle connections with active SMB1 directory scans.
When all scans are via file handles this code can
be removed.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-07-09 23:12:16 +00:00
Jeremy Allison
abc58a4a12 s3: smbd: Add dptr_activecnum(), not yet used.
Will be used to help remove the SMB1 idle directory
code.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-07-09 23:12:16 +00:00
Andreas Schneider
ccf3e76625 s3:profile: Allow profile subsystem to use SHA1 in FIPS mode
This is non-cryptographic use.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Jul  9 13:31:46 UTC 2019 on sn-devel-184
2019-07-09 13:31:46 +00:00
Andreas Schneider
31a943fa08 lib:crypto: Add GNUTLS_FIPS140_SET_(LAX|STRICT)_MODE to helpers
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14031

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2019-07-09 12:16:11 +00:00
Andreas Schneider
6fe2193b17 s3:profile: Use SHA1 for hashing in profiling functions.
This can use SHA NI instructions if the CPU supports it.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2019-07-09 12:16:10 +00:00
Ralph Boehme
bf5d5fd17c docs/xml: change default for "mangled names" to "illegal"
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2019-07-08 16:22:38 +00:00
Stefan Metzmacher
3264b1f317 docs-xml: change "client min protocol" to SMB2_02
It's time to disable SMB1 by default...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2019-07-08 16:22:38 +00:00
Stefan Metzmacher
840b8501b4 docs-xml: change "server min protocol" to SMB2_02
SMB2_02 was available with Windows Vista.
It's time to turn SMB1 off by default.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2019-07-08 16:22:37 +00:00
Volker Lendecke
32766db210 smbd: Move fcb_or_dos_open() out of open_file_ntcreate()
This is SMB1-only and pre-ntcreate with only 3 callers that look at
NTCREATEX_OPTIONS_PRIVATE_DENY_[DOS|FCB]. It is a bit less efficient
if it kicks in (we have to recreate the fsp), but SMB1 is less and
less popular, and this particular share mode combination from the
open&x family of calls might not be worth optimizing for.

This adds smb1_utils.[ch] as a kitchen sink for functions that can go
away once we drop SMB1.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2019-07-08 16:22:37 +00:00
Volker Lendecke
b16f7113eb smbd: Slightly simplify open_mode_check()
If there are no share modes, we'll just not enter the loop.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2019-07-08 16:22:37 +00:00
Volker Lendecke
9c81d7ec8d vfs_fruit: Fix a typo
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2019-07-08 16:22:37 +00:00
Volker Lendecke
aab429c1d9 smbd: Slightly simplify fsp_lease_update()
We have already dereferenced fsp->lease

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2019-07-08 16:22:37 +00:00
Volker Lendecke
cb2e6226fe smbd: Simplify smbd_smb2_setinfo_send()
Avoid an "else" branch

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2019-07-08 16:22:37 +00:00
Volker Lendecke
81011f5ea1 smbd: Make get_relative_fid_filename() static to open.c
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2019-07-08 16:22:37 +00:00
Volker Lendecke
9f0820f9ef smbd: Make find_share_mode_entry() static to locking.c
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2019-07-08 16:22:37 +00:00
Noel Power
96e00a5258 s3/lib: Fix Access to field results in dereference of NULL pointer
Fixes:

ource3/lib/messages_dgm.c:176:29: warning: Access to field 'queue' results in a dereference of a null pointer (loaded from variable 'out') <--[clang]
        qlen = tevent_queue_length(out->queue);

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2019-07-08 09:30:10 +00:00
Björn Jacke
d6b8cbc8f7 param: change default of "allocation roundup size" to 0
Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2019-07-07 21:32:25 +00:00
Christof Schmitt
b1fc6e435b s3:tests: Add test for manual smbtorture zero-data
Ensure that these tests keep working.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Jul  5 05:02:12 UTC 2019 on sn-devel-184
2019-07-05 05:02:12 +00:00
Jeremy Allison
4a9d46dafb s3: smbd: SMB1 add range checks to reply_fclose().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Jul  4 15:40:31 UTC 2019 on sn-devel-184
2019-07-04 15:40:31 +00:00
Jeremy Allison
522fe23612 s3: smbd: SMB1 add range checks to reply_search().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2019-07-04 14:03:29 +00:00
Bjoern Jacke
173923c41a vfs_nfs4acl_xattr: fix setting of permissions via NFS
via NFS root may not be priviledged user, so we should not call become_root()
here. The normal NFS4 permissions already handle permission modify right, no
need to do more magic things for Samba here.

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2019-07-04 14:03:29 +00:00
Volker Lendecke
8bae5d82e2 smbd: Don't store num_read_oplocks in brlock.tdb
This removes a kludgy implementation that worked around a locking
hierarchy problem: Setting a byte range lock had to contend the level2
oplocks, which are stored in locking.tdb/leases.tdb. We could not
access locking.tdb in the brlock.tdb code, as brlock.tdb might have
been locked first without locking.tdb, violating the locking hierarchy
locking.tdb->brlock.tdb. Now that that problem is gone (see the commit
wrapping do_lock() in share_mode_do_locked()), we can remove this
kludge.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2019-07-04 14:03:29 +00:00
Volker Lendecke
2d7efba0d9 smbd: Use share_mode's flags in contend_level2_oplocks
Here we traverse the oplocks and leases when breaking read leases. We
find out here whether any of those are still left.

As it's the receivers of the messages that downgrade the database
entries, we might do that more than once. Possible future
optimization?

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2019-07-04 14:03:29 +00:00
Volker Lendecke
0e34096cae smbd: Set SHARE_MODE_HAS_READ_LEASE when downgrading an oplock
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2019-07-04 14:03:29 +00:00
Volker Lendecke
ffd098d8bb smbd: Set SHARE_MODE_HAS_READ_LEASE when granting a read lease
Lazy update of the flag: Whenever we add a read lease, we have to set
the flag. Nobody except contend_level2_oplocks_begin will remove that
flag again, as this would mean a full lease traverse when removing
one. And contend_level2_oplocks_begin traverses the leases anyway

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2019-07-04 14:03:29 +00:00
Volker Lendecke
0d4c4e045e smbd: Add file_has_read_lease()
This caches share_mode_data->flags in the fsp, cache flush happening
on tdb_seqnum change.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2019-07-04 14:03:29 +00:00
Volker Lendecke
01428c55dd smbd: Add flags to the beginning of share_mode_data
They are put at the beginning for easy parsing without reading the
full struct. First step to remove the number of read oplocks/leases
from brlock.tdb, where it does not belong.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2019-07-04 14:03:29 +00:00
Volker Lendecke
c5659f7b05 smbd: Send do_lock() through share_mode_do_locked()
We need to maintain the locking hierarchy locking.tdb->brlock.tdb at
all times. vfs_fruit directly calls do_lock(), which might fail to
maintain the locking hierarchy: In brlock.c we call
contend_level2_oplocks_begin(), which will soon look at the
locking.tdb record.

For the SMB1 and SMB2 callers we already have the share mode locked,
we might want to watch that record for unlocks. For those callers
share_mode_do_locked() is practically free to call, we share the
underlying db_record.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2019-07-04 14:03:29 +00:00
Volker Lendecke
44a77e6a5f smbd: Add share_mode_do_locked()
This is made for efficient locking of share mode records in
locking.tdb. Right now we already need that when accessing leases.tdb,
and soon it will be required for brlock.tdb as well. It does not give
direct access to the parsed share mode entry, but the record is
available for dbwrap_watched_wakeup() within downgrade_lease().

It can be freely nested with get_share_mode_lock calls, the record
will be shared and proper nesting should be checked.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2019-07-04 14:03:29 +00:00
Volker Lendecke
0be81cda56 smbd: Introduce static_share_mode_record
The next commit will introduce share_mode_do_locked(), which allocates
a share mode record on the stack. We have to expect nested
get_share_mode_lock() calls from within share_mode_do_locked() for
which we need to share a db_record.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2019-07-04 14:03:29 +00:00
Volker Lendecke
aabc97ebc9 smbd: Simplify share_mode_lock.c
Do explicit refcounting instead of talloc_reference(). A later patch
will introduce a share_mode_do_locked() routine that can be nested
arbitrarily with get_share_mode_lock(). To do sanity checks for proper
nesting, share_mode_do_locked needs to be aware of the reference
counts for "static_share_mode_lock".

Why is share_mode_memcache_delete() gone? In parse_share_modes() we
already move the data out of the cache, share_mode_lock_destructor()
we don't even bother re-adding the share_mode_data to the cache if
it does not have share entries, because the next opener will invent a
new seqnum anyway.

Also: Less talloc_reference(), less lines of code.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2019-07-04 14:03:29 +00:00
Volker Lendecke
3b7b979ee9 dbwrap: Add publically available dbwrap_watch_wakeup()
Without this, to notify watchers you need to actually store data. This
might be a waste of resources. locking.tdb waiters might actually wait
for leases.tdb or brlock.tdb changes, and locking.tdb records can be
large.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2019-07-04 14:03:28 +00:00
Volker Lendecke
1920ebfda8 dbwrap: Rename dbwrap_watched_wakeup()
In the next step I want to make dbwrap_watched_wakeup() publically
available under that canonical name.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2019-07-04 14:03:28 +00:00
Ralf Habacker
1b39c56354 winbind: fix crash in fill_domain_username_talloc() if specified username is NULL
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jul  3 19:24:52 UTC 2019 on sn-devel-184
2019-07-03 19:24:52 +00:00
Amit Kumar
4992c9bbbb docs: Correct 'net ads dns unregister --help' description
This change corrects the content of 'net ads dns unregister --help'
command. Updated output would be:
Usage:
net ads dns unregister [hostname]
    Remove all IP Address entires for a given
    hostname from the Active Directory server.

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

Signed-off-by: Amit Kumar <amitkuma@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Jul  3 15:12:50 UTC 2019 on sn-devel-184
2019-07-03 15:12:50 +00:00
Andreas Schneider
9d5044fe97 s3:modules: Use hash_inode() in vfs_streams_xattr
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Jul  3 12:37:12 UTC 2019 on sn-devel-184
2019-07-03 12:37:11 +00:00
Andreas Schneider
10f828629b s3:modules: Use hash_inode() in vfs_fruit
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2019-07-03 11:19:20 +00:00
Andreas Schneider
855540a899 s3:modules: Allow SHA1 usage for file IDs in FIPS mode
This is non-cryptographic use!

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2019-07-03 11:19:20 +00:00
Andreas Schneider
cf0442bff1 s3:modules: Add hash_inode() function based on SHA1
This should use SHA1 as modern CPUs have SHA NI instruction support.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2019-07-03 11:19:20 +00:00
Volker Lendecke
9b017ab046 smbd: Simplify filename_convert_internal()
Use a direct struct assignment

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 Jul  2 18:17:39 UTC 2019 on sn-devel-184
2019-07-02 18:17:39 +00:00
Volker Lendecke
ce3666fb83 smbd: Remove unused "msg_ctx" from smbd_smb1_do_locks_send()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-02 17:01:28 +00:00
Volker Lendecke
f952967e58 smbd: Remove unused "msg_ctx" from smbd_do_locks_try()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-02 17:01:28 +00:00
Volker Lendecke
45d2720a87 smbd: Remove unused "msg_ctx" from locking_close_file()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-02 17:01:28 +00:00
Volker Lendecke
0658626776 smbd: Remove unused "msg_ctx" from do_unlock()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-02 17:01:28 +00:00
Volker Lendecke
316365805a smbd: Remove unused "msg_ctx" from brl_close_fnum()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-02 17:01:28 +00:00
Volker Lendecke
c2292a85f5 smbd: Remove unused "msg_ctx" from brl_unlock()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-02 17:01:27 +00:00
Volker Lendecke
39f14da9ad vfs: Remove unused "msg_ctx" from SMB_VFS_BRL_UNLOCK_WINDOWS
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-02 17:01:27 +00:00
Volker Lendecke
3a93c63894 smbd: Remove unused "msg_ctx" from brl_unlock_posix()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-02 17:01:27 +00:00
Volker Lendecke
4d75c0aa53 smbd: Remove unused "msg_ctx" from do_lock()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-02 17:01:27 +00:00
Volker Lendecke
b809e68c12 smbd: Remove unused "msg_ctx" from brl_lock()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-02 17:01:27 +00:00
Volker Lendecke
5a89031cf8 smbd: Remove unused "msg_ctx" from brl_lock_posix
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-02 17:01:27 +00:00
Volker Lendecke
a045b9b1f3 smbd: Remove unused "blocking_lock" from brl_lock_windows_default()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-02 17:01:27 +00:00
Volker Lendecke
f83775d855 vfs: Remove "blocking_lock" from SMB_VFS_BRL_LOCK_WINDOWS
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-02 17:01:27 +00:00
Volker Lendecke
37c9c4c3ce smbd: brl_lock() never sees blocking locks anymore
This is now all handled in protocol-specific layers

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-02 17:01:27 +00:00
Volker Lendecke
5a012a0fdf smbd: do_lock() never sees blocking locks anymore
This is now all handled in protocol-specific layers

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-02 17:01:27 +00:00
Volker Lendecke
b70d855e1a smbd: Make do_lock() return NTSTATUS
This routine did a NO-GO: It returned something on talloc_tos(), for
later consumption by push_blocking_lock_request. This is now gone, no
caller uses the "struct byte_range_lock" returned anymore.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-02 17:01:27 +00:00
Volker Lendecke
b0d4939d6c smbd: Avoid casts in do_lock()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-02 17:01:27 +00:00
Volker Lendecke
e36398d93b smbd: Ensure initialized vars in do_lock
brl_lock does not initialize these variables in all cases

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-02 17:01:27 +00:00
Douglas Bagnall
dfe32af975 net idmap check: correct spelling of --force
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-07-02 04:21:36 +00:00
Ralph Boehme
6e65c28312 selftest: add a test that itime is not set when setting DOS attrs
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): Mon Jul  1 23:21:07 UTC 2019 on sn-devel-184
2019-07-01 23:21:07 +00:00
Ralph Boehme
03690ec218 vfs_fruit: change default for "fruit:zero_file_id" to false
Now that we have reliable File-IDs, change the default for the option
"zero_file_id" to false.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-01 21:43:24 +00:00
Ralph Boehme
eb98678656 vfs_fruit: make "fruit:zero_file_id" a per share option
Now that File-ID calculation goes through the VFS, we can nicely make a
per-share option out of it.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-01 21:43:24 +00:00
Ralph Boehme
076f26dd5c vfs_fruit: move zero file-id to vfs_fruit
Now that this stuff goes through the VFS, let's do it right. :)

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-01 21:43:24 +00:00
Ralph Boehme
36d100e4b8 s3:smbd: set file_id in fetch_dos_mode_done()
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-01 21:43:24 +00:00
Ralph Boehme
a3caf4140c s3:smbd: use stored file_id in SMB_VFS_FS_FILE_ID()
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-01 21:43:24 +00:00
Ralph Boehme
df5752ec90 s3:vfs: move get_fs_file_id to vfs_default
This makes get_fs_file_id() the default implementation of
SMB_VFS_FS_FILE_ID(). No change in behaviour.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-01 21:43:24 +00:00
Ralph Boehme
71996fef09 s3:vfs: add SMB_VFS_FS_FILE_ID()
Not yet used, that comes next.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-01 21:43:24 +00:00
Ralph Boehme
d2bac65e2e s3:smbd: rename get_FileIndex() to get_fs_file_id()
Also rename all variable used to store the result of the renamed
get_fs_file_id() in the callers.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-01 21:43:24 +00:00
Ralph Boehme
e6cdd4862f s3:smbd: return inode number, not FileIndex for UNIX query info level
get_FileIndex() returns a stable and unique numerical identifier when "store dos
attributes" is enabled. It is NOT the same as a file's inode number which used
as the key for locking.tdb.

For POSIX clients we should return the inode numbers in the POSIX query info
level and the FileIndex in the corresponding SMB protocol fields (eg SMB2 QFID
create context).

This fix lets test "smbtorture_s3.plain.CLEANUP3" test work with get_FileIndex()
returning something different then the file's inode number.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-01 21:43:24 +00:00
Ralph Boehme
ebe7b8c58c s3:smbd: use xattr_DosInfo4 in set_ea_dos_attribute()
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-01 21:43:24 +00:00
Ralph Boehme
d54424a758 s3:smbd: parse xattr_DosInfo4 in parse_dos_attribute_blob()
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-01 21:43:24 +00:00
Ralph Boehme
c03094cc1f s3:smbd: mark itime non-calculated if we created a file or dir
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-01 21:43:24 +00:00
Ralph Boehme
a5a2ce953b s3/lib: add make_file_index_from_itime()
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-01 21:43:24 +00:00
Ralph Boehme
295d3501d7 s3/lib: add update_stat_ex_file_id()
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-01 21:43:23 +00:00
Ralph Boehme
506ef2761c s3/lib: add update_stat_ex_itime()
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-01 21:43:23 +00:00
Ralph Boehme
30b7f9ae2d s3: add st_ex_file_id to struct stat_ex
st_ex_file_id is an immutable, never reused numeric identifier for objects in a
filesystem.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-01 21:43:23 +00:00
Ralph Boehme
df4a380d9f s3: add st_ex_itime to struct stat_ex
st_ex_itime is an immutable original birth time aka instantiation time. Set when
a file is created, never changes thereafter. May not be set by the client.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-01 21:43:23 +00:00
Ralph Boehme
d18bdc1c43 s3: convert struct stat_ex st_ex_calculated_birthtime bool to flags
Subsequent commits will add more flags, this paves the way.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-01 21:43:23 +00:00
Ralph Boehme
a5f4e33f87 s3: remove unused st_ex_mask from struct stat_ex
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-01 21:43:23 +00:00
Ralph Boehme
ae6dd4853e vfs_catia: pass stat info to synthetic_smb_fname()
This doesn't cause visible damage in vanilla Samba, but would affect downstream
consumers that add additional fields to struct smb_filename.

For the same reason there's no test.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14015
RN: Ensure vfs_catia passes stat info to stacked VFS modules

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-07-01 21:43:23 +00:00
Andreas Schneider
163c0cc84a s3:winbind: Add support for storing KRB5 credential in KCM
This can store crentiials in the Kerberos Credential Manager e.g.
provided by sssd.

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): Mon Jul  1 19:22:02 UTC 2019 on sn-devel-184
2019-07-01 19:22:02 +00:00
Swen Schillig
a75727f191 source3: Update all consumers of strtoul_err(), strtoull_err() to new API
Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2019-06-30 11:32:18 +00:00
Jeremy Allison
cd66614a4e s3: smbd: Make open_directory() always open a fd.
As we never use kernel oplocks on directory handles,
there is no reason not to always open file descriptors (no
more "stat" opens on directories).

Preparing to have SMB1search use real directory
opens.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2019-06-30 11:32:17 +00:00