Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/lpr/lpd Fix PR bin/30272 Lpd would create the temp...



details:   https://anonhg.NetBSD.org/src/rev/05628be46724
branches:  trunk
changeset: 587300:05628be46724
user:      garbled <garbled%NetBSD.org@localhost>
date:      Thu Jan 19 19:17:59 2006 +0000

description:
Fix PR bin/30272  Lpd would create the tempfile "remotexxxxx" and send
that, but then fill out the control file with the "df" filename.  Fix by
sending the remote file with the "df" filename, as suggested by Robert
Vargason on tech-userlevel.  lpd -r now works properly with an if (input
filter)

diffstat:

 usr.sbin/lpr/lpd/printjob.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (37 lines):

diff -r aff4b52efd76 -r 05628be46724 usr.sbin/lpr/lpd/printjob.c
--- a/usr.sbin/lpr/lpd/printjob.c       Thu Jan 19 17:50:33 2006 +0000
+++ b/usr.sbin/lpr/lpd/printjob.c       Thu Jan 19 19:17:59 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: printjob.c,v 1.46 2006/01/17 19:12:17 garbled Exp $    */
+/*     $NetBSD: printjob.c,v 1.47 2006/01/19 19:17:59 garbled Exp $    */
 
 /*
  * Copyright (c) 1983, 1993
@@ -41,7 +41,7 @@
 #if 0
 static char sccsid[] = "@(#)printjob.c 8.7 (Berkeley) 5/10/95";
 #else
-__RCSID("$NetBSD: printjob.c,v 1.46 2006/01/17 19:12:17 garbled Exp $");
+__RCSID("$NetBSD: printjob.c,v 1.47 2006/01/19 19:17:59 garbled Exp $");
 #endif
 #endif /* not lint */
 
@@ -870,7 +870,9 @@
        char buf[BUFSIZ];
        int sizerr, resp;
        extern int rflag;
+       char *save_file;
 
+       save_file = file;
        if (type == '\3' && rflag && (OF || IF)) {
                int     save_pfd = pfd;
 
@@ -905,7 +907,7 @@
                return(ACCESS);
 
        amt = snprintf(buf, sizeof(buf), "%c%lld %s\n", type,
-           (long long)stb.st_size, file);
+           (long long)stb.st_size, save_file);
        for (i = 0; ; i++) {
                if (write(pfd, buf, amt) != amt ||
                    (resp = response()) < 0 || resp == '\1') {



Home | Main Index | Thread Index | Old Index