Date: Tue, 6 Dec 2016 23:29:16 +0200 From: Andriy Gapon <avg@FreeBSD.org> To: Tijl Coosemans <tijl@FreeBSD.org> Cc: freebsd-emulation@FreeBSD.org Subject: Re: /compat/linux/dev and an odd program Message-ID: <5286e838-f730-c5ff-9d25-119d1ededd23@FreeBSD.org> In-Reply-To: <20161206195520.367929e9@kalimero.tijl.coosemans.org> References: <1668707b-3f94-ccc4-068c-04869620b4f4@FreeBSD.org> <20161206195520.367929e9@kalimero.tijl.coosemans.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 06/12/2016 20:55, Tijl Coosemans wrote: > On Tue, 6 Dec 2016 18:49:06 +0200 Andriy Gapon <avg@FreeBSD.org> wrote: >> I have an old binary-only Linux program that, for whatever reason, opens >> /dev/null with O_CREAT flag (O_WRONLY | O_CREAT | O_TRUNC). That works fine >> when there is no /compat/linux/dev: the code in kern_alternate_path() sees that >> the directory does not exist, strips /compat/linux prefix and, so, the real >> /dev/null is found. But typically, if linux_base is installed, there is >> /compat/linux/dev directory, because of /compat/linux/dev/shm/. The code will >> see the directory and, thus, it will try to open /compat/linux/dev/null. But >> there is no such file, so it will try to create it. And fail with EPERM for a >> non-privileged user. >> >> I wonder if anyone has thoughts or suggestions on this situation. >> Either an administrative solution or a code change would be fine for me. >> Thanks! > > Try creating this symlink: > > ln -s /dev/null /compat/linux/dev/null > That does the job, thank you! -- Andriy Gapon
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5286e838-f730-c5ff-9d25-119d1ededd23>