diff options
Diffstat (limited to 'meta-application-manager/recipes-application-framework/ail/files')
-rw-r--r-- | meta-application-manager/recipes-application-framework/ail/files/ail_journal_perm_check.patch | 138 |
1 files changed, 138 insertions, 0 deletions
diff --git a/meta-application-manager/recipes-application-framework/ail/files/ail_journal_perm_check.patch b/meta-application-manager/recipes-application-framework/ail/files/ail_journal_perm_check.patch new file mode 100644 index 0000000..46ad215 --- /dev/null +++ b/meta-application-manager/recipes-application-framework/ail/files/ail_journal_perm_check.patch @@ -0,0 +1,138 @@ +diff --git a/src/ail_db.c b/src/ail_db.c +index 462c545..5c6bb5e 100755 +--- a/src/ail_db.c ++++ b/src/ail_db.c +@@ -100,15 +100,19 @@ static int ail_db_change_perm(const char *db_file, uid_t uid) + ret = chown(files[i], uid, userinfo->pw_gid); + SET_SMACK_LABEL(files[i],uid) + if (ret == -1) { ++ if (files[i] == journal_file && errno == ENOENT) ++ continue; + strerror_r(errno, buf, sizeof(buf)); +- _E("FAIL : chown %s %d.%d, because %s", db_file, uid, userinfo->pw_gid, buf); ++ _E("FAIL : chown %s %d.%d, because %s", files[i], uid, userinfo->pw_gid, buf); + return AIL_ERROR_FAIL; + } + + ret = chmod(files[i], S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); + if (ret == -1) { ++ if (files[i] == journal_file && errno == ENOENT) ++ continue; + strerror_r(errno, buf, sizeof(buf)); +- _E("FAIL : chmod %s 0664, because %s", db_file, buf); ++ _E("FAIL : chmod %s 0664, because %s", files[i], buf); + return AIL_ERROR_FAIL; + } + } +diff --git a/tool/src/ail_fota.c b/tool/src/ail_fota.c +index 20d17c5..c523588 100644 +--- a/tool/src/ail_fota.c ++++ b/tool/src/ail_fota.c +@@ -176,15 +176,19 @@ static int initdb_change_perm(const char *db_file) + for (i = 0; files[i]; i++) { + ret = chown(files[i], OWNER_ROOT, OWNER_ROOT); + if (ret == -1) { ++ if (files[i] == journal_file && errno == ENOENT) ++ continue; + strerror_r(errno, buf, sizeof(buf)); +- _E("FAIL : chown %s %d.%d, because %s", db_file, OWNER_ROOT, OWNER_ROOT, buf); ++ _E("FAIL : chown %s %d.%d, because %s", files[i], OWNER_ROOT, OWNER_ROOT, buf); + return AIL_ERROR_FAIL; + } + + ret = chmod(files[i], S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); + if (ret == -1) { ++ if (files[i] == journal_file && errno == ENOENT) ++ continue; + strerror_r(errno, buf, sizeof(buf)); +- _E("FAIL : chmod %s 0664, because %s", db_file, buf); ++ _E("FAIL : chmod %s 0664, because %s", files[i], buf); + return AIL_ERROR_FAIL; + } + } +diff --git a/tool/src/createdb.c b/tool/src/createdb.c +index f203c74..05d101d 100644 +--- a/tool/src/createdb.c ++++ b/tool/src/createdb.c +@@ -97,15 +97,19 @@ static int createdb_change_perm(const char *db_file) + for (i = 0; files[i]; i++) { + ret = chown(files[i], GLOBAL_USER, OWNER_ROOT); + if (ret == -1) { ++ if (files[i] == journal_file && errno == ENOENT) ++ continue; + strerror_r(errno, buf, sizeof(buf)); +- _E("FAIL : chown %s %d.%d, because %s", db_file, OWNER_ROOT, OWNER_ROOT, buf); ++ _E("FAIL : chown %s %d.%d, because %s", files[i], OWNER_ROOT, OWNER_ROOT, buf); + return AIL_ERROR_FAIL; + } + + ret = chmod(files[i], S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); + if (ret == -1) { ++ if (files[i] == journal_file && errno == ENOENT) ++ continue; + strerror_r(errno, buf, sizeof(buf)); +- _E("FAIL : chmod %s 0664, because %s", db_file, buf); ++ _E("FAIL : chmod %s 0664, because %s", files[i], buf); + return AIL_ERROR_FAIL; + } + } +@@ -173,7 +177,6 @@ int main(int argc, char *argv[]) + _E(" %s is not removed",APP_INFO_DB_FILE); + if(remove(APP_INFO_DB_FILE_JOURNAL)) + _E(" %s is not removed",APP_INFO_DB_FILE_JOURNAL); +- return -1; + } + ret = setenv("AIL_INITDB", "1", 1); + _D("AIL_INITDB : %d", ret); +diff --git a/tool/src/initdb.c b/tool/src/initdb.c +index 75d5788..79df936 100755 +--- a/tool/src/initdb.c ++++ b/tool/src/initdb.c +@@ -174,15 +174,19 @@ static int initdb_change_perm(const char *db_file) + for (i = 0; files[i]; i++) { + ret = chown(files[i], GLOBAL_USER, OWNER_ROOT); + if (ret == -1) { ++ if (files[i] == journal_file && errno == ENOENT) ++ continue; + strerror_r(errno, buf, sizeof(buf)); +- _E("FAIL : chown %s %d.%d, because %s", db_file, OWNER_ROOT, OWNER_ROOT, buf); ++ _E("FAIL : chown %s %d.%d, because %s", files[i], OWNER_ROOT, OWNER_ROOT, buf); + return AIL_ERROR_FAIL; + } + + ret = chmod(files[i], S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); + if (ret == -1) { ++ if (files[i] == journal_file && errno == ENOENT) ++ continue; + strerror_r(errno, buf, sizeof(buf)); +- _E("FAIL : chmod %s 0664, because %s", db_file, buf); ++ _E("FAIL : chmod %s 0664, because %s", files[i], buf); + return AIL_ERROR_FAIL; + } + } +diff --git a/tool/src/syncdb.c b/tool/src/syncdb.c +index 247602b..1ba2490 100644 +--- a/tool/src/syncdb.c ++++ b/tool/src/syncdb.c +@@ -176,15 +176,19 @@ static int syncdb_change_perm(const char *db_file) + for (i = 0; files[i]; i++) { + ret = chown(files[i], GLOBAL_USER, OWNER_ROOT); + if (ret == -1) { ++ if (files[i] == journal_file && errno == ENOENT) ++ continue; + strerror_r(errno, buf, sizeof(buf)); +- _E("FAIL : chown %s %d.%d, because %s", db_file, OWNER_ROOT, OWNER_ROOT, buf); ++ _E("FAIL : chown %s %d.%d, because %s", files[i], OWNER_ROOT, OWNER_ROOT, buf); + return AIL_ERROR_FAIL; + } + + ret = chmod(files[i], S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); + if (ret == -1) { ++ if (files[i] == journal_file && errno == ENOENT) ++ continue; + strerror_r(errno, buf, sizeof(buf)); +- _E("FAIL : chmod %s 0664, because %s", db_file, buf); ++ _E("FAIL : chmod %s 0664, because %s", files[i], buf); + return AIL_ERROR_FAIL; + } + } |