Drop exec capability iff restricted

Nothing must be executed when running /copy, et al.
このコミットが含まれているのは:
Klemens Nanni 2021-01-22 22:02:01 +01:00 committed by C. McEnroe
コミット 837c9efce4

7
chat.c
ファイルの表示

@ -340,6 +340,13 @@ int main(int argc, char *argv[]) {
fcntl(execPipe[1], F_SETFD, FD_CLOEXEC); fcntl(execPipe[1], F_SETFD, FD_CLOEXEC);
} }
#ifdef __OpenBSD__
if (self.restricted) {
error = pledge("stdio rpath wpath cpath tty", NULL);
if (error) err(EX_OSERR, "pledge");
}
#endif
struct pollfd fds[] = { struct pollfd fds[] = {
{ .events = POLLIN, .fd = STDIN_FILENO }, { .events = POLLIN, .fd = STDIN_FILENO },
{ .events = POLLIN, .fd = irc }, { .events = POLLIN, .fd = irc },