Fix grant ownership when perfoming resource coping
authorilho kim <ilho159.kim@samsung.com>
Tue, 18 Apr 2023 08:40:40 +0000 (17:40 +0900)
committerŁukasz Stelmach <l.stelmach@samsung.com>
Thu, 27 Apr 2023 18:44:48 +0000 (20:44 +0200)
When copying the directory, ownership was not granted

Change-Id: Ie77919296eaef5a92b3994efdb52be9ec9003189
Signed-off-by: ilho kim <ilho159.kim@samsung.com>
src/res-copy/src/file_util.cc

index 1a8eb2ee316ae44a2e4559f27f6408caa531e326..0d8d50438011f838954d740ba67f0f8b1fbc5281 100644 (file)
@@ -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();