FS#21971 - Be less stringent on read-only file checking

Attached to Project: Pacman
Opened by Allan McRae (Allan) - Friday, 03 December 2010, 14:23 GMT
Last edited by Allan McRae (Allan) - Saturday, 16 February 2013, 01:19 GMT
Task Type Bug Report
Category General
Status Closed
Assigned To Dan McGee (toofishes)
Allan McRae (Allan)
Dave Reisner (falconindy)
Architecture All
Severity Very Low
Priority Normal
Reported Version 3.4.1
Due in Version 4.1.0
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

In "can_remove_file" in lib/libalpm/remove.c

/* If we fail write permissions due to a read-only filesystem, abort.
* Assume all other possible failures are covered somewhere else */

We could skip that check for _folders_ that are in both the old and the new package as they do not need removed. Or at least it does not matter if they are failed to be removed as is shown later in remove.c...

if(S_ISDIR(buf.st_mode)) {
if(rmdir(file)) {
/* this is okay, other packages are probably using it (like /usr) */
...
This task depends upon

Closed by  Allan McRae (Allan)
Saturday, 16 February 2013, 01:19 GMT
Reason for closing:  Fixed
Additional comments about closing:  See also  FS#30884 
Comment by Allan McRae (Allan) - Friday, 03 December 2010, 14:26 GMT
This was noted in  FS#20894  where the /media/cd/ folder was read-only during an update due to a cd being mounted there. The /media/cd/ folder was in the updated package so did pacman did not need to abort due to it being read-only.
Comment by Dan McGee (toofishes) - Friday, 03 December 2010, 15:19 GMT
This is a pretty small corner case, but yeah if we do a stat in can_remove_file instead and check if it is a directory I would be fine with that. It also makes me think twice about that rmdir comment. This stuff last looked at in 2798ebbb6286b and 6f870968edd; introduced in a94e22d9245f ( FS#5887 ).

Comment by Pierre Schmitz (Pierre) - Thursday, 21 June 2012, 20:10 GMT
This bug is also triggered by recent devtools which mount the host's sys read-only into the chroot. pacman fails to update the filesystem package here.
Comment by Allan McRae (Allan) - Saturday, 09 February 2013, 03:16 GMT
Dave has most of a patch for this, which would be good to get in 4.1.
Comment by Allan McRae (Allan) - Saturday, 16 February 2013, 01:19 GMT
We now skip removing mountpoints - so some of this is fixed... Closing in favour of  FS#30884  which specifically deals with read-only filesystems

Loading...