Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
lua: when copying a file, preserve the mode of the original one
Baptiste Daroussin committed 4 years ago
commit 8d94fb9a73e2cbbb3eed3b2dc8d9b1728c906f6c
parent 0627523
1 file changed +1 -1
modified libpkg/lua.c
@@ -218,7 +218,7 @@ lua_pkg_copy(lua_State *L)
	 * bug is preventing us doing that
	 * See https://bugs.freebsd.org/250271
	 */
-
	fd2 = openat(rootfd, RELATIVE_PATH(dst), O_RDWR | O_CREAT | O_TRUNC | O_EXCL, DEFFILEMODE);
+
	fd2 = openat(rootfd, RELATIVE_PATH(dst), O_RDWR | O_CREAT | O_TRUNC | O_EXCL, s1.st_mode);
	if (fd2 == -1) {
		lua_pushinteger(L, 2);
		return (1);