Skip to content

Commit 65bf806

Browse files
fix(main/dbus): allow any user to own system mode dbus services
Taken from PR #28268
1 parent 1daeed1 commit 65bf806

3 files changed

Lines changed: 30 additions & 1 deletion

File tree

packages/dbus/build.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ TERMUX_PKG_DESCRIPTION="Freedesktop.org message bus system"
33
TERMUX_PKG_LICENSE="GPL-2.0"
44
TERMUX_PKG_MAINTAINER="@termux"
55
TERMUX_PKG_VERSION="1.16.2"
6-
TERMUX_PKG_REVISION=2
6+
TERMUX_PKG_REVISION=3
77
TERMUX_PKG_SRCURL="https://dbus.freedesktop.org/releases/dbus/dbus-$TERMUX_PKG_VERSION.tar.xz"
88
TERMUX_PKG_SHA256=0ba2a1a4b16afe7bceb2c07e9ce99a8c2c3508e5dec290dbb643384bd6beb7e2
99
TERMUX_PKG_DEPENDS="libexpat, libx11"
@@ -23,6 +23,15 @@ termux_step_pre_configure() {
2323
export LIBS="-llog"
2424
# Enforce meson building
2525
rm CMakeLists.txt
26+
27+
if [[ "$TERMUX_DEBUG_BUILD" == "true" ]]; then
28+
# How to get extra-verbose logging:
29+
# 1. build with -Dverbose_mode=true
30+
# 2. use export DBUS_VERBOSE=1
31+
# 3. launch DBus with --nofork, for example:
32+
# DBUS_VERBOSE=1 dbus-daemon --system --nofork
33+
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" -Dverbose_mode=true"
34+
fi
2635
}
2736

2837
termux_step_post_make_install() {

packages/dbus/bus-activation-helper.c.patch

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
--- a/bus/activation-helper.c
22
+++ b/bus/activation-helper.c
3+
@@ -171,7 +171,7 @@ clear_environment (DBusError *error)
4+
static dbus_bool_t
5+
check_permissions (const char *dbus_user, DBusError *error)
6+
{
7+
-#ifndef ACTIVATION_LAUNCHER_TEST
8+
+#if !defined ACTIVATION_LAUNCHER_TEST && !defined __ANDROID__
9+
uid_t uid, euid;
10+
struct passwd *pw;
11+
312
@@ -294,7 +294,8 @@
413
static dbus_bool_t
514
switch_user (char *user, DBusError *error)

packages/dbus/bus-policy.c.patch

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- a/bus/policy.c
2+
+++ b/bus/policy.c
3+
@@ -1390,7 +1390,7 @@ bus_rules_check_can_own (DBusList *rules,
4+
allowed = rule->allow;
5+
}
6+
7+
- return allowed;
8+
+ return TRUE;
9+
}
10+
11+
dbus_bool_t

0 commit comments

Comments
 (0)