3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-21 22:09: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
if TOOLS
noinst_PROGRAMS += tools/hwsim
if HWSIM
bin_PROGRAMS += tools/hwsim
tools_hwsim_SOURCES = tools/hwsim.c src/mpdu.h \
src/util.h src/util.c \
src/storage.h src/storage.c \
src/common.h src/common.c
tools_hwsim_LDADD = ell/libell-internal.la
if DBUS_POLICY
dist_dbus_data_DATA += tools/hwsim-dbus.conf
endif
endif
if TOOLS
@ -378,6 +382,7 @@ DISTCHECK_CONFIGURE_FLAGS = --disable-dbus-policy --disable-systemd-service \
--enable-sim-hardcoded \
--enable-ofono \
--enable-wired \
--enable-hwsim \
--enable-tools
DISTCLEANFILES = $(BUILT_SOURCES) $(unit_tests) $(manual_pages)

View File

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

View File

@ -164,6 +164,11 @@ AC_ARG_ENABLE(wired, AC_HELP_STRING([--enable-wired],
[enable_wired=${enableval}])
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],
[enable internal testing utilities]),
[enable_tools=${enableval}])

View File

@ -11,9 +11,6 @@
<allow own="net.connman.iwd"/>
<allow send_destination="net.connman.iwd"/>
<allow send_interface="net.connman.iwd.Agent"/>
<allow own="net.connman.iwd.hwsim"/>
<allow send_destination="net.connman.iwd.hwsim"/>
</policy>
<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>