[vhffs-dev] [svn] commit: r266 - /trunk/vhffs-robots/src/fix_quota.pl |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
Author: gradator
Date: Tue Oct 31 03:31:02 2006
New Revision: 266
Log:
hop hop, now using the perl quota module instead stupid fork to setquota
Modified:
trunk/vhffs-robots/src/fix_quota.pl
Modified: trunk/vhffs-robots/src/fix_quota.pl
==============================================================================
--- trunk/vhffs-robots/src/fix_quota.pl (original)
+++ trunk/vhffs-robots/src/fix_quota.pl Tue Oct 31 03:31:02 2006
@@ -34,6 +34,7 @@
use POSIX;
use locale;
use Locale::gettext;
+use Quota;
use Vhffs::Main;
use Vhffs::Robots;
use Vhffs::Group;
@@ -59,8 +60,7 @@
$inodes = $group->get_quota * 1126400 / 100;
if( -x "/usr/sbin/setquota" )
{
- $cmd = "/usr/sbin/setquota -g ".$group->get_gid ." ".$blocks." ".$blocks." ".$inodes." ".$inodes." ".$vhffs->get_config->get_datadir;
- system( $cmd );
+ Quota::setqlim(Quota::getqcarg($vhffs->get_config->get_datadir), $group->get_gid, $blocks, $blocks, $inodes, $inodes, 0, 1);
Vhffs::Robots::vhffs_log( sprintf( "Update quota for group %s set %s" , $group->get_groupname , $group->get_quota ) );
}
}
@@ -76,8 +76,7 @@
$inodes = 1126400 / 100;
if( -x "/usr/sbin/setquota" )
{
- $cmd = "/usr/sbin/setquota -g ".$user->get_gid ." ".$blocks." ".$blocks." ".$inodes." ".$inodes." ".$vhffs->get_config->get_datadir;
- system( $cmd );
+ Quota::setqlim(Quota::getqcarg($vhffs->get_config->get_datadir), $user->get_gid, $blocks, $blocks, $inodes, $inodes, 0, 1);
Vhffs::Robots::vhffs_log( sprintf( "Update quota for user group %s set 1" , $user->get_username ) );
}
}