Do not exit if pledge fails, just return with disabled sandbox

This commit is contained in:
pancake 2017-03-20 16:05:48 +01:00
parent 765fc56ec5
commit 94ec966936
2 changed files with 3 additions and 2 deletions

View File

@ -53,7 +53,8 @@
#undef MAXCOMLEN /* redefined in zipint.h */
#endif
#if (OpenBSD >= 201605) /* release >= 5.9 */
/* release >= 5.9 */
#if __OpenBSD__ && OpenBSD >= 201605
#define LIBC_HAVE_PLEDGE 1
#else
#define LIBC_HAVE_PLEDGE 0

View File

@ -106,7 +106,7 @@ R_API bool r_sandbox_enable (bool e) {
#if LIBC_HAVE_PLEDGE
if (enabled && pledge ("stdio rpath tty prot_exec", NULL) == -1) {
eprintf ("sandbox: pledge call failed\n");
exit (1);
return false;
}
#endif
return enabled;