fix: rollback dbus configuration

This commit is contained in:
Kevin Yue 2022-05-29 21:00:37 +08:00
parent fb2b148b72
commit 9c9b42b87f
4 changed files with 11 additions and 29 deletions

View File

@ -3,18 +3,16 @@
"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
<policy context="default">
<deny own="com.yuezk.qt.GPService"/>
<deny send_destination="com.yuezk.qt.GPService" />
</policy>
<policy user="root">
<allow own="com.yuezk.qt.GPService"/>
<allow send_destination="com.yuezk.qt.GPService" />
</policy>
<policy user="root">
<allow own="com.yuezk.qt.GPService"/>
</policy>
<!--LOGNAME-->
<policy user="@CMAKE_LOGNAME@">
<allow own="com.yuezk.qt.GPService"/>
<allow send_destination="com.yuezk.qt.GPService" />
</policy>
<policy context="default">
<allow send_destination="com.yuezk.qt.GPService"
send_interface="com.yuezk.qt.GPService"
/>
<allow send_destination="com.yuezk.qt.GPService"
send_interface="org.freedesktop.DBus.Introspectable"
/>
</policy>
</busconfig>

11
debian/postinst vendored
View File

@ -1,11 +0,0 @@
#!/bin/sh
set -e
# Update the the dbus user to logname
dbus_conf=/usr/share/dbus-1/system.d/com.yuezk.qt.GPService.conf
if [ -f $dbus_conf ]; then
sed -i "/LOGNAME/,+1s/user=\".*\"/user=\"$(logname)\"/" $dbus_conf
fi
#DEBHELPER#

View File

@ -1,7 +1,4 @@
post_install() {
# Update the the dbus user to logname
sed -i "/LOGNAME/,+1s/user=\".*\"/user=\"$(logname)\"/" /usr/share/dbus-1/system.d/com.yuezk.qt.GPService.conf
systemctl enable gpservice.service
systemctl restart gpservice.service
}

View File

@ -33,8 +33,6 @@ A GlobalProtect VPN client (GUI) for Linux based on OpenConnect and built with Q
%post
sed -i "/LOGNAME/,+1s/user=\".*\"/user=\"$(logname)\"/" /usr/share/dbus-1/system.d/com.yuezk.qt.GPService.conf
%if 0%{?suse_version}
%service_add_post gpservice.service
%else