I found an AIX machine in a remote corner of this building and compiled
it. Here are the diffs.


*** nfsbug.c	Mon May 16 15:30:08 1994
--- nfsbug.c.safe	Mon May 16 15:24:05 1994
***************
*** 8,14 ****
   * mknod bug, and the uid masking bug.
   *
   * Author:
!  *	Leendert van Doorn, may 1994
   *
   * TODO:
   *	- close sockets (?)
--- 8,14 ----
   * mknod bug, and the uid masking bug.
   *
   * Author:
!  *	Leendert van Doorn, april 1994
   *
   * TODO:
   *	- close sockets (?)
***************
*** 21,27 ****
  #ifdef SVR4
  #include <rpc/clnt_soc.h>
  #endif
- #include <sys/types.h>
  #include <sys/param.h>
  #include <sys/socket.h>
  #include <netinet/in.h>
--- 21,26 ----
***************
*** 31,37 ****
  #include <sys/vnode.h>
  #include <sys/vfs.h>
  #include <sys/sysmacros.h>
! #if defined(SVR4) || defined(AIX)
  #include <sys/inode.h>
  #else
  #ifndef HPUX
--- 30,36 ----
  #include <sys/vnode.h>
  #include <sys/vfs.h>
  #include <sys/sysmacros.h>
! #ifdef SVR4
  #include <sys/inode.h>
  #else
  #ifndef HPUX
***************
*** 117,137 ****
   * This struct is only used to find the size of the data field in the
   * fhandle structure below.
   */
! struct xfhsize {
!     fsid_t  xf1;
!     u_short xf2;
!     char    xf3[4];
!     u_short xf4;
!     char    xf5[4];
  };
! #define NFS_FHMAXDATA   ((NFS_FHSIZE - sizeof (struct xfhsize) + 8) / 2)
  
! struct xsvcfh {
!     fsid_t  xfh_fsid;                /* filesystem id */
!     u_short xfh_len;                 /* file number length */
!     char    xfh_data[NFS_FHMAXDATA]; /* and data */
!     u_short xfh_xlen;                /* export file number length */
!     char    xfh_xdata[NFS_FHMAXDATA]; /* and data */
  };
  
  char *program;
--- 116,136 ----
   * This struct is only used to find the size of the data field in the
   * fhandle structure below.
   */
! struct fhsize {
!     fsid_t  f1;
!     u_short f2;
!     char    f3[4];
!     u_short f4;
!     char    f5[4];
  };
! #define NFS_FHMAXDATA   ((NFS_FHSIZE - sizeof (struct fhsize) + 8) / 2)
  
! struct svcfh {
!     fsid_t  fh_fsid;                /* filesystem id */
!     u_short fh_len;                 /* file number length */
!     char    fh_data[NFS_FHMAXDATA]; /* and data */
!     u_short fh_xlen;                /* export file number length */
!     char    fh_xdata[NFS_FHMAXDATA]; /* and data */
  };
  
  char *program;
***************
*** 485,491 ****
      fhandle *handle;
      CLIENT *client;
  {
!     struct xsvcfh *fh = (struct xsvcfh *) handle;
      diropargs dargs;
      diropres *dres;
      attrstat *ares;
--- 484,490 ----
      fhandle *handle;
      CLIENT *client;
  {
!     struct svcfh *fh = (struct svcfh *) handle;
      diropargs dargs;
      diropres *dres;
      attrstat *ares;
***************
*** 496,508 ****
       * systems.
       */
  #ifdef	HPUX
!     if (fh->xfh_fsid[1] != MOUNT_UFS)
  	return FALSE;
  #else
!     if (fh->xfh_fsid.val[1] != MOUNT_UFS)
  	return FALSE;
  #endif
!     if (*((ino_t *)&fh->xfh_data[2]) != 2)
  	return FALSE;
  
      /* get the file handle for ``..'' */
--- 495,507 ----
       * systems.
       */
  #ifdef	HPUX
!     if (fh->fh_fsid[1] != MOUNT_UFS)
  	return FALSE;
  #else
!     if (fh->fh_fsid.val[1] != MOUNT_UFS)
  	return FALSE;
  #endif
!     if (*((ino_t *)&fh->fh_data[2]) != 2)
  	return FALSE;
  
      /* get the file handle for ``..'' */
***************
*** 706,738 ****
   */
  void
  makehandle(handle, maj, min, inum, gen, rinum, rgen)
!     struct xsvcfh *handle;
      int maj, min;
      long inum, gen;
      long rinum, rgen;
  {
  #ifdef	HPUX
!     handle->xfh_fsid[0] = makedev(maj, min);
!     handle->xfh_fsid[1] = MOUNT_UFS;
  #else
!     handle->xfh_fsid.val[0] = makedev(maj, min);
!     handle->xfh_fsid.val[1] = MOUNT_UFS;
  #endif
  
!     handle->xfh_len = 10;
!     *((u_short *)&handle->xfh_data[0]) = 0;	/* length */
!     *((ino_t *)&handle->xfh_data[2]) = inum;	/* inode */
!     *((long *)&handle->xfh_data[6]) = gen;	/* generation number */
  
!     handle->xfh_xlen = 10;
!     *((u_short *)&handle->xfh_xdata[0]) = 0;	/* length */
!     *((ino_t *)&handle->xfh_xdata[2]) = rinum;	/* inode */
!     *((long *)&handle->xfh_xdata[6]) = rgen;	/* generation number */
  }
  
  void
  printhandle(handle)
!     struct xsvcfh *handle;
  {
      register char *p;
      register int i;
--- 705,737 ----
   */
  void
  makehandle(handle, maj, min, inum, gen, rinum, rgen)
!     struct svcfh *handle;
      int maj, min;
      long inum, gen;
      long rinum, rgen;
  {
  #ifdef	HPUX
!     handle->fh_fsid[0] = makedev(maj, min);
!     handle->fh_fsid[1] = MOUNT_UFS;
  #else
!     handle->fh_fsid.val[0] = makedev(maj, min);
!     handle->fh_fsid.val[1] = MOUNT_UFS;
  #endif
  
!     handle->fh_len = 10;
!     *((u_short *)&handle->fh_data[0]) = 0;	/* length */
!     *((ino_t *)&handle->fh_data[2]) = inum;	/* inode */
!     *((long *)&handle->fh_data[6]) = gen;	/* generation number */
  
!     handle->fh_xlen = 10;
!     *((u_short *)&handle->fh_xdata[0]) = 0;	/* length */
!     *((ino_t *)&handle->fh_xdata[2]) = rinum;	/* inode */
!     *((long *)&handle->fh_xdata[6]) = rgen;	/* generation number */
  }
  
  void
  printhandle(handle)
!     struct svcfh *handle;
  {
      register char *p;
      register int i;
***************
*** 740,756 ****
      /* fsid[0] -> major, minor device number */
  #ifdef	HPUX
      printf("(%d,%d) ",
! 	major(handle->xfh_fsid[0]), minor(handle->xfh_fsid[0]));
  #else
      printf("(%d,%d) ",
! 	major(handle->xfh_fsid.val[0]), minor(handle->xfh_fsid.val[0]));
  #endif
  
      /* fsid[1] -> file system type */
  #ifdef	HPUX
!     switch (handle->xfh_fsid[1]) {
  #else
!     switch (handle->xfh_fsid.val[1]) {
  #endif
      case MOUNT_UFS: printf("ufs "); break;
      case MOUNT_NFS: printf("nfs "); break;
--- 739,755 ----
      /* fsid[0] -> major, minor device number */
  #ifdef	HPUX
      printf("(%d,%d) ",
! 	major(handle->fh_fsid[0]), minor(handle->fh_fsid[0]));
  #else
      printf("(%d,%d) ",
! 	major(handle->fh_fsid.val[0]), minor(handle->fh_fsid.val[0]));
  #endif
  
      /* fsid[1] -> file system type */
  #ifdef	HPUX
!     switch (handle->fh_fsid[1]) {
  #else
!     switch (handle->fh_fsid.val[1]) {
  #endif
      case MOUNT_UFS: printf("ufs "); break;
      case MOUNT_NFS: printf("nfs "); break;
***************
*** 763,781 ****
  
      /* file number length, and data */
      printf("<%d,%ld,%ld> ",
! 	*((u_short *)&handle->xfh_data[0]),
! 	*((ino_t *)&handle->xfh_data[2]),
! 	*((long *)&handle->xfh_data[6]));
  
      /* export file number length, and data */
      printf("<%d,%ld,%ld> ",
! 	*((u_short *)&handle->xfh_xdata[0]),
! 	*((ino_t *)&handle->xfh_xdata[2]),
! 	*((long *)&handle->xfh_xdata[6]));
  
      /* print handle in hex-decimal format (as input for nfs) */
      printf("= <");
!     for (i = 0, p = (char *)handle; i < sizeof(struct xsvcfh); i++, p++)
  	printf(" %02x", *p & 0xFF);
      printf(" >\n");
  }
--- 762,780 ----
  
      /* file number length, and data */
      printf("<%d,%ld,%ld> ",
! 	*((u_short *)&handle->fh_data[0]),
! 	*((ino_t *)&handle->fh_data[2]),
! 	*((long *)&handle->fh_data[6]));
  
      /* export file number length, and data */
      printf("<%d,%ld,%ld> ",
! 	*((u_short *)&handle->fh_xdata[0]),
! 	*((ino_t *)&handle->fh_xdata[2]),
! 	*((long *)&handle->fh_xdata[6]));
  
      /* print handle in hex-decimal format (as input for nfs) */
      printf("= <");
!     for (i = 0, p = (char *)handle; i < sizeof(struct svcfh); i++, p++)
  	printf(" %02x", *p & 0xFF);
      printf(" >\n");
  }
