Add pledge(2) support for OpenBSD
pledges for i3: "stdio rpath unix" for talking to the i3 socket usually in /tmp "proc exec" for executing programs "wpath cpath" are needed for the restart-in-place functionality To make this work, @semarie pointed out that it is sufficient to ensure that we get physical_mem_bytes only once, namely in init_logging(). pledges for i3-msg: "stdio rpath unix" are needed for talking to the i3-socket pledges for i3-nagbar "rpath getpw" to find the home directory "wpath cpath" to write the script "proc exec" to execute the script
This commit is contained in:
@ -119,6 +119,10 @@ static yajl_callbacks reply_callbacks = {
|
||||
};
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
#if defined(__OpenBSD__)
|
||||
if (pledge("stdio rpath unix", NULL) == -1)
|
||||
err(EXIT_FAILURE, "pledge");
|
||||
#endif
|
||||
char *env_socket_path = getenv("I3SOCK");
|
||||
if (env_socket_path)
|
||||
socket_path = sstrdup(env_socket_path);
|
||||
|
Reference in New Issue
Block a user