From: Ilho Kim Date: Mon, 27 Jul 2020 10:35:02 +0000 (+0900) Subject: Set ownership and permission while installing user package X-Git-Tag: accepted/tizen/unified/20200811.050444~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F29%2F239529%2F2;p=platform%2Fcore%2Fappfw%2Fapp-installers.git Set ownership and permission while installing user package Change-Id: I31db65fc6162bea8f70baacc6c95c70956311e9c Signed-off-by: Ilho Kim --- diff --git a/src/common/shared_dirs.cc b/src/common/shared_dirs.cc index 88f1673..447ce05 100644 --- a/src/common/shared_dirs.cc +++ b/src/common/shared_dirs.cc @@ -599,6 +599,15 @@ bool CreateStorageDirectories(const boost::filesystem::path& path, if (!::SetPackageDirectoryOwnerAndPermissions(path / pkgid, uid)) return false; + if (shareddata) { + std::vector shared_dirs(kSharedDataEntries); + for (auto entry : shared_dirs) { + bf::path shared_dst = path / entry / pkgid; + if (!::SetPackageDirectoryOwnerAndPermissions(shared_dst, uid)) + return false; + } + } + std::string error_message; if (!RegisterSecurityContextForPath(pkgid, path / pkgid, uid, false, &error_message)) {