From owner-freebsd-bugs Tue Oct 22 13:04:25 1996 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id NAA27068 for bugs-outgoing; Tue, 22 Oct 1996 13:04:25 -0700 (PDT) Received: from irz301.inf.tu-dresden.de (irz301.inf.tu-dresden.de [141.76.1.11]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id NAA27053 for ; Tue, 22 Oct 1996 13:04:15 -0700 (PDT) Received: from sax.sax.de (sax.sax.de [193.175.26.33]) by irz301.inf.tu-dresden.de (8.6.12/8.6.12-s1) with ESMTP id WAA24287; Tue, 22 Oct 1996 22:04:06 +0200 Received: (from uucp@localhost) by sax.sax.de (8.6.12/8.6.12-s1) with UUCP id WAA03008; Tue, 22 Oct 1996 22:04:06 +0200 Received: (from j@localhost) by uriah.heep.sax.de (8.7.6/8.6.9) id VAA18687; Tue, 22 Oct 1996 21:20:37 +0200 (MET DST) From: J Wunsch Message-Id: <199610221920.VAA18687@uriah.heep.sax.de> Subject: Re: bin/1863: On systems with setuid 'lpr' and defined printers, lpr breaks root To: roberto@keltia.freenix.fr Date: Tue, 22 Oct 1996 21:20:37 +0200 (MET DST) Cc: freebsd-bugs@freefall.freebsd.org Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) In-Reply-To: <199610221620.JAA08429@freefall.freebsd.org> from Ollivier Robert at "Oct 22, 96 09:20:02 am" X-Phone: +49-351-2012 669 X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F 93 21 E0 7D F9 12 D6 4E X-Mailer: ELM [version 2.4ME+ PL17 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk As Ollivier Robert wrote: > Here is a fix which truncate the input string if longer than BUFSIZ. I did > not consider it worth dynamic allocation because the strings are supposed > to be short in the control file. I think there's not even a need for a dynamic buffer, the buffer is written to `ofd' at the end of the function, so you can loop until all bytes from p2 are written. -- cheers, J"org joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-)