[Release] wrt-installer_0.1.123
[platform/framework/web/wrt-installer.git] / src / jobs / widget_install / directory_api.cpp
index 678ec1d..5edcf4c 100644 (file)
@@ -22,6 +22,7 @@
 
 #include <directory_api.h>
 #include <sys/stat.h>
+#include <unistd.h>
 #include <dirent.h>
 #include <fstream>
 #include <dpl/log/log.h>
@@ -71,6 +72,8 @@ bool DirectoryCopy(std::string source, std::string dest)
             outfile << infile.rdbuf();
             outfile.close();
             infile.close();
+
+            chown(destFile.c_str(), statInfo.st_uid, statInfo.st_gid);
         }
     } while (dEntryResult != NULL && return_code == 0);
     closedir(dir);