From 64bee8acfc875fee19db3ec2ae721635ce2b8ab4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ketelaars?= Date: Sat, 27 Jul 2019 20:05:54 +0200 Subject: [PATCH] Reduce number of pledge(2) promises (OpenBSD only) Restrict spectrwm even further following work from matthieu@ on font caches: https://undeadly.org/cgi?action=article;sid=20180717074543 --- spectrwm.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/spectrwm.c b/spectrwm.c index 725dc6b..bb8b717 100644 --- a/spectrwm.c +++ b/spectrwm.c @@ -1433,7 +1433,7 @@ expand_tilde(const char *s) ppwd = strlen(user) == 0 ? getpwuid(getuid()) : getpwnam(user); free(user); - if (pledge("stdio proc exec cpath rpath wpath fattr", NULL) == -1) + if (pledge("stdio proc exec rpath", NULL) == -1) err(1, "pledge"); if (ppwd == NULL) @@ -13258,8 +13258,7 @@ main(int argc, char *argv[]) if (setlocale(LC_CTYPE, "") == NULL || setlocale(LC_TIME, "") == NULL) warnx("no locale support"); - if (pledge("stdio proc exec cpath rpath wpath fattr getpw dns inet " - "unix", NULL) == -1) + if (pledge("stdio proc exec rpath getpw dns inet unix", NULL) == -1) err(1, "pledge"); /* handle some signals */ @@ -13279,8 +13278,7 @@ main(int argc, char *argv[]) if ((display = XOpenDisplay(0)) == NULL) errx(1, "can not open display"); - if (pledge("stdio proc exec cpath rpath wpath fattr getpw", - NULL) == -1) + if (pledge("stdio proc exec rpath getpw", NULL) == -1) err(1, "pledge"); conn = XGetXCBConnection(display);