From owner-freebsd-current Fri Jul 31 18:08:47 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id SAA07547 for freebsd-current-outgoing; Fri, 31 Jul 1998 18:08:47 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from zone.baldcom.net (zone.BALDCOM.NET [205.232.46.9]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id SAA07530 for ; Fri, 31 Jul 1998 18:08:42 -0700 (PDT) (envelope-from green@zone.baldcom.net) Received: from localhost (green@localhost) by zone.baldcom.net (8.8.8/8.8.7) with SMTP id VAA26305; Fri, 31 Jul 1998 21:08:09 -0400 (EDT) Date: Fri, 31 Jul 1998 21:08:09 -0400 (EDT) From: Brian Feldman To: Mike Smith cc: freebsd-current@FreeBSD.ORG Subject: Re: flock(2) problem & fix In-Reply-To: <199808010014.RAA01387@dingo.cdrom.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Whoops, I suppose you're right, I think I'll start testing it out =) With respect to Tom's comment, this won't cnvert an exclusive to a non-exclusive lock, it will return EPERM; also, the program SHOULDn't be using an exclusive lock, it should be using a shared lock. Cheers, Brian Feldman green@unixhelp.org On Fri, 31 Jul 1998, Mike Smith wrote: > > > > Our flock(2) doesn't seem to do the right thing all the time. It seems > > that any user with read access to a file is allowed exclusive locking of > > it, which I think is wrong (does everyone agree?), and that a shared lock > > should be used, because the user does not own the file, and has no write > > permission, therefore no need for an exclusive lock. I raise the question > > as to whether it should matter if the lock is non-blocking or not, and > > that should be considered I suppose, as to assure the Right Thing will > > happen. Attached is a patch to sys/kern/kern_descrip.c which should fix > > the problem but is untested. > > Sorry, I think you mistyped that last bit. Shouldn't it read "the > tested patch is contained in PR kern/XXXX" ? > > 8) > > -- > \\ Sometimes you're ahead, \\ Mike Smith > \\ sometimes you're behind. \\ mike@smith.net.au > \\ The race is long, and in the \\ msmith@freebsd.org > \\ end it's only with yourself. \\ msmith@cdrom.com > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-current" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message