Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Support of OpenBSD pledge(2) and unveil(2) in programming languages
@n0la

This comment has been minimized.

Copy link

@n0la n0la commented Apr 7, 2016

I also have a port for lua-openbsd here: luaports.

@NattyNarwhal

This comment has been minimized.

Copy link

@NattyNarwhal NattyNarwhal commented Apr 8, 2016

here's my C# version: (which can be used with any .NET language - F# and VB included) pledge.cs

@ligurio

This comment has been minimized.

Copy link
Owner Author

@ligurio ligurio commented Apr 8, 2016

@NattyNarwhal, thanks!

@msantos

This comment has been minimized.

Copy link

@msantos msantos commented Apr 9, 2016

And support for Erlang/Elixir/lfe! https://github.com/msantos/prx/wiki/prx#pledge-3

@absorber

This comment has been minimized.

Copy link

@absorber absorber commented Apr 10, 2016

Would be great if we would have something like this for Bash too.

@evhan

This comment has been minimized.

Copy link

@evhan evhan commented Apr 10, 2016

@netzbasis

This comment has been minimized.

Copy link

@netzbasis netzbasis commented Apr 10, 2016

@absorber, not Bash but ksh: netzbasis/openbsd-src@master...hf-ksh_builtin_pledge
Just for testing...

@ligurio

This comment has been minimized.

Copy link
Owner Author

@ligurio ligurio commented Apr 11, 2016

@evhan, added. Thanks!

@euantorano

This comment has been minimized.

@ligurio

This comment has been minimized.

Copy link
Owner Author

@ligurio ligurio commented Apr 13, 2016

@euantorano, added. Thanks!

@tvlooy

This comment has been minimized.

Copy link

@tvlooy tvlooy commented Nov 5, 2016

Pledge and unveil for PHP https://github.com/tvlooy/php-pledge

@ligurio

This comment has been minimized.

Copy link
Owner Author

@ligurio ligurio commented Nov 9, 2016

@tvlooy, added, thanks! :)

@tvlooy

This comment has been minimized.

Copy link

@tvlooy tvlooy commented Apr 10, 2019

Note that with PHP 7.4 you have FFI available and can call C functions without needing an extension:

$libc = FFI::cdef('
    int unveil(const char *path, const char *permissions);
', 'libc.so.92.5');

$libc->unveil(__DIR__, 'r');
@ligurio

This comment has been minimized.

Copy link
Owner Author

@ligurio ligurio commented Apr 29, 2019

@tvlooy, updated, thanks!

@eau-u4f

This comment has been minimized.

Copy link

@eau-u4f eau-u4f commented Apr 30, 2019

hello, unveil(2) is present for some in the x/sys, same place as pledge for the build of golang on openbsd, they recently updated the build tags and moved it to master: https://github.com/golang/sys/blob/master/unix/unveil_openbsd.go, same goes for pledge: https://github.com/golang/sys/blob/master/unix/pledge_openbsd.go, so i'd say "yes" / "yes" for both? hth

@tvlooy

This comment has been minimized.

Copy link

@tvlooy tvlooy commented Apr 30, 2019

actually with PHP 7.4 you can use pledge too. It's the same mechanism (FFI)

@ligurio

This comment has been minimized.

Copy link
Owner Author

@ligurio ligurio commented May 2, 2019

@eau-u4f, updated, thanks!
@tvlooy, added, thanks!

@netzbasis

This comment has been minimized.

Copy link

@netzbasis netzbasis commented May 4, 2019

ksh has a early version of unveil, too. Same branch as pledge.

@ligurio

This comment has been minimized.

Copy link
Owner Author

@ligurio ligurio commented May 6, 2019

@netzbasis, thanks, added. (looks like you have accidentally committed coredump file (echo.core))

@euantorano

This comment has been minimized.

Copy link

@euantorano euantorano commented Jan 21, 2020

Just a note that my Nim package supports unveil(2) as of v2.0.0.

@ligurio

This comment has been minimized.

Copy link
Owner Author

@ligurio ligurio commented Jan 22, 2020

@euantorano Added, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment