metze/samba/wip.git
5 years agoauth: Add a new cli_credentials_ccache_init()
Andreas Schneider [Sat, 1 Oct 2016 08:57:23 +0000 (10:57 +0200)]
auth: Add a new cli_credentials_ccache_init()

Signed-off-by: Andreas Schneider <asn@samba.org>
5 years agos4-libsmb: Do not set empty password for gensec
Andreas Schneider [Mon, 19 Sep 2016 12:38:54 +0000 (14:38 +0200)]
s4-libsmb: Do not set empty password for gensec

GENSEC expects NULL as no password. There are too many places which
set "" instead of NULL. We plan to pass down the cli_credentials
structure anyway so this workaround should be ok for now.

Signed-off-by: Andreas Schneider <asn@samba.org>
5 years agoauth: Do not set an empty realm
Andreas Schneider [Mon, 19 Sep 2016 13:59:34 +0000 (15:59 +0200)]
auth: Do not set an empty realm

Just remove the @ sign and use it as a username.

Signed-off-by: Andreas Schneider <asn@samba.org>
5 years agoauth: Do not set emtpy passwords for credentials
Andreas Schneider [Mon, 19 Sep 2016 13:56:01 +0000 (15:56 +0200)]
auth: Do not set emtpy passwords for credentials

Signed-off-by: Andreas Schneider <asn@samba.org>
5 years agoSKIP TESTS - DONT PUSH
Andreas Schneider [Mon, 19 Sep 2016 10:42:27 +0000 (12:42 +0200)]
SKIP TESTS - DONT PUSH

5 years agosq gensec_gssapi_map_krb5_error master3-libsmb-tmp
Stefan Metzmacher [Wed, 22 Feb 2017 18:54:57 +0000 (19:54 +0100)]
sq gensec_gssapi_map_krb5_error

5 years agokrb5 fallback
Stefan Metzmacher [Wed, 22 Feb 2017 05:30:23 +0000 (06:30 +0100)]
krb5 fallback

5 years agos4 make use of gensec_gssapi_try_kerberos()
Stefan Metzmacher [Thu, 9 Feb 2017 13:51:24 +0000 (14:51 +0100)]
s4 make use of gensec_gssapi_try_kerberos()

5 years agoTODO s4:auth/gensec: make use of gensec_gssapi... GENSEC_GSSAPI_HELPER
Stefan Metzmacher [Thu, 29 Dec 2016 23:58:35 +0000 (00:58 +0100)]
TODO s4:auth/gensec: make use of gensec_gssapi... GENSEC_GSSAPI_HELPER

5 years agouse gensec_gssapi_try_kerberos in source3/librpc/crypto/gse.c
Stefan Metzmacher [Thu, 29 Dec 2016 16:51:17 +0000 (17:51 +0100)]
use gensec_gssapi_try_kerberos in source3/librpc/crypto/gse.c

5 years agoauth/kerberos: add gensec_gssapi_try_kerberos()
Stefan Metzmacher [Thu, 29 Dec 2016 16:04:17 +0000 (17:04 +0100)]
auth/kerberos: add gensec_gssapi_try_kerberos()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agoTODO improve pdb_samba_dsdb_get_trusteddom_creds
Stefan Metzmacher [Fri, 17 Feb 2017 16:52:08 +0000 (17:52 +0100)]
TODO improve pdb_samba_dsdb_get_trusteddom_creds

5 years agos3:libads: let get_kdc_ip_string() also return kpasswd_server entries for each kdc
Stefan Metzmacher [Thu, 9 Feb 2017 06:57:51 +0000 (07:57 +0100)]
s3:libads: let get_kdc_ip_string() also return kpasswd_server entries for each kdc

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agos3:libads: improve the logic in get_kdc_ip_string()
Stefan Metzmacher [Thu, 9 Feb 2017 06:09:38 +0000 (07:09 +0100)]
s3:libads: improve the logic in get_kdc_ip_string()

This fixes possible memory leaks on 'mem_ctx' and
always adds :88 (also for ipv4 addresses).

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agoREQUIRE NEW ldb version auth/credentials: use LDB_FLG_DONT_CREATE_DB and avoid creati...
Stefan Metzmacher [Fri, 24 Feb 2017 14:37:16 +0000 (15:37 +0100)]
REQUIRE NEW ldb version auth/credentials: use LDB_FLG_DONT_CREATE_DB and avoid creating secrets.ldb on domain members

Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agos4:param: pass flags via secrets_db_connect() to ldb_wrap_connect()
Stefan Metzmacher [Fri, 24 Feb 2017 14:36:24 +0000 (15:36 +0100)]
s4:param: pass flags via secrets_db_connect() to ldb_wrap_connect()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agosq Test python binding for package_PackagesBlob
Stefan Metzmacher [Wed, 10 May 2017 07:55:34 +0000 (09:55 +0200)]
sq Test python binding for package_PackagesBlob

5 years agoselftest: only use the ntvfs server for ad_dc_ntvfs, rpc_proxy, promoted_dc and s4member*
Stefan Metzmacher [Wed, 10 May 2017 06:49:05 +0000 (08:49 +0200)]
selftest: only use the ntvfs server for ad_dc_ntvfs, rpc_proxy, promoted_dc and s4member*

5 years agoRevert "s3:smbd: unimplement FSCTL_VALIDATE_NEGOTIATE_INFO with "server max protocol...
Stefan Metzmacher [Wed, 10 May 2017 06:40:03 +0000 (08:40 +0200)]
Revert "s3:smbd: unimplement FSCTL_VALIDATE_NEGOTIATE_INFO with "server max protocol = SMB2_02""

This reverts commit def878b3aa74c81303fe4ba3fe69e20ee579dd55.

5 years agoworks
Stefan Metzmacher [Wed, 10 May 2017 06:39:53 +0000 (08:39 +0200)]
works

5 years agos3:smbd: unimplement FSCTL_VALIDATE_NEGOTIATE_INFO with "server max protocol = SMB2_02"
Stefan Metzmacher [Fri, 5 May 2017 16:49:37 +0000 (18:49 +0200)]
s3:smbd: unimplement FSCTL_VALIDATE_NEGOTIATE_INFO with "server max protocol = SMB2_02"

A client that supports SMB3 will do a signed FSCTL_VALIDATE_NEGOTIATE_INFO
after a tree connect. This FSCTL_VALIDATE_NEGOTIATE_INFO call contains
the client capabilities, client guid, security mode and the array of supported
dialects. But if SMB 2.02 is negotiated the doesn't send these values to the
server in the first connection attempt (when the client starts with a SMB1 Negotiate).

Windows servers that only support SMB2 just return NT_STATUS_FILE_CLOSED
as answer to FSCTL_VALIDATE_NEGOTIATE_INFO.

We should do the same if we just pretend to support SMB 2.02,
as SMB 2.10 always include an SMB2 Negotiate request we can leave it as is.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agorun samba3.blackbox.smbclient_auth.plain with -mSMB...
Stefan Metzmacher [Wed, 10 May 2017 06:05:02 +0000 (08:05 +0200)]
run samba3.blackbox.smbclient_auth.plain with -mSMB...

5 years agoselftest: run nt4_member with server max protocol = SMB3_02
Stefan Metzmacher [Wed, 10 May 2017 05:53:07 +0000 (07:53 +0200)]
selftest: run nt4_member with server max protocol = SMB3_02

This makes sure we don't regress with it.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agoRevert "s3:smbd: unimplement FSCTL_VALIDATE_NEGOTIATE_INFO with "server max protocol...
Stefan Metzmacher [Wed, 10 May 2017 05:37:37 +0000 (07:37 +0200)]
Revert "s3:smbd: unimplement FSCTL_VALIDATE_NEGOTIATE_INFO with "server max protocol = SMB2_02""

This reverts commit efa5e47869ee88e5984e6763a40efa1eb2e64c9e.

5 years agoTest python binding for package_PackagesBlob
Arvid Requate [Wed, 3 May 2017 08:59:41 +0000 (10:59 +0200)]
Test python binding for package_PackagesBlob

Signed-off-by: Arvid Requate <requate@univention.de>
5 years agoREVIEW: pidl/Python: make use of pyrpc_string_array_{from,to}_PyList()
Stefan Metzmacher [Fri, 10 Mar 2017 16:41:46 +0000 (17:41 +0100)]
REVIEW: pidl/Python: make use of pyrpc_string_array_{from,to}_PyList()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
TODO: Reviewed-by: Arvid Requate <requate@univention.de>

5 years agopidl/Python: make use of pyrpc_PyStr_AsString() in ConvertStringFromPythonData()
Stefan Metzmacher [Tue, 9 May 2017 06:42:21 +0000 (08:42 +0200)]
pidl/Python: make use of pyrpc_PyStr_AsString() in ConvertStringFromPythonData()

This reduces the amount of generated code a lot.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agopidl/Python: generate a ndr_PyLong_AsCheckedLongLong() helper function
Stefan Metzmacher [Tue, 9 May 2017 07:59:39 +0000 (09:59 +0200)]
pidl/Python: generate a ndr_PyLong_AsCheckedLongLong() helper function

This reduces the size of the generated C code a lot.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agopidl/Python: generate a ndr_PyLong_AsCheckedUnsignedLongLong() helper function
Stefan Metzmacher [Tue, 9 May 2017 07:59:39 +0000 (09:59 +0200)]
pidl/Python: generate a ndr_PyLong_AsCheckedUnsignedLongLong() helper function

This reduces the size of the generated C code a lot.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agopidl/Python: improve generation of error checking in FromPythonToUnionFunction()
Stefan Metzmacher [Tue, 9 May 2017 14:05:12 +0000 (16:05 +0200)]
pidl/Python: improve generation of error checking in FromPythonToUnionFunction()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agopidl/Python: fix talloc hierachy in FromPythonToUnionFunction()
Stefan Metzmacher [Tue, 9 May 2017 14:04:18 +0000 (16:04 +0200)]
pidl/Python: fix talloc hierachy in FromPythonToUnionFunction()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agopidl/Python: avoid generation of dead code in FromUnionToPythonFunction()
Stefan Metzmacher [Tue, 9 May 2017 14:01:39 +0000 (16:01 +0200)]
pidl/Python: avoid generation of dead code in FromUnionToPythonFunction()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agopidl/Python: improve error handling in PythonFunctionUnpackOut() results
Stefan Metzmacher [Tue, 9 May 2017 13:02:02 +0000 (15:02 +0200)]
pidl/Python: improve error handling in PythonFunctionUnpackOut() results

Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agopidl/Python: improve error paths for Exceptions during the PyList construction
Stefan Metzmacher [Tue, 9 May 2017 07:17:20 +0000 (09:17 +0200)]
pidl/Python: improve error paths for Exceptions during the PyList construction

Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agopidl/Python: stop processing if fail to create a PyObject from a C type
Stefan Metzmacher [Tue, 9 May 2017 06:57:28 +0000 (08:57 +0200)]
pidl/Python: stop processing if fail to create a PyObject from a C type

If the conversion from a C variable into a PyObject fails
(typically is raises an Exception), we need to stop processing
and propagate the error.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agoRevert "Test python binding for package_PackagesBlob"
Stefan Metzmacher [Mon, 26 Jun 2017 12:54:12 +0000 (14:54 +0200)]
Revert "Test python binding for package_PackagesBlob"

This reverts commit cfc69410bbf4598fd18e1e1bce262e8a247df926.

5 years agoTest python binding for package_PackagesBlob
Arvid Requate [Wed, 3 May 2017 08:59:41 +0000 (10:59 +0200)]
Test python binding for package_PackagesBlob

Signed-off-by: Arvid Requate <requate@univention.de>
5 years agoSIGN-OFF s4:pyrpc: add pyrpc_string_array_{from,to}_PyList()
Arvid Requate [Fri, 10 Mar 2017 16:41:46 +0000 (17:41 +0100)]
SIGN-OFF s4:pyrpc: add pyrpc_string_array_{from,to}_PyList()

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

TODO: Signed-off-by: Arvid Requate <requate@univention.de>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agos4:pyrpc: add pyrpc_PyStr_AsString() helper function
Stefan Metzmacher [Tue, 9 May 2017 06:31:13 +0000 (08:31 +0200)]
s4:pyrpc: add pyrpc_PyStr_AsString() helper function

This contains the logic that's currently used in the pidl generated
python bindings. Moving this to a helper function will remove a lot
of generated code.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agotalloc: improve pytalloc error code paths if talloc* fails
Stefan Metzmacher [Tue, 9 May 2017 06:55:55 +0000 (08:55 +0200)]
talloc: improve pytalloc error code paths if talloc* fails

Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agoRevert "TODO pyrpc_string_array_{from,to}_PyList()"
Stefan Metzmacher [Fri, 10 Mar 2017 16:46:17 +0000 (17:46 +0100)]
Revert "TODO pyrpc_string_array_{from,to}_PyList()"

This reverts commit 27ec6e04894422e9988674985f8055bb9c7a6764.

5 years agoTODO pyrpc_string_array_{from,to}_PyList()
Stefan Metzmacher [Fri, 10 Mar 2017 16:41:46 +0000 (17:41 +0100)]
TODO pyrpc_string_array_{from,to}_PyList()

5 years agocli_state_update_after_negprot source3/libsmb/cliconnect.c server_os...
Stefan Metzmacher [Wed, 15 Mar 2017 17:04:44 +0000 (17:04 +0000)]
cli_state_update_after_negprot source3/libsmb/cliconnect.c server_os...

5 years agooverwrite... in cli_state_update_after_sesssetup
Stefan Metzmacher [Mon, 8 May 2017 13:27:21 +0000 (15:27 +0200)]
overwrite... in cli_state_update_after_sesssetup

5 years agoRevert "TODO NOT NEEDED cli_connect_sock_send/recv return sock_storage"
Stefan Metzmacher [Wed, 21 Jun 2017 14:02:50 +0000 (16:02 +0200)]
Revert "TODO NOT NEEDED cli_connect_sock_send/recv return sock_storage"

This reverts commit 6c0bd63a73bf8140fb92ea6896008109a0598097.

5 years agoTODO NOT NEEDED cli_connect_sock_send/recv return sock_storage
Stefan Metzmacher [Wed, 21 Jun 2017 14:02:20 +0000 (16:02 +0200)]
TODO NOT NEEDED cli_connect_sock_send/recv return sock_storage

5 years agoRevert "s3:selftest: also run test_smbclient_s3.sh with PROTO=SMB3"
Stefan Metzmacher [Tue, 20 Jun 2017 09:38:09 +0000 (11:38 +0200)]
Revert "s3:selftest: also run test_smbclient_s3.sh with PROTO=SMB3"

This reverts commit b689e911a42481aa5a66827bbf0b80b93d60c5f8.

5 years agos3:libsmb: change the connect banner to "Server=[%s] Protocol=[%s]"
Stefan Metzmacher [Mon, 19 Jun 2017 19:54:33 +0000 (21:54 +0200)]
s3:libsmb: change the connect banner to "Server=[%s] Protocol=[%s]"

5 years agos3:libsmb: pass an optional const struct sockaddr_storage *dest_ss to cli_cm_open()
Stefan Metzmacher [Wed, 21 Jun 2017 14:03:32 +0000 (16:03 +0200)]
s3:libsmb: pass an optional const struct sockaddr_storage *dest_ss to cli_cm_open()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agos3:libsmb: pass 'dest_ss' from cli_cm_connect() via do_connect() to cli_connect_nb()
Stefan Metzmacher [Wed, 21 Jun 2017 09:50:40 +0000 (11:50 +0200)]
s3:libsmb: pass 'dest_ss' from cli_cm_connect() via do_connect() to cli_connect_nb()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agoTODO use cli_state_dup
Stefan Metzmacher [Wed, 21 Jun 2017 13:41:33 +0000 (15:41 +0200)]
TODO use cli_state_dup

5 years agoTODO: s3:libsmb: add cli_state_dup()
Stefan Metzmacher [Wed, 21 Jun 2017 14:00:30 +0000 (16:00 +0200)]
TODO: s3:libsmb: add cli_state_dup()

This can be used to create a 2nd cli_state for
a different tcon on the same connection/session.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agoRevert "run_oplock_cancel"
Stefan Metzmacher [Wed, 21 Jun 2017 16:24:20 +0000 (18:24 +0200)]
Revert "run_oplock_cancel"

This reverts commit fbd15d778d26c3061140537b64a4e6dc5baf5dad.

5 years agorun_oplock_cancel
Stefan Metzmacher [Wed, 21 Jun 2017 16:12:10 +0000 (18:12 +0200)]
run_oplock_cancel

5 years agoRevert "WORKS BUT NOT NEEDED s3:smbd: allow cancelling deferred SMB1 opens"
Stefan Metzmacher [Wed, 21 Jun 2017 16:24:02 +0000 (18:24 +0200)]
Revert "WORKS BUT NOT NEEDED s3:smbd: allow cancelling deferred SMB1 opens"

This reverts commit bf5b33b83f7d0ca13d07d8c53651b8664df137ac.

5 years agoWORKS BUT NOT NEEDED s3:smbd: allow cancelling deferred SMB1 opens
Stefan Metzmacher [Wed, 21 Jun 2017 16:03:07 +0000 (18:03 +0200)]
WORKS BUT NOT NEEDED s3:smbd: allow cancelling deferred SMB1 opens

The Windows 2012R2 behaviour seems to be a NTCREATE response
with STATUS_CANCELLED, but the underlying open is not really
cancelled and a following open get SHARING_VIOLATION.

5 years agoRevert "s3:libsmb: remove unused show_sessetup handling from do_connect()"
Stefan Metzmacher [Fri, 23 Jun 2017 15:13:59 +0000 (17:13 +0200)]
Revert "s3:libsmb: remove unused show_sessetup handling from do_connect()"

This reverts commit b6f66cf85fafa08aed5692d76940908854310e93.

5 years agoRevert "more enctypes..."
Stefan Metzmacher [Thu, 17 Aug 2017 15:46:30 +0000 (17:46 +0200)]
Revert "more enctypes..."

This reverts commit f5cfd4aa8b4dfb442f1abfc61ef66cdb0b8cd09a.

5 years agomore enctypes...
Stefan Metzmacher [Thu, 17 Aug 2017 15:46:11 +0000 (17:46 +0200)]
more enctypes...

5 years agoRevert "HACK... https://bugzilla.samba.org/show_bug.cgi?id=12892"
Stefan Metzmacher [Mon, 18 Feb 2019 11:47:30 +0000 (12:47 +0100)]
Revert "HACK... https://bugzilla.samba.org/show_bug.cgi?id=12892"

This reverts commit 4da2a7a9f9261ab18207699a102069040b652c24.

5 years agoHACK... https://bugzilla.samba.org/show_bug.cgi?id=12892
Stefan Metzmacher [Tue, 11 Jul 2017 16:05:14 +0000 (18:05 +0200)]
HACK... https://bugzilla.samba.org/show_bug.cgi?id=12892

5 years agos3:libsmb: add support for SMB2/3 in cli_chkpath()
Stefan Metzmacher [Wed, 16 Aug 2017 05:18:02 +0000 (07:18 +0200)]
s3:libsmb: add support for SMB2/3 in cli_chkpath()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agodebug REVISION_MISMATCH master3-libsmb-ok
Stefan Metzmacher [Mon, 19 Jun 2017 06:08:50 +0000 (08:08 +0200)]
debug REVISION_MISMATCH

5 years agomore [flag(NDR_SECRET)]...
Stefan Metzmacher [Wed, 28 Jun 2017 07:09:14 +0000 (09:09 +0200)]
more [flag(NDR_SECRET)]...

5 years ago.gitlab-ci.yml: merge .gitlab-ci-private.yml
Joe Guo [Fri, 15 Feb 2019 09:25:07 +0000 (22:25 +1300)]
.gitlab-ci.yml: merge .gitlab-ci-private.yml

`.gitlab-ci.yml` support conditional jobs with `only` and `except`.
And variables can be read from repo CI/CD settings as condition:

    build_samba:
      script: ...
      only:
        variables:
          - $SUPPORT_PRIVATE_TEST == 'yes'

Instead of having 2 copies of yml file, we can use this feature to
trigger private jobs only when a var like `SUPPORT_PRIVATE_TEST` is defined.

I've already added above var to our repos.
Once merged, we can remove custom CI config file in
gitlab repo settings, and remove .gitlab-ci-private.yml file from code.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Feb 18 10:54:19 CET 2019 on sn-devel-144

5 years agowafsamba/symbols: change regex to match both rpath and runpath for different readelf...
Joe Guo [Thu, 14 Feb 2019 22:46:22 +0000 (11:46 +1300)]
wafsamba/symbols: change regex to match both rpath and runpath for different readelf output

In `wafsamba.dumplicate_symbols` test, it will use Popen to call:

    readelf --dynamic bin/default/source3/lib/netapi/examples/netlogon/netlogon_control2

then try to find rpath lib lines from output with regex:

    re_rpath     = re.compile(b'Library rpath: \[(.*)\]')

In ubuntu 14.04 docker image, which current CI is using, the actual output
from `readelf` is `runpath` instead of 'rpath':

    ...
    Library runpath: [/home/gitlab-runner/samba/bin/shared:/home/gitlab-runner/samba/bin/shared/private]\n'
    ...

So the regex never matched, and hide a bug.

In Ubuntu 1604 docker image, the output changes to `rpath` and matched the
regex, which expose the error in previous commit.

Improve the regex to match both `rpath` and `runpath`.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agowafsamba/symbols: always split Popen output by bytes
Joe Guo [Thu, 14 Feb 2019 22:23:17 +0000 (11:23 +1300)]
wafsamba/symbols: always split Popen output by bytes

In py3, `wafsamba.duplicate_symbols` test may fail:

    ...
    elfpipe = subprocess.Popen(['readelf', '--dynamic', binname], stdout=subprocess.PIPE).stdout
    ...

    File "./buildtools/wafsamba/symbols.py", line 153, in get_libs
        rpath.extend(m.group(1).split(":"))
    TypeError: a bytes-like object is required, not 'str'

Because Popen will always return bytestr even in py3, and ":" is a
unicode str in py3.  Change ":" to b":" to fix.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoselftest: Initialize DC_SERVER/etc variables in one place
Tim Beale [Sun, 17 Feb 2019 20:28:37 +0000 (09:28 +1300)]
selftest: Initialize DC_SERVER/etc variables in one place

It's simpler to do setup DC_SERVER/etc in the same place we set
SERVER/etc. (Rather than initializing them for every single testenv,
like we were doing).

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Feb 18 07:24:05 CET 2019 on sn-devel-144

5 years agoselftest: Add helper function to avoid repeated {DC_SERVER}=x
Tim Beale [Wed, 13 Feb 2019 02:52:00 +0000 (15:52 +1300)]
selftest: Add helper function to avoid repeated {DC_SERVER}=x

For every 2-DC testenv we setup, we copy the $DC_SERVER value of the
dependent testenv (i.e. the PDC) into the env variables for the new
testenv. This means DC_SERVER always points to the PDC (or first DC).

This adds a helper function to avoid repeating this code for every 2-DC
environment we setup.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoselftest: Remove need for $RODC_DC_SERVER env variable
Tim Beale [Wed, 13 Feb 2019 02:37:24 +0000 (15:37 +1300)]
selftest: Remove need for $RODC_DC_SERVER env variable

Same deal as earlier patch - we can use the $SERVER env variable instead
and avoid the need for this extra variable.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoselftest: Remove unused environment variables
Tim Beale [Wed, 13 Feb 2019 01:50:12 +0000 (14:50 +1300)]
selftest: Remove unused environment variables

We only really want generic environment variables. For 2+ DC
environments, we have the $SERVER and $DC_SERVER (aka PDC) variables.
However, lots of testenvs also export really specific environment
variables, e.g. VAMPIRE_2000_DC_SERVER_IP (despite that testenv being
only used for a single test case).

Previously the <testenv>_SERVER variable was used for DRS tests, but we
can avoid the need to do this now. The other variables are not used at
all.

The RODC and TRUST environment variables are still used by a few tests.
SUBDOM_DC_SERVER is only used within Samba4.pm and not exported.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agotests: Tweak DRS tests to avoid unnecessary env variables
Tim Beale [Wed, 13 Feb 2019 02:23:29 +0000 (15:23 +1300)]
tests: Tweak DRS tests to avoid unnecessary env variables

Each DC used in a DRS test has its own '<testenv>_SERVER' environment
variable, e.g. VAMPIRE_DC_SERVER. These variables are only used by
test.py for DRS, but they're not actually needed.

The $SERVER environment variable holds the same information, so we can
just use this in test.py instead.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoselftest: Export DC conf path for special cases
Tim Beale [Mon, 11 Feb 2019 04:15:22 +0000 (17:15 +1300)]
selftest: Export DC conf path for special cases

In a few rare cases, a test needs to assert aspects both client-side and
server-side aspects. A typical example would be the audit logging, which
is exercising client-side behaviour, but also asserting the server-side
logging.

Usually this has involved a kludge in tests.py to either use
socket-wrapper explicitly, or hardcode in the server smb.conf path.

This patch exposes the existing SERVERCONFFILE env variable to the
tests. DC_SERVERCONFFILE has been added for 2 DC testenvs, where we need
the PDC's smb.conf.

The benefit of doing this way is the filepath/testenv-dependency logic
is all self-contained with the Perl code, and it doesn't bleed out into
tests.py as well.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoselftest: Add common function to return cmd environment variables
Tim Beale [Wed, 30 Jan 2019 03:31:40 +0000 (16:31 +1300)]
selftest: Add common function to return cmd environment variables

We prefix samba-tool commands with a bunch of WRAPPER/CONF environment
variables, in order for the command to work properly. These variables
are duplicated all over the place in the selftest code. This patch adds
a helper function to return the variables, so we can reduce the required
code down to a single line in a lot of places.

A couple of exceptions I've left alone:
- drs replicate, which omits the RESOLV_WRAPPER_CONF/_HOSTS variables
  (I'm not sure whether that's deliberate or not).
- create_backup(), which uses the backupfromdc's krb5.conf rather than
  the new testenv.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agothird_party/nss_wrapper/wscript: check for libnsl and libsocket
Björn Jacke [Sat, 16 Feb 2019 00:23:29 +0000 (01:23 +0100)]
third_party/nss_wrapper/wscript: check for libnsl and libsocket

this is needed as there are HAVE_LIBNSL and HAVE_LIBSOCKET in the code and
Samba fails to build in a terrible obscure way on Solaris if this is not
working inside nss_wrapper here.

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Björn Jacke <bjacke@samba.org>
Autobuild-Date(master): Sun Feb 17 15:05:20 CET 2019 on sn-devel-144

5 years agowaf: add library dependency for sendfile on Solaris
Björn Jacke [Sun, 10 Feb 2019 21:38:49 +0000 (22:38 +0100)]
waf: add library dependency for sendfile on Solaris

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agothird_party/nss_wrapper/wscript: fix check for gethostbyname
Björn Jacke [Sun, 10 Feb 2019 01:02:06 +0000 (02:02 +0100)]
third_party/nss_wrapper/wscript: fix check for gethostbyname

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agowaf: fix setting of RPATH_ST variable
Björn Jacke [Sun, 10 Feb 2019 02:41:50 +0000 (03:41 +0100)]
waf: fix setting of RPATH_ST variable

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agowafsamba: we should also remove stale symlinks here
Björn Jacke [Mon, 11 Feb 2019 14:30:24 +0000 (15:30 +0100)]
wafsamba: we should also remove stale symlinks here

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agowaf: print the library name in which we search for a function
Björn Jacke [Mon, 11 Feb 2019 09:03:00 +0000 (10:03 +0100)]
waf: print the library name in which we search for a function

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agowaf: use the correct WERROR_CFLAGS in CHECK_CODE
Björn Jacke [Sun, 10 Feb 2019 00:29:22 +0000 (01:29 +0100)]
waf: use the correct WERROR_CFLAGS in CHECK_CODE

all the non gcc version were incorrectly set here till now

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agowaf: remove redundant WERROR flag
Björn Jacke [Sat, 9 Feb 2019 23:47:59 +0000 (00:47 +0100)]
waf: remove redundant WERROR flag

CHECK_CFLAGS always uses WERROR flags

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agowaf: remove duplicate WERROR cflags
Björn Jacke [Sat, 9 Feb 2019 23:44:14 +0000 (00:44 +0100)]
waf: remove duplicate WERROR cflags

WERROR flags are already added by the strict=True switch.

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agowaf: fix compiler warnings in configure checks
Björn Jacke [Sat, 9 Feb 2019 23:07:57 +0000 (00:07 +0100)]
waf: fix compiler warnings in configure checks

the studio compiler issued here:

warning: statement not reached

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agowaf: fix WERROR_CFLAGS check
Björn Jacke [Sat, 9 Feb 2019 00:33:13 +0000 (01:33 +0100)]
waf: fix WERROR_CFLAGS check

if we found the right WERROR flags of the compiler then the compiler is right
to fail because we explicitly give it an empty file to compile. We
should not do that because that makes the almost successful test fail.
This fixed the studio compiler test.

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agowaf: fix some missing newline compiler warnings
Björn Jacke [Sat, 9 Feb 2019 00:30:50 +0000 (01:30 +0100)]
waf: fix some missing newline compiler warnings

without a trailing newline the studio compiler issues:

warning: newline not last character in file

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agosysquotas_4B: raise log level of a sometimes too noisy message
Björn Jacke [Tue, 12 Feb 2019 18:07:38 +0000 (19:07 +0100)]
sysquotas_4B: raise log level of a sometimes too noisy message

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
5 years agowaf/quotas: fail configure when quotas were requested but not found
Björn Jacke [Thu, 7 Feb 2019 03:39:04 +0000 (04:39 +0100)]
waf/quotas: fail configure when quotas were requested but not found

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
5 years agoquotas: remove legacy AIX quota code that is covered by sysquotas now
Bjoern Jacke [Thu, 31 Jan 2019 03:57:38 +0000 (21:57 -0600)]
quotas: remove legacy AIX quota code that is covered by sysquotas now

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
5 years agotests/sysquotas.c: include jfs/quota.h for 4B test on AIX
Bjoern Jacke [Thu, 31 Jan 2019 00:35:55 +0000 (18:35 -0600)]
tests/sysquotas.c: include jfs/quota.h for 4B test on AIX

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
5 years agoadd sysquotas_jfs2.c
Bjoern Jacke [Tue, 5 Feb 2019 22:52:33 +0000 (16:52 -0600)]
add sysquotas_jfs2.c

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
5 years agosysquotas_4B: enable for jfs/quota.h on AIX
Bjoern Jacke [Thu, 31 Jan 2019 00:33:55 +0000 (18:33 -0600)]
sysquotas_4B: enable for jfs/quota.h on AIX

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
5 years agosysquotas_4B: make quota block calculation adopt to platform quota block size
Bjoern Jacke [Tue, 5 Feb 2019 23:23:35 +0000 (17:23 -0600)]
sysquotas_4B: make quota block calculation adopt to platform quota block size

the correct QUOTABLOCK_SIZE for platform is taken from sysquotas.h

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
5 years agowaf: check for jfs/quota.h
Bjoern Jacke [Thu, 31 Jan 2019 00:27:12 +0000 (18:27 -0600)]
waf: check for jfs/quota.h

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
5 years agosysquotas.h: collect more platform quotablock sizes
Bjoern Jacke [Thu, 31 Jan 2019 18:01:36 +0000 (12:01 -0600)]
sysquotas.h: collect more platform quotablock sizes

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
5 years agotests/quota: tidy up includes of sysquotas 4B
Bjoern Jacke [Wed, 30 Jan 2019 23:55:06 +0000 (17:55 -0600)]
tests/quota: tidy up includes of sysquotas 4B

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
5 years agosysquotas_nfs: also honor reported inode/file limits
Björn Jacke [Sat, 9 Feb 2019 23:51:23 +0000 (00:51 +0100)]
sysquotas_nfs: also honor reported inode/file limits

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
5 years agosysquotas_xfs: fix inode limit setting, which is not depeding on blocksize
Björn Jacke [Thu, 7 Feb 2019 03:23:13 +0000 (04:23 +0100)]
sysquotas_xfs: fix inode limit setting, which is not depeding on blocksize

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
5 years agosysquotas_linux: fix inode limit setting, which is not depeding on blocksize
Björn Jacke [Thu, 7 Feb 2019 02:35:01 +0000 (03:35 +0100)]
sysquotas_linux: fix inode limit setting, which is not depeding on blocksize

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
5 years agontquotas: do not set inode limits when setting space quota
Björn Jacke [Thu, 14 Feb 2019 11:09:38 +0000 (12:09 +0100)]
ntquotas: do not set inode limits when setting space quota

we are supposed to set a space quota limit, we should not calculate an
additional artifical inode limit out of that.

Signed-off-by: Bjoern Jacke <bjacke@samba.org>