]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
5 years agoselftest: Add function for checking whether a module is enabled
Christof Schmitt [Wed, 19 Aug 2020 18:54:43 +0000 (11:54 -0700)] 
selftest: Add function for checking whether a module is enabled

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agowscript: Make list of shared modules available in STRING_SHARED_MODULES
Christof Schmitt [Wed, 19 Aug 2020 18:48:55 +0000 (11:48 -0700)] 
wscript: Make list of shared modules available in STRING_SHARED_MODULES

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolib/replace: move lib/replace/closefrom.c from ROKEN_HOSTCC_SOURCE to REPLACE_HOSTCC_...
Stefan Metzmacher [Tue, 8 Sep 2020 10:13:20 +0000 (10:13 +0000)] 
lib/replace: move lib/replace/closefrom.c from ROKEN_HOSTCC_SOURCE to REPLACE_HOSTCC_SOURCE

This is where it really belongs and we avoid the strange interaction
with source4/heimdal_build/config.h. This a follow up for commit
f31333d40e6fa38daa32a3ebb32d5a317c06fc62.

This fixes a build problem if libbsd-dev is not installed.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Björn Jacke <bjacke@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Sep  8 13:59:58 UTC 2020 on sn-devel-184

5 years agogitlab-ci: Fix the sha1sum
Andreas Schneider [Mon, 7 Sep 2020 15:36:58 +0000 (17:36 +0200)] 
gitlab-ci: Fix the sha1sum

The images where build with an invalid sha1sum.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Sep  7 23:57:48 UTC 2020 on sn-devel-184

5 years agos3: libsmb: Cleanup in get_dc_list()
Noel Power [Fri, 4 Sep 2020 11:23:14 +0000 (12:23 +0100)] 
s3: libsmb: Cleanup in get_dc_list()

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

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Mon Sep  7 14:46:58 UTC 2020 on sn-devel-184

5 years agos3: libsmb: Now we only have namecache_store_sa(), rename it back to namecache_store().
Jeremy Allison [Thu, 27 Aug 2020 19:17:07 +0000 (12:17 -0700)] 
s3: libsmb: Now we only have namecache_store_sa(), rename it back to namecache_store().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libsmb: Remove use of struct ip_service from the namecache code.
Jeremy Allison [Thu, 27 Aug 2020 19:14:13 +0000 (12:14 -0700)] 
s3: libsmb: Remove use of struct ip_service from the namecache code.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libsmb: Remove the last caller of namecache_store().
Jeremy Allison [Thu, 27 Aug 2020 19:04:50 +0000 (12:04 -0700)] 
s3: libsmb: Remove the last caller of namecache_store().

Convert to a struct samba_sockaddr array and use namecache_store_sa().

We can now remove the use of 'struct ip_list' from
the namecache code.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libsmb: Add internal conversion function ip_service_to_samba_sockaddr().
Jeremy Allison [Thu, 27 Aug 2020 18:59:20 +0000 (11:59 -0700)] 
s3: libsmb: Add internal conversion function ip_service_to_samba_sockaddr().

Compiles but commented out as not yet used. Next commit will
change that.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: winbindd: Use namecache_store_sa() inside dcip_check_name().
Jeremy Allison [Thu, 27 Aug 2020 18:52:57 +0000 (11:52 -0700)] 
s3: winbindd: Use namecache_store_sa() inside dcip_check_name().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libsmb: Use namecache_store_sa() instead of namecache_store().
Jeremy Allison [Thu, 27 Aug 2020 18:49:07 +0000 (11:49 -0700)] 
s3: libsmb: Use namecache_store_sa() instead of namecache_store().

Removes one more struct ip_service usage.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libsmb: Add namecache_store_sa(). Doesn't store ports and takes a samba_sockaddr...
Jeremy Allison [Thu, 27 Aug 2020 18:45:17 +0000 (11:45 -0700)] 
s3: libsmb: Add namecache_store_sa(). Doesn't store ports and takes a samba_sockaddr array.

Now uses ipstr_list_make_sa(). Now convert
the callers, remove namecache_store() and
then rename namecache_store_sa() back to namecache_store().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libsmb: Add internal ipstr_list_make_sa().
Jeremy Allison [Thu, 27 Aug 2020 18:40:10 +0000 (11:40 -0700)] 
s3: libsmb: Add internal ipstr_list_make_sa().

Duplicates ipstr_list_make() with samba_sockaddr, but doesn't store
ports. The duplication is temporary as the ipstr_list_make() function
will go away once namecache_store is converted to samba_sockaddr.

Compiles but 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 - resolve_name() get names from internal_resolve_names() which...
Jeremy Allison [Thu, 27 Aug 2020 18:33:20 +0000 (11:33 -0700)] 
s3: libsmb: Cleanup - resolve_name() get names from internal_resolve_names() which is guaranteed not to return zero addresses.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libsmb: Remove commented out wrapper for internal_resolve_name().
Jeremy Allison [Thu, 27 Aug 2020 18:23:08 +0000 (11:23 -0700)] 
s3: libsmb: Remove commented out wrapper for internal_resolve_name().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libsmb: Comment out wrapper function internal_resolve_name(). Rename _internal_re...
Jeremy Allison [Thu, 27 Aug 2020 18:14:10 +0000 (11:14 -0700)] 
s3: libsmb: Comment out wrapper function internal_resolve_name(). Rename _internal_resolve_name() -> internal_resolve_name().

We can now remove the wrapper.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libsmb: Remove now unused dup_ip_service_array().
Jeremy Allison [Thu, 27 Aug 2020 18:12:17 +0000 (11:12 -0700)] 
s3: libsmb: Remove now unused dup_ip_service_array().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libsmb: Finally change _internal_resolve_name() to return a talloc'ed ip_service...
Jeremy Allison [Thu, 27 Aug 2020 02:05:28 +0000 (19:05 -0700)] 
s3: libsmb: Finally change _internal_resolve_name() to return a talloc'ed ip_service array.

The wrapper internal_resolve_name() is now functionaly identical to _internal_resolve_name()
so we can remove it and rename _internal_resolve_name() back to internal_resolve_name().

dup_ip_service_array() is now no longer used, so comment it
out as it's a staic function.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libsmb: Make _internal_resolve_name() return a size_t pointer for count.
Jeremy Allison [Wed, 26 Aug 2020 23:42:29 +0000 (16:42 -0700)] 
s3: libsmb: Make _internal_resolve_name() return a size_t pointer for count.

Getting closer to being a idential to the wrapper function
internal_resolve_name() which we can then remove.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libsmb: _internal_resolve_name() code cleanup.
Jeremy Allison [Wed, 26 Aug 2020 23:38:32 +0000 (16:38 -0700)] 
s3: libsmb: _internal_resolve_name() code cleanup.

Only set *return_iplist just before success return.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libsmb: _internal_resolve_name() code cleanup.
Jeremy Allison [Wed, 26 Aug 2020 23:34:57 +0000 (16:34 -0700)] 
s3: libsmb: _internal_resolve_name() code cleanup.

Only set *return_count just before success return.
Preparing to move all counts to size_t.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3/libsmb: Cleanup coding in convert_ss2service()
Noel Power [Fri, 4 Sep 2020 02:22:21 +0000 (19:22 -0700)] 
s3/libsmb: Cleanup coding in convert_ss2service()

Don't update out params when unsuccessful

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3: libsmb: Cleanup coding in convert_ss2service().
Jeremy Allison [Wed, 26 Aug 2020 22:57:27 +0000 (15:57 -0700)] 
s3: libsmb: Cleanup coding in convert_ss2service().

Will make it easier to return a talloc'ed array.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libsmb: Change convert_ss2service() and it's one caller to take and return unsign...
Jeremy Allison [Wed, 26 Aug 2020 22:54:49 +0000 (15:54 -0700)] 
s3: libsmb: Change convert_ss2service() and it's one caller to take and return unsigned counts.

Getting closer to making _internal_resolve_name() return a pointer to size_t
for a count.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libsmb: Make namecache_store() take an unsigned count.
Jeremy Allison [Wed, 26 Aug 2020 22:45:35 +0000 (15:45 -0700)] 
s3: libsmb: Make namecache_store() take an unsigned count.

Counts can never be negative.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 years agos3: libsmb: _internal_resolve_name(). Remove unused free(s).
Jeremy Allison [Wed, 26 Aug 2020 22:43:46 +0000 (15:43 -0700)] 
s3: libsmb: _internal_resolve_name(). Remove unused free(s).

*return_iplist is guaranteeded to be always NULL here.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
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>