Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
When openning a file, in case of creation, use the default mode as stated in sys/stat.h
Baptiste Daroussin committed 6 years ago
commit bef5fac81bb88495d3ebf2a5249d411a466124da
parent 917e4b4
1 file changed +2 -1
modified libpkg/lua_scripts.c
@@ -34,6 +34,7 @@
#include <sys/capsicum.h>
#endif

+
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/wait.h>

@@ -155,7 +156,7 @@ lua_io_open(lua_State *L)
	luaL_Stream *p = newfile(L);
	const char *md = mode;
	luaL_argcheck(L, checkflags(md, &oflags), 2, "invalid mode");
-
	int fd = openat(pkg->rootfd, RELATIVE_PATH(filename), oflags);
+
	int fd = openat(pkg->rootfd, RELATIVE_PATH(filename), oflags, DEFFILEMODE);
	if (fd == -1)
		return (1);
	p->f = fdopen(fd, mode);