diff options
author | Dave Reisner <dreisner@archlinux.org> | 2013-01-07 01:08:00 +0100 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2013-02-16 02:06:43 +0100 |
commit | 26a79cb29d279c529d58c62b7ad9c103c808d218 (patch) | |
tree | 625025456d32e3f4b5b1f90072062a7958f32f09 /lib/libalpm/backup.c | |
parent | 8fe8233dfa9c7827371168158784311cffb97556 (diff) | |
download | pacman-26a79cb29d279c529d58c62b7ad9c103c808d218.tar.gz pacman-26a79cb29d279c529d58c62b7ad9c103c808d218.tar.xz |
libalpm: never attempt to remove a mountpoint
Arch Linux typically runs into this with /sys when upgrading the
filesystem package in build chroots, but LXC users might also run into
this, since their /sys is shared from the host and must, for security
reasons, be mounted RO.
I've neglected to add any tests for this because they would require root
in order to run. Current tests all pass with this patch and I've
confirmed the desired behavior in a VM. Incidentally, the first hunk of
this patch (skipping can_remove_file checks for directories) resolves the
case of API mountpoints being removed since they eventually fall into
unlink_file and fail with "contains files". However, this patch should
still be the Right Thing To Do™, as we can't possibly remove a directory
that is also a mountpoint.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
[Allan] Do not skip checking if directories can be removed. Instead test
if directories are mountpoints in can_remove_file.
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib/libalpm/backup.c')
0 files changed, 0 insertions, 0 deletions