Return-Path: Delivered-To: new-httpd-archive@hyperreal.org Received: (qmail 1860 invoked by uid 6000); 5 Nov 1997 01:21:13 -0000 Received: (qmail 1851 invoked from network); 5 Nov 1997 01:21:11 -0000 Received: from devsys.jagunet.com (206.156.208.6) by taz.hyperreal.org with SMTP; 5 Nov 1997 01:21:11 -0000 Received: (from jim@localhost) by devsys.jaguNET.com (8.8.7/jag-2.4) id UAA22700 for new-httpd@apache.org; Tue, 4 Nov 1997 20:21:07 -0500 (EST) From: Jim Jagielski Message-Id: <199711050121.UAA22700@devsys.jaguNET.com> Subject: Re: [PATCH] Make FLOCK mutex work PR#1056 To: new-httpd@apache.org Date: Tue, 4 Nov 1997 20:21:07 -0500 (EST) In-Reply-To: <199711050107.UAA22458@devsys.jaguNET.com> from "Jim Jagielski" at Nov 4, 97 08:07:13 pm X-Mailer: ELM [version 2.4 PL25] Content-Type: text Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org Dean Gaudet wrote: > > > > On Tue, 4 Nov 1997, Jim Jagielski wrote: > > > - lock_fd = popenf(p, lock_fname, O_CREAT | O_WRONLY | O_EXCL, 0644); > > + lock_fd = popenf(p, lock_fname, O_CREAT | O_WRONLY, 0600); > > Make the parent do an O_CREAT to create the file, and remove O_CREAT from > the children ... to make the window in which an attacker can stuff a > symlink in the way smaller... also helps make sure we notice if some dolt > removes the lock file (the children would all exit, the server would chew > lots of cpu spawning new children :). It looks fine either way though. > Hmmm... On 2nd thought, it some idiot does remove the lockfile then Apache would spawn new children that would immediately die because they can't open the file (I'm not sure if that's what you meant). I wonder if it's better to have Apache be more robust than that and actually recover? Agreed that the parent should make it initially. -- ==================================================================== Jim Jagielski | jaguNET Access Services jim@jaguNET.com | http://www.jaguNET.com/ "Look at me! I'm wearing a cardboard belt!"