bbaumbach/samba-autobuild/.git
23 months agoRevert "docs-xml: Update documentation for removal of NIS support"
Samuel Cabrero [Fri, 3 Jun 2022 12:12:01 +0000 (14:12 +0200)]
Revert "docs-xml: Update documentation for removal of NIS support"

This partly reverts commit a72bc3e15d3ed62e9ad2c0a97ce5d6d653abb048.

Revert only the chunks related to netgroups and skip NIS related ones.

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

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
23 months agoRevert "s3:auth: Fix user_in_list() for UNIX groups"
Samuel Cabrero [Fri, 3 Jun 2022 12:01:36 +0000 (14:01 +0200)]
Revert "s3:auth: Fix user_in_list() for UNIX groups"

This partly reverts commit 6dc463d3e2eb229df1c4f620cfcaf22ac71738d4.

Reverted to allow next revert commits to apply cleanly. Do not recreate
selftest/knownfail.d/usernamemap file.

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

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
23 months agos3:smbd: Out-by-4 error in smbd read reply max_send clamp
Robert Sprowson [Sun, 19 Jul 2020 11:59:00 +0000 (12:59 +0100)]
s3:smbd: Out-by-4 error in smbd read reply max_send clamp

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

Signed-off-by: Robert Sprowson <webpages@sprow.co.uk>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jun  8 19:50:08 UTC 2022 on sn-devel-184

23 months agotdb: version 1.4.7
Stefan Metzmacher [Wed, 8 Jun 2022 13:02:53 +0000 (15:02 +0200)]
tdb: version 1.4.7

* Fix build problems

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Jun  8 17:57:53 UTC 2022 on sn-devel-184

23 months agotevent: version 0.12.1
Stefan Metzmacher [Wed, 8 Jun 2022 13:04:08 +0000 (15:04 +0200)]
tevent: version 0.12.1

* Fix build problems

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
23 months agotalloc: version 2.3.4
Stefan Metzmacher [Wed, 8 Jun 2022 13:01:55 +0000 (15:01 +0200)]
talloc: version 2.3.4

* Fix build problems

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
23 months agos3:tests: Reformat test_rpcclientsrvsvc.sh
Andreas Schneider [Fri, 22 Apr 2022 13:34:10 +0000 (15:34 +0200)]
s3:tests: Reformat test_rpcclientsrvsvc.sh

shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Jun  8 14:13:35 UTC 2022 on sn-devel-184

23 months agos3:tests: Reformat test_rpcclient_samlogon.sh
Andreas Schneider [Fri, 22 Apr 2022 13:34:10 +0000 (15:34 +0200)]
s3:tests: Reformat test_rpcclient_samlogon.sh

shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
23 months agos3:tests: Reformat test_rpcclient_pw_nt_hash.sh
Andreas Schneider [Fri, 22 Apr 2022 13:34:10 +0000 (15:34 +0200)]
s3:tests: Reformat test_rpcclient_pw_nt_hash.sh

shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
23 months agos3:tests: Reformat test_rpcclient_netsessenum.sh
Andreas Schneider [Fri, 22 Apr 2022 13:34:10 +0000 (15:34 +0200)]
s3:tests: Reformat test_rpcclient_netsessenum.sh

shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
23 months agos3:tests: Reformat test_rpcclient_lookup.sh
Andreas Schneider [Fri, 22 Apr 2022 13:34:10 +0000 (15:34 +0200)]
s3:tests: Reformat test_rpcclient_lookup.sh

shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
23 months agos3:tests: Reformat test_rpcclient_dfs.sh
Andreas Schneider [Fri, 22 Apr 2022 13:34:10 +0000 (15:34 +0200)]
s3:tests: Reformat test_rpcclient_dfs.sh

shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
23 months agos3:tests: Reformat test_rpcclient.sh
Andreas Schneider [Fri, 22 Apr 2022 13:34:10 +0000 (15:34 +0200)]
s3:tests: Reformat test_rpcclient.sh

shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
23 months agos3:tests: Reformat test_resolvconf.sh
Andreas Schneider [Fri, 22 Apr 2022 13:34:10 +0000 (15:34 +0200)]
s3:tests: Reformat test_resolvconf.sh

shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
23 months agos3:tests: Reformat test_registry_upgrade.sh
Andreas Schneider [Fri, 22 Apr 2022 13:34:10 +0000 (15:34 +0200)]
s3:tests: Reformat test_registry_upgrade.sh

shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
23 months agos3:tests: Reformat test_pthreadpool.sh
Andreas Schneider [Fri, 22 Apr 2022 13:34:10 +0000 (15:34 +0200)]
s3:tests: Reformat test_pthreadpool.sh

shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
23 months agos3:tests: Reformat test_printing_var_exp.sh
Andreas Schneider [Fri, 22 Apr 2022 13:34:10 +0000 (15:34 +0200)]
s3:tests: Reformat test_printing_var_exp.sh

shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
23 months agos3:tests: Reformat test_preserve_case.sh
Andreas Schneider [Fri, 22 Apr 2022 13:34:10 +0000 (15:34 +0200)]
s3:tests: Reformat test_preserve_case.sh

shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
23 months agos3:tests: Reformat test_open_eintr.sh
Andreas Schneider [Fri, 22 Apr 2022 13:34:10 +0000 (15:34 +0200)]
s3:tests: Reformat test_open_eintr.sh

shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
23 months agos3:tests: Reformat test_offline.sh
Andreas Schneider [Fri, 22 Apr 2022 13:34:10 +0000 (15:34 +0200)]
s3:tests: Reformat test_offline.sh

shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
23 months agos3:tests: Reformat test_netfileenum.sh
Andreas Schneider [Fri, 22 Apr 2022 13:34:10 +0000 (15:34 +0200)]
s3:tests: Reformat test_netfileenum.sh

shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
23 months agolib/smbconf: expose smbconf error codes to python wrapper
John Mulligan [Mon, 6 Jun 2022 19:55:22 +0000 (15:55 -0400)]
lib/smbconf: expose smbconf error codes to python wrapper

The smbconf library defines an enum of error codes that can be returned
from the C calls. The error codes were getting stored in the python
SMBConfError type but it was not easy to access or obvious what the
integer code represented.

This change makes it easier to get the returned error code: via a
`error_code` attribute on the exception value. It also exposes the
integer constants to the module. Simple tests for a few of the more
obvious error codes check that this new error handling correctly
exposes the error code values.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Wed Jun  8 13:13:10 UTC 2022 on sn-devel-184

23 months agos3:tests: Reformat test_net_usershare.sh
Andreas Schneider [Fri, 22 Apr 2022 13:34:09 +0000 (15:34 +0200)]
s3:tests: Reformat test_net_usershare.sh

shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Jun  8 07:28:08 UTC 2022 on sn-devel-184

23 months agos3:tests: Reformat test_net_tdb.sh
Andreas Schneider [Fri, 22 Apr 2022 13:34:09 +0000 (15:34 +0200)]
s3:tests: Reformat test_net_tdb.sh

shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
23 months agos3:tests: Reformat test_net_rpc_share_allowedusers.sh
Andreas Schneider [Fri, 22 Apr 2022 13:34:09 +0000 (15:34 +0200)]
s3:tests: Reformat test_net_rpc_share_allowedusers.sh

shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
23 months agos3:tests: Reformat test_net_rpc_oldjoin.sh
Andreas Schneider [Fri, 22 Apr 2022 13:34:09 +0000 (15:34 +0200)]
s3:tests: Reformat test_net_rpc_oldjoin.sh

shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
23 months agos3:tests: Reformat test_net_rpc_join_creds.sh
Andreas Schneider [Fri, 22 Apr 2022 13:34:09 +0000 (15:34 +0200)]
s3:tests: Reformat test_net_rpc_join_creds.sh

shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
23 months agos3:tests: Reformat test_net_rpc_join.sh
Andreas Schneider [Fri, 22 Apr 2022 13:34:09 +0000 (15:34 +0200)]
s3:tests: Reformat test_net_rpc_join.sh

shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
23 months agos3:tests: Reformat test_net_registry_roundtrip.sh
Andreas Schneider [Fri, 22 Apr 2022 13:34:09 +0000 (15:34 +0200)]
s3:tests: Reformat test_net_registry_roundtrip.sh

shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
23 months agos3:tests: Reformat test_net_registry_import.sh
Andreas Schneider [Fri, 22 Apr 2022 13:34:09 +0000 (15:34 +0200)]
s3:tests: Reformat test_net_registry_import.sh

shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
23 months agos3:tests: Reformat test_net_registry_check.sh
Andreas Schneider [Fri, 22 Apr 2022 13:34:09 +0000 (15:34 +0200)]
s3:tests: Reformat test_net_registry_check.sh

shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
23 months agos3:tests: Reformat test_net_registry.sh
Andreas Schneider [Fri, 22 Apr 2022 13:34:09 +0000 (15:34 +0200)]
s3:tests: Reformat test_net_registry.sh

shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
23 months agos3:tests: Reformat test_net_misc.sh
Andreas Schneider [Fri, 22 Apr 2022 13:34:09 +0000 (15:34 +0200)]
s3:tests: Reformat test_net_misc.sh

shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
23 months agos3:tests: Reformat test_net_machine_account.sh
Andreas Schneider [Fri, 22 Apr 2022 13:34:09 +0000 (15:34 +0200)]
s3:tests: Reformat test_net_machine_account.sh

shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
23 months agos3:tests: Reformat test_net_lookup.sh
Andreas Schneider [Fri, 22 Apr 2022 13:34:09 +0000 (15:34 +0200)]
s3:tests: Reformat test_net_lookup.sh

shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
23 months agos3:tests: Reformat test_net_dom_join_fail_dc.sh
Andreas Schneider [Fri, 22 Apr 2022 13:34:09 +0000 (15:34 +0200)]
s3:tests: Reformat test_net_dom_join_fail_dc.sh

shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
23 months agos3:tests: Reformat test_net_cred_change.sh
Andreas Schneider [Fri, 22 Apr 2022 13:34:09 +0000 (15:34 +0200)]
s3:tests: Reformat test_net_cred_change.sh

shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
23 months agos3:tests: Reformat test_net_conf.sh
Andreas Schneider [Fri, 22 Apr 2022 13:34:09 +0000 (15:34 +0200)]
s3:tests: Reformat test_net_conf.sh

shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Jun  7 09:19:43 UTC 2022 on sn-devel-184

23 months agos3:tests: Reformat test_net_cache_samlogon.sh
Andreas Schneider [Fri, 22 Apr 2022 13:34:09 +0000 (15:34 +0200)]
s3:tests: Reformat test_net_cache_samlogon.sh

shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
23 months agowinbindd: Remove a "wrong" error message
Volker Lendecke [Sun, 5 Jun 2022 15:28:04 +0000 (17:28 +0200)]
winbindd: Remove a "wrong" error message

Before 9bacf7529dd child_process_request() returned right after the
callback function without going through the DEBUG message. Restore
that behaviour.

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): Mon Jun  6 20:17:06 UTC 2022 on sn-devel-184

23 months agolib: Slightly simplify is_ntfs_stream_smb_fname()
Volker Lendecke [Sun, 5 Jun 2022 12:39:48 +0000 (14:39 +0200)]
lib: Slightly simplify is_ntfs_stream_smb_fname()

YMMV, but for me the direct return is easier to read

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
23 months agovfs: Remove a typedef
Volker Lendecke [Fri, 3 Jun 2022 12:47:30 +0000 (14:47 +0200)]
vfs: Remove a typedef

We want to get rid of struct typedefs, and this was quick

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
23 months agosmbd: Fix a typo
Volker Lendecke [Thu, 2 Jun 2022 13:48:37 +0000 (15:48 +0200)]
smbd: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
23 months agosmbd: Fix CID 1504457 Resource leak
Volker Lendecke [Fri, 20 May 2022 08:18:59 +0000 (10:18 +0200)]
smbd: Fix CID 1504457 Resource leak

Highly likely that's a false positive because Coverity does not
understand that srv_encrypt_buffer() only allocates when
NT_STATUS_OK(status), but it does not hurt to make it happy this way.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
23 months agosmbd: Remove NTCREATEX_FLAG_DELETE_ON_CLOSE
Volker Lendecke [Thu, 19 May 2022 18:05:52 +0000 (20:05 +0200)]
smbd: Remove NTCREATEX_FLAG_DELETE_ON_CLOSE

This is only used for print files. Storing it in the fd_handle seems
overkill to me, this can easily be stored directly in the fsp itself,
we have a flag for this.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
23 months agolsa_server4: Simplify get_tdo() with talloc_asprintf_addbuf()
Volker Lendecke [Fri, 27 May 2022 18:57:53 +0000 (20:57 +0200)]
lsa_server4: Simplify get_tdo() with talloc_asprintf_addbuf()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
23 months agolsa_server4: Simplify get_tdo() with dom_sid_str_buf()
Volker Lendecke [Fri, 27 May 2022 16:38:34 +0000 (18:38 +0200)]
lsa_server4: Simplify get_tdo() with dom_sid_str_buf()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
23 months agosmbd: Move message_push_string() to smb1_utils.c
Volker Lendecke [Sun, 5 Jun 2022 14:44:28 +0000 (16:44 +0200)]
smbd: Move message_push_string() to smb1_utils.c

Only used in SMB1 code

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
23 months agosmbd: Remove unused smb_bufrem() macro
Volker Lendecke [Sun, 5 Jun 2022 14:37:13 +0000 (16:37 +0200)]
smbd: Remove unused smb_bufrem() macro

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
23 months agos3:smbd implement volume serial number parameter
Christian Ambach [Tue, 31 May 2022 19:13:25 +0000 (21:13 +0200)]
s3:smbd implement volume serial number parameter

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14765
RN: add new smb.conf parameter "volume serial number" to allow overriding
the generated default value

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed=by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Jun  6 17:42:37 UTC 2022 on sn-devel-184

23 months agodocs-xml: add new parameter volume serial number
Christian Ambach [Wed, 18 May 2022 20:07:17 +0000 (22:07 +0200)]
docs-xml: add new parameter volume serial number

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14765
RN: add new smb.conf parameter "volume serial number" to allow overriding
the generated default value

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
23 months agos3:smbd factor out volume serial number generation
Christian Ambach [Wed, 27 Apr 2022 17:27:15 +0000 (19:27 +0200)]
s3:smbd factor out volume serial number generation

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14765
RN: add new smb.conf parameter "volume serial number" to allow overriding the
generated default value

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
23 months agos3:smbd add missing VolumeCreationTime to FileFsVolumeInformation
Christian Ambach [Sat, 7 May 2022 18:37:34 +0000 (20:37 +0200)]
s3:smbd add missing VolumeCreationTime to FileFsVolumeInformation

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
23 months agos3:include fix typo
Christian Ambach [Sat, 7 May 2022 18:35:43 +0000 (20:35 +0200)]
s3:include fix typo

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
23 months agoselftests: Convert "net ads dns async" test to python
Samuel Cabrero [Thu, 2 Jun 2022 16:39:57 +0000 (18:39 +0200)]
selftests: Convert "net ads dns async" test to python

The current test uses the dig tool from bind9 but this tool has been
rewritten in 9.17.7 to use bind's netmgr functions instead of isc_socket
(commit 94b7988efb0f9b96415dd2966e6070450d960263).

The problem is that these 'netmgr' functions use libuv internally, and, on
systems supporting it, they end up using the sendmmsg() syscall which is not
catched by socket wrapper so the test fails.

This commit converts the test to python and uses the dnspython module
instead of the dig tool. Backtraces follow as reference.

Backtrace from dig v9.16.28 (working):

 #0  0x00007ffff778edee in sendmsg () from /lib64/libc.so.6
 #1  0x00000000005e5dee in cmsgsend (s=s@entry=12, level=level@entry=0, type=type@entry=1, res=<optimized out>) at net.c:515
 #2  0x00000000005e616c in try_dscp_v4 () at net.c:623
 #3  try_dscp () at net.c:696
 #4  0x00007ffff7708ad7 in __pthread_once_slow () from /lib64/libc.so.6
 #5  0x00000000005e66d7 in initialize_dscp () at net.c:702
 #6  isc_net_probedscp () at net.c:707
 #7  0x00000000005e8460 in socket_create (manager=0x6b49c0, pf=2, type=<optimized out>, socketp=0x7ffff0012b00, dup_socket=0x0) at socket.c:2454
 #8  0x000000000043cfcd in send_udp (query=0x7ffff00129a8) at dighost.c:2897
 #9  0x000000000043f9c7 in onrun_callback (task=<optimized out>, event=<optimized out>) at dighost.c:4271
 #10 0x00000000005dfefe in task_run (task=0x6b5c70) at task.c:851
 #11 isc_task_run (task=0x6b5c70) at task.c:944
 #12 0x00000000005ca0ce in isc__nm_async_task (worker=0x6b8970, ev0=0x716250) at netmgr.c:873
 #13 process_netievent (worker=worker@entry=0x6b8970, ievent=0x716250) at netmgr.c:952
 #14 0x00000000005ca2ba in process_queue (worker=worker@entry=0x6b8970, type=type@entry=NETIEVENT_TASK) at netmgr.c:1021
 #15 0x00000000005caa43 in process_all_queues (worker=0x6b8970) at netmgr.c:792
 #16 async_cb (handle=0x6b8cd0) at netmgr.c:821
 #17 0x00007ffff7898a4d in ?? () from /lib64/libuv.so.1
 #18 0x00007ffff78b4217 in ?? () from /lib64/libuv.so.1
 #19 0x00007ffff789e40a in uv_run () from /lib64/libuv.so.1
 #20 0x00000000005ca31e in nm_thread (worker0=0x6b8970) at netmgr.c:727
 #21 0x00000000005e2315 in isc__trampoline_run (arg=0x6b7c40) at trampoline.c:198
 #22 0x00007ffff7703767 in start_thread () from /lib64/libc.so.6
 #23 0x00007ffff778dc10 in clone3 () from /lib64/libc.so.6

Backtrace from dig v9.17.7 (not working):

 #0  0x00007ffff7684480 in syscall () from /lib64/libc.so.6
 #1  0x00007ffff754aed0 in uv__sendmmsg (vlen=0, mmsg=0x0, fd=10) at src/unix/linux-syscalls.c:163
 #2  uv__udp_mmsg_init () at src/unix/udp.c:74
 #3  0x00007ffff7606ad7 in __pthread_once_slow () from /lib64/libc.so.6
 #4  0x00007ffff7541bd9 in uv_once (guard=<optimized out>, callback=<optimized out>) at src/unix/thread.c:440
 #5  0x00007ffff7539e9b in uv__udp_sendmsg (handle=0x7ffff50535b8) at src/unix/udp.c:415
 #6  uv__udp_send (send_cb=0x7ffff7a41db0 <udp_send_cb>, addrlen=<optimized out>, addr=<optimized out>, nbufs=1, bufs=0x7ffff506c720, handle=0x7ffff50535b8, req=0x7ffff506c878) at src/unix/udp.c:773
 #7  uv_udp_send (req=req@entry=0x7ffff506c878, handle=handle@entry=0x7ffff50535b8, bufs=bufs@entry=0x7ffff506c720, nbufs=nbufs@entry=1, addr=<optimized out>, send_cb=send_cb@entry=0x7ffff7a41db0 <udp_send_cb>) at src/uv-common.c:464
 #8  0x00007ffff7a42308 in udp_send_direct (peer=0x7ffff5dfa988, req=0x7ffff506c700, sock=0x7ffff5053000) at netmgr/udp.c:839
 #9  isc__nm_async_udpsend (worker=<optimized out>, ev0=0x7ffff5dfa950) at netmgr/udp.c:780
 #10 0x00007ffff7a47de7 in isc__nm_udp_send (handle=<optimized out>, region=0x7ffff5dfaa90, cb=0x555555566250 <send_done>, cbarg=<optimized out>) at netmgr/udp.c:749
 #11 0x0000555555562ac2 in send_udp (query=0x7ffff502a000) at /usr/src/debug/bind-9.18.2-1.1.x86_64/bin/dig/dighost.c:2899
 #12 udp_ready (handle=0x7ffff5026180, eresult=ISC_R_SUCCESS, arg=<optimized out>) at /usr/src/debug/bind-9.18.2-1.1.x86_64/bin/dig/dighost.c:2974
 #13 0x00007ffff7a37d34 in isc__nm_async_connectcb (worker=worker@entry=0x7ffff622f000, ev0=ev0@entry=0x7ffff5026480) at netmgr/netmgr.c:2704
 #14 0x00007ffff7a3ca20 in process_netievent (worker=worker@entry=0x7ffff622f000, ievent=0x7ffff5026480) at netmgr/netmgr.c:940
 #15 0x00007ffff7a3d027 in process_queue (worker=worker@entry=0x7ffff622f000, type=type@entry=NETIEVENT_NORMAL) at netmgr/netmgr.c:977
 #16 0x00007ffff7a3d203 in process_all_queues (worker=0x7ffff622f000) at netmgr/netmgr.c:733
 #17 async_cb (handle=0x7ffff622f360) at netmgr/netmgr.c:762
 #18 0x00007ffff7531a4d in uv__async_io (loop=0x7ffff622f010, w=<optimized out>, events=<optimized out>) at src/unix/async.c:163
 #19 0x00007ffff754d217 in uv__io_poll (loop=0x7ffff622f010, timeout=<optimized out>) at src/unix/epoll.c:374
 #20 0x00007ffff753740a in uv__io_poll (timeout=<optimized out>, loop=0x7ffff622f010) at src/unix/udp.c:122
 #21 uv_run (loop=loop@entry=0x7ffff622f010, mode=mode@entry=UV_RUN_DEFAULT) at src/unix/core.c:391
 #22 0x00007ffff7a3d624 in nm_thread (worker0=0x7ffff622f000) at netmgr/netmgr.c:664
 #23 0x00007ffff7a6c915 in isc__trampoline_run (arg=0x555555599210) at /usr/src/debug/bind-9.18.2-1.1.x86_64/lib/isc/trampoline.c:187
 #24 0x00007ffff7601767 in start_thread () from /lib64/libc.so.6
 #25 0x00007ffff768bc10 in clone3 () from /lib64/libc.so.6

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Jun  4 00:27:29 UTC 2022 on sn-devel-184

23 months agolib/util/gpfswrap: remove unused gpfswrap_get_winattrs_path()
Ralph Boehme [Tue, 17 May 2022 14:52:21 +0000 (16:52 +0200)]
lib/util/gpfswrap: remove unused gpfswrap_get_winattrs_path()

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jun  3 21:53:31 UTC 2022 on sn-devel-184

23 months agovfs_gpfs: use handle based gpfswrap_get_winattrs()
Ralph Boehme [Tue, 17 May 2022 14:32:23 +0000 (16:32 +0200)]
vfs_gpfs: use handle based gpfswrap_get_winattrs()

Fixes detecting offline flag for files in snapshot – no idea if this is
actually expected.

Replaces path based gpfswrap_get_winattrs_path() with handle based version
gpfswrap_get_winattrs(). When dealing with files in snapshots fsp->fsp_name
points to the active dataset, which will cause ENOENT failures if files are
deleted there any only present in the snapshot.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
23 months agolib/util/gpfswrap: remove unused gpfswrap_getacl()
Ralph Boehme [Tue, 17 May 2022 14:27:58 +0000 (16:27 +0200)]
lib/util/gpfswrap: remove unused gpfswrap_getacl()

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
23 months agovfs_gpfs: finally: use gpfswrap_fgetacl() instead of gpfswrap_getacl()
Ralph Boehme [Tue, 17 May 2022 14:02:10 +0000 (16:02 +0200)]
vfs_gpfs: finally: use gpfswrap_fgetacl() instead of gpfswrap_getacl()

Replaces path based gpfswrap_getacl() with handle based version
gpfswrap_fgetacl(). When dealing with files in snapshots fsp->fsp_name points to
the active dataset, which will cause ENOENT failures if files are deleted there
any only present in the snapshot:

[2022/05/06 11:32:55.233435,  4, pid=12962, effective(1460548, 273710), real(1460548, 0)]
   calling open_file with flags=0x0 flags2=0x800 mode=0644, access_mask = 0x80, open_access_mask = 0x80
[2022/05/06 11:32:55.233460, 10, pid=12962, effective(1460548, 273710), real(1460548, 0), class=vfs]
   gpfs_get_nfs4_acl invoked for dir/subdir/file.txt
[2022/05/06 11:32:55.233495,  5, pid=12962, effective(1460548, 273710), real(1460548, 0), class=vfs]
   smbd_gpfs_getacl failed with No such file or directory
[2022/05/06 11:32:55.233521,  9, pid=12962, effective(1460548, 273710), real(1460548, 0), class=vfs]
   gpfs_getacl failed for dir/subdir/file.txt with No such file or directory
[2022/05/06 11:32:55.233546, 10, pid=12962, effective(1460548, 273710), real(1460548, 0)]
   smbd_check_access_rights_fsp: Could not get acl on dir/subdir/file.txt {@GMT-2022.05.04-11.58.53}: NT_STATUS_OBJECT_NAME_NOT_FOUND

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
23 months agolib/util/gpfswrap: add gpfswrap_fgetacl()
Ralph Boehme [Tue, 17 May 2022 13:43:39 +0000 (15:43 +0200)]
lib/util/gpfswrap: add gpfswrap_fgetacl()

Adds handle based version of gpfswrap_getacl().

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
23 months agovfs_gpfs: pass fsp to gpfs_getacl_with_capability()
Ralph Boehme [Tue, 17 May 2022 14:01:48 +0000 (16:01 +0200)]
vfs_gpfs: pass fsp to gpfs_getacl_with_capability()

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
23 months agovfs_gpfs: pass fsp to vfs_gpfs_getacl()
Ralph Boehme [Tue, 17 May 2022 13:35:26 +0000 (15:35 +0200)]
vfs_gpfs: pass fsp to vfs_gpfs_getacl()

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
23 months agovfs_gpfs: use fsp in gpfsacl_get_posix_acl()
Ralph Boehme [Tue, 17 May 2022 13:34:35 +0000 (15:34 +0200)]
vfs_gpfs: use fsp in gpfsacl_get_posix_acl()

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
23 months agovfs_gpfs: pass fsp to gpfsacl_get_posix_acl()
Ralph Boehme [Tue, 17 May 2022 13:32:24 +0000 (15:32 +0200)]
vfs_gpfs: pass fsp to gpfsacl_get_posix_acl()

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
23 months agovfs_gpfs: pass fsp to gpfs_get_nfs4_acl()
Ralph Boehme [Tue, 17 May 2022 13:25:35 +0000 (15:25 +0200)]
vfs_gpfs: pass fsp to gpfs_get_nfs4_acl()

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
23 months agovfs_gpfs: pass fsp to gpfsacl_emu_chmod()
Ralph Boehme [Tue, 17 May 2022 13:17:34 +0000 (15:17 +0200)]
vfs_gpfs: pass fsp to gpfsacl_emu_chmod()

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
23 months agovfs_gpfs: indentation and README.Coding fixes
Ralph Boehme [Tue, 17 May 2022 12:47:03 +0000 (14:47 +0200)]
vfs_gpfs: indentation and README.Coding fixes

Best viewed with git show -w.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
23 months agos3:printing: Start samba-bgqd as soon as possible
Andreas Schneider [Tue, 31 May 2022 06:35:00 +0000 (08:35 +0200)]
s3:printing: Start samba-bgqd as soon as possible

We need some time to fill the printcap cache.

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

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): Tue May 31 21:51:07 UTC 2022 on sn-devel-184

23 months agos3:printing: Initialize the printcap cache as soon as the bgqd starts
Andreas Schneider [Mon, 30 May 2022 15:22:21 +0000 (17:22 +0200)]
s3:printing: Initialize the printcap cache as soon as the bgqd starts

As soon as the background daemon starts, we need to initialize the
printcap cache so that rpcd-spoolssd can serve printers.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
23 months agogpo: Move Group Policy code below gp directory
David Mulder [Fri, 27 May 2022 16:56:25 +0000 (10:56 -0600)]
gpo: Move Group Policy code below gp directory

Moves the Group Policy extensions and supporting
code within the existing python/samba/gp directory.
Meant to clean up the clutter that's accumulating
in python/samba.

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue May 31 20:15:45 UTC 2022 on sn-devel-184

23 months agowinbind: Create local krb5.conf for idmap backend ad
Volker Lendecke [Tue, 24 May 2022 06:23:25 +0000 (08:23 +0200)]
winbind: Create local krb5.conf for idmap backend ad

Without this, it can happen that tldap will look at a possibly wrong
/etc/krb5.conf. I have not reliably reproduced this, because a
set_domain_online_request() in the idmap child might interfere with
this, so I could not write a comprehensive test for this. Manual
testing however fixes the issue that wbinfo --sid-to-uid can take ages
asking a potentially nonexisting KDC.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
23 months agoctdb-tests: Fix a cut and paste error in a comment
Martin Schwenke [Tue, 24 May 2022 01:30:20 +0000 (11:30 +1000)]
ctdb-tests: Fix a cut and paste error in a comment

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Tue May 31 05:56:43 UTC 2022 on sn-devel-184

23 months agoctdb-recoverd: Do not ban on unknown error when taking cluster lock
Martin Schwenke [Thu, 19 May 2022 05:09:41 +0000 (15:09 +1000)]
ctdb-recoverd: Do not ban on unknown error when taking cluster lock

If the cluster filesystem is unavailable then I/O errors may occur.
This is no worse than contention, so don't ban.  This avoids having
services unavailable for longer than necessary.

Update the associated test to simply confirm that this results in a
leaderless cluster, and leadership is restored when the lock can once
again be taken.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
23 months agoctdb-doc: Fix typos in the policy routing documentation
Martin Schwenke [Thu, 3 Mar 2022 21:52:32 +0000 (08:52 +1100)]
ctdb-doc: Fix typos in the policy routing documentation

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
23 months agoctdb-daemon: Remove unused #includes of rb_tree.h
Martin Schwenke [Tue, 22 Feb 2022 22:57:33 +0000 (09:57 +1100)]
ctdb-daemon: Remove unused #includes of rb_tree.h

ctdb_takeover.c and eventscript.c no longer use this.
ipalloc_common.c has never used it.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
23 months agoctdb-daemon: Log per-database summary of resent calls
Martin Schwenke [Fri, 15 Oct 2021 00:10:46 +0000 (11:10 +1100)]
ctdb-daemon: Log per-database summary of resent calls

After a recovery that takes a significant amount of time the logs are
flooded with messages about every resent call.

Log a summary instead and demote per-call messages to INFO level.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
23 months agodebug: update comments about setup_logging()
Douglas Bagnall [Thu, 26 May 2022 03:50:23 +0000 (15:50 +1200)]
debug: update comments about setup_logging()

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon May 30 11:03:47 UTC 2022 on sn-devel-184

23 months agocmdline_s4: re-initialise logging once loadparm is ready
Douglas Bagnall [Thu, 26 May 2022 03:46:08 +0000 (15:46 +1200)]
cmdline_s4: re-initialise logging once loadparm is ready

The first time round we maybe didn't know which files we wanted to log to.
Suppose, for example, we had an smb.conf with

 log level = 1 dsdb_group_json_audit:5@/var/log/group_json.log

we wouldn't see anything in "/var/log/group_json.log", while the level
5 dsdb_group_json_audit messages would go into the main log.

Note that the named file would still be opened by winbindd and others
that use the s3 code, but would remain empty as they don't have anything
to say about dsdb_group_json_audit.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
23 months agopy:gpo: Fix testing of 0x8000 bit
Pavel Filipenský [Thu, 26 May 2022 13:38:23 +0000 (15:38 +0200)]
py:gpo: Fix testing of 0x8000 bit

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: David Mulder <dmulder@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): David Mulder <dmulder@samba.org>
Autobuild-Date(master): Thu May 26 19:36:52 UTC 2022 on sn-devel-184

23 months ago[ci-images] remove use of sudo in image building smoke test
Uri Simchoni [Tue, 24 May 2022 19:54:04 +0000 (22:54 +0300)]
[ci-images] remove use of sudo in image building smoke test

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Wed May 25 20:50:25 UTC 2022 on sn-devel-184

23 months ago[ci-images] run podman directly instead of docker link
Uri Simchoni [Mon, 23 May 2022 19:58:16 +0000 (22:58 +0300)]
[ci-images] run podman directly instead of docker link

Instead of having a symbolic link from docker to podman,
use podman directly. This is made for better clarity, and
because docker and podman are not 100% intechangeable in this
script.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
23 months ago[ci-images] use podman instead of docker
Uri Simchoni [Mon, 23 May 2022 17:42:55 +0000 (20:42 +0300)]
[ci-images] use podman instead of docker

Use podman as image building tool instead of docker. The image-creation
pipeline still runs on docker only (until gitlab-runner supports
podman), but the pipeline image may emply podman instead of docker to
build images.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
23 months agos3/util/py_net.c: fix samba-tool domain join&leave segfault
Michael Tokarev [Tue, 24 May 2022 13:25:41 +0000 (16:25 +0300)]
s3/util/py_net.c: fix samba-tool domain join&leave segfault

We process python args using PyArg_ParseTupleAndKeywords(), and use "p"
type modifier there.  According to documentation, this type modifier,
while works for a boolean type, expects an argument of type int. But in
py_net_join_member() and  py_net_leave() we use argument of type uint8_t
(no_dns_update, keep_account, r->in.debug). So when PyArg_ParseTupleAndKeywords()
tries to assign a value to &no_dns_update, it updates subsequent, unrelated bytes
too, - which ones depends on the stack and structure layout used by the compiler.

Fix this by using int type for all relevant variables, and by introducing proxy
variable "debug" (of the same type) for r->in.debug.

While at it, also ensure all variables have sensible default values.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed May 25 06:19:32 UTC 2022 on sn-devel-184

23 months agos3/client: Restore '-E' handling
Noel Power [Mon, 23 May 2022 16:23:41 +0000 (17:23 +0100)]
s3/client: Restore '-E' handling

Sometimes we really do need to redirect output to stderr
e.g. when using the tar command to output the archive to stdout
we don't want debug or cmdline status messages straying into stdout.

was removed with commit: e4474ac0a540c56548b4d15e38f2e234455e19b6

remove known fail for the test

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15075
Signed-off-by: Noel Power <noel.power@suse.com>
Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Tue May 24 10:29:27 UTC 2022 on sn-devel-184

23 months agos3/script/tests: Test smbclient -E redirects output to stderr
Noel Power [Mon, 23 May 2022 19:11:13 +0000 (20:11 +0100)]
s3/script/tests: Test smbclient -E redirects output to stderr

Add new test to ensure smbclient is writing to stderr (with '-E')
Add knownfail for this test (will be removed when issue is fixed in
later commit)

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15075
Signed-off-by: Noel Power <noel.power@suse.com>
23 months agos3:libads: Clear previous CLDAP ping flags when reusing the ADS_STRUCT
Samuel Cabrero [Mon, 23 May 2022 12:11:24 +0000 (14:11 +0200)]
s3:libads: Clear previous CLDAP ping flags when reusing the ADS_STRUCT

Before commit 1d066f37b9217a475b6b84a935ad51fbec88fe04, when the LDAP
connection wasn't established yet (ads->ldap.ld == NULL), the
ads_current_time() function always allocated and initialized a new
ADS_STRUCT even when ads->ldap.ss had a good address after having called
ads_find_dc().

After that commit, when the ADS_STRUCT is reused and passed to the
ads_connect() call, ads_try_connect() may fail depending on the
contacted DC because ads->config.flags field can contain the flags
returned by the previous CLDAP call. For example, when having 5 DCs:

* 192.168.101.31 has PDC FSMO role
* 192.168.101.32
* 192.168.101.33
* 192.168.101.34
* 192.168.101.35

$> net ads info -S 192.168.101.35

net_ads_info()
  ads_startup_nobind()
    ads_startup_int()
      ads_init()
      ads_connect()
        ads_try_connect(192.168.101.35)
          check_cldap_reply_required_flags(returned=0xF1FC, required=0x0)
  ads_current_time()
    ads_connect()
      ads_try_connect(192.168.101.35)
        check_cldap_reply_required_flags(returned=0xF1FC, required=0xF1FC)

The check_cldap_reply_required_flags() call fails because
ads->config.flags contain the flags returned by the previous CLDAP call,
even when the returned and required values match because they have
different semantics:

  if (req_flags & DS_PDC_REQUIRED)
        RETURN_ON_FALSE(ret_flags & NBT_SERVER_PDC);

  translates to:

  if (0xF1FC & 0x80)
        RETURN_ON_FALSE(0xF1FC & 0x01);

  which returns false because 192.168.101.35 has no PDC FSMO role.

The easiest fix for now is to reset ads->config.flags in
ads_current_time() when reusing an ADS_STRUCT before calling
ads_connect(), but we should consider storing the required and returned
flags in different fields or at least use the same bitmap for them
because check_cldap_reply_required_flags() is checking a
netr_DsRGetDCName_flags value using the nbt_server_type bitmap.

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

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon May 23 19:18:38 UTC 2022 on sn-devel-184

23 months agos3:libnet: Fix talloc frame not freed in order
Samuel Cabrero [Mon, 23 May 2022 09:51:32 +0000 (11:51 +0200)]
s3:libnet: Fix talloc frame not freed in order

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
23 months agos3:libads: Print 'gc' and 'no_fallback' fields in ndr_print_ads_struct()
Samuel Cabrero [Mon, 23 May 2022 09:43:29 +0000 (11:43 +0200)]
s3:libads: Print 'gc' and 'no_fallback' fields in ndr_print_ads_struct()

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
23 months agopython/gp_cert_auto_enroll: Fix bitwise test in expression
Pavel Filipenský [Mon, 23 May 2022 11:10:31 +0000 (13:10 +0200)]
python/gp_cert_auto_enroll: Fix bitwise test in expression

Found by covscan.

result_independent_of_operands: "(e.data & 4) == 1" is always false regardless of the values of its operands. This occurs as the operand of assignment.

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
23 months agos3:lib: Fix use_after_free: Using freed pointer "p"
Pavel Filipenský [Mon, 23 May 2022 10:57:42 +0000 (12:57 +0200)]
s3:lib: Fix use_after_free: Using freed pointer "p"

Found by covscan.

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agothird_party: Update waf to version 2.0.24
Andreas Schneider [Mon, 23 May 2022 05:54:06 +0000 (07:54 +0200)]
third_party: Update waf to version 2.0.24

This fixes building of python libraries with Python 3.11!

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon May 23 09:34:51 UTC 2022 on sn-devel-184

2 years agos4/dlz: add support for bind 9.18
Douglas Bagnall [Wed, 23 Feb 2022 23:17:00 +0000 (12:17 +1300)]
s4/dlz: add support for bind 9.18

It seems nothing has changed since 9.16 for our purposes.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Signed-off-by: Andreas Hasenack <andreas@canonical.com>
Pair-programmed-with: Andreas Hasenack <andreas@canonical.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Mon May 23 00:53:09 UTC 2022 on sn-devel-184

2 years agosrvsvcd: Silence a integer type warning
Volker Lendecke [Sun, 15 May 2022 11:30:09 +0000 (13:30 +0200)]
srvsvcd: Silence a integer type warning

Okay because lp_csc_policy() is an enum with 4 choices

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): Fri May 20 19:59:07 UTC 2022 on sn-devel-184

2 years agosrvsvcd: Avoid an "else" due to the early return
Volker Lendecke [Sun, 15 May 2022 11:20:34 +0000 (13:20 +0200)]
srvsvcd: Avoid an "else" due to the early return

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosrvsvcd: Directly initialize variables in count_for_all_fn()
Volker Lendecke [Sun, 15 May 2022 11:19:35 +0000 (13:19 +0200)]
srvsvcd: Directly initialize variables in count_for_all_fn()

Easier to read for me

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosrvsvcd: Align integer types
Volker Lendecke [Sun, 15 May 2022 11:18:24 +0000 (13:18 +0200)]
srvsvcd: Align integer types

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosrvsvcd: Fix shareinfo2 max_connections calculation
Volker Lendecke [Sun, 15 May 2022 11:17:06 +0000 (13:17 +0200)]
srvsvcd: Fix shareinfo2 max_connections calculation

lp_max_connections() being an int could be >UINT32_MAX

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosrvsvcd: Use UINT32_MAX where appropriate
Volker Lendecke [Sun, 15 May 2022 11:15:31 +0000 (13:15 +0200)]
srvsvcd: Use UINT32_MAX where appropriate

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agoregistry3: Align some integer types
Volker Lendecke [Thu, 19 May 2022 18:10:52 +0000 (20:10 +0200)]
registry3: Align some integer types

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Simplify copy_file()
Volker Lendecke [Fri, 20 May 2022 06:06:28 +0000 (08:06 +0200)]
smbd: Simplify copy_file()

Pass in new_create_disposition directly. We can also remove the
if-case (ofun & OPENX_FILE_EXISTS_OPEN) in copy_file, the two callers
don't use it.

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