summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-if-shell.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2015-10-31 08:13:58 +0000
committernicm <nicm@openbsd.org>2015-10-31 08:13:58 +0000
commit3baa4a0c87c984716fa2bde8c3c85ab9031b05d8 (patch)
treed4a7ae30f3f6f078addaedda2c627e1216b270d9 /usr.bin/tmux/cmd-if-shell.c
parentsync (diff)
downloadwireguard-openbsd-3baa4a0c87c984716fa2bde8c3c85ab9031b05d8.tar.xz
wireguard-openbsd-3baa4a0c87c984716fa2bde8c3c85ab9031b05d8.zip
Because pledge(2) does not allow us to pass directory file descriptors
around, we can't use file descriptors for the working directory because we will be unable to pass it to a privileged process to tell it where to read or write files or spawn children. So move tmux back to using strings for the current working directory. We try to check it exists with access() when it is set but ultimately fall back to ~ if it fails at time of use (or / if that fails too).
Diffstat (limited to 'usr.bin/tmux/cmd-if-shell.c')
-rw-r--r--usr.bin/tmux/cmd-if-shell.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/tmux/cmd-if-shell.c b/usr.bin/tmux/cmd-if-shell.c
index fdac5bd188e..2154afafce6 100644
--- a/usr.bin/tmux/cmd-if-shell.c
+++ b/usr.bin/tmux/cmd-if-shell.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-if-shell.c,v 1.33 2015/09/16 22:24:54 nicm Exp $ */
+/* $OpenBSD: cmd-if-shell.c,v 1.34 2015/10/31 08:13:58 nicm Exp $ */
/*
* Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org>
@@ -66,7 +66,7 @@ cmd_if_shell_exec(struct cmd *self, struct cmd_q *cmdq)
struct winlink *wl = NULL;
struct window_pane *wp = NULL;
struct format_tree *ft;
- int cwd;
+ const char *cwd;
if (args_has(args, 't')) {
wl = cmd_find_pane(cmdq, args_get(args, 't'), &s, &wp);
@@ -83,7 +83,7 @@ cmd_if_shell_exec(struct cmd *self, struct cmd_q *cmdq)
else if (s != NULL)
cwd = s->cwd;
else
- cwd = -1;
+ cwd = NULL;
}
ft = format_create();