From 5c4104ea0e47493db1ad0e21c83e1fe948a8f6e4 Mon Sep 17 00:00:00 2001 From: Junghyun Yeon Date: Tue, 31 Aug 2021 11:23:56 +0900 Subject: [PATCH] Change permission of directories being created or copied Change-Id: I2b72706dfd2f95f779d2446e5cc83ef0ac35a480 Signed-off-by: Junghyun Yeon --- src/res-copy/src/file_util.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/res-copy/src/file_util.cc b/src/res-copy/src/file_util.cc index b823839..1a8eb2e 100644 --- a/src/res-copy/src/file_util.cc +++ b/src/res-copy/src/file_util.cc @@ -38,6 +38,7 @@ namespace { constexpr uid_t kRootUID = 0; constexpr gid_t kPrivPlatformGid = 10212; constexpr mode_t kDefaultMode640 = S_IRUSR | S_IWUSR | S_IRGRP; +constexpr mode_t kDirectoryMode650 = S_IRUSR | S_IWUSR | S_IRGRP | S_IXGRP; } // namespace @@ -171,7 +172,7 @@ bool CreateDir(const bf::path& path) { } if (!SetDirOwnershipAndPermissions( - path, kDefaultMode640, kRootUID, kPrivPlatformGid)) + path, kDirectoryMode650, kRootUID, kPrivPlatformGid)) return false; return true; @@ -238,14 +239,14 @@ bool CreateDirs( while(target_path.filename() != pkgid) { if (!SetDirOwnershipAndPermissions( - target_path, kDefaultMode640, kRootUID, kPrivPlatformGid)) + target_path, kDirectoryMode650, kRootUID, kPrivPlatformGid)) return false; target_path = target_path.parent_path(); } if (!SetDirOwnershipAndPermissions( - target_path, kDefaultMode640, kRootUID, kPrivPlatformGid)) + target_path, kDirectoryMode650, kRootUID, kPrivPlatformGid)) return false; return true; -- 2.34.1