summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2021-05-01 11:53:25 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2021-05-01 11:53:25 +0000
commit747faa287567a0716ae1ed8dcfb654dbfcfdbbb5 (patch)
tree0313ebf55cca53080d8e758fe4b8b7096e846494 /sbin
parenta2395c6e69ed0443a73904970ddeca8a785362b8 (diff)
In singel user mode / is mounted ro. Just warn if we can't create
the control socket instead of fatal(). OK deraadt
Diffstat (limited to 'sbin')
-rw-r--r--sbin/dhcpleased/dhcpleased.c7
-rw-r--r--sbin/slaacd/slaacd.c7
2 files changed, 8 insertions, 6 deletions
diff --git a/sbin/dhcpleased/dhcpleased.c b/sbin/dhcpleased/dhcpleased.c
index 88152345793..46685012402 100644
--- a/sbin/dhcpleased/dhcpleased.c
+++ b/sbin/dhcpleased/dhcpleased.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhcpleased.c,v 1.10 2021/04/14 23:35:24 deraadt Exp $ */
+/* $OpenBSD: dhcpleased.c,v 1.11 2021/05/01 11:52:36 florian Exp $ */
/*
* Copyright (c) 2017, 2021 Florian Obser <florian@openbsd.org>
@@ -260,7 +260,7 @@ main(int argc, char *argv[])
#ifndef SMALL
if ((control_fd = control_init(csock)) == -1)
- fatalx("control socket setup failed");
+ warnx("control socket setup failed");
#endif /* SMALL */
if (unveil("/dev/bpf", "rw") == -1)
@@ -280,7 +280,8 @@ main(int argc, char *argv[])
main_imsg_compose_frontend(IMSG_ROUTESOCK, frontend_routesock, NULL, 0);
#ifndef SMALL
- main_imsg_compose_frontend(IMSG_CONTROLFD, control_fd, NULL, 0);
+ if (control_fd != -1)
+ main_imsg_compose_frontend(IMSG_CONTROLFD, control_fd, NULL, 0);
#endif /* SMALL */
main_imsg_compose_frontend(IMSG_STARTUP, -1, NULL, 0);
diff --git a/sbin/slaacd/slaacd.c b/sbin/slaacd/slaacd.c
index 9e1e9998b2f..44a754b421c 100644
--- a/sbin/slaacd/slaacd.c
+++ b/sbin/slaacd/slaacd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: slaacd.c,v 1.59 2021/03/21 18:25:24 florian Exp $ */
+/* $OpenBSD: slaacd.c,v 1.60 2021/05/01 11:53:24 florian Exp $ */
/*
* Copyright (c) 2017 Florian Obser <florian@openbsd.org>
@@ -263,7 +263,7 @@ main(int argc, char *argv[])
#ifndef SMALL
if ((control_fd = control_init(csock)) == -1)
- fatalx("control socket setup failed");
+ warnx("control socket setup failed");
#endif /* SMALL */
if (pledge("stdio inet sendfd wroute", NULL) == -1)
@@ -272,7 +272,8 @@ main(int argc, char *argv[])
main_imsg_compose_frontend(IMSG_ROUTESOCK, frontend_routesock, NULL, 0);
#ifndef SMALL
- main_imsg_compose_frontend(IMSG_CONTROLFD, control_fd, NULL, 0);
+ if (control_fd != -1)
+ main_imsg_compose_frontend(IMSG_CONTROLFD, control_fd, NULL, 0);
#endif /* SMALL */
main_imsg_compose_frontend(IMSG_STARTUP, -1, NULL, 0);