mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2025-12-27 04:30:08 +01:00
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>
This commit is contained in:
parent
3a10304a2d
commit
5872c6f7ff
1 changed files with 24 additions and 24 deletions
|
|
@ -105,30 +105,6 @@ bus_apparmor_confinement_new (char *label,
|
|||
return confinement;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
|
|
@ -552,6 +528,30 @@ bus_apparmor_enabled (void)
|
|||
#endif
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue