-/* $OpenBSD: engine.c,v 1.71 2021/03/21 18:25:24 florian Exp $ */
+/* $OpenBSD: engine.c,v 1.72 2021/05/01 11:53:06 florian Exp $ */
/*
* Copyright (c) 2017 Florian Obser <florian@openbsd.org>
if ((pw = getpwnam(SLAACD_USER)) == NULL)
fatal("getpwnam");
- if (chroot(pw->pw_dir) == -1)
- fatal("chroot");
if (chdir("/") == -1)
fatal("chdir(\"/\")");
+ if (unveil("/", "") == -1)
+ fatal("unveil(\"/\", \"\")");
+ if (unveil(NULL, NULL) == -1)
+ fatal("unveil(NULL, NULL)");
+
setproctitle("%s", "engine");
log_procinit("engine");
-/* $OpenBSD: frontend.c,v 1.55 2021/03/21 18:25:24 florian Exp $ */
+/* $OpenBSD: frontend.c,v 1.56 2021/05/01 11:53:06 florian Exp $ */
/*
* Copyright (c) 2017 Florian Obser <florian@openbsd.org>
if ((pw = getpwnam(SLAACD_USER)) == NULL)
fatal("getpwnam");
- if (chroot(pw->pw_dir) == -1)
- fatal("chroot");
if (chdir("/") == -1)
fatal("chdir(\"/\")");
+ if (unveil("/", "") == -1)
+ fatal("unveil(\"/\", \"\")");
+ if (unveil(NULL, NULL) == -1)
+ fatal("unveil(NULL, NULL)");
+
setproctitle("%s", "frontend");
log_procinit("frontend");