Bug 493283 - Dophin does not honor user's UMASK
Summary: Dophin does not honor user's UMASK
Status: RESOLVED WORKSFORME
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 24.08.1
Platform: Fedora RPMs Linux
: NOR major
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-17 17:19 UTC by Emmett Culley
Modified: 2024-09-19 02:52 UTC (History)
2 users (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 Emmett Culley 2024-09-17 17:19:36 UTC
SUMMARY
Dolphin does not honor umask.  At first I thought it was kio issue, but now I see that even creating a local file or directory ignores user's umask

STEPS TO REPRODUCE
1.   Right click on panel and select to create file or directory
2.   Select directory or file and enter name.
3.  Hit enter key

OBSERVED RESULT
File or directory is created, but group write in not enabled, even though umask = 0002

ls result after creation:
drwxr-sr-x  2 emmett web_prog    6 Sep 17 09:53 cccapply

[emmett@ws1: dev]$ umask
0002


EXPECTED RESULT
Expect group write permission to be enabled.

SOFTWARE/OS VERSIONS

Linux/KDE Plasma:  Fedora 40
KDE Plasma Version:  6.1.4
KDE Frameworks Version:  6.5.0
Qt Version: 6.7.2

ADDITIONAL INFORMATION
6.10.7-200.fc40.x86_64 (64-bit) kernel
Using Wayland

Note that I have the group sticky bit set virtually everywhere, and that always works, and so creates all directories and files in directory with the same group as the parent.  As expected.
Comment 1 argonel 2024-09-18 04:57:25 UTC
How are you configuring the umask? It is working for me in Fedora 40.
Comment 2 Emmett Culley 2024-09-18 19:20:54 UTC
For my user, I set is in .bashrc.  

umask 0002
Comment 3 argonel 2024-09-18 23:41:19 UTC
That won't work in Fedora because the desktop session creation doesn't involve a shell, and the umask command only affects the current process and its descendants. There are various other options like creating a systemd override, but Fedora 40 has pam_umask enabled.

To use pam_umask, the umask should go after the fourth value in the GECOS field in the user's entry in /etc/passwd, for example:

    f40_vm:x:1000:1000:F40 Test,,,,umask=0002:/home/f40_vm:/bin/bash

As far as I know there aren't any tools that can manipulate the 5th and later values in the GECOS list, so you'll have to edit it manually. pam_umask doesn't care, but the umask directive might get displayed in unexpected places if its earlier in the list.
Comment 4 Emmett Culley 2024-09-19 00:57:02 UTC
That didn't help:
xfxfxfxf:x:1000:1000:Factor now,,,,umask=0002:/home/xfxfxfxf:/bin/bash

Still, creating a file or directory in dolphin still does not set group to write.  What am I missing?

Emmett
Comment 5 Emmett Culley 2024-09-19 01:04:48 UTC
Turns out  that did fix it.  I hadn't thought to log out and reset my machine.  Once I did that, the umask worked as expected.

Thanks
Comment 6 Emmett Culley 2024-09-19 01:32:40 UTC
I'm pretty happy as this fixes an issue I've had for years with my NFS server ignoring the umask.  I never noticed this using dolphin locally as it was pretty rare to create files from dolphin.

I'd sometimes also noticed this when using kio, but until recently I just worked around it as it wasn't soemting I needed to do very often.  It was this new project that has me roking on a remote host for som development work that finaly had finally take the time to create a bug report.  (get some help).

Thanks again for looking into this and providing the clues I needed.
Comment 7 argonel 2024-09-19 02:52:09 UTC
Excellent!