1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

183 Commits

Author SHA1 Message Date
Andreas Schneider
bb2e0622f0 testsuite: Reformat shell scripts
shfmt -f testsuite/ | xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
2022-08-10 13:17:31 +00:00
Volker Lendecke
a7c65958a1 s3:rpc_server: Activate samba-dcerpcd
This is the big switch to use samba-dcerpcd for the RPC services in
source3/. It is a pretty big and unordered patch, but I don't see a
good way to split this up into more manageable pieces without
sacrificing bisectability even more. Probably I could cut out a few
small ones, but a major architechtural switch like this will always be
messy.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2021-12-10 14:02:30 +00:00
Volker Lendecke
a0075a1fd0 unittest: Remove test_sambafs_srv_pipe
is_known_pipename() will be removed soon

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2021-12-10 14:02:30 +00:00
Alex Richardson
2c18a98253 Don't use sysconf(_SC_NGROUPS_MAX) on macOS for getgroups()
On MacOS sysconf(_SC_NGROUPS_MAX) always returns 16. However, this is not
the value used by getgroups(2). MacOS uses nested groups but getgroups(2)
will return the flattened list which can easily exceed 16 groups. In my
testing getgroups() already returns 16 groups on a freshly installed
system. And on a 10.14 system the root user is in more than 16 groups by
default which makes it impossible to run smbd without this change.
Setting _DARWIN_UNLIMITED_GETGROUPS allows getgroups() to return more than
16 groups. This also changes set_unix_security_ctx() to only set up to
16 groups since that is the limit for initgroups() according to the manpage.

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

Signed-off-by: Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Sep  9 17:43:19 UTC 2021 on sn-devel-184
2021-09-09 17:43:19 +00:00
Volker Lendecke
8b6c6fd17c auth3: Remove auth_skel.c
Authentication is a very complex topic, and someone who is able to
write a custom auth module turning a struct auth_usersupplied_info
into a struct auth_serversupplied_info should be able to live without
this skeleton module.

This module also gave an example to load a secondary authentication
module via a module parameter (the call to load_module()). We have
abandoned this practice, and since the "auth methods" parameter has
gone we don't use this anymore internally.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2021-04-19 18:18:31 +00:00
Volker Lendecke
6f4e6fc631 test: Add a test for background_job_send crash
I haven't figured out how to properly add a crashing test to
"knownfail", so this is added after the fix.

Signed-off-by: Volker Lendecke <vl@samba.org>
2021-04-01 19:32:36 +00:00
Volker Lendecke
9614273aa3 librpc: Make "dcesrv_context->callbacks" a pointer
This structure just grew from 3 to 6 pointers, avoid making a copy of
this. All callers of dcesrv_init_context() have this as a static
struct in the C object, so a pointer to that won't change.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2021-03-16 17:09:32 +00:00
Andreas Schneider
2d89ddb012 unittests: Mark test binaries for selftest
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14550

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2020-10-23 14:09:43 +00:00
Matthew DeVore
c2ac923c6a s3: safe_string: do not include string_wrappers.h
Rather than have safe_string.h #include string_wrappers.h, make users of
string_wrappers.h include it explicitly.

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

Signed-off-by: Matthew DeVore <matvore@google.com>
Reviewed-by: David Mulder <dmulder@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-08-28 00:56:34 +00:00
Samuel Cabrero
06a913a269 s3:rpc_server: Retrieve dcesrv_context from parent context to open NP
Get the dcesrv_context from parent context and use it to search the
endpoint serving the named pipe. Once we have the endpoint pass it to
the make_internal_rpc_pipe_socketpair function.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2020-03-20 15:36:35 +00:00
Andrew Bartlett
92ce387ed0 build: Remove workaround for missing os.path.relpath in Python < 2.6
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: David Mulder <dmulder@suse.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-11-13 08:42:30 +00:00
Ralph Boehme
9e706ee573 unittest: workaround dependency problem in test_lib_util_modules
waf somehow screws the dependencies and the module ends up with a bunch of
missing RPC related symbols once an RPC service has special dependencies like
the mdssvc RPC service.

  $ bin/test_lib_util_modules
  test: test_samba_module_probe
  success: test_samba_module_probe
  test: test_samba_module_probe_dummy
  Error loading module '/home/samba/src/bin/modules/rpc/test_dummy_module.so':
  /home/samba/src/bin/modules/rpc/test_dummy_module.so: undefined symbol:
  rpc_service_mode
  failure: test_samba_module_probe_dummy [
  NT_STATUS_IS_OK(status)
  ../../testsuite/unittests/test_lib_util_modules.c:39: error: Failure!
  ]
  test: test_samba_module_probe_slash
  success: test_samba_module_probe_slash

This is currently not noticed as mdssvc is not enabled in selftest, but that is
going to change with a subsequent commit.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-08-08 20:24:32 +00:00
Samuel Cabrero
dde08e8f26 s3:rpc_server: Return NTSTATUS in is_known_pipename function
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2019-07-22 16:49:16 +00:00
Tim Beale
a68e8af2d1 testsuite: Remove build_farm testsuites
This test code is not run (and has not been run for about a decade).
Let's remove it - it's there in the git history if we ever want to try
to repurpose it again.

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): Tue Mar 12 02:56:05 UTC 2019 on sn-devel-144
2019-03-12 02:56:05 +00:00
Alexander Bokovoy
ca5008a49d testsuite/headers/wscript_build: update to handle waf 2.0.4
Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:24 +02:00
Douglas Bagnall
cb5f1f3b26 unittests.lib_util_modules: test module probe with "skel", not "unix"
The unix module is not available as a module on some systems.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-02-22 01:04:18 +01:00
Gary Lockyer
d11473b15d source3: remove sock_exec
Remove the sock_exec code which is no longer needed and additionally has been
used by exploit code.

This was originally test support code, the tests relying on the sock_exec
code have been removed.

Past exploits have used sock_exec as a proxy for system() matching a talloc
destructor prototype.

See for example:
Exploit for Samba vulnerabilty (CVE-2015-0240) at
    https://gist.github.com/worawit/051e881fc94fe4a49295
    and the Red Hat post at
    https://access.redhat.com/blogs/766093/posts/1976553

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Nov 20 07:20:13 CET 2017 on sn-devel-144
2017-11-20 07:20:13 +01:00
Lumir Balhar
09104dc417 unittests: Fix missing include of signal.h
Signed-off-by: Lumir Balhar <lbalhar@redhat.com>
Reviewed-by: Andrew Bartlet <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Oct 18 14:24:39 CEST 2017 on sn-devel-144
2017-10-18 14:24:39 +02:00
Volker Lendecke
30ffc120e2 testsuite: Fix the 32-bit test build
samba_init_module returns 32-bit. For some reason on my
32-bit lxc "return 0" was converted to something but
NT_STATUS_OK, making initialization fail.

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): Thu Sep 21 02:49:32 CEST 2017 on sn-devel-144
2017-09-21 02:49:32 +02:00
Andreas Schneider
1de4390353 unittests: Do not install the test_dummy rpc module
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12879

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): Wed Jul  5 22:21:06 CEST 2017 on sn-devel-144
2017-07-05 22:21:06 +02:00
Andreas Schneider
5d18c5e5ec unittests: Add missing stdint.h include
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12878

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2017-07-05 17:54:10 +02:00
Andreas Schneider
61f827bcdd unittest: Add testsuite for smb_probe_module()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12780

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-06-06 18:36:07 +02:00
Andreas Schneider
90b69ba95d unittest: Add testsuite for is_known_pipename()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12780

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-06-06 18:36:06 +02:00
Andreas Schneider
94b7672d48 third_party: Add cmocka 1.1.1
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlet <abartlet@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Apr 10 11:38:13 CEST 2017 on sn-devel-144
2017-04-10 11:38:13 +02:00
Ian Stakenvicius
7142a88441 waf: disable-python - don't include python.h in test_headers.c
Signed-off-by: Ian Stakenvicius <axs@gentoo.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Mar 10 11:24:13 CET 2017 on sn-devel-144
2017-03-10 11:24:13 +01:00
Andreas Schneider
85d5b43392 waf: Do not install the unit test binary for krb5samba
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12552

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Feb 13 14:17:39 CET 2017 on sn-devel-144
2017-02-13 14:17:39 +01:00
Andreas Schneider
7585aa6c8f testsuite: Add cmocka unit test for smb_krb5_kt_open()
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): Fri Dec 16 05:43:12 CET 2016 on sn-devel-144
2016-12-16 05:43:10 +01:00
Jelmer Vernooij
3123e2c66a Simplify handling of dependencies on external libraries in test_headers.
Signed-off-by: Jelmer Vernooij <jelmer@jelmer.uk>
2016-01-13 04:43:22 +01:00
Stefan Metzmacher
54ea6ff788 testsuite/headers: remove unused checks for ntdb.h
ntdb is already removed.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Karolin Seeger <kseeger@samba.org>
2015-07-21 19:04:15 +02:00
Volker Lendecke
334015ebca autobuild: Remove ntdb target
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-03-17 11:30:51 +01:00
Volker Lendecke
89052936ae Remove ntdb from scripts
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-03-17 11:30:51 +01:00
Ira Cooper
38de110b02 third_party/popt: Initial support for popt.
ctdb, ldb, and samba are supported builds for third_party popt.

Signed-off-by: Ira Cooper <ira@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-08-09 18:26:17 +02:00
Andreas Schneider
69b3a0cb3f testsuit: Fix fprintf format.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-11-15 11:07:40 -08:00
Jeremy Allison
821bd95156 Replace all uses of setXX[ug]id() and setgroups with samba_setXX[ug]id() calls.
Will allow thread-specific credentials to be added by modifying
the central definitions. Deliberately left the setXX[ug]id()
call in popt as this is not used in Samba.
2012-06-28 17:15:16 -07:00
Rusty Russell
1fe797aada ntdb: put it back into the build.
This doesn't do anything with it yet, just wires it back into the build.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-19 05:38:07 +02:00
Andrew Bartlett
9712912dfc testsuite/libsmbclient: Remove unused and expensive-to-link testsuite
This testsuite never got off the ground, and unlike the other
libsmbclient tests, it is not integrated into make test, has no driver
script we could integrate.

As it has been in this state for 10 years, and adding it to the compile
did not find any link-time issues (particularly in comparison to the
link-time cost for so many individual binaries), I am now removing them.

The libsmbclient examples are seperate to this, and remain in
examples/libsmbclient.

Andrew Bartlett
2012-05-02 10:53:51 +10:00
Amitay Isaacs
cac9bfe475 testsuite: Replace deprecated bzero with memset
This fixes build issues on solaris reported in bug #8767.

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

Autobuild-User: Amitay Isaacs <amitay@samba.org>
Autobuild-Date: Wed Feb 29 10:39:10 CET 2012 on sn-devel-104
2012-02-29 10:39:09 +01:00
Andrew Bartlett
62a66b00b6 testsuite: Remove unused and unlikely to be revived DejaGNU tests 2011-12-12 12:57:08 +01:00
Günther Deschner
ef87630594 s3-libsmbclient: make some functions static in testsuite code.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Tue Oct 25 17:57:25 CEST 2011 on sn-devel-104
2011-10-25 17:57:25 +02:00
Andrew Bartlett
3ae478be0f build: compile (but do not install) all the libsmbclient tests
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Thu Oct 20 13:49:39 CEST 2011 on sn-devel-104
2011-10-20 13:49:39 +02:00
Rusty Russell
ca1936fbb2 tdb_compat: use tdb_open_compat.
This is a helper for the common case of opening a tdb with a logging
function, but it doesn't do all the work, since TDB1 and TDB2's log
functions are different types.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Volker Lendecke
ce9d63d161 s3: Remove the smbtorture3 OPLOCK3 test
This is the last user of cli_receive_smb. Oplocks are nowadays tested
in smbtorture4, this mainly has historic value
2011-05-22 21:07:40 +02:00
Andrew Tridgell
46384cf60a headers: cope with non-system popt in test_headers
Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Wed Mar 16 09:09:40 CET 2011 on sn-devel-104
2011-03-16 09:09:40 +01:00
Andrew Tridgell
3cfa8216b9 headers: include Python.h first to avoid warnings 2011-03-16 08:23:25 +01:00
Andrew Tridgell
72ca88d604 build: fixed cflags for test_header
when using system libraries, we need the right cflags
2011-03-15 12:22:20 +11:00
Andrew Tridgell
ba9ae79e0b build: added automated testing of our public headers
we generate test_headers.h, which includes all of our public headers,
and check it compiles
2011-03-15 12:22:19 +11:00
Andrew Bartlett
cba7f8b827 s3:dom_sid Global replace of DOM_SID with struct dom_sid
This matches the structure that new code is being written to,
and removes one more of the old-style named structures, and
the need to know that is is just an alias for struct dom_sid.

Andrew Bartlett

Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-21 10:39:59 +02:00
Lars Müller
8e26aa3d7c testsuite/libsmbclient use source3 in the path of the C and LFLAGS 2010-01-28 00:44:04 +01:00
Lars Müller
97c4c63990 Link testsuite/libsmbclient against required libtdb and libwbclient 2010-01-28 00:38:04 +01:00
Bo Yang
238bf25af4 s3: add a test to test libsmbclient
Signed-off-by: Bo Yang <boyang@samba.org>
2009-08-08 06:26:43 +08:00