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.000000000 +0100
> +++ lpr-2008.05.17+nmu1.new/lpd/recvjob.c 2014-11-17 17:57:56.000000000
> +0100
> @@ -298,7 +298,7 @@
> static int
> chksize(int size)
> {
> - int spacefree;
> + long long spacefree;
> struct statfs sfb;
>
> if (statfs(".", &sfb) < 0) {
--
Adam Majer
[email protected]
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]