summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* s3:printing: Fix %J substitionRalph Boehme2019-11-0710-13/+23
| | | | | | | | | | | | | | | | | | | | | print_run_command() uses lp_print_command() which internally performs basic substition by calling talloc_sub_basic(). As a result. any of the variables in the "basic set", including "%J" are already substituted. To prevent the unwanted subtitution, we declare all affected configuration options as const, which disabled the basic substition. As a result print_run_command() can run manual substitution on all characters, including %J, in the variadic argument list *before* calling lp_string() to run basic substition which we had disabled before with the const. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13745 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Thu Nov 7 16:01:21 UTC 2019 on sn-devel-184
* s3:printing: add a DEBUG statementRalph Boehme2019-11-071-0/+2
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13745 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3:lib: factor out talloc_sub_advanced() from talloc_sub_full()Ralph Boehme2019-11-072-5/+27
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13745 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3: rename talloc_sub_advanced() to talloc_sub_full()Ralph Boehme2019-11-0711-24/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently have the following substitution functions: talloc_sub_basic() talloc_sub_advanced() talloc_sub_basic() currently substitutes a subset of talloc_sub_advanced(). We'll need a function X that only substitutes what talloc_sub_advanced() substitutes *without* what talloc_sub_basic() does. To get there rename talloc_sub_advanced() to talloc_sub_full(). A subsequent commit will then bring back talloc_sub_advanced() as described above. Examples with fictional replacement letters A and B. Currently: talloc_sub_basic: A talloc_sub_advanced: AB New: talloc_sub_basic: A talloc_sub_advanced: B talloc_sub_full: AB BUG: https://bugzilla.samba.org/show_bug.cgi?id=13745 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3: remove unused function standard_sub_advanced()Ralph Boehme2019-11-072-20/+0
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13745 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3: replace standard_sub_advanced with talloc_sub_advanced in one placeRalph Boehme2019-11-071-4/+10
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13745 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3:printing: fix a long lineRalph Boehme2019-11-071-1/+2
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13745 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* vfs: Use file_id_str_buf() in vfs_delay_inject_brl_lock_timer()Volker Lendecke2019-11-061-1/+2
| | | | | | | | 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): Wed Nov 6 21:58:52 UTC 2019 on sn-devel-184
* smbd: Use struct initialization instead of ZERO_STRUCT()Volker Lendecke2019-11-061-3/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs: Use file_id_str_buf() in smb_full_audit_file_id_create()Volker Lendecke2019-11-061-1/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use file_id_str_buf() in set_write_time()Volker Lendecke2019-11-061-2/+3
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use file_id_str_buf() in rename_open_files()Volker Lendecke2019-11-061-7/+12
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use file_id_str_buf() in contend_level2_oplocks_begin_default()Volker Lendecke2019-11-061-1/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use file_id_str_buf() in process_kernel_oplock_break()Volker Lendecke2019-11-061-3/+5
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use file_id_str_buf() in process_oplock_break_message()Volker Lendecke2019-11-061-7/+9
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use file_id_str_buf() in initial_break_processing()Volker Lendecke2019-11-061-9/+13
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use file_id_str_buf() in downgrade_lease()Volker Lendecke2019-11-061-8/+17
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use file_id_str_buf() in downgrade_oplock()Volker Lendecke2019-11-061-4/+6
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use file_id_str_buf() in set_file_oplock()Volker Lendecke2019-11-061-2/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use file_id_str_buf() in set_file_oplock()Volker Lendecke2019-11-061-1/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* ntlm_auth: Fix nonempty line endingsVolker Lendecke2019-11-061-64/+64
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* ntlm_auth: Simplify session generationVolker Lendecke2019-11-061-16/+3
| | | | | | | We don't need to parse a text sid, we have those as binary available Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* auth: Simplify session generationVolker Lendecke2019-11-061-12/+3
| | | | | | | We don't need to parse a text sid, we have those as binary available Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Avoid includes.h in g_lock.cVolker Lendecke2019-11-061-1/+5
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Remove g_lock_do()Volker Lendecke2019-11-062-68/+0
| | | | | | | | This puts too much logic into this lowlevel infrastructure module, given the two minor external users. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* net: Avoid the use of g_lock_do()Volker Lendecke2019-11-061-25/+26
| | | | | | | g_lock_do() does too much in g_lock.c, and it's rarely used. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* net: Avoid the use of g_lock_do()Volker Lendecke2019-11-061-71/+65
| | | | | | | g_lock_do() does too much in g_lock.c, and it's rarely used. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* g_lock: Avoid sys_random(), use generate_random()Volker Lendecke2019-11-061-2/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* dbwrap_tdb: Avoid a use of talloc_stackframe()Volker Lendecke2019-11-061-10/+10
| | | | | | | For really large keys (that probably don't exist), use dump_data() Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Remove #define serverid_equal server_id_equalVolker Lendecke2019-11-0612-18/+19
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: smbd: SMB1 UNIX extensions - remove dead code.Jeremy Allison2019-11-061-13/+0
| | | | | | | | | | We no longer set delete_on_fail on return from mknod. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Nov 6 19:31:00 UTC 2019 on sn-devel-184
* s3: smbd: SMB1 UNIX extensions - POSIX mknod should just create the object, ↵Jeremy Allison2019-11-061-34/+1
| | | | | | | not change attributes after. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3: smbd: SMB1 UNIX extensions - only allow size change on regular file.Jeremy Allison2019-11-061-8/+10
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* 3: smbd: SMB1 UNIX extensions - For POSIX mknod we can only create ↵Jeremy Allison2019-11-061-0/+5
| | | | | | | | | blk/chr/fifo/sock objects. Fail requests to create other object types. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3: smbd: SMB1 UNIX extensions - Ensure POSIX mknod is root-only.Jeremy Allison2019-11-061-0/+7
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* bootstrap: Fix centos7 image creationAndreas Schneider2019-11-065-4/+5
| | | | | | | | 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 Nov 6 13:35:17 UTC 2019 on sn-devel-184
* bootstrap: Add Fedora 31Andreas Schneider2019-11-069-2/+316
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
* bootstrap: Remove Fedora 28 which is already EOLAndreas Schneider2019-11-069-309/+2
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
* ctdb-tests: Make process exists test more resilientMartin Schwenke2019-11-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This can fail as follows: --==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==-- Running test ./tests/UNIT/tool/ctdb.process-exists.003.sh (02:26:30) --==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==-- ctdb.process-exists.003 - ctdbd process with multiple connections on node 0 Setting up fake ctdbd <10||0| OK <10|PID 26107 exists |0| OK ================================================== Running "ctdb -d NOTICE process-exists 26107 0x1234567812345678" PASSED ================================================== Running "ctdb -d NOTICE process-exists 26107 0xaebbccdd12345678" Registered SRVID 0xaebbccdd12345678 -------------------------------------------------- Output (Exit status: 1): -------------------------------------------------- PID 26107 with SRVID 0xaebbccdd12345678 does not exist -------------------------------------------------- Required output (Exit status: 0): -------------------------------------------------- PID 26107 with SRVID 0xaebbccdd12345678 exists FAILED connection to daemon closed, exiting ========================================================================== TEST FAILED: ./tests/UNIT/tool/ctdb.process-exists.003.sh (status 1) (duration: 0s) ========================================================================== This happens when dummy_client has not registered the SRVID (for its 10th connection) before the 2nd simple_test. Change the initial wait to ensure that the SRVID is registered. 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): Wed Nov 6 02:46:24 UTC 2019 on sn-devel-184
* ctdb-tests: Improve code quality in ctdb_init()Martin Schwenke2019-11-061-7/+9
| | | | | | | | Improve quoting and indentation. Print a clear error if the cluster goes back into recovery and doesn't come back out. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: No longer retry starting the clusterMartin Schwenke2019-11-061-30/+4
| | | | | | | | Retrying like this hides bugs. The cluster should come up first time, every time. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tcp: Drop tracking of file descriptor for incoming connectionsMartin Schwenke2019-11-064-11/+0
| | | | | | | | | | | This file descriptor is owned by the incoming queue. It will be closed when the queue is torn down. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14175 RN: Avoid communication breakdown on node reconnect Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tcp: Avoid orphaning the TCP incoming queueMartin Schwenke2019-11-061-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CTDB's incoming queue handling does not check whether an existing queue exists, so can overwrite the pointer to the queue. This used to be harmless until commit c68b6f96f26664459187ab2fbd56767fb31767e0 changed the read callback to use a parent structure as the callback data. Instead of cleaning up an orphaned queue on disconnect, as before, this will now free the new queue. At first glance it doesn't seem possible that 2 incoming connections from the same node could be processed before the intervening disconnect. However, the incoming connections and disconnect occur on different file descriptors. The queue can become orphaned on node A when the following sequence occurs: 1. Node A comes up 2. Node A accepts an incoming connection from node B 3. Node B processes a timeout before noticing that outgoing the queue is writable 4. Node B tears down the outgoing connection to node A 5. Node B initiates a new connection to node A 6. Node A accepts an incoming connection from node B Node A processes then the disconnect of the old incoming connection from (2) but tears down the new incoming connection from (6). This then occurs until the originally affected node is restarted. However, due to the number of outgoing connection attempts and associated teardowns, this induces the same behaviour on the corresponding incoming queue on all nodes that node A attempts to connect to. Therefore, other nodes become affected and need to be restarted too. As a result, the whole cluster probably needs to be restarted to recover from this situation. The problem can occur any time CTDB is started on a node. The fix is to avoid accepting new incoming connections when a queue for incoming connections is already present. The connecting node will simply retry establishing its outgoing connection. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14175 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tcp: Check incoming queue to see if incoming connection is upMartin Schwenke2019-11-061-1/+1
| | | | | | | | | | This makes it consistent with the reverse case. Also, in_fd will soon be removed. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14175 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* s3: libsmb: Ensure return from net_share_enum_rpc() sets cli->raw_status on ↵Jeremy Allison2019-11-051-11/+22
| | | | | | | | | | | | | | | error. Convert net_share_enum_rpc() to return an NTSTATUS and ensure the status is set correctly on error so SMBC_errno() can return it. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14176 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Tue Nov 5 12:36:48 UTC 2019 on sn-devel-184
* s3:libads: Fix mem leak in ads_create_machine_acctJones Syue2019-11-041-1/+2
| | | | | | | | | | | Use 'goto done' instead of 'return' to fix machine_escaped leak. Signed-off-by: Jones Syue <jonessyue@qnap.com> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Mon Nov 4 22:48:50 UTC 2019 on sn-devel-184
* gitlab-ci: Run 'samba' tests also with MIT KerberosAndreas Schneider2019-11-042-0/+55
| | | | | | | | | | This runs the tests of the ktest environment. 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): Mon Nov 4 14:19:17 UTC 2019 on sn-devel-184
* libcli:smb: Do not use gnutls_aead_cipher_encryptv2() with GnuTLS 3.6.10Andreas Schneider2019-11-041-2/+6
| | | | | | | | | | The gnutls_aead_cipher_encryptv2() implementation was released with a bug. This wont be fixed before 3.6.11. See https://gitlab.com/gnutls/gnutls/merge_requests/1085 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
* CVE-2019-14847 dsdb: Correct behaviour of ranged_results when combined with ↵Andrew Bartlett2019-10-313-8/+27
| | | | | | | | | | | | dirsync BUG: https://bugzilla.samba.org/show_bug.cgi?id=14040 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org> Autobuild-Date(master): Thu Oct 31 23:29:15 UTC 2019 on sn-devel-184
* CVE-2019-14847 dsdb: Demonstrate the correct interaction of ranged_results ↵Andrew Bartlett2019-10-312-0/+27
| | | | | | | | | | | | style attributes and dirsync Incremental results are provided by a flag on the dirsync control, not by changing the attribute name. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14040 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>