Welcome to the Pacman bug tracker. Please search the current bugs and feature requests before filing a new one! Use advanced search and select "Search in Comments".

* Please select the correct category and version.
* Write a descriptive summary, background info, and provide a reproducible test case whenever possible.

FS#3564 - Pacman + Immutable Files

Attached to Project: Pacman
Opened by Marno van der Molen (Target) - Friday, 02 December 2005, 17:17 GMT
Last edited by Aaron Griffin (phrakture) - Friday, 28 September 2007, 02:22 GMT
Task Type Bug Report
Category General
Status Assigned
Assigned To Aaron Griffin (phrakture)
Dan McGee (toofishes)
Architecture All
Severity Very Low
Priority Normal
Reported Version 0.7 Wombat
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No


Hello everyone,

I think I've found a bug in the way pacman handles files. See this forum post for an explanation:

It basically comes down to this: When you run pacman, and it has to write out to an immutable file (chattr +i) it will error that it cannot extract the file, but this is not a fatal error. I only noticed that the instalation had gone wrong when I tried to run 'useradd' (which I found belonged to the 'shadow' package). After trying to reinstall shadow, I noticed the error message that it could not write to /etc/shadow (cause it is chattr +i). I believe this is a bug cause you first remove the old binaries, and then start trying to write out to the config file. A check to see if it's writable / chattred would be in order. And I also think you should make the error that it could not write out the file a fatal one, and notify the user that the old binaries have been removed without installing the new ones.

This is the only bug I've found so far, and it's not a big deal. Thanks for creating such a great distribution, I enjoy it every day on my servers!

Greetings, Marno
Comment by Aaron Griffin (phrakture) - Friday, 28 September 2007, 02:22 GMT
After looking at this one, I'm not sure where to go with it.
The problem, is can_remove_file in lib/libalpm/remove.c - we don't check attributes like this.

The problem is, of course, that chattr is for ext filesystems only, and who knows what other filesystems have things like this.

I think, in here, the only logical way to solve this issue is with real transactional support for file changes like this.

Dan, opinions?