3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-22 06:29:23 +01:00

tools: Add configure option and D-Bus policy file for hwsim utility

This commit is contained in:
Marcel Holtmann 2018-09-14 15:24:15 +02:00
parent 5126459ecc
commit 502aac073f
5 changed files with 36 additions and 5 deletions

View File

@ -209,14 +209,18 @@ dbus_bus_DATA += wired/net.connman.ead.service
endif endif
endif endif
if TOOLS if HWSIM
noinst_PROGRAMS += tools/hwsim bin_PROGRAMS += tools/hwsim
tools_hwsim_SOURCES = tools/hwsim.c src/mpdu.h \ tools_hwsim_SOURCES = tools/hwsim.c src/mpdu.h \
src/util.h src/util.c \ src/util.h src/util.c \
src/storage.h src/storage.c \ src/storage.h src/storage.c \
src/common.h src/common.c src/common.h src/common.c
tools_hwsim_LDADD = ell/libell-internal.la tools_hwsim_LDADD = ell/libell-internal.la
if DBUS_POLICY
dist_dbus_data_DATA += tools/hwsim-dbus.conf
endif
endif endif
if TOOLS if TOOLS
@ -378,6 +382,7 @@ DISTCHECK_CONFIGURE_FLAGS = --disable-dbus-policy --disable-systemd-service \
--enable-sim-hardcoded \ --enable-sim-hardcoded \
--enable-ofono \ --enable-ofono \
--enable-wired \ --enable-wired \
--enable-hwsim \
--enable-tools --enable-tools
DISTCLEANFILES = $(BUILT_SOURCES) $(unit_tests) $(manual_pages) DISTCLEANFILES = $(BUILT_SOURCES) $(unit_tests) $(manual_pages)

View File

@ -12,6 +12,7 @@ fi
--enable-sim-hardcoded \ --enable-sim-hardcoded \
--enable-ofono \ --enable-ofono \
--enable-wired \ --enable-wired \
--enable-hwsim \
--enable-tools \ --enable-tools \
--disable-dbus-policy \ --disable-dbus-policy \
--disable-systemd-service $* --disable-systemd-service $*

View File

@ -164,6 +164,11 @@ AC_ARG_ENABLE(wired, AC_HELP_STRING([--enable-wired],
[enable_wired=${enableval}]) [enable_wired=${enableval}])
AM_CONDITIONAL(WIRED, test "${enable_wired}" = "yes") AM_CONDITIONAL(WIRED, test "${enable_wired}" = "yes")
AC_ARG_ENABLE(hwsim, AC_HELP_STRING([--enable-hwsim],
[enable Wireless simulation utility]),
[enable_hwsim=${enableval}])
AM_CONDITIONAL(HWSIM, test "${enable_hwsim}" = "yes")
AC_ARG_ENABLE(tools, AC_HELP_STRING([--enable-tools], AC_ARG_ENABLE(tools, AC_HELP_STRING([--enable-tools],
[enable internal testing utilities]), [enable internal testing utilities]),
[enable_tools=${enableval}]) [enable_tools=${enableval}])

View File

@ -11,9 +11,6 @@
<allow own="net.connman.iwd"/> <allow own="net.connman.iwd"/>
<allow send_destination="net.connman.iwd"/> <allow send_destination="net.connman.iwd"/>
<allow send_interface="net.connman.iwd.Agent"/> <allow send_interface="net.connman.iwd.Agent"/>
<allow own="net.connman.iwd.hwsim"/>
<allow send_destination="net.connman.iwd.hwsim"/>
</policy> </policy>
<policy group="wheel"> <policy group="wheel">

23
tools/hwsim-dbus.conf Normal file
View File

@ -0,0 +1,23 @@
<!-- This configuration file specifies the required security policies
for Simulation daemon to work. -->
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
<!-- ../system.conf have denied everything, so we just punch some holes -->
<policy user="root">
<allow own="net.connman.iwd.hwsim"/>
<allow send_destination="net.connman.iwd.hwsim"/>
</policy>
<policy group="wheel">
<allow send_destination="net.connman.iwd.hwsim"/>
</policy>
<policy context="default">
<deny send_destination="net.connman.iwd.hwsim"/>
</policy>
</busconfig>