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

Oskar Skog <[email protected]> Tue, 4 Aug 2026 22:21:05 +0300
Newsgroups gmane.os.freebsd.questions
Message-ID <[email protected]>
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?