]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
5 years agos3: libsmb: Convert namecache_fetch() and it's only caller to return a talloc'ed...
Jeremy Allison [Wed, 26 Aug 2020 22:42:15 +0000 (15:42 -0700)] 
s3: libsmb: Convert namecache_fetch() and it's only caller to return a talloc'ed array of struct samba_sockaddr.

Eventually everything will be talloced arrays of samba_sockaddr.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libsmb: Cleanup the code to do one address return given an IP address to _interna...
Jeremy Allison [Wed, 26 Aug 2020 22:26:54 +0000 (15:26 -0700)] 
s3: libsmb: Cleanup the code to do one address return given an IP address to _internal_resolve_name().

Will make easier to move to talloc later.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libsmb: Change remove_duplicate_addrs2() to take and return size_t, not int.
Jeremy Allison [Wed, 26 Aug 2020 22:16:48 +0000 (15:16 -0700)] 
s3: libsmb: Change remove_duplicate_addrs2() to take and return size_t, not int.

Will make converting _internal_resolve_name() to return a size_t easier.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libsmb: Move talloc_stackframe() initialization to the front of _internal_resolve...
Jeremy Allison [Wed, 26 Aug 2020 20:59:14 +0000 (13:59 -0700)] 
s3: libsmb: Move talloc_stackframe() initialization to the front of _internal_resolve_name().

Ensure we free correctly on all exit paths.
This will allow us to move the internal calls to
talloc more easily.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libsmb: Rename internal_resolve_name_talloc() -> internal_resolve_name().
Jeremy Allison [Wed, 26 Aug 2020 20:56:50 +0000 (13:56 -0700)] 
s3: libsmb: Rename internal_resolve_name_talloc() -> internal_resolve_name().

No more non-talloc callers.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libsmb: Remove internal_resolve_name() externally. All callers now use internal_r...
Jeremy Allison [Wed, 26 Aug 2020 20:53:35 +0000 (13:53 -0700)] 
s3: libsmb: Remove internal_resolve_name() externally. All callers now use internal_resolve_name_talloc().

Make the wrapped internal_resolve_name() function static as _internal_resolve_name().

Now we can rename the callers back from internal_resolve_name_talloc() -> internal_resolve_name()
as all external callers are talloc-based.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3/libsmb: Cleanup, don't modify out params except on success
Noel Power [Fri, 4 Sep 2020 02:11:08 +0000 (19:11 -0700)] 
s3/libsmb: Cleanup, don't modify out params except on success

All callers don't use out params on failure.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3: libsmb: Make discover_dc_netbios() use internal_resolve_name_talloc().
Jeremy Allison [Wed, 26 Aug 2020 20:47:55 +0000 (13:47 -0700)] 
s3: libsmb: Make discover_dc_netbios() use internal_resolve_name_talloc().

No more external users of internal_resolve_name().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libsmb: Make get_dc_list() use internal_resolve_name_talloc().
Jeremy Allison [Wed, 26 Aug 2020 20:41:15 +0000 (13:41 -0700)] 
s3: libsmb: Make get_dc_list() use internal_resolve_name_talloc().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libsmb: Make get_pdc_ip() use internal_resolve_name_talloc().
Jeremy Allison [Wed, 26 Aug 2020 20:35:22 +0000 (13:35 -0700)] 
s3: libsmb: Make get_pdc_ip() use internal_resolve_name_talloc().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libsmb: Make find_master_ip() use internal_resolve_name_talloc().
Jeremy Allison [Wed, 26 Aug 2020 20:32:15 +0000 (13:32 -0700)] 
s3: libsmb: Make find_master_ip() use internal_resolve_name_talloc().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3/libsmb: resolve_name_list don't update out params except for success
Noel Power [Fri, 4 Sep 2020 02:07:08 +0000 (19:07 -0700)] 
s3/libsmb: resolve_name_list don't update out params except for success

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3: libsmb: Make resolve_name_list() use internal_resolve_name_talloc().
Jeremy Allison [Wed, 26 Aug 2020 20:30:02 +0000 (13:30 -0700)] 
s3: libsmb: Make resolve_name_list() use internal_resolve_name_talloc().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libsmb: namequery - Make resolve_name() use internal_resolve_name_talloc().
Jeremy Allison [Wed, 26 Aug 2020 20:28:12 +0000 (13:28 -0700)] 
s3: libsmb: namequery - Make resolve_name() use internal_resolve_name_talloc().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libsmb: namequery - Add internal_resolve_name_talloc().
Jeremy Allison [Wed, 26 Aug 2020 20:25:07 +0000 (13:25 -0700)] 
s3: libsmb: namequery - Add internal_resolve_name_talloc().

This is a wrapper function for internal_resolve_name()
that converts the replies from malloc() -> talloc().

Now to move the callers, and I can move the talloc
code down one level again.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libsmb: Make get_dc_list() internal to namequery.c return talloc'ed ip_service...
Jeremy Allison [Wed, 26 Aug 2020 19:31:53 +0000 (12:31 -0700)] 
s3: libsmb: Make get_dc_list() internal to namequery.c return talloc'ed ip_service array.

Moving closer to the target of making internal_resolve_name()
use talloc.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libsmb: Cleanup - use early return in get_dc_list().
Jeremy Allison [Wed, 26 Aug 2020 19:19:31 +0000 (12:19 -0700)] 
s3: libsmb: Cleanup - use early return in get_dc_list().

No logic change. Makes later code changes clearer.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libsmb: Change get_dc_list() to return a size_t count parameter.
Jeremy Allison [Wed, 26 Aug 2020 19:13:08 +0000 (12:13 -0700)] 
s3: libsmb: Change get_dc_list() to return a size_t count parameter.

Remove paranoia checks and casts from callers, move internally.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libsmb: Change to an early return in get_dc_list().
Jeremy Allison [Wed, 26 Aug 2020 19:07:18 +0000 (12:07 -0700)] 
s3: libsmb: Change to an early return in get_dc_list().

No logic change. Will make later code changes clearer.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libsmb: Cleanup - rename ctx -> frame for a talloc_stackframe to match modern...
Jeremy Allison [Wed, 26 Aug 2020 19:05:06 +0000 (12:05 -0700)] 
s3: libsmb: Cleanup - rename ctx -> frame for a talloc_stackframe to match modern coding standards.

We will be passing in a real TALLOC_CTX soon.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libsmb: Rename get_sorted_dc_list_talloc() -> get_sorted_dc_list()
Jeremy Allison [Wed, 26 Aug 2020 19:03:31 +0000 (12:03 -0700)] 
s3: libsmb: Rename get_sorted_dc_list_talloc() -> get_sorted_dc_list()

There are no non-talloc callers.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libsmb: Remove get_sorted_dc_list().
Jeremy Allison [Wed, 26 Aug 2020 19:01:18 +0000 (12:01 -0700)] 
s3: libsmb: Remove get_sorted_dc_list().

No more callers.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: winbindd: Move callers of get_sorted_dc_list() -> get_sorted_dc_list_talloc().
Jeremy Allison [Wed, 26 Aug 2020 19:00:00 +0000 (12:00 -0700)] 
s3: winbindd: Move callers of get_sorted_dc_list() -> get_sorted_dc_list_talloc().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: net lookup: Move callers of get_sorted_dc_list() -> get_sorted_dc_list_talloc().
Jeremy Allison [Wed, 26 Aug 2020 18:56:00 +0000 (11:56 -0700)] 
s3: net lookup: Move callers of get_sorted_dc_list() -> get_sorted_dc_list_talloc().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libsmb: Move callers of get_sorted_dc_list() -> get_sorted_dc_list_talloc().
Jeremy Allison [Wed, 26 Aug 2020 18:53:07 +0000 (11:53 -0700)] 
s3: libsmb: Move callers of get_sorted_dc_list() -> get_sorted_dc_list_talloc().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libads: Move callers of get_sorted_dc_list() -> get_sorted_dc_list_talloc().
Jeremy Allison [Wed, 26 Aug 2020 18:50:46 +0000 (11:50 -0700)] 
s3: libads: Move callers of get_sorted_dc_list() -> get_sorted_dc_list_talloc().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libsmb: Add get_sorted_dc_list_talloc().
Jeremy Allison [Wed, 26 Aug 2020 18:47:44 +0000 (11:47 -0700)] 
s3: libsmb: Add get_sorted_dc_list_talloc().

Talloc version of get_sorted_dc_list_talloc().
Makes use of dup_ip_service_array().
Now to move the callers.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libads: Rename get_kdc_list_talloc() -> get_kdc_list().
Jeremy Allison [Wed, 26 Aug 2020 18:43:32 +0000 (11:43 -0700)] 
s3: libads: Rename get_kdc_list_talloc() -> get_kdc_list().

It's the only version now.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libsmb: Remove now unused get_kdc_list() (non-talloc version).
Jeremy Allison [Wed, 26 Aug 2020 18:39:54 +0000 (11:39 -0700)] 
s3: libsmb: Remove now unused get_kdc_list() (non-talloc version).

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: utils: net_lookup. Convert to use get_kdc_list_talloc().
Jeremy Allison [Wed, 26 Aug 2020 18:38:31 +0000 (11:38 -0700)] 
s3: utils: net_lookup. Convert to use get_kdc_list_talloc().

No more users of get_kdc_list().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3/libads: Cleanup() get_kdc_ip_string, free kdc_str on error
Noel Power [Fri, 4 Sep 2020 11:02:58 +0000 (12:02 +0100)] 
s3/libads: Cleanup() get_kdc_ip_string, free kdc_str on error

kdc_str will be cleaned up when the passed ctx is freed,
it just seems odd that we now return NULL without cleaning up allocated mem.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3/libads: Only set result to kdc_str on success
Noel Power [Fri, 4 Sep 2020 09:38:27 +0000 (10:38 +0100)] 
s3/libads: Only set result to kdc_str on success

Prior to this change result was set even when any or all errors
occured in the function.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3: libads: Make get_kdc_ip_string() use get_kdc_list_talloc().
Jeremy Allison [Wed, 26 Aug 2020 18:30:36 +0000 (11:30 -0700)] 
s3: libads: Make get_kdc_ip_string() use get_kdc_list_talloc().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libsmb: Add get_kdc_list_talloc().
Jeremy Allison [Wed, 26 Aug 2020 18:26:33 +0000 (11:26 -0700)] 
s3: libsmb: Add get_kdc_list_talloc().

Talloc version of get_kdc_list(). Makes use of dup_ip_service_array().
Now to move the callers.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libsmb: Add utility funtion dup_ip_service_array().
Jeremy Allison [Tue, 25 Aug 2020 17:22:10 +0000 (10:22 -0700)] 
s3: libsmb: Add utility funtion dup_ip_service_array().

Preparing to return ip_service arrays as talloc, not
malloc. Commented out as not yet used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libsmb: Cleanup - Use helper variable for return from namecache_fetch() in intern...
Jeremy Allison [Wed, 26 Aug 2020 22:20:22 +0000 (15:20 -0700)] 
s3: libsmb: Cleanup - Use helper variable for return from namecache_fetch() in internal_resolve_name().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libsmb: Cleanup in resolve_name_list().
Noel Power [Wed, 2 Sep 2020 17:52:08 +0000 (10:52 -0700)] 
s3: libsmb: Cleanup in resolve_name_list().

Don't modify out params (unless successful result).

Signed-off-by: Noel Power <npower@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3: libsmb: Cleanup - correctly error on sockaddr_storage_to_samba_sockaddr() fail.
Jeremy Allison [Thu, 27 Aug 2020 16:49:05 +0000 (09:49 -0700)] 
s3: libsmb: Cleanup - correctly error on sockaddr_storage_to_samba_sockaddr() fail.

Instead of jumping out and leaking the memory onto ctx,
skip bad conversions and error out if there are no addresses
to return (and cleanup the memory there).

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libsmb: Cleanup - ensure we initialize all stack variables to 'safe' values when...
Noel Power [Fri, 4 Sep 2020 02:03:52 +0000 (19:03 -0700)] 
s3: libsmb: Cleanup - ensure we initialize all stack variables to 'safe' values when calling resolve_name_list()

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3: libsmb: Cleanup - ensure we initialize all stack variables to 'safe' values when...
Jeremy Allison [Wed, 2 Sep 2020 17:05:48 +0000 (10:05 -0700)] 
s3: libsmb: Cleanup - ensure we initialize all stack variables to 'safe' values when calling get_sorted_dc_list() that may not touch returns on error.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libsmb: Cleanup - ensure we initialize all stack variables to 'safe' values when...
Jeremy Allison [Wed, 2 Sep 2020 16:58:30 +0000 (09:58 -0700)] 
s3: libsmb: Cleanup - ensure we initialize all stack variables to 'safe' values when calling get_kdc_list() that may not touch returns on error.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libsmb: discover_dc_netbios(). Remember to free on error return.
Jeremy Allison [Wed, 26 Aug 2020 20:45:43 +0000 (13:45 -0700)] 
s3: libsmb: discover_dc_netbios(). Remember to free on error return.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos4:smb_server: Use cli_credentials_init_server() for negprot
Andreas Schneider [Mon, 7 Sep 2020 07:19:43 +0000 (09:19 +0200)] 
s4:smb_server: Use cli_credentials_init_server() for negprot

Signed-off-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Mon Sep  7 13:22:26 UTC 2020 on sn-devel-184

5 years agos4:rpc_server: Use cli_credentials_init_server()
Andreas Schneider [Fri, 4 Sep 2020 10:21:36 +0000 (12:21 +0200)] 
s4:rpc_server: Use cli_credentials_init_server()

Signed-off-by: Andreas Schneider <asn@samba.org>
5 years agoauth:creds: Add cli_credentials_init_server()
Andreas Schneider [Fri, 4 Sep 2020 10:21:21 +0000 (12:21 +0200)] 
auth:creds: Add cli_credentials_init_server()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agoauth:gensec: If Kerberos is required, keep schannel for machine account auth
Stefan Metzmacher [Fri, 4 Sep 2020 15:00:45 +0000 (17:00 +0200)] 
auth:gensec: If Kerberos is required, keep schannel for machine account auth

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
5 years agoauth:gensec: Pass use_kerberos and keep_schannel to gensec_use_kerberos_mechs()
Stefan Metzmacher [Fri, 4 Sep 2020 12:41:43 +0000 (14:41 +0200)] 
auth:gensec: Pass use_kerberos and keep_schannel to gensec_use_kerberos_mechs()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agoauth:gensec: Make gensec_use_kerberos_mechs() a static function
Stefan Metzmacher [Fri, 4 Sep 2020 12:39:15 +0000 (14:39 +0200)] 
auth:gensec: Make gensec_use_kerberos_mechs() a static function

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agos4:ldap_server: Use samba_server_gensec_start() in ldapsrv_backend_Init()
Stefan Metzmacher [Fri, 4 Sep 2020 08:48:27 +0000 (10:48 +0200)] 
s4:ldap_server: Use samba_server_gensec_start() in ldapsrv_backend_Init()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agoauth:gensec: Add gensec_security_sasl_names()
Stefan Metzmacher [Fri, 4 Sep 2020 08:47:54 +0000 (10:47 +0200)] 
auth:gensec: Add gensec_security_sasl_names()

Pair-Programmed-With: Andreas Schneider <asn@samba.org>

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agowaf: upgrade to 2.0.20
David Mulder [Mon, 24 Aug 2020 19:12:46 +0000 (13:12 -0600)] 
waf: upgrade to 2.0.20

This contain an important change:
"Fix gccdeps.scan() returning nodes that no longer exist on disk."
https://gitlab.com/ita1024/waf/-/merge_requests/2293

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agobootstrap: install perl-JSON on on rpm distributions
Stefan Metzmacher [Fri, 3 Apr 2020 10:16:08 +0000 (12:16 +0200)] 
bootstrap: install perl-JSON on on rpm distributions

This will be needed for the next heimdal import.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agobootstrap: document git push -o ci.variable='SAMBA_CI_REBUILD_IMAGES=yes'
Stefan Metzmacher [Thu, 6 Aug 2020 13:27:24 +0000 (15:27 +0200)] 
bootstrap: document git push -o ci.variable='SAMBA_CI_REBUILD_IMAGES=yes'

This is much easier than going through the web interface.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agopython/tests/gpo: this should fix a Popen deadlock
Stefan Metzmacher [Mon, 7 Sep 2020 08:31:36 +0000 (10:31 +0200)] 
python/tests/gpo: this should fix a Popen deadlock

It is inspired by commit 5dc773a5b00834c7a53130a73a48f49048bd55e8
   Author: Joe Guo <joeg@catalyst.net.nz>
   Date:   Fri Sep 15 16:13:26 2017 +1200

      python: use communicate to fix Popen deadlock

      `Popen.wait()` will deadlock when using stdout=PIPE and/or stderr=PIPE and the
      child process generates large output to a pipe such that it blocks waiting for
      the OS pipe buffer to accept more data. Use communicate() to avoid that.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
      Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
      Autobuild-Date(master): Thu Oct 19 09:27:16 CEST 2017 on sn-devel-144

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
5 years agos3:libads: Also add a realm entry for the domain name
Andreas Schneider [Thu, 3 Sep 2020 11:49:33 +0000 (13:49 +0200)] 
s3:libads: Also add a realm entry for the domain name

This is required if we try to authenticate as Administrator@DOMAIN so it
can find the KDC. This fixes 'net ads join' for ad_member_fips if we
require Kerberos auth.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Isaac Boukris <iboukris@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Sep  7 09:25:33 UTC 2020 on sn-devel-184

5 years agos3:libads: Only add RC4 if weak crypto is allowed
Andreas Schneider [Thu, 3 Sep 2020 09:45:33 +0000 (11:45 +0200)] 
s3:libads: Only add RC4 if weak crypto is allowed

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Isaac Boukris <iboukris@samba.org>
5 years agos3:libads: Remove DES legacy types for Kerberos
Andreas Schneider [Thu, 3 Sep 2020 09:11:14 +0000 (11:11 +0200)] 
s3:libads: Remove DES legacy types for Kerberos

We already removed DES support for Kerberos in Samba 4.12.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Isaac Boukris <iboukris@samba.org>
5 years agoFixed arrow keys typo to the computer move command utility
Hezekiah [Tue, 1 Sep 2020 09:54:39 +0000 (12:54 +0300)] 
Fixed arrow keys typo to the computer move command utility

Signed-off-by: Hezekiah <hezekiahmaina3@gmail.com>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): Alexander Bokovoy <ab@samba.org>
Autobuild-Date(master): Fri Sep  4 16:57:30 UTC 2020 on sn-devel-184

5 years agobuild: avoid some unnecessary list.extend() calls
David Disseldorp [Wed, 2 Sep 2020 13:19:52 +0000 (15:19 +0200)] 
build: avoid some unnecessary list.extend() calls

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Thu Sep  3 13:33:54 UTC 2020 on sn-devel-184

5 years agobuild: avoid unnecessary TO_LIST() calls for static strings
David Disseldorp [Wed, 2 Sep 2020 12:35:21 +0000 (14:35 +0200)] 
build: avoid unnecessary TO_LIST() calls for static strings

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 years agobuild: toggle vfs_snapper using --with-shared-modules
David Disseldorp [Wed, 2 Sep 2020 08:50:04 +0000 (10:50 +0200)] 
build: toggle vfs_snapper using --with-shared-modules

7ae03a19b3c ("build: add configure option to control vfs_snapper build")
added new --enable-snapper and --disable-snapper configure parameters to
control whether the vfs_snapper module was built.
The new parameters conflicted with existing
--with-shared-modules=[!]vfs_snapper behaviour.

This change reinstates working --with-shared-modules=[!]vfs_snapper
functionality. vfs_snapper stays enabled by default, but only on Linux.
Linux systems lacking the dbus library and header files should
explicitly disable the module via --with-shared-modules=!vfs_snapper as
documented.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14437

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Björn Jacke <bjacke@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Wed Sep  2 16:24:50 UTC 2020 on sn-devel-184

5 years agotests: Make sure that idmap_ad retrieves unix nss attributes
Volker Lendecke [Sun, 30 Aug 2020 09:45:56 +0000 (11:45 +0200)] 
tests: Make sure that idmap_ad retrieves unix nss attributes

Make sure that unix_primary_group and unix_nss_info idmap_ad options
work. We have two domains here and test wbinfo -i for both domains, so
we also run the test without those options for the trusted domain.

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): Wed Sep  2 10:35:53 UTC 2020 on sn-devel-184

5 years agoGPO: Update the samba-gpupdate man page
David Mulder [Fri, 28 Aug 2020 21:32:13 +0000 (15:32 -0600)] 
GPO: Update the samba-gpupdate man page

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agogpo: Pass necessary parameters to rsop
David Mulder [Thu, 27 Aug 2020 19:25:44 +0000 (13:25 -0600)] 
gpo: Pass necessary parameters to rsop

These parameters were missed by mistake when exts
were modified to be initialized within the rsop
command. Fixes an exception thrown when executing
samba-gpupdate --rsop:

Traceback (most recent call last):
  File "/usr/sbin/samba-gpupdate", line 99, in <module>
    rsop(lp, creds, gp_extensions, opts.target)
  File "/usr/lib64/python3.8/site-packages/samba/gpclass.py", line 512, in rsop
    ext = ext(logger, lp, creds, store)
NameError: name 'logger' is not defined

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 years agogpo: Test rsop function for success
David Mulder [Fri, 28 Aug 2020 14:38:41 +0000 (08:38 -0600)] 
gpo: Test rsop function for success

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 years agosamba-tool: Create unix user with modified template homedir
David Mulder [Thu, 27 Aug 2020 20:22:34 +0000 (14:22 -0600)] 
samba-tool: Create unix user with modified template homedir

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosamba-tool: Test creating unix user with modified template homedir
David Mulder [Thu, 27 Aug 2020 19:13:06 +0000 (13:13 -0600)] 
samba-tool: Test creating unix user with modified template homedir

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolzxpress: avoid technically undefined shift
Douglas Bagnall [Thu, 6 Aug 2020 05:17:01 +0000 (17:17 +1200)] 
lzxpress: avoid technically undefined shift

UBSAN:

  runtime error: left shift of 1 by 31 places cannot be represented in type 'int'

Credit to OSS-fuzz.

REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=22283

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Aug 31 22:31:13 UTC 2020 on sn-devel-184

5 years agolib/util/asn1: avoid technically undefined shift
Douglas Bagnall [Thu, 6 Aug 2020 05:10:30 +0000 (17:10 +1200)] 
lib/util/asn1: avoid technically undefined shift

UBSAN says

 runtime error: left shift of 255 by 24 places cannot be represented in type 'int'

Credit to OSS-Fuzz.

REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=22889

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 years agoFix clang 9 format-nonliteral warning
Gary Lockyer [Thu, 27 Aug 2020 01:50:16 +0000 (13:50 +1200)] 
Fix clang 9 format-nonliteral warning

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agopython/samba/tests/blackbox: Tests with nested DFS container
Noel Power [Mon, 27 Jul 2020 15:58:31 +0000 (16:58 +0100)] 
python/samba/tests/blackbox: Tests with nested DFS container

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Aug 31 19:09:24 UTC 2020 on sn-devel-184

5 years agos3/utils: restore client share connection after call to sec_desc_parse
Noel Power [Fri, 24 Jul 2020 14:32:11 +0000 (15:32 +0100)] 
s3/utils: restore client share connection after call to sec_desc_parse

This normally isn't a problem *except* for when the share is a dfs root
(which results in cli_resolve_patch creating an incorrect path)

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3/utils: If dfs path is an ordinary path then really just return it
Noel Power [Fri, 24 Jul 2020 13:50:57 +0000 (14:50 +0100)] 
s3/utils: If dfs path is an ordinary path then really just return it

In cli_resolve_path if the share was a root dfs share then any self
hosted dfs paths end up not being returned as is but being decorated
with fileserver and share. This file path is not suitable for
passing to cli_list so we adjust it here.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agopython/samba/tests/blackbox: python smbcacls '--propagate-inherit' test
Noel Power [Fri, 3 Jul 2020 10:55:44 +0000 (10:55 +0000)] 
python/samba/tests/blackbox: python smbcacls '--propagate-inherit' test

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agodoc: describe smbcacls --propagate-inheritance expanding INHERITANCE section
Noel Power [Fri, 15 Nov 2013 11:53:35 +0000 (11:53 +0000)] 
doc: describe smbcacls --propagate-inheritance expanding INHERITANCE section

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agodoc: describe smbcacls --propagate-inheritance
David Disseldorp [Thu, 14 Nov 2013 18:38:19 +0000 (19:38 +0100)] 
doc: describe smbcacls --propagate-inheritance

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agoadd new '--propagate-inheritance' option for smbcacls
Noel Power [Thu, 14 Nov 2013 17:45:07 +0000 (17:45 +0000)] 
add new '--propagate-inheritance' option for smbcacls

smbcacls now can take a '--propagate-inheritance' flag to indicate that the
add, delete, modify and set operations now support automatic propagation of
inheritable ACE(s)

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agopython/samba/tests/blackbox: Preparatory change to support custom share
Noel Power [Mon, 27 Jul 2020 15:51:12 +0000 (16:51 +0100)] 
python/samba/tests/blackbox: Preparatory change to support custom share

tearDown method doesn't handle local file deletion fallback if a share
other than 'tmp' is used

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agopython/samba/tests:blackbox: Fix local file delete test tree fallback
Noel Power [Mon, 27 Jul 2020 16:02:28 +0000 (17:02 +0100)] 
python/samba/tests:blackbox: Fix local file delete test tree fallback

Wrong indentation ensures the fallback where we use file system removal
of test files if the test's tearDown method fails.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agopython/samba/tests/blackbox: Fix undetected deltree fail
Noel Power [Tue, 28 Jul 2020 15:21:17 +0000 (16:21 +0100)] 
python/samba/tests/blackbox: Fix undetected deltree fail

With msdfs root share smbclient deltree command can fail without
setting the errorcode (e.g. when do_list encounters an error it will
log a warning message and continue rather than error out fatally)

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3:share_mode_lock: remove unused reproducer for bug #14428
Stefan Metzmacher [Fri, 28 Aug 2020 14:28:41 +0000 (16:28 +0200)] 
s3:share_mode_lock: remove unused reproducer for bug #14428

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Aug 31 13:34:17 UTC 2020 on sn-devel-184

5 years agos3:share_mode_lock: make sure share_mode_cleanup_disconnected() removes the record
Stefan Metzmacher [Fri, 28 Aug 2020 14:28:41 +0000 (16:28 +0200)] 
s3:share_mode_lock: make sure share_mode_cleanup_disconnected() removes the record

This fixes one possible trigger for "PANIC: assert failed in get_lease_type()"
https://bugzilla.samba.org/show_bug.cgi?id=14428

This is no longer enough to remove the record:

   d->have_share_modes = false;
   d->modified = true;

Note that we can remove it completely from
share_mode_cleanup_disconnected() as
share_mode_forall_entries() already sets it
when there are no entries left.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agos3:share_mode_lock: add missing 'goto done' in share_mode_cleanup_disconnected()
Stefan Metzmacher [Fri, 28 Aug 2020 13:56:35 +0000 (15:56 +0200)] 
s3:share_mode_lock: add missing 'goto done' in share_mode_cleanup_disconnected()

When cleanup_disconnected_lease() fails we should stop,
at least we do that if brl_cleanup_disconnected() fails.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agos3:share_mode_lock: consistently debug share_mode_entry records
Stefan Metzmacher [Fri, 28 Aug 2020 13:56:35 +0000 (15:56 +0200)] 
s3:share_mode_lock: consistently debug share_mode_entry records

share_mode_entry_do(), share_mode_forall_entries() and
share_entry_forall() print the record before the callback is called
and when it was modified or deleted.

This makes it much easier to debug problems.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agos3:share_mode_lock: let share_mode_forall_entries/share_entry_forall evaluate e.stale...
Stefan Metzmacher [Fri, 28 Aug 2020 13:56:35 +0000 (15:56 +0200)] 
s3:share_mode_lock: let share_mode_forall_entries/share_entry_forall evaluate e.stale first

It's not really clear why e.stale would be ignored if *modified is set
to true.

This matches the behavior of share_mode_entry_do()

This also makes sure we see the removed entry in level 10 logs again.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agos3:share_mode_lock: reproduce problem with stale disconnected share mode entries
Stefan Metzmacher [Fri, 28 Aug 2020 12:37:59 +0000 (14:37 +0200)] 
s3:share_mode_lock: reproduce problem with stale disconnected share mode entries

This reproduces the origin of "PANIC: assert failed in get_lease_type()"
(https://bugzilla.samba.org/show_bug.cgi?id=14428).

share_mode_cleanup_disconnected() removes disconnected entries from
leases.tdb and brlock.tdb but not from locking.tdb.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agos3:selftest: also run durable_v2_reconnect_delay_msec in samba3.blackbox.durable_v2_delay
Stefan Metzmacher [Fri, 28 Aug 2020 13:33:43 +0000 (15:33 +0200)] 
s3:selftest: also run durable_v2_reconnect_delay_msec in samba3.blackbox.durable_v2_delay

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agolib/util: remove extra safe_string.h file
Matthew DeVore [Fri, 7 Aug 2020 20:27:39 +0000 (13:27 -0700)] 
lib/util: remove extra safe_string.h file

lib/util/safe_string.h is similar to source3/include/safe_string.h, but
the former has fewer checks. It is missing bcopy, strcasecmp, and
strncasecmp.

Add the missing elements to lib/util/safe_string.h remove the other
safe_string.h which is in the source3-specific path. To accomodate
existing uses of str(n?)casecmp, add #undef lines to source files where
they are used.

Signed-off-by: Matthew DeVore <matvore@google.com>
Reviewed-by: David Mulder <dmulder@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Aug 28 02:18:40 UTC 2020 on sn-devel-184

5 years agos3: safe_string: do not include string_wrappers.h
Matthew DeVore [Fri, 7 Aug 2020 18:17:34 +0000 (11:17 -0700)] 
s3: safe_string: do not include string_wrappers.h

Rather than have safe_string.h #include string_wrappers.h, make users of
string_wrappers.h include it explicitly.

includes.h now no longer includes string_wrappers.h transitively. Still
allow includes.h to #include safe_string.h for now so that as many
modules as possible get the safety checks in it.

Signed-off-by: Matthew DeVore <matvore@google.com>
Reviewed-by: David Mulder <dmulder@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agostring_wrappers: include replace.h
Matthew DeVore [Fri, 7 Aug 2020 18:14:57 +0000 (11:14 -0700)] 
string_wrappers: include replace.h

To ensure we always get the right value for the config.h macro
`HAVE_COMPILER_WILL_OPTIMIZE_OUT_FNS`, #include "lib/util/replace.h"
rather than rely on it being included by the API user.

Signed-off-by: Matthew DeVore <matvore@google.com>
Reviewed-by: David Mulder <dmulder@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolib/util: do not make string_wrappers.h public
Matthew DeVore [Fri, 7 Aug 2020 18:27:53 +0000 (11:27 -0700)] 
lib/util: do not make string_wrappers.h public

string_wrappers.h is a collection of macros. All but one of the macros
rely on symbols not defined in public headers, so it is not useful as a
public header.

For instance, fstring is defined in includes.h. PTR_DIFF is defined in
lib/util/memory.h, which is not public.

checked_strlcpy is actually self-contained and is usable outside of a
Samba build, but without a Samba config.h, it is just aliased to
strlcpy.

Signed-off-by: Matthew DeVore <matvore@google.com>
Reviewed-by: David Mulder <dmulder@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3: safe_string: remove unnecessary include
Matthew DeVore [Thu, 6 Aug 2020 22:42:46 +0000 (15:42 -0700)] 
s3: safe_string: remove unnecessary include

safe_string.h is only included by source3/include/includes.h, which
already includes ntstatus.h, so it is not necessary to include it
from within safe_string.h.

Signed-off-by: Matthew DeVore <matvore@google.com>
Reviewed-by: David Mulder <dmulder@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3:smbd: Fix strict aliasing in get_socket_port()
Andreas Schneider [Thu, 2 Apr 2020 12:16:10 +0000 (14:16 +0200)] 
s3:smbd: Fix strict aliasing in get_socket_port()

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): Thu Aug 27 21:59:17 UTC 2020 on sn-devel-184

5 years agoGPO: Add rsop output for Messages policy
David Mulder [Wed, 19 Aug 2020 17:27:26 +0000 (11:27 -0600)] 
GPO: Add rsop output for Messages policy

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): David Mulder <dmulder@samba.org>
Autobuild-Date(master): Thu Aug 27 17:19:48 UTC 2020 on sn-devel-184

5 years agoGPO: Test rsop output for Messages policy
David Mulder [Wed, 19 Aug 2020 17:25:57 +0000 (11:25 -0600)] 
GPO: Test rsop output for Messages policy

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 years agogpo: Apply Group Policy Login Prompt Message
David Mulder [Wed, 8 Jul 2020 21:30:25 +0000 (15:30 -0600)] 
gpo: Apply Group Policy Login Prompt Message

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 years agogpo: Test Group Policy Login Prompt Message
David Mulder [Thu, 9 Jul 2020 15:53:34 +0000 (09:53 -0600)] 
gpo: Test Group Policy Login Prompt Message

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 years agogpo: Apply Group Policy Message of the day
David Mulder [Wed, 8 Jul 2020 21:29:42 +0000 (15:29 -0600)] 
gpo: Apply Group Policy Message of the day

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 years agogpo: Test Group Policy Message of the day
David Mulder [Thu, 9 Jul 2020 14:39:41 +0000 (08:39 -0600)] 
gpo: Test Group Policy Message of the day

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 years agoGPO: Add rsop output for smb.conf policy
David Mulder [Wed, 19 Aug 2020 20:23:37 +0000 (14:23 -0600)] 
GPO: Add rsop output for smb.conf policy

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>