]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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

4 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

4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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

4 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>
4 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

4 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>
4 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>
4 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

4 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>
4 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>
4 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>
4 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>
4 years agolibrpc: Align a few integer types
Volker Lendecke [Thu, 31 Dec 2020 09:16:21 +0000 (10:16 +0100)] 
librpc: Align a few integer types

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agorpc_client: Simplify rpc_pipe_open_ncalrpc()
Volker Lendecke [Sun, 10 Jan 2021 17:42:18 +0000 (18:42 +0100)] 
rpc_client: Simplify rpc_pipe_open_ncalrpc()

Consolidate close(fd)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agorpc_client: Use common "goto fail" for all error cases
Volker Lendecke [Sun, 10 Jan 2021 17:31:33 +0000 (18:31 +0100)] 
rpc_client: Use common "goto fail" for all error cases

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agorpc_client: Fix an error path memleak in rpc_pipe_open_ncalrpc()
Volker Lendecke [Sun, 10 Jan 2021 17:31:17 +0000 (18:31 +0100)] 
rpc_client: Fix an error path memleak in rpc_pipe_open_ncalrpc()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agorpc_client: Error from rpc_pipe_open_ncalrpc() for path overflow
Volker Lendecke [Sun, 10 Jan 2021 17:28:20 +0000 (18:28 +0100)] 
rpc_client: Error from rpc_pipe_open_ncalrpc() for path overflow

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoepmapper3: Fix a DEBUG message
Volker Lendecke [Sun, 10 Jan 2021 12:16:43 +0000 (13:16 +0100)] 
epmapper3: Fix a DEBUG message

This is not function dcesrv_interface_register()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoepmapper3: Fix a typo
Volker Lendecke [Sun, 10 Jan 2021 12:15:49 +0000 (13:15 +0100)] 
epmapper3: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agorpc_server: Fix an error path memleak
Volker Lendecke [Sun, 10 Jan 2021 12:12:26 +0000 (13:12 +0100)] 
rpc_server: Fix an error path memleak

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agorpc_server: Avoid a pointless ZERO_STRUCTP
Volker Lendecke [Sun, 10 Jan 2021 12:10:47 +0000 (13:10 +0100)] 
rpc_server: Avoid a pointless ZERO_STRUCTP

We've done talloc_zero() 4 lines above.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agorpc_server: Move a variable closer to its use
Volker Lendecke [Sun, 10 Jan 2021 12:07:54 +0000 (13:07 +0100)] 
rpc_server: Move a variable closer to its use

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agorpc_server: Fix a typo
Volker Lendecke [Sun, 10 Jan 2021 12:01:45 +0000 (13:01 +0100)] 
rpc_server: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoauth4: Use global_sid_Anonymous
Volker Lendecke [Sat, 9 Jan 2021 21:53:29 +0000 (22:53 +0100)] 
auth4: Use global_sid_Anonymous

dom_sid_dup() is much simpler than dom_sid_parse_talloc()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoauth4: Use global_sid_System
Volker Lendecke [Sat, 9 Jan 2021 21:51:38 +0000 (22:51 +0100)] 
auth4: Use global_sid_System

dom_sid_dup() is much simpler than dom_sid_parse_talloc()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolib: Move utf16_len[_n]() to lib/util/charset/
Volker Lendecke [Tue, 5 Jan 2021 09:27:12 +0000 (10:27 +0100)] 
lib: Move utf16_len[_n]() to lib/util/charset/

util_unistr.c references it, avoid broken dependencies

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agobuild: Make smb_panic() available as a subsystem of its own
Volker Lendecke [Mon, 11 Jan 2021 12:59:00 +0000 (13:59 +0100)] 
build: Make smb_panic() available as a subsystem of its own

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolib: Avoid all_string_sub() in smb_panic()
Volker Lendecke [Mon, 11 Jan 2021 12:55:38 +0000 (13:55 +0100)] 
lib: Avoid all_string_sub() in smb_panic()

smb_panic() should be available everywhere. Avoid a dependency on
all_string_sub(), this pulls in a lot of other dependencies. The only
change is that this uses "strstr" instead of "strstr_m", but having
non-ascii panic actions strings can be called rare.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agobuild: Move weird.c and charset_macosxfs.c to ICONV_WRAPPER
Volker Lendecke [Mon, 4 Jan 2021 13:25:36 +0000 (14:25 +0100)] 
build: Move weird.c and charset_macosxfs.c to ICONV_WRAPPER

iconv.c directly references them, it does not make sense to have it
without them.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolib: Simplify "weird" charset code
Volker Lendecke [Mon, 4 Jan 2021 11:28:20 +0000 (12:28 +0100)] 
lib: Simplify "weird" charset code

Don't depend on DEBUG. This is a pure developer module, the developer
should be able to figure out what's going on after this has abort()ed.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolib: Move ucs2_align() to 'charset' subsystem
Volker Lendecke [Mon, 4 Jan 2021 10:14:56 +0000 (11:14 +0100)] 
lib: Move ucs2_align() to 'charset' subsystem

Fix a circular dependency: util_str_common.c depends on 'charset',
which depends on util_str_common.c. Fix that.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: Slightly simplify smbd_smb2_create_send()
Volker Lendecke [Sun, 27 Dec 2020 11:13:51 +0000 (12:13 +0100)] 
smbd: Slightly simplify smbd_smb2_create_send()

If we return unconditionally, "else" is not needed

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_glusterfs: support read dirfsps in vfs_gluster_openat()
Ralph Boehme [Mon, 11 Jan 2021 09:53:31 +0000 (10:53 +0100)] 
vfs_glusterfs: support read dirfsps in vfs_gluster_openat()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Mon Jan 11 21:34:52 UTC 2021 on sn-devel-184

4 years agosmbd: pass O_DIRECTORY to fd_openat() for directories
Ralph Boehme [Mon, 11 Jan 2021 08:58:58 +0000 (09:58 +0100)] 
smbd: pass O_DIRECTORY to fd_openat() for directories

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 years agosmbd: move S_ISDIR check up a bit in openat_pathref_fsp()
Ralph Boehme [Mon, 11 Jan 2021 08:57:26 +0000 (09:57 +0100)] 
smbd: move S_ISDIR check up a bit in openat_pathref_fsp()

This relies on the caller having stat()ed smb_fname instead of relying on
fd_openat() fstat()ing fsp->fsp_name. Otherwise no change in behaviour.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 years agolibrpc: Use GUID_buf_string in dcerpc_binding_string()
Volker Lendecke [Thu, 31 Dec 2020 09:11:04 +0000 (10:11 +0100)] 
librpc: Use GUID_buf_string in dcerpc_binding_string()

Avoid a (small) memleak

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): Mon Jan 11 14:25:04 UTC 2021 on sn-devel-184

4 years agorpc_servers: Remove unused variables
Volker Lendecke [Thu, 7 Jan 2021 19:53:17 +0000 (20:53 +0100)] 
rpc_servers: Remove unused variables

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
4 years agorpc_servers: Fix crash with many interfaces
Volker Lendecke [Thu, 31 Dec 2020 14:10:10 +0000 (15:10 +0100)] 
rpc_servers: Fix crash with many interfaces

Previously, the lowlevel routines wrote into the pf_listen_fd arrays
without checking its size.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
4 years agorpc_server: Add dcesrv_create_endpoint_list_fd_listen_fds()
Volker Lendecke [Thu, 31 Dec 2020 13:49:26 +0000 (14:49 +0100)] 
rpc_server: Add dcesrv_create_endpoint_list_fd_listen_fds()

This encapsulates the loop in the three standalone rpc daemons walking
the endpoints in a dcesrv_context.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
4 years agorpc_server: Lift ph_listen_fd logic one level
Volker Lendecke [Thu, 31 Dec 2020 09:47:03 +0000 (10:47 +0100)] 
rpc_server: Lift ph_listen_fd logic one level

Push filling in struct pf_listen_fd into the daemons using
dcesrv_create_endpoint_sockets().

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
4 years agorpc_server: Lift logic to fill in pf_listen_fd one level
Volker Lendecke [Thu, 31 Dec 2020 08:54:15 +0000 (09:54 +0100)] 
rpc_server: Lift logic to fill in pf_listen_fd one level

dcesrv_create_ncacn_ip_tcp_sockets() now returns a struct of fd's
instead of filling a preallocated array: Its only function beyond
dcesrv_open_ncacn_ip_tcp_sockets() is thus gone.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
4 years agorpc_server: Use dcesrv_open_ncacn_ip_tcp_sockets() in dcesrv_setup_ncacn_ip_tcp_sockets()
Volker Lendecke [Thu, 31 Dec 2020 08:47:18 +0000 (09:47 +0100)] 
rpc_server: Use dcesrv_open_ncacn_ip_tcp_sockets() in dcesrv_setup_ncacn_ip_tcp_sockets()

Avoid duplication of logic with "lp_interfaces_only()"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
4 years agorpc_server: Factor out dcesrv_open_ncacn_ip_tcp_sockets()
Volker Lendecke [Thu, 31 Dec 2020 08:21:25 +0000 (09:21 +0100)] 
rpc_server: Factor out dcesrv_open_ncacn_ip_tcp_sockets()

The main change is to return an allocated array of file descriptors in
dcesrv_open_ncacn_ip_tcp_sockets() instead of filling a preallocated
array of pf_listen_fd structures.

Signed-off-by: Volker Lendecke <vl@samba.org>
4 years agolib: Add samba_sockaddr_[gs]et_port()
Volker Lendecke [Wed, 30 Dec 2020 21:50:36 +0000 (22:50 +0100)] 
lib: Add samba_sockaddr_[gs]et_port()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
4 years agolib: Move sockaddr_storage_to_samba_sockaddr() to lib/
Volker Lendecke [Wed, 30 Dec 2020 21:43:07 +0000 (22:43 +0100)] 
lib: Move sockaddr_storage_to_samba_sockaddr() to lib/

This can be useful outside of source3/libsmb/namequery.c as Samba
moves towards samba_sockaddr.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
4 years agovfs_fruit: fix close for fake_fd
Ralph Boehme [Fri, 11 Dec 2020 11:59:28 +0000 (12:59 +0100)] 
vfs_fruit: fix close for fake_fd

If the next backend doesn't use kernel fd's should not
pass a fake_fd to the next backend.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jan  8 21:38:18 UTC 2021 on sn-devel-184

4 years agovfs_fruit: check fake_fd in fruit_pread_meta_stream()
Ralph Boehme [Fri, 11 Dec 2020 12:00:56 +0000 (13:00 +0100)] 
vfs_fruit: check fake_fd in fruit_pread_meta_stream()

Don't call into the next VFS backend if we know we still have a fake-fd. Just
return -1 and the caller has the logic to handle this, which results in
returning a AFP_AfpInfo blob initialized with some defaults.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_fruit: use "fake_fd" instead of "created"
Ralph Boehme [Fri, 11 Dec 2020 12:00:09 +0000 (13:00 +0100)] 
vfs_fruit: use "fake_fd" instead of "created"

Both have basically the same semantics.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_streams_xattr: make use of vfs_fake_fd_close()
Stefan Metzmacher [Fri, 18 Dec 2020 13:36:00 +0000 (14:36 +0100)] 
vfs_streams_xattr: make use of vfs_fake_fd_close()

When we used vfs_fake_fd() we should use vfs_fake_fd_close()
in order to have things symetric.

That may allows us to change vfs_fake_fd() internally if required.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_fruit: make use of vfs_fake_fd_close()
Stefan Metzmacher [Fri, 18 Dec 2020 13:36:00 +0000 (14:36 +0100)] 
vfs_fruit: make use of vfs_fake_fd_close()

When we used vfs_fake_fd() we should use vfs_fake_fd_close()
in order to have things symetric.

That may allows us to change vfs_fake_fd() internally if required.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3:smbd: add vfs_fake_fd_close() helper
Stefan Metzmacher [Fri, 18 Dec 2020 13:03:09 +0000 (14:03 +0100)] 
s3:smbd: add vfs_fake_fd_close() helper

When we used vfs_fake_fd() we should use vfs_fake_fd_close()
in order to have things symetric.

This makes code easier to understand and may allow us to change
vfs_fake_fd() internally if required.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos4:torture/fruit: avoid sleep(10000000); if write_stream() fails
Stefan Metzmacher [Tue, 8 Dec 2020 14:47:53 +0000 (15:47 +0100)] 
s4:torture/fruit: avoid sleep(10000000); if write_stream() fails

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3: Remove "developer.c" module
Volker Lendecke [Mon, 4 Jan 2021 11:22:13 +0000 (12:22 +0100)] 
s3: Remove "developer.c" module

This can't have been built since commit f9acf770e9c12 from 2011 when
smb_register_charset was removed.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agopassdb: Fix a typo
Volker Lendecke [Sun, 27 Dec 2020 10:38:45 +0000 (11:38 +0100)] 
passdb: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolib: Initialize pointers in server_prefork.c
Volker Lendecke [Sun, 27 Dec 2020 07:50:34 +0000 (08:50 +0100)] 
lib: Initialize pointers in server_prefork.c

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolib: Fix error path memleaks in prefork_create_pool()
Volker Lendecke [Sat, 26 Dec 2020 17:22:23 +0000 (18:22 +0100)] 
lib: Fix error path memleaks in prefork_create_pool()

A few return statements missed the "TALLOC_FREE(pfp);"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agorpc_server: Make default prefork configs const
Volker Lendecke [Sat, 26 Dec 2020 09:04:42 +0000 (10:04 +0100)] 
rpc_server: Make default prefork configs const

Move 24 bytes from modifyable data to .text segment

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolib: Make pfh_daemon_config take a const default config
Volker Lendecke [Sat, 26 Dec 2020 08:59:04 +0000 (09:59 +0100)] 
lib: Make pfh_daemon_config take a const default config

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolibrpc: Fix an error path memleak
Volker Lendecke [Sat, 26 Dec 2020 08:27:10 +0000 (09:27 +0100)] 
librpc: Fix an error path memleak

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolib: give global_contexts.c its own header file
Volker Lendecke [Sun, 3 Jan 2021 20:53:49 +0000 (21:53 +0100)] 
lib: give global_contexts.c its own header file

It's a bit shocking how many references we have to global
contexts. Make this a bit more obvious.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolibsmb: Use hex_byte() in urldecode_talloc()
Volker Lendecke [Mon, 4 Jan 2021 13:16:32 +0000 (14:16 +0100)] 
libsmb: Use hex_byte() in urldecode_talloc()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoctdb: Use hex_byte() in hex_to_data()
Volker Lendecke [Mon, 4 Jan 2021 13:10:57 +0000 (14:10 +0100)] 
ctdb: Use hex_byte() in hex_to_data()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolib: Use hex_byte() in ucs2hex_pull()
Volker Lendecke [Mon, 4 Jan 2021 13:03:28 +0000 (14:03 +0100)] 
lib: Use hex_byte() in ucs2hex_pull()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolib: Use hex_byte() in rfc1738_unescape()
Volker Lendecke [Mon, 4 Jan 2021 12:57:53 +0000 (13:57 +0100)] 
lib: Use hex_byte() in rfc1738_unescape()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoldb: Use hex_byte() in ldb_binary_decode()
Volker Lendecke [Mon, 4 Jan 2021 12:55:01 +0000 (13:55 +0100)] 
ldb: Use hex_byte() in ldb_binary_decode()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agotdb: Use hex_byte() in parse_hex()
Volker Lendecke [Mon, 4 Jan 2021 12:52:48 +0000 (13:52 +0100)] 
tdb: Use hex_byte() in parse_hex()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agotdb: Use hex_byte() in read_data()
Volker Lendecke [Mon, 4 Jan 2021 12:50:23 +0000 (13:50 +0100)] 
tdb: Use hex_byte() in read_data()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolib: Add "hex_byte()" to replace.h
Volker Lendecke [Mon, 4 Jan 2021 12:12:30 +0000 (13:12 +0100)] 
lib: Add "hex_byte()" to replace.h

This is required in quite a few places, and replace.h has things like
ZERO_STRUCT already, so this is not completely outplaced.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agodsdb: Fix a typo
Volker Lendecke [Tue, 5 Jan 2021 14:41:45 +0000 (15:41 +0100)] 
dsdb: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agodsdb: Fix comment wording
Volker Lendecke [Tue, 5 Jan 2021 13:42:40 +0000 (14:42 +0100)] 
dsdb: Fix comment wording

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoauth: Fix a typo
Volker Lendecke [Tue, 5 Jan 2021 13:36:45 +0000 (14:36 +0100)] 
auth: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoauth: Reformat a comment
Volker Lendecke [Tue, 5 Jan 2021 13:36:23 +0000 (14:36 +0100)] 
auth: Reformat a comment

Will fix a typo next

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agovfs_virusfilter: Allocate separate memory for config char*
Arne Kreddig [Fri, 1 Jan 2021 21:54:22 +0000 (22:54 +0100)] 
vfs_virusfilter: Allocate separate memory for config char*

Instead of using only the pointer to the configuration char* from the
global configuration, vfs_virusfilter now allocates its own memory and
copies the char* from the global configuration.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14606
Signed-off-by: Arne Kreddig <arne@kreddig.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jan  7 19:25:38 UTC 2021 on sn-devel-184

4 years agos3:lib: Create the cache path of user gencache recursively
Andreas Schneider [Mon, 21 Dec 2020 09:36:46 +0000 (10:36 +0100)] 
s3:lib: Create the cache path of user gencache recursively

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

Signed-off-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 Jan  6 23:59:58 UTC 2021 on sn-devel-184

4 years agolib:util: Add directory_create_or_exists_recursive()
Andreas Schneider [Mon, 21 Dec 2020 09:35:51 +0000 (10:35 +0100)] 
lib:util: Add directory_create_or_exists_recursive()

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3:utils - explicitly free cmdline_messaging_context
Andrew Walker [Thu, 24 Dec 2020 11:38:18 +0000 (06:38 -0500)] 
s3:utils - explicitly free cmdline_messaging_context

Some command line utilities do not free their messaging context
which results in extra entries being left in the msg.lock directory.

Signed-off-by: Andrew Walker <awalker@ixsystems.com>
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): Tue Jan  5 21:30:08 UTC 2021 on sn-devel-184

4 years agoFix small typo in manpage
Yvan Masson [Mon, 14 Dec 2020 14:14:31 +0000 (15:14 +0100)] 
Fix small typo in manpage

Signed-off-by: Yvan Masson <yvan@masson-informatique.fr>
Reviewed-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Jan  4 16:23:03 UTC 2021 on sn-devel-184

4 years agoWHATSNEW: printing changes
Björn Jacke [Mon, 4 Jan 2021 11:20:36 +0000 (12:20 +0100)] 
WHATSNEW: printing changes

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Karolin Seeger <kseeger@samba.org>
Autobuild-User(master): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(master): Mon Jan  4 12:51:49 UTC 2021 on sn-devel-184