File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 1
1
o = require (" openbsd" )
2
2
3
3
-- Test out unveil
4
- ret = o .unveil (" ." , " rwx" )
5
- print (" unveil: " .. ret )
4
+ ret , errstr = o .unveil (" ." , " rwx" )
5
+ print (" unveil:" , ret , errstr )
6
6
7
7
-- Same as pledge("rpath", NULL)
8
8
ret , s = o .pledge (" rpath stdio" )
9
- print (ret , s )
9
+ print (" pledge: " , ret , s )
10
10
11
11
-- Same as pledge("rpath stdio wpath", "rpath stdio")
12
12
ret , s = o .pledge (" rpath stdio wpath" , " rpath stdio" )
13
-
14
- print (ret , s )
13
+ print (" pledge:" , ret , s )
15
14
16
15
print (o .arc4random ())
17
16
Original file line number Diff line number Diff line change @@ -98,6 +98,11 @@ int lua_unveil(lua_State *L)
98
98
ret = unveil (path , mode );
99
99
lua_pushnumber (L , ret );
100
100
101
+ if (ret == -1 ) {
102
+ lua_pushstring (L , strerror (errno ));
103
+ return 2 ;
104
+ }
105
+
101
106
return 1 ;
102
107
}
103
108
You can’t perform that action at this time.
0 commit comments