Fix TIVI 2012 : Add Smack build option 26/11326/2
authorBaptiste DURAND <baptiste.durand@eurogiciel.fr>
Thu, 24 Oct 2013 11:13:52 +0000 (13:13 +0200)
committerRusty Lynch <rusty.lynch@intel.com>
Thu, 24 Oct 2013 17:13:03 +0000 (10:13 -0700)
ail_initdb  set SMACK label on app_info.db.

As manifest is reset to default floor, we need to remove the smack instruction in the code too.

Change-Id: I3e6f27712dccc0aed055259819eae105f6a17bf5
Signed-off-by: Baptiste DURAND <baptiste.durand@eurogiciel.fr>
CMakeLists.txt
initdb/src/initdb.c
packaging/ail.spec

index 7db2927..88081ae 100644 (file)
@@ -2,7 +2,10 @@
 
 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 PROJECT(ail C)
-
+OPTION(SMACK "Enable smack support" ON)
+IF(SMACK)
+    ADD_DEFINITIONS("-DWRT_SMACK_ENABLED")  # enable smack
+ENDIF(SMACK)
 SET(LIBNAME "lib${PROJECT_NAME}")
 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 SET(BINDIR "${PREFIX}/bin")
index ea17385..e5dae3f 100755 (executable)
@@ -275,12 +275,12 @@ int main(int argc, char *argv[])
        if (ret == AIL_ERROR_FAIL) {
                _E("cannot chown.");
        }
-
+#ifdef WRT_SMACK_ENABLED
        const char *argv_smack[] = { "/usr/bin/chsmack", "-a", APP_INFO_DB_LABEL, APP_INFO_DB_FILE, NULL };
        xsystem(argv_smack);
        const char *argv_smackjn[] = { "/usr/bin/chsmack", "-a", APP_INFO_DB_LABEL, APP_INFO_DB_FILE_JOURNAL, NULL };
        xsystem(argv_smackjn);
-
+#endif
        return AIL_ERROR_OK;
 }
 
index 6a585e6..ec73767 100755 (executable)
@@ -31,7 +31,8 @@ cp %{SOURCE1001} .
 
 %build
 CFLAGS+=" -fpic"
-%cmake .  -DBUILD_PKGTYPE=rpm
+%cmake .  -DBUILD_PKGTYPE=rpm \
+                 -DSMACK=Off
 
 make %{?_smp_mflags}