If anyone’s interested in having VSC support Dolphin’s “Open as Administrator” option, upvote the undermentioned:
opened 10:25PM - 30 Apr 25 UTC
feature-request
file-io
#### Does this issue occur when all extensions are disabled?
Yes
#### VS Co… de Version
<blockquote>
~~~YAML
Version: 1.99.3
Commit: 17baf841131aa23349f217ca7c570c76ee87b957
Date: 2025-04-15T23:18:46.076Z
Electron: 34.3.2
ElectronBuildId: 11161073
Chromium: 132.0.6834.210
Node.js: 20.18.3
V8: 13.2.152.41-electron.0
OS: Linux x64 6.14.4-300.fc42.x86_64
~~~
</blockquote>
It's `code-1.99.3-1744761644.el8.x86_64`:
1. ~~~sh
#!/usr/bin/env sh
dnf5 --refresh info 'code'
~~~
1. <blockquote>
~~~YAML
Name : code
Epoch : 0
Version : 1.99.3
Release : 1744761644.el8
Architecture : x86_64
Installed size : 400.4 MiB
Source : code-1.99.3-1744761644.el8.src.rpm
From repository : <unknown>
Vendor : Microsoft Corporation
~~~
</blockquote>
#### OS Version
1. ~~~pwsh
#!/usr/bin/env pwsh
#Requires -PSEdition Core
Get-Content -LiteralPath '/etc/os-release' | Select-String -SimpleMatch 'CPE_NAME'
~~~
1. <blockquote>
~~~desktop
CPE_NAME="cpe:/o:fedoraproject:fedora:42"
~~~
</blockquote>
#### Steps to Reproduce
https://github.com/user-attachments/assets/ce21dad9-3f49-4346-8327-60f90220c7cf
1. Configure the OS & DE to match my `kinfo` output (which should be the default state of the Fedora Workstation's KDE Spin):
<blockquote>
~~~YAML
KDE Plasma Version: 6.3.4
KDE Frameworks Version: 6.13.0
Qt Version: 6.9.0
Kernel Version: 6.14.4-300.fc42.x86_64 (64-bit)
Graphics Platform: Wayland
~~~
</blockquote>
1. ~~~sh
#!/usr/bin/env sh
touch '/home/file.txt' && \
sudo chown root:root '/home/file.txt'
~~~
1. #### `kwrite`
KWrite understands that the file contains content:
1. ~~~pwsh
#!/usr/bin/env pwsh
#Requires -PSEdition Core
kwrite 'admin:///home/file.txt'
~~~
1. 
1. 
If authentication fails, it states so:
1. 
1. 
<details>
<blockquote>
~~~log
"org.freedesktop.DBus.Error.AccessDenied" ""
"org.freedesktop.DBus.Error.AccessDenied" ""
kf.kio.workers.file: readData() returned -1
kf.kio.core: Connection::send() called with connection not invited
~~~
</blockquote>
</details>
1. #### `code`
VSC considers the file to be empty:
1. ~~~pwsh
#!/usr/bin/env pwsh
#Requires -PSEdition Core
code 'admin:///home/file.txt'
~~~
1. 
If I attempt to close the file, it prompts me to save it:

If I do so, VSC considers the file content to be overwritten:

However, it merely reprompts me when I attempt to close the tab again. ~~This behaviour repeats even when I merely supply a path, though.~~ [^path]
[^path]: [`issues/247915#issue-3032730656`](https://github.com/microsoft/vscode/issues/247915#issue-3032730656:~:text=637%20%C3%97%20362:-,Image,Image,-1)
#### Solution
1. Always prompt for superuser elevation when necessary.
1. Throw a (user-comprehensible) exception when an unsupported URI is provided as the location parameter's argument.
#### Permissions
1. #### `admin:///home/test.txt`
<blockquote>
~~~RS
stat admin:///home/test.txt
File: admin:///home/test.txt
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: 0,45 Inode: 6819027 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/RokeJulianLockhart) Gid: ( 1000/RokeJulianLockhart)
Context: unconfined_u:object_r:user_home_t:s0
Access: 2025-04-30 23:21:04.171264682 +0100
Modify: 2025-04-30 23:20:56.111128774 +0100
Change: 2025-04-30 23:20:56.111128774 +0100
Birth: 2025-04-30 23:20:43.068908859 +0100
~~~
</blockquote>
1. #### `/home/test.txt`
<blockquote>
~~~RS
stat /home/test.txt
File: /home/test.txt
Size: 16 Blocks: 8 IO Block: 4096 regular file
Device: 0,45 Inode: 6819414 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Context: system_u:object_r:home_root_t:s0
Access: 2025-04-30 23:35:30.127866527 +0100
Modify: 2025-04-30 23:23:02.473703946 +0100
Change: 2025-04-30 23:38:32.925949552 +0100
Birth: 2025-04-30 23:23:02.473259465 +0100
~~~
</blockquote>
1. #### `admin:///home/`
<blockquote>
~~~RS
stat admin:///home/
File: admin:///home/
Size: 16 Blocks: 0 IO Block: 4096 directory
Device: 0,45 Inode: 6819026 Links: 1
Access: (0755/drwxr-xr-x) Uid: ( 1000/RokeJulianLockhart) Gid: ( 1000/RokeJulianLockhart)
Context: unconfined_u:object_r:user_home_t:s0
Access: 2025-04-30 23:20:44.166927373 +0100
Modify: 2025-04-30 23:20:43.068908859 +0100
Change: 2025-04-30 23:20:43.068908859 +0100
Birth: 2025-04-30 23:20:43.068908859 +0100
~~~
</blockquote>
1. #### `/home/`
<blockquote>
~~~RS
stat /home/
File: /home/
Size: 78 Blocks: 0 IO Block: 4096 directory
Device: 0,45 Inode: 256 Links: 1
Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Context: system_u:object_r:home_root_t:s0
Access: 2025-04-30 23:38:32.954950041 +0100
Modify: 2025-04-30 23:38:32.925949552 +0100
Change: 2025-04-30 23:38:32.925949552 +0100
Birth: 2025-03-09 14:50:28.432002762 +0000
~~~
</blockquote>
[^stat]
[^stat]: [`askubuntu.com/revisions/528414/1#content`](https://askubuntu.com/revisions/528414/1#content:~:text=Or%20stat:-,stat,-%5Bfilename%5D)
If it doesn’t get 20, it’ll be closed.
jbb
July 1, 2025, 9:26pm
4
As far as I know the admin:// scheme is kde-specific, so I kind of doubt third party applications will implement it.
Usually kio-fuse would handle these situations, but I imagine exposing the admin:// protocol through kio-fuse could have negative security implications. It might be excluded from kio-fuse, not sure.
1 Like
@jbb , indeed: I’d originally expected that support was transparent, hence why the issue was filed as a BR (before being converted into an FR by the triage assignee). However, it appears to not be! In retrospect, I should have filed an FR with KDE for an attribute in an application’s .desktop
that whitelists it for admin:
support, which Dolphin consumes. Otherwise, Dolphin’s administrator elevation merely appears inconistent to the point of broken.