[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: locking utmp



On Tue, 19 Mar 2002 12:58, Miquel van Smoorenburg wrote:
> >I need to know why it wants to lock a range of length 0.  Is this a bug or
> > is there some good reason for it?
>
> The standard linux fcntl() manpage doesn't explain it, but google'ing
> on "l_len zero" brings up manpages from other Unices which do:
>
> http://www.tac.eu.org/cgi-bin/man-cgi?fcntl+2
>
>     "Locks may start and extend beyond the current end of a file, but may
> not start or extend before the beginning of the file.  A lock is set to ex-
> tend to the largest possible value of the file offset for that file if
> l_len is set to zero. If l_whence and l_start point to the beginning of the
> file, and l_len is zero, the entire file is locked."

Thanks for this information!

I needed to know what it was doing to determine the correct SE policy for the 
program.  It seems that there's a reason for locking the entire utmp file, 
and from inspection of it's operation I think that there is no risk of a long 
running lock as long as I don't allow SIGSTOP or ptrace() on the process.

-- 
If you send email to me or to a mailing list that I use which has >4 lines
of legalistic junk at the end then you are specifically authorizing me to do
whatever I wish with the message and all other messages from your domain, by
posting the message you agree that your long legalistic sig is void.



Reply to: