Modification about smack label of db file belong to process.
[platform/framework/web/wrt-security.git] / etc / wrt_security_create_clean_db.sh
index c70c6e7..f5df7bd 100644 (file)
 #    See the License for the specific language governing permissions and
 #    limitations under the License.
 #
+
+source /etc/tizen-platform.conf
+
 for name in ace
 do
-    rm -f /opt/dbspace/.$name.db
-    rm -f /opt/dbspace/.$name.db-journal
+    rm -f $TZ_SYS_DB/.$name.db
+    rm -f $TZ_SYS_DB/.$name.db-journal
     SQL="PRAGMA journal_mode = PERSIST;"
-    sqlite3 /opt/dbspace/.$name.db "$SQL"
-    SQL=".read /usr/share/wrt-engine/"$name"_db.sql"
-    sqlite3 /opt/dbspace/.$name.db "$SQL"
-    touch /opt/dbspace/.$name.db-journal
-    chown 0:6026 /opt/dbspace/.$name.db
-    chown 0:6026 /opt/dbspace/.$name.db-journal
-    chmod 660 /opt/dbspace/.$name.db
-    chmod 660 /opt/dbspace/.$name.db-journal
+    sqlite3 $TZ_SYS_DB/.$name.db "$SQL"
+    SQL=".read "$TZ_SYS_RO_WRT_ENGINE"/"$name"_db.sql"
+    sqlite3 $TZ_SYS_DB/.$name.db "$SQL"
+    touch $TZ_SYS_DB/.$name.db-journal
+    chown 0:db_wrt $TZ_SYS_DB/.$name.db
+    chown 0:db_wrt $TZ_SYS_DB/.$name.db-journal
+    chmod 660 $TZ_SYS_DB/.$name.db
+    chmod 660 $TZ_SYS_DB/.$name.db-journal
+# These need to be disabled while we work on the three domain model
+#    if [ -f /usr/lib/rpm-plugins/msm.so ]
+#    then
+#        chsmack -a "wrt-security-daemon::db" /opt/dbspace/.$name.db
+#        chsmack -a "wrt-security-daemon::db" /opt/dbspace/.$name.db-journal
+#    fi
 done
 
+