Commit d5b1a2b
Ilyes Ben Hamouda
session BUGFIX do not close SSH socket twice
Currently, SSH socket is closed twice when created by libssh, causing
undefined behavior in multithreaded programs (e.g. netopeer2-server).
ssh_disconnect() used to close the SSH socket. However, this behavior
changed with libssh 0.10: the socket is no longer closed when passed
through options.
Only close SSH socket when created by us after disconnecting from
the session (if libssh >= 0.10).
Fixes #450
Fixes: 70e9062 ("session BUGFIX close SSH socket")
Signed-off-by: Ilyes Ben Hamouda <[email protected]>1 parent 4b05cbe commit d5b1a2b
File tree
4 files changed
+25
-3
lines changed- src
4 files changed
+25
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
816 | 816 | | |
817 | 817 | | |
818 | 818 | | |
819 | | - | |
820 | | - | |
821 | 819 | | |
822 | | - | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
823 | 823 | | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
824 | 829 | | |
| 830 | + | |
825 | 831 | | |
826 | 832 | | |
827 | 833 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1655 | 1655 | | |
1656 | 1656 | | |
1657 | 1657 | | |
| 1658 | + | |
1658 | 1659 | | |
1659 | 1660 | | |
1660 | 1661 | | |
| |||
1683 | 1684 | | |
1684 | 1685 | | |
1685 | 1686 | | |
| 1687 | + | |
1686 | 1688 | | |
1687 | 1689 | | |
1688 | 1690 | | |
| |||
1809 | 1811 | | |
1810 | 1812 | | |
1811 | 1813 | | |
| 1814 | + | |
1812 | 1815 | | |
1813 | 1816 | | |
1814 | 1817 | | |
| |||
1833 | 1836 | | |
1834 | 1837 | | |
1835 | 1838 | | |
| 1839 | + | |
1836 | 1840 | | |
1837 | 1841 | | |
1838 | 1842 | | |
| |||
1903 | 1907 | | |
1904 | 1908 | | |
1905 | 1909 | | |
| 1910 | + | |
1906 | 1911 | | |
1907 | 1912 | | |
1908 | 1913 | | |
| |||
2016 | 2021 | | |
2017 | 2022 | | |
2018 | 2023 | | |
| 2024 | + | |
| 2025 | + | |
| 2026 | + | |
2019 | 2027 | | |
2020 | 2028 | | |
2021 | 2029 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
145 | 150 | | |
146 | 151 | | |
147 | 152 | | |
| |||
786 | 791 | | |
787 | 792 | | |
788 | 793 | | |
| 794 | + | |
789 | 795 | | |
790 | 796 | | |
791 | 797 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1449 | 1449 | | |
1450 | 1450 | | |
1451 | 1451 | | |
| 1452 | + | |
1452 | 1453 | | |
1453 | 1454 | | |
1454 | 1455 | | |
| |||
1955 | 1956 | | |
1956 | 1957 | | |
1957 | 1958 | | |
| 1959 | + | |
1958 | 1960 | | |
1959 | 1961 | | |
1960 | 1962 | | |
| |||
0 commit comments