From ff1909e7f4fe1fdf41ac0e428682b42a89040627 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ketelaars?= Date: Thu, 8 Nov 2018 05:03:51 +0100 Subject: [PATCH] pledge() earlier --- spectrwm.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/spectrwm.c b/spectrwm.c index bc9bfe5..a41b122 100644 --- a/spectrwm.c +++ b/spectrwm.c @@ -1360,6 +1360,9 @@ 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) + err(1, "pledge"); + if (ppwd == NULL) result = strdup(sc); else @@ -3117,6 +3120,9 @@ xft_init(struct swm_region *r) free(str); } + if (pledge("stdio proc exec", NULL) == -1) + err(1, "pledge"); + if (bar_font == NULL) errx(1, "unable to open a font"); @@ -12606,9 +12612,6 @@ noconfig: if (cfile) conf_load(cfile, SWM_CONF_DEFAULT); - if (pledge("stdio proc exec cpath rpath wpath fattr", NULL) == -1) - err(1, "pledge"); - validate_spawns(); if (getenv("SWM_STARTED") == NULL) @@ -12620,9 +12623,6 @@ noconfig: TAILQ_FOREACH(r, &screens[i].rl, entry) bar_setup(r); - if (pledge("stdio proc exec", NULL) == -1) - err(1, "pledge"); - /* Manage existing windows. */ grab_windows();