[1027] in Kerberos-V5-bugs

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

Changes to make krb5 work on OSF/1

daemon@ATHENA.MIT.EDU (epeisach@MIT.EDU)
Tue Jan 3 10:25:03 1995

From: epeisach@MIT.EDU
Date: Tue, 3 Jan 1995 10:24:56 -0500
To: krb5-bugs@MIT.EDU


These are the minimal changes required.... I have some other changes
(like configure caching) but they can wait. I have not tested server
side support, and the gssapi client/server does not seem to work, but I
have not tracked it down.... I am resending them in their completeness...

Changes:

acconfig.h:
	Add BITS64
appl/gss-sample/gss-server.c:
	Prototype matching of arguments... ret_flags should be an int,
		not an OM_unit32...

include/des.h:
	Include krb5/wordsize.h so that KRB_INT32 may be overridden
	there. (the change could have been on osconf.h, but it was
	cleaner to have all BITS64 definitions in one place.

include/kerberosIV/krb.h:
	define KRB4_32 - what is a 32bit integer - long vs. int.
	The modified structures are where structures are passed over the
	wire and the size matters.

include/krb5/configure.in: 
	I have sent in bigger changes for this configure.in - but I am
limiting this to the section that deals with BITS defintion. This will
unfortunately not work when cross compiling, but will defined BITS64 and
BITS32 properly (for a DEC Alpha....)

include/krb5/wordsize.h:
	All the BITS64 defintions to be accepted - they are right for
this platform. Also, add a defininition for KRB5_INT32 (for
include/des.h)

lib/krb5/krb/compat_recv.c:
	The length field is 4 bytes - not sizeof(long). Checksum in v4
is also 4 bytes and not 8.

util/et/com_err.h: (Not DEC OSF/1)
	(Required for SGI platform....) All routines defined in the
com_err library should have extern before the prototypes....

Future problem: In OSF 3.0 grantpt exists but not sys/ptyvar.h. This
will affect appl/telnet/telnetd/configure.in....


===================================================================
RCS file: /mit/krb5/.cvsroot/src/acconfig.h,v
retrieving revision 5.2
diff -c -r5.2 acconfig.h
*** 5.2	1994/11/30 22:15:20
--- acconfig.h	1994/11/30 23:16:08
***************
*** 6,11 ****
--- 6,12 ----
  #undef ANSI_STDIO
  #undef HAS_SETVBUF
  #undef BITS32
+ #undef BITS64
  #undef HAS_ANSI_CONST
  #undef HAS_ANSI_VOLATILE
  #undef HAS_STDLIB_H
===================================================================
RCS file: /mit/krb5/.cvsroot/src/appl/gss-sample/gss-server.c,v
retrieving revision 1.4
diff -c -r1.4 gss-server.c
*** 1.4	1994/08/18 21:05:23
--- gss-server.c	1994/10/03 18:46:58
***************
*** 302,308 ****
       gss_buffer_desc send_tok, recv_tok;
       gss_name_t client;
       gss_OID doid;
!      OM_uint32 maj_stat, min_stat, ret_flags;
  
       *context = GSS_C_NO_CONTEXT;
       
--- 302,309 ----
       gss_buffer_desc send_tok, recv_tok;
       gss_name_t client;
       gss_OID doid;
!      OM_uint32 maj_stat, min_stat;
!      int ret_flags;
  
       *context = GSS_C_NO_CONTEXT;
       
===================================================================
RCS file: /mit/krb5/.cvsroot/src/include/des.h,v
retrieving revision 1.2
diff -c -r1.2 des.h
*** 1.2	1994/08/18 21:17:44
--- des.h	1994/10/01 11:58:42
***************
*** 15,20 ****
--- 15,21 ----
  
  #include <kerberosIV/mit-copyright.h>
  #include <krb5/osconf.h>
+ #include <krb5/wordsize.h>
  
  #ifndef KRB_INT32
  #define KRB_INT32 long
===================================================================
RCS file: /mit/krb5/.cvsroot/src/include/kerberosIV/krb.h,v
retrieving revision 1.4
diff -c -r1.4 krb.h
*** 1.4	1994/08/18 21:18:24
--- krb.h	1994/11/03 06:57:27
***************
*** 45,50 ****
--- 45,56 ----
  #define		KSUCCESS	0
  #define		KFAILURE	255
  
+ #ifndef __alpha
+ #define KRB4_32	long
+ #else
+ #define KRB4_32	int
+ #endif
+ 
  #ifdef NO_UIDGID_T
  typedef unsigned short uid_t;
  typedef unsigned short gid_t;
***************
*** 139,149 ****
      char    pname[ANAME_SZ];	/* Principal's name */
      char    pinst[INST_SZ];	/* His Instance */
      char    prealm[REALM_SZ];	/* His Realm */
!     unsigned long checksum;	/* Data checksum (opt) */
      C_Block session;		/* Session Key */
      int     life;		/* Life of ticket */
!     unsigned long time_sec;	/* Time ticket issued */
!     unsigned long address;	/* Address in ticket */
      KTEXT_ST reply;		/* Auth reply (opt) */
  };
  
--- 145,155 ----
      char    pname[ANAME_SZ];	/* Principal's name */
      char    pinst[INST_SZ];	/* His Instance */
      char    prealm[REALM_SZ];	/* His Realm */
!     unsigned KRB4_32 checksum;	/* Data checksum (opt) */
      C_Block session;		/* Session Key */
      int     life;		/* Life of ticket */
!     unsigned KRB4_32 time_sec;	/* Time ticket issued */
!     unsigned KRB4_32 address;	/* Address in ticket */
      KTEXT_ST reply;		/* Auth reply (opt) */
  };
  
***************
*** 159,165 ****
      int     lifetime;		/* Lifetime */
      int     kvno;		/* Key version number */
      KTEXT_ST ticket_st;		/* The ticket itself */
!     long    issue_date;		/* The issue time */
      char    pname[ANAME_SZ];	/* Principal's name */
      char    pinst[INST_SZ];	/* Principal's instance */
  };
--- 165,171 ----
      int     lifetime;		/* Lifetime */
      int     kvno;		/* Key version number */
      KTEXT_ST ticket_st;		/* The ticket itself */
!     KRB4_32 issue_date;		/* The issue time */
      char    pname[ANAME_SZ];	/* Principal's name */
      char    pinst[INST_SZ];	/* Principal's instance */
  };
***************
*** 170,179 ****
  
  struct msg_dat {
      unsigned char *app_data;	/* pointer to appl data */
!     unsigned long app_length;	/* length of appl data */
!     unsigned long hash;		/* hash to lookup replay */
      int     swap;		/* swap bytes? */
!     long    time_sec;		/* msg timestamp seconds */
      unsigned char time_5ms;	/* msg timestamp 5ms units */
  };
  
--- 176,185 ----
  
  struct msg_dat {
      unsigned char *app_data;	/* pointer to appl data */
!     unsigned KRB4_32 app_length;	/* length of appl data */
!     unsigned KRB4_32 hash;	/* hash to lookup replay */
      int     swap;		/* swap bytes? */
!     KRB4_32  time_sec;		/* msg timestamp seconds */
      unsigned char time_5ms;	/* msg timestamp 5ms units */
  };
  
===================================================================
RCS file: /mit/krb5/.cvsroot/src/include/krb5/configure.in,v
retrieving revision 1.14
diff -c -r1.14 configure.in
*** 1.14	1994/11/30 21:36:26
--- configure.in	1994/12/02 12:25:31
***************
*** 69,78 ****
  AC_CONST
  AC_DEFINE(HAS_ANSI_CONST)
  
! AC_COMPILE_CHECK([volatile],[volatile int x();], ,AC_DEFINE(HAS_ANSI_VOLATILE))
  
  dnl BITS16, BITS32, BITS64
! AC_DEFINE(BITS32)
  
  dnl then from osconf.h, we have
  AC_TIME_WITH_SYS_TIME
--- 106,148 ----
  AC_CONST
  AC_DEFINE(HAS_ANSI_CONST)
  
! AC_MSG_CHECKING(for volatile)
! AC_CACHE_VAL(krb5_cv_type_volatile,
! [AC_TRY_COMPILE(
! [volatile],[volatile int x();], krb5_cv_type_volatile=yes, krb5_cv_type_volatile=no)])
! AC_MSG_RESULT($krb5_cv_type_volatile)
! if test $krb5_cv_type_volatile = yes; then
! 	AC_DEFINE(HAS_ANSI_VOLATILE)
! fi
  
  dnl BITS16, BITS32, BITS64
! 
! dnl Need some sizes for use below. This is separate for nice output..
! AC_CACHE_VAL(krb5_cv_sys_bits,
! [AC_SIZEOF_TYPE(int)
! AC_SIZEOF_TYPE(long)])
! dnl
! AC_MSG_CHECKING(for value of BITS definition)
! AC_CACHE_VAL(krb5_cv_sys_bits,
! [if test $ac_cv_sizeof_long = 8 && test $ac_cv_sizeof_int = 4; then
! 	krb5_cv_sys_bits=64
! elif test $ac_cv_sizeof_long = 4 && test $ac_cv_sizeof_int = 4; then
! 	krb5_cv_sys_bits=32
! else 
! 	AC_MSG_ERROR(Cannot determine BITS information for this platform)
! fi
! ])
! AC_MSG_RESULT($krb5_cv_sys_bits)
! if test $krb5_cv_sys_bits = 64; then
! 	AC_DEFINE(BITS64)
! elif test $krb5_cv_sys_bits = 32; then
! 	AC_DEFINE(BITS32)
! else
! 	AC_MSG_ERROR(Confifuration file error)
! fi
! 
! dnl AC_SIZEOF_TYPE(long)
! dnl AC_DEFINE(BITS32)
  
  dnl then from osconf.h, we have
  AC_TIME_WITH_SYS_TIME
===================================================================
RCS file: /mit/krb5/.cvsroot/src/include/krb5/wordsize.h,v
retrieving revision 5.16
diff -c -r5.16 wordsize.h
*** 5.16	1994/08/18 21:19:45
--- wordsize.h	1994/10/01 11:58:50
***************
*** 49,59 ****
  typedef	unsigned int	krb5_ui_4;
  #endif
  
- #ifdef NOT_RIGHT_YET
  /*
   * Incorporated from the Sandia changes; but this can't be right; if
   * we're on a 64 bit machine, an int shouldn't be 32 bits!?!
   * [tytso:19920616.2224EDT]
   */
  #ifdef BITS64
  #define __OK
--- 49,60 ----
  typedef	unsigned int	krb5_ui_4;
  #endif
  
  /*
   * Incorporated from the Sandia changes; but this can't be right; if
   * we're on a 64 bit machine, an int shouldn't be 32 bits!?!
   * [tytso:19920616.2224EDT]
+  * For an alpha - ints are 32bit and longs are 64 -- better O/S checking
+  * casting may be needed.
   */
  #ifdef BITS64
  #define __OK
***************
*** 63,70 ****
  typedef	unsigned char	krb5_ui_1;
  typedef	unsigned short	krb5_ui_2;
  typedef	unsigned int	krb5_ui_4;
  #endif
- #endif	/* NOT RIGHT YET */
  
  #ifndef __OK
   ?==error:  must define word size!
--- 64,72 ----
  typedef	unsigned char	krb5_ui_1;
  typedef	unsigned short	krb5_ui_2;
  typedef	unsigned int	krb5_ui_4;
+ /* See des.h */
+ #define KRB_INT32 int
  #endif
  
  #ifndef __OK
   ?==error:  must define word size!
===================================================================
RCS file: /mit/krb5/.cvsroot/src/lib/krb5/krb/compat_recv.c,v
retrieving revision 5.5
diff -c -r5.5 compat_recv.c
*** 5.5	1994/08/18 22:05:10
--- compat_recv.c	1994/11/03 06:57:54
***************
*** 227,234 ****
      char krb_vers[KRB_SENDAUTH_VLEN + 1]; /* + 1 for the null terminator */
      char *cp;
      int rem;
!     long tkt_len, priv_len;
!     u_long cksum;
      u_char tmp_buf[MAX_KTXT_LEN+max(KRB_SENDAUTH_VLEN+1,21)];
  
      /* read the application version string */
--- 227,234 ----
      char krb_vers[KRB_SENDAUTH_VLEN + 1]; /* + 1 for the null terminator */
      char *cp;
      int rem;
!     krb5_int32 tkt_len, priv_len;
!     krb5_ui_4 cksum;
      u_char tmp_buf[MAX_KTXT_LEN+max(KRB_SENDAUTH_VLEN+1,21)];
  
      /* read the application version string */
===================================================================
===================================================================
RCS file: /mit/krb5/.cvsroot/src/util/et/com_err.h,v
retrieving revision 5.3
diff -c -r5.3 com_err.h
*** 5.3	1994/06/22 22:48:45
--- com_err.h	1994/10/06 22:37:21
***************
*** 25,43 ****
  
  #ifdef __STDC__
  /* ANSI C -- use prototypes etc */
! void com_err (const char *, long, const char *, ...);
! char const *error_message (long);
! void (*com_err_hook) (const char *, long, const char *, va_list);
! void (*set_com_err_hook (void (*) (const char *, long, const char *, va_list)))
      (const char *, long, const char *, va_list);
! void (*reset_com_err_hook ()) (const char *, long, const char *, va_list);
  #else
  /* no prototypes */
! void com_err ();
! char *error_message ();
! void (*com_err_hook) ();
! void (*set_com_err_hook ()) ();
! void (*reset_com_err_hook ()) ();
  #endif
  
  #define __COM_ERR_H
--- 25,43 ----
  
  #ifdef __STDC__
  /* ANSI C -- use prototypes etc */
! extern void com_err (const char *, long, const char *, ...);
! extern char const *error_message (long);
! extern void (*com_err_hook) (const char *, long, const char *, va_list);
! extern void (*set_com_err_hook (void (*) (const char *, long, const char *, va_list)))
      (const char *, long, const char *, va_list);
! extern void (*reset_com_err_hook ()) (const char *, long, const char *, va_list);
  #else
  /* no prototypes */
! extern void com_err ();
! extern char *error_message ();
! extern void (*com_err_hook) ();
! extern void (*set_com_err_hook ()) ();
! extern void (*reset_com_err_hook ()) ();
  #endif
  
  #define __COM_ERR_H

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