Return to BSD News archive
Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!msuinfo!agate!howland.reston.ans.net!EU.net!sun4nl!news.nic.surfnet.nl!tuegate.tue.nl!rwa.urc.tue.nl!rcpt
From: rcpt@rwa.urc.tue.nl (Piet Tutelaers)
Newsgroups: comp.unix.bsd
Subject: Making the BSD spooler even more POSIX ...
Date: 17 Jun 1994 16:00:42 +0200
Organization: Eindhoven University of Technology, The Netherlands
Lines: 29
Message-ID: <rcpt.771860340@rwa.urc.tue.nl>
NNTP-Posting-Host: rwa.urc.tue.nl
X-Newsreader: NN version 6.5.0 #9 (NOV)
A while ago I posted the results of my attempt to make the LPD spooler
more POSIX compatible. Despite this effort there were however two
severe bugs from which I suffered on our SGI machines. I have provided
a fix on ftp.urc.tue.nl in pub/sgi/posix-lpr.patch1.
In the lpd/printjob.c program there is a very funny line:
(void) sprintf(buf, "%c%qd %s\n", type, stb.st_size, file);
^^^ hidden BSD feature??
I wonder how this can work on a BSD system? On SGI it was the reason that
remote printing to other systems did *not* work. And if you compile next
program on NetBSD it gives a `segmentation error':
--------- funny BSD feature ------
#include <stdio.h>
main() {
char buf[255];
(void) sprintf(buf, "%c%qd %s\n", '\3', 512, "something");
printf("%s\n", buf);
}
----------------------------------
--Piet
internet: rcpt@urc.tue.nl __o Piet Tutelaers
bitnet: rcpt@heitue5.BITNET _`\<,_ Computer Center Room RC 1.90
phone: +31 (0)40 474541 (_)/ (_) Eindhoven University of Technology
fax: +31 (0)40 434438 Save nature P.O. Box 513, 5600 MB Eindhoven, NL