mintsources sets incorrect permissions on written files when user has umask set
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Linux Mint |
New
|
Undecided
|
Unassigned |
Bug Description
I have 'umask 027' set in my profile, to protect my files from being read by other users on the system by default. (This allows me, for example, to have guest use my computer with a guest account while having private files in my own area).
When I run `mintsources` and choose a different mirror, the files `/etc/apt/
Before:
ls -lh /etc/apt/
total 12K
-rw-r--r-- 1 root root 189 May 18 12:08 google-chrome.list
-rw-r--r-- 1 root root 561 Jun 4 15:35 official-
-rw-r--r-- 1 root root 585 Jun 4 15:35 official-
After:
ls -lh /etc/apt/
-rw-r--r-- 1 root root 189 May 18 12:08 google-chrome.list
-rw-r----- 1 root root 545 May 31 14:55 official-
-rw-r----- 1 root root 569 May 31 14:55 official-
The result is that various things that rely on users being able to read these files stop working. In particular, `apt-cache search foo` reports:
E: Opening /etc/apt/
E: The list of sources could not be read.
Also, the Mint Update Manager often reports an error about the APT cache being corrupted.
These errors are fixed by changing the permissions back to what they were.
Expected behaviour:
Either, the new files should be written ignoring the user's umask (this is probably correct behaviour for a tool that runs as root),
Or, the new files should be written with permissions that allow Mint's own package management tools to continue working,
Or, the new files should be written with the same permissions that they were before.
Also reported here - https:/ /github. com/linuxmint/ mintsources/ issues/ 97 - not sure which is the right place.