From e6377f0b98d35b68ada4f633e34b18e7f5787a05 Mon Sep 17 00:00:00 2001 From: alban Date: Sun, 8 Oct 2017 09:03:06 +0200 Subject: [PATCH] [fix] The legacy du.pl script should be replaced by /usr/bin/du in spoolsize.php Turns out quotas were broken due to a header in du.pl printf "FIXME: do not work with Debian Compliance"; exit(1); The script is therefore unusable and useless now. --- src/du.pl | 43 ------------------------------------------- src/spoolsize.php | 2 +- 2 files changed, 1 insertion(+), 44 deletions(-) delete mode 100644 src/du.pl diff --git a/src/du.pl b/src/du.pl deleted file mode 100644 index 762265bf..00000000 --- a/src/du.pl +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/perl - -$ENV{PATH} = "/usr/bin:/bin"; -$ENV{CDPATH} = ""; - -printf "FIXME: do not work with Debian Compliance"; -exit(1); - - -$A=$ARGV[0]; -sub untaint { - my @list = @_; - for (@list) { - /(.*)/; - $_ = $1; - } wantarray ? @list : $list[0]; -} - -$A=untaint($A); -if ($A=~/^\/var\/alternc\/html\/[a-z0-9]\//) { - open(SI,"/usr/bin/du -s '$A'|"); - $B=; - $B=~/^([0-9]+).*/; - printf "$1\n"; -} -if ($A=~/^\/var\/alternc\/mail\/[a-z0-9_]\//) { - open(SI,"/usr/bin/du -s '$A'|"); - $B=; - $B=~/^([0-9]+).*/; - printf "$1\n"; -} -if ($A=~/^\/var\/alternc\/db\//) { - open(SI,"/usr/bin/du -s '$A'|"); - $B=; - $B=~/^([0-9]+).*/; - printf "$1\n"; -} -if ($A=~/^\/var\/lib\/mailman\//) { - open(SI,"/usr/bin/du -s '$A'|"); - $B=; - $B=~/^([0-9]+).*/; - printf "$1\n"; -} diff --git a/src/spoolsize.php b/src/spoolsize.php index f3bc9f6f..dfbbaf95 100644 --- a/src/spoolsize.php +++ b/src/spoolsize.php @@ -22,7 +22,7 @@ if ($db->query("SELECT uid,login FROM membres;")) { } else { // The QUOTA system being disabled, we need to use 'du' on each folder. $login = $db->f('login'); - $size=exec("/usr/lib/alternc/du.pl /var/www/alternc/".substr($login,0,1)."/".$login); + $size=exec("/usr/bin/du /var/www/alternc/".substr($login,0,1)."/".$login); } $db2->query("REPLACE INTO size_web SET uid=?, size=?;",array(intval($db->f('uid')),intval($size))); echo $db->f('login')." (".(round($size/1024, 1))." MB)\n";