summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2013-11-28 09:49:04 +0000
committerColin Guthrie <colin@mageia.org>2013-11-28 09:49:04 +0000
commit95d90855603ac4e65d95c741888ef60c4b3b049e (patch)
treebdbe0ddeda52804b482d2408e124f88380ed4242 /urpm
parentcf32cbcf6213c38c6b05c62173b2afb3e6af304d (diff)
downloadurpmi-95d90855603ac4e65d95c741888ef60c4b3b049e.tar
urpmi-95d90855603ac4e65d95c741888ef60c4b3b049e.tar.gz
urpmi-95d90855603ac4e65d95c741888ef60c4b3b049e.tar.bz2
urpmi-95d90855603ac4e65d95c741888ef60c4b3b049e.tar.xz
urpmi-95d90855603ac4e65d95c741888ef60c4b3b049e.zip
Use /proc/self/mountinfo for ro filesystem checks mga#11319
Diffstat (limited to 'urpm')
-rw-r--r--urpm/sys.pm9
1 files changed, 7 insertions, 2 deletions
diff --git a/urpm/sys.pm b/urpm/sys.pm
index bfe0e719..3b9eee49 100644
--- a/urpm/sys.pm
+++ b/urpm/sys.pm
@@ -162,6 +162,11 @@ sub proc_mounts() {
@l;
}
+sub proc_self_mountinfo() {
+ my @l = cat_('/proc/self/mountinfo') or warn "Can't read /proc/self/mountinfo: $!\n";
+ @l;
+}
+
sub trim_until_d {
my ($dir) = @_;
foreach (proc_mounts()) {
@@ -179,8 +184,8 @@ Checks if the main filesystems are writable for urpmi to install files in
=cut
sub check_fs_writable () {
- foreach (proc_mounts()) {
- (undef, our $mountpoint, undef, my $opts) = split ' ';
+ foreach (proc_self_mountinfo()) {
+ (undef, undef, undef, undef, our $mountpoint, my $opts) = split ' ';
if ($opts =~ /(?:^|,)ro(?:,|$)/ && $mountpoint =~ m!^(/|/usr|/s?bin)\z!) {
return 0;
}