[1744] in Kerberos-V5-bugs

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

AIX 3.2.5 porting notes/fixes

daemon@ATHENA.MIT.EDU (Mark Carson)
Tue Dec 19 14:04:48 1995

Date: Tue, 19 Dec 1995 14:04:41 -0500 (EST)
From: Mark Carson <carson@cs.umd.edu>
To: krb5-bugs@MIT.EDU

Continuing my previous message, I have ported the May beta 5 code to
AIX 3.2.5.  This message covers the AIX-specific changes I made.

Mark Carson

Notes: 1. I did some minimal testing of these same changes on AIX 3.2,
and they seem to work there too.  I haven't yet tried anything on AIX
4.1.

2. I used gnu make, but AIX awk, yacc, etc.  This worked ok except it
turns out making the kerbsrc.zip file for the Windows build requires
gawk.  (This wasn't made configurable unlike the other usage of (g)awk.)
Using gawk, though, I created the kerbsrc.zip file and successfully built
it and ran it on a Windows 3.1 system.

3. In doing the port, I found (as is usually the case) it's best to
start with BSD versions rather than System V versions.  More generally,
the preference list is (a) POSIX (b) BSD (c) System V.

4. In particular, even though AIX 3.2.5 supports streams, you're better
off not using the streams-dependent code.  I didn't take the time to
figure out how to get configure not to define HAVE_STREAMS, but just
eliminated it manually.  (The files involved are src/appl/bsd/krlogin.c
and src/appl/bsd/krlogind.c.)

5. Configure needs to check whether <time.h> is needed.  For now, I
simply wired in -DNEED_TIME_H.

6. The install program in /usr/ucb is BSD-compatible and works just
fine for the install.  This is fortunate, since the Makefiles configure
built didn't always have the path to the install-sh script right.  (I
didn't investigate what the problem was.)

7. I also enabled telnet encryption in my build.

8. In summary, to configure for the build, I ran (in <toplevel>/rs6000)
configure as follows:

export INSTALL='/usr/ucb/install -c'
../src/configure --with-cppopts='-D_BSD -DBSD -D_ALL_SOURCE -DNEED_TIME_H -DENCRYPTION -DDES_ENCRYPTION'

and then patched up the HAVE_STREAMS defines.

Code changes (in addition to those reported previously):

1. /usr/include/sys/stat.h (yes, the system header file) -- fchmod was
declared incorrectly.  This may well be fixed in one of the AIX 3.2.5
patches.

2. /usr/include/netdb.h -- the field named n_name conflicts with a define
in /usr/include/nlist.h.  I modified netdb.h to undefine the offender.
Again, an AIX 3.2.5 patch may offer a better solution.

3. src/appl/bsd/krlogin.c -- the status argument needs to be cast to (int *).

Context diffs (Warning! Don't blindly apply the system header file changes!
They may well not be relevant for your version!):

*** /usr/include/sys/stat.h.orig	Sun Aug 22 10:39:27 1993
--- /usr/include/sys/stat.h	Fri Dec  1 11:07:03 1995
***************
*** 157,163 ****
  #else                           /* use POSIX required prototypes */
  #ifndef _KERNEL
          extern int      lstat(const char *, struct stat *);
!         extern int      fchmod(char *, mode_t);
  #endif /* _KERNEL */
  #endif /* _NO_PROTO */
  
--- 157,164 ----
  #else                           /* use POSIX required prototypes */
  #ifndef _KERNEL
          extern int      lstat(const char *, struct stat *);
! 	/* @@ Mark -- this had char * instead of int!! */
!         extern int      fchmod(int, mode_t);
  #endif /* _KERNEL */
  #endif /* _NO_PROTO */
  
*** /usr/include/netdb.h.orig	Sun Oct 11 15:32:56 1992
--- /usr/include/netdb.h	Fri Dec  1 11:13:07 1995
***************
*** 73,78 ****
--- 73,82 ----
   * Assumption here is that a network number
   * fits in 32 bits -- probably a poor one.
   */
+ /* @@ Mark -- conflicts with nlist.h */
+ #ifdef n_name
+ #undef n_name
+ #endif
  struct	netent {
  	char		*n_name;	/* official name of net */
  	char		**n_aliases;	/* alias list */
*** src/appl/bsd/krlogin.c.orig	Fri Apr 21 15:11:00 1995
--- src/appl/bsd/krlogin.c	Fri Dec  1 14:10:26 1995
***************
*** 960,966 ****
      
    again:
  #ifdef HAVE_WAITPID
!     pid = waitpid(-1, &status, WNOHANG|WUNTRACED);
  #else
      pid = wait3(&status, WNOHANG|WUNTRACED, (struct rusage *)0);
  #endif
--- 964,974 ----
      
    again:
  #ifdef HAVE_WAITPID
!     pid = waitpid(-1, 
! #ifdef _AIX
! 		(int *)
! #endif
! 		&status, WNOHANG|WUNTRACED);
  #else
      pid = wait3(&status, WNOHANG|WUNTRACED, (struct rusage *)0);
  #endif


Mark Carson	carson@cs.umd.edu	301-240-7348
Department of Computer Science   University of Maryland, College Park -or-
FSC 182/3F42   700 N. Frederick Ave.   Gaithersburg MD 20879


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