From owner-freebsd-audit Tue Oct 24 13:39: 7 2000 Delivered-To: freebsd-audit@freebsd.org Received: from mail.rpi.edu (mail.rpi.edu [128.113.100.7]) by hub.freebsd.org (Postfix) with ESMTP id 1D5D637B4CF for ; Tue, 24 Oct 2000 13:39:03 -0700 (PDT) Received: from [128.113.24.47] (gilead.acs.rpi.edu [128.113.24.47]) by mail.rpi.edu (8.9.3/8.9.3) with ESMTP id QAA499608; Tue, 24 Oct 2000 16:38:47 -0400 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <20001024211518.E209@lucifer.bart.nl> References: <20001024140510.G93799@lucifer.bart.nl> <20001024170054.Q93799@lucifer.bart.nl> <20001024192539.A65599@gvr.gvr.org> <20001024202942.C209@lucifer.bart.nl> <20001024211518.E209@lucifer.bart.nl> Date: Tue, 24 Oct 2000 16:38:46 -0400 To: Jeroen Ruigrok van der Werven , Guido van Rooij From: Garance A Drosihn Subject: Re: printjob.c mktemp() problem Cc: audit@FreeBSD.ORG Content-Type: text/plain; charset="us-ascii" ; format="flowed" Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG At 9:15 PM +0200 10/24/00, Jeroen Ruigrok van der Werven wrote: >-On [20001024 20:35], Jeroen Ruigrok van der Werven >(jruigrok@via-net-works.nl) wrote: > >-On [20001024 19:30], Guido van Rooij (guido@gvr.org) wrote: > >>You should remove the addition of int i = -1 since it isn't used. > > > >Yeah, I fixed that in my latest patches. > >Deleted bogus assignment of i = fchmod(). No need for it. > > > I still need to look at Garance's mention of the tempfile name > > which doesn't include a /tmp/ path. > >My new patch should also fix this case. Uh, the tempfile name is NOT supposed to include /tmp in the pathname. The file is supposed to be created in the spool directory, and not in /tmp. 'mktemp' does not imply the file must be in /tmp. In the case of lpd, moving the filenames into /tmp would make matters worse instead of better. (at least for my print servers it would, in other cases it might not make any difference). I was just saying that given the pattern being used, which is a correct pattern, the bug was that mktemp was called BEFORE the chdir, when it should only be called AFTER the current-directory has been changed. If I remember right, the suggested mkstemp patch already fixed that particular problem. --- Garance Alistair Drosehn = gad@eclipse.acs.rpi.edu Senior Systems Programmer or drosih@rpi.edu Rensselaer Polytechnic Institute To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message