Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
lua copy: preserve ownership during copy of files
Baptiste Daroussin committed 4 years ago
commit 20878604437f652e9488ec27e2f7ceea707ecb96
parent 7d17466
1 file changed +5 -1
modified libpkg/lua.c
@@ -220,7 +220,11 @@ lua_pkg_copy(lua_State *L)
	}

	if (!copy_file(fd1, fd2)) {
-
		lua_pushinteger(L, -1);
+
		lua_pushinteger(L, 2);
+
		return (1);
+
	}
+
	if (fchown(fd2, s1.st_uid, s1.st_gid) == -1) {
+
		lua_pushinteger(L, 2);
		return (1);
	}