You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Passing nil to promises or execpromises prevents that value from being changed in the future (see pledge(2). I wanted to prevent both promises and execpromises from being further modified.
What did you expect to see?
For there to be a function to pass nil for both promises and execpromises, akin to unveil_openbsd.go's UnveilBlock().
What did you see instead?
Currently, to prevent future modification of promises and execpromises, you need to call PledgePromises(), which locks down execpromises, followed by PledgeExecpromises(), which locks down promises.
This is rather unwieldy and requires you to re-specify your current promises and execpromises (as passing "" to the above 2 functions would limit you to only being able to call _exit(2)).
The text was updated successfully, but these errors were encountered:
This program will execute successfully. From the manual you link:
Passing NULL to promises or execpromises specifies to not change the current value
This behavior is usually used to restrict one of the parameters without changing the other, for example restricting promises without changing the existing execpromises pledges. Therefore passing NULL to both arguments is essentially a no-op (ignoring things like restricting some ioctl requests which a program's first call to pledge does).
The blocking behavior of unveil is specific to that syscall. As far as I know, the pledge syscall provides no mechanism to restrict future calls to itself.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Passing nil to promises or execpromises prevents that value from being changed in the future (see
pledge(2)
. I wanted to prevent both promises and execpromises from being further modified.What did you expect to see?
For there to be a function to pass nil for both promises and execpromises, akin to unveil_openbsd.go's
UnveilBlock()
.What did you see instead?
Currently, to prevent future modification of promises and execpromises, you need to call
PledgePromises()
, which locks down execpromises, followed byPledgeExecpromises()
, which locks down promises.This is rather unwieldy and requires you to re-specify your current promises and execpromises (as passing
""
to the above 2 functions would limit you to only being able to call_exit(2)
).The text was updated successfully, but these errors were encountered: