Resetting Mint's Default umask to 002

Write tutorials for Linux Mint here
More tutorials on https://github.com/orgs/linuxmint/discu ... /tutorials and (archive) on https://community.linuxmint.com/tutorial
Forum rules
Don't add support questions to tutorials; start your own topic in the appropriate sub-forum instead. Before you post read forum rules
Post Reply
altair4
Level 20
Level 20
Posts: 11460
Joined: Tue Feb 03, 2009 10:27 am

Resetting Mint's Default umask to 002

Post by altair4 »

Admittedly, this is going to be useful to a small subset of Mint's users unless they try to use the more traditional yet advanced permissions options available in Linux.

Mint18.2: Mint18.2 has changed it's display manager to LightDM from mdm and as I predicated below this issue went away and the default umask is allowed to be 0002 as intended. For Mint 18.2 no action is required.

To change the default umask in Mint:

Create a script:

Code: Select all

gksu gedit /etc/profile.d/umask.sh
Add this line - make sure there are no leading spaces before the umask operator:

Code: Select all

umask 0002
Reboot the box.

Background:

The effective default umask in Mint is 022 which means that every file you might create on your desktop system say through your file manager will save as 644. Readable to everyone but writeable only to the owner of the file. For most users that's fine but there are circumstances where you might want both user and group to be writeable by default.

In Ubuntu there is a file that among other things controls the default umask: /etc/login.defs
# If USERGROUPS_ENAB is set to "yes", that will modify this UMASK default value
# for private user groups, i. e. the uid is the same as gid, and username is
# the same as the primary group name: for these, the user permissions will be
# used as group permissions, e. g. 022 will become 002.
Later on in the file it states:
USERGROUPS_ENAB yes
That file with those settings does exactly what it is supposed to do and sets the default umask to 002. By default new files created by the user save as 664. Writeable to owner and group and readable to everyone else.

In Mint that file is identical to Ubuntu's with the exact same settings yet Mint's umask results in 022.

The problem appears to be Mint's display manager - mdm - as seen by this bug report: https://bugs.launchpad.net/linuxmint/+bug/1094990
It looks remarkably like a bug report issued to the gdm display manager 9 years earlier: https://bugs.debian.org/cgi-bin/bugrepo ... bug=314791

I suspect mdm is a fork of gdm. Ubuntu doesn't use mdm or gdm it uses lightdm. In fact if you were to replace mdm in Mint with lightdm the default umask resets itself to 002 without any user intervention.

The traditional methods of changing the default systematically don't seem to work as it appears mdm overrides them. Setting it at /etc/profile.d/umask.sh seems to do the trick.
Last edited by altair4 on Wed Jul 05, 2017 2:36 pm, edited 1 time in total.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
fbachofner
Level 3
Level 3
Posts: 101
Joined: Sun Aug 08, 2010 6:49 pm
Location: Seaside, CA

Re: Resetting Mint's Default umask to 002

Post by fbachofner »

This is still a problem (tested on LM 18) and I think it qualifies as a bug, especially as the impression is it should conform to the underlying Ubuntu distribution, but does in fact not.

Where is the appropriate place to enter a bug report for Linux Mint?
various self-built desktop machines and a MiniForums U550 mini-PC
each runs LinuxMint 20.3 with Cinnamon
i7 self-built server --> Ubuntu 20.04.3 LTR (with Cinnamon, for the rare GUI login)
various VPSes --> Ubuntu Server LTR (headless)
Cosmo.
Level 24
Level 24
Posts: 22968
Joined: Sat Dec 06, 2014 7:34 am

Re: Resetting Mint's Default umask to 002

Post by Cosmo. »

Here. You need to get an account on GitHub.
altair4
Level 20
Level 20
Posts: 11460
Joined: Tue Feb 03, 2009 10:27 am

Re: Resetting Mint's Default umask to 002

Post by altair4 »

Good luck with your efforts but ...

MDM is a fork of GDM 2.2 and GDM2 no longer exists since it was replaced with GDM3. Mint would have to:

** Determine the cause of the bug and fix it.
** Create MDM2 which would fork off of GDM3 with the hope that GDM3 does not have this issue.

I suspect either of these is not a trivial exercise but note that Gnome and Debian had 6 years to find a fix and either failed or just ignored the bug report. Ubuntu has moved on to LightDM where this is not an issue.

Correction: Debian didn't ignore the bug report it just took 10 years to respond to it:
https://bugs.debian.org/cgi-bin/bugrepo ... bug=314791

Then again perhaps a website labelled bugs.debian.org was never the right place to submit a bug report just as one labelled bugs.launchpad.net/linuxmint is apparently not the right place for Mint.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
fbachofner
Level 3
Level 3
Posts: 101
Joined: Sun Aug 08, 2010 6:49 pm
Location: Seaside, CA

Re: Resetting Mint's Default umask to 002

Post by fbachofner »

Cosmo. wrote:Here. You need to get an account on GitHub.
Thanks Cosmo!

Already had a GH account . . .

I posted it a moment ago:
https://github.com/linuxmint/mdm/issues/190
various self-built desktop machines and a MiniForums U550 mini-PC
each runs LinuxMint 20.3 with Cinnamon
i7 self-built server --> Ubuntu 20.04.3 LTR (with Cinnamon, for the rare GUI login)
various VPSes --> Ubuntu Server LTR (headless)
fbachofner
Level 3
Level 3
Posts: 101
Joined: Sun Aug 08, 2010 6:49 pm
Location: Seaside, CA

Re: Resetting Mint's Default umask to 002

Post by fbachofner »

Hi altair4
altair4 wrote:Good luck with your efforts but ...

MDM is a fork of GDM 2.2 and GDM2 no longer exists since it was replaced with GDM3. Mint would have to:
<snip>
Interesting!

After many years of use I still don't fully appreciate the complete design philosophy of *nix, so I probably have some confusion here . . .
. . . but what does the display manager have to do with creating a file?

I recognize that the display manager is not the same as the graphical desktop, but shouldn't file management (creation, etc.) not be influenced by the display manager? It seems like this aspect of the system precedes any consideration of display . . . indeed, umask should affect file creation from any shell, right?
various self-built desktop machines and a MiniForums U550 mini-PC
each runs LinuxMint 20.3 with Cinnamon
i7 self-built server --> Ubuntu 20.04.3 LTR (with Cinnamon, for the rare GUI login)
various VPSes --> Ubuntu Server LTR (headless)
altair4
Level 20
Level 20
Posts: 11460
Joined: Tue Feb 03, 2009 10:27 am

Re: Resetting Mint's Default umask to 002

Post by altair4 »

fbachofner wrote:Hi altair4
altair4 wrote:After many years of use I still don't fully appreciate the complete design philosophy of *nix, so I probably have some confusion here . . .
. . . but what does the display manager have to do with creating a file?
None that I can think of and that's why there are bug reports on it. GDM "hard codes" the value and overrides all the usual documented ways of changing it. If you only use the command line there are ways of getting around this I suppose without using this HowTo but this is supposed to be a desktop oriented distro not a server.

There's probably a very good reason for it and one no other DM seems to need but I'm not on the mailing list for this one. Each distro has a personality with some quirks. For Mint this is just one of a couple that I always have to remember since they deviate from Ubuntu
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
Post Reply

Return to “Tutorials”