Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ TEST_FIXTURES = \
src/tests/fixtures/filter-minimal.conf \
src/tests/fixtures/filter-cases.txt \
src/tests/fixtures/broken-filter.conf \
init/fapolicyd-filter.conf \
init/data/fapolicyd-filter.conf \
src/tests/fixtures/rules-valid.rules

EXTRA_DIST = ChangeLog AUTHORS NEWS README.md INSTALL fapolicyd.spec \
Expand Down
213 changes: 114 additions & 99 deletions README.md

Large diffs are not rendered by default.

16 changes: 15 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,21 @@ if test x$use_deb = xyes ; then
fi
AM_CONDITIONAL(WITH_DEB, test x$use_deb = xyes)

AM_CONDITIONAL(NEED_MD5, test x$use_deb = xyes)
withval=""
AC_ARG_WITH(ebuild,
AS_HELP_STRING([--with-ebuild],[Use the ebuild database as a trust source]),
use_ebuild=$withval,use_ebuild=no)

if test x$use_ebuild = xyes ; then

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use AS_IF. Bare if has issues with quoting and is no longer recommended in the autoconf manual.

AC_DEFINE(USE_EBUILD,1,[Define if you want to use the ebuild database as trust source.])
AC_CHECK_LIB(md, MD5Final, , [AC_MSG_ERROR([libmd is missing])], -lmd)
fi
AM_CONDITIONAL(WITH_EBUILD, test x$use_ebuild = xyes)

if test x$use_deb = xyes || test x$use_ebuild = xyes ; then
AC_DEFINE(NEED_MD5, 1, [Define if MD5 hashing is needed])
fi
AM_CONDITIONAL(NEED_MD5, test x$use_deb = xyes || test x$use_ebuild = xyes)

dnl FIXME some day pass this on the command line
def_systemdsystemunitdir=${prefix}/lib/systemd/system
Expand Down
12 changes: 7 additions & 5 deletions fapolicyd.spec
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,13 @@ fi
%doc README.md
%{!?_licensedir:%global license %%doc}
%license COPYING
%attr(755,root,root) %dir %{_datadir}/%{name}
%attr(755,root,root) %dir %{_datadir}/%{name}/sample-rules
%attr(644,root,root) %{_datadir}/%{name}/default-ruleset.known-libs
%attr(644,root,root) %{_datadir}/%{name}/sample-rules/*
%attr(644,root,root) %{_datadir}/%{name}/fapolicyd-magic.mgc
%attr(755,root,%{name}) %dir %{_datadir}/%{name}
%attr(755,root,%{name}) %dir %{_datadir}/%{name}/sample-rules
%attr(644,root,%{name}) %{_datadir}/%{name}/default-ruleset.known-libs
%attr(644,root,%{name}) %{_datadir}/%{name}/sample-rules/*
%attr(644,root,%{name}) %{_datadir}/%{name}/fapolicyd-magic.mgc
%exclude %{_sysconfdir}/init.d/%{name}
%exclude %{_sysconfdir}/conf.d/%{name}
%attr(750,root,%{name}) %dir %{_sysconfdir}/%{name}
%attr(750,root,%{name}) %dir %{_sysconfdir}/%{name}/trust.d
%attr(750,root,%{name}) %dir %{_sysconfdir}/%{name}/rules.d
Expand Down
25 changes: 16 additions & 9 deletions init/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
EXTRA_DIST = \
fapolicyd.service \
fapolicyd.conf \
fapolicyd-filter.conf \
fapolicyd.trust \
data/fapolicyd-filter.conf \
data/fapolicyd.conf \
data/fapolicyd.trust \
openrc/conf.d/fapolicyd \
openrc/init.d/fapolicyd \
systemd/fapolicyd.service \
fapolicyd-tmpfiles.conf \
fapolicyd-magic \
fapolicyd.bash_completion \
Expand All @@ -11,20 +13,25 @@ EXTRA_DIST = \
fapolicyddir = $(sysconfdir)/fapolicyd

dist_fapolicyd_DATA = \
fapolicyd.conf \
fapolicyd-filter.conf \
fapolicyd.trust
data/fapolicyd.conf \
data/fapolicyd-filter.conf \
data/fapolicyd.trust

systemdservicedir = $(systemdsystemunitdir)
dist_systemdservice_DATA = fapolicyd.service
dist_systemdservice_DATA = systemd/fapolicyd.service

openrcinitdir = $(sysconfdir)/init.d
dist_openrcinit_DATA = openrc/init.d/fapolicyd
openrcconfdir = $(sysconfdir)/conf.d
dist_openrcconf_DATA = openrc/conf.d/fapolicyd

sbin_SCRIPTS = fagenrules

completiondir = $(sysconfdir)/bash_completion.d/
dist_completion_DATA = fapolicyd.bash_completion

MAGIC = fapolicyd-magic.mgc
pkgdata_DATA = ${MAGIC}
pkgdata_DATA = ${MAGIC}
CLEANFILES = ${MAGIC}

${MAGIC}: $(EXTRA_DIST)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion init/fapolicyd-magic
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
0 string/wt #!\ /bin/rc Plan 9 shell script text executable
!:mime text/x-plan9-shellscript

0 string/wb #!\ /usr/bin/ocamlrun Ocaml byte-compiled executable
0 string/wb #!\ /usr/bin/ocamlrun Ocaml byte-compiled executable
!:mime application/x-bytecode.ocaml

0 string/wt #!\ /usr/bin/lua Lua script text executable
Expand Down
1 change: 1 addition & 0 deletions init/openrc/conf.d/fapolicyd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fapolicyd_opts="--permissive --debug"
19 changes: 19 additions & 0 deletions init/openrc/init.d/fapolicyd
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/sbin/openrc-run

name=$RC_SVCNAME
cfgfile="/etc/$RC_SVCNAME/$RC_SVCNAME.conf"
command="/usr/sbin/fapolicyd"
command_args="${fapolicyd_opts}"
command_user="fapolicyd"
pidfile="/run/$RC_SVCNAME/$RC_SVCNAME.pid"

# Depend on local disks being mounted
depend() {
need localmount
}

# Before starting the service update the rulesfile in /etc/fapolicyd
# from the fragments in /etc/fapolicyd/rules.d
start_pre() {
/usr/sbin/fagenrules
}
File renamed without changes.
Loading