summaryrefslogtreecommitdiffstats
path: root/server-client.c
diff options
context:
space:
mode:
authornicm <nicm>2019-12-16 16:39:03 +0000
committernicm <nicm>2019-12-16 16:39:03 +0000
commit1bdd4828bd0a13d6fb81c903078ad99ff2429b5d (patch)
tree8b7a92b596096fff6dc031ebab92ce55490a494b /server-client.c
parentb4520aaf2cb56cd14519e2df9d99ea6efc8ddd03 (diff)
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 'server-client.c')
-rw-r--r--server-client.c16
1 files changed, 0 insertions, 16 deletions
diff --git a/server-client.c b/server-client.c
index fdedc35f..ee7b4c70 100644
--- a/server-client.c
+++ b/server-client.c
@@ -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));
-}