Skip to content

Commit

Permalink
lua: when copying a file, preserve the mode of the original one
Browse files Browse the repository at this point in the history
  • Loading branch information
bapt committed Jan 21, 2022
1 parent 0627523 commit 8d94fb9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libpkg/lua.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8d94fb9

Please sign in to comment.