Commit Graph

251 Commits

Author SHA1 Message Date
Bryan Stansell
f6f3999437
Merge pull request #83 from saproj/master
Fix failure of out-of-tree build
2024-03-22 21:53:44 -07:00
Bryan Stansell
13c1365e46
Merge branch 'master' into master 2024-03-22 21:50:15 -07:00
Bryan Stansell
47c232b881
Merge pull request #98 from daztucker/master
In AddrsMatch, keep copies of addrinfos to free.
2024-02-17 10:52:28 -08:00
Bryan Stansell
c2cc96b67f
Merge branch 'master' into master 2024-02-17 10:41:19 -08:00
Bryan Stansell
ee0fa16229
Merge pull request #97 from bmork/fix-crash-with-ipv6
fix SEGFAULT on early exit with IPv6 enabled
2024-02-17 10:41:08 -08:00
Bryan Stansell
93671649a6
Merge branch 'master' into fix-crash-with-ipv6 2024-02-17 10:37:48 -08:00
Bryan Stansell
337647ed35
Merge pull request #100 from bstansell/cirrus-freebsd-fix
Try and find a valid image
2024-02-17 10:37:34 -08:00
Bryan Stansell
342fe1a4da
Try and find a valid image 2024-02-17 10:34:03 -08:00
Bryan Stansell
affb22138d
Merge branch 'master' into fix-crash-with-ipv6 2024-02-17 10:25:07 -08:00
Bryan Stansell
28837087b4
Merge pull request #95 from JeffMoyer/issue-93
FileUnopen: always return a valid file descriptor
2024-02-17 10:23:09 -08:00
Darren Tucker
f93b20a3bc In AddrsMatch, keep copies of addrinfos to free.
When looping through addrinfo lists matching addresses, keep a copy
of the original addrinfo pointers to free instead of ending up at the
terminating NULLs and trying to free those.

In the best case this fixes a mem leak.  In implementations such as musl
where freeaddrinfo(NULL) is not safe (which is not required by the spec),
this fixes a segfault.
2024-02-14 23:42:59 +11:00
Bjørn Mork
ec846dfedd
fix SEGFAULT on early exit with IPv6 enabled
Some command line options, like e.g -V, will cause conserver
to exit before the IPv6 address variables are initialized.
Avoid the calls to freeaddrinfo() in these cases.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
2024-02-05 21:24:00 +01:00
Jeff Moyer
e4162a8a6d FileUnopen: always return a valid file descriptor
We have seen conserver crash due to a buffer overflow which was
tracked down to the following code in Spawn():

        if (pCLmall->fd != (CONSFILE *)0) {
            int fd;
            fd = FileUnopen(pCLmall->fd);
            pCLmall->fd = (CONSFILE *)0;
            CONDDEBUG((1, "Spawn(): closing Master() client fd %d", fd));
            close(fd);
*           FD_CLR(fd, &rinit);
            FD_CLR(fd, &winit);
        }

FileUnopen had returned -1 (which can happen for CONSFILEs of type
SSLSocket), and that was passed to FD_CLR, which essentially uses it
as an array index.

The signature of the crash is as follows:

*** buffer overflow detected ***: /usr/sbin/conserver terminated
======= Backtrace: =========
/lib64/libc.so.6(__fortify_fail+0x37)[0x7facde1987a7]
/lib64/libc.so.6(+0x116922)[0x7facde196922]
/lib64/libc.so.6(+0x118707)[0x7facde198707]
/usr/sbin/conserver(+0x158d2)[0x558ddb5468d2]
/usr/sbin/conserver(+0x2581a)[0x558ddb55681a]
/usr/sbin/conserver(+0x1944f)[0x558ddb54a44f]
/usr/sbin/conserver(+0x78f8)[0x558ddb5388f8]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x7facde0a2555]
/usr/sbin/conserver(+0x7c79)[0x558ddb538c79]

This happens after the server receives a HUP signal.

There are only two callers of FileUnopen, and the above call site is the
only one which uses the return value.  For that reason, I decided to
always return a valid file descriptor instead of changing the caller to
check for -1.  Note that FileUnopen() could still return -1 in theory:

    switch (cfp->ftype) {
...
        default:
            retval = -1;
            break;
    }

However, after auditing the code, I don't see how we would have a
CONSFILE that is not properly initialized with a type.  If I missed
such a case, then we would also need to modify the caller to check
for -1.

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
2023-11-10 17:33:15 -05:00
saproj
8d83acb273
Update Makefile.in
Support out-of-tree build.
2022-09-21 15:19:53 +03:00
saproj
037ed61e1a
Update Makefile.in
Support out-of-tree build.
2022-09-21 15:19:08 +03:00
Bryan Stansell
b7aa0508f0
Merge pull request #82 from viraptor/macos 2022-07-15 07:59:37 -07:00
Stanisław Pitucha
84fc79a459 Don't reference true
`true` coming from some macos configurations is a define in `stdbool`. This
means it can't be redefined or turned into a reference.

Use a different variable name.
2022-07-15 16:06:29 +10:00
Bryan Stansell
31bdc9b4dd
Merge pull request #81 from bstansell/release-v8.2.7
Release v8.2.7
2022-07-07 18:20:02 -07:00
Bryan Stansell
123eb1144f Release v8.2.7 2022-07-07 18:15:22 -07:00
Bryan Stansell
7b028b54b5
Merge pull request #79 from lzaoral/support-libgssapi_krb5
configure.ac: support libgssapi_krb5
2022-07-07 18:01:08 -07:00
Bryan Stansell
bc481964b5
Merge branch 'master' into support-libgssapi_krb5 2022-07-07 17:57:30 -07:00
Bryan Stansell
1b2bf598b0
Merge pull request #69 from bzfbd/bz_baudprint
conserver: reflect that baud rates have increased to 7 digits
2022-07-07 17:57:14 -07:00
Bryan Stansell
8ac5440d2e
Merge branch 'master' into bz_baudprint 2022-07-07 17:52:42 -07:00
Jiri Kastner
d3e5f34fa7 configure.ac: support libgssapi_krb5
Fixes: #59
2022-07-07 17:52:27 -07:00
Bryan Stansell
902344ce8d
Merge pull request #80 from bstansell/cirrus-freebsd-upgrade
move to freebsd-13-0
2022-07-07 17:51:45 -07:00
Bryan Stansell
52a65dd864 move to freebsd-13-0 2022-07-07 17:42:34 -07:00
Bjoern A. Zeeb
32a918162f record updated test case output. 2022-05-05 18:30:19 +00:00
Bjoern A. Zeeb
1a961cdf18 conserver: reflect that baud values have increased to 7 digits
When having "examine" print baud/parity increase the maximum string
width from 6 to 7 digits.  And while here try to indicate more baud
values in the manual going up to 4000000.
2022-05-05 18:26:01 +00:00
Bryan Stansell
0ed802ea6f
Merge pull request #68 from bzfbd/bz_subst
conserver.cf: devicesubst add 'b' for baud rate
2021-07-17 10:49:38 -07:00
Bryan Stansell
ebf3da2169
Merge branch 'master' into bz_subst 2021-07-17 10:36:11 -07:00
Bryan Stansell
cf24bb9404
Merge pull request #66 from bzfbd/bz_compile
Make compile --with-ipv6 & setproctitle
2021-07-17 10:28:40 -07:00
Bjoern A. Zeeb
959a3bc8de conserver.cf: devicesubst add 'b' for baud rate
Add a 'b' subst format to get baud rates as well to build up
device names and the others.
2021-07-16 16:52:39 +00:00
Bjoern A. Zeeb
e801b9cc75 Make compile --with-ipv6 & setproctitle
If compiling with IPv6 support and setproctitle two places are using
the wrong type (char *) instead of (ushort) or a non-existent variable.
Fix these to make --with-ipv6 compile on FreeBSD.
2021-07-15 17:49:49 +00:00
Bryan Stansell
8b3dfdb14f
Merge pull request #61 from bstansell/wom-bat
Fix Cirrus on FreeBSD
2021-03-17 15:01:01 -07:00
Bryan Stansell
ae26f9fc02
move to freebsd 12.2 2021-03-17 14:51:19 -07:00
Bryan Stansell
361d55f656
Merge pull request #60 from wom-bat/master
Conserver-server: Add high baud rates
2021-03-17 14:50:07 -07:00
Peter Chubb
e7ca230c22 Conserver-server: Add high baud rates
Linux (and others) allow higher baud rates than POSIX.
Add the definitions so that baud rates up to 4Mb/s are recognised
and can be used.

Signed-off-by: Peter Chubb <peter.chubb@data61.csiro.au>
2021-03-16 10:31:27 +11:00
Bryan Stansell
60bdfc3a12
Merge pull request #58 from Polynomial-C/autoconf-2.70
configure.ac: autoconf-2.70 fix
2021-01-12 15:06:08 -08:00
Lars Wendler
ce3b4f1d00
configure.ac: autoconf-2.70 fix
Gentoo-bug: https://bugs.gentoo.org/750230
Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
2021-01-12 18:20:44 +01:00
Bryan Stansell
c8355ae8b9
Merge branch 'release-v8.2.6' 2020-10-19 22:33:19 -07:00
Bryan Stansell
d8bf1d96a8
Release v8.2.6 2020-10-19 22:30:29 -07:00
Bryan Stansell
780daa7d37
Merge pull request #56 from bstansell/ipv6_access_behavior
Fix #48 - apply ipv4 CIDR access list when compiled with ipv6 support
2020-10-19 00:33:42 -07:00
Bryan Stansell
3091aa88c7
Merge branch 'master' into ipv6_access_behavior 2020-10-19 00:23:28 -07:00
Bryan Stansell
974451e7cf
Merge pull request #55 from bstansell/fix-github-pointers
fixing links to github repo - from conserver to bstansell
2020-10-18 23:53:38 -07:00
Bryan Stansell
f1f3e2a1dc
fixing links to github repo - from conserver to bstansell 2020-10-18 23:41:46 -07:00
Bryan Stansell
5be57261e8
ran gindent to clean up formatting 2020-10-18 23:31:04 -07:00
Bryan Stansell
0d64aad812
fix compiler warning and allow ipv4 cidr notation to work when compiled with ipv6 support 2020-10-18 23:26:40 -07:00
Bryan Stansell
15359cd1f3
Merge branch 'client_opt_k' 2020-10-18 10:17:59 -07:00
Bryan Stansell
3bf686ed39
adding docs/help for new -k and exiting like other code paths 2020-10-17 17:07:01 -07:00
Bryan Stansell
4396ff9456
Merge pull request #54 from MyleneJ/add_k_option
console: Add 'k' option to exit on console-down
2020-10-17 15:36:40 -07:00