From 17e23b10fd11cf6eb7a28d3d9a29ea7f1f37fa3a Mon Sep 17 00:00:00 2001 From: Sangyoon Jang Date: Thu, 24 Dec 2015 16:00:13 +0900 Subject: [PATCH] Fix db permission temporarily Change-Id: I760f68c48de986fe1ebf85087a045490245cced3 Signed-off-by: Sangyoon Jang --- parser/pkgmgr_parser_db.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/parser/pkgmgr_parser_db.c b/parser/pkgmgr_parser_db.c index 020f81e..c0162a8 100644 --- a/parser/pkgmgr_parser_db.c +++ b/parser/pkgmgr_parser_db.c @@ -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, ""); -- 2.7.4