Pacman

Historical bug tracker for the Pacman package manager.

The pacman bug tracker has moved to gitlab:
https://gitlab.archlinux.org/pacman/pacman/-/issues

This tracker remains open for interaction with historical bugs during the transition period. Any new bugs reports will be closed without further action.
Tasklist

FS#34786 - [pacman] 4.1.0-2: Permissions of files generated in /usr/share/mime depend on root's umask

Attached to Project: Pacman
Opened by Jed Liu (jed) - Sunday, 14 April 2013, 23:12 GMT
Last edited by Allan McRae (Allan) - Monday, 14 October 2013, 05:51 GMT
Task Type Bug Report
Category General
Status Closed
Assigned To No-one
Architecture All
Severity Medium
Priority Normal
Reported Version 4.1.0
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:
I have root's umask set to 077 in /root/.bashrc. Whenever /usr/share/mime is regenerated (via installing/uninstalling a package whose .INSTALL calls update-mime-database), most of the files in /usr/share/mime have permission bits 0600 instead of 0644.

This only started happening after updating a large slew of packages on 09 Apr, listed below. (Or, at least, my KDE apps started exhibiting mime errors after the updates, and I traced these errors to the permissions problem.) Since update-mime-database lives in shared-mime-info, which was not updated, I suspect changes in pacman are the cause.

Additional info:

Here's the relevant excerpt from /var/log/pacman.log.

[2013-04-09 15:28] upgraded pacman (4.0.3-7 -> 4.1.0-2)
[2013-04-09 15:45] [PACMAN] upgraded archlinux-keyring (20130224-1 -> 20130406-1)
[2013-04-09 15:45] [PACMAN] upgraded cairo-dock (3.2.0-1 -> 3.2.0-2)
[2013-04-09 15:45] [PACMAN] upgraded cairo-dock-plugins (3.2.0-1 -> 3.2.0-2)
[2013-04-09 15:45] [PACMAN] upgraded cups-filters (1.0.31-1 -> 1.0.33-1)
[2013-04-09 15:45] [PACMAN] upgraded postgresql-libs (9.2.3-1 -> 9.2.4-1)
[2013-04-09 15:45] [PACMAN] upgraded dovecot (2.1.15-2 -> 2.1.16-1)
[2013-04-09 15:45] [PACMAN] upgraded firefox (19.0.2-1 -> 20.0-1)
[2013-04-09 15:45] [PACMAN] upgraded git (1.8.2-1 -> 1.8.2.1-1)
[2013-04-09 15:45] [PACMAN] upgraded libgnome-media-profiles (3.0.0-3 -> 3.0.0-4)
[2013-04-09 15:45] [PACMAN] upgraded gnome-media (3.4.0-1 -> 3.4.0-2)
[2013-04-09 15:45] [PACMAN] upgraded harfbuzz (0.9.14-1 -> 0.9.15-1)
[2013-04-09 15:45] [PACMAN] upgraded imagemagick (6.8.4.0-1 -> 6.8.4.6-1)
[2013-04-09 15:45] [PACMAN] upgraded isl (0.11.1-1 -> 0.11.1-2)
[2013-04-09 15:45] [PACMAN] upgraded kdelibs (4.10.1-2 -> 4.10.2-1)
[2013-04-09 15:45] [PACMAN] upgraded nepomuk-core (4.10.1-1 -> 4.10.2-1)
[2013-04-09 15:45] [PACMAN] upgraded kactivities (4.10.1-1 -> 4.10.2-1)
[2013-04-09 15:45] [PACMAN] upgraded kde-base-artwork (4.10.1-1 -> 4.10.2-1)
[2013-04-09 15:46] [PACMAN] upgraded kde-wallpapers (4.10.1-1 -> 4.10.2-1)
[2013-04-09 15:46] [PACMAN] upgraded kdeartwork-wallpapers (4.10.1-1 -> 4.10.2-1)
[2013-04-09 15:46] [PACMAN] upgraded oxygen-icons (4.10.1-1 -> 4.10.2-1)
[2013-04-09 15:46] [PACMAN] upgraded kdebase-runtime (4.10.1-1 -> 4.10.2-2)
[2013-04-09 15:46] [PACMAN] upgraded kdebase-lib (4.10.1-1 -> 4.10.2-1)
[2013-04-09 15:46] [PACMAN] upgraded nepomuk-widgets (4.10.1-1 -> 4.10.2-1)
[2013-04-09 15:46] [PACMAN] upgraded kdebase-dolphin (4.10.1-1 -> 4.10.2-1)
[2013-04-09 15:46] [PACMAN] upgraded kdebase-katepart (4.10.1-1 -> 4.10.2-1)
[2013-04-09 15:46] [PACMAN] upgraded kdebase-keditbookmarks (4.10.1-1 -> 4.10.2-1)
[2013-04-09 15:46] [PACMAN] upgraded kdebase-konqueror (4.10.1-1 -> 4.10.2-1)
[2013-04-09 15:46] [PACMAN] upgraded kdebase-konsole (4.10.1-1 -> 4.10.2-1)
[2013-04-09 15:46] [PACMAN] upgraded kdepim-runtime (4.10.1-1 -> 4.10.2-1)
[2013-04-09 15:46] [PACMAN] upgraded lm_sensors (3.3.3-1 -> 3.3.3-2)
[2013-04-09 15:46] [PACMAN] upgraded kdebase-workspace (4.10.1-1 -> 4.10.2-1)
[2013-04-09 15:46] [PACMAN] upgraded kdebindings-python-common (4.10.1-1 -> 4.10.2-1)
[2013-04-09 15:46] [PACMAN] upgraded kdebindings-python (4.10.1-1 -> 4.10.2-1)
[2013-04-09 15:46] [PACMAN] upgraded kdegraphics-okular (4.10.1-1 -> 4.10.2-1)
[2013-04-09 15:46] [PACMAN] upgraded kdepimlibs (4.10.1-1 -> 4.10.2-1)
[2013-04-09 15:46] [PACMAN] upgraded kdeplasma-addons-applets-luna (4.10.1-1 -> 4.10.2-1)
[2013-04-09 15:46] [PACMAN] upgraded kdeplasma-addons-applets-notes (4.10.1-1 -> 4.10.2-1)
[2013-04-09 15:46] [PACMAN] upgraded kdeplasma-addons-libs (4.10.1-1 -> 4.10.2-1)
[2013-04-09 15:46] [PACMAN] upgraded kdeplasma-addons-applets-weather (4.10.1-1 -> 4.10.2-1)
[2013-04-09 15:46] [PACMAN] upgraded kdeutils-kwallet (4.10.1-1 -> 4.10.2-1)
[2013-04-09 15:46] [PACMAN] upgraded lib32-sqlite (3.7.16-1 -> 3.7.16.1-1)
[2013-04-09 15:46] [PACMAN] upgraded liblastfm (1.0.6-2 -> 1.0.7-1)
[2013-04-09 15:46] [PACMAN] upgraded libreoffice-en-GB (4.0.1-1 -> 4.0.2-1)
[2013-04-09 15:46] [PACMAN] upgraded python (3.3.0-3 -> 3.3.1-1)
[2013-04-09 15:46] [PACMAN] upgraded libreoffice-common (4.0.1-5 -> 4.0.2-2)
[2013-04-09 15:46] [PACMAN] upgraded libreoffice-gnome (4.0.1-5 -> 4.0.2-2)
[2013-04-09 15:46] [PACMAN] upgraded libreoffice-kde4 (4.0.1-5 -> 4.0.2-2)
[2013-04-09 15:46] [PACMAN] upgraded libreoffice-writer (4.0.1-5 -> 4.0.2-2)
[2013-04-09 15:46] [PACMAN] upgraded libxi (1.7-1 -> 1.7.1-1)
[2013-04-09 15:46] [PACMAN] upgraded libzip (0.10.1-1 -> 0.11-1)
[2013-04-09 15:46] [PACMAN] upgraded linux (3.8.4-1 -> 3.8.6-1)
[2013-04-09 15:46] [PACMAN] upgraded lirc-utils (1:0.9.0-39 -> 1:0.9.0-41)
[2013-04-09 15:46] [PACMAN] upgraded lua (5.2.1-3 -> 5.2.2-1)
[2013-04-09 15:46] [PACMAN] upgraded mpg123 (1.15.1-1 -> 1.15.3-1)
[2013-04-09 15:46] [PACMAN] upgraded phpmyadmin (3.5.7-2 -> 3.5.8-1)
[2013-04-09 15:46] [PACMAN] upgraded postgresql (9.2.3-1 -> 9.2.4-1)
[2013-04-09 15:46] [PACMAN] upgraded psmisc (22.19-1 -> 22.20-1)
[2013-04-09 15:46] [PACMAN] upgraded python-psycopg2 (2.4.6-1 -> 2.5-1)
[2013-04-09 15:46] [PACMAN] upgraded python2 (2.7.3-4 -> 2.7.4-1)
[2013-04-09 15:46] [PACMAN] upgraded python2-markdown (2.2.1-1 -> 2.3.1-1)
[2013-04-09 15:46] [PACMAN] upgraded subversion (1.7.8-1 -> 1.7.9-1)
[2013-04-09 15:46] [PACMAN] upgraded systemd (198-2 -> 200-1)
[2013-04-09 15:46] [PACMAN] upgraded systemd-sysvcompat (198-2 -> 200-1)
[2013-04-09 15:47] [PACMAN] upgraded thunderbird (17.0.4-1 -> 17.0.5-1)
[2013-04-09 15:47] [PACMAN] upgraded vhba-module (20120422-18 -> 20120422-20)
[2013-04-09 15:47] [PACMAN] upgraded virtualbox-host-modules (4.2.10-2 -> 4.2.10-4)
[2013-04-09 15:47] [PACMAN] upgraded wireshark-cli (1.8.6-1 -> 1.8.6-2)
[2013-04-09 15:47] [PACMAN] upgraded wireshark-gtk (1.8.6-1 -> 1.8.6-2)
[2013-04-09 15:47] [PACMAN] upgraded xf86-video-intel (2.21.5-1 -> 2.21.6-1)

Steps to reproduce:
1. Set umask 077 in /root/.bashrc.
2. pacman -S meld
3. Observe files in /usr/share/mime have permission bits 600 instead of 644.
This task depends upon

Closed by  Allan McRae (Allan)
Monday, 14 October 2013, 05:51 GMT
Reason for closing:  Not a bug
Additional comments about closing:  Not a pacman bug.
Comment by Jed Liu (jed) - Friday, 26 April 2013, 06:32 GMT
This issue is affecting my GNOME installation too. After updating to GNOME-3.8.1, I had to comment out the umask line in my /root/.bashrc and reinstall gsettings-desktop-schemas to get things to work.

I suspect this is because the package has an .INSTALL file containing a post_install() that calls glib-compile-schemas. With the "umask 077" in /root/.bashrc, /usr/share/glib-2.0/schemas/gschemas.compiled is created with permission bits 600. In this state, many of my GTK applications (e.g., firefox, gnome-terminal) segfault.

When I comment out the "umask" line in /root/.bashrc and reinstall gsettings-desktop-schemas, /usr/share/glib-2.0/schemas/gschemas.compiled is instead created with permission bits 644, and everything works fine.

It seems that pacman should be setting umask 022 before calling any of the functions in .INSTALL.
Comment by Allan McRae (Allan) - Saturday, 18 May 2013, 14:32 GMT
Interesting... here is where we run the install scripts:

umask(0022);
execv(cmd, argv);

so the umask is there. Needs more research.
Comment by Andrew Gregory (andrewgregory) - Saturday, 18 May 2013, 16:08 GMT
You must have BASH_ENV set so that /root/.bashrc is being sourced for non-interactive shells. There's not much pacman can do about that because it's sourced AFTER the umask(0022) call. The only way I see to avoid sourcing BASH_ENV is to invoke bash with the -p flag or unset BASH_ENV before running the script, although I'm not very eager to start hardcoding workarounds for specific shells into pacman. If you're using sudo, you could use SUDO_COMMAND to limit the umask 077 call to non-pacman commands.

Loading...