[debian-edu-commits] debian-edu/ 01/01: debian-edu-fsautoresize: Always use mapper names instead of kernel names when detecting supported mount points. (Closes: #800651). Thanks to Wolfgang Schweer and Giorgio Pioda.

Mike Gabriel sunweaver at debian.org
Wed Oct 14 07:48:58 UTC 2015


This is an automated email from the git hooks/post-receive script.

sunweaver pushed a commit to branch master
in repository debian-edu-config.

commit b9d0b1f7a8fa7c4d6e00cd61dc3fb2bc592d8c94
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Wed Oct 14 09:47:17 2015 +0200

    debian-edu-fsautoresize: Always use mapper names instead of kernel names when detecting supported mount points. (Closes: #800651). Thanks to Wolfgang Schweer and Giorgio Pioda.
---
 debian/changelog             | 3 +++
 sbin/debian-edu-fsautoresize | 8 ++++++++
 2 files changed, 11 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 2adbc0c..f9bbe81 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -20,6 +20,9 @@ debian-edu-config (1.819) UNRELEASED; urgency=low
       host blacklisting to be handled via the below NIS netgroup.
     - no-wakeup-in-the-morning-hosts: blacklist of hosts that are not
       to be woken up in the morning.
+  * debian-edu-fsautoresize: Always use mapper names instead of kernel names
+    when detecting supported mount points. (Closes: #800651). Thanks
+    to Wolfgang Schweer and Giorgio Pioda.
 
  -- Petter Reinholdtsen <pere at debian.org>  Sat, 16 May 2015 23:12:06 +0200
 
diff --git a/sbin/debian-edu-fsautoresize b/sbin/debian-edu-fsautoresize
index debfc0d..64c7b21 100644
--- a/sbin/debian-edu-fsautoresize
+++ b/sbin/debian-edu-fsautoresize
@@ -14,6 +14,7 @@ use warnings;
 
 use Getopt::Std;
 use Sys::Syslog qw(openlog syslog closelog LOG_NOTICE);
+use File::Basename;
 
 # Using this module (instead of Filesys::DiskSpace) to get a version
 # providing the device size, and not only free and used.
@@ -194,6 +195,13 @@ sub supported_mountpoints {
         chomp;
         my @f = split(/\s+/);
         my $device = $f[0];
+        # Always use mapper names instead of kernel ones.
+        if (index ($f[0], "/dev/dm-") != -1) {
+            for my $mapdevice (glob "/dev/mapper/*") {
+                my $dmdevice = basename(readlink $mapdevice) if -l $mapdevice;
+                $device = $mapdevice if defined($dmdevice) && $dmdevice =~ basename($f[0]);
+            }
+        }
         my $mountpoint = $f[1];
         my $typename = $f[2];
         next unless (exists $fsops{$typename});

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-edu/debian-edu-config.git



More information about the debian-edu-commits mailing list