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

109852 Commits

Author SHA1 Message Date
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
Douglas Bagnall
0f0acb00ea replmd: use check_parsed_dn_duplicates() more widely
replmd_add_fix_la() was already making the same check; here we move it
a bit earlier.

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
Douglas Bagnall
b6294c84a5 linked attribute tests: fix logic for add test
We were ensuring that when we got an LdbError it was the right type,
but we weren't ensuring we got one at all.

The new test doesn't fail.

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
Douglas Bagnall
7cf3bbcc5c linked attribute tests: ensure duplicate deletes fail
We can't remove the same thing twice in the same message.

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
Douglas Bagnall
625e65d9f3 replmd: check for duplicate values in MOD_REPLACE case
Because we already have a sorted parsed_dn list, this is a simple
linear scan.

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

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
Douglas Bagnall
046fc1f7de linked attribute tests: test against duplicates in replace
We should not be able to introduce duplicate links using MOD_REPLACE.
It turns out we could and weren't testing.

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

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
Andreas Schneider
2d260b28f5 s4:scripting: Fix ntstatus_gen.h generation on 32bit
The hex() function results in different output on 32bit systems. It adds
a L for long for some numbers. Thus we have a different header file.

This patch makes sure we have a consistent file generation on different
paltforms.

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

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

Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Wed Oct 25 22:28:39 CEST 2017 on sn-devel-144
2017-10-25 22:28:39 +02:00
Jeremy Allison
7abe56ccfa s3: smbclient: Test we can rename with a name containing.
Samba always allowed this anyway, but it's a good place
to ensure we don't regress.

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

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

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Oct 24 23:32:58 CEST 2017 on sn-devel-144
2017-10-24 23:32:58 +02:00
Jeremy Allison
f81c34c296 s3: smbclient: Ensure we call client_clean_name() before all operations on remote pathnames.
This allows names containing .. components to be resolved on the client side
before being sent to the server. Relative names work in SMB1 but not in SMB2.
Fix both client.c and clitar.c

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2017-10-24 19:35:08 +02:00
Jeremy Allison
d4d9d1941b s3: client: Add new utility function client_clean_name().
Correctly canonicalizes a remote pathname removing '..'
elements before sending to a remote server. '..' elements
work in SMB1 pathnames, but not in SMB2.

Not yet used.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2017-10-24 19:35:08 +02:00
Amitay Isaacs
65442e1714 ctdb-client: Fix CID 1419820
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>

Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Mon Oct 23 19:45:08 CEST 2017 on sn-devel-144
2017-10-23 19:45:08 +02:00
Amitay Isaacs
adde930795 ctdb-tools: Drop duplicate output from dbstatistics
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2017-10-23 15:41:10 +02:00
Lumir Balhar
e583a926eb python: Port tests of samba.messaging to Python 3 compatible form.
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): Mon Oct 23 15:40:48 CEST 2017 on sn-devel-144
2017-10-23 15:40:48 +02:00
Lumir Balhar
806c1bcacd python: Port samba.messaging module to Python 3 compatible form.
Signed-off-by: Lumir Balhar <lbalhar@redhat.com>
Reviewed-by: Andrew Bartlet <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2017-10-23 11:42:19 +02:00
Volker Lendecke
c3a1348371 xattr.idl: Don't generate an interface table
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Sun Oct 22 21:40:16 CEST 2017 on sn-devel-144
2017-10-22 21:40:16 +02:00
Volker Lendecke
0bd5d7bcbe nfs4acls: Don't generate an interface table for nfs4acls.idl
Nobody uses the function nfs4acl_test.

It took a while to figure out how to get this to build. The "uuid" line in the
idl file triggers pidl to generate the function table entry, which in turn then
triggers tables.pl to register this interface
./bin/default/source4/librpc/gen_ndr/tables.c. We could for example do the same
with xattr_parse_DOSATTRIB. Nobody uses this.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-10-22 17:46:15 +02:00
Volker Lendecke
abcb983430 nfs4acls: Slightly simplify smb_add_ace4
The comment was a bit confusing to me, it took a few seconds too many to figure
out *why* setting NULL is not required. Remove it :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-10-22 17:46:15 +02:00
Volker Lendecke
5c520f79a6 nfs4acls: Fix a debug message
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-10-22 17:46:15 +02:00
Ralph Boehme
e6f3631eba s3/smbd: update some more DEBUG macros in smbd_smb2_create_send
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): Sat Oct 21 18:08:46 CEST 2017 on sn-devel-144
2017-10-21 18:08:46 +02:00
Ralph Boehme
18a7ea8c0f s3/smbd: use early returns in smbd_smb2_create_send
Now that we have the nice smbd_smb2_create_after_exec() and
smbd_smb2_create_finish() functions, use early returns for the create
replay and durable handle reconnect case.

No change in behaviour, best viewed with

$ git show -w COMMIT

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2017-10-21 14:00:11 +02:00
Ralph Boehme
e55949c415 s3/smbd: factor out smbd_smb2_create_after_exec from smbd_smb2_create_send
No change in behaviour.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2017-10-21 14:00:11 +02:00
Ralph Boehme
6478a2b1fd s3/smbd: factor out smbd_smb2_create_before_exec from smbd_smb2_create_send
No change in behaviour, best viewed with:

$ git show --diff-algorithm=histogram COMMIT

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2017-10-21 14:00:11 +02:00
Ralph Boehme
403f024de1 s3/smbd: remove all stack variables of smbd_smb2_create_send into smbd_smb2_create_state
This allows factoring out smbd_smb2_create_after|before_exec() in the
next steps.

Moving all variable in one big fell swoop instead of one per commit,
because if I'd miss to adjust a variable access the commit wouldn't
compile.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2017-10-21 14:00:11 +02:00
Ralph Boehme
cadf4d56ee s3/smbd: move create ctx extraction and validation to a helper func
No change in behaviour.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2017-10-21 14:00:11 +02:00
Ralph Boehme
8229473347 s3/smbd: move create contexts into smbd_smb2_create_state
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2017-10-21 14:00:11 +02:00
Ralph Boehme
4cbd2f13ba s3/smbd: remove unneeded args from smbd_smb2_create_finish
The previous commits moved all arguments into smbd_smb2_create_state.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2017-10-21 14:00:11 +02:00
Ralph Boehme
4bb7acfe65 s3/smbd: move info into smbd_smb2_create_state
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2017-10-21 14:00:11 +02:00
Ralph Boehme
b0ee889a0a s3/smbd: add in_create_disposition to smbd_smb2_create_state
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2017-10-21 14:00:11 +02:00
Ralph Boehme
127715c665 s3/smbd: add in_oplock_level to smbd_smb2_create_state
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2017-10-21 14:00:10 +02:00
Ralph Boehme
dafb1ad4b6 s3/smbd: move requested_oplock_level into smbd_smb2_create_state
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2017-10-21 14:00:10 +02:00
Ralph Boehme
0a8263a9d6 s3/smbd: move replay_operation into smbd_smb2_create_state
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2017-10-21 14:00:10 +02:00