On Mon, Jan 20, 2014 at 10:11:53AM +1300, Philip Guenther wrote:
> On Sun, Jan 19, 2014 at 10:48 AM, Todd C. Miller
> <[email protected]> wrote:
> > Perhaps something like this? Only compile-tested.
>
> Looks good. We also need to fix the 'S' line parsing code in sendit()
> and printit() in lpd/printjob.c to use unsigned long long when parsing
> the ino_t instead of trying to store it in an int. Perhaps change it
> to use strtoull() too?
I'll investigate into that further, too.
To keep tech@ updated, the fdev = fino = -1 part has to be put up
one more level, because the same code exists in sendit() that has
to be fixed, too. Will send a fully updated diff soon.
Index: lpd/printjob.c
===================================================================
RCS file: /var/www/cvs/src/usr.sbin/lpr/lpd/printjob.c,v
retrieving revision 1.49
diff -u -p -r1.49 printjob.c
--- lpd/printjob.c 10 Dec 2013 16:38:04 -0000 1.49
+++ lpd/printjob.c 18 Jan 2014 22:09:53 -0000
@@ -226,7 +226,9 @@ again:
continue;
errcnt = 0;
restart:
- (void)lseek(lfd, pidoff, 0);
+ fdev = (dev_t)-1;
+ fino = (ino_t)-1;
+ (void)lseek(lfd, pidoff, SEEK_SET);
if ((i = snprintf(line, sizeof(line), "%s\n", q->q_name)) >=
sizeof(line) || i == -1)
i = sizeof(line) - 1; /* can't happen */