aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2021-09-15 16:12:02 +0200
committerOmar Polo <op@omarpolo.com>2021-09-15 16:12:02 +0200
commit55ccd6d096be150da4ea2ad1d4aa6bd60059fb0f (patch)
tree86f7aa71a01caa7ff657074ea9bff91714ea669c
parent5d7c642a6671900ac3079d2dab6a28efa810d7bb (diff)
downloadtelescope-55ccd6d096be150da4ea2ad1d4aa6bd60059fb0f.tar.gz
telescope-55ccd6d096be150da4ea2ad1d4aa6bd60059fb0f.tar.bz2
propagate the safe_mode to the children
-rw-r--r--telescope.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/telescope.c b/telescope.c
index b48313b..bee4740 100644
--- a/telescope.c
+++ b/telescope.c
@@ -994,7 +994,7 @@ humanify_url(const char *raw, char *ret, size_t len)
static pid_t
start_child(enum telescope_process p, const char *argv0, int fd)
{
- const char *argv[4];
+ const char *argv[5];
int argc = 0;
pid_t pid;
@@ -1023,6 +1023,9 @@ start_child(enum telescope_process p, const char *argv0, int fd)
break;
}
+ if (safe_mode)
+ argv[argc++] = "-S";
+
argv[argc++] = NULL;
execvp(argv0, (char *const *)argv);
err(1, "execvp(%s)", argv0);