[3853] in Kerberos

home help back first fref pref prev next nref lref last post

Re: v5srvtab lossage ... anyone seen this?

daemon@ATHENA.MIT.EDU (Dave McGuire)
Fri Sep 16 17:17:11 1994

Date: Fri, 16 Sep 1994 16:55:06 -0400
From: Dave McGuire <mcguire@rocinante.digex.net>
To: kerberos@MIT.EDU
In-Reply-To: Re: v5srvtab lossage ... anyone seen this? (John Gardiner Myers)

On September 16, John Gardiner Myers wrote:
> hobbit@elf.com (*Hobbit*) writes:
> >             fopen (said file, "rb+)     /* succeeds */
> 
> Dollars to donuts that's the culprit.
> 
> To get a fcntl exclusive lock, you have to have the file descriptor
> open for writing.  fnctl locking blows chunks.
> 
> "rb+" is the correct way in ANSI C to open a file both for reading and
> writing in binary mode, without blowing away the existing contents of
> the file.
> 
> Many Unix versions of fopen stop parsing on the "b" because they don't
> know about it, binary mode being meaningless on unix.  If fopen stops
> parsing on the 'b' and misses the '+', the file won't be opened for
> writing and the fcntl lock attempt will fail.

  Ok, that's understandable, but I'm using the same distribution on
the same platform and don't have this problem...Why the difference
between Hobbit's machine and mine, I wonder?


                            -Dave McGuire
                             Operations
                             Digital Express Group, Incorporated
                             mcguire@digex.net

home help back first fref pref prev next nref lref last post