remove changing permission for ELM_PROFILE_CFG file 25/108525/1
authorYoungbok Shin <youngb.shin@samsung.com>
Thu, 5 Jan 2017 03:34:01 +0000 (12:34 +0900)
committerYoungbok Shin <youngb.shin@samsung.com>
Thu, 5 Jan 2017 03:38:47 +0000 (12:38 +0900)
It was a legacy code for old Tizen 2.x. The configure files for EFL
will be cared in each user sessions. So, we don't need to care
permisson and owner of the configure files.

Change-Id: Ia3d0b2efe917320ffc6976e3f1081363cb6488be

pkgmgr_font/src/font_service_register.c

index 3147a7d..55f072f 100755 (executable)
@@ -31,7 +31,6 @@
 #include <pkgmgr_installer_info.h>
 #include "system_settings.h"
 
-
 #define FONT_SERVICE_TAG               "FONT_SERVICE"
 #define DEBUG_LOG(frmt, args...)               \
        do { SLOG(LOG_DEBUG,FONT_SERVICE_TAG, "[font_service] %s: "frmt"\n",\
@@ -47,7 +46,6 @@ static const char *PARENT_PATH = "/opt/share/fonts";
 static const char *DOWNLOAD_PATH = "/opt/share/fonts/download";
 static const char *PRELOADED_PATH = "/opt/share/fonts/preloaded";
 
-static const char *ELM_PROFILE_CFG = "/opt/home/app/.elementary/config/profile.cfg";
 #define MAX_FILE_LEN 4096
 #define APP_OWNER_ID 5001
 #define APP_GROUP_ID 100
@@ -703,13 +701,14 @@ int COMMON_PKGMGR_PLUGIN_UNINSTALL(const char *pkgid, const char *appid, GList *
        if (fs)
        {
                int j;
+
                for (j = 0; j < fs->nfont; j++)
                {
                        FcChar8 *file = NULL;
                        if (FcPatternGetString(fs->fonts[j], FC_FILE, 0, &file) == FcResultMatch)
                        {
-                               DEBUG_LOG("file =%s\n",file);
-                               if (strncmp((const char*)file , deletedir , deletedir_len) == 0 )
+                               DEBUG_LOG("file =%s, deletedir =%s\n", file, deletedir);
+                               if (strncmp((const char*)file, deletedir, deletedir_len) == 0)
                                {
                                        DEBUG_LOG("change to default font\n");
                                        char *default_font_name = NULL;
@@ -722,8 +721,6 @@ int COMMON_PKGMGR_PLUGIN_UNINSTALL(const char *pkgid, const char *appid, GList *
                                        }
 
                                        DEBUG_LOG("default_font_name = %s \n",default_font_name);
-                                       setenv("HOME", "/opt/home/app", 1);
-
                                        ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_FONT_TYPE, default_font_name);
                                        if (ret < 0)
                                        {
@@ -732,46 +729,7 @@ int COMMON_PKGMGR_PLUGIN_UNINSTALL(const char *pkgid, const char *appid, GList *
                                                break;
                                        }
 
-                                       char *elm_profile_path = (char*)elm_config_profile_dir_get(elm_config_profile_get(), EINA_TRUE);
-
-                                       setenv("HOME", "/root", 1);
-
-                                       ret = chown(ELM_PROFILE_CFG, APP_OWNER_ID, APP_GROUP_ID);
-                                       if (ret < 0)
-                                       {
-                                               chmod (ELM_PROFILE_CFG, 0777);
-                                       }
-
-                                       DIR *d = NULL;
-                                       struct dirent *e;
-
-                                       if (elm_profile_path)
-                                               d = opendir (elm_profile_path);
-
-                                       if (d)
-                                       {
-                                               while ((e = readdir (d)))
-                                               {
-                                                       if (e->d_name[0] != '.' &&  (strstr(e->d_name, ".cfg") != 0 || strstr(e->d_name, ".CFG") != 0))
-                                                       {
-                                                               char file_full_path[100];
-
-                                                               sprintf(file_full_path, "%s/%s", elm_profile_path, e->d_name);
-
-                                                               ret = chown(file_full_path, APP_OWNER_ID, APP_GROUP_ID);
-                                                               if (ret < 0)
-                                                               {
-                                                                       DEBUG_LOG("chown is failed %s", file_full_path);
-                                                                       chmod (file_full_path, 0777);
-                                                               }
-                                                       }
-                                               }
-
-                                               closedir (d);
-                                       }
-
                                        free(default_font_name);
-                                       free(elm_profile_path);
                                        DEBUG_LOG("success change to default font\n");
                                        break;
                                }