Change chown to lchown 62/81862/1 accepted/tizen/common/20160817.133235 accepted/tizen/common/20160818.144510 accepted/tizen/ivi/20160819.063350 accepted/tizen/mobile/20160819.063214 accepted/tizen/tv/20160819.063333 accepted/tizen/wearable/20160819.063314 submit/tizen/20160817.084623 submit/tizen/20160818.060816
authorYunmi Ha <yunmi.ha@samsung.com>
Fri, 29 Jul 2016 01:14:41 +0000 (10:14 +0900)
committerYunmi Ha <yunmi.ha@samsung.com>
Fri, 29 Jul 2016 01:14:41 +0000 (10:14 +0900)
For dereferencing symbolic link when copy home(skel) directory,
change the api.

Change-Id: Ibc67cab8dc3ca91afdd0d27f631e206ce961c9c6
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
src/common/gum-file.c

index fc071c2..abfc2d9 100755 (executable)
@@ -167,7 +167,7 @@ _copy_file_attributes (
 
     if (stat (from_path, &from_stat) < 0 ||
         chmod (to_path, from_stat.st_mode) < 0 ||
-        chown (to_path, from_stat.st_uid, from_stat.st_gid) < 0) {
+        lchown (to_path, from_stat.st_uid, from_stat.st_gid) < 0) {
         return FALSE;
     }
 
@@ -759,7 +759,7 @@ _copy_dir_recursively (
                     GUM_CONFIG_GENERAL_SMACK64_USER_FILES);
         }
         if (!stop) stop = !_copy_file_attributes (src_filepath, dest_filepath);
-        if (!stop) stop = (chown (dest_filepath, uid, gid) < 0);
+        if (!stop) stop = (lchown (dest_filepath, uid, gid) < 0);
 
 _free_data:
         g_free (src_filepath);
@@ -839,7 +839,7 @@ gum_file_create_home_dir (
         uid = getuid ();
         gid = getgid ();
 #endif
-        if (chown (home_dir, uid, gid) < 0) {
+        if (lchown (home_dir, uid, gid) < 0) {
             GUM_RETURN_WITH_ERROR (GUM_ERROR_HOME_DIR_CREATE_FAILURE,
                     "Home directory chown failure", error, FALSE);
         }