From bb9d62fda5d3511d76b07b19b6af80adcf049483 Mon Sep 17 00:00:00 2001 From: jca Date: Sun, 25 Oct 2015 21:23:42 +0000 Subject: [PATCH] Stop writing down a pidfile. pid files aren't useful on OpenBSD, the rc.d(8) framework doesn't use them. In rtadvd, not writing a pid file means that we can set tighter pledge(2) settings. Also the pid file handling is pretty basic and the atexit handler can't remove the pid file since rtadvd did a chroot - beurk. ok florian@, "perfect" deraadt@ (!) --- usr.sbin/rtadvd/Makefile | 4 +--- usr.sbin/rtadvd/rtadvd.8 | 9 +++------ usr.sbin/rtadvd/rtadvd.c | 7 +------ 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/usr.sbin/rtadvd/Makefile b/usr.sbin/rtadvd/Makefile index c9df9e0ae7f..e56e5af76fb 100644 --- a/usr.sbin/rtadvd/Makefile +++ b/usr.sbin/rtadvd/Makefile @@ -1,11 +1,9 @@ -# $OpenBSD: Makefile,v 1.6 2008/04/21 20:40:55 rainer Exp $ +# $OpenBSD: Makefile,v 1.7 2015/10/25 21:23:42 jca Exp $ PROG= rtadvd SRCS= rtadvd.c rrenum.c advcap.c if.c config.c timer.c dump.c log.c CFLAGS+=-Wall -LDADD+= -lutil -DPADD+= ${LIBUTIL} MAN= rtadvd.8 rtadvd.conf.5 .include diff --git a/usr.sbin/rtadvd/rtadvd.8 b/usr.sbin/rtadvd/rtadvd.8 index c693ad97d8d..e826aeaad9c 100644 --- a/usr.sbin/rtadvd/rtadvd.8 +++ b/usr.sbin/rtadvd/rtadvd.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: rtadvd.8,v 1.31 2015/06/02 16:02:45 sobrado Exp $ +.\" $OpenBSD: rtadvd.8,v 1.32 2015/10/25 21:23:42 jca Exp $ .\" $KAME: rtadvd.8,v 1.18 2002/04/28 10:43:02 jinmei Exp $ .\" .\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -28,7 +28,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd $Mdocdate: June 2 2015 $ +.Dd $Mdocdate: October 25 2015 $ .Dt RTADVD 8 .Os .Sh NAME @@ -147,12 +147,9 @@ will transmit router advertisement with router lifetime 0 to all the interfaces .Pq in accordance with RFC 4861 6.2.5 . .Sh FILES -.Bl -tag -width "/var/run/rtadvd.pidXX" -compact +.Bl -tag -width "/etc/rtadvd.conf" -compact .It Pa /etc/rtadvd.conf The default configuration file. -.It Pa /var/run/rtadvd.pid -Contains the PID of the currently running -.Nm . .El .Sh EXIT STATUS .Ex -std rtadvd diff --git a/usr.sbin/rtadvd/rtadvd.c b/usr.sbin/rtadvd/rtadvd.c index 52484d1b2eb..1f3e9900a62 100644 --- a/usr.sbin/rtadvd/rtadvd.c +++ b/usr.sbin/rtadvd/rtadvd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtadvd.c,v 1.55 2015/08/20 22:39:29 deraadt Exp $ */ +/* $OpenBSD: rtadvd.c,v 1.56 2015/10/25 21:23:42 jca Exp $ */ /* $KAME: rtadvd.c,v 1.66 2002/05/29 14:18:36 itojun Exp $ */ /* @@ -55,7 +55,6 @@ #include #include #include -#include #include #include "rtadvd.h" @@ -224,10 +223,6 @@ main(argc, argv) sock_open(); - /* record the current PID */ - if (pidfile(NULL) < 0) - log_warnx("failed to open the pid log file, run anyway."); - if (sflag == 0) { rtsock_open(); } -- 2.20.1