Commit 6099f3b0 authored by topjohnwu's avatar topjohnwu

Always resolve to canonical path

parent a5cc3178
...@@ -192,9 +192,11 @@ void install_module(const char *file) { ...@@ -192,9 +192,11 @@ void install_module(const char *file) {
if (access(file, F_OK)) if (access(file, F_OK))
abort(stderr, "'%s' does not exist", file); abort(stderr, "'%s' does not exist", file);
char *zip = realpath(file, nullptr);
setenv("OUTFD", "1", 1); setenv("OUTFD", "1", 1);
setenv("ZIPFILE", file, 1); setenv("ZIPFILE", zip, 1);
setenv("ASH_STANDALONE", "1", 1); setenv("ASH_STANDALONE", "1", 1);
free(zip);
int fd = xopen("/dev/null", O_RDONLY); int fd = xopen("/dev/null", O_RDONLY);
xdup2(fd, STDERR_FILENO); xdup2(fd, STDERR_FILENO);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment