[350] in Kerberos-V5-bugs

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

POSIX_FILE_LOCKS in Kerberos V

daemon@ATHENA.MIT.EDU (Hugh C. Lauer)
Sat Sep 18 19:39:08 1993

To: krb5-bugs@MIT.EDU
Cc: lauer@merl.com
Date: Sat, 18 Sep 93 19:38:40 -0400
From: "Hugh C. Lauer" <lauer@merl.com>

The file slave/kprop.c does not compile in the presence of the switch

		POSIX_FILE_LOCKS

The function lockf is called with incorrect arguments.  Here is a context
diff to make it compile correctly, according to the HP-UX 9.0 man page
description of the lockf call.

*** kprop.c     Sat Sep 18 19:28:00 1993
--- kprop.c.orig        Thu Sep 24 23:33:36 1992
***************
*** 417,424 ****
        }

  #ifdef POSIX_FILE_LOCKS
!       if (lockf(fd, F_TLOCK, 0) < 0) {
!               if (errno == EACCES || errno == EAGAIN)
                        com_err(progname, 0, "database locked");
                else
                        com_err(progname, errno, "while trying to flock %s",
--- 417,424 ----
        }

  #ifdef POSIX_FILE_LOCKS
!       if (lockf(fd, LOCK_SH | LOCK_NB, 0) < 0) {
!               if (errno == EWOULDBLOCK || errno == EAGAIN)
                        com_err(progname, 0, "database locked");
                else
                        com_err(progname, errno, "while trying to flock %s",

Note that I have not yet got so far as testing this on my HP 700 series system.
However, I thought I would pass it on before I forget.

Sincerely,

Hugh Lauer

P.S. The HP-UX 'c89' compiler purports to be a true POSIX compiler.  However,
I cannot use it on Kerberos V as you requested in the interim documentation
because the ISODE include files blow up with either an ANSI or POSIX compiler.
Since these are included all over the place, it proved to be impossible to
use 'c89'.

HCL

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