diff options
author | Martin Whitaker <mageia@martin-whitaker.me.uk> | 2018-01-14 22:30:56 +0000 |
---|---|---|
committer | Martin Whitaker <mageia@martin-whitaker.me.uk> | 2018-01-14 22:30:56 +0000 |
commit | 693b5e844102bced38b08bc13e758e12fd7f6fde (patch) | |
tree | 0dc0ea8c28cb98eeed890b0abda796dc68d81bf9 /lib | |
parent | 4c3460bb0e1b4886a4e90aaf33257c55f0971b50 (diff) | |
download | drakiso-693b5e844102bced38b08bc13e758e12fd7f6fde.tar drakiso-693b5e844102bced38b08bc13e758e12fd7f6fde.tar.gz drakiso-693b5e844102bced38b08bc13e758e12fd7f6fde.tar.bz2 drakiso-693b5e844102bced38b08bc13e758e12fd7f6fde.tar.xz drakiso-693b5e844102bced38b08bc13e758e12fd7f6fde.zip |
Add check for empty $root when mounting/unmounting filesystems.
Again to make sure we don't accidently affect the build system.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/MGA/DrakISO/Utils.pm | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/MGA/DrakISO/Utils.pm b/lib/MGA/DrakISO/Utils.pm index c283d0d..43dc357 100644 --- a/lib/MGA/DrakISO/Utils.pm +++ b/lib/MGA/DrakISO/Utils.pm @@ -140,6 +140,7 @@ sub mount { sub mount_system_fs { my ($root) = @_; + $root or die; mount($root . '/dev', '/dev', '--bind', '-o', 'ro'); mount($root . '/proc', 'none', '-t', 'proc'); mount($root . '/sys', 'none', '-t', 'sysfs'); @@ -148,6 +149,7 @@ sub mount_system_fs { sub umount_all_in_root { my ($root) = @_; + $root or die; $root = Cwd::abs_path($root); my @mounts = grep { $_ =~ $root } split("\n", cat_('/proc/mounts')); foreach (reverse(@mounts)) { |