240 Commits

Author SHA1 Message Date
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
28837087b4
Merge pull request #95 from JeffMoyer/issue-93
FileUnopen: always return a valid file descriptor
2024-02-17 10:23:09 -08: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
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
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' 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
Mylène Josserand
e42a2c9c85 console: Add 'k' option to exit on console-down
This commit is adding an option 'k' to make the console
application exits when the console is down.

This can be useful in some cases such as an integration to LAVA
infrastructure. Console can be used to open a terminal on different
boards to be able to run some tests.
In some cases, the console is down and without this commit, the
tests will be timed-out because it can't talk to the device.
Adding this option will allow us to exit the console directly, without
waiting for a timeout. The benefit will be time saving.

Signed-off-by: Mylène Josserand <mylene.josserand@collabora.com>
2020-10-16 14:06:09 +02:00
Bryan Stansell
5935a7984e
Merge pull request #53 from bstansell/nanosleep
usleep()/nanosleep() wrapper - based on contribution by Rosen Penev <rosenp@gmail.com>
2020-10-13 22:32:39 -07:00
Bryan Stansell
62dba066e1
wrap usleep()/nanosleep() with Sleep() based on configure findings 2020-10-13 14:54:29 -07:00
Bryan Stansell
3d3b5b7c44
Merge pull request #52 from neheb/nano
replace usleep with nanosleep
2020-10-13 14:22:54 -07:00
Rosen Penev
8ac7f57db8
replace usleep with nanosleep
The former is removed in POSIX 2008.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-10-12 16:44:38 -07:00
Bryan Stansell
4caac4ddd7
Merge pull request #44 from conserver/adjust-filename-again
still not properly detecting - this will do it
2020-05-25 22:08:07 -07:00
Bryan Stansell
0967c4b179
still not properly detecting - this will do it 2020-05-25 21:45:54 -07:00
Bryan Stansell
453bb82a75
Merge pull request #43 from conserver/adjust-filename
renaming for github license detection
2020-05-25 21:15:31 -07:00
Bryan Stansell
2cbcb24728
renaming for github license detection 2020-05-25 20:48:44 -07:00
Bryan Stansell
3c96ccb0da
Merge pull request #42 from conserver/issue-41-clarify-license
fix #41 - clarify license
2020-05-25 20:37:25 -07:00
Bryan Stansell
a1368a2e94
adding portion of latest email around this 2020-05-25 20:01:26 -07:00