diff options
author | Tyler Hicks <tyhicks@canonical.com> | 2015-02-18 15:44:59 -0600 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2015-02-19 10:22:17 +0000 |
commit | 5872c6f7ff502bb993ce4fe47a4e78afd16c65c2 (patch) | |
tree | 6aa71b066c75863280e5d578df44fee7cfd8b2c5 /bus/apparmor.c | |
parent | 3a10304a2de1c795049c0f9cadff6dc8061f5920 (diff) | |
download | dbus-5872c6f7ff502bb993ce4fe47a4e78afd16c65c2.tar.gz |
apparmor: Fix build failure with --disable-apparmor
The bus_apparmor_confinement_unref() function definition must exist even
when building with --disable-apparmor.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=75113
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Diffstat (limited to 'bus/apparmor.c')
-rw-r--r-- | bus/apparmor.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/bus/apparmor.c b/bus/apparmor.c index 072e2edf..a1b3621a 100644 --- a/bus/apparmor.c +++ b/bus/apparmor.c @@ -106,30 +106,6 @@ bus_apparmor_confinement_new (char *label, } void -bus_apparmor_confinement_unref (BusAppArmorConfinement *confinement) -{ -#ifdef HAVE_APPARMOR - if (!apparmor_enabled) - return; - - _dbus_assert (confinement != NULL); - _dbus_assert (confinement->refcount > 0); - - confinement->refcount -= 1; - - if (confinement->refcount == 0) - { - /** - * Do not free confinement->mode, as libapparmor does a single malloc for - * both confinement->label and confinement->mode. - */ - free (confinement->label); - dbus_free (confinement); - } -#endif -} - -void bus_apparmor_audit_init (void) { #ifdef HAVE_LIBAUDIT @@ -553,6 +529,30 @@ bus_apparmor_enabled (void) } void +bus_apparmor_confinement_unref (BusAppArmorConfinement *confinement) +{ +#ifdef HAVE_APPARMOR + if (!apparmor_enabled) + return; + + _dbus_assert (confinement != NULL); + _dbus_assert (confinement->refcount > 0); + + confinement->refcount -= 1; + + if (confinement->refcount == 0) + { + /** + * Do not free confinement->mode, as libapparmor does a single malloc for + * both confinement->label and confinement->mode. + */ + free (confinement->label); + dbus_free (confinement); + } +#endif +} + +void bus_apparmor_confinement_ref (BusAppArmorConfinement *confinement) { #ifdef HAVE_APPARMOR |