[sys-process/audit] sync with gentoo

This commit is contained in:
Robert Förster 2015-08-21 14:22:55 +02:00
parent 778a03981f
commit b8d4542d8a
6 changed files with 34 additions and 37 deletions

View File

@ -1,6 +1,6 @@
# Copyright 1999-2015 Gentoo Foundation # Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2 # Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-process/audit/audit-2.4.1-r1.ebuild,v 1.1 2015/05/16 05:56:03 robbat2 Exp $ # $Id$
EAPI="5" EAPI="5"
@ -25,9 +25,11 @@ RDEPEND="apparmor? ( sys-apps/apparmor )
tcpd? ( sys-apps/tcp-wrappers ) tcpd? ( sys-apps/tcp-wrappers )
sys-libs/libcap-ng" sys-libs/libcap-ng"
DEPEND="${RDEPEND} DEPEND="${RDEPEND}
python? ( ${PYTHON_DEPS} >=sys-kernel/linux-headers-2.6.34
dev-lang/swig ) python? (
>=sys-kernel/linux-headers-2.6.34" ${PYTHON_DEPS}
dev-lang/swig:0
)"
# Do not use os-headers as this is linux specific # Do not use os-headers as this is linux specific
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
@ -80,7 +82,6 @@ src_prepare() {
multilib_src_configure() { multilib_src_configure() {
local ECONF_SOURCE=${S} local ECONF_SOURCE=${S}
#append-flags -D'__attribute__(x)='
econf \ econf \
--sbindir=/sbin \ --sbindir=/sbin \
--enable-systemd \ --enable-systemd \
@ -189,9 +190,11 @@ multilib_src_install_all() {
docinto contrib/plugin docinto contrib/plugin
dodoc contrib/plugin/* dodoc contrib/plugin/*
newinitd "${FILESDIR}"/auditd-init.d-2.3.6 auditd newinitd "${FILESDIR}"/auditd-init.d-2.4.3 auditd
newconfd "${FILESDIR}"/auditd-conf.d-2.3.6 auditd newconfd "${FILESDIR}"/auditd-conf.d-2.3.6 auditd
chmod 644 "${D}/$(systemd_get_unitdir)"/auditd.service || die # 556436
[ -f "${D}"/sbin/audisp-remote ] && \ [ -f "${D}"/sbin/audisp-remote ] && \
dodir /usr/sbin && \ dodir /usr/sbin && \
mv "${D}"/{sbin,usr/sbin}/audisp-remote || die mv "${D}"/{sbin,usr/sbin}/audisp-remote || die

View File

@ -1,6 +1,6 @@
# Copyright 1999-2011 Gentoo Foundation # Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2 # Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-process/audit/files/audit.rules-2.1.3,v 1.1 2011/09/11 02:58:55 robbat2 Exp $ # $Id$
# #
# This file contains the auditctl rules that are loaded # This file contains the auditctl rules that are loaded
# whenever the audit daemon is started via the initscripts. # whenever the audit daemon is started via the initscripts.

View File

@ -1,6 +1,6 @@
# Copyright 1999-2005 Gentoo Foundation # Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2 # Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-process/audit/files/audit.rules.stop.post,v 1.1 2006/06/22 07:41:46 robbat2 Exp $ # $Id$
# #
# This file contains the auditctl rules that are loaded immediately after the # This file contains the auditctl rules that are loaded immediately after the
# audit deamon is stopped via the initscripts. # audit deamon is stopped via the initscripts.

View File

@ -1,6 +1,6 @@
# Copyright 1999-2011 Gentoo Foundation # Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2 # Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-process/audit/files/audit.rules.stop.pre,v 1.2 2011/09/11 02:58:55 robbat2 Exp $ # $Id$
# #
# This file contains the auditctl rules that are loaded immediately before the # This file contains the auditctl rules that are loaded immediately before the
# audit deamon is stopped via the initscripts. # audit deamon is stopped via the initscripts.

View File

@ -1,6 +1,6 @@
# Copyright 1999-2011 Gentoo Foundation # Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2 # Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-process/audit/files/auditd-conf.d-2.1.3,v 1.1 2011/09/11 02:58:55 robbat2 Exp $ # $Id$
# Configuration options for auditd # Configuration options for auditd
# -f for foreground mode # -f for foreground mode

View File

@ -1,7 +1,7 @@
#!/sbin/runscript #!/sbin/openrc-run
# Copyright 1999-2014 Gentoo Foundation # Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2 # Distributed under the terms of the GNU General Public License v2
# $Header: $ # $Id$
extra_started_commands='reload reload_auditd reload_rules' extra_started_commands='reload reload_auditd reload_rules'
description='Linux Auditing System' description='Linux Auditing System'
@ -15,18 +15,18 @@ command='/sbin/auditd'
start_auditd() { start_auditd() {
# Env handling taken from the upstream init script # Env handling taken from the upstream init script
if [ -z "$AUDITD_LANG" -o "$AUDITD_LANG" = "none" -o "$AUDITD_LANG" = "NONE" ]; then if [ -z "$AUDITD_LANG" -o "$AUDITD_LANG" = "none" -o "$AUDITD_LANG" = "NONE" ]; then
unset LANG LC_TIME LC_ALL LC_MESSAGES LC_NUMERIC LC_MONETARY LC_COLLATE unset LANG LC_TIME LC_ALL LC_MESSAGES LC_NUMERIC LC_MONETARY LC_COLLATE
else else
LANG="$AUDITD_LANG" LANG="$AUDITD_LANG"
LC_TIME="$AUDITD_LANG" LC_TIME="$AUDITD_LANG"
LC_ALL="$AUDITD_LANG" LC_ALL="$AUDITD_LANG"
LC_MESSAGES="$AUDITD_LANG" LC_MESSAGES="$AUDITD_LANG"
LC_NUMERIC="$AUDITD_LANG" LC_NUMERIC="$AUDITD_LANG"
LC_MONETARY="$AUDITD_LANG" LC_MONETARY="$AUDITD_LANG"
LC_COLLATE="$AUDITD_LANG" LC_COLLATE="$AUDITD_LANG"
export LANG LC_TIME LC_ALL LC_MESSAGES LC_NUMERIC LC_MONETARY LC_COLLATE export LANG LC_TIME LC_ALL LC_MESSAGES LC_NUMERIC LC_MONETARY LC_COLLATE
fi fi
unset HOME MAIL USER USERNAME unset HOME MAIL USER USERNAME
ebegin "Starting ${name}" ebegin "Starting ${name}"
@ -38,7 +38,7 @@ start_auditd() {
return $ret return $ret
} }
stop_auditd() { stop_auditd() {
ebegin "Stopping ${name}" ebegin "Stopping ${name}"
start-stop-daemon --stop --quiet --pidfile ${pidfile} start-stop-daemon --stop --quiet --pidfile ${pidfile}
local ret=$? local ret=$?
@ -46,12 +46,11 @@ stop_auditd() {
return $ret return $ret
} }
loadfile() { loadfile() {
local rules="$1" local rules="$1"
if [ -n "${rules}" -a -f "${rules}" ]; then if [ -n "${rules}" -a -f "${rules}" ]; then
einfo "Loading audit rules from ${rules}" einfo "Loading audit rules from ${rules}"
/sbin/auditctl -R "${rules}" 1>/dev/null /sbin/auditctl -R "${rules}" >/dev/null
return $? return $?
else else
return 0 return 0
@ -62,7 +61,6 @@ start() {
start_auditd start_auditd
local ret=$? local ret=$?
if [ $ret -eq 0 -a "${RC_CMD}" != "restart" ]; then if [ $ret -eq 0 -a "${RC_CMD}" != "restart" ]; then
touch /var/lock/${name}
if yesno ${USE_AUGENRULES:-no}; then if yesno ${USE_AUGENRULES:-no}; then
test -d /etc/audit/rules.d && /sbin/augenrules test -d /etc/audit/rules.d && /sbin/augenrules
fi fi
@ -76,7 +74,10 @@ reload_rules() {
} }
reload_auditd() { reload_auditd() {
[ -f ${pidfile} ] && kill -HUP `cat ${pidfile}` ebegin "Reloading ${SVCNAME}"
start-stop-daemon --signal HUP \
--exec "${command}" --pidfile "${pidfile}"
eend $?
} }
reload() { reload() {
@ -87,14 +88,7 @@ reload() {
stop() { stop() {
[ "${RC_CMD}" != "restart" ] && loadfile "${RULEFILE_STOP_PRE}" [ "${RC_CMD}" != "restart" ] && loadfile "${RULEFILE_STOP_PRE}"
stop_auditd stop_auditd
rm -f /var/lock/${name}
local ret=$? local ret=$?
[ "${RC_CMD}" != "restart" ] && loadfile "${RULEFILE_STOP_POST}" [ "${RC_CMD}" != "restart" ] && loadfile "${RULEFILE_STOP_POST}"
return $ret return $ret
} }
# This is a special case, we do not want to touch the rules at all
restart() {
stop_auditd
start_auditd
}