Unduplicate code 59/279259/1 accepted/tizen/unified/20220805.131908 submit/tizen/20220804.142848
authorMichal Bloch <m.bloch@samsung.com>
Thu, 4 Aug 2022 14:43:19 +0000 (16:43 +0200)
committerMichal Bloch <m.bloch@samsung.com>
Thu, 4 Aug 2022 14:43:19 +0000 (16:43 +0200)
Change-Id: Ic52222eb6157a5507689a3a91f6103d13de5ca02
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
sessiond/src/fs_helpers.cpp

index 51b93b2..2f8f2d1 100644 (file)
@@ -71,11 +71,7 @@ void fs_helpers::copy_ownership(std::string_view src_path, std::string_view dest
                        + src_path.data()
                        + "` file/directory");
 
-       if (chown(dest_path.data(), info.st_uid, info.st_gid) == -1)
-               throw std::system_error(errno, std::system_category(),
-                       "Couldn't set owner/group of the `"s
-                       + dest_path.data()
-                       + "` file/directory");
+       change_owner_and_group(dest_path, info.st_uid, info.st_gid);
 }
 
 std::string fs_helpers::get_smack_label(std::string_view src_path, smack_label_type type)