diff options
author | 2019-12-16 16:39:03 +0000 | |
---|---|---|
committer | 2019-12-16 16:39:03 +0000 | |
commit | 80659a0f68fe6fb5491096133a09e408eb2e2869 (patch) | |
tree | 854b246182ddcc4e407055379e31604b4117af68 /usr.bin/tmux/server-client.c | |
parent | Update to bind-9.10.5-P3, which appears to have been the last ISC version. (diff) | |
download | wireguard-openbsd-80659a0f68fe6fb5491096133a09e408eb2e2869.tar.xz wireguard-openbsd-80659a0f68fe6fb5491096133a09e408eb2e2869.zip |
If /dev/fd/X is a symlink and realpath() expands symlinks, /dev/fd/X
ends up pointing to the wrong place before it is passed to the client.
The path is only used internally so there is no real need for
realpath(), remove it and move the get_path function to file.c where all
the callers are.
Diffstat (limited to 'usr.bin/tmux/server-client.c')
-rw-r--r-- | usr.bin/tmux/server-client.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c index 78a379cfdc9..6a7d1d3fee0 100644 --- a/usr.bin/tmux/server-client.c +++ b/usr.bin/tmux/server-client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server-client.c,v 1.301 2019/12/16 15:48:50 nicm Exp $ */ +/* $OpenBSD: server-client.c,v 1.302 2019/12/16 16:39:03 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -2111,19 +2111,3 @@ server_client_get_cwd(struct client *c, struct session *s) return (home); return ("/"); } - -/* Resolve an absolute path or relative to client working directory. */ -char * -server_client_get_path(struct client *c, const char *file) -{ - char *path, resolved[PATH_MAX]; - - if (*file == '/') - path = xstrdup(file); - else - xasprintf(&path, "%s/%s", server_client_get_cwd(c, NULL), file); - if (realpath(path, resolved) == NULL) - return (path); - free(path); - return (xstrdup(resolved)); -} |