Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 Jul 1998 21:08:09 -0400 (EDT)
From:      Brian Feldman <green@zone.baldcom.net>
To:        Mike Smith <mike@smith.net.au>
Cc:        freebsd-current@FreeBSD.ORG
Subject:   Re: flock(2) problem & fix 
Message-ID:  <Pine.BSF.4.02.9807312106510.26234-100000@zone.baldcom.net>
In-Reply-To: <199808010014.RAA01387@dingo.cdrom.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.02.9807312106510.26234-100000>