From 95d90855603ac4e65d95c741888ef60c4b3b049e Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Thu, 28 Nov 2013 09:49:04 +0000 Subject: Use /proc/self/mountinfo for ro filesystem checks mga#11319 --- urpm/sys.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'urpm') 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; } -- cgit v1.2.1