Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Apr 2026 19:29:58 +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-uGwfbXkNP2@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 #5 from Kyle Evans <kevans@freebsd.org> ---
(In reply to Jan Bramkamp from comment #4)

Thanks.  In the meantime, looking at the fexecve(2) docs:

     The fexecve() ignores the file offset of fd.  Since execute permission is
     checked by fexecve(), the file descriptor fd need not have been opened
     with the O_EXEC flag.  However, if the file to be executed denies read
     permission for the process preparing to do the exec, the only way to
     provide the fd to fexecve() is to use the O_EXEC flag when opening fd.
     Note that the file to be executed can not be open for writing.

I agree that we could seize the opportunity to explicitly mention the
interpreter problem here as a reason one might not want O_EXEC.

-- 
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-uGwfbXkNP2>