From owner-cvs-src-old@FreeBSD.ORG Thu Oct 21 06:52:24 2010 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB5A81065780 for ; Thu, 21 Oct 2010 06:52:24 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id D87128FC1E for ; Thu, 21 Oct 2010 06:52:24 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.4/8.14.4) with ESMTP id o9L6qOwJ014061 for ; Thu, 21 Oct 2010 06:52:24 GMT (envelope-from edwin@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.4/8.14.4/Submit) id o9L6qOFq014060 for cvs-src-old@freebsd.org; Thu, 21 Oct 2010 06:52:24 GMT (envelope-from edwin@repoman.freebsd.org) Message-Id: <201010210652.o9L6qOFq014060@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to edwin@repoman.freebsd.org using -f From: Edwin Groothuis Date: Thu, 21 Oct 2010 06:52:14 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/usr.sbin/lpr/lpr lpr.c X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Oct 2010 06:52:25 -0000 edwin 2010-10-21 06:52:14 UTC FreeBSD src repository Modified files: usr.sbin/lpr/lpr lpr.c Log: SVN rev 214124 on 2010-10-21 06:52:14Z by edwin 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 MFC after: 1 week Revision Changes Path 1.45 +1 -1 src/usr.sbin/lpr/lpr/lpr.c