From: ilho kim Date: Tue, 18 Apr 2023 08:40:40 +0000 (+0900) Subject: Fix grant ownership when perfoming resource coping X-Git-Tag: accepted/tizen/unified/20230425.175845~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8f32288daef1affebe66765e91072093eb59fb8c;p=platform%2Fcore%2Fappfw%2Fpkgmgr-tool.git Fix grant ownership when perfoming resource coping When copying the directory, ownership was not granted Change-Id: Ie77919296eaef5a92b3994efdb52be9ec9003189 Signed-off-by: ilho kim --- diff --git a/src/res-copy/src/file_util.cc b/src/res-copy/src/file_util.cc index 1a8eb2e..0d8d504 100644 --- a/src/res-copy/src/file_util.cc +++ b/src/res-copy/src/file_util.cc @@ -149,6 +149,10 @@ bool CopyDir(const boost::filesystem::path& src, bf::rename(destination, target); } + + if (!SetDirOwnershipAndPermissions( + destination, kDirectoryMode650, kRootUID, kPrivPlatformGid)) + return false; } } catch (const bf::filesystem_error& error) { LOG(ERROR) << "Failed to copy directory: " << error.what();