diff options
author | SoonKyu Park <sk7.park@samsung.com> | 2016-07-29 11:41:58 +0900 |
---|---|---|
committer | SoonKyu Park <sk7.park@samsung.com> | 2016-07-29 11:41:58 +0900 |
commit | 273e681f8f5c851b8b52ddc6d86002e079c6f2da (patch) | |
tree | 16837d07a4bcacaec2873342ef65df1d0e9bce15 | |
parent | 74aac7e91f90770fc18a480bd881b92127ff2b50 (diff) | |
download | qemu-273e681f8f5c851b8b52ddc6d86002e079c6f2da.tar.gz qemu-273e681f8f5c851b8b52ddc6d86002e079c6f2da.tar.bz2 qemu-273e681f8f5c851b8b52ddc6d86002e079c6f2da.zip |
Revert "binfmt: translate symbolic file links before checking /emul"
This reverts commit 74aac7e91f90770fc18a480bd881b92127ff2b50.
-rw-r--r-- | linux-user/binfmt.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/linux-user/binfmt.c b/linux-user/binfmt.c index d8209281e..2a9009621 100644 --- a/linux-user/binfmt.c +++ b/linux-user/binfmt.c @@ -4,7 +4,6 @@ #include <libgen.h> #include <string.h> #include <stdlib.h> -#include <limits.h> int main(int argc, char **argv, char **envp) @@ -30,22 +29,10 @@ int main(int argc, char **argv, char **envp) /* Now argv[0] is the real qemu binary name */ { - int len; - int r; - char buf[PATH_MAX]; char *hostbin; - char *path; - - path = argv[1]; - - /* Follow symbolic link if any. */ - len = readlink(path, buf, sizeof(buf) - 1); - if (len > 0) { - buf[len] = 0; - path = buf; - } + int r; - r = asprintf(&hostbin, "/emul/%s", path); + r = asprintf(&hostbin, "/emul/%s", argv[1]); if (!access(hostbin, X_OK) && (r > 0)) { /* * We found a host binary replacement for the non-host binary. Let's |