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

109982 Commits

Author SHA1 Message Date
Ralph Boehme
914dfe6ed4 vfs_nfs4acl_xattr: remove a layer of indirection
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-11-08 00:20:07 +01:00
Ralph Boehme
dd3660631b s3/posix_acls: add default ACL style "everyone"
This synthesizes an ACL with a single ACE with full permissions for
everyone. Not used for now, this comes later.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-11-08 00:20:07 +01:00
Ralph Boehme
33c0b0df01 s3/smbd: make make_default_filesystem_acl public
This will be used by another VFS module in a subsequent commit.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-11-08 00:20:07 +01:00
Ralph Boehme
c373102f35 vfs_acl_common: directly pass default_acl_style
This is in preperation of moving make_default_filesystem_acl() and
making it globally accessible. No change in behaviour.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-11-08 00:20:07 +01:00
Ralph Boehme
f3f119e456 selftest: split out failing owner related subtest from samba3.raw.acls.create_file|dir
All the other subtests in samba3.raw.acls.create_file|dir pass with
nfs4acl_xattr, it's just the subtest that tries to set the owner which
fails with everything else then acl_xattr.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-11-08 00:20:07 +01:00
Martin Schwenke
5c354e10ac ctdb-tests: Add sock_daemon test for stale socket handling
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 Nov  7 07:51:02 CET 2017 on sn-devel-144
2017-11-07 07:51:02 +01:00
Amitay Isaacs
ad8d72091e ctdb-common: Fix stale socket removal
Sockets need to be created from sock_daemon_run_send().  This means
that stale socket removal can depend on the PID file context being
initialised.

Also fix associated test.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2017-11-07 03:53:27 +01:00
Martin Schwenke
4b652c1527 ctdb-scripts: Don't bother checking PID file when starting ctdbd
This is an optimisation that can cause incorrect results.  If ctdbd
was killed and there is a stale PID file then this will often cause
"CTDB exited during initialisation".  The wrapper reads the old PID
from the PID file, finds the PID gone, complains and exits.

It is better to drop this code and finally get this right.  If ctdbd
does exit early then it will take CTDB_STARTUP_TIMEOUT (default 10)
seconds before the wrapper fails.  That's not too bad...

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2017-11-07 03:53:27 +01:00
Martin Schwenke
f025f5c0a7 ctdb-tests: Have fake daemon log when it parses public IPs
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2017-11-07 03:53:27 +01:00
Martin Schwenke
28d6356a65 ctdb-common: Ensure unused bytes in union are initialised
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2017-11-07 03:53:27 +01:00
Ralph Wuerthner
44c018bdcc s4: torture: Add smb2 FIND_and_set_DOC test case.
Regression tests doing an SMB2_find followed by
a set delete on close and then close on a directory.

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

Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Sun Nov  5 12:31:12 CET 2017 on sn-devel-144
2017-11-05 12:31:12 +01:00
Ralph Wuerthner
c9e996d78d s3: smbd: Fix delete-on-close after smb2_find
Both dptr_create() and can_delete_directory_fsp() are calling OpenDir_fsp()
to get a directory handle. This causes an issue when delete-on-close is
set after smb2_find because both directory handle instances share the same
underlying file descriptor. In addition the SMB_ASSERT() in destructor
smb_Dir_destructor() gets triggered.

To avoid this use OpenDir() instead of OpenDir_fsp().

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

Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2017-11-05 08:30:19 +01:00
Ralph Boehme
3bb854ce90 vfs_fruit: avoid dereferencing a freed object in an error case
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Nov  3 19:05:05 CET 2017 on sn-devel-144
2017-11-03 19:05:05 +01:00
Andrew Bartlett
dc3adc898e s4-smbtorture: Show that the KDC provides no protection from CVE-2017-11103
The server name in the AS-REQ is unprotected, sadly.

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

Signed-off-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): Thu Nov  2 07:16:50 CET 2017 on sn-devel-144
2017-11-02 07:16:50 +01:00
Andrew Bartlett
4d056974dd s4-smbtorture: Add test krb5.kdc to prove fix for CVE-2017-11103
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12894

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2017-11-02 03:17:38 +01:00
Ralph Boehme
11da1e5c05 vfs_zfsacl: fix compilation error
Bug: https://bugzilla.samba.org/show_bug.cgi?id=6133

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Nov  2 03:16:11 CET 2017 on sn-devel-144
2017-11-02 03:16:10 +01:00
Joe Guo
8be4236b32 gitlab-ci: add .gitlab-ci.yml
Add .gitlab-ci.yml file, and define build jobs in groups.

Once gitlab-runner set up, builds and tests can be triggered
automatically in parallel when push to gitlab.
Also, with gitlab-runner autoscale mode, build instances
will be created and removed on demand.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Oct 31 15:32:16 CET 2017 on sn-devel-144
2017-10-31 15:32:16 +01:00
Günther Deschner
910b0ce2a2 s4-torture: remove obsolete comment in libsmbclient torture suite.
Since smbc_setX calls now handle string allocation using malloc
themselves (since commit 2d41b1ab78) we
indeed no longer need to provide malloced strings (the extra malloc
already got removed earlier).

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Oct 30 21:09:14 CET 2017 on sn-devel-144
2017-10-30 21:09:14 +01:00
Andrew Bartlett
c3aa8809e1 repl_meta_data: Initialise parent_dn to NULL
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>

Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Mon Oct 30 04:16:42 CET 2017 on sn-devel-144
2017-10-30 04:16:42 +01:00
Andrew Bartlett
cdb42eae89 repl_meta_data: Explain that we do not truncate the DN at present
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2017-10-30 00:16:39 +01:00
Andrew Bartlett
68de8c66c7 repl_meta_data: Use replmd_make_prefix_child_dn() in replmd_conflict_dn()
Now both routines avoid the escape/unescape implicit in ldb_dn_add_child_fmt()

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2017-10-30 00:16:39 +01:00
Andrew Bartlett
5364f8d3d5 repl_meta_data: Split replmd_make_deleted_child_dn() into a helper function
This will allow it to be used in common with replmd_conflict_dn()

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2017-10-30 00:16:39 +01:00
Andrew Bartlett
5eff04e9b8 repl_meta_data: Move creation of deleted DN into helper: replmd_make_deleted_child_dn()
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2017-10-30 00:16:39 +01:00
Andrew Bartlett
b838c14b1b repl_meta_data: Avoid printf() and use binary direct RDN creation for deleted objects
This makes it clearer that we are just replacing the RDN and ensures we do not
somehow create multiple components inside ldb_dn_add_child_fmt().

We also avoid an escape/un-escape round-trip.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2017-10-30 00:16:39 +01:00
Günther Deschner
3e0cc6e96d s3-auth: remove leftover prototype from auth_domain.
Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Oct 30 00:15:07 CET 2017 on sn-devel-144
2017-10-30 00:15:06 +01:00
Volker Lendecke
e5251ee188 winbindd: Remove a misleading comment
The reality is a bit more complex than this comment indicates. We should never
suggest anywhere that we can connect to domains that we don't have a direct
trust account to. For the member case, it's "our" domain, and for the DC case,
it's the direct trusts. Everything else is pure luck.

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): Sat Oct 28 00:31:58 CEST 2017 on sn-devel-144
2017-10-28 00:31:58 +02:00
Volker Lendecke
61176a66cc printing: Avoid an "extern current_user"
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-10-27 20:33:25 +02:00
Volker Lendecke
e03e947e0c printing: Avoid an "extern current_user"
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-10-27 20:33:25 +02:00
Volker Lendecke
e62253a52a smbd: Fix the memory hierarchy in the unix token
"groups" should hang off the token itself, not its parent

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-10-27 20:33:25 +02:00
Volker Lendecke
7e4908d72b lib: Use all_zero where appropriate
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-10-27 20:33:25 +02:00
Volker Lendecke
dea1881fc5 smbd: Remove an indentation level in smb2_negprot
Do an early return. Best viewed with "git show -b"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-10-27 20:33:25 +02:00
Volker Lendecke
6475293bc8 samba: Fix CID 1420179 Code maintainability issues UNUSED_VALUE
I don't think pid is used at all here.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-10-27 20:33:25 +02:00
Volker Lendecke
e7a4c31047 samba: Fix CID 1420180 Null pointer dereferences
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-10-27 20:33:25 +02:00
Andreas Schneider
e56626e864 s4:pyparam: Fix resource leaks on error
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13101

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-10-27 20:33:25 +02:00
Andreas Schneider
b012f1589b s4:torture: Avoid useless strdup in libsmbclient test
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13101

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-10-27 20:33:25 +02:00
Andreas Schneider
9f3151a4e2 libsmbclient: Use const for the user
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13101

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-10-27 20:33:24 +02:00
Andreas Schneider
0a796f5677 testprogs: Update the kpasswd setpassword test
This has been fixed with b81ca4f9dc

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Oct 27 15:22:43 CEST 2017 on sn-devel-144
2017-10-27 15:22:43 +02:00
Andreas Schneider
ab44be7a27 s4:kdc: Pass down the task to get access to model_ops for kpasswd server
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-10-27 11:29:12 +02:00
Andreas Schneider
327190893f s3:modules: Check correct variable for NULL in posixacl_xattr
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13101

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 Oct 27 04:54:22 CEST 2017 on sn-devel-144
2017-10-27 04:54:22 +02:00
Andreas Schneider
5274beba4c s3:passdb: Make sure the salt is fully initialized before passing
Otherwise the magic member is not initialized.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-10-27 01:00:26 +02:00
Andreas Schneider
d6a418c13f s3:secrets: Do not leak memory of pw and old_pw
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13101

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-10-27 01:00:25 +02:00
Andreas Schneider
4f458437af s3:vfs_glusterfs: Use SAFE_FREE
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Oct 26 17:31:40 CEST 2017 on sn-devel-144
2017-10-26 17:31:40 +02:00
Martin Schwenke
0e8b781e07 ctdb-tests: Process-exists unit tests should wait until PID is registered
Otherwise the client registration can race with the check in the test.

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

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): Thu Oct 26 13:32:24 CEST 2017 on sn-devel-144
2017-10-26 13:32:24 +02:00
Martin Schwenke
6fad42103c ctdb-tests: Wait for fake_ctdbd to start, fail if it doesn't
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13097

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2017-10-26 09:35:25 +02:00
Martin Schwenke
274fef9b84 ctdb-tests: Skip starting fake_ctdbd when current node is disconnected
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13097

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2017-10-26 09:35:25 +02:00
Martin Schwenke
dcbaebc232 ctdb-tests: Wait for ctdb_eventd to start, fail if it doesn't
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13097

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2017-10-26 09:35:25 +02:00
Martin Schwenke
d69899238b ctdb-tests: Allow wait_until() to be used in unit tests
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13097

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2017-10-26 09:35:25 +02:00
Andreas Schneider
16389bed07 s3:vfs_glusterfs: Fix a double free in vfs_gluster_getwd()
Found by cppcheck.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Oct 26 09:34:40 CEST 2017 on sn-devel-144
2017-10-26 09:34:40 +02:00
Douglas Bagnall
30584a278a linked attribute tests: correct add_all_at_once test
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Oct 26 05:36:11 CEST 2017 on sn-devel-144
2017-10-26 05:36:11 +02:00
Douglas Bagnall
1e62bbaeac linked_attribute tests: helper assert function for expected LdbError
The logic involved in asserting that a function raises an LdbError with
a particular error value has shown itself to be too complicated for me
to repeat too often.

To test this function, you would want a put a test in a bit like this:

    def test_assertRaisesLdbError(self):
        for i in [1, 2, ldb.ERR_ENTRY_ALREADY_EXISTS, 999]:
            def f(*args, **kwargs):
                raise ldb.LdbError(i, 'msg %s' % i)
            self.assertRaisesLdbError(i, 'a message', f, 'la la', la='la')

            def f2(*args, **kwargs):
                raise ldb.LdbError(i + 1, 'msg %s' % i)
            def f3(*args, **kwargs):
                pass
            for f in (f2, f3):
                try:
                    self.assertRaisesLdbError(i, 'a message', f, 'la la', la='la')
                except AssertionError as e:
                    print i, e, f
                    pass
                else:
                    print i, f
                    self.fail('assertRaisesLdbError() failed to fail!')

..but a self-testing test-tester is getting a too meta to run in every
autobuild.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2017-10-26 01:32:14 +02:00