summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2014-02-07 23:06:22 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2014-02-07 23:06:22 +0000
commit317d221da892af5cbb2178412a43cbcb7ef84bc7 (patch)
tree2e720bcffcd1ced7da8121486609cd49985d66df
parenta8eb22e6b33809701c754c66ff9624638816db8e (diff)
Fix remote printing; broken in rev 1.50. OK guenther@ stsp@
-rw-r--r--usr.sbin/lpr/lpd/printjob.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.sbin/lpr/lpd/printjob.c b/usr.sbin/lpr/lpd/printjob.c
index cfbea5ba777..2bafc0ca2f9 100644
--- a/usr.sbin/lpr/lpd/printjob.c
+++ b/usr.sbin/lpr/lpd/printjob.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: printjob.c,v 1.51 2014/01/20 19:52:45 tobias Exp $ */
+/* $OpenBSD: printjob.c,v 1.52 2014/02/07 23:06:21 millert Exp $ */
/* $NetBSD: printjob.c,v 1.31 2002/01/21 14:42:30 wiz Exp $ */
/*
@@ -909,6 +909,10 @@ sendfile(int type, char *file)
PRIV_START;
f = safe_open(file, O_RDONLY|O_NOFOLLOW, 0);
PRIV_END;
+ if (fstat(f, &stb) == -1) {
+ close(f);
+ f = -1;
+ }
}
if (f == -1)
return(ERROR);