Package: golang-github-containers-common
Version: 0.33.4+ds1-1
Severity: normal

When the environment variable `DBUS_SESSION_BUS_ADDRESS` contains the GUID,
the detection of the systemd user session fails. This happens, e.g., when
starting konsole using krunner on KDE. In this case podman will print a long
error message and refuses to use systemd for cgroup management.

To reproduce:

  1. Start KDE.
  2. Right click the desktop and start KRunner.
  3. Enter "konsole" and hit enter.
  4. The environment variable `DBUS_SESSION_BUS_ADDRESS` should look as
     follows.

         unix:path=/run/user/.../bus,guid=...

  5. In the window of konsole enter `podman image ls`. A warning message is 
shown.

Looking at the code, I would assume that the error is in the file
`pkg/config/config.go` starting at line 539. Comparing with the upstream code
[1] suggests that the error has been fixed in upstream. Replacing the code
block starting at line 539 with the code block at [1] should solve the issue.
A patch file is attached. I did, however, not test the patch.

[1]: 
https://github.com/containers/common/blob/74022015478a9621623656b7998c87f198295df9/pkg/config/config.go#L641


-- System Information:
Debian Release: 11.0
  APT prefers stable-security
  APT policy: (500, 'stable-security'), (500, 'stable'), (500, 'oldstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.10.0-8-rt-amd64 (SMP w/4 CPU threads; PREEMPT)
Kernel taint flags: TAINT_CRAP, TAINT_FIRMWARE_WORKAROUND
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages golang-github-containers-common depends on:
ii  golang-github-containers-image  5.10.3-1

golang-github-containers-common recommends no packages.

golang-github-containers-common suggests no packages.

-- no debconf information
diff -Naur golang-github-containers-common-0.33.4+ds1.orig/pkg/config/config.go 
golang-github-containers-common-0.33.4+ds1/pkg/config/config.go
--- golang-github-containers-common-0.33.4+ds1.orig/pkg/config/config.go        
2021-08-29 13:44:23.361683928 +0200
+++ golang-github-containers-common-0.33.4+ds1/pkg/config/config.go     
2021-08-29 13:45:32.322985875 +0200
@@ -538,10 +538,15 @@
 
        session := os.Getenv("DBUS_SESSION_BUS_ADDRESS")
        hasSession := session != ""
-       if hasSession && strings.HasPrefix(session, "unix:path=") {
-               _, err := os.Stat(strings.TrimPrefix(session, "unix:path="))
-               hasSession = err == nil
-       }
+       if hasSession {
+               for _, part := range strings.Split(session, ",") {
+                       if strings.HasPrefix(part, "unix:path=") {
+                               _, err := os.Stat(strings.TrimPrefix(part, 
"unix:path="))
+                               hasSession = err == nil
+                               break
+                       }
+               }
+       } 
 
        if !hasSession {
                logrus.Warningf("The cgroupv2 manager is set to systemd but 
there is no systemd user session available")

Reply via email to