Fix grant ownership when perfoming resource coping 57/291557/1
authorilho kim <ilho159.kim@samsung.com>
Tue, 18 Apr 2023 08:40:40 +0000 (17:40 +0900)
committerilho kim <ilho159.kim@samsung.com>
Tue, 18 Apr 2023 08:40:40 +0000 (17:40 +0900)
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 1a8eb2e..0d8d504 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();