projects
/
webmin.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7b480c5
)
Only trusted parted 1.8_
author
Jamie Cameron
<jcameron@webmin.com>
Sat, 1 Oct 2011 23:24:22 +0000
(16:24 -0700)
committer
Jamie Cameron
<jcameron@webmin.com>
Sat, 1 Oct 2011 23:24:22 +0000
(16:24 -0700)
fdisk/fdisk-lib.pl
patch
|
blob
|
history
diff --git
a/fdisk/fdisk-lib.pl
b/fdisk/fdisk-lib.pl
index
d43e18d
..
a60728b
100755
(executable)
--- a/
fdisk/fdisk-lib.pl
+++ b/
fdisk/fdisk-lib.pl
@@
-27,7
+27,8
@@
elsif ($config{'mode'} eq 'fdisk') {
$has_parted = 0;
}
else {
- $has_parted = !$config{'noparted'} && &has_command("parted");
+ $has_parted = !$config{'noparted'} && &has_command("parted") &&
+ &get_parted_version() >= 1.8;
}
$| = 1;
@@
-1548,4
+1549,12
@@
else {
}
}
+# get_parted_version()
+# Returns the version number of parted that is installed
+sub get_parted_version
+{
+my $out = &backquote_command("parted -v 2>&1 </dev/null");
+return $out =~ /parted.*\s([0-9\.]+)/i ? $1 : undef;
+}
+
1;