aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2024-04-10 15:36:20 -0500
committerDenis Kenzior <denkenz@gmail.com>2024-04-10 15:36:20 -0500
commit3cb0cb829beea0c906864970b76eae2c86ae8628 (patch)
tree318c4ec21c83cc5cd3b0edb01a856757d7b1b18c
parent6d7edaf5bc5a17f1c7974024b9c139a3fea6ac93 (diff)
downloadofono-3cb0cb829beea0c906864970b76eae2c86ae8628.tar.gz
umlrunner: Allow EXTERNAL authentication
Tools such as busctl use EXTERNAL authentication to DBus and get confused if EXTERNAL authentication is not enabled. For this, the root user must also exist inside /etc/passwd, or dbus-daemon is unable to accept auth requests using EXTERNAL authentication mechanism.
-rwxr-xr-xtools/umlrunner6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/umlrunner b/tools/umlrunner
index bb2f24a6d..264703408 100755
--- a/tools/umlrunner
+++ b/tools/umlrunner
@@ -37,6 +37,8 @@ mounts_common = [
MountInfo('sysfs', 'sysfs', '/sys', '', MS_NOSUID|MS_NOEXEC|MS_NODEV),
MountInfo('proc', 'proc', '/proc', '', MS_NOSUID|MS_NOEXEC|MS_NODEV),
MountInfo('devpts', 'devpts', '/dev/pts', 'mode=0620', MS_NOSUID|MS_NOEXEC),
+ MountInfo('cgroup2', 'cgroup2', '/sys/fs/cgroup', '',
+ MS_NOSUID|MS_NODEV|MS_NOEXEC|MS_STRICTATIME),
MountInfo('tmpfs', 'tmpfs', '/dev/shm', 'mode=1777',
MS_NOSUID|MS_NODEV|MS_STRICTATIME),
MountInfo('tmpfs', 'tmpfs', '/run', 'mode=0755',
@@ -74,6 +76,7 @@ busconfig.dtd\">
<busconfig>
<type>system</type>
<limit name=\"reply_timeout\">2147483647</limit>
+<auth>EXTERNAL</auth>
<auth>ANONYMOUS</auth>
<allow_anonymous/>
<policy context=\"default\">
@@ -152,6 +155,9 @@ class Init:
fcntl.ioctl(STDIN_FILENO, TIOCSTTY, 1)
+ with open('/etc/passwd', 'w+') as f:
+ f.write(f'root:x:0:0::/root:/bin/bash')
+
os.system('ip link set dev lo up')
def stop_dbus(self):