X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=st.c;h=76bb3eafbe0ba110af5c85465f3a40906cf5f886;hb=4f4bccd1627c845330235721f593d2e93418723d;hp=0628707eae4bc351c483caf7477782d8273203b4;hpb=041912a791e8c2f4d5d2415b16210d29d7e701c5;p=st.git diff --git a/st.c b/st.c index 0628707..76bb3ea 100644 --- a/st.c +++ b/st.c @@ -806,9 +806,17 @@ ttynew(char *line, char *cmd, char *out, char **args) die("ioctl TIOCSCTTY failed: %s\n", strerror(errno)); close(s); close(m); +#ifdef __OpenBSD__ + if (pledge("stdio getpw proc exec", NULL) == -1) + die("pledge\n"); +#endif execsh(cmd, args); break; default: +#ifdef __OpenBSD__ + if (pledge("stdio rpath tty proc", NULL) == -1) + die("pledge\n"); +#endif close(s); cmdfd = m; signal(SIGCHLD, sigchld);