The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
CHANGES 011
META.yml 11
Quota.pm 33
Quota.xs 1012
README 22
test.pl 04
6 files changed (This is a version diff) 1633
@@ -1,3 +1,14 @@
+Changes in 1.6.6 (June 2011)
+- Ignore "rootfs" filesystem in Quota::getqcarg() on Linux, which always
+  is a duplicate.  Thanks to "abaturin" for providing this patch.
+- Made test.pl exit immediately when AUTOMATED_TESTING is set in the
+  environment (same as when called not from a tty), as all tests require
+  user interaction. Changed on request of TODDR of cpan.org
+
+Changes in 1.6.5 (January 2011)
+- Fixed syntax error and missing init for params to setqlim()
+  Thanks to Heinrich Mislik for reporting the bugs
+
 Changes in 1.6.4 (January 2010)
 - Fixed RPC quota block count truncation to 32bit (CPAN ticket 52813 )
   Thanks to Lloyd Brown for reporting the bug
@@ -1,7 +1,7 @@
 --- #YAML:1.0
 name: Quota
 abstract: Quota - Perl interface to file system quotas
-version: 1.6.4
+version: 1.6.6
 author:
   - Tom Zoerner <tomzo@users.sourceforge.net>
 license: perl
@@ -1,5 +1,5 @@
 # ------------------------------------------------------------------------ #
-# Quota.pm - Copyright (C) 1995-2010 Tom Zoerner
+# Quota.pm - Copyright (C) 1995-2011 Tom Zoerner
 # ------------------------------------------------------------------------ #
 # This program is free software: you can redistribute it and/or modify
 # it either under the terms of the Perl Artistic License or the GNU
@@ -22,7 +22,7 @@ require DynaLoader;
 @ISA = qw(Exporter DynaLoader);
 @EXPORT = ();
 
-$VERSION = '1.6.4';
+$VERSION = '1.6.6';
 
 bootstrap Quota;
 
@@ -69,7 +69,7 @@ sub getqcarg {
 
   if(defined($dev) && ($target ne "") && !Quota::setmntent()) {
     while(($fsname,$path,$fstyp,$fsopt) = Quota::getmntent()) {
-      next if $fstyp =~ /^(lofs|ignore|auto.*|proc)$/;
+      next if $fstyp =~ /^(lofs|ignore|auto.*|proc|rootfs)$/;
       my($pdev) = (stat($path))[0];
       if (defined($pdev) && ($dev == $pdev)) {
         if ($fsname =~ m|^[^/]+:/|) {
@@ -176,6 +176,7 @@ getnfsquota(hostp, fsnamep, uid, kind, dqp)
   case Q_OK:
     {
       struct timeval tv;
+      int qb_fac;
 
       gettimeofday(&tv, NULL);
 #ifdef LINUX_RQUOTAD_BUG
@@ -196,18 +197,18 @@ getnfsquota(hostp, fsnamep, uid, kind, dqp)
         dqp->QS_BSOFT = gq_rslt.GQR_RQUOTA.rq_bsoftlimit;
         dqp->QS_BCUR = gq_rslt.GQR_RQUOTA.rq_curblocks;
 
-	/* we rely on the fact that block sizes are always powers of 2 */
-	/* so the conversion factor will never be a fraction */
-        int qb_fac = gq_rslt.GQR_RQUOTA.rq_bsize / DEV_QBSIZE;
-	dqp->QS_BHARD *= qb_fac;
-	dqp->QS_BSOFT *= qb_fac;
-	dqp->QS_BCUR *= qb_fac;
+        /* we rely on the fact that block sizes are always powers of 2 */
+        /* so the conversion factor will never be a fraction */
+        qb_fac = gq_rslt.GQR_RQUOTA.rq_bsize / DEV_QBSIZE;
+        dqp->QS_BHARD *= qb_fac;
+        dqp->QS_BSOFT *= qb_fac;
+        dqp->QS_BCUR *= qb_fac;
       }
       else {
-        int qb_fac = DEV_QBSIZE / gq_rslt.GQR_RQUOTA.rq_bsize;
-	dqp->QS_BHARD = gq_rslt.GQR_RQUOTA.rq_bhardlimit / qb_fac;
-	dqp->QS_BSOFT = gq_rslt.GQR_RQUOTA.rq_bsoftlimit / qb_fac;
-	dqp->QS_BCUR = gq_rslt.GQR_RQUOTA.rq_curblocks / qb_fac;
+        qb_fac = DEV_QBSIZE / gq_rslt.GQR_RQUOTA.rq_bsize;
+        dqp->QS_BHARD = gq_rslt.GQR_RQUOTA.rq_bhardlimit / qb_fac;
+        dqp->QS_BSOFT = gq_rslt.GQR_RQUOTA.rq_bsoftlimit / qb_fac;
+        dqp->QS_BCUR = gq_rslt.GQR_RQUOTA.rq_curblocks / qb_fac;
       }
 #endif /* LINUX_RQUOTAD_BUG */
       dqp->QS_FHARD = gq_rslt.GQR_RQUOTA.rq_fhardlimit;
@@ -562,6 +563,7 @@ setqlim(dev,uid,bs,bh,fs,fh,timelimflag=0,kind=0)
           else
 #endif /* HAVE_JFS2 */
 	  {
+            memset(&dqblk, 0, sizeof(dqblk));
 	    dqblk.QS_BSOFT = Q_MUL(bs);
 	    dqblk.QS_BHARD = Q_MUL(bh);
 	    dqblk.QS_BTIME = timelimflag;
@@ -3,8 +3,8 @@ Quota extension module for Perl
 
 Author:    Tom Zoerner (tomzo AT users.sourceforge.net)
 
-Version:   1.6.4
-Date:      January 2010
+Version:   1.6.6
+Date:      June 2011
 DLSIP-Code:Rcdfg
            - stable release
            - C compiler required for installation
@@ -19,6 +19,10 @@ if (! -t) {
    print STDERR "\nThis is an interactive test script - input must be a tty\nExiting now.\n";
    exit;
 }
+if ($ENV{AUTOMATED_TESTING}) {
+   print STDERR "\nNo tests available for AUTOMATED_TESTING - Exiting now.\n";
+   exit;
+}
 
 while(1) {
   print "\nEnter path to get quota for (NFS possible; default '.'): ";