sqlite3_close_v2(src_db);
sqlite3_close_v2(dest_db);
+
+ if (__set_db_permission(dest_path) != 0)
+ return -1;
+
__remove_backup_flag(src_path);
return 0;
if (__backup_file(src_path, dest_path) != 0)
return -1;
- if (__set_db_permission(dest_path) != 0)
- return -1;
-
return 0;
}
return -1;
}
+ // set the database permission to solve the case of using the backup database
+ // which the smack label is not applied properly
+ if (__set_db_permission(DBPATH) != 0) {
+ _LOGE("set db permissison at parser db failed\n");
+ return -1;
+ }
+
+ if (__set_db_permission(CERT_DBPATH) != 0) {
+ _LOGE("set db permissison at cert db failed\n");
+ return -1;
+ }
+
/* check pkgmgr-fota dir, if it is not, then exit */
ret = __check_pkgmgr_fota_dir();
if (ret < 0) {