Modification about smack label of db file belong to process. 82/20982/2 accepted/tizen/common/20140519.230349 submit/tizen/20140516.061258 submit/tizen_common/20140521.163740 submit/tizen_common/20140522.130648 submit/tizen_common/20140522.135644
authorjooseong.lee <jooseong.lee@samsung.com>
Wed, 14 May 2014 09:44:08 +0000 (18:44 +0900)
committerjooseong lee <jooseong.lee@samsung.com>
Wed, 14 May 2014 09:43:48 +0000 (02:43 -0700)
[Problem]
Most db files have 'floor' label.  Because these are created during image creation time.
Therefore no process can write the dbs (since 'floor' label allows only read and execute)

[Solution]
Modify smack label of the db files based on condition below referring three domain model
Condition1. Assign domain of process which creates db files
Condition2. Assign domain of process accesses db files.

Change-Id: I7538593b434e3e8a07696c12f441cbd444a31d16
Signed-off-by: jooseong.lee <jooseong.lee@samsung.com>
tool/pkg_initdb.c

index 9da565e..aec8faa 100755 (executable)
@@ -47,7 +47,7 @@
 #define PKG_PARSER_DB_FILE_JOURNAL tzplatform_mkpath(TZ_SYS_DB, ".pkgmgr_parser.db-journal")
 #define PKG_CERT_DB_FILE tzplatform_mkpath(TZ_SYS_DB, ".pkgmgr_cert.db")
 #define PKG_CERT_DB_FILE_JOURNAL tzplatform_mkpath(TZ_SYS_DB, ".pkgmgr_cert.db-journal")
-#define PKG_INFO_DB_LABEL "pkgmgr::db"
+#define PKG_INFO_DB_LABEL "User"
 
 #ifdef _E
 #undef _E
@@ -266,7 +266,6 @@ int main(int argc, char *argv[])
                return -1;
        }
 
-/*
        const char *argv_parser[] = { "/usr/bin/chsmack", "-a", PKG_INFO_DB_LABEL, PKG_PARSER_DB_FILE, NULL };
        initdb_xsystem(argv_parser);
        const char *argv_parserjn[] = { "/usr/bin/chsmack", "-a", PKG_INFO_DB_LABEL, PKG_PARSER_DB_FILE_JOURNAL, NULL };
@@ -275,8 +274,6 @@ int main(int argc, char *argv[])
        initdb_xsystem(argv_cert);
        const char *argv_certjn[] = { "/usr/bin/chsmack", "-a", PKG_INFO_DB_LABEL, PKG_CERT_DB_FILE_JOURNAL, NULL };
        initdb_xsystem(argv_certjn);
-*/
+
        return 0;
 }
-
-