mirror of
https://github.com/tmate-io/tmate.git
synced 2024-11-23 00:23:08 +01:00
__OpenBSD__ around pledge()
This commit is contained in:
parent
3e0d31c4e9
commit
91f53d590b
3
server.c
3
server.c
@ -177,10 +177,11 @@ server_start(struct event_base *base, int lockfd, char *lockfile)
|
|||||||
}
|
}
|
||||||
close(pair[0]);
|
close(pair[0]);
|
||||||
|
|
||||||
|
#ifdef __OpenBSD__
|
||||||
if (pledge("stdio rpath wpath cpath fattr unix recvfd proc exec tty "
|
if (pledge("stdio rpath wpath cpath fattr unix recvfd proc exec tty "
|
||||||
"ps", NULL) != 0)
|
"ps", NULL) != 0)
|
||||||
fatal("pledge failed");
|
fatal("pledge failed");
|
||||||
|
#endif
|
||||||
/*
|
/*
|
||||||
* Must daemonise before loading configuration as the PID changes so
|
* Must daemonise before loading configuration as the PID changes so
|
||||||
* $TMUX would be wrong for sessions created in the config file.
|
* $TMUX would be wrong for sessions created in the config file.
|
||||||
|
2
tmux.c
2
tmux.c
@ -259,9 +259,11 @@ main(int argc, char **argv)
|
|||||||
if (shell_cmd != NULL && argc != 0)
|
if (shell_cmd != NULL && argc != 0)
|
||||||
usage();
|
usage();
|
||||||
|
|
||||||
|
#ifdef __OpenBSD__
|
||||||
if (pledge("stdio rpath wpath cpath flock fattr unix sendfd recvfd "
|
if (pledge("stdio rpath wpath cpath flock fattr unix sendfd recvfd "
|
||||||
"proc exec tty ps", NULL) != 0)
|
"proc exec tty ps", NULL) != 0)
|
||||||
err(1, "pledge");
|
err(1, "pledge");
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!(flags & CLIENT_UTF8)) {
|
if (!(flags & CLIENT_UTF8)) {
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user