From f6db9e263ad09c30685ca7babf52d140792bfcfd Mon Sep 17 00:00:00 2001 From: alban Date: Sun, 8 Oct 2017 09:15:37 +0200 Subject: [PATCH] [fix] Cleans up the removal of du.pl --- debian/alternc-slave.lintian | 2 -- debian/alternc.lintian | 2 -- etc/sudoers.d/alternc | 2 +- src/spoolsize.php | 6 +++--- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/debian/alternc-slave.lintian b/debian/alternc-slave.lintian index 9002d062..49a116ea 100644 --- a/debian/alternc-slave.lintian +++ b/debian/alternc-slave.lintian @@ -1,9 +1,7 @@ -alternc-slave: setuid-binary usr/lib/alternc/du.pl 4750 root/www-data alternc-slave: setuid-binary usr/lib/alternc/mem_add 4750 root/www-data alternc-slave: setuid-binary usr/lib/alternc/mem_del 4750 root/www-data alternc-slave: setuid-binary usr/lib/alternc/quota_edit 4750 root/www-data alternc-slave: setuid-binary usr/lib/alternc/quota_get 4750 root/www-data -alternc-slave: executable-is-not-world-readable usr/lib/alternc/du.pl 4750 alternc-slave: executable-is-not-world-readable usr/lib/alternc/fixperms.sh 0750 != 0755 alternc-slave: executable-is-not-world-readable usr/lib/alternc/mem_add 4750 alternc-slave: executable-is-not-world-readable usr/lib/alternc/mem_del 4750 diff --git a/debian/alternc.lintian b/debian/alternc.lintian index b979d882..b51b7292 100644 --- a/debian/alternc.lintian +++ b/debian/alternc.lintian @@ -6,7 +6,6 @@ alternc: setuid-binary usr/lib/alternc/quota_get 4750 root/www-data alternc: setuid-binary usr/lib/alternc/mem_add 4750 root/www-data alternc: setuid-binary usr/lib/alternc/mem_del 4750 root/www-data alternc: setuid-binary usr/lib/alternc/db_create 4750 root/www-data -alternc: setuid-binary usr/lib/alternc/du.pl 4750 root/www-data alternc: non-standard-executable-perm usr/lib/alternc/quota_edit.sh 0750 != 0755 alternc: non-standard-executable-perm usr/lib/alternc/quota_get.sh 0750 != 0755 alternc: non-standard-executable-perm usr/lib/alternc/sqlbackup.sh 0750 != 0755 @@ -36,7 +35,6 @@ alternc: executable-is-not-world-readable usr/lib/alternc/slave_dns 0750 != 0755 alternc: executable-is-not-world-readable usr/lib/alternc/update_domains.sh 0750 != 0755 alternc: executable-is-not-world-readable usr/lib/alternc/functions_hosting.sh 0750 != 0755 alternc: executable-is-not-world-readable usr/lib/alternc/functions_dns.sh 0750 != 0755 -alternc: executable-is-not-world-readable usr/lib/alternc/du.pl 4750 alternc: executable-is-not-world-readable usr/lib/alternc/quota_init 0750 != 0755 alternc: executable-is-not-world-readable usr/lib/alternc/spoolsize.php 0750 != 0755 alternc: executable-is-not-world-readable usr/lib/alternc/rawstat.daily 0750 != 0755 diff --git a/etc/sudoers.d/alternc b/etc/sudoers.d/alternc index 82baf029..e104e6a9 100644 --- a/etc/sudoers.d/alternc +++ b/etc/sudoers.d/alternc @@ -1,2 +1,2 @@ -alterncpanel ALL = NOPASSWD : /usr/bin/quota, /usr/sbin/setquota, /usr/lib/alternc/fixperms.sh, /usr/lib/alternc/mem_add, /usr/lib/alternc/mem_del, /usr/lib/alternc/quota_edit, /usr/lib/alternc/quota_get, /usr/lib/alternc/du.pl, /usr/lib/alternc/update_mails.sh, /usr/sbin/repquota +alterncpanel ALL = NOPASSWD : /usr/bin/quota, /usr/sbin/setquota, /usr/lib/alternc/fixperms.sh, /usr/lib/alternc/mem_add, /usr/lib/alternc/mem_del, /usr/lib/alternc/quota_edit, /usr/lib/alternc/quota_get, /usr/bin/du, /usr/lib/alternc/update_mails.sh, /usr/sbin/repquota vmail ALL = NOPASSWD : /usr/lib/dovecot/deliver diff --git a/src/spoolsize.php b/src/spoolsize.php index dfbbaf95..d32143c1 100644 --- a/src/spoolsize.php +++ b/src/spoolsize.php @@ -58,9 +58,9 @@ if ($db->query("SELECT uid, name FROM mailman;")) { } foreach ($cc as $c){ echo $c["uid"]."/".$c["name"]; flush(); - $size1=exec("sudo /usr/lib/alternc/du.pl ".escapeshellarg("/var/lib/mailman/lists/".$c["name"])); - $size2=exec("sudo /usr/lib/alternc/du.pl ".escapeshellarg("/var/lib/mailman/archives/private/".$c["name"])); - $size3=exec("sudo /usr/lib/alternc/du.pl ".escapeshellarg("/var/lib/mailman/archives/private/".$c["name"].".mbox")); + $size1=exec("sudo /usr/bin/du ".escapeshellarg("/var/lib/mailman/lists/".$c["name"])); + $size2=exec("sudo /usr/bin/du ".escapeshellarg("/var/lib/mailman/archives/private/".$c["name"])); + $size3=exec("sudo /usr/bin/du ".escapeshellarg("/var/lib/mailman/archives/private/".$c["name"].".mbox")); $size=(intval($size1)+intval($size2)+intval($size3)); $db->query("REPLACE INTO size_mailman SET uid=?,list=?,size=?;",array($c["uid"],$c["name"],$size)); echo " done (".(round($size/1024, 1))." MB) \n"; flush();