Bug 489008 - Cannot open files in /dev with error "WorkingDirectory= may not be below /proc/, /sys/ or /dev/"
Summary: Cannot open files in /dev with error "WorkingDirectory= may not be below /pro...
Status: RESOLVED UPSTREAM
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 24.05.1
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-22 20:59 UTC by Eamonn Rea
Modified: 2024-07-20 21:45 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eamonn Rea 2024-06-22 20:59:37 UTC
SUMMARY
When trying to open a file in "/dev", such as log files in "/dev/shm/", Dolphin is unable to open them and displays the error "WorkingDirectory= may not be below /proc/, /sys/ or /dev/" when trying to open them using any application such as Kate. However the applications themselves can open these files. You can run `kate /dev/shm/myfile.log` and open it just fine. Likewise you can open these files just fine, for example opening files in this directory with Kate using its file picker works just fine. It is only Dolphin which does not let you open files in this directory.

This is a regression in 6.1.0, and was not present in 6.0.5 and below - I regularly open files from /dev/shm, which is how I noticed this, but this bug is specific to any files in /dev.

STEPS TO REPRODUCE
1. Navigate to /dev in Dolphin.
2. Attempt to open a file in this directory.
3. Dolphin will display the message "WorkingDirectory= may not be below /proc/, /sys/ or /dev/"
    a. When trying to double-click the file, it will show it in a red box inside the Dolphin window
    b. When trying to open the file by right clicking -> Open With -> Application, the error is displayed in a dialog box.

OBSERVED RESULT
Dolphin cannot open files in /dev, whereas applications themselves (such as Kate) can open files in this directory.

EXPECTED RESULT
Dolphin should be able to open files in /dev, in particular /dev/shm as some applications will put logging information there.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 6.9.5 Linux Zen
KDE Plasma Version: 6.1.0
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.1

ADDITIONAL INFORMATION
I confirmed this issue across two separate machines, so I do not think it is an isolated problem.

If this is intentional, this is going to be quite problematic for applications that put logging information in /dev/shm, and should perhaps be reconsidered?
Comment 1 Eamonn Rea 2024-06-23 01:07:01 UTC
Attempted to use `xdg-open` to open this file and it does not work either, it gives the following error:

```
kf.kio.gui: Failed to launch process as service: "app-org.kde.kate@c6423623b2c042cdb697e96a24758e21.service" "org.freedesktop.DBus.Error.InvalidArgs" "WorkingDirectory= may not be below /proc/, /sys/ or /dev/"
WorkingDirectory= may not be below /proc/, /sys/ or /dev/
```

Perhaps this is an upstream issue with systemd? https://github.com/systemd/systemd/issues/33361 - Although that would suggest the changes came with systemd, but this just started happening to me since Plasma 6.1. Maybe it was just coincidental timing?
Comment 2 Eamonn Rea 2024-06-23 13:37:32 UTC
Might be a duplicate of Bug 488177.
Comment 3 Eamonn Rea 2024-07-06 01:13:21 UTC
Should be fixed in systemd 256.2 with this cherry-picked commit: https://github.com/systemd/systemd/commit/52371fe5263eb2916dcef69d93515f8d2a8e6043
Comment 4 Eamonn Rea 2024-07-20 21:45:17 UTC
Confirmed across two machines that this was fixed with a recent systemd update.