Bug#280213: More info

John Goerzen John Goerzen <jgoerzen@complete.org>, 280213@bugs.debian.org
Mon, 8 Nov 2004 15:23:05 -0600


--LZvS9be/3tNcYl/X
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

The attached patch is a *work around* for this.  THIS IS NOT A FIX.

Note that there is another bug here: according to the spec, space isn't
checked if the space check value is set to 0, but it is checking it
here.

Note that the unsigned int/%ld changes didn't help anything.  I just
didn't back them out.

-- John

--LZvS9be/3tNcYl/X
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="receive.diff"

--- /tmp/receive.c	2004-11-08 13:04:51.000000000 -0600
+++ receive.c	2004-11-08 15:12:58.000000000 -0600
@@ -139,8 +139,8 @@
 
   /* check_spool_space is held in K because disks are getting huge */
 
-  if (statbuf.F_BAVAIL < (unsigned long)
-        ((((double)check_spool_space) * 1024.0 + (double)msg_size) /
+  if (statbuf.F_BAVAIL < (fsblkcnt_t)
+        ((((double)check_spool_space) * 1024.0 /* + (double)msg_size */) /
             (double)statbuf.F_FRSIZE)
        ||
       (statbuf.F_FILES > 0 &&
@@ -149,9 +149,9 @@
     rc = FALSE;
 
   DEBUG(D_receive)
-    debug_printf("spool directory %s space = %d blocks; inodes = %d; "
-      "check_space = %dK (%d blocks); inodes = %d; msg_size = %d (%d blocks)\n",
-      spool_directory, (int)statbuf.F_BAVAIL, (int)statbuf.F_FAVAIL,
+    debug_printf("spool directory %s space = %ld blocks; inodes = %ld; "
+      "check_space = %dK (%d blocks); inodes = %ld; msg_size = %d (%d blocks)\n",
+      spool_directory, (fsblkcnt_t)statbuf.F_BAVAIL, (fsfilcnt_t)statbuf.F_FAVAIL,
       check_spool_space,
       (int)(((double)check_spool_space * 1024.0) / (double)statbuf.F_FRSIZE),
       check_spool_inodes, msg_size, (int)(msg_size / statbuf.F_FRSIZE));

--LZvS9be/3tNcYl/X--