summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* VERSION: Bump version up to 4.9.15...Karolin Seeger2019-10-221-2/+2
| | | | | | and re-enable GIT_SNAPSHOT. Signed-off-by: Karolin Seeger <kseeger@samba.org>
* VERSION: Disable GIT_SNAPSHOT for the 4.9.14 release.samba-4.9.14Karolin Seeger2019-10-221-1/+1
| | | | Signed-off-by: Karolin Seeger <kseeger@samba.org>
* WHATSNEW: Add release notes for Samba 4.9.14.Karolin Seeger2019-10-221-2/+84
| | | | Signed-off-by: Karolin Seeger <kseeger@samba.org>
* spnego: fix server handling of no optimistic exchangeIsaac Boukris2019-10-162-1/+13
| | | | | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14106 Signed-off-by: Isaac Boukris <iboukris@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Sat Oct 12 15:51:42 UTC 2019 on sn-devel-184 Autobuild-User(v4-9-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-9-test): Wed Oct 16 16:47:14 UTC 2019 on sn-devel-144
* selftest: add tests for no optimistic spnego exchangeIsaac Boukris2019-10-162-0/+5
| | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14106 Signed-off-by: Isaac Boukris <iboukris@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* spnego: add client option to omit sending an optimistic tokenIsaac Boukris2019-10-161-0/+11
| | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14106 Signed-off-by: Isaac Boukris <iboukris@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* ctdb-vacuum: Process all records not deleted on a remote nodeAmitay Isaacs2019-10-161-1/+1
| | | | | | | | | | | This currently skips the last record. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14147 RN: Avoid potential data loss during recovery after vacuuming error Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> (cherry picked from commit 33f1c9d9654fbdcb99c23f9d23c4bbe2cc596b98)
* fault.c: improve fault_report message text pointing to our wikiBjörn Jacke2019-09-261-1/+5
| | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14139 Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> (cherry picked from commit ec4c5975528f3d3ab9c8813e176c6d1a2f1ca506) Autobuild-User(v4-9-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-9-test): Thu Sep 26 04:30:04 UTC 2019 on sn-devel-144
* ctdb-tools: Stop deleted nodes from influencing ctdb nodestatus exit codeMartin Schwenke2019-09-201-1/+7
| | | | | | | | | | | | | | Deleted nodes should simply be ignored. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14129 RN: Stop deleted nodes from influencing ctdb nodestatus exit code Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit 32b5ceb31936ec5447362236c1809db003561d29) Autobuild-User(v4-9-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-9-test): Fri Sep 20 14:09:11 UTC 2019 on sn-devel-144
* s3/4: libsmbclient test. Test using smbc_telldir/smbc_lseekdir with ↵Jeremy Allison2019-09-191-0/+340
| | | | | | | | | | | | | | | | | | | smbc_readdir/smbc_readdirplus/smbc_getdents. Ensure that for file access you can mix any of these three access methods for directory entries and the returned names/structs stay in sync across telldir/seekdir changes. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14094 Back-ported from master 3355601fe8541994cc41f5ed800aab9b6a2294f4. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org> Autobuild-User(v4-9-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-9-test): Thu Sep 19 10:40:56 UTC 2019 on sn-devel-144
* s3: libsmbclient: Fix smbc_lseekdir() to work with smbc_readdirplus().Jeremy Allison2019-09-191-26/+43
| | | | | | | | | | | If returning files the dir_list and the dirplus_list have exactly the same entries, we just need to keep the next pointers in sync on seek. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14094 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org> (cherry picked from commit 0d9b1645499ce12a79a137d3482434aa5d2eb47c)
* s3: libsmbclient: Ensure SMBC_getdents_ctx() also updates the readdirplus ↵Jeremy Allison2019-09-191-0/+11
| | | | | | | | | | | | | | | | pointers. If we are returning file entries, we have a duplicate list in dirplus. Update dirplus_next also so readdir and readdirplus are kept in sync. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14094 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org> (cherry picked from commit 754cec7756b2ddb1cfcc3984265f01cb366beb76)
* s3: libsmbclient: Ensure SMBC_readdirplus_ctx() also updates the readdir ↵Jeremy Allison2019-09-191-0/+11
| | | | | | | | | | | | | | | | pointers. If we are returning file entries, we have a duplicate list in dir_list. Update dir_next also so readdir and readdirplus are kept in sync. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14094 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org> (cherry picked from commit 3d82b7d11cd7b78adc6b3642e64e3a8f251de869)
* s3: libsmbclient: Ensure SMBC_readdir_ctx() also updates the readdirplus ↵Jeremy Allison2019-09-191-0/+11
| | | | | | | | | | | | | | | | pointers. If we are returning file entries, we have a duplicate list in dirplus. Update dirplus_next also so readdir and readdirplus are kept in sync. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14094 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org> (cherry picked from commit 4bca8e097f5a909c628daa4dbfa932ddc1725ebc)
* libcli/smb: send SMB2_NETNAME_NEGOTIATE_CONTEXT_IDStefan Metzmacher2019-09-111-0/+17
| | | | | | | | | | | | | | | | | | Note: Unlike the current documentation, the utf16 string is not null-terminated, that matches Windows Server 1903 as a client. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14055 RN: Add the target server name of SMB 3.1.1 connections as a hint to load balancers or servers with "multi-tenancy" support. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Aurelien Aptel <aaptel@suse.com> (similar to commit 21f6cece543dd791e0f4636458bfe9819823420c) Autobuild-User(v4-9-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-9-test): Wed Sep 11 13:27:24 UTC 2019 on sn-devel-144
* libcli/smb: add new COMPRESSION and NETNAME negotiate context idsStefan Metzmacher2019-09-111-0/+2
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14055 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Aurelien Aptel <aaptel@suse.com> (cherry picked from commit e10b90f33bb812600886656a1124e2d434416563)
* s3:ldap: Fix join with don't exists machine accountEvgeny Sinelnikov2019-09-111-2/+3
| | | | | | | | | | | | | | | | | Add check for requested replies of existing machine object during join machine to domain. This solves regression fail during join with error: "None of the information to be translated has been translated." https://bugzilla.samba.org/show_bug.cgi?id=14007 Reviewed-by: Guenther Deschner <gd@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Wed Sep 4 17:02:37 UTC 2019 on sn-devel-184 (cherry picked from commit ad4ef1657e9b2a088a3bfadcce196cfcceead1dc)
* ctdb: fix compilation on systems with glibc robust mutexesRalph Boehme2019-09-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | On older systems like SLES 11 without POSIX robust mutexes, but with glib robust mutexes where all the functions are available but have a "_np" suffix, compilation fails in: ctdb/tests/src/test_mutex_raw.c.239.o: In function `worker': /root/samba-4.10.6/bin/default/../../ctdb/tests/src/test_mutex_raw.c:129: undefined reference to `pthread_mutex_consistent' ctdb/tests/src/test_mutex_raw.c.239.o: In function `main': /root/samba-4.10.6/bin/default/../../ctdb/tests/src/test_mutex_raw.c:285: undefined reference to `pthread_mutex_consistent' /root/samba-4.10.6/bin/default/../../ctdb/tests/src/test_mutex_raw.c:332: undefined reference to `pthread_mutexattr_setrobust' /root/samba-4.10.6/bin/default/../../ctdb/tests/src/test_mutex_raw.c:363: undefined reference to `pthread_mutex_consistent' collect2: ld returned 1 exit status This could be fixed by using libreplace system/threads.h instead of pthreads.h directly, but as there has been a desire to keep test_mutex_raw.c standalone and compilable without other external depenencies then libc and libpthread, make the tool developer build only. This should get the average user over the cliff. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14038 RN: Fix compiling ctdb on older systems lacking POSIX robust mutexes Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net> (cherry picked from commit f5388f97792ac2d7962950dad91aaf8ad49bceaa) Autobuild-User(v4-9-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-9-test): Thu Sep 5 16:12:34 UTC 2019 on sn-devel-144
* vfs_glusterfs: Use pthreadpool for scheduling aio operationsPoornima G2019-09-031-285/+260
| | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14098 Signed-off-by: Poornima G <pgurusid@redhat.com> Reviewed-by: Guenther Deschner <gd@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(v4-9-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-9-test): Tue Sep 3 16:01:37 UTC 2019 on sn-devel-144
* ctdb-recoverd: Fix typo in previous fixMartin Schwenke2019-09-031-1/+1
| | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14085 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 Aug 27 15:29:11 UTC 2019 on sn-devel-184 (cherry picked from commit 8190993d99284162bd8699780248bb2edfec2673)
* ctdb-tests: Clear deleted record via recovery instead of vacuumingMartin Schwenke2019-09-031-11/+5
| | | | | | | | | | | | | | | | | | | | This test has been flapping because sometimes the record is not vacuumed within the expected time period, perhaps even because the check for the record can interfere with vacuuming. However, instead of waiting for vacuuming the record can be cleared by doing a recovery. This should be much more reliable. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14085 RN: Fix flapping CTDB tests Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Wed Aug 21 13:06:57 UTC 2019 on sn-devel-184 (backported from commit 71ad473ba805abe23bbe6c1a1290612e448e73f3) Signed-off-by: Martin Schwenke <martin@meltin.net>
* ctdb-tests: Strengthen volatile DB traverse testMartin Schwenke2019-09-031-15/+52
| | | | | | | | | | | Check the record count more often, from multiple nodes. Add a case with multiple records. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14085 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit ca4df06080709adf0cbebc95b0a70b4090dad5ba)
* ctdb-recoverd: Only check for LMASTER nodes in the VNN mapMartin Schwenke2019-09-031-4/+10
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14085 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit 5d655ac6f2ff82f8f1c89b06870d600a1a3c7a8a)
* ctdb-tests: Don't retrieve the VNN map from target node for notlmasterMartin Schwenke2019-09-031-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Use the VNN map from the node running node_has_status(). This means that wait_until_node_has_status 1 notlmaster 10 0 will run "ctdb status" on node 0 and check (for up to 10 seconds) if node 1 is in the VNN map. If the LMASTER capability has been dropped on node 1 then the above will wait for the VNN map to be updated on node 0. This will happen as part of the recovery that is triggered by the change of LMASTER capability. The next command will then only be able to attach to $TESTDB after the recovery is complete thus guaranteeing a sane state for the test to continue. This stops simple/79_volatile_db_traverse.sh from going into recovery during the traverse or at some other inconvenient time. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14085 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit 53daeb2f878af1634a26e05cb86d87e2faf20173)
* ctdb-tests: Handle special cases first and returnMartin Schwenke2019-09-031-31/+28
| | | | | | | | | | All the other cases involve matching bits. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14085 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit bff1a3a548a2cace997b767d78bb824438664cb7)
* ctdb-tests: Inline handling of recovered and notlmaster statusesMartin Schwenke2019-09-031-6/+12
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14085 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit bb59073515ee5f7886b5d9a20d7b2805857c2708)
* ctdb-tests: Drop unused node statuses frozen/unfrozenMartin Schwenke2019-09-031-6/+2
| | | | | | | | | | Silently drop unused local variable mpat. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14085 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit 9b09a87326af28877301ad27bcec5bb13744e2b6)
* ctdb-tests: Reformat node_has_status()Martin Schwenke2019-09-031-46/+48
| | | | | | | | | | Re-indent and drop non-POSIX left-parenthesis from case labels. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14085 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit 52227d19735a3305ad633672c70385f443f222f0)
* VERSION: Bump version up to 4.9.14.Karolin Seeger2019-09-031-1/+1
| | | | Signed-off-by: Karolin Seeger <kseeger@samba.org>
* Merge tag 'samba-4.9.13' into v4-9-testKarolin Seeger2019-09-034-22/+151
|\ | | | | | | samba: tag release samba-4.9.13
| * VERSION: Disable GIT_SNAPSHOT for the 4.9.13 release.samba-4.9.13Karolin Seeger2019-08-281-1/+1
| | | | | | | | Signed-off-by: Karolin Seeger <kseeger@samba.org>
| * WHATSNEW: Add release notes for Samba 4.9.13.Karolin Seeger2019-08-281-2/+60
| | | | | | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14035 CVE-2019-10197 [SECURITY][EMBARGOED] permissions check deny can allow user to escape from the share. Signed-off-by: Karolin Seeger <kseeger@samba.org>
| * CVE-2019-10197: smbd: split change_to_user_impersonate() out of ↵Stefan Metzmacher2019-08-282-5/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | change_to_user_internal() This makes sure we always call chdir_current_service() even when we still impersonated the user. Which is important in order to run the SMB* request within the correct working directory and only if the user has permissions to enter that directory. It makes sure we always update conn->lastused_count in chdir_current_service() for each request. Note that vfs_ChDir() (called from chdir_current_service()) maintains its own cache and avoids calling SMB_VFS_CHDIR() if possible. It means we still avoid syscalls if we get a multiple requests for the same session/tcon tuple. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14035 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
| * CVE-2019-10197: test_smbclient_s3.sh: add regression test for the no ↵Stefan Metzmacher2019-08-283-0/+43
| | | | | | | | | | | | | | | | permission on share root problem BUG: https://bugzilla.samba.org/show_bug.cgi?id=14035 Signed-off-by: Stefan Metzmacher <metze@samba.org>
| * CVE-2019-10197: selftest: make fsrvp_share its own independent subdirectoryStefan Metzmacher2019-08-281-2/+5
| | | | | | | | | | | | | | | | The next patch will otherwise break the fsrvp related tests. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14035 Signed-off-by: Stefan Metzmacher <metze@samba.org>
| * CVE-2019-10197: smbd: make sure we reset current_user.{need,done}_chdir in ↵Stefan Metzmacher2019-08-281-0/+3
| | | | | | | | | | | | | | | | become_root() BUG: https://bugzilla.samba.org/show_bug.cgi?id=14035 Signed-off-by: Stefan Metzmacher <metze@samba.org>
| * CVE-2019-10197: smbd: make sure that change_to_user_internal() always resets ↵Stefan Metzmacher2019-08-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | current_user.done_chdir We should not leave current_user.done_chdir as true if we didn't call chdir_current_service() with success. This caused problems in when calling vfs_ChDir() in pop_conn_ctx() when chdir_current_service() worked once on one share but later failed on another share. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14035 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
| * CVE-2019-10197: smbd: separate out impersonation debug info into a new function.Jeremy Allison2019-08-281-14/+23
| | | | | | | | | | | | | | | | | | | | Will be called on elsewhere on successful impersonation. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14035 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
| * VERSION: Bump version up to 4.9.13...Karolin Seeger2019-08-281-2/+2
| | | | | | | | | | | | and re-enable GIT_SNAPSHOT. Signed-off-by: Karolin Seeger <kseeger@samba.org>
* | ctdb-daemon: Make node inactive in the NODE_STOP controlMartin Schwenke2019-08-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently some of this is supported by a periodic check in the recovery daemon's main_loop(), which notices the flag change, sets recovery mode active and freezes databases. If STOP_NODE returns immediately then the associated recovery can complete and the node can be continued before databases are actually frozen. Instead, immediately do all of the things that make a node inactive. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14087 RN: Stop "ctdb stop" from completing before freezing databases 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 Aug 20 08:32:27 UTC 2019 on sn-devel-184 (cherry picked from commit e9f2e205ee89f4f3d6302cc11b4d0eb2efaf0f53) Autobuild-User(v4-9-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-9-test): Wed Aug 28 12:04:13 UTC 2019 on sn-devel-144
* | ctdb-daemon: Drop unused function ctdb_local_node_got_banned()Martin Schwenke2019-08-282-25/+0
| | | | | | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14087 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit 91ac4c13d8472955d1f04bd775ec4b3ff8bf1b61)
* | ctdb-daemon: Switch banning code to use ctdb_node_become_inactive()Martin Schwenke2019-08-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's no reason to avoid immediately setting recovery mode to active and initiating freeze of databases. This effectively reverts the following commits: d8f3b490bbb691c9916eed0df5b980c1aef23c85 b4357a79d916b1f8ade8fa78563fbef0ce670aa9 The latter is now implemented using a control, resulting in looser coupling. See also the following commit: f8141e91a693912ea1107a49320e83702a80757a BUG: https://bugzilla.samba.org/show_bug.cgi?id=14087 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit 0f5f7b7cf4e970f3f36c5e0b3d09e710fe90801a)
* | ctdb-daemon: Factor out new function ctdb_node_become_inactive()Martin Schwenke2019-08-282-0/+45
| | | | | | | | | | | | | | | | | | | | | | This is a superset of ctdb_local_node_got_banned() so will replace that function, and will also be used in the NODE_STOP control. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14087 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit a42bcaabb63722411bee52b80cbfc795593defbc)
* | ctdb-tcp: Mark node as disconnected if incoming connection goes awayMartin Schwenke2019-08-282-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To make it easy to pass the node data to the upcall, the private data for ctdb_tcp_read_cb() needs to be changed from tnode to node. RN: Avoid marking a node as connected before it can receive packets BUG: https://bugzilla.samba.org/show_bug.cgi?id=14084 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Fri Aug 16 22:50:35 UTC 2019 on sn-devel-184 (cherry picked from commit 73c850eda4209b688a169aeeb20c453b738cbb35)
* | ctdb-tcp: Only mark a node connected if both directions are upMartin Schwenke2019-08-281-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Nodes are currently marked as up if the outgoing connection is established. However, if the incoming connection is not yet established then this node could send a request where the replying node can not queue its reply. Wait until both directions are up before marking a node as connected. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14084 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit 8c98c10f242bc722beffc711e85c0e4f2e74cd57)
* | ctdb-tcp: Create outbound queue when the connection becomes writableMartin Schwenke2019-08-283-12/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit ddd97553f0a8bfaada178ec4a7460d76fa21f079 ctdb_queue_send() doesn't queue a packet if the connection isn't yet established (i.e. when fd == -1). So, don't bother creating the outbound queue during initialisation but create it when the connection becomes writable. Now the presence of the queue indicates that the outbound connection is up. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14084 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit 7f4854d9643a096a6d8a354fcd27b7c6ed24a75e)
* | ctdb-tcp: Use TALLOC_FREE()Martin Schwenke2019-08-281-4/+2
| | | | | | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14084 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit d80d9edb4dc107b15a35a39e5c966a3eaed6453a)
* | ctdb-tcp: Move incoming fd and queue into struct ctdb_tcp_nodeMartin Schwenke2019-08-284-34/+61
| | | | | | | | | | | | | | | | | | | | | | This makes it easy to track both incoming and outgoing connectivity states. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14084 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit c68b6f96f26664459187ab2fbd56767fb31767e0)
* | ctdb-tcp: Rename fd -> out_fdMartin Schwenke2019-08-283-49/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | in_fd is coming soon. Fix coding style violations in the affected and adjacent lines. Modernise some debug macros and make them more consistent (e.g. drop logging of errno when strerror(errno) is already logged. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14084 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit c06620169fc178ea6db2631f03edf008285d8cf2)
* | ctdb-daemon: Add function ctdb_ip_to_node()Martin Schwenke2019-08-282-5/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the core logic from ctdb_ip_to_pnn(), so re-implement that that function using ctdb_ip_to_node(). Something similar (ctdb_ip_to_nodeid()) was recently removed in commit 010c1d77cd7e192b1fff39b7b91fccbdbbf4a786 because it wasn't required. Now there is a use case. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14084 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit 3acb8e9d1c854b577d6be282257269df83055d31)