ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
AM_MAKEFLAGS = --no-print-directory
-SUBDIRS = libsmack utils doc
+SUBDIRS = libsmack utils doc init
AM_CONDITIONAL([ENABLE_DOXYGEN],[test ! -z "$DOXYGEN"], [Build API documentation.])
AC_SUBST([DOXYGEN], [$DOXYGEN])
-AC_CONFIG_FILES([Makefile libsmack/Makefile libsmack/libsmack.pc utils/Makefile doc/Makefile])
+AC_CONFIG_FILES([Makefile libsmack/Makefile libsmack/libsmack.pc utils/Makefile doc/Makefile init/Makefile])
AC_OUTPUT
--- /dev/null
+initdir = /lib/systemd/system
+init_DATA = smack.mount smack.service
--- /dev/null
+[Unit]
+Description=Smack filesystem mounting
+Before=local-fs.target
+
+[Mount]
+What=smackfs
+Where=/smack
+Type=smackfs
--- /dev/null
+[Unit]
+Description=Smack
+After=basic.target
+
+[Service]
+ExecStart=/usr/bin/smackctl apply
+ExecStop=/usr/bin/smackctl clear
+RemainAfterExit=yes
if (fd < 0)
return -1;
- fd = open(fpath, O_RDONLY);
- if (fd < 0)
- return -1;
-
ret = apply_rules_file(fd, 0) ? FTW_STOP : FTW_CONTINUE;
close(fd);
return ret;
#define LABEL_LEN 23
#define SMACKFS_MNT "/smack"
-#define ACCESSES_PATH "/etc/smack/accesses"
#define ACCESSES_D_PATH "/etc/smack/accesses.d"
-#define CIPSO_PATH "/etc/smack/cipso"
#define CIPSO_D_PATH "/etc/smack/cipso.d"
int clear(void);
if (clear())
return -1;
- if (apply_rules(ACCESSES_PATH, 0))
- perror("apply_rules File");
-
if (apply_rules(ACCESSES_D_PATH, 0))
perror("apply_rules Path");
- if (apply_cipso(CIPSO_PATH))
- perror("apply_cipso File");
-
if (apply_cipso(CIPSO_D_PATH))
perror("apply_cipso Path");