1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-17 10:26:15 +00:00
freebsd/usr.sbin/lpr
Edwin Groothuis e782099404 Fix printing of files located on ZFS filesystem with an st_dev or
st_ino larger than 2**31.

From the PR:

   Printing from a ZFS filesystem using 'lp' fails and returns an
   email reporting "Your printer job was not printed because it was
   not linked to the original file".

   In order to protect against files being switched when files
   are printed using 'lp' or 'lpr -s', the st_dev and st_ino
   values for the original file are saved by lpr and verified
   by lpd before the file is printed. Unfortunately, lpr prints
   both values using '%d' (although both fields are unsigned)
   and lpd(8) assumes a string of decimal digits.

   ZFS (at least) generates st_dev values greater than 2^31-1,
   resulting in negative values being printed - which lpd cannot
   parse, leading it to report that the file has been switched.

   A similar problem would occur with large inode numbers.

   How-To-Repeat:

   Find a file with either st_dev or st_ino greater than 2^31-1
   (stat(1) will report both numbers) and print it with 'lpq -s'.
   This should generate an email reporting that the file could
   not be printed because it was not linked to the original file

PR:		bin/151567
Submitted by:	Peter Jeremy <Peter.Jeremy@alcatel-lucent.com>
MFC after:	1 week
2010-10-21 06:52:14 +00:00
..
chkprintcap
common_source Modernize scandir(3) and alphasort(3) interfaces according to the IEEE 2010-01-04 15:40:17 +00:00
filters
filters.ru The last big commit: let usr.sbin/ use WARNS=6 by default. 2010-01-02 11:07:44 +00:00
lp
lpc The last big commit: let usr.sbin/ use WARNS=6 by default. 2010-01-02 11:07:44 +00:00
lpd - Improve the wait4data() routine so it behaves better when checking 2010-08-11 19:32:49 +00:00
lpq mdoc: drop redundant .Pp and .LP calls 2010-10-08 12:40:16 +00:00
lpr Fix printing of files located on ZFS filesystem with an st_dev or 2010-10-21 06:52:14 +00:00
lprm mdoc: drop redundant .Pp and .LP calls 2010-10-08 12:40:16 +00:00
lptest
pac
SMM.doc
Makefile
Makefile.inc