Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Apr 2026 19:47:15 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 294780] fexecve(2) only works for scripts if /dev/fd is mounted with the non-default nodup option.
Message-ID:  <bug-294780-227-Zb1fsBwhyZ@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-294780-227@https.bugs.freebsd.org/bugzilla/>

index | next in thread | previous in thread | raw e-mail

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294780

--- Comment #6 from Jan Bramkamp <crest@bultmann.eu> ---
I couldn't sleep and you're right. I had a stupid bug in my faccessat(2) based
attempt. I used !! instead of a single ! to convert the return value to bool.

Opening the file for reading, checking if it should be executeable with
faccessat(O_EMPTY_PATH) then using fexecve() with a read only descriptor works. 

Sorry for taking up your time with my mistakes. No change to the mutally
exclusive nature of O_RDONLY/O_WRONLY/O_RDWR/O_EXEC is needed because the
kernel accepts both a O_RDONLY and O_EXEC. A hint not to use O_EXEC unless you
really have an executable that isn't also readable to the process opening it
would be helpful.

-- 
You are receiving this mail because:
You are the assignee for the bug.

home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-294780-227-Zb1fsBwhyZ>