-/* $OpenBSD: radiusctl.c,v 1.4 2015/08/25 01:21:57 yasuoka Exp $ */
+/* $OpenBSD: radiusctl.c,v 1.5 2015/10/19 22:07:37 yasuoka Exp $ */
/*
* Copyright (c) 2015 YASUOKA Masahiko <yasuoka@yasuoka.net>
*
case NONE:
break;
case TEST:
+ if (pledge("stdio dns inet", NULL) == -1)
+ err(EXIT_FAILURE, "pledge");
radius_test(result);
break;
}
-/* $OpenBSD: radiusd.c,v 1.8 2015/10/19 06:56:58 yasuoka Exp $ */
+/* $OpenBSD: radiusd.c,v 1.9 2015/10/19 22:07:37 yasuoka Exp $ */
/*
* Copyright (c) 2013 Internet Initiative Japan Inc.
if (radiusd_start(radiusd) != 0)
errx(EX_DATAERR, "start failed");
+#ifdef RADIUSD_DEBUG
+ if (pledge("stdio inet proc abort", NULL) == -1)
+ err(EXIT_FAILURE, "pledge");
+#else
+ if (pledge("stdio inet", NULL) == -1)
+ err(EXIT_FAILURE, "pledge");
+#endif
+
if (event_loop(0) < 0)
radiusd_stop(radiusd);
-/* $OpenBSD: radiusd_bsdauth.c,v 1.5 2015/10/19 07:58:28 yasuoka Exp $ */
+/* $OpenBSD: radiusd_bsdauth.c,v 1.6 2015/10/19 22:07:37 yasuoka Exp $ */
/*
* Copyright (c) 2015 YASUOKA Masahiko <yasuoka@yasuoka.net>
openlog(NULL, LOG_PID, LOG_DAEMON);
setproctitle("[priv]");
imsg_init(&ibuf, pipe_chld);
+
+ if (pledge("stdio getpw rpath proc exec", NULL) == -1)
+ err(EXIT_FAILURE, "pledge");
+
for (;;) {
if ((n = imsg_read(&ibuf)) <= 0)
break;
module_load(module_bsdauth.base);
imsg_init(&module_bsdauth.ibuf, pipe_prnt);
+
+ if (pledge("stdio proc", NULL) == -1)
+ err(EXIT_FAILURE, "pledge");
+
while (module_run(module_bsdauth.base) == 0)
;
-/* $OpenBSD: radiusd_radius.c,v 1.7 2015/08/02 21:27:27 yasuoka Exp $ */
+/* $OpenBSD: radiusd_radius.c,v 1.8 2015/10/19 22:07:37 yasuoka Exp $ */
/*
* Copyright (c) 2013 Internet Initiative Japan Inc.
module_load(module_radius.base);
log_init(0);
event_init();
+ if (pledge("stdio inet", NULL) == -1)
+ err(EXIT_FAILURE, "pledge");
module_start(module_radius.base);
event_loop(0);