Fix db permission temporarily 17/55517/2 accepted/tizen/mobile/20151224.102655 accepted/tizen/tv/20151224.102712 accepted/tizen/wearable/20151224.102731 submit/tizen/20151224.071904 submit/tizen_common/20151229.142028 submit/tizen_common/20151229.144031 submit/tizen_common/20151229.154718
authorSangyoon Jang <s89.jang@samsung.com>
Thu, 24 Dec 2015 07:00:13 +0000 (16:00 +0900)
committerSangyoon Jang <s89.jang@samsung.com>
Thu, 24 Dec 2015 07:12:23 +0000 (16:12 +0900)
Change-Id: I760f68c48de986fe1ebf85087a045490245cced3
Signed-off-by: Sangyoon Jang <s89.jang@samsung.com>
parser/pkgmgr_parser_db.c

index 020f81e..c0162a8 100644 (file)
@@ -1663,6 +1663,7 @@ static int __parserdb_change_perm(const char *db_file, uid_t uid)
        files[0] = (char *)db_file;
        files[1] = journal_file;
        files[2] = NULL;
+       mode_t mode;
 
        if (db_file == NULL)
                return -1;
@@ -1689,7 +1690,10 @@ static int __parserdb_change_perm(const char *db_file, uid_t uid)
                        return -1;
                }
 
-               ret = chmod(files[i], S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
+               mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH;
+               if (!strcmp(db_file, getUserPkgCertDBPathUID(GLOBAL_USER)))
+                       mode |= S_IWOTH;
+               ret = chmod(files[i], mode);
                if (ret == -1) {
                        if (strerror_r(errno, buf, sizeof(buf)))
                                strcpy(buf, "");