[537] in Kerberos-V5-bugs

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

krb5 B4 P1 on HP-UX and NetBSD

daemon@ATHENA.MIT.EDU (John Brezak)
Wed Jun 29 17:35:28 1994

To: krb5-bugs@MIT.EDU
Cc: sommerfeld@apollo.hp.com
Date: Wed, 29 Jun 1994 17:34:07 -0400
From: John Brezak <brezak@apollo.hp.com>


This is related to the HP-UX patch I sent earlier. I found out how to
do things without directly changing the configure scripts since then. Here
are some comments.

I'm also working on getting telnet working on HP-UX - I did it for beta3,
now I just need to merge.

A few problems:

1) In some of the Makefile.in files there are lines that contain just a single
   space (" ") character. This causes some makes to break. (NetBSD)

2) Please add this line to the configure.in files (or some global file):

	AC_HAVE_LIBRARY(BSD)

   This is to use the -lBSD on HP-UX to get BSD style signal semantics.

3) HP-UX has libndbm.a for the dbm functions. There needs to be something
   to fill in DBMLIB= in the Makefiles. I'm not sure about the best way
   to do this with configure. But there should be an attempt to see if libc
   has dbm_open(), then try -lndbm and finially -ldbm.

4) These should be detected and used appropriatedly (include/krb5/configure.in)

	AC_FUNC_CHECK(utimes,AC_DEFINE(HAS_UTIMES))
	AC_FUNC_CHECK(random,AC_DEFINE(HAS_RANDOM))
	AC_FUNC_CHECK(setsid,AC_DEFINE(HAS_SETSID))
	AC_FUNC_CHECK(getcwd,AC_DEFINE(HAS_GETCWD))

   These pertain to Posix (SYS5) systems. and should be used appropriately.
   This is needed for HP-UX.

*** include/krb5/configure.in.orig      Wed Jun 22 14:13:45 1994
--- include/krb5/configure.in   Wed Jun 22 14:15:01 1994
***************
*** 3,8 ****
--- 3,12 ----
  AC_PROG_LEX
  HAVE_YYLINENO
  AC_FUNC_CHECK(strdup,AC_DEFINE(HAS_STRDUP))
+ AC_FUNC_CHECK(utimes,AC_DEFINE(HAS_UTIMES))
+ AC_FUNC_CHECK(random,AC_DEFINE(HAS_RANDOM))
+ AC_FUNC_CHECK(setsid,AC_DEFINE(HAS_SETSID))
+ AC_FUNC_CHECK(getcwd,AC_DEFINE(HAS_GETCWD))
  CHECK_DIRENT
  CHECK_FCNTL
  CHECK_WAIT_TYPE

*** include/krb5/acconfig.h.orig        Wed Jun 22 14:20:47 1994
--- include/krb5/acconfig.h     Wed Jun 22 14:21:23 1994
***************
*** 6,11 ****
--- 6,15 ----
  #undef HAS_ANSI_VOLATILE
  #undef HAS_STDLIB_H
  #undef HAS_STRDUP
+ #undef HAS_UTIMES
+ #undef HAS_RANDOM
+ #undef HAS_SETSID
+ #undef HAS_GETCWD
  #undef HAS_VOID_TYPE
  #undef KRB5_PROVIDE_PROTOTYPES
  #undef NEED_SYS_FCNTL_H

*** include/krb5/config.new.orig        Wed Jun 22 14:25:21 1994
--- include/krb5/config.new     Wed Jun 22 14:25:58 1994
***************
*** 30,36 ****
  #define KRB5_AUTOCONF__
  #include "autoconf.h"
  #endif
! #ifdef SYSV
  /* Change srandom and random to use rand and srand */
  /* Taken from the Sandia changes.  XXX  We should really just include */
  /* srandom and random into Kerberos release, since rand() is a really */
--- 30,37 ----
  #define KRB5_AUTOCONF__
  #include "autoconf.h"
  #endif
! 
! #ifndef HAS_RANDOM
  /* Change srandom and random to use rand and srand */
  /* Taken from the Sandia changes.  XXX  We should really just include */
  /* srandom and random into Kerberos release, since rand() is a really */
***************
*** 37,46 ****
  /* bad random number generator.... [tytso:19920616.2231EDT] */
  #define random() rand()
  #define srandom(a) srand(a)
! #ifndef unicos61
! #define utimes(a,b) utime(a,b)
! #endif  /* unicos61 */
! #endif /* SYSV */
  
  /* XXX these should be parameterized soon... */
  #define PROVIDE_DES_CBC_CRC
--- 38,44 ----
  /* bad random number generator.... [tytso:19920616.2231EDT] */
  #define random() rand()
  #define srandom(a) srand(a)
! #endif
  
  /* XXX these should be parameterized soon... */
  #define PROVIDE_DES_CBC_CRC

4a) I added a compatable utimes() based on utime() in lib/kdb/kdb_dbm.c keyed
   on #ifndef HAS_UTIMES.

*** lib/kdb/kdb_dbm.c.orig      Wed Jun 22 14:46:22 1994
--- lib/kdb/kdb_dbm.c   Wed Jun 22 14:46:38 1994
***************
*** 1348,1350 ****
--- 1348,1368 ----
      non_blocking = mode;
      return old;
  }
+ 
+ #ifndef HAS_UTIMES
+ extern int errno;
+ 
+ #include <utime.h>
+ #include <sys/time.h>
+ 
+ utimes(file, tvp)
+ char *file;
+ struct timeval *tvp;
+ {
+       struct utimbuf times;
+ 
+       times.actime = tvp[0].tv_sec;
+       times.modtime = tvp[1].tv_sec;
+       return(utime(file, &times));
+ }
+ #endif

4b) I use rand()/srand() as random()/srandom() #ifndef HAS_RANDOM

4c) These files should use getcwd() when HAS_GETCWD.

	./admin/edit/kdb5_edit.c
	./clients/ksu/main.c

4d) This file should use getsid() instead of setpgrp() / TIOCNOTTY.

	./slave/kpropd.c

5) The changes under isode in the previous HP-UX patch I sent.

*** ./isode/h/config.h.orig   Wed Jun 22 14:27:47 1994
--- ./isode/h/config.h        Wed Jun 22 14:28:01 1994
***************
*** 17,22 ****
--- 17,29 ----
  #define BSD42
  #endif
  
+ #if defined(HPUX) || defined(__hpux)
+ #define SYS5
+ #ifndef HPUX
+ #define HPUX
+ #endif
+ #endif
+ 
  #ifdef _AIX
  /* SYS5 is also for fcntl.h instead of sys/fcntl.h */
  #define SYS5

*** ./isode/compat/signals.c.orig       Wed Jun 22 14:27:13 1994
--- ./isode/compat/signals.c    Wed Jun 22 14:27:31 1994
***************
*** 98,104 ****
  }
  
  /* 
      */
! #ifndef SVR4_UCB
  
  int   sigblock (mask)
  int   mask;
--- 98,104 ----
  }
  
  /* 
      */
! #if !defined(SVR4_UCB) && !defined(__hpux)
  
  int   sigblock (mask)
  int   mask;


6) TCL should be autodetected and used in kdb5_edit. Maybe not build ss
   if TCL can be used.






=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 John Brezak                    UUCP:     uunet!apollo.hp!brezak
 Hewlett Packard/Apollo         Internet: brezak@ch.hp.com
 300 Apollo Drive               Phone:    (508) 436-4915
 Chelmsford, Massachusetts      Fax:      (508) 436-5122



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