mirror of git://git.sysmocom.de/ofono
Check for capabilities support via libcap-ng
This commit is contained in:
parent
022359ba72
commit
9ee614b64b
|
@ -237,7 +237,7 @@ src_ofonod_SOURCES = $(gdbus_sources) $(builtin_sources) \
|
|||
src/gprs.c src/idmap.h src/idmap.c \
|
||||
src/radio-settings.c src/stkutil.h src/stkutil.c
|
||||
|
||||
src_ofonod_LDADD = $(builtin_libadd) @GLIB_LIBS@ @DBUS_LIBS@ -ldl
|
||||
src_ofonod_LDADD = $(builtin_libadd) @GLIB_LIBS@ @DBUS_LIBS@ @CAPNG_LIBS@ -ldl
|
||||
|
||||
src_ofonod_LDFLAGS = -Wl,--export-dynamic -Wl,--version-script=src/ofono.ver
|
||||
|
||||
|
@ -254,7 +254,7 @@ else
|
|||
build_plugindir = $(plugindir)
|
||||
endif
|
||||
|
||||
AM_CFLAGS = @DBUS_CFLAGS@ @GLIB_CFLAGS@ $(builtin_cflags) \
|
||||
AM_CFLAGS = @DBUS_CFLAGS@ @GLIB_CFLAGS@ @CAPNG_CFLAGS@ $(builtin_cflags) \
|
||||
-DOFONO_PLUGIN_BUILTIN \
|
||||
-DPLUGINDIR=\""$(build_plugindir)"\"
|
||||
|
||||
|
|
|
@ -12,4 +12,5 @@ fi
|
|||
--mandir=/usr/share/man \
|
||||
--sysconfdir=/etc \
|
||||
--localstatedir=/var \
|
||||
--enable-capng \
|
||||
--disable-datafiles $*
|
||||
|
|
10
configure.ac
10
configure.ac
|
@ -125,6 +125,16 @@ AC_SUBST(UDEV_CFLAGS)
|
|||
AC_SUBST(UDEV_LIBS)
|
||||
AM_CONDITIONAL(UDEV, test "${enable_udev}" = "yes")
|
||||
|
||||
AC_ARG_ENABLE(capng, AC_HELP_STRING([--enable-capng],
|
||||
[enable capabilities support]), [enable_capng=${enableval}])
|
||||
if (test "${enable_capng}" = "yes"); then
|
||||
PKG_CHECK_MODULES(CAPNG, libcap-ng, dummy=yes,
|
||||
AC_MSG_ERROR(Capabilities library is required))
|
||||
AC_SUBST(CAPNG_CFLAGS)
|
||||
AC_SUBST(CAPNG_LIBS)
|
||||
AC_DEFINE(HAVE_CAPNG, 1, [Define to 1 if you have capabilities library.])
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(isimodem, AC_HELP_STRING([--disable-isimodem],
|
||||
[disable PhoNet/ISI modem support]),
|
||||
[enable_isimodem=${enableval}])
|
||||
|
|
12
src/main.c
12
src/main.c
|
@ -23,8 +23,6 @@
|
|||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <gdbus.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
@ -32,6 +30,12 @@
|
|||
#include <signal.h>
|
||||
#include <sys/signalfd.h>
|
||||
|
||||
#include <gdbus.h>
|
||||
|
||||
#ifdef HAVE_CAPNG
|
||||
#include <cap-ng.h>
|
||||
#endif
|
||||
|
||||
#include "ofono.h"
|
||||
|
||||
#define SHUTDOWN_GRACE_SECONDS 10
|
||||
|
@ -114,6 +118,10 @@ int main(int argc, char **argv)
|
|||
GIOChannel *signal_io;
|
||||
int signal_source;
|
||||
|
||||
#ifdef HAVE_CAPNG
|
||||
/* Drop capabilities */
|
||||
#endif
|
||||
|
||||
sigemptyset(&mask);
|
||||
sigaddset(&mask, SIGTERM);
|
||||
sigaddset(&mask, SIGINT);
|
||||
|
|
Loading…
Reference in New Issue