Bug#769925: lpr will fail to accept print jobs on partitions larger than 1TB

2014-11-17 Thread Peter Schlaile
Package: lpr
Version: 1:2008.05.17+nmu1
Severity: important
Tags: patch

Dear Maintainer,

lpr fails to accept print jobs, if the spool directory is located on 
a partition larger or equal to 1TB.

Status to remote hosts looks like
no space on remote; waiting for queue to drain

Reason: lpd/chksize() makes certain assumptions about spacefree in 512 byte
blocks (stores it into a signed 32 bit int, 512*pow(2,31) equals 1 TB, things
go havoc, bla bla).

Changing the local variable spacefree into a long long fixes the problem:

--- lpr-2008.05.17+nmu1/lpd/recvjob.c   2005-01-29 05:40:20.0 +0100
+++ lpr-2008.05.17+nmu1.new/lpd/recvjob.c   2014-11-17 17:57:56.0 
+0100
@@ -298,7 +298,7 @@
 static int
 chksize(int size)
 {
-   int spacefree;
+   long long spacefree;
struct statfs sfb;
 
if (statfs(., sfb)  0) {




-- System Information:
Debian Release: 7.1
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.2.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE@euro, LC_CTYPE=de_DE@euro (charmap=ISO-8859-15)
Shell: /bin/sh linked to /bin/dash


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#769925: lpr will fail to accept print jobs on partitions larger than 1TB

2014-11-17 Thread Adam Majer
On Mon, Nov 17, 2014 at 06:21:22PM +0100, Peter Schlaile wrote:
 Package: lpr
 Version: 1:2008.05.17+nmu1
 Severity: important
 Tags: patch
 
 Dear Maintainer,
 
 lpr fails to accept print jobs, if the spool directory is located on 
 a partition larger or equal to 1TB.
 
 Status to remote hosts looks like
 no space on remote; waiting for queue to drain


Thank you for the bug report. Looking at the sources, it seems this
has been fixed upstream already with the following patch,

@@ -298,9 +298,11 @@ noresponse(void)
 static int
 chksize(int size)
 {
-   int spacefree;
+   int64_t spacefree;
struct statfs sfb;

+   if (size = 0)
+   return (0);
if (statfs(., sfb)  0) {
syslog(LOG_ERR, %s: %m, statfs(\.\));
return (1);


 Reason: lpd/chksize() makes certain assumptions about spacefree in 512 byte
 blocks (stores it into a signed 32 bit int, 512*pow(2,31) equals 1 TB, things
 go havoc, bla bla).
 
 Changing the local variable spacefree into a long long fixes the problem:
 
 --- lpr-2008.05.17+nmu1/lpd/recvjob.c 2005-01-29 05:40:20.0 +0100
 +++ lpr-2008.05.17+nmu1.new/lpd/recvjob.c 2014-11-17 17:57:56.0 
 +0100
 @@ -298,7 +298,7 @@
  static int
  chksize(int size)
  {
 - int spacefree;
 + long long spacefree;
   struct statfs sfb;
  
   if (statfs(., sfb)  0) {

-- 
Adam Majer
ad...@zombino.com


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#769925: lpr will fail to accept print jobs on partitions larger than 1TB

2014-11-17 Thread Peter Schlaile
Hi Adam,

could you apply the upstream patch to squeeze(-lts) and wheezy?

That would be great!

Regards
Peter