Linuxulator: /var/games/foo refers to a different file when reading vs writing

1 view
Skip to first unread message

Oskar Skog

unread,
Aug 4, 2026, 3:22:45 PM (5 days ago) Aug 4
to freebsd-...@freebsd.org
Both /var/games and /compat/linux/var/games exist
15.1-RELEASE-p2
linux_base-rl9


If I create a file in /var/games it can be opened for reading in Linux
processes, but if I try to open it for writing it will instead try to
create a new file in /compat/linux/var/games.


Setup from FreeBSD:
# echo test > /var/games/foo
# chmod 666 /var/games/foo


Trying reading/writing as unprivileged user in a Linux process:

$ pypy3 # Linux version
>>>> open('/var/games/foo').read()
'test\n'
>>>> f = open('/var/games/foo', 'w')
Traceback ...
PermissionError: [Errno 13] Permission denied: '/var/games/foo'


Trying reading/writing as root in a Linux process:

# pypy3
>>>> open('/var/games/foo').read()
'test\n'
>>>> f = open('/var/games/foo', 'w')
>>>> f.write('testtesttest\n')
13
>>>> f.close()

$ ls -l /var/games/foo /compat/linux/var/games/foo
-rw-r--r-- 1 root wheel 13 Aug 4 20:25 /compat/linux/var/games/foo
-rw-rw-rw- 1 root games 5 Aug 4 20:24 /var/games/foo


Is that supposed to happen?

Reply all
Reply to author
Forward
0 new messages