{
if (&get_mounted($_[1], "*") < 0) { return (); }
if ($_[0] eq "proc" || $_[0] eq "swap") { return (); }
-&execute_command("df -k $_[1]", undef, \$out, undef, 0, 1);
+my $out;
+&execute_command("df -k ".quotemeta($_[1]), undef, \$out, undef, 0, 1);
if ($out =~ /Mounted on\n\S+\s+(\S+)\s+\S+\s+(\S+)/) {
return ($1, $2);
}
if ($_[0] eq "swap") {
return ();
}
-local $out;
-&execute_command("bdf $_[1]", undef, \$out, \$out, 0, 1);
+my $out;
+&execute_command("bdf ".quotemeta($_[1]), undef, \$out, \$out, 0, 1);
if ($out =~ /Mounted on\n\S+\s+(\S+)\s+\S+\s+(\S+)/) {
return ($1, $2);
}
if ($_[0] eq "fd" || $_[0] eq "proc" || $_[0] eq "swap" || $_[0] eq "autofs") {
return ();
}
-if (&backquote_command("df -k $_[1]", 1) =~
+if (&backquote_command("df -k ".quotemeta($_[1]), 1) =~
/Mounted on\n\S+\s+\S+\s+(\S+)\s+\S+\s+(\S+)/) {
return ($1, $2);
}
if (&get_mounted($_[1], "*") < 0) { return (); }
if ($_[0] eq "proc" || $_[0] eq "swap" ||
$_[0] eq "auto" || $_[0] eq "autofs") { return (); }
-local $out = &backquote_command("LC_ALL='' LANG='' df -k $_[1]", 1);
+local $out = &backquote_command("LC_ALL='' LANG='' df -k ".quotemeta($_[1]), 1);
if ($out =~ /Mounted on\n\S+\s+(\S+)\s+\S+\s+(\S+)/) {
return ($1, $2);
}
{
if (&get_mounted($_[1], "*") < 0) { return (); }
if ($_[0] eq "proc" || $_[0] eq "swap") { return (); }
-if (&backquote_command("df -k $_[1]", 1) =~
+if (&backquote_command("df -k ".quotemeta($_[1]), 1) =~
/Mounted on\n\S+\s+(\S+)\s+\S+\s+(\S+)/) {
return ($1, $2);
}
{
if (&get_mounted($_[1], "*") < 0) { return (); }
if ($_[0] eq "proc" || $_[0] eq "swap") { return (); }
-if (&backquote_command("df -k $_[1]", 1) =~
+if (&backquote_command("df -k ".quotemeta($_[1]), 1) =~
/Mounted on\n\S+\s+(\S+)\s+\S+\s+(\S+)/) {
return ($1, $2);
}
{
if (&get_mounted($_[1], "*") < 0) { return (); }
if ($_[0] eq "proc" || $_[0] eq "swap") { return (); }
-if (&backquote_command("df -k $_[1]", 1) =~
+if (&backquote_command("df -k ".quotemeta($_[1]), 1) =~
/Mounted on\n\S+\s+(\S+)\s+\S+\s+(\S+)/) {
return ($1, $2);
}
if ($_[0] eq "fd" || $_[0] eq "proc" || $_[0] eq "swap" || $_[0] eq "autofs") {
return ();
}
-if (&backquote_command("df -k $_[1]", 1) =~
+if (&backquote_command("df -k ".quotemeta($_[1]), 1) =~
/Mounted on\n\S+\s+(\S+)\s+\S+\s+(\S+)/) {
return ($1, $2);
}
if ($_[0] eq "fd" || $_[0] eq "proc" || $_[0] eq "swap" || $_[0] eq "autofs") {
return ();
}
-if (&backquote_command("df -k $_[1]", 1) =~
- /Mounted on\n\S+\s+(\S+)\s+\S+\s+(\S+)/) {
- return ($1, $2);
+if (&backquote_command("df -k ".quotemeta($_[1]), 1) =~
+ /Mounted on\n\S+\s+(\S+)\s+(\S+)\s+(\S+)/) {
+ if ($1 == 0) {
+ # Size is sometimes zero on Solaris? Fake it..
+ return ($2+$3, $3);
+ }
+ else {
+ return ($1, $3);
+ }
}
return ( );
}
if ($_[0] eq "fd" || $_[0] eq "proc" || $_[0] eq "swap" || $_[0] eq "autofs") {
return ();
}
-if (&backquote_command("df -k $_[1]", 1) =~
+if (&backquote_command("df -k ".quotemeta($_[1]), 1) =~
/Mounted on\n\S+\s+(\S+)\s+\S+\s+(\S+)/) {
return ($1, $2);
}