Commit cb074265 authored by Dominique Leuenberger's avatar Dominique Leuenberger Committed by Zeeshan Ali

build: Add configure option to specify service user

This is the user as which the service will run as.

https://bugs.freedesktop.org/show_bug.cgi?id=68947

Co-Author: Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
parent 78f0b117
......@@ -119,12 +119,20 @@ else
fi
AC_SUBST(DBUS_SYS_DIR)
AC_ARG_WITH(dbus-service-user,
AS_HELP_STRING([--with-dbus-service-user=USER],
[The USER (existing) as which the service will run (default: root)]),
dbus_srv_user="$with_dbus_service_user",
dbus_srv_user="root")
AC_SUBST(dbus_srv_user)
AC_CONFIG_FILES([
Makefile
src/Makefile
src/geoclue-2.0.pc
src/geoip-server/Makefile
po/Makefile.in
data/org.freedesktop.GeoClue2.conf
data/Makefile
demo/Makefile
])
......
......@@ -3,12 +3,11 @@ service_in_files = org.freedesktop.GeoClue2.service.in
service_DATA = $(service_in_files:.service.in=.service)
$(service_DATA): $(service_in_files) Makefile
@sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
@sed -e "s|\@libexecdir\@|$(libexecdir)|" $< | \
sed -e "s|\@dbus_srv_user\@|$(dbus_srv_user)|" > $@
# DBus Service policy file
dbusservicedir = $(DBUS_SYS_DIR)
dbusservice_DATA = org.freedesktop.GeoClue2.conf
EXTRA_DIST = $(service_in_files) \
$(dbusservice_DATA)
DISTCLEANFILES = $(service_DATA)
......@@ -8,8 +8,8 @@
<allow send_destination="org.freedesktop.GeoClue2"/>
</policy>
<policy user="root">
<!-- Only allow root to own the name on the bus -->
<policy user="@dbus_srv_user@">
<!-- Only allow @dbus_srv_user@ to own the name on the bus -->
<allow own="org.freedesktop.GeoClue2"/>
</policy>
</busconfig>
[D-BUS Service]
Name=org.freedesktop.GeoClue2
Exec=@libexecdir@/geoclue -t 5
User=root
User=@dbus_srv_user@
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment