summary refs log tree commit diff stats
path: root/results/scraper/launchpad-without-comments/1808563
blob: f68c6ad5088a4e68dcba908f1de386f81ff13be8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Listing the contents of / lists QEMU_LD_PREFIX instead

Seeing this in qemu-user version 3.1.0

Demo:
$ QEMU_LD_PREFIX=$(pwd)/usr/armv7a-cros-linux-gnueabi ../run/qemu-arm /tmp/coreutils --coreutils-prog=ls / 
etc  lib  usr
$ ls /
boot  etc   lib     lib64   lost+found  mnt    root  sbin  sys  usr
bin   dev   export  home    lib32       net    proc  run   tmp  var
$ ls usr/armv7a-cros-linux-gnueabi
etc  lib  usr

In strace, the openat for "/" is remapped to the directory specified in QEMU_LD_PREFIX:
[pid  5302] openat(AT_FDCWD, "/tmp/qemu/usr/armv7a-cros-linux-gnueabi", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3

As an aside, if I change the code to do chdir("/"); opendir("."); it works fine.