Index: openafs/src/JAVA/classes/org/openafs/jafs/Token.java
diff -c openafs/src/JAVA/classes/org/openafs/jafs/Token.java:1.2.2.1 openafs/src/JAVA/classes/org/openafs/jafs/Token.java:1.2.2.2
*** openafs/src/JAVA/classes/org/openafs/jafs/Token.java:1.2.2.1	Fri Oct 14 22:14:10 2005
--- openafs/src/JAVA/classes/org/openafs/jafs/Token.java	Fri Dec 14 16:37:39 2007
***************
*** 144,149 ****
--- 144,163 ----
    }
  
    /**
+    * Constructs a new <CODE>Token</CODE> object instance given the
+    * name of the AFS cell it represents; the token for administrative
+    * access will be extracted from the kernel cache manager if possible.
+    *
+    * @param cellName    the name of the cell to Token into
+    * @exception AFSException  If an error occurs in the native code
+    */
+   public Token(String cellName) 
+       throws AFSException
+   {
+       this(null, null, cellName);
+   }
+ 
+   /**
     * Constructs a new <CODE>Token</CODE> object instance given 
     * the name of the AFS cell it represents and the username and password 
     * of the user to be Tokend for 
Index: openafs/src/JAVA/libjafs/AdminToken.c
diff -c openafs/src/JAVA/libjafs/AdminToken.c:1.3.2.1 openafs/src/JAVA/libjafs/AdminToken.c:1.3.2.2
*** openafs/src/JAVA/libjafs/AdminToken.c:1.3.2.1	Fri Oct 14 22:14:11 2005
--- openafs/src/JAVA/libjafs/AdminToken.c	Fri Dec 14 16:37:40 2007
***************
*** 30,35 ****
--- 30,36 ----
  #include <kautils.h>
  #include <cellconfig.h>
  #include <afs_AdminClientErrors.h>
+ #include <rx/rxkad.h>
  
  /**
   * Static function used to initialize the client library and the 
***************
*** 71,76 ****
--- 72,78 ----
    const char *password;
    void *tokenHandle;
    int rc;
+   int err;
  
    // convert java strings
    if( jcellName != NULL ) { 
***************
*** 101,108 ****
        password = NULL;
    }
  
!   if ( !(afsclient_TokenGetNew( cellName, userName, password, &tokenHandle, 
! 				&ast) ) ) {
      // release converted strings
        if( cellName != NULL ) {
  	  (*env)->ReleaseStringUTFChars(env, jcellName, cellName);
--- 103,113 ----
        password = NULL;
    }
  
!   err = (password==NULL || userName==NULL)
!     ? afsclient_TokenGetExisting( cellName, &tokenHandle, &ast)
!     : afsclient_TokenGetNew( cellName, userName, password, &tokenHandle, &ast);
! 
!   if ( !err ) {
      // release converted strings
        if( cellName != NULL ) {
  	  (*env)->ReleaseStringUTFChars(env, jcellName, cellName);
Index: openafs/src/JAVA/libjafs/Makefile.in
diff -c openafs/src/JAVA/libjafs/Makefile.in:1.3.2.1 openafs/src/JAVA/libjafs/Makefile.in:1.3.2.2
*** openafs/src/JAVA/libjafs/Makefile.in:1.3.2.1	Fri Oct 14 22:14:12 2005
--- openafs/src/JAVA/libjafs/Makefile.in	Fri Dec 14 16:37:40 2007
***************
*** 13,19 ****
  TOP_INCDIR=@TOP_INCDIR@
  TOP_LIBDIR=@TOP_LIBDIR@
  TOP_JLIBDIR=@TOP_SRCDIR@/JAVA/libjafs
! JNI_INC=${JAVA_HOME}/include
  prefix=@prefix@
  exec_prefix=@exec_prefix@
  bindir=@bindir@
--- 13,19 ----
  TOP_INCDIR=@TOP_INCDIR@
  TOP_LIBDIR=@TOP_LIBDIR@
  TOP_JLIBDIR=@TOP_SRCDIR@/JAVA/libjafs
! JNI_INC=-I ${JAVA_HOME}/include -I `dirname ${JAVA_HOME}/include/*/jni_md.h`
  prefix=@prefix@
  exec_prefix=@exec_prefix@
  bindir=@bindir@
***************
*** 35,44 ****
  OBJECT_FLAGS = -fPIC -c
  
  ifeq "$(BUILD_TYPE)" "admin"
! 	INC := -I${TOP_INCDIR} -I${TOP_INCDIR}/afs/ -I${JAVA_HOME}/include -I ${JNI_INC}
  	CFLAGS := ${INC} ${DBG} ${OPTMZ} -I${TOP_SRCDIR}/config ${MT_CFLAGS}
  else
! 	INC := -I${TOP_SRCDIR}/libuafs -I${TOP_INCDIR} -I${JAVA_HOME}/include -I ${JNI_INC}
  	CFLAGS := ${INC} ${DBG} ${OPTMZ} ${FSINCLUDES} -D_REENTRANT -DLIBJUAFS ${MT_CFLAGS}
  endif
  
--- 35,44 ----
  OBJECT_FLAGS = -fPIC -c
  
  ifeq "$(BUILD_TYPE)" "admin"
! 	INC := -I${TOP_INCDIR} -I${TOP_INCDIR}/afs/ ${JNI_INC}
  	CFLAGS := ${INC} ${DBG} ${OPTMZ} -I${TOP_SRCDIR}/config ${MT_CFLAGS}
  else
! 	INC := -I${TOP_SRCDIR}/libuafs -I${TOP_INCDIR} ${JNI_INC}
  	CFLAGS := ${INC} ${DBG} ${OPTMZ} ${FSINCLUDES} -D_REENTRANT -DLIBJUAFS ${MT_CFLAGS}
  endif
  
***************
*** 50,56 ****
  JAVADOCSDIR = javadocs/
  
  JAVAH = ${JAVA_HOME}/bin/javah -classpath ${ROOTPACKAGEDIR} -jni -d ${LIBJAFSADMDIR}
! JAVAC = ${JAVA_HOME}/bin/javac -classpath ${ROOTPACKAGEDIR}
  
  J_NATIVE_PREFIX = org.openafs.jafs.
  C_NATIVE_PREFIX = org_openafs_jafs_
--- 50,56 ----
  JAVADOCSDIR = javadocs/
  
  JAVAH = ${JAVA_HOME}/bin/javah -classpath ${ROOTPACKAGEDIR} -jni -d ${LIBJAFSADMDIR}
! JAVAC = ${JAVA_HOME}/bin/javac -source 1.4 -classpath ${ROOTPACKAGEDIR}
  
  J_NATIVE_PREFIX = org.openafs.jafs.
  C_NATIVE_PREFIX = org_openafs_jafs_
***************
*** 153,158 ****
--- 153,159 ----
  
  LIBJAFS_LIBS =\
  	${TOP_LIBDIR}/libjuafs.a \
+ 	${TOP_LIBDIR}/libafsutil.a \
  	${TOP_LIBDIR}/libdes.a \
  	-lresolv \
  	-lpthread
Index: openafs/src/WINNT/afs_setup_utils/afsrm.c
diff -c openafs/src/WINNT/afs_setup_utils/afsrm.c:1.3 openafs/src/WINNT/afs_setup_utils/afsrm.c:1.3.8.1
*** openafs/src/WINNT/afs_setup_utils/afsrm.c:1.3	Tue Sep 18 00:26:47 2001
--- openafs/src/WINNT/afs_setup_utils/afsrm.c	Wed Oct 31 00:13:07 2007
***************
*** 23,29 ****
  #include "forceremove.h"
  
  
! static int DoClient34(struct cmd_syndesc *as, char *arock)
  {
      DWORD status = Client34Eradicate(FALSE);
  
--- 23,29 ----
  #include "forceremove.h"
  
  
! static int DoClient34(struct cmd_syndesc *as, void *arock)
  {
      DWORD status = Client34Eradicate(FALSE);
  
***************
*** 40,46 ****
  {
      struct cmd_syndesc	*ts;
  
!     ts = cmd_CreateSyntax("client34", DoClient34, 0,
  			  "remove AFS 3.4a client");
  }
  
--- 40,46 ----
  {
      struct cmd_syndesc	*ts;
  
!     ts = cmd_CreateSyntax("client34", DoClient34, NULL,
  			  "remove AFS 3.4a client");
  }
  
Index: openafs/src/WINNT/afsd/cklog.c
diff -c openafs/src/WINNT/afsd/cklog.c:1.3.2.1 openafs/src/WINNT/afsd/cklog.c:1.3.2.2
*** openafs/src/WINNT/afsd/cklog.c:1.3.2.1	Tue Apr 10 14:43:34 2007
--- openafs/src/WINNT/afsd/cklog.c	Wed Oct 31 00:13:19 2007
***************
*** 22,28 ****
  #define BAD_ARGUMENT 1
  #define KLOGEXIT(code) exit(code)
  
! int CommandProc();
  
  static int zero_argc;
  static char **zero_argv;
--- 22,28 ----
  #define BAD_ARGUMENT 1
  #define KLOGEXIT(code) exit(code)
  
! static int CommandProc(struct cmd_syndesc *, void *);
  
  static int zero_argc;
  static char **zero_argv;
***************
*** 40,46 ****
      /* Start up sockets */
      WSAStartup(0x0101, &WSAjunk);
  
!     ts = cmd_CreateSyntax((char *) 0, CommandProc, 0, "obtain Kerberos authentication");
  
  #define aXFLAG 0
  #define aPRINCIPAL 1
--- 40,46 ----
      /* Start up sockets */
      WSAStartup(0x0101, &WSAjunk);
  
!     ts = cmd_CreateSyntax(NULL, CommandProc, NULL, "obtain Kerberos authentication");
  
  #define aXFLAG 0
  #define aPRINCIPAL 1
***************
*** 135,143 ****
      return !ok;
  }
  
! CommandProc (as, arock)
!   char *arock;
!   struct cmd_syndesc *as;
  {
      char  name[MAXKTCNAMELEN];
      char  instance[MAXKTCNAMELEN];
--- 135,142 ----
      return !ok;
  }
  
! static int
! CommandProc (struct cmd_syndesc *as, void *arock)
  {
      char  name[MAXKTCNAMELEN];
      char  instance[MAXKTCNAMELEN];
Index: openafs/src/WINNT/afsd/cunlog.c
diff -c openafs/src/WINNT/afsd/cunlog.c:1.2 openafs/src/WINNT/afsd/cunlog.c:1.2.20.1
*** openafs/src/WINNT/afsd/cunlog.c:1.2	Sat Nov  4 05:01:41 2000
--- openafs/src/WINNT/afsd/cunlog.c	Wed Oct 31 00:13:20 2007
***************
*** 15,23 ****
  #include <afsint.h>
  #include <winsock2.h>
  
! CommandProc (as, arock)
!   char *arock;
!   struct cmd_syndesc *as;
  {
    afs_int32 code, ecode=0;
    struct ktc_principal server;
--- 15,22 ----
  #include <afsint.h>
  #include <winsock2.h>
  
! static int
! CommandProc (struct cmd_syndesc *as, void *arock)
  {
    afs_int32 code, ecode=0;
    struct ktc_principal server;
***************
*** 55,61 ****
  
    WSAStartup(0x0101, &WSAjunk);
  
!   ts = cmd_CreateSyntax((char *) 0, CommandProc, 0, "Release Kerberos authentication");
    cmd_AddParm(ts, "-cell", CMD_LIST, CMD_OPTIONAL, "cell name");
  
    code = cmd_Dispatch(argc, argv);
--- 54,60 ----
  
    WSAStartup(0x0101, &WSAjunk);
  
!   ts = cmd_CreateSyntax(NULL, CommandProc, NULL, "Release Kerberos authentication");
    cmd_AddParm(ts, "-cell", CMD_LIST, CMD_OPTIONAL, "cell name");
  
    code = cmd_Dispatch(argc, argv);
Index: openafs/src/WINNT/afsd/fs.c
diff -c openafs/src/WINNT/afsd/fs.c:1.16.2.21 openafs/src/WINNT/afsd/fs.c:1.16.2.22
*** openafs/src/WINNT/afsd/fs.c:1.16.2.21	Tue Apr 10 14:43:35 2007
--- openafs/src/WINNT/afsd/fs.c	Wed Oct 31 00:13:20 2007
***************
*** 50,66 ****
  
  static struct ubik_client *uclient;
  
! static int GetClientAddrsCmd(struct cmd_syndesc *asp, char *arock);
! static int SetClientAddrsCmd(struct cmd_syndesc *asp, char *arock);
! static int FlushMountCmd(struct cmd_syndesc *asp, char *arock);
! static int RxStatProcCmd(struct cmd_syndesc *asp, char *arock);
! static int RxStatPeerCmd(struct cmd_syndesc *asp, char *arock);
  
  extern struct cmd_syndesc *cmd_CreateSyntax();
  
! static int MemDumpCmd(struct cmd_syndesc *asp, char *arock);
! static int CSCPolicyCmd(struct cmd_syndesc *asp, char *arock);
! static int MiniDumpCmd(struct cmd_syndesc *asp, char *arock);
  
  static char pn[] = "fs";
  static int rxInitDone = 0;
--- 50,66 ----
  
  static struct ubik_client *uclient;
  
! static int GetClientAddrsCmd(struct cmd_syndesc *asp, void *arock);
! static int SetClientAddrsCmd(struct cmd_syndesc *asp, void *arock);
! static int FlushMountCmd(struct cmd_syndesc *asp, void *arock);
! static int RxStatProcCmd(struct cmd_syndesc *asp, void *arock);
! static int RxStatPeerCmd(struct cmd_syndesc *asp, void *arock);
  
  extern struct cmd_syndesc *cmd_CreateSyntax();
  
! static int MemDumpCmd(struct cmd_syndesc *asp, void *arock);
! static int CSCPolicyCmd(struct cmd_syndesc *asp, void *arock);
! static int MiniDumpCmd(struct cmd_syndesc *asp, void *arock);
  
  static char pn[] = "fs";
  static int rxInitDone = 0;
***************
*** 873,879 ****
  }
  
  static int
! SetACLCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 873,879 ----
  }
  
  static int
! SetACLCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 1003,1009 ****
  }
  
  static int 
! CopyACLCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 1003,1009 ----
  }
  
  static int 
! CopyACLCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 1179,1185 ****
  
  /* clean up an acl to not have bogus entries */
  static int 
! CleanACLCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct Acl *ta = 0;
--- 1179,1185 ----
  
  /* clean up an acl to not have bogus entries */
  static int 
! CleanACLCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct Acl *ta = 0;
***************
*** 1266,1272 ****
  }
  
  static int 
! ListACLCmd(struct cmd_syndesc *as, char *arock) 
  {
      afs_int32 code;
      struct Acl *ta = 0;
--- 1266,1272 ----
  }
  
  static int 
! ListACLCmd(struct cmd_syndesc *as, void *arock) 
  {
      afs_int32 code;
      struct Acl *ta = 0;
***************
*** 1332,1338 ****
  }
  
  static int
! FlushAllCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 1332,1338 ----
  }
  
  static int
! FlushAllCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 1347,1353 ****
  }
  
  static int
! FlushVolumeCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 1347,1353 ----
  }
  
  static int
! FlushVolumeCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 1369,1375 ****
  }
  
  static int 
! FlushCmd(struct cmd_syndesc *as, char *arock) 
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 1369,1375 ----
  }
  
  static int 
! FlushCmd(struct cmd_syndesc *as, void *arock) 
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 1397,1403 ****
  
  /* all this command does is repackage its args and call SetVolCmd */
  static int
! SetQuotaCmd(struct cmd_syndesc *as, char *arock) {
      struct cmd_syndesc ts;
  
      /* copy useful stuff from our command slot; we may later have to reorder */
--- 1397,1403 ----
  
  /* all this command does is repackage its args and call SetVolCmd */
  static int
! SetQuotaCmd(struct cmd_syndesc *as, void *arock) {
      struct cmd_syndesc ts;
  
      /* copy useful stuff from our command slot; we may later have to reorder */
***************
*** 1406,1412 ****
  }
  
  static int
! SetVolCmd(struct cmd_syndesc *as, char *arock) {
      afs_int32 code;
      struct ViceIoctl blob;
      struct cmd_item *ti;
--- 1406,1412 ----
  }
  
  static int
! SetVolCmd(struct cmd_syndesc *as, void *arock) {
      afs_int32 code;
      struct ViceIoctl blob;
      struct cmd_item *ti;
***************
*** 1482,1488 ****
  #endif /* WIN32 */
  
  static int 
! ExamineCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 1482,1488 ----
  #endif /* WIN32 */
  
  static int 
! ExamineCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 1545,1551 ****
  }
  
  static int
! ListQuotaCmd(struct cmd_syndesc *as, char *arock) 
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 1545,1551 ----
  }
  
  static int
! ListQuotaCmd(struct cmd_syndesc *as, void *arock) 
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 1577,1583 ****
  }
  
  static int
! WhereIsCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 1577,1583 ----
  }
  
  static int
! WhereIsCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 1616,1622 ****
  
  
  static int
! DiskFreeCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 1616,1622 ----
  
  
  static int
! DiskFreeCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 1647,1653 ****
  }
  
  static int
! QuotaCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 1647,1653 ----
  }
  
  static int
! QuotaCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 1679,1685 ****
  }
  
  static int
! ListMountCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 1679,1685 ----
  }
  
  static int
! ListMountCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 1831,1837 ****
  }
  
  static int
! MakeMountCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      char *cellName, *volName, *tmpName;
--- 1831,1837 ----
  }
  
  static int
! MakeMountCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      char *cellName, *volName, *tmpName;
***************
*** 1973,1979 ****
   *      tp: Set to point to the actual name of the mount point to nuke.
   */
  static int
! RemoveMountCmd(struct cmd_syndesc *as, char *arock) {
      afs_int32 code=0;
      struct ViceIoctl blob;
      struct cmd_item *ti;
--- 1973,1979 ----
   *      tp: Set to point to the actual name of the mount point to nuke.
   */
  static int
! RemoveMountCmd(struct cmd_syndesc *as, void *arock) {
      afs_int32 code=0;
      struct ViceIoctl blob;
      struct cmd_item *ti;
***************
*** 2049,2055 ****
  */
  
  static int
! CheckServersCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 2049,2055 ----
  */
  
  static int
! CheckServersCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 2155,2161 ****
  }
  
  static int
! MessagesCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code=0;
      struct ViceIoctl blob;
--- 2155,2161 ----
  }
  
  static int
! MessagesCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code=0;
      struct ViceIoctl blob;
***************
*** 2198,2204 ****
  }
  
  static int
! CheckVolumesCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 2198,2204 ----
  }
  
  static int
! CheckVolumesCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 2216,2222 ****
  }
  
  static int
! SetCacheSizeCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 2216,2222 ----
  }
  
  static int
! SetCacheSizeCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 2261,2267 ****
  
  #define MAXGCSIZE	16
  static int
! GetCacheParmsCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 2261,2267 ----
  
  #define MAXGCSIZE	16
  static int
! GetCacheParmsCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 2286,2292 ****
  }
  
  static int
! ListCellsCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      afs_int32 i, j, *lp, magic, size;
--- 2286,2292 ----
  }
  
  static int
! ListCellsCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      afs_int32 i, j, *lp, magic, size;
***************
*** 2346,2352 ****
  
  #ifndef WIN32
  static int
! ListAliasesCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code, i;
      char *tp, *aliasName, *realName;
--- 2346,2352 ----
  
  #ifndef WIN32
  static int
! ListAliasesCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code, i;
      char *tp, *aliasName, *realName;
***************
*** 2376,2382 ****
  }
  
  static int
! CallBackRxConnCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 2376,2382 ----
  }
  
  static int
! CallBackRxConnCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 2416,2422 ****
  #endif /* WIN32 */
  
  static int
! NewCellCmd(struct cmd_syndesc *as, char *arock)
  {
  #ifndef WIN32
      afs_int32 code, linkedstate=0, size=0, *lp;
--- 2416,2422 ----
  #endif /* WIN32 */
  
  static int
! NewCellCmd(struct cmd_syndesc *as, void *arock)
  {
  #ifndef WIN32
      afs_int32 code, linkedstate=0, size=0, *lp;
***************
*** 2513,2519 ****
  
  #ifndef WIN32
  static int
! NewAliasCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 2513,2519 ----
  
  #ifndef WIN32
  static int
! NewAliasCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 2549,2555 ****
  #endif /* WIN32 */
  
  static int
! WhichCellCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct cmd_item *ti;
--- 2549,2555 ----
  #endif /* WIN32 */
  
  static int
! WhichCellCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct cmd_item *ti;
***************
*** 2573,2579 ****
  }
  
  static int
! WSCellCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 2573,2579 ----
  }
  
  static int
! WSCellCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 2596,2602 ****
  
  /*
  static int
! PrimaryCellCmd(struct cmd_syndesc *as, char *arock)
  {
      fprintf(stderr,"This command is obsolete, as is the concept of a primary token.\n");
      return 0;
--- 2596,2602 ----
  
  /*
  static int
! PrimaryCellCmd(struct cmd_syndesc *as, void *arock)
  {
      fprintf(stderr,"This command is obsolete, as is the concept of a primary token.\n");
      return 0;
***************
*** 2604,2610 ****
  */
  
  static int
! MonitorCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 2604,2610 ----
  */
  
  static int
! MonitorCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 2664,2670 ****
  }
  
  static int
! SysNameCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 2664,2670 ----
  }
  
  static int
! SysNameCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 2734,2740 ****
  }
  
  static char *exported_types[] = {"null", "nfs", ""};
! static int ExportAfsCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 2734,2740 ----
  }
  
  static char *exported_types[] = {"null", "nfs", ""};
! static int ExportAfsCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 2837,2843 ****
  
  
  static int
! GetCellCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 2837,2843 ----
  
  
  static int
! GetCellCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 2886,2892 ****
      return error;
  }
  
! static int SetCellCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 2886,2892 ----
      return error;
  }
  
! static int SetCellCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 3173,3179 ****
  
  #ifdef WIN32
  static int
! SetPrefCmd(struct cmd_syndesc *as, char * arock)
  {
      FILE *infd;
      afs_int32 code;
--- 3173,3179 ----
  
  #ifdef WIN32
  static int
! SetPrefCmd(struct cmd_syndesc *as, void * arock)
  {
      FILE *infd;
      afs_int32 code;
***************
*** 3263,3269 ****
  }
  #else
  static int
! SetPrefCmd(struct cmd_syndesc *as, char *arock)
  {
      FILE *infd;
      afs_int32 code;
--- 3263,3269 ----
  }
  #else
  static int
! SetPrefCmd(struct cmd_syndesc *as, void *arock)
  {
      FILE *infd;
      afs_int32 code;
***************
*** 3369,3375 ****
  
  #ifdef WIN32
  static int 
! GetPrefCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct cmd_item *ti;
--- 3369,3375 ----
  
  #ifdef WIN32
  static int 
! GetPrefCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct cmd_item *ti;
***************
*** 3440,3446 ****
  }
  #else
  static int
! GetPrefCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct cmd_item *ti;
--- 3440,3446 ----
  }
  #else
  static int
! GetPrefCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct cmd_item *ti;
***************
*** 3511,3517 ****
  #endif /* WIN32 */
  
  static int
! TraceCmd(struct cmd_syndesc *asp, char *arock)
  {
      long code;
      struct ViceIoctl blob;
--- 3511,3517 ----
  #endif /* WIN32 */
  
  static int
! TraceCmd(struct cmd_syndesc *asp, void *arock)
  {
      long code;
      struct ViceIoctl blob;
***************
*** 3573,3579 ****
  
  /* fs sb -kbytes 9999 -files *.o -default 64 */
  static int
! StoreBehindCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code = 0;
      struct ViceIoctl blob;
--- 3573,3579 ----
  
  /* fs sb -kbytes 9999 -files *.o -default 64 */
  static int
! StoreBehindCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code = 0;
      struct ViceIoctl blob;
***************
*** 3680,3686 ****
  }
  
  static afs_int32 
! SetCryptCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code = 0, flag;
      struct ViceIoctl blob;
--- 3680,3686 ----
  }
  
  static afs_int32 
! SetCryptCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code = 0, flag;
      struct ViceIoctl blob;
***************
*** 3713,3719 ****
  }
  
  static afs_int32 
! GetCryptCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code = 0, flag;
      struct ViceIoctl blob;
--- 3713,3719 ----
  }
  
  static afs_int32 
! GetCryptCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code = 0, flag;
      struct ViceIoctl blob;
***************
*** 3741,3747 ****
  }
  
  static int
! MemDumpCmd(struct cmd_syndesc *asp, char *arock)
  {
      long code;
      struct ViceIoctl blob;
--- 3741,3747 ----
  }
  
  static int
! MemDumpCmd(struct cmd_syndesc *asp, void *arock)
  {
      long code;
      struct ViceIoctl blob;
***************
*** 3786,3792 ****
  }
  
  static int
! MiniDumpCmd(struct cmd_syndesc *asp, char *arock)
  {
      BOOL success = 0;
      SERVICE_STATUS status;
--- 3786,3792 ----
  }
  
  static int
! MiniDumpCmd(struct cmd_syndesc *asp, void *arock)
  {
      BOOL success = 0;
      SERVICE_STATUS status;
***************
*** 3827,3833 ****
  }
  
  static int
! CSCPolicyCmd(struct cmd_syndesc *asp, char *arock)
  {
      struct cmd_item *ti;
      char *share = NULL;
--- 3827,3833 ----
  }
  
  static int
! CSCPolicyCmd(struct cmd_syndesc *asp, void *arock)
  {
      struct cmd_item *ti;
      char *share = NULL;
***************
*** 3941,3947 ****
  #ifndef WIN32
  /* get clients interface addresses */
  static int
! GetClientAddrsCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct cmd_item *ti;
--- 3941,3947 ----
  #ifndef WIN32
  /* get clients interface addresses */
  static int
! GetClientAddrsCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct cmd_item *ti;
***************
*** 3987,3993 ****
  }
  
  static int
! SetClientAddrsCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code, addr;
      struct cmd_item *ti;
--- 3987,3993 ----
  }
  
  static int
! SetClientAddrsCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code, addr;
      struct cmd_item *ti;
***************
*** 4061,4067 ****
  }
  
  static int
! FlushMountCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 4061,4067 ----
  }
  
  static int
! FlushMountCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 4178,4184 ****
  #endif /* WIN32 */
  
  static int
! RxStatProcCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      afs_int32 flags = 0;
--- 4178,4184 ----
  #endif /* WIN32 */
  
  static int
! RxStatProcCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      afs_int32 flags = 0;
***************
*** 4213,4219 ****
  }
  
  static int
! RxStatPeerCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      afs_int32 flags = 0;
--- 4213,4219 ----
  }
  
  static int
! RxStatPeerCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      afs_int32 flags = 0;
***************
*** 4280,4311 ****
      osi_Init();
  
  #ifndef WIN32
!     ts = cmd_CreateSyntax("getclientaddrs", GetClientAddrsCmd, 0,
  			  "get client network interface addresses");
      cmd_CreateAlias(ts, "gc");
  
!     ts = cmd_CreateSyntax("setclientaddrs", SetClientAddrsCmd, 0,
  			  "set client network interface addresses");
      cmd_AddParm(ts, "-address", CMD_LIST, CMD_OPTIONAL | CMD_EXPANDS,
                  "client network interfaces");
      cmd_CreateAlias(ts, "sc");
  #endif /* WIN32 */
  
!     ts = cmd_CreateSyntax("setserverprefs", SetPrefCmd, 0, "set server ranks");
      cmd_AddParm(ts, "-servers", CMD_LIST, CMD_OPTIONAL|CMD_EXPANDS, "fileserver names and ranks");
      cmd_AddParm(ts, "-vlservers", CMD_LIST, CMD_OPTIONAL|CMD_EXPANDS, "VL server names and ranks");
      cmd_AddParm(ts, "-file", CMD_SINGLE, CMD_OPTIONAL, "input from named file");
      cmd_AddParm(ts, "-stdin", CMD_FLAG, CMD_OPTIONAL, "input from stdin");
      cmd_CreateAlias(ts, "sp");
  
!     ts = cmd_CreateSyntax("getserverprefs", GetPrefCmd, 0, "get server ranks");
      cmd_AddParm(ts, "-file", CMD_SINGLE, CMD_OPTIONAL, "output to named file");
      cmd_AddParm(ts, "-numeric", CMD_FLAG, CMD_OPTIONAL, "addresses only");
      cmd_AddParm(ts, "-vlservers", CMD_FLAG, CMD_OPTIONAL, "VL servers");
      /* cmd_AddParm(ts, "-cell", CMD_FLAG, CMD_OPTIONAL, "cellname"); */
      cmd_CreateAlias(ts, "gp");
  
!     ts = cmd_CreateSyntax("setacl", SetACLCmd, 0, "set access control list");
      cmd_AddParm(ts, "-dir", CMD_LIST, 0, "directory");
      cmd_AddParm(ts, "-acl", CMD_LIST, 0, "access list entries");
      cmd_AddParm(ts, "-clear", CMD_FLAG, CMD_OPTIONAL, "clear access list");
--- 4280,4311 ----
      osi_Init();
  
  #ifndef WIN32
!     ts = cmd_CreateSyntax("getclientaddrs", GetClientAddrsCmd, NULL,
  			  "get client network interface addresses");
      cmd_CreateAlias(ts, "gc");
  
!     ts = cmd_CreateSyntax("setclientaddrs", SetClientAddrsCmd, NULL,
  			  "set client network interface addresses");
      cmd_AddParm(ts, "-address", CMD_LIST, CMD_OPTIONAL | CMD_EXPANDS,
                  "client network interfaces");
      cmd_CreateAlias(ts, "sc");
  #endif /* WIN32 */
  
!     ts = cmd_CreateSyntax("setserverprefs", SetPrefCmd, NULL, "set server ranks");
      cmd_AddParm(ts, "-servers", CMD_LIST, CMD_OPTIONAL|CMD_EXPANDS, "fileserver names and ranks");
      cmd_AddParm(ts, "-vlservers", CMD_LIST, CMD_OPTIONAL|CMD_EXPANDS, "VL server names and ranks");
      cmd_AddParm(ts, "-file", CMD_SINGLE, CMD_OPTIONAL, "input from named file");
      cmd_AddParm(ts, "-stdin", CMD_FLAG, CMD_OPTIONAL, "input from stdin");
      cmd_CreateAlias(ts, "sp");
  
!     ts = cmd_CreateSyntax("getserverprefs", GetPrefCmd, NULL, "get server ranks");
      cmd_AddParm(ts, "-file", CMD_SINGLE, CMD_OPTIONAL, "output to named file");
      cmd_AddParm(ts, "-numeric", CMD_FLAG, CMD_OPTIONAL, "addresses only");
      cmd_AddParm(ts, "-vlservers", CMD_FLAG, CMD_OPTIONAL, "VL servers");
      /* cmd_AddParm(ts, "-cell", CMD_FLAG, CMD_OPTIONAL, "cellname"); */
      cmd_CreateAlias(ts, "gp");
  
!     ts = cmd_CreateSyntax("setacl", SetACLCmd, NULL, "set access control list");
      cmd_AddParm(ts, "-dir", CMD_LIST, 0, "directory");
      cmd_AddParm(ts, "-acl", CMD_LIST, 0, "access list entries");
      cmd_AddParm(ts, "-clear", CMD_FLAG, CMD_OPTIONAL, "clear access list");
***************
*** 4315,4331 ****
      cmd_AddParm(ts, "-if", CMD_FLAG, CMD_OPTIONAL, "initial file acl (DFS only)");
      cmd_CreateAlias(ts, "sa");
      
!     ts = cmd_CreateSyntax("listacl", ListACLCmd, 0, "list access control list");
      cmd_AddParm(ts, "-path", CMD_LIST, CMD_OPTIONAL, "dir/file path");
      parm_listacl_id = ts->nParms;
      cmd_AddParm(ts, "-id", CMD_FLAG, CMD_OPTIONAL, "initial directory acl");
      cmd_AddParm(ts, "-if", CMD_FLAG, CMD_OPTIONAL, "initial file acl");
      cmd_CreateAlias(ts, "la");
      
!     ts = cmd_CreateSyntax("cleanacl", CleanACLCmd, 0, "clean up access control list");
      cmd_AddParm(ts, "-path", CMD_LIST, CMD_OPTIONAL, "dir/file path");
      
!     ts = cmd_CreateSyntax("copyacl", CopyACLCmd, 0, "copy access control list");
      cmd_AddParm(ts, "-fromdir", CMD_SINGLE, 0, "source directory (or DFS file)");
      cmd_AddParm(ts, "-todir", CMD_LIST, 0, "destination directory (or DFS file)");
      cmd_AddParm(ts, "-clear", CMD_FLAG, CMD_OPTIONAL, "first clear dest access list");
--- 4315,4331 ----
      cmd_AddParm(ts, "-if", CMD_FLAG, CMD_OPTIONAL, "initial file acl (DFS only)");
      cmd_CreateAlias(ts, "sa");
      
!     ts = cmd_CreateSyntax("listacl", ListACLCmd, NULL, "list access control list");
      cmd_AddParm(ts, "-path", CMD_LIST, CMD_OPTIONAL, "dir/file path");
      parm_listacl_id = ts->nParms;
      cmd_AddParm(ts, "-id", CMD_FLAG, CMD_OPTIONAL, "initial directory acl");
      cmd_AddParm(ts, "-if", CMD_FLAG, CMD_OPTIONAL, "initial file acl");
      cmd_CreateAlias(ts, "la");
      
!     ts = cmd_CreateSyntax("cleanacl", CleanACLCmd, NULL, "clean up access control list");
      cmd_AddParm(ts, "-path", CMD_LIST, CMD_OPTIONAL, "dir/file path");
      
!     ts = cmd_CreateSyntax("copyacl", CopyACLCmd, NULL, "copy access control list");
      cmd_AddParm(ts, "-fromdir", CMD_SINGLE, 0, "source directory (or DFS file)");
      cmd_AddParm(ts, "-todir", CMD_LIST, 0, "destination directory (or DFS file)");
      cmd_AddParm(ts, "-clear", CMD_FLAG, CMD_OPTIONAL, "first clear dest access list");
***************
*** 4335,4350 ****
      
      cmd_CreateAlias(ts, "ca");
  
!     ts = cmd_CreateSyntax("flush", FlushCmd, 0, "flush file from cache");
      cmd_AddParm(ts, "-path", CMD_LIST, CMD_OPTIONAL, "dir/file path");
      
  #ifndef WIN32
!     ts = cmd_CreateSyntax("flushmount", FlushMountCmd, 0,
                             "flush mount symlink from cache");
      cmd_AddParm(ts, "-path", CMD_LIST, CMD_OPTIONAL, "dir/file path");
  #endif
  
!     ts = cmd_CreateSyntax("setvol", SetVolCmd, 0, "set volume status");
      cmd_AddParm(ts, "-path", CMD_LIST, CMD_OPTIONAL, "dir/file path");
      cmd_AddParm(ts, "-max", CMD_SINGLE, CMD_OPTIONAL, "disk space quota in 1K units");
  #ifdef notdef
--- 4335,4350 ----
      
      cmd_CreateAlias(ts, "ca");
  
!     ts = cmd_CreateSyntax("flush", FlushCmd, NULL, "flush file from cache");
      cmd_AddParm(ts, "-path", CMD_LIST, CMD_OPTIONAL, "dir/file path");
      
  #ifndef WIN32
!     ts = cmd_CreateSyntax("flushmount", FlushMountCmd, NULL,
                             "flush mount symlink from cache");
      cmd_AddParm(ts, "-path", CMD_LIST, CMD_OPTIONAL, "dir/file path");
  #endif
  
!     ts = cmd_CreateSyntax("setvol", SetVolCmd, NULL, "set volume status");
      cmd_AddParm(ts, "-path", CMD_LIST, CMD_OPTIONAL, "dir/file path");
      cmd_AddParm(ts, "-max", CMD_SINGLE, CMD_OPTIONAL, "disk space quota in 1K units");
  #ifdef notdef
***************
*** 4354,4382 ****
      cmd_AddParm(ts, "-offlinemsg", CMD_SINGLE, CMD_OPTIONAL, "offline message");
      cmd_CreateAlias(ts, "sv");
      
!     ts = cmd_CreateSyntax("messages", MessagesCmd, 0, "control Cache Manager messages");
      cmd_AddParm(ts, "-show", CMD_SINGLE, CMD_OPTIONAL, "[user|console|all|none]");
  
!     ts = cmd_CreateSyntax("examine", ExamineCmd, 0, "display file/volume status");
      cmd_AddParm(ts, "-path", CMD_LIST, CMD_OPTIONAL, "dir/file path");
      cmd_CreateAlias(ts, "lv");
      cmd_CreateAlias(ts, "listvol");
      
!     ts = cmd_CreateSyntax("listquota", ListQuotaCmd, 0, "list volume quota");
      cmd_AddParm(ts, "-path", CMD_LIST, CMD_OPTIONAL, "dir/file path");
      cmd_CreateAlias(ts, "lq");
      
!     ts = cmd_CreateSyntax("diskfree", DiskFreeCmd, 0, "show server disk space usage");
      cmd_AddParm(ts, "-path", CMD_LIST, CMD_OPTIONAL, "dir/file path");
      cmd_CreateAlias(ts, "df");
      
!     ts = cmd_CreateSyntax("quota", QuotaCmd, 0, "show volume quota usage");
      cmd_AddParm(ts, "-path", CMD_LIST, CMD_OPTIONAL, "dir/file path");
      
!     ts = cmd_CreateSyntax("lsmount", ListMountCmd, 0, "list mount point");    
      cmd_AddParm(ts, "-dir", CMD_LIST, 0, "directory");
      
!     ts = cmd_CreateSyntax("mkmount", MakeMountCmd, 0, "make mount point");
      cmd_AddParm(ts, "-dir", CMD_SINGLE, 0, "directory");
      cmd_AddParm(ts, "-vol", CMD_SINGLE, 0, "volume name");
      cmd_AddParm(ts, "-cell", CMD_SINGLE, CMD_OPTIONAL, "cell name");
--- 4354,4382 ----
      cmd_AddParm(ts, "-offlinemsg", CMD_SINGLE, CMD_OPTIONAL, "offline message");
      cmd_CreateAlias(ts, "sv");
      
!     ts = cmd_CreateSyntax("messages", MessagesCmd, NULL, "control Cache Manager messages");
      cmd_AddParm(ts, "-show", CMD_SINGLE, CMD_OPTIONAL, "[user|console|all|none]");
  
!     ts = cmd_CreateSyntax("examine", ExamineCmd, NULL, "display file/volume status");
      cmd_AddParm(ts, "-path", CMD_LIST, CMD_OPTIONAL, "dir/file path");
      cmd_CreateAlias(ts, "lv");
      cmd_CreateAlias(ts, "listvol");
      
!     ts = cmd_CreateSyntax("listquota", ListQuotaCmd, NULL, "list volume quota");
      cmd_AddParm(ts, "-path", CMD_LIST, CMD_OPTIONAL, "dir/file path");
      cmd_CreateAlias(ts, "lq");
      
!     ts = cmd_CreateSyntax("diskfree", DiskFreeCmd, NULL, "show server disk space usage");
      cmd_AddParm(ts, "-path", CMD_LIST, CMD_OPTIONAL, "dir/file path");
      cmd_CreateAlias(ts, "df");
      
!     ts = cmd_CreateSyntax("quota", QuotaCmd, NULL, "show volume quota usage");
      cmd_AddParm(ts, "-path", CMD_LIST, CMD_OPTIONAL, "dir/file path");
      
!     ts = cmd_CreateSyntax("lsmount", ListMountCmd, NULL, "list mount point");    
      cmd_AddParm(ts, "-dir", CMD_LIST, 0, "directory");
      
!     ts = cmd_CreateSyntax("mkmount", MakeMountCmd, NULL, "make mount point");
      cmd_AddParm(ts, "-dir", CMD_SINGLE, 0, "directory");
      cmd_AddParm(ts, "-vol", CMD_SINGLE, 0, "volume name");
      cmd_AddParm(ts, "-cell", CMD_SINGLE, CMD_OPTIONAL, "cell name");
***************
*** 4391,4421 ****
      */
  
      
!     ts = cmd_CreateSyntax("rmmount", RemoveMountCmd, 0, "remove mount point");
      cmd_AddParm(ts, "-dir", CMD_LIST, 0, "directory");
      
!     ts = cmd_CreateSyntax("checkservers", CheckServersCmd, 0, "check local cell's servers");
      cmd_AddParm(ts, "-cell", CMD_SINGLE, CMD_OPTIONAL, "cell to check");
      cmd_AddParm(ts, "-all", CMD_FLAG, CMD_OPTIONAL, "check all cells");
      cmd_AddParm(ts, "-fast", CMD_FLAG, CMD_OPTIONAL, "just list, don't check");
      cmd_AddParm(ts,"-interval",CMD_SINGLE,CMD_OPTIONAL,"seconds between probes");
      
!     ts = cmd_CreateSyntax("checkvolumes", CheckVolumesCmd,0, "check volumeID/name mappings");
      cmd_CreateAlias(ts, "checkbackups");
  
      
!     ts = cmd_CreateSyntax("setcachesize", SetCacheSizeCmd, 0, "set cache size");
      cmd_AddParm(ts, "-blocks", CMD_SINGLE, CMD_OPTIONAL, "size in 1K byte blocks (0 => reset)");
      cmd_CreateAlias(ts, "cachesize");
  
      cmd_AddParm(ts, "-reset", CMD_FLAG, CMD_OPTIONAL, "reset size back to boot value");
      
!     ts = cmd_CreateSyntax("getcacheparms", GetCacheParmsCmd, 0, "get cache usage info");
  
!     ts = cmd_CreateSyntax("listcells", ListCellsCmd, 0, "list configured cells");
      cmd_AddParm(ts, "-numeric", CMD_FLAG, CMD_OPTIONAL, "addresses only");
      
!     ts = cmd_CreateSyntax("setquota", SetQuotaCmd, 0, "set volume quota");
      cmd_AddParm(ts, "-path", CMD_SINGLE, CMD_OPTIONAL, "dir/file path");
      cmd_AddParm(ts, "-max", CMD_SINGLE, 0, "max quota in kbytes");
  #ifdef notdef
--- 4391,4421 ----
      */
  
      
!     ts = cmd_CreateSyntax("rmmount", RemoveMountCmd, NULL, "remove mount point");
      cmd_AddParm(ts, "-dir", CMD_LIST, 0, "directory");
      
!     ts = cmd_CreateSyntax("checkservers", CheckServersCmd, NULL, "check local cell's servers");
      cmd_AddParm(ts, "-cell", CMD_SINGLE, CMD_OPTIONAL, "cell to check");
      cmd_AddParm(ts, "-all", CMD_FLAG, CMD_OPTIONAL, "check all cells");
      cmd_AddParm(ts, "-fast", CMD_FLAG, CMD_OPTIONAL, "just list, don't check");
      cmd_AddParm(ts,"-interval",CMD_SINGLE,CMD_OPTIONAL,"seconds between probes");
      
!     ts = cmd_CreateSyntax("checkvolumes", CheckVolumesCmd, NULL, "check volumeID/name mappings");
      cmd_CreateAlias(ts, "checkbackups");
  
      
!     ts = cmd_CreateSyntax("setcachesize", SetCacheSizeCmd, NULL, "set cache size");
      cmd_AddParm(ts, "-blocks", CMD_SINGLE, CMD_OPTIONAL, "size in 1K byte blocks (0 => reset)");
      cmd_CreateAlias(ts, "cachesize");
  
      cmd_AddParm(ts, "-reset", CMD_FLAG, CMD_OPTIONAL, "reset size back to boot value");
      
!     ts = cmd_CreateSyntax("getcacheparms", GetCacheParmsCmd, NULL, "get cache usage info");
  
!     ts = cmd_CreateSyntax("listcells", ListCellsCmd, NULL, "list configured cells");
      cmd_AddParm(ts, "-numeric", CMD_FLAG, CMD_OPTIONAL, "addresses only");
      
!     ts = cmd_CreateSyntax("setquota", SetQuotaCmd, NULL, "set volume quota");
      cmd_AddParm(ts, "-path", CMD_SINGLE, CMD_OPTIONAL, "dir/file path");
      cmd_AddParm(ts, "-max", CMD_SINGLE, 0, "max quota in kbytes");
  #ifdef notdef
***************
*** 4423,4429 ****
  #endif
      cmd_CreateAlias(ts, "sq");
  
!     ts = cmd_CreateSyntax("newcell", NewCellCmd, 0, "configure new cell");
  #ifndef WIN32
      cmd_AddParm(ts, "-name", CMD_SINGLE, 0, "cell name");
      cmd_AddParm(ts, "-servers", CMD_LIST, CMD_REQUIRED, "primary servers");
--- 4423,4429 ----
  #endif
      cmd_CreateAlias(ts, "sq");
  
!     ts = cmd_CreateSyntax("newcell", NewCellCmd, NULL, "configure new cell");
  #ifndef WIN32
      cmd_AddParm(ts, "-name", CMD_SINGLE, 0, "cell name");
      cmd_AddParm(ts, "-servers", CMD_LIST, CMD_REQUIRED, "primary servers");
***************
*** 4440,4485 ****
      cmd_AddParm(ts, "-vlport", CMD_SINGLE, CMD_OPTIONAL, "cell's vldb server port");
  #endif
  
!     ts = cmd_CreateSyntax("newalias", NewAliasCmd, 0,
  			  "configure new cell alias");
      cmd_AddParm(ts, "-alias", CMD_SINGLE, 0, "alias name");
      cmd_AddParm(ts, "-name", CMD_SINGLE, 0, "real name of cell");
  #endif
  
!     ts = cmd_CreateSyntax("whichcell", WhichCellCmd, 0, "list file's cell");
      cmd_AddParm(ts, "-path", CMD_LIST, CMD_OPTIONAL, "dir/file path");
  
!     ts = cmd_CreateSyntax("whereis", WhereIsCmd, 0, "list file's location");
      cmd_AddParm(ts, "-path", CMD_LIST, CMD_OPTIONAL, "dir/file path");
  
!     ts = cmd_CreateSyntax("wscell", WSCellCmd, 0, "list workstation's cell");
      
      /*
       ts = cmd_CreateSyntax("primarycell", PrimaryCellCmd, 0, "obsolete (listed primary cell)");
       */
      
!     ts = cmd_CreateSyntax("monitor", MonitorCmd, 0, "set cache monitor host address");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_OPTIONAL, "host name or 'off'");
      cmd_CreateAlias(ts, "mariner");
      
     
!     ts = cmd_CreateSyntax("getcellstatus", GetCellCmd, 0, "get cell status");
      cmd_AddParm(ts, "-cell", CMD_LIST, 0, "cell name");
      
!     ts = cmd_CreateSyntax("setcell", SetCellCmd, 0, "set cell status");
      cmd_AddParm(ts, "-cell", CMD_LIST, 0, "cell name");
      cmd_AddParm(ts, "-suid", CMD_FLAG, CMD_OPTIONAL, "allow setuid programs");
      cmd_AddParm(ts, "-nosuid", CMD_FLAG, CMD_OPTIONAL, "disallow setuid programs");
  
!     ts = cmd_CreateSyntax("flushall", FlushAllCmd, 0, "flush all data");
  
!     ts = cmd_CreateSyntax("flushvolume", FlushVolumeCmd, 0, "flush all data in volume");
      cmd_AddParm(ts, "-path", CMD_LIST, CMD_OPTIONAL, "dir/file path");
  
!     ts = cmd_CreateSyntax("sysname", SysNameCmd, 0, "get/set sysname (i.e. @sys) value");
      cmd_AddParm(ts, "-newsys", CMD_LIST, CMD_OPTIONAL, "new sysname");
  
!     ts = cmd_CreateSyntax("exportafs", ExportAfsCmd, 0, "enable/disable translators to AFS");
      cmd_AddParm(ts, "-type", CMD_SINGLE, 0, "exporter name");
      cmd_AddParm(ts, "-start", CMD_SINGLE, CMD_OPTIONAL, "start/stop translator ('on' or 'off')");
      cmd_AddParm(ts, "-convert", CMD_SINGLE, CMD_OPTIONAL, "convert from afs to unix mode ('on or 'off')");
--- 4440,4485 ----
      cmd_AddParm(ts, "-vlport", CMD_SINGLE, CMD_OPTIONAL, "cell's vldb server port");
  #endif
  
!     ts = cmd_CreateSyntax("newalias", NewAliasCmd, NULL,
  			  "configure new cell alias");
      cmd_AddParm(ts, "-alias", CMD_SINGLE, 0, "alias name");
      cmd_AddParm(ts, "-name", CMD_SINGLE, 0, "real name of cell");
  #endif
  
!     ts = cmd_CreateSyntax("whichcell", WhichCellCmd, NULL, "list file's cell");
      cmd_AddParm(ts, "-path", CMD_LIST, CMD_OPTIONAL, "dir/file path");
  
!     ts = cmd_CreateSyntax("whereis", WhereIsCmd, NULL, "list file's location");
      cmd_AddParm(ts, "-path", CMD_LIST, CMD_OPTIONAL, "dir/file path");
  
!     ts = cmd_CreateSyntax("wscell", WSCellCmd, NULL, "list workstation's cell");
      
      /*
       ts = cmd_CreateSyntax("primarycell", PrimaryCellCmd, 0, "obsolete (listed primary cell)");
       */
      
!     ts = cmd_CreateSyntax("monitor", MonitorCmd, NULL, "set cache monitor host address");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_OPTIONAL, "host name or 'off'");
      cmd_CreateAlias(ts, "mariner");
      
     
!     ts = cmd_CreateSyntax("getcellstatus", GetCellCmd, NULL, "get cell status");
      cmd_AddParm(ts, "-cell", CMD_LIST, 0, "cell name");
      
!     ts = cmd_CreateSyntax("setcell", SetCellCmd, NULL, "set cell status");
      cmd_AddParm(ts, "-cell", CMD_LIST, 0, "cell name");
      cmd_AddParm(ts, "-suid", CMD_FLAG, CMD_OPTIONAL, "allow setuid programs");
      cmd_AddParm(ts, "-nosuid", CMD_FLAG, CMD_OPTIONAL, "disallow setuid programs");
  
!     ts = cmd_CreateSyntax("flushall", FlushAllCmd, NULL, "flush all data");
  
!     ts = cmd_CreateSyntax("flushvolume", FlushVolumeCmd, NULL, "flush all data in volume");
      cmd_AddParm(ts, "-path", CMD_LIST, CMD_OPTIONAL, "dir/file path");
  
!     ts = cmd_CreateSyntax("sysname", SysNameCmd, NULL, "get/set sysname (i.e. @sys) value");
      cmd_AddParm(ts, "-newsys", CMD_LIST, CMD_OPTIONAL, "new sysname");
  
!     ts = cmd_CreateSyntax("exportafs", ExportAfsCmd, NULL, "enable/disable translators to AFS");
      cmd_AddParm(ts, "-type", CMD_SINGLE, 0, "exporter name");
      cmd_AddParm(ts, "-start", CMD_SINGLE, CMD_OPTIONAL, "start/stop translator ('on' or 'off')");
      cmd_AddParm(ts, "-convert", CMD_SINGLE, CMD_OPTIONAL, "convert from afs to unix mode ('on or 'off')");
Index: openafs/src/WINNT/afsd/symlink.c
diff -c openafs/src/WINNT/afsd/symlink.c:1.2.20.5 openafs/src/WINNT/afsd/symlink.c:1.2.20.6
*** openafs/src/WINNT/afsd/symlink.c:1.2.20.5	Tue Apr 10 14:43:36 2007
--- openafs/src/WINNT/afsd/symlink.c	Wed Oct 31 00:13:21 2007
***************
*** 269,276 ****
  }
  
  
! static ListLinkCmd(as)
! register struct cmd_syndesc *as; {
      register afs_int32 code;
      struct ViceIoctl blob;
      int error;
--- 269,276 ----
  }
  
  
! static ListLinkCmd(register struct cmd_syndesc *as, void *arock)
! {
      register afs_int32 code;
      struct ViceIoctl blob;
      int error;
***************
*** 420,427 ****
      return error;
  }
  
! static MakeLinkCmd(as)
! register struct cmd_syndesc *as; {
      register afs_int32 code;
      struct ViceIoctl blob;
      char * parent;
--- 420,427 ----
      return error;
  }
  
! static MakeLinkCmd(register struct cmd_syndesc *as, void *arock)
! {
      register afs_int32 code;
      struct ViceIoctl blob;
      char * parent;
***************
*** 484,491 ****
   *	    symlink (or ``.'' if none is provided)
   *      tp: Set to point to the actual name of the symlink to nuke.
   */
! static RemoveLinkCmd(as)
! register struct cmd_syndesc *as; {
      register afs_int32 code=0;
      struct ViceIoctl blob;
      register struct cmd_item *ti;
--- 484,491 ----
   *	    symlink (or ``.'' if none is provided)
   *      tp: Set to point to the actual name of the symlink to nuke.
   */
! static RemoveLinkCmd(register struct cmd_syndesc *as, void *arock)
! {
      register afs_int32 code=0;
      struct ViceIoctl blob;
      register struct cmd_item *ti;
***************
*** 589,602 ****
  
      osi_Init();
  
!     ts = cmd_CreateSyntax("list", ListLinkCmd, 0, "list symlink");    
      cmd_AddParm(ts, "-name", CMD_LIST, 0, "name");
      
!     ts = cmd_CreateSyntax("make", MakeLinkCmd, 0, "make symlink");
      cmd_AddParm(ts, "-name", CMD_SINGLE, 0, "name");
      cmd_AddParm(ts, "-to", CMD_SINGLE, 0, "target");
  
!     ts = cmd_CreateSyntax("remove", RemoveLinkCmd, 0, "remove symlink");
      cmd_AddParm(ts, "-name", CMD_LIST, 0, "name");
      cmd_CreateAlias(ts, "rm");
  
--- 589,602 ----
  
      osi_Init();
  
!     ts = cmd_CreateSyntax("list", ListLinkCmd, NULL, "list symlink");    
      cmd_AddParm(ts, "-name", CMD_LIST, 0, "name");
      
!     ts = cmd_CreateSyntax("make", MakeLinkCmd, NULL, "make symlink");
      cmd_AddParm(ts, "-name", CMD_SINGLE, 0, "name");
      cmd_AddParm(ts, "-to", CMD_SINGLE, 0, "target");
  
!     ts = cmd_CreateSyntax("remove", RemoveLinkCmd, NULL, "remove symlink");
      cmd_AddParm(ts, "-name", CMD_LIST, 0, "name");
      cmd_CreateAlias(ts, "rm");
  
Index: openafs/src/WINNT/afsd/sample/token.c
diff -c openafs/src/WINNT/afsd/sample/token.c:1.3.2.1 openafs/src/WINNT/afsd/sample/token.c:1.3.2.2
*** openafs/src/WINNT/afsd/sample/token.c:1.3.2.1	Tue Apr 10 14:43:36 2007
--- openafs/src/WINNT/afsd/sample/token.c	Wed Oct 31 00:13:21 2007
***************
*** 18,24 ****
  #define KABADARGUMENT 1
  #define KLOGEXIT(code) exit(code)
  
! int CommandProc();
  
  static int zero_argc;
  static char **zero_argv;
--- 18,24 ----
  #define KABADARGUMENT 1
  #define KLOGEXIT(code) exit(code)
  
! int CommandProc(struct cmd_syndesc *, void *);
  
  static int zero_argc;
  static char **zero_argv;
***************
*** 36,42 ****
      /* Start up sockets */
      WSAStartup(0x0101, &WSAjunk);
  
!     ts = cmd_CreateSyntax((char *) 0, CommandProc, 0, "obtain Kerberos authentication");
  
  #define aXFLAG 0
  #define aPRINCIPAL 1
--- 36,42 ----
      /* Start up sockets */
      WSAStartup(0x0101, &WSAjunk);
  
!     ts = cmd_CreateSyntax(NULL, CommandProc, NULL, "obtain Kerberos authentication");
  
  #define aXFLAG 0
  #define aPRINCIPAL 1
***************
*** 131,139 ****
      return !ok;
  }
  
! CommandProc (as, arock)
!   char *arock;
!   struct cmd_syndesc *as;
  {
      char  name[MAXKTCNAMELEN];
      char  defaultCell[256];
--- 131,138 ----
      return !ok;
  }
  
! int
! CommandProc (struct cmd_syndesc *as, void *arock)
  {
      char  name[MAXKTCNAMELEN];
      char  defaultCell[256];
Index: openafs/src/WINNT/afsreg/test/regman.c
diff -c openafs/src/WINNT/afsreg/test/regman.c:1.3.8.1 openafs/src/WINNT/afsreg/test/regman.c:1.3.8.2
*** openafs/src/WINNT/afsreg/test/regman.c:1.3.8.1	Tue Apr 10 14:43:37 2007
--- openafs/src/WINNT/afsreg/test/regman.c	Wed Oct 31 00:13:22 2007
***************
*** 35,41 ****
  static char* whoami;
  
  
! static int DoVptList(struct cmd_syndesc *as, char *arock)
  {
      struct vpt_iter vpiter;
      struct vptab vpentry;
--- 35,41 ----
  static char* whoami;
  
  
! static int DoVptList(struct cmd_syndesc *as, void *arock)
  {
      struct vpt_iter vpiter;
      struct vptab vpentry;
***************
*** 51,57 ****
      return 0;
  }
  
! static int DoVptAdd(struct cmd_syndesc *as, char *arock)
  {
      char *vpName, *vpDev;
      struct vptab vpentry;
--- 51,57 ----
      return 0;
  }
  
! static int DoVptAdd(struct cmd_syndesc *as, void *arock)
  {
      char *vpName, *vpDev;
      struct vptab vpentry;
***************
*** 79,85 ****
      return 0;
  }
  
! static int DoVptDel(struct cmd_syndesc *as, char *arock)
  {
      char *vpName;
  
--- 79,85 ----
      return 0;
  }
  
! static int DoVptDel(struct cmd_syndesc *as, void *arock)
  {
      char *vpName;
  
***************
*** 98,104 ****
  }
  
  
! static int DoDirGet(struct cmd_syndesc *as, char *arock)
  {
      char *buf;
  
--- 98,104 ----
  }
  
  
! static int DoDirGet(struct cmd_syndesc *as, void *arock)
  {
      char *buf;
  
***************
*** 115,121 ****
  }
  
  
! static int DoDirSet(struct cmd_syndesc *as, char *arock)
  {
      long status;
      HKEY key;
--- 115,121 ----
  }
  
  
! static int DoDirSet(struct cmd_syndesc *as, void *arock)
  {
      long status;
      HKEY key;
***************
*** 143,149 ****
  }
  
  
! static int DoBosCfg(struct cmd_syndesc *as, char *arock)
  {
      char bosSvcPath[AFSDIR_PATH_MAX];
      SC_HANDLE scmHandle, svcHandle;
--- 143,149 ----
  }
  
  
! static int DoBosCfg(struct cmd_syndesc *as, void *arock)
  {
      char bosSvcPath[AFSDIR_PATH_MAX];
      SC_HANDLE scmHandle, svcHandle;
***************
*** 213,219 ****
  }
  
  
! static int DoBosDel(struct cmd_syndesc *as, char *arock)
  {
      int rc = 0;
      SC_HANDLE scmHandle, svcHandle;
--- 213,219 ----
  }
  
  
! static int DoBosDel(struct cmd_syndesc *as, void *arock)
  {
      int rc = 0;
      SC_HANDLE scmHandle, svcHandle;
***************
*** 258,264 ****
      return (rc);
  }
  
! static int DoVersionGet(struct cmd_syndesc *as, char *arock)
  {
      unsigned major, minor, patch;
  
--- 258,264 ----
      return (rc);
  }
  
! static int DoVersionGet(struct cmd_syndesc *as, void *arock)
  {
      unsigned major, minor, patch;
  
***************
*** 286,300 ****
  {
      struct cmd_syndesc	*ts;
  
!     ts = cmd_CreateSyntax("vptlist", DoVptList, 0,
  			  "list vice partition table");
  
!     ts = cmd_CreateSyntax("vptadd", DoVptAdd, 0,
  			  "add entry to vice partition table");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_REQUIRED, "partition name");
      cmd_AddParm(ts, "-dev", CMD_SINGLE, CMD_REQUIRED, "device name");
  
!     ts = cmd_CreateSyntax("vptdel", DoVptDel, 0,
  			  "remove entry from vice partition table");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_REQUIRED, "partition name");
  }
--- 286,300 ----
  {
      struct cmd_syndesc	*ts;
  
!     ts = cmd_CreateSyntax("vptlist", DoVptList, NULL,
  			  "list vice partition table");
  
!     ts = cmd_CreateSyntax("vptadd", DoVptAdd, NULL,
  			  "add entry to vice partition table");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_REQUIRED, "partition name");
      cmd_AddParm(ts, "-dev", CMD_SINGLE, CMD_REQUIRED, "device name");
  
!     ts = cmd_CreateSyntax("vptdel", DoVptDel, NULL,
  			  "remove entry from vice partition table");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_REQUIRED, "partition name");
  }
***************
*** 304,313 ****
  {
      struct cmd_syndesc	*ts;
  
!     ts = cmd_CreateSyntax("dirget", DoDirGet, 0,
  			  "display the AFS server installation directory");
  
!     ts = cmd_CreateSyntax("dirset", DoDirSet, 0,
  			  "set the AFS server installation directory");
      cmd_AddParm(ts, "-path", CMD_SINGLE, CMD_REQUIRED, "directory path");
  }
--- 304,313 ----
  {
      struct cmd_syndesc	*ts;
  
!     ts = cmd_CreateSyntax("dirget", DoDirGet, NULL,
  			  "display the AFS server installation directory");
  
!     ts = cmd_CreateSyntax("dirset", DoDirSet, NULL,
  			  "set the AFS server installation directory");
      cmd_AddParm(ts, "-path", CMD_SINGLE, CMD_REQUIRED, "directory path");
  }
***************
*** 317,327 ****
  {
      struct cmd_syndesc	*ts;
  
!     ts = cmd_CreateSyntax("boscfg", DoBosCfg, 0,
  			  "configure the AFS BOS control service");
      cmd_AddParm(ts, "-path", CMD_SINGLE, CMD_OPTIONAL, "service binary path");
  
!     ts = cmd_CreateSyntax("bosdel", DoBosDel, 0,
  			  "delete (unconfigure) the AFS BOS control service");
  }
  
--- 317,327 ----
  {
      struct cmd_syndesc	*ts;
  
!     ts = cmd_CreateSyntax("boscfg", DoBosCfg, NULL,
  			  "configure the AFS BOS control service");
      cmd_AddParm(ts, "-path", CMD_SINGLE, CMD_OPTIONAL, "service binary path");
  
!     ts = cmd_CreateSyntax("bosdel", DoBosDel, NULL,
  			  "delete (unconfigure) the AFS BOS control service");
  }
  
***************
*** 330,336 ****
  {
      struct cmd_syndesc	*ts;
  
!     ts = cmd_CreateSyntax("version", DoVersionGet, 0,
  			  "display AFS version information");
  }
  
--- 330,336 ----
  {
      struct cmd_syndesc	*ts;
  
!     ts = cmd_CreateSyntax("version", DoVersionGet, NULL,
  			  "display AFS version information");
  }
  
Index: openafs/src/afs/afs.h
diff -c openafs/src/afs/afs.h:1.48.2.30 openafs/src/afs/afs.h:1.48.2.31
*** openafs/src/afs/afs.h:1.48.2.30	Wed Oct 10 12:57:54 2007
--- openafs/src/afs/afs.h	Mon Nov 26 16:21:44 2007
***************
*** 914,919 ****
--- 914,922 ----
  #endif
  #endif
  
+ 
+ #ifdef KERNEL
+ /* it does not compile outside kernel */
  struct buffer {
    afs_int32 fid;              /* is adc->index, the cache file number */
    afs_inode_t inode;          /* is adc->f.inode, the inode number of the cac\
***************
*** 941,946 ****
--- 944,950 ----
      afs_int32 chunkBytes;	/* Num bytes in this chunk */
      char states;		/* Has this chunk been modified? */
  };
+ #endif
  
  /* magic numbers to specify the cache type */
  
Index: openafs/src/afs/afs_buffer.c
diff -c openafs/src/afs/afs_buffer.c:1.16.2.6 openafs/src/afs/afs_buffer.c:1.16.2.7
*** openafs/src/afs/afs_buffer.c:1.16.2.6	Tue Jan 24 12:41:20 2006
--- openafs/src/afs/afs_buffer.c	Thu Dec 13 14:18:47 2007
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_buffer.c,v 1.16.2.6 2006/01/24 17:41:20 shadow Exp $");
  
  #include "afs/sysincludes.h"
  #include "afsincludes.h"
--- 11,17 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_buffer.c,v 1.16.2.7 2007/12/13 19:18:47 shadow Exp $");
  
  #include "afs/sysincludes.h"
  #include "afsincludes.h"
***************
*** 534,540 ****
      register struct buffer *tp;
  #endif
      int i;
-     extern int afs_cold_shutdown;
  
      AFS_STATCNT(shutdown_bufferpackage);
      /* Free all allocated Buffers and associated buffer pages */
--- 534,539 ----
Index: openafs/src/afs/afs_call.c
diff -c openafs/src/afs/afs_call.c:1.74.2.25 openafs/src/afs/afs_call.c:1.74.2.30
*** openafs/src/afs/afs_call.c:1.74.2.25	Tue Oct 16 23:51:44 2007
--- openafs/src/afs/afs_call.c	Fri Apr 18 10:06:50 2008
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_call.c,v 1.74.2.25 2007/10/17 03:51:44 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
--- 11,17 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_call.c,v 1.74.2.30 2008/04/18 14:06:50 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 581,586 ****
--- 581,587 ----
  #endif /* RXK_LISTENER_ENV */
  	    afs_osi_Invisible();
  	    afs_RXCallBackServer();
+ 	    afs_osi_Visible();
  	}
  #ifdef AFS_SGI_ENV
  	AFS_GUNLOCK();
***************
*** 609,614 ****
--- 610,616 ----
  	    afs_osi_RxkRegister();
  #endif /* !UKERNEL */
  	    rxk_Listener();
+ 	    afs_osi_Visible();
  	}
  #ifdef	AFS_SGI_ENV
  	AFS_GUNLOCK();
***************
*** 628,633 ****
--- 630,636 ----
  	afs_osi_Wakeup(&afs_initState);
  	afs_osi_Invisible();
  	afs_Daemon();
+ 	afs_osi_Visible();
  #ifdef AFS_SGI_ENV
  	AFS_GUNLOCK();
  	exit(CLD_EXITED, 0);
***************
*** 635,640 ****
--- 638,644 ----
      } else if (parm == AFSOP_START_CS) {
  	afs_osi_Invisible();
  	afs_CheckServerDaemon();
+ 	afs_osi_Visible();
  #ifdef AFS_SGI_ENV
  	AFS_GUNLOCK();
  	exit(CLD_EXITED, 0);
***************
*** 654,659 ****
--- 658,664 ----
  	else
  #endif /* AFS_AIX32_ENV */
  	    afs_BackgroundDaemon();
+ 	afs_osi_Visible();
  #ifdef AFS_SGI_ENV
  	AFS_GUNLOCK();
  	exit(CLD_EXITED, 0);
***************
*** 664,669 ****
--- 669,675 ----
  	/* start the bkg daemon */
  	afs_osi_Invisible();
  	afs_CacheTruncateDaemon();
+ 	afs_osi_Visible();
  #ifdef	AFS_SGI_ENV
  	AFS_GUNLOCK();
  	exit(CLD_EXITED, 0);
***************
*** 675,680 ****
--- 681,687 ----
  	    afs_osi_Sleep(&afs_initState);
  	afs_osi_Invisible();
  	afs_rxevent_daemon();
+ 	afs_osi_Visible();
  #ifdef AFS_SGI_ENV
  	AFS_GUNLOCK();
  	exit(CLD_EXITED, 0);
***************
*** 1408,1414 ****
--- 1415,1425 ----
      if (current->thread.flags & THREAD_IA32)
  
  #elif defined(AFS_PPC64_LINUX26_ENV)
+ #if defined(STRUCT_TASK_STRUCT_HAS_THREAD_INFO)
      if (current->thread_info->flags & _TIF_32BIT) 
+ #else
+     if (task_thread_info(current)->flags & _TIF_32BIT) 
+ #endif      
  #elif defined(AFS_PPC64_LINUX20_ENV)
      if (current->thread.flags & PPC_FLAG_32BIT) 
  
***************
*** 1864,1875 ****
  #endif
      afs_warn("\n");
  
!     /* Close file only after daemons which can write to it are stopped. */
!     if (afs_cacheInodep) {	/* memcache won't set this */
! 	osi_UFSClose(afs_cacheInodep);	/* Since we always leave it open */
! 	afs_cacheInodep = 0;
!     }
!     return;			/* Just kill daemons for now */
  #ifdef notdef
      shutdown_CB();
      shutdown_AFS();
--- 1875,1884 ----
  #endif
      afs_warn("\n");
  
! #ifdef AFS_AIX51_ENV
!     shutdown_daemons();
! #endif
! 
  #ifdef notdef
      shutdown_CB();
      shutdown_AFS();
***************
*** 1877,1897 ****
      shutdown_rxevent();
      shutdown_rx();
      afs_shutdown_BKG();
-     shutdown_bufferpackage();
- #endif
- #ifdef AFS_AIX51_ENV
-     shutdown_daemons();
  #endif
! #ifdef notdef
      shutdown_cache();
      shutdown_osi();
      shutdown_osinet();
      shutdown_osifile();
      shutdown_vnodeops();
-     shutdown_vfsops();
-     shutdown_exporter();
      shutdown_memcache();
  #if (!defined(AFS_NONFSTRANS) || defined(AFS_AIX_IAUTH_ENV)) && !defined(AFS_OSF_ENV)
      shutdown_nfsclnt();
  #endif
      shutdown_afstest();
--- 1886,1901 ----
      shutdown_rxevent();
      shutdown_rx();
      afs_shutdown_BKG();
  #endif
!     shutdown_bufferpackage();
      shutdown_cache();
      shutdown_osi();
      shutdown_osinet();
      shutdown_osifile();
      shutdown_vnodeops();
      shutdown_memcache();
  #if (!defined(AFS_NONFSTRANS) || defined(AFS_AIX_IAUTH_ENV)) && !defined(AFS_OSF_ENV)
+     shutdown_exporter();
      shutdown_nfsclnt();
  #endif
      shutdown_afstest();
***************
*** 1902,1909 ****
      memset(&afs_stats_cmfullperf, 0, sizeof(struct afs_stats_CMFullPerf));
  */
      afs_warn(" ALL allocated tables\n");
      afs_shuttingdown = 0;
! #endif
  }
  
  void
--- 1906,1921 ----
      memset(&afs_stats_cmfullperf, 0, sizeof(struct afs_stats_CMFullPerf));
  */
      afs_warn(" ALL allocated tables\n");
+ 
+     /* Close file only after daemons which can write to it are stopped. */
+     if (afs_cacheInodep) {	/* memcache won't set this */
+ 	osi_UFSClose(afs_cacheInodep);	/* Since we always leave it open */
+ 	afs_cacheInodep = 0;
+     }
+ 
      afs_shuttingdown = 0;
! 
!     return;			/* Just kill daemons for now */
  }
  
  void
Index: openafs/src/afs/afs_callback.c
diff -c openafs/src/afs/afs_callback.c:1.27.2.8 openafs/src/afs/afs_callback.c:1.27.2.10
*** openafs/src/afs/afs_callback.c:1.27.2.8	Fri Feb  2 22:25:18 2007
--- openafs/src/afs/afs_callback.c	Mon Mar 10 18:35:33 2008
***************
*** 17,23 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_callback.c,v 1.27.2.8 2007/02/03 03:25:18 shadow Exp $");
  
  #include "afs/sysincludes.h"	/*Standard vendor system headers */
  #include "afsincludes.h"	/*AFS-based standard headers */
--- 17,23 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_callback.c,v 1.27.2.10 2008/03/10 22:35:33 shadow Exp $");
  
  #include "afs/sysincludes.h"	/*Standard vendor system headers */
  #include "afsincludes.h"	/*AFS-based standard headers */
***************
*** 61,67 ****
      {
        "afs_xsrvAddr", (char *)&afs_xsrvAddr},
      {
!     "afs_xvreclaim", (char *)&afs_xvreclaim}
  };
  unsigned long lastCallBack_vnode;
  unsigned int lastCallBack_dv;
--- 61,71 ----
      {
        "afs_xsrvAddr", (char *)&afs_xsrvAddr},
      {
!       "afs_xvreclaim", (char *)&afs_xvreclaim},
! #ifdef AFS_AFSDB_ENV
!     { "afsdb_client_lock", (char *)&afsdb_client_lock},
!     { "afsdb_req_lock", (char *)&afsdb_req_lock},
! #endif
  };
  unsigned long lastCallBack_vnode;
  unsigned int lastCallBack_dv;
***************
*** 307,317 ****
  
      AFS_STATCNT(SRXAFSCB_GetLock);
      nentries = sizeof(ltable) / sizeof(struct ltable);
!     if (a_index < 0 || a_index >= nentries) {
  	/*
  	 * Past EOF
  	 */
  	code = 1;
      } else {
  	/*
  	 * Found it - copy out its contents.
--- 311,345 ----
  
      AFS_STATCNT(SRXAFSCB_GetLock);
      nentries = sizeof(ltable) / sizeof(struct ltable);
!     if (a_index < 0 || a_index >= nentries+afs_cellindex) {
  	/*
  	 * Past EOF
  	 */
  	code = 1;
+     } else if (a_index >= nentries) {
+ 	struct cell *tc = afs_GetCellByIndex(a_index-nentries, 0);
+ 	strcpy(a_result->name, tc->cellName);
+ 	a_result->lock.waitStates =
+ 	    ((struct afs_lock *)&(tc->lock))->wait_states;
+ 	a_result->lock.exclLocked =
+ 	    ((struct afs_lock *)&(tc->lock))->excl_locked;
+ 	a_result->lock.readersReading =
+ 	    ((struct afs_lock *)&(tc->lock))->readers_reading;
+ 	a_result->lock.numWaiting =
+ 	    ((struct afs_lock *)&(tc->lock))->num_waiting;
+ #ifdef INSTRUMENT_LOCKS
+ 	a_result->lock.pid_last_reader =
+ 	    MyPidxx2Pid(((struct afs_lock *)&(tc->lock))->pid_last_reader);
+ 	a_result->lock.pid_writer =
+ 	    MyPidxx2Pid(((struct afs_lock *)&(tc->lock))->pid_writer);
+ 	a_result->lock.src_indicator =
+ 	    ((struct afs_lock *)&(tc->lock))->src_indicator;
+ #else
+ 	a_result->lock.pid_last_reader = 0;
+ 	a_result->lock.pid_writer = 0;
+ 	a_result->lock.src_indicator = 0;
+ #endif
+ 	code = 0;
      } else {
  	/*
  	 * Found it - copy out its contents.
***************
*** 981,987 ****
      /*
       * Donate this process to Rx.
       */
!     rx_ServerProc();
      return (0);
  
  }				/*afs_RXCallBackServer */
--- 1009,1015 ----
      /*
       * Donate this process to Rx.
       */
!     rx_ServerProc(NULL);
      return (0);
  
  }				/*afs_RXCallBackServer */
Index: openafs/src/afs/afs_cell.c
diff -c openafs/src/afs/afs_cell.c:1.30.2.4 openafs/src/afs/afs_cell.c:1.30.2.6
*** openafs/src/afs/afs_cell.c:1.30.2.4	Mon Mar 19 20:52:20 2007
--- openafs/src/afs/afs_cell.c	Tue Dec  4 15:33:17 2007
***************
*** 14,20 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_cell.c,v 1.30.2.4 2007/03/20 00:52:20 shadow Exp $");
  
  #include "afs/stds.h"
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
--- 14,20 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_cell.c,v 1.30.2.6 2007/12/04 20:33:17 shadow Exp $");
  
  #include "afs/stds.h"
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
***************
*** 35,52 ****
   */
  
  #ifdef AFS_AFSDB_ENV
! static afs_rwlock_t afsdb_client_lock;	/* Serializes client requests */
  static char afsdb_handler_running;	/* Protected by GLOCK */
  static char afsdb_handler_shutdown;	/* Protected by GLOCK */
  
  static struct {
!     afs_rwlock_t lock;
      char pending;
      char complete;
      char *cellname;
-     afs_int32 *cellhosts;
-     int *timeout;
-     char **realname;
  } afsdb_req;
  
  void
--- 35,52 ----
   */
  
  #ifdef AFS_AFSDB_ENV
! afs_rwlock_t afsdb_client_lock;	/* Serializes client requests */
! afs_rwlock_t afsdb_req_lock;	/* Serializes client requests */
  static char afsdb_handler_running;	/* Protected by GLOCK */
  static char afsdb_handler_shutdown;	/* Protected by GLOCK */
  
+ /* from cellconfig.h */
+ #define MAXCELLCHARS    64
  static struct {
!     /* lock moved to afsdb_req_lock for cmdebug */
      char pending;
      char complete;
      char *cellname;
  } afsdb_req;
  
  void
***************
*** 63,108 ****
  int
  afs_AFSDBHandler(char *acellName, int acellNameLen, afs_int32 * kernelMsg)
  {
      if (afsdb_handler_shutdown)
  	return -2;
      afsdb_handler_running = 1;
  
!     ObtainSharedLock(&afsdb_req.lock, 683);
      if (afsdb_req.pending) {
  	int i, hostCount;
  
! 	UpgradeSToWLock(&afsdb_req.lock, 684);
  	hostCount = kernelMsg[0];
! 	*afsdb_req.timeout = kernelMsg[1];
! 	if (*afsdb_req.timeout)
! 	    *afsdb_req.timeout += osi_Time();
! 	*afsdb_req.realname = afs_strdup(acellName);
  
  	for (i = 0; i < MAXCELLHOSTS; i++) {
  	    if (i >= hostCount)
! 		afsdb_req.cellhosts[i] = 0;
  	    else
! 		afsdb_req.cellhosts[i] = kernelMsg[2 + i];
  	}
  
  	/* Request completed, wake up the relevant thread */
  	afsdb_req.pending = 0;
  	afsdb_req.complete = 1;
  	afs_osi_Wakeup(&afsdb_req);
! 	ConvertWToSLock(&afsdb_req.lock);
      }
!     ConvertSToRLock(&afsdb_req.lock);
  
      /* Wait for a request */
      while (afsdb_req.pending == 0 && afs_termState != AFSOP_STOP_AFSDB) {
! 	ReleaseReadLock(&afsdb_req.lock);
  	afs_osi_Sleep(&afsdb_req);
! 	ObtainReadLock(&afsdb_req.lock);
      }
  
      /* Check if we're shutting down */
      if (afs_termState == AFSOP_STOP_AFSDB) {
! 	ReleaseReadLock(&afsdb_req.lock);
  
  	/* Inform anyone waiting for us that we're going away */
  	afsdb_handler_shutdown = 1;
--- 63,122 ----
  int
  afs_AFSDBHandler(char *acellName, int acellNameLen, afs_int32 * kernelMsg)
  {
+     afs_int32 timeout, code;
+     afs_int32 cellHosts[MAXCELLHOSTS];
+ 
      if (afsdb_handler_shutdown)
  	return -2;
      afsdb_handler_running = 1;
  
!     ObtainSharedLock(&afsdb_req_lock, 683);
      if (afsdb_req.pending) {
  	int i, hostCount;
  
! 	UpgradeSToWLock(&afsdb_req_lock, 684);
  	hostCount = kernelMsg[0];
! 	timeout = kernelMsg[1];
! 	if (timeout)
! 	    timeout += osi_Time();
  
  	for (i = 0; i < MAXCELLHOSTS; i++) {
  	    if (i >= hostCount)
! 		cellHosts[i] = 0;
  	    else
! 		cellHosts[i] = kernelMsg[2 + i];
  	}
  
+ 	if (hostCount)
+ 	    code = afs_NewCell(acellName, cellHosts, CNoSUID, NULL, 0, 0, 
+ 			       timeout);
+ 
+ 	if (!hostCount || (code && code != EEXIST)) 
+ 	    /* null out the cellname if the lookup failed */
+ 	    afsdb_req.cellname = NULL;
+ 	else
+ 	    /* If we found an alias, create it */
+ 	    if (afs_strcasecmp(afsdb_req.cellname, acellName))
+ 		afs_NewCellAlias(afsdb_req.cellname, acellName);
+ 
  	/* Request completed, wake up the relevant thread */
  	afsdb_req.pending = 0;
  	afsdb_req.complete = 1;
  	afs_osi_Wakeup(&afsdb_req);
! 	ConvertWToSLock(&afsdb_req_lock);
      }
!     ConvertSToRLock(&afsdb_req_lock);
  
      /* Wait for a request */
      while (afsdb_req.pending == 0 && afs_termState != AFSOP_STOP_AFSDB) {
! 	ReleaseReadLock(&afsdb_req_lock);
  	afs_osi_Sleep(&afsdb_req);
! 	ObtainReadLock(&afsdb_req_lock);
      }
  
      /* Check if we're shutting down */
      if (afs_termState == AFSOP_STOP_AFSDB) {
! 	ReleaseReadLock(&afsdb_req_lock);
  
  	/* Inform anyone waiting for us that we're going away */
  	afsdb_handler_shutdown = 1;
***************
*** 116,158 ****
  
      /* Return the lookup request to userspace */
      strncpy(acellName, afsdb_req.cellname, acellNameLen);
!     ReleaseReadLock(&afsdb_req.lock);
      return 0;
  }
  
  static int
! afs_GetCellHostsAFSDB(char *acellName, afs_int32 * acellHosts, int *timeout,
! 		      char **realName)
  {
      AFS_ASSERT_GLOCK();
      if (!afsdb_handler_running)
  	return ENOENT;
  
      ObtainWriteLock(&afsdb_client_lock, 685);
!     ObtainWriteLock(&afsdb_req.lock, 686);
  
-     *acellHosts = 0;
      afsdb_req.cellname = acellName;
-     afsdb_req.cellhosts = acellHosts;
-     afsdb_req.timeout = timeout;
-     afsdb_req.realname = realName;
  
      afsdb_req.complete = 0;
      afsdb_req.pending = 1;
      afs_osi_Wakeup(&afsdb_req);
!     ConvertWToRLock(&afsdb_req.lock);
  
      while (afsdb_handler_running && !afsdb_req.complete) {
! 	ReleaseReadLock(&afsdb_req.lock);
  	afs_osi_Sleep(&afsdb_req);
! 	ObtainReadLock(&afsdb_req.lock);
      };
!     ReleaseReadLock(&afsdb_req.lock);
      ReleaseWriteLock(&afsdb_client_lock);
  
!     if (*acellHosts)
  	return 0;
!     else
  	return ENOENT;
  }
  #endif
--- 130,167 ----
  
      /* Return the lookup request to userspace */
      strncpy(acellName, afsdb_req.cellname, acellNameLen);
!     ReleaseReadLock(&afsdb_req_lock);
      return 0;
  }
  
  static int
! afs_GetCellHostsAFSDB(char *acellName)
  {
      AFS_ASSERT_GLOCK();
      if (!afsdb_handler_running)
  	return ENOENT;
  
      ObtainWriteLock(&afsdb_client_lock, 685);
!     ObtainWriteLock(&afsdb_req_lock, 686);
  
      afsdb_req.cellname = acellName;
  
      afsdb_req.complete = 0;
      afsdb_req.pending = 1;
      afs_osi_Wakeup(&afsdb_req);
!     ConvertWToRLock(&afsdb_req_lock);
  
      while (afsdb_handler_running && !afsdb_req.complete) {
! 	ReleaseReadLock(&afsdb_req_lock);
  	afs_osi_Sleep(&afsdb_req);
! 	ObtainReadLock(&afsdb_req_lock);
      };
!     ReleaseReadLock(&afsdb_req_lock);
      ReleaseWriteLock(&afsdb_client_lock);
  
!     if (afsdb_req.cellname) {
  	return 0;
!     } else
  	return ENOENT;
  }
  #endif
***************
*** 161,184 ****
  afs_LookupAFSDB(char *acellName)
  {
  #ifdef AFS_AFSDB_ENV
!     afs_int32 cellHosts[MAXCELLHOSTS];
!     char *realName = NULL;
!     int code, timeout;
  
!     code = afs_GetCellHostsAFSDB(acellName, cellHosts, &timeout, &realName);
!     if (code)
! 	goto done;
!     code = afs_NewCell(realName, cellHosts, CNoSUID, NULL, 0, 0, timeout);
!     if (code && code != EEXIST)
! 	goto done;
! 
!     /* If we found an alias, create it */
!     if (afs_strcasecmp(acellName, realName))
! 	afs_NewCellAlias(acellName, realName);
! 
!   done:
!     if (realName)
! 	afs_osi_FreeStr(realName);
  #endif
  }
  
--- 170,183 ----
  afs_LookupAFSDB(char *acellName)
  {
  #ifdef AFS_AFSDB_ENV
!     int code;
!     char *cellName = afs_strdup(acellName);
! 
!     code = afs_GetCellHostsAFSDB(cellName);
  
!     afs_Trace2(afs_iclSetp, CM_TRACE_AFSDB, ICL_TYPE_STRING, cellName, 
! 	       ICL_TYPE_INT32, code);
!     afs_osi_FreeStr(cellName);
  #endif
  }
  
***************
*** 819,825 ****
      RWLOCK_INIT(&afs_xcell, "afs_xcell");
  #ifdef AFS_AFSDB_ENV
      RWLOCK_INIT(&afsdb_client_lock, "afsdb_client_lock");
!     RWLOCK_INIT(&afsdb_req.lock, "afsdb_req.lock");
  #endif
      QInit(&CellLRU);
  
--- 818,824 ----
      RWLOCK_INIT(&afs_xcell, "afs_xcell");
  #ifdef AFS_AFSDB_ENV
      RWLOCK_INIT(&afsdb_client_lock, "afsdb_client_lock");
!     RWLOCK_INIT(&afsdb_req_lock, "afsdb_req_lock");
  #endif
      QInit(&CellLRU);
  
Index: openafs/src/afs/afs_dcache.c
diff -c openafs/src/afs/afs_dcache.c:1.42.2.22 openafs/src/afs/afs_dcache.c:1.42.2.23
*** openafs/src/afs/afs_dcache.c:1.42.2.22	Mon Aug 20 13:53:15 2007
--- openafs/src/afs/afs_dcache.c	Sat Dec  8 13:00:44 2007
***************
*** 14,20 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_dcache.c,v 1.42.2.22 2007/08/20 17:53:15 shadow Exp $");
  
  #include "afs/sysincludes.h"	/*Standard vendor system headers */
  #include "afsincludes.h"	/*AFS-based standard headers */
--- 14,20 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_dcache.c,v 1.42.2.23 2007/12/08 18:00:44 shadow Exp $");
  
  #include "afs/sysincludes.h"	/*Standard vendor system headers */
  #include "afsincludes.h"	/*AFS-based standard headers */
***************
*** 2860,2865 ****
--- 2860,2866 ----
      if (cacheDiskType == AFS_FCACHE_TYPE_MEM)
  	return 0;
      AFS_STATCNT(afs_WriteDCache);
+     osi_Assert(WriteLocked(&afs_xdcache));
      if (atime)
  	adc->f.modTime = osi_Time();
      /*
Index: openafs/src/afs/afs_osi.c
diff -c openafs/src/afs/afs_osi.c:1.48.2.12 openafs/src/afs/afs_osi.c:1.48.2.15
*** openafs/src/afs/afs_osi.c:1.48.2.12	Tue Apr  3 14:57:06 2007
--- openafs/src/afs/afs_osi.c	Tue Feb  5 20:43:44 2008
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_osi.c,v 1.48.2.12 2007/04/03 18:57:06 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
--- 11,17 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_osi.c,v 1.48.2.15 2008/02/06 01:43:44 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 280,288 ****
  void
  afs_osi_RxkRegister(void)
  {
- #ifdef AFS_LINUX22_ENV
-     osi_linux_rxkreg();
- #endif
  }
  
  /* procedure for making our processes as invisible as we can */
--- 280,285 ----
***************
*** 308,315 ****
      AFS_STATCNT(osi_Invisible);
  }
  
  
! #if !defined(AFS_LINUX20_ENV) && !defined(AFS_FBSD_ENV)
  /* set the real time */
  void
  afs_osi_SetTime(osi_timeval_t * atv)
--- 305,325 ----
      AFS_STATCNT(osi_Invisible);
  }
  
+ void
+ afs_osi_Visible(void)
+ {
+ #if defined(AFS_SUN5_ENV)
+     curproc->p_flag &= ~SSYS;
+ #elif defined(AFS_DARWIN80_ENV)
+ #elif defined(AFS_DARWIN_ENV)
+     /* maybe call init_process instead? */
+     current_proc()->p_flag &= ~P_SYSTEM;
+ #elif defined(AFS_XBSD_ENV)
+     curproc->p_flag &= ~P_SYSTEM;
+ #endif
+ }
  
! #if !defined(AFS_LINUX20_ENV) && !defined(AFS_XBSD_ENV)
  /* set the real time */
  void
  afs_osi_SetTime(osi_timeval_t * atv)
Index: openafs/src/afs/afs_osi_alloc.c
diff -c openafs/src/afs/afs_osi_alloc.c:1.10.2.1 openafs/src/afs/afs_osi_alloc.c:1.10.2.3
*** openafs/src/afs/afs_osi_alloc.c:1.10.2.1	Sun Apr  3 14:18:54 2005
--- openafs/src/afs/afs_osi_alloc.c	Thu Dec 13 14:18:47 2007
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_osi_alloc.c,v 1.10.2.1 2005/04/03 18:18:54 shadow Exp $");
  
  
  
--- 11,17 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_osi_alloc.c,v 1.10.2.3 2007/12/13 19:18:47 shadow Exp $");
  
  
  
***************
*** 120,126 ****
      if (!freeSmallList) {
  	afs_stats_cmperf.SmallBlocksAlloced++;
  	afs_stats_cmperf.SmallBlocksActive++;
! 	return afs_osi_Alloc(AFS_SMALLOCSIZ);
      }
      afs_stats_cmperf.SmallBlocksActive++;
      MObtainWriteLock(&osi_fsplock, 327);
--- 120,130 ----
      if (!freeSmallList) {
  	afs_stats_cmperf.SmallBlocksAlloced++;
  	afs_stats_cmperf.SmallBlocksActive++;
! 	tp = afs_osi_Alloc(AFS_SMALLOCSIZ);
! #ifdef KERNEL_HAVE_PIN
!         pin((char *)tp, AFS_SMALLOCSIZ);
! #endif
!         return (char *)tp;
      }
      afs_stats_cmperf.SmallBlocksActive++;
      MObtainWriteLock(&osi_fsplock, 327);
***************
*** 136,164 ****
  void
  shutdown_osinet(void)
  {
-     extern int afs_cold_shutdown;
- 
      AFS_STATCNT(shutdown_osinet);
      if (afs_cold_shutdown) {
  	struct osi_packet *tp;
  
  	while ((tp = freePacketList)) {
  	    freePacketList = tp->next;
- 	    afs_osi_Free(tp, AFS_LRALLOCSIZ);
  #ifdef  KERNEL_HAVE_PIN
  	    unpin(tp, AFS_LRALLOCSIZ);
  #endif
  	}
  
  	while ((tp = freeSmallList)) {
  	    freeSmallList = tp->next;
- 	    afs_osi_Free(tp, AFS_SMALLOCSIZ);
  #ifdef  KERNEL_HAVE_PIN
  	    unpin(tp, AFS_SMALLOCSIZ);
  #endif
  	}
  	LOCK_INIT(&osi_fsplock, "osi_fsplock");
  	LOCK_INIT(&osi_flplock, "osi_flplock");
      }
  }
  #endif
--- 140,173 ----
  void
  shutdown_osinet(void)
  {
      AFS_STATCNT(shutdown_osinet);
      if (afs_cold_shutdown) {
  	struct osi_packet *tp;
  
  	while ((tp = freePacketList)) {
  	    freePacketList = tp->next;
  #ifdef  KERNEL_HAVE_PIN
  	    unpin(tp, AFS_LRALLOCSIZ);
  #endif
+ 	    afs_osi_Free(tp, AFS_LRALLOCSIZ);
  	}
  
  	while ((tp = freeSmallList)) {
  	    freeSmallList = tp->next;
  #ifdef  KERNEL_HAVE_PIN
  	    unpin(tp, AFS_SMALLOCSIZ);
  #endif
+ 	    afs_osi_Free(tp, AFS_SMALLOCSIZ);
  	}
  	LOCK_INIT(&osi_fsplock, "osi_fsplock");
  	LOCK_INIT(&osi_flplock, "osi_flplock");
      }
+     if (afs_stats_cmperf.LargeBlocksActive || 
+ 	afs_stats_cmperf.SmallBlocksActive) 
+     {
+ 	afs_warn("WARNING: not all blocks freed: large %d small %d\n", 
+ 		 afs_stats_cmperf.LargeBlocksActive, 
+ 		 afs_stats_cmperf.SmallBlocksActive);
+     }
  }
  #endif
Index: openafs/src/afs/afs_osi_pag.c
diff -c openafs/src/afs/afs_osi_pag.c:1.21.2.10 openafs/src/afs/afs_osi_pag.c:1.21.2.11
*** openafs/src/afs/afs_osi_pag.c:1.21.2.10	Thu Feb  8 19:32:04 2007
--- openafs/src/afs/afs_osi_pag.c	Fri Jan  4 13:40:30 2008
***************
*** 23,29 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_osi_pag.c,v 1.21.2.10 2007/02/09 00:32:04 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
--- 23,29 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_osi_pag.c,v 1.21.2.11 2008/01/04 18:40:30 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 145,150 ****
--- 145,151 ----
   */
  
  static int afs_pag_sleepcnt = 0;
+ static int afs_pag_timewarn = 0;
  
  static int
  afs_pag_sleep(struct AFS_UCRED **acred)
***************
*** 155,160 ****
--- 156,168 ----
  	if(osi_Time() - pag_epoch < pagCounter) {
  	    rv = 1;
  	}
+ 	if (rv && (osi_Time() < pag_epoch)) {
+ 	    if (!afs_pag_timewarn) {
+ 		afs_pag_timewarn = 1;
+ 		printf("clock went backwards, not PAG throttling");
+ 	    }
+ 	    rv = 0;
+ 	}
      }
  
      return rv;
Index: openafs/src/afs/afs_pioctl.c
diff -c openafs/src/afs/afs_pioctl.c:1.81.2.28 openafs/src/afs/afs_pioctl.c:1.81.2.33
*** openafs/src/afs/afs_pioctl.c:1.81.2.28	Tue Aug 21 22:15:33 2007
--- openafs/src/afs/afs_pioctl.c	Fri Apr 18 16:13:32 2008
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_pioctl.c,v 1.81.2.28 2007/08/22 02:15:33 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #ifdef AFS_OBSD_ENV
--- 11,17 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_pioctl.c,v 1.81.2.33 2008/04/18 20:13:32 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #ifdef AFS_OBSD_ENV
***************
*** 284,290 ****
      if (current->thread.flags & THREAD_IA32)
  
  #elif defined(AFS_PPC64_LINUX26_ENV)
!     if (current->thread_info->flags & _TIF_32BIT)
  #elif defined(AFS_PPC64_LINUX20_ENV)
      if (current->thread.flags & PPC_FLAG_32BIT)
  
--- 284,294 ----
      if (current->thread.flags & THREAD_IA32)
  
  #elif defined(AFS_PPC64_LINUX26_ENV)
! #if defined(STRUCT_TASK_STRUCT_HAS_THREAD_INFO)
!     if (current->thread_info->flags & _TIF_32BIT) 
! #else
!     if (task_thread_info(current)->flags & _TIF_32BIT) 
! #endif      
  #elif defined(AFS_PPC64_LINUX20_ENV)
      if (current->thread.flags & PPC_FLAG_32BIT)
  
***************
*** 982,989 ****
  #if defined(AFS_SUN510_ENV)
      if (vp && !IsAfsVnode(vp)) {
  	struct vnode *realvp;
! 	
! 	if (VOP_REALVP(vp, &realvp) == 0) {
  	    struct vnode *oldvp = vp;
  	    
  	    VN_HOLD(realvp);
--- 986,998 ----
  #if defined(AFS_SUN510_ENV)
      if (vp && !IsAfsVnode(vp)) {
  	struct vnode *realvp;
! 	if
! #ifdef AFS_SUN511_ENV
!           (VOP_REALVP(vp, &realvp, NULL) == 0) 
! #else
! 	  (VOP_REALVP(vp, &realvp) == 0) 
! #endif
! {
  	    struct vnode *oldvp = vp;
  	    
  	    VN_HOLD(realvp);
***************
*** 2773,2779 ****
  DECL_PIOCTL(PSetSysName)
  {
      char *cp, *cp2 = NULL, inname[MAXSYSNAME], outname[MAXSYSNAME];
!     int setsysname, foundname = 0;
      register struct afs_exporter *exporter;
      register struct unixuser *au;
      register afs_int32 pag, error;
--- 2782,2789 ----
  DECL_PIOCTL(PSetSysName)
  {
      char *cp, *cp2 = NULL, inname[MAXSYSNAME], outname[MAXSYSNAME];
!     afs_int32 setsysname;
!     int foundname = 0;
      register struct afs_exporter *exporter;
      register struct unixuser *au;
      register afs_int32 pag, error;
***************
*** 2790,2796 ****
  #endif
      }
      memset(inname, 0, MAXSYSNAME);
!     memcpy((char *)&setsysname, ain, sizeof(afs_int32));
      ain += sizeof(afs_int32);
      if (setsysname) {
  
--- 2800,2806 ----
  #endif
      }
      memset(inname, 0, MAXSYSNAME);
!     memcpy(&setsysname, ain, sizeof(afs_int32));
      ain += sizeof(afs_int32);
      if (setsysname) {
  
***************
*** 3852,3857 ****
--- 3862,3868 ----
      afs_uuid_create(&afs_cb_interface.uuid);
      ReleaseWriteLock(&afs_xinterface);
      ForceAllNewConnections();
+     return 0;
  }
  
  DECL_PIOCTL(PCallBackAddr)
Index: openafs/src/afs/afs_prototypes.h
diff -c openafs/src/afs/afs_prototypes.h:1.53.2.20 openafs/src/afs/afs_prototypes.h:1.53.2.24
*** openafs/src/afs/afs_prototypes.h:1.53.2.20	Wed Jun 27 12:32:12 2007
--- openafs/src/afs/afs_prototypes.h	Fri Apr 18 02:04:01 2008
***************
*** 195,201 ****
--- 195,206 ----
  extern void afs_DequeueCallback(struct vcache *avc);
  
  /* afs_cell.c */
+ extern afs_int32 afs_cellindex;
  extern afs_rwlock_t afs_xcell;
+ #ifdef AFS_AFSDB_ENV
+ extern afs_rwlock_t afsdb_client_lock;
+ extern afs_rwlock_t afsdb_req_lock;
+ #endif
  extern struct afs_q CellLRU;           
  
  extern void afs_CellInit(void);
***************
*** 466,471 ****
--- 471,477 ----
  /* afs_osi.c */
  extern afs_lock_t afs_ftf;
  extern void afs_osi_Invisible(void);
+ extern void afs_osi_Visible(void);
  extern void afs_osi_RxkRegister(void);
  extern void afs_osi_MaskSignals(void);
  extern void afs_osi_UnmaskRxkSignals(void);
***************
*** 527,532 ****
--- 533,539 ----
  extern void osi_FreeSmallSpace(void *adata);
  extern void *osi_AllocLargeSpace(size_t size);
  extern void *osi_AllocSmallSpace(size_t size);
+ extern void shutdown_osinet(void);
  
  /* afs_osi_uio.c */
  extern int afsio_copy(struct uio *ainuio, struct uio *aoutuio,
***************
*** 554,560 ****
  #endif
  extern void osi_linux_mask(void);
  extern void osi_linux_unmask(void);
- extern void osi_linux_rxkreg(void);
  extern int setpag(cred_t ** cr, afs_uint32 pagvalue, afs_uint32 * newpag,
  		  int change_parent);
  #endif
--- 561,566 ----
Index: openafs/src/afs/afs_segments.c
diff -c openafs/src/afs/afs_segments.c:1.16.2.5 openafs/src/afs/afs_segments.c:1.16.2.6
*** openafs/src/afs/afs_segments.c:1.16.2.5	Sun Feb 20 20:15:21 2005
--- openafs/src/afs/afs_segments.c	Tue Dec  4 16:12:16 2007
***************
*** 14,20 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_segments.c,v 1.16.2.5 2005/02/21 01:15:21 shadow Exp $");
  
  #include "afs/sysincludes.h"	/*Standard vendor system headers */
  #include "afsincludes.h"	/*AFS-based standard headers */
--- 14,20 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_segments.c,v 1.16.2.6 2007/12/04 21:12:16 shadow Exp $");
  
  #include "afs/sysincludes.h"	/*Standard vendor system headers */
  #include "afsincludes.h"	/*AFS-based standard headers */
***************
*** 92,97 ****
--- 92,101 ----
  		afs_int32 l1, l2;
  		l1 = avc->m.Length;
  		l2 = tlen;
+ 		if ((avc->m.Length > 0x7fffffff) ||
+ 		    (tlen > 0x7fffffff) ||
+ 		    ((0x7fffffff - tlen) < avc->m.Length))
+ 		    return EFBIG;
  		code =
  		    StartRXAFS_StoreData(tcall,
  					 (struct AFSFid *)&avc->fid.Fid,
Index: openafs/src/afs/afs_server.c
diff -c openafs/src/afs/afs_server.c:1.33.2.10 openafs/src/afs/afs_server.c:1.33.2.12
*** openafs/src/afs/afs_server.c:1.33.2.10	Thu Oct  4 22:54:08 2007
--- openafs/src/afs/afs_server.c	Tue Dec 11 16:31:52 2007
***************
*** 33,39 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_server.c,v 1.33.2.10 2007/10/05 02:54:08 shadow Exp $");
  
  #include "afs/stds.h"
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
--- 33,39 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_server.c,v 1.33.2.12 2007/12/11 21:31:52 shadow Exp $");
  
  #include "afs/stds.h"
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
***************
*** 1129,1134 ****
--- 1129,1135 ----
  	    sa->sa_iprank = afs_min(sa->sa_iprank, MED);
  	}
      }
+     return;
  }
  #else /* AFS_USERSPACE_IP_ADDR */
  #if (! defined(AFS_SUN5_ENV)) && !defined(AFS_DARWIN60_ENV) && defined(USEIFADDR)
Index: openafs/src/afs/afs_stats.h
diff -c openafs/src/afs/afs_stats.h:1.11.2.4 openafs/src/afs/afs_stats.h:1.11.2.5
*** openafs/src/afs/afs_stats.h:1.11.2.4	Tue Jun 21 16:13:48 2005
--- openafs/src/afs/afs_stats.h	Mon Mar 17 14:03:27 2008
***************
*** 35,40 ****
--- 35,41 ----
  #define AFS_STATS(arg)
  #define XSTATS_DECLS
  #define XSTATS_START_TIME(arg)
+ #define XSTATS_START_CMTIME(arg)
  #define XSTATS_END_TIME
  
  #else /* AFS_NOSTATS */
Index: openafs/src/afs/afs_trace.et
diff -c openafs/src/afs/afs_trace.et:1.17.2.1 openafs/src/afs/afs_trace.et:1.17.2.2
*** openafs/src/afs/afs_trace.et:1.17.2.1	Mon May 30 00:36:58 2005
--- openafs/src/afs/afs_trace.et	Fri Nov 23 09:34:57 2007
***************
*** 172,176 ****
--- 172,177 ----
  	ec	CM_TRACE_LOCKWAIT,"%s line %d: Waiting for lock 0x%lx level %d"
  	ec	CM_TRACE_WRITEFAILED, "osi_Write failed len %ld resid %ld err %ld"
  	ec	CM_TRACE_ADJUSTSIZE2, "AdjustSize dc = 0x%lx, chunkBytes = 0x%x used = %ld, diff = %ld"
+ 	ec 	CM_TRACE_AFSDB, "AFSDB lookup %s returned %d"
  end
  
Index: openafs/src/afs/afs_vcache.c
diff -c openafs/src/afs/afs_vcache.c:1.65.2.46 openafs/src/afs/afs_vcache.c:1.65.2.48
*** openafs/src/afs/afs_vcache.c:1.65.2.46	Thu Nov  9 23:35:13 2006
--- openafs/src/afs/afs_vcache.c	Thu Dec 13 14:49:30 2007
***************
*** 39,45 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_vcache.c,v 1.65.2.46 2006/11/10 04:35:13 shadow Exp $");
  
  #include "afs/sysincludes.h"	/*Standard vendor system headers */
  #include "afsincludes.h"	/*AFS-based standard headers */
--- 39,45 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_vcache.c,v 1.65.2.48 2007/12/13 19:49:30 shadow Exp $");
  
  #include "afs/sysincludes.h"	/*Standard vendor system headers */
  #include "afsincludes.h"	/*AFS-based standard headers */
Index: openafs/src/afs/lock.h
diff -c openafs/src/afs/lock.h:1.13.2.7 openafs/src/afs/lock.h:1.13.2.8
*** openafs/src/afs/lock.h:1.13.2.7	Fri Feb  2 22:25:18 2007
--- openafs/src/afs/lock.h	Fri Nov  9 14:22:07 2007
***************
*** 102,110 ****
--- 102,116 ----
  #define MyPidxx2Pid(x) ((afs_int32)(x))
  #else /* AFS_AIX41_ENV */
  #if defined(AFS_HPUX101_ENV)
+ #if defined(AFS_HPUX1111_ENV)
+ typedef struct kthread * afs_lock_tracker_t;
+ #define MyPidxx (u.u_kthreadp)
+ #define MyPidxx2Pid(x) (x ? kt_tid(x) : 0)
+ #else
  typedef struct proc * afs_lock_tracker_t;
  #define MyPidxx (u.u_procp)
  #define MyPidxx2Pid(x) (x ? (afs_int32)p_pid(x) : 0)
+ #endif
  #else
  #if defined(AFS_SGI64_ENV)
  #if defined(AFS_SGI65_ENV)
Index: openafs/src/afs/sysincludes.h
diff -c openafs/src/afs/sysincludes.h:1.28.2.14 openafs/src/afs/sysincludes.h:1.28.2.15
*** openafs/src/afs/sysincludes.h:1.28.2.14	Thu Dec 28 16:50:58 2006
--- openafs/src/afs/sysincludes.h	Fri Nov 23 08:45:04 2007
***************
*** 75,80 ****
--- 75,83 ----
  #if defined(LINUX_KEYRING_SUPPORT)
  #include <linux/rwsem.h>
  #include <linux/key.h>
+ #if defined(KEY_TYPE_H_EXISTS)
+ #include <linux/key-type.h>
+ #endif
  #ifndef KEY_ALLOC_IN_QUOTA
  #define KEY_ALLOC_IN_QUOTA 1
  #endif
Index: openafs/src/afs/AIX/osi_file.c
diff -c openafs/src/afs/AIX/osi_file.c:1.9.2.2 openafs/src/afs/AIX/osi_file.c:1.9.2.3
*** openafs/src/afs/AIX/osi_file.c:1.9.2.2	Wed Aug 15 23:54:26 2007
--- openafs/src/afs/AIX/osi_file.c	Thu Dec 13 14:18:49 2007
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/AIX/osi_file.c,v 1.9.2.2 2007/08/16 03:54:26 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
--- 11,17 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/AIX/osi_file.c,v 1.9.2.3 2007/12/13 19:18:49 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 272,279 ****
  void
  shutdown_osifile(void)
  {
-     extern int afs_cold_shutdown;
- 
      AFS_STATCNT(shutdown_osifile);
      if (afs_cold_shutdown) {
  	afs_osicred_initialized = 0;
--- 272,277 ----
Index: openafs/src/afs/AIX/osi_vfsops.c
diff -c openafs/src/afs/AIX/osi_vfsops.c:1.11.2.1 openafs/src/afs/AIX/osi_vfsops.c:1.11.2.2
*** openafs/src/afs/AIX/osi_vfsops.c:1.11.2.1	Wed Aug 25 03:16:15 2004
--- openafs/src/afs/AIX/osi_vfsops.c	Thu Dec 13 14:18:49 2007
***************
*** 14,20 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/AIX/osi_vfsops.c,v 1.11.2.1 2004/08/25 07:16:15 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
--- 14,20 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/AIX/osi_vfsops.c,v 1.11.2.2 2007/12/13 19:18:49 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 34,41 ****
  struct vfs *afs_globalVFS = 0;
  struct vcache *afs_globalVp = 0;
  
- extern int afs_cold_shutdown;
- 
  static int afs_root_nolock(struct vfs *afsp, struct vnode **avpp);
  
  static int
--- 34,39 ----
Index: openafs/src/afs/DARWIN/osi_file.c
diff -c openafs/src/afs/DARWIN/osi_file.c:1.8.2.7 openafs/src/afs/DARWIN/osi_file.c:1.8.2.8
*** openafs/src/afs/DARWIN/osi_file.c:1.8.2.7	Wed Oct 10 12:57:55 2007
--- openafs/src/afs/DARWIN/osi_file.c	Thu Dec 13 14:18:49 2007
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/DARWIN/osi_file.c,v 1.8.2.7 2007/10/10 16:57:55 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
--- 11,17 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/DARWIN/osi_file.c,v 1.8.2.8 2007/12/13 19:18:49 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 418,425 ****
  void
  shutdown_osifile(void)
  {
-     extern int afs_cold_shutdown;
- 
      AFS_STATCNT(shutdown_osifile);
      if (afs_cold_shutdown) {
  	afs_osicred_initialized = 0;
--- 418,423 ----
Index: openafs/src/afs/DARWIN/osi_misc.c
diff -c openafs/src/afs/DARWIN/osi_misc.c:1.6.2.2 openafs/src/afs/DARWIN/osi_misc.c:1.6.2.3
*** openafs/src/afs/DARWIN/osi_misc.c:1.6.2.2	Wed Oct  5 01:58:29 2005
--- openafs/src/afs/DARWIN/osi_misc.c	Mon Mar 24 13:10:40 2008
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/DARWIN/osi_misc.c,v 1.6.2.2 2005/10/05 05:58:29 shadow Exp $");
  
  #include "afs/sysincludes.h"
  #include "afsincludes.h"
--- 11,17 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/DARWIN/osi_misc.c,v 1.6.2.3 2008/03/24 17:10:40 shadow Exp $");
  
  #include "afs/sysincludes.h"
  #include "afsincludes.h"
***************
*** 102,111 ****
     user_addr_t iovaddr;
     user_size_t iovsize;
  
!    /* XXX 64 bit userspaace? */
!    res = uio_create(uio_iovcnt(auio), uio_offset(auio),
!                     uio_isuserspace(auio) ? UIO_USERSPACE32 : UIO_SYSSPACE32,
!                     uio_rw(auio));
  
     for (i = 0;i < uio_iovcnt(auio) && size > 0;i++) {
         if (uio_getiov(auio, i, &iovaddr, &iovsize))
--- 102,116 ----
     user_addr_t iovaddr;
     user_size_t iovsize;
  
!    if (proc_is64bit(current_proc())) {
!        res = uio_create(uio_iovcnt(auio), uio_offset(auio),
! 			uio_isuserspace(auio) ? UIO_USERSPACE64 : UIO_SYSSPACE32,
! 			uio_rw(auio));
!    } else {
!        res = uio_create(uio_iovcnt(auio), uio_offset(auio),
! 			uio_isuserspace(auio) ? UIO_USERSPACE32 : UIO_SYSSPACE32,
! 			uio_rw(auio));
!    }
  
     for (i = 0;i < uio_iovcnt(auio) && size > 0;i++) {
         if (uio_getiov(auio, i, &iovaddr, &iovsize))
Index: openafs/src/afs/DARWIN/osi_vnodeops.c
diff -c openafs/src/afs/DARWIN/osi_vnodeops.c:1.18.2.28 openafs/src/afs/DARWIN/osi_vnodeops.c:1.18.2.29
*** openafs/src/afs/DARWIN/osi_vnodeops.c:1.18.2.28	Wed Oct 24 01:45:38 2007
--- openafs/src/afs/DARWIN/osi_vnodeops.c	Tue Nov 27 15:04:13 2007
***************
*** 5,11 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/DARWIN/osi_vnodeops.c,v 1.18.2.28 2007/10/24 05:45:38 shadow Exp $");
  
  #include <afs/sysincludes.h>	/* Standard vendor system headers */
  #include <afsincludes.h>	/* Afs-based standard headers */
--- 5,11 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/DARWIN/osi_vnodeops.c,v 1.18.2.29 2007/11/27 20:04:13 shadow Exp $");
  
  #include <afs/sysincludes.h>	/* Standard vendor system headers */
  #include <afsincludes.h>	/* Afs-based standard headers */
***************
*** 743,748 ****
--- 743,751 ----
      int code;
      struct vnode *vp = ap->a_vp;
      struct vcache *avc = VTOAFS(vp);
+ 
+     if (vnode_isdir(ap->a_vp)) 
+ 	return EISDIR;
  #ifdef AFS_DARWIN80_ENV
      ubc_sync_range(ap->a_vp, AFS_UIO_OFFSET(ap->a_uio), AFS_UIO_OFFSET(ap->a_uio) + AFS_UIO_RESID(ap->a_uio), UBC_PUSHDIRTY);
  #else
Index: openafs/src/afs/DUX/osi_file.c
diff -c openafs/src/afs/DUX/osi_file.c:1.9 openafs/src/afs/DUX/osi_file.c:1.9.2.1
*** openafs/src/afs/DUX/osi_file.c:1.9	Tue Jul 15 19:14:18 2003
--- openafs/src/afs/DUX/osi_file.c	Thu Dec 13 14:18:50 2007
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/DUX/Attic/osi_file.c,v 1.9 2003/07/15 23:14:18 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
--- 11,17 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/DUX/Attic/osi_file.c,v 1.9.2.1 2007/12/13 19:18:50 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 279,286 ****
  void
  shutdown_osifile(void)
  {
-     extern int afs_cold_shutdown;
- 
      AFS_STATCNT(shutdown_osifile);
      if (afs_cold_shutdown) {
  	afs_osicred_initialized = 0;
--- 279,284 ----
Index: openafs/src/afs/FBSD/osi_file.c
diff -c openafs/src/afs/FBSD/osi_file.c:1.13.2.1 openafs/src/afs/FBSD/osi_file.c:1.13.2.2
*** openafs/src/afs/FBSD/osi_file.c:1.13.2.1	Thu Nov  9 18:26:25 2006
--- openafs/src/afs/FBSD/osi_file.c	Thu Dec 13 14:18:50 2007
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/FBSD/osi_file.c,v 1.13.2.1 2006/11/09 23:26:25 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
--- 11,17 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/FBSD/osi_file.c,v 1.13.2.2 2007/12/13 19:18:50 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 244,251 ****
  void
  shutdown_osifile(void)
  {
-     extern int afs_cold_shutdown;
- 
      AFS_STATCNT(shutdown_osifile);
      if (afs_cold_shutdown) {
  	afs_osicred_initialized = 0;
--- 244,249 ----
Index: openafs/src/afs/HPUX/osi_file.c
diff -c openafs/src/afs/HPUX/osi_file.c:1.8.2.1 openafs/src/afs/HPUX/osi_file.c:1.8.2.2
*** openafs/src/afs/HPUX/osi_file.c:1.8.2.1	Thu Nov  9 18:26:26 2006
--- openafs/src/afs/HPUX/osi_file.c	Thu Dec 13 14:18:50 2007
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/HPUX/osi_file.c,v 1.8.2.1 2006/11/09 23:26:26 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
--- 11,17 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/HPUX/osi_file.c,v 1.8.2.2 2007/12/13 19:18:50 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 223,230 ****
  void
  shutdown_osifile(void)
  {
-     extern int afs_cold_shutdown;
- 
      AFS_STATCNT(shutdown_osifile);
      if (afs_cold_shutdown) {
  	afs_osicred_initialized = 0;
--- 223,228 ----
Index: openafs/src/afs/IRIX/osi_file.c
diff -c openafs/src/afs/IRIX/osi_file.c:1.11.2.1 openafs/src/afs/IRIX/osi_file.c:1.11.2.2
*** openafs/src/afs/IRIX/osi_file.c:1.11.2.1	Thu Nov  9 18:26:26 2006
--- openafs/src/afs/IRIX/osi_file.c	Thu Dec 13 14:18:53 2007
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/IRIX/osi_file.c,v 1.11.2.1 2006/11/09 23:26:26 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
--- 11,17 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/IRIX/osi_file.c,v 1.11.2.2 2007/12/13 19:18:53 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 262,269 ****
  void
  shutdown_osifile(void)
  {
-     extern int afs_cold_shutdown;
- 
      AFS_STATCNT(shutdown_osifile);
      if (afs_cold_shutdown) {
  	afs_osicred_initialized = 0;
--- 262,267 ----
Index: openafs/src/afs/IRIX/osi_vfsops.c
diff -c openafs/src/afs/IRIX/osi_vfsops.c:1.13.2.1 openafs/src/afs/IRIX/osi_vfsops.c:1.13.2.2
*** openafs/src/afs/IRIX/osi_vfsops.c:1.13.2.1	Wed Aug 25 03:09:34 2004
--- openafs/src/afs/IRIX/osi_vfsops.c	Thu Dec 13 14:18:53 2007
***************
*** 14,20 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/IRIX/osi_vfsops.c,v 1.13.2.1 2004/08/25 07:09:34 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
--- 14,20 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/IRIX/osi_vfsops.c,v 1.13.2.2 2007/12/13 19:18:53 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 207,213 ****
       int flags;
       cred_t *cr;
  {
-     extern int afs_afs_cold_shutdown;
      struct vcache *tvc;
      vnode_t *vp, *rootvp = NULL;
      register struct afs_q *tq;
--- 207,212 ----
Index: openafs/src/afs/LINUX/osi_file.c
diff -c openafs/src/afs/LINUX/osi_file.c:1.19.2.11 openafs/src/afs/LINUX/osi_file.c:1.19.2.16
*** openafs/src/afs/LINUX/osi_file.c:1.19.2.11	Thu Nov  9 18:26:26 2006
--- openafs/src/afs/LINUX/osi_file.c	Wed Mar 26 00:10:52 2008
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_file.c,v 1.19.2.11 2006/11/09 23:26:26 shadow Exp $");
  
  #ifdef AFS_LINUX24_ENV
  #include "h/module.h" /* early to avoid printf->printk mapping */
--- 11,17 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_file.c,v 1.19.2.16 2008/03/26 04:10:52 shadow Exp $");
  
  #ifdef AFS_LINUX24_ENV
  #include "h/module.h" /* early to avoid printf->printk mapping */
***************
*** 20,26 ****
  #include "afsincludes.h"	/* Afs-based standard headers */
  #include "afs/afs_stats.h"	/* afs statistics */
  #include "h/smp_lock.h"
! 
  
  int afs_osicred_initialized = 0;
  struct AFS_UCRED afs_osi_cred;
--- 20,28 ----
  #include "afsincludes.h"	/* Afs-based standard headers */
  #include "afs/afs_stats.h"	/* afs statistics */
  #include "h/smp_lock.h"
! #if !defined(HAVE_IGET)
! #include "h/exportfs.h"
! #endif
  
  int afs_osicred_initialized = 0;
  struct AFS_UCRED afs_osi_cred;
***************
*** 40,45 ****
--- 42,50 ----
      struct inode *tip = NULL;
      struct dentry *dp = NULL;
      struct file *filp = NULL;
+ #if !defined(HAVE_IGET)
+     struct fid fid;
+ #endif
      AFS_STATCNT(osi_UFSOpen);
      if (cacheDiskType != AFS_FCACHE_TYPE_UFS) {
  	osi_Panic("UFSOpen called for non-UFS cache\n");
***************
*** 57,70 ****
  		  sizeof(struct osi_file));
      }
      memset(afile, 0, sizeof(struct osi_file));
      tip = iget(afs_cacheSBp, (u_long) ainode);
      if (!tip)
  	osi_Panic("Can't get inode %d\n", ainode);
-     tip->i_flags |= MS_NOATIME;	/* Disable updating access times. */
  
      dp = d_alloc_anon(tip);
      if (!dp) 
             osi_Panic("Can't get dentry for inode %d\n", ainode);          
  
      filp = dentry_open(dp, mntget(afs_cacheMnt), O_RDWR);
      if (IS_ERR(filp))
--- 62,82 ----
  		  sizeof(struct osi_file));
      }
      memset(afile, 0, sizeof(struct osi_file));
+ #if defined(HAVE_IGET)
      tip = iget(afs_cacheSBp, (u_long) ainode);
      if (!tip)
  	osi_Panic("Can't get inode %d\n", ainode);
  
      dp = d_alloc_anon(tip);
+ #else
+     fid.i32.ino = ainode;
+     fid.i32.gen = 0;
+     dp = afs_cacheSBp->s_export_op->fh_to_dentry(afs_cacheSBp, &fid, sizeof(fid), FILEID_INO32_GEN);
      if (!dp) 
             osi_Panic("Can't get dentry for inode %d\n", ainode);          
+     tip = dp->d_inode;
+ #endif
+     tip->i_flags |= MS_NOATIME;	/* Disable updating access times. */
  
      filp = dentry_open(dp, mntget(afs_cacheMnt), O_RDWR);
      if (IS_ERR(filp))
***************
*** 348,355 ****
  void
  shutdown_osifile(void)
  {
-     extern int afs_cold_shutdown;
- 
      AFS_STATCNT(shutdown_osifile);
      if (afs_cold_shutdown) {
  	afs_osicred_initialized = 0;
--- 360,365 ----
Index: openafs/src/afs/LINUX/osi_groups.c
diff -c openafs/src/afs/LINUX/osi_groups.c:1.25.2.10 openafs/src/afs/LINUX/osi_groups.c:1.25.2.15
*** openafs/src/afs/LINUX/osi_groups.c:1.25.2.10	Tue Mar 20 14:48:52 2007
--- openafs/src/afs/LINUX/osi_groups.c	Sat Apr 19 17:56:11 2008
***************
*** 20,26 ****
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_groups.c,v 1.25.2.10 2007/03/20 18:48:52 shadow Exp $");
  
  #include "afs/sysincludes.h"
  #include "afsincludes.h"
--- 20,26 ----
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_groups.c,v 1.25.2.15 2008/04/19 21:56:11 shadow Exp $");
  
  #include "afs/sysincludes.h"
  #include "afsincludes.h"
***************
*** 50,61 ****
--- 50,63 ----
  
      crset(*cr);
  
+ #ifdef STRUCT_TASK_STRUCT_HAS_PARENT
      if (change_parent) {
  	old_info = current->parent->group_info;
  	get_group_info(group_info);
  	current->parent->group_info = group_info;
  	put_group_info(old_info);
      }
+ #endif
  
      return (0);
  }
***************
*** 222,228 ****
  }
  
  #ifdef LINUX_KEYRING_SUPPORT
! static struct key_type *__key_type_keyring;
  
  static int
  install_session_keyring(struct task_struct *task, struct key *keyring)
--- 224,231 ----
  }
  
  #ifdef LINUX_KEYRING_SUPPORT
! extern struct key_type key_type_keyring __attribute__((weak));
! static struct key_type *__key_type_keyring = &key_type_keyring;
  
  static int
  install_session_keyring(struct task_struct *task, struct key *keyring)
***************
*** 624,651 ****
  void osi_keyring_init(void)
  {
      struct task_struct *p;
! #ifdef EXPORTED_TASKLIST_LOCK
!     if (&tasklist_lock)
!       read_lock(&tasklist_lock);
! #endif
! #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
! #ifdef EXPORTED_TASKLIST_LOCK
!     else
! #endif
!       rcu_read_lock();
! #endif
!     p = find_task_by_pid(1);
!     if (p && p->user->session_keyring)
! 	__key_type_keyring = p->user->session_keyring->type;
! #ifdef EXPORTED_TASKLIST_LOCK
!     if (&tasklist_lock)
!        read_unlock(&tasklist_lock);
! #endif
! #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
! #ifdef EXPORTED_TASKLIST_LOCK
!     else
! #endif
!       rcu_read_unlock();
  #endif
  
      register_key_type(&key_type_afs_pag);
--- 627,665 ----
  void osi_keyring_init(void)
  {
      struct task_struct *p;
! 
!     /* If we can't lock the tasklist, either with its explicit lock,
!      * or by using the RCU lock, then we can't safely work out the 
!      * type of a keyring. So, we have to rely on the weak reference. 
!      * If that's not available, then keyring based PAGs won't work.
!      */
!     
! #if defined(EXPORTED_TASKLIST_LOCK) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16) && defined(EXPORTED_RCU_READ_LOCK))
!     if (__key_type_keyring == NULL) {
! # ifdef EXPORTED_TASKLIST_LOCK
! 	if (&tasklist_lock)
! 	    read_lock(&tasklist_lock);
! # endif
! # if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16) && defined(EXPORTED_RCU_READ_LOCK))
! #  ifdef EXPORTED_TASKLIST_LOCK
!  	else
! #  endif
! 	    rcu_read_lock();
! # endif
! 	p = find_task_by_pid(1);
! 	if (p && p->user->session_keyring)
! 	    __key_type_keyring = p->user->session_keyring->type;
! # ifdef EXPORTED_TASKLIST_LOCK
! 	if (&tasklist_lock)
! 	    read_unlock(&tasklist_lock);
! # endif
! # if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16) && defined(EXPORTED_RCU_READ_LOCK))
! #  ifdef EXPORTED_TASKLIST_LOCK
! 	else
! #  endif
! 	    rcu_read_unlock();
! # endif
!     }
  #endif
  
      register_key_type(&key_type_afs_pag);
Index: openafs/src/afs/LINUX/osi_machdep.h
diff -c openafs/src/afs/LINUX/osi_machdep.h:1.22.2.17 openafs/src/afs/LINUX/osi_machdep.h:1.22.2.18
*** openafs/src/afs/LINUX/osi_machdep.h:1.22.2.17	Thu Feb  8 17:41:20 2007
--- openafs/src/afs/LINUX/osi_machdep.h	Fri Nov 23 08:45:04 2007
***************
*** 76,82 ****
--- 76,93 ----
  
  #define afs_hz HZ
  #include "h/sched.h"
+ #if defined(HAVE_CURRENT_KERNEL_TIME)
+ static inline time_t osi_Time(void) { 
+     struct timespec xtime;
+     xtime = current_kernel_time();
+     return xtime.tv_sec;
+ }
+ #else
  #define osi_Time() (xtime.tv_sec)
+ #endif
+ 
+ 
+ 
  #ifdef AFS_LINUX_64BIT_KERNEL
  #define osi_GetTime(V)                                 \
      do {                                               \
Index: openafs/src/afs/LINUX/osi_misc.c
diff -c openafs/src/afs/LINUX/osi_misc.c:1.34.2.10 openafs/src/afs/LINUX/osi_misc.c:1.34.2.12
*** openafs/src/afs/LINUX/osi_misc.c:1.34.2.10	Mon Jul 11 15:29:56 2005
--- openafs/src/afs/LINUX/osi_misc.c	Mon Mar 10 15:05:28 2008
***************
*** 15,21 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_misc.c,v 1.34.2.10 2005/07/11 19:29:56 shadow Exp $");
  
  #include "afs/sysincludes.h"
  #include "afsincludes.h"
--- 15,21 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_misc.c,v 1.34.2.12 2008/03/10 19:05:28 shadow Exp $");
  
  #include "afs/sysincludes.h"
  #include "afsincludes.h"
***************
*** 52,61 ****
--- 52,68 ----
  #endif
  
      if (!code) {
+ #if defined(STRUCT_NAMEIDATA_HAS_PATH)
+ 	*dpp = dget(nd.path.dentry);
+         if (mnt)
+ 	    *mnt = mntget(nd.path.mnt);
+ 	path_put(&nd.path);
+ #else
  	*dpp = dget(nd.dentry);
          if (mnt)
             *mnt = mntget(nd.mnt);
  	path_release(&nd);
+ #endif
      }
      return code;
  }
***************
*** 348,355 ****
      }
  }
  
- struct task_struct *rxk_ListenerTask;
- 
  void
  osi_linux_mask(void)
  {
--- 355,360 ----
***************
*** 358,366 ****
      RECALC_SIGPENDING(current);
      SIG_UNLOCK(current);
  }
- 
- void
- osi_linux_rxkreg(void)
- {
-     rxk_ListenerTask = current;
- }
--- 363,365 ----
Index: openafs/src/afs/LINUX/osi_probe.c
diff -c openafs/src/afs/LINUX/osi_probe.c:1.1.2.24 openafs/src/afs/LINUX/osi_probe.c:1.1.2.25
*** openafs/src/afs/LINUX/osi_probe.c:1.1.2.24	Tue Aug 21 17:31:59 2007
--- openafs/src/afs/LINUX/osi_probe.c	Sun Apr  6 23:19:40 2008
***************
*** 45,50 ****
--- 45,51 ----
  
  /* Code to find the Linux syscall table */
  
+ #if defined(EXPORTED_INIT_MM)
  #ifdef OSI_PROBE_STANDALONE
  #define OSI_PROBE_DEBUG
  #endif
***************
*** 1481,1483 ****
--- 1482,1490 ----
  module_exit(osi_probe_exit);
  #endif
  #endif
+ #else
+ void *osi_find_syscall_table(int which)
+ {
+     return 0;
+ }
+ #endif /* EXPORTED_INIT_MM */
Index: openafs/src/afs/LINUX/osi_sysctl.c
diff -c openafs/src/afs/LINUX/osi_sysctl.c:1.7.2.5 openafs/src/afs/LINUX/osi_sysctl.c:1.7.2.6
*** openafs/src/afs/LINUX/osi_sysctl.c:1.7.2.5	Tue Jun 12 14:28:49 2007
--- openafs/src/afs/LINUX/osi_sysctl.c	Fri Nov 23 08:45:04 2007
***************
*** 1,7 ****
  /*
   * osi_sysctl.c: Linux sysctl interface to OpenAFS
   *
!  * $Id: osi_sysctl.c,v 1.7.2.5 2007/06/12 18:28:49 shadow Exp $
   *
   * Written Jan 30, 2002 by Kris Van Hees (Sine Nomine Associates)
   */
--- 1,7 ----
  /*
   * osi_sysctl.c: Linux sysctl interface to OpenAFS
   *
!  * $Id: osi_sysctl.c,v 1.7.2.6 2007/11/23 13:45:04 shadow Exp $
   *
   * Written Jan 30, 2002 by Kris Van Hees (Sine Nomine Associates)
   */
***************
*** 28,34 ****
--- 28,38 ----
  
  static ctl_table afs_sysctl_table[] = {
      {
+ #if defined(SYSCTL_TABLE_CHECKING)
+ 	.ctl_name 	= CTL_UNNUMBERED, 
+ #else
  	.ctl_name 	= 1, 
+ #endif
  	.procname 	= "hm_retry_RO",
  	.data 		= &hm_retry_RO, 
  	.maxlen		= sizeof(afs_int32), 
***************
*** 36,42 ****
--- 40,50 ----
  	.proc_handler	= &proc_dointvec
      },
      {
+ #if defined(SYSCTL_TABLE_CHECKING)
+ 	.ctl_name 	= CTL_UNNUMBERED, 
+ #else
          .ctl_name 	= 2, 
+ #endif
          .procname 	= "hm_retry_RW",
          .data		= &hm_retry_RW,
  	.maxlen		= sizeof(afs_int32), 
***************
*** 44,50 ****
--- 52,62 ----
       	.proc_handler	= &proc_dointvec
      },
      {
+ #if defined(SYSCTL_TABLE_CHECKING)
+ 	.ctl_name 	= CTL_UNNUMBERED, 
+ #else
  	.ctl_name	= 3, 
+ #endif
  	.procname	= "hm_retry_int",
  	.data		= &hm_retry_int, 
  	.maxlen		= sizeof(afs_int32), 
***************
*** 52,58 ****
--- 64,74 ----
  	.proc_handler	= &proc_dointvec
      },
      {
+ #if defined(SYSCTL_TABLE_CHECKING)
+ 	.ctl_name 	= CTL_UNNUMBERED, 
+ #else
  	.ctl_name	= 4, 
+ #endif
  	.procname	= "GCPAGs",
  	.data		= &afs_gcpags, 
  	.maxlen		= sizeof(afs_int32), 
***************
*** 60,66 ****
--- 76,86 ----
  	.proc_handler 	= &proc_dointvec
      },
      {
+ #if defined(SYSCTL_TABLE_CHECKING)
+ 	.ctl_name 	= CTL_UNNUMBERED, 
+ #else
  	.ctl_name	= 5, 
+ #endif
  	.procname	= "rx_deadtime",
  	.data		= &afs_rx_deadtime, 
  	.maxlen		= sizeof(afs_int32), 
***************
*** 68,74 ****
--- 88,98 ----
  	.proc_handler	= &proc_dointvec
      },
      {
+ #if defined(SYSCTL_TABLE_CHECKING)
+ 	.ctl_name 	= CTL_UNNUMBERED, 
+ #else
  	.ctl_name	= 6, 
+ #endif
  	.procname	= "bkVolPref",
  	.data		= &afs_bkvolpref, 
  	.maxlen		= sizeof(afs_int32), 
***************
*** 80,86 ****
--- 104,114 ----
  
  static ctl_table fs_sysctl_table[] = {
      {
+ #if defined(SYSCTL_TABLE_CHECKING)
+ 	.ctl_name 	= CTL_UNNUMBERED, 
+ #else
  	.ctl_name	= 1, 
+ #endif
  	.procname	= "afs", 
  	.mode		= 0555, 
  	.child		= afs_sysctl_table
Index: openafs/src/afs/LINUX/osi_vfsops.c
diff -c openafs/src/afs/LINUX/osi_vfsops.c:1.29.2.26 openafs/src/afs/LINUX/osi_vfsops.c:1.29.2.28
*** openafs/src/afs/LINUX/osi_vfsops.c:1.29.2.26	Mon Oct 15 08:42:26 2007
--- openafs/src/afs/LINUX/osi_vfsops.c	Fri Nov 23 08:45:04 2007
***************
*** 16,22 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_vfsops.c,v 1.29.2.26 2007/10/15 12:42:26 shadow Exp $");
  
  #define __NO_VERSION__		/* don't define kernel_version in module.h */
  #include <linux/module.h> /* early to avoid printf->printk mapping */
--- 16,22 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_vfsops.c,v 1.29.2.28 2007/11/23 13:45:04 shadow Exp $");
  
  #define __NO_VERSION__		/* don't define kernel_version in module.h */
  #include <linux/module.h> /* early to avoid printf->printk mapping */
***************
*** 295,302 ****
--- 295,306 ----
  #if defined(HAVE_KMEM_CACHE_T)
  init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
  #else
+ #if defined(KMEM_CACHE_INIT)
+ init_once(struct kmem_cache * cachep, void * foo)
+ #else
  init_once(void * foo, struct kmem_cache * cachep, unsigned long flags)
  #endif
+ #endif
  {
      struct vcache *vcp = (struct vcache *) foo;
  
***************
*** 531,538 ****
--- 535,545 ----
      ip->i_size = vp->va_size;
  #if defined(AFS_LINUX26_ENV)
      ip->i_atime.tv_sec = vp->va_atime.tv_sec;
+     ip->i_atime.tv_nsec = 0;
      ip->i_mtime.tv_sec = vp->va_mtime.tv_sec;
+     ip->i_mtime.tv_nsec = 0;
      ip->i_ctime.tv_sec = vp->va_ctime.tv_sec;
+     ip->i_ctime.tv_nsec = 0;
  #else
      ip->i_atime = vp->va_atime.tv_sec;
      ip->i_mtime = vp->va_mtime.tv_sec;
Index: openafs/src/afs/LINUX/osi_vnodeops.c
diff -c openafs/src/afs/LINUX/osi_vnodeops.c:1.81.2.57 openafs/src/afs/LINUX/osi_vnodeops.c:1.81.2.64
*** openafs/src/afs/LINUX/osi_vnodeops.c:1.81.2.57	Mon Oct 15 08:42:26 2007
--- openafs/src/afs/LINUX/osi_vnodeops.c	Tue Apr 15 08:29:54 2008
***************
*** 22,28 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_vnodeops.c,v 1.81.2.57 2007/10/15 12:42:26 shadow Exp $");
  
  #include "afs/sysincludes.h"
  #include "afsincludes.h"
--- 22,28 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_vnodeops.c,v 1.81.2.64 2008/04/15 12:29:54 shadow Exp $");
  
  #include "afs/sysincludes.h"
  #include "afsincludes.h"
***************
*** 564,581 ****
  #endif
  {
      struct vrequest treq;
!     struct vcache *vcp = VTOAFS(FILE_INODE(fp));
!     cred_t *credp = crref();
      int code;
  
      AFS_GLOCK();
  
      code = afs_InitReq(&treq, credp);
      if (code)
  	goto out;
  
      ObtainSharedLock(&vcp->lock, 535);
!     if (vcp->execsOrWriters > 0) {
  	UpgradeSToWLock(&vcp->lock, 536);
  	code = afs_StoreAllSegments(vcp, &treq, AFS_SYNC | AFS_LASTSTORE);
  	ConvertWToSLock(&vcp->lock);
--- 564,589 ----
  #endif
  {
      struct vrequest treq;
!     struct vcache *vcp;
!     cred_t *credp;
      int code;
  
      AFS_GLOCK();
  
+     if ((fp->f_flags & O_ACCMODE) == O_RDONLY) { /* readers dont flush */
+ 	AFS_GUNLOCK();
+ 	return 0;
+     }
+ 
+     credp = crref();
+     vcp = VTOAFS(FILE_INODE(fp));
+ 
      code = afs_InitReq(&treq, credp);
      if (code)
  	goto out;
  
      ObtainSharedLock(&vcp->lock, 535);
!     if ((vcp->execsOrWriters > 0) && (file_count(fp) == 1)) {
  	UpgradeSToWLock(&vcp->lock, 536);
  	code = afs_StoreAllSegments(vcp, &treq, AFS_SYNC | AFS_LASTSTORE);
  	ConvertWToSLock(&vcp->lock);
***************
*** 643,648 ****
--- 651,660 ----
  #if defined(AFS_LINUX26_ENV) && defined(STRUCT_FILE_OPERATIONS_HAS_SENDFILE)
    .sendfile =   generic_file_sendfile,
  #endif
+ #if defined(AFS_LINUX26_ENV) && defined(STRUCT_FILE_OPERATIONS_HAS_SPLICE)
+   .splice_write = generic_file_splice_write,
+   .splice_read = generic_file_splice_read,
+ #endif
    .release =	afs_linux_release,
    .fsync =	afs_linux_fsync,
    .lock =	afs_linux_lock,
***************
*** 791,798 ****
  	if (vcp == afs_globalVp)
  	    goto good_dentry;
  
! 	if (*dp->d_name.name != '/' && vcp->mvstat == 2)	/* root vnode */
! 	    check_bad_parent(dp);	/* check and correct mvid */
  
  #ifdef notdef
  	/* If the last looker changes, we should make sure the current
--- 803,816 ----
  	if (vcp == afs_globalVp)
  	    goto good_dentry;
  
! 	if (vcp->mvstat == 1) {         /* mount point */
! 	    if (vcp->mvid && (vcp->states & CMValid)) {
! 		/* a mount point, not yet replaced by its directory */
! 		goto bad_dentry;
! 	    }
! 	} else
! 	    if (*dp->d_name.name != '/' && vcp->mvstat == 2) /* root vnode */
! 		check_bad_parent(dp);	/* check and correct mvid */
  
  #ifdef notdef
  	/* If the last looker changes, we should make sure the current
***************
*** 878,883 ****
--- 896,910 ----
      AFS_GLOCK();
      (void) afs_InactiveVCache(vcp, NULL);
      AFS_GUNLOCK();
+ #ifdef DCACHE_NFSFS_RENAMED
+ #ifdef AFS_LINUX26_ENV
+     spin_lock(&dp->d_lock);
+ #endif
+     dp->d_flags &= ~DCACHE_NFSFS_RENAMED;   
+ #ifdef AFS_LINUX26_ENV
+     spin_unlock(&dp->d_lock);
+ #endif
+ #endif
  
      iput(ip);
  }
***************
*** 939,944 ****
--- 966,972 ----
  
  	afs_getattr(vcp, &vattr, credp);
  	afs_fill_inode(ip, &vattr);
+ 	insert_inode_hash(ip);
  	dp->d_op = &afs_dentry_operations;
  	dp->d_time = hgetlo(VTOAFS(dip)->m.DataVersion);
  	d_instantiate(dp, ip);
***************
*** 984,989 ****
--- 1012,1019 ----
  	ip = AFSTOV(vcp);
  	afs_getattr(vcp, &vattr, credp);
  	afs_fill_inode(ip, &vattr);
+ 	if (hlist_unhashed(&ip->i_hash))
+ 	    insert_inode_hash(ip);
      }
      dp->d_op = &afs_dentry_operations;
      dp->d_time = hgetlo(VTOAFS(dip)->m.DataVersion);
***************
*** 1095,1100 ****
--- 1125,1139 ----
              }
              tvc->uncred = credp;
  	    tvc->states |= CUnlinked;
+ #ifdef DCACHE_NFSFS_RENAMED
+ #ifdef AFS_LINUX26_ENV
+ 	    spin_lock(&dp->d_lock);
+ #endif
+ 	    dp->d_flags |= DCACHE_NFSFS_RENAMED;   
+ #ifdef AFS_LINUX26_ENV
+ 	    spin_unlock(&dp->d_lock);
+ #endif
+ #endif
  	} else {
  	    osi_FreeSmallSpace(__name);	
  	}
***************
*** 1822,1826 ****
  #endif
      }
  
-     /* insert_inode_hash(ip);	-- this would make iget() work (if we used it) */
  }
--- 1861,1864 ----
Index: openafs/src/afs/NBSD/osi_file.c
diff -c openafs/src/afs/NBSD/osi_file.c:1.5.2.1 openafs/src/afs/NBSD/osi_file.c:1.5.2.2
*** openafs/src/afs/NBSD/osi_file.c:1.5.2.1	Thu Nov  9 18:26:26 2006
--- openafs/src/afs/NBSD/osi_file.c	Thu Dec 13 14:18:55 2007
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/NBSD/osi_file.c,v 1.5.2.1 2006/11/09 23:26:26 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
--- 11,17 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/NBSD/osi_file.c,v 1.5.2.2 2007/12/13 19:18:55 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 224,231 ****
  void
  shutdown_osifile(void)
  {
-     extern int afs_cold_shutdown;
- 
      AFS_STATCNT(shutdown_osifile);
      if (afs_cold_shutdown) {
  	afs_osicred_initialized = 0;
--- 224,229 ----
Index: openafs/src/afs/OBSD/osi_file.c
diff -c openafs/src/afs/OBSD/osi_file.c:1.10.2.2 openafs/src/afs/OBSD/osi_file.c:1.10.2.3
*** openafs/src/afs/OBSD/osi_file.c:1.10.2.2	Thu Nov  9 18:26:26 2006
--- openafs/src/afs/OBSD/osi_file.c	Fri Jan  4 12:56:41 2008
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/OBSD/osi_file.c,v 1.10.2.2 2006/11/09 23:26:26 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afs/afsincludes.h"	/* Afs-based standard headers */
--- 11,17 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/OBSD/osi_file.c,v 1.10.2.3 2008/01/04 17:56:41 rees Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afs/afsincludes.h"	/* Afs-based standard headers */
***************
*** 136,142 ****
  int
  afs_osi_Read(struct osi_file *afile, int offset, void *aptr, afs_int32 asize)
  {
!     unsigned int resid;
      afs_int32 code;
  
      AFS_STATCNT(osi_Read);
--- 136,142 ----
  int
  afs_osi_Read(struct osi_file *afile, int offset, void *aptr, afs_int32 asize)
  {
!     size_t resid;
      afs_int32 code;
  
      AFS_STATCNT(osi_Read);
***************
*** 164,171 ****
  	afile->offset += code;
  	osi_DisableAtimes(afile->vnode);
      } else {
! 	afs_Trace2(afs_iclSetp, CM_TRACE_READFAILED, ICL_TYPE_INT32, resid,
! 		   ICL_TYPE_INT32, code);
  	code = -1;
      }
      return code;
--- 164,171 ----
  	afile->offset += code;
  	osi_DisableAtimes(afile->vnode);
      } else {
! 	afs_Trace2(afs_iclSetp, CM_TRACE_READFAILED, ICL_TYPE_INT32,
! 		   (unsigned int) resid, ICL_TYPE_INT32, code);
  	code = -1;
      }
      return code;
***************
*** 176,182 ****
  afs_osi_Write(struct osi_file *afile, afs_int32 offset, void *aptr,
  	      afs_int32 asize)
  {
!     unsigned int resid;
      afs_int32 code;
  
      AFS_STATCNT(osi_Write);
--- 176,182 ----
  afs_osi_Write(struct osi_file *afile, afs_int32 offset, void *aptr,
  	      afs_int32 asize)
  {
!     size_t resid;
      afs_int32 code;
  
      AFS_STATCNT(osi_Write);
Index: openafs/src/afs/OBSD/osi_machdep.h
diff -c openafs/src/afs/OBSD/osi_machdep.h:1.16.2.8 openafs/src/afs/OBSD/osi_machdep.h:1.16.2.9
*** openafs/src/afs/OBSD/osi_machdep.h:1.16.2.8	Thu Nov  9 19:08:56 2006
--- openafs/src/afs/OBSD/osi_machdep.h	Fri Jan  4 12:53:37 2008
***************
*** 16,22 ****
   * afs_osi.h.
   */
  
! /* $Id: osi_machdep.h,v 1.16.2.8 2006/11/10 00:08:56 shadow Exp $ */
  
  #ifndef _OSI_MACHDEP_H_
  #define _OSI_MACHDEP_H_
--- 16,22 ----
   * afs_osi.h.
   */
  
! /* $Id: osi_machdep.h,v 1.16.2.9 2008/01/04 17:53:37 rees Exp $ */
  
  #ifndef _OSI_MACHDEP_H_
  #define _OSI_MACHDEP_H_
***************
*** 69,75 ****
  /* time */
  #define	afs_hz		hz
  #define osi_GetTime(x)	microtime(x)
! #define osi_Time()	(time.tv_sec)
  
  /* str */
  #define afs_strcasecmp(s1, s2)	strncasecmp((s1), (s2), 65535)
--- 69,75 ----
  /* time */
  #define	afs_hz		hz
  #define osi_GetTime(x)	microtime(x)
! extern time_t osi_Time();
  
  /* str */
  #define afs_strcasecmp(s1, s2)	strncasecmp((s1), (s2), 65535)
Index: openafs/src/afs/OBSD/osi_sleep.c
diff -c openafs/src/afs/OBSD/osi_sleep.c:1.7.2.2 openafs/src/afs/OBSD/osi_sleep.c:1.7.2.3
*** openafs/src/afs/OBSD/osi_sleep.c:1.7.2.2	Thu Jul 28 17:48:35 2005
--- openafs/src/afs/OBSD/osi_sleep.c	Fri Jan  4 12:53:37 2008
***************
*** 1,5 ****
  /*
!  * $Id: osi_sleep.c,v 1.7.2.2 2005/07/28 21:48:35 shadow Exp $
   */
  
  /*
--- 1,5 ----
  /*
!  * $Id: osi_sleep.c,v 1.7.2.3 2008/01/04 17:53:37 rees Exp $
   */
  
  /*
***************
*** 45,51 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/OBSD/osi_sleep.c,v 1.7.2.2 2005/07/28 21:48:35 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afs/afsincludes.h"	/* Afs-based standard headers */
--- 45,51 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/OBSD/osi_sleep.c,v 1.7.2.3 2008/01/04 17:53:37 rees Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afs/afsincludes.h"	/* Afs-based standard headers */
***************
*** 54,59 ****
--- 54,74 ----
  static char waitV;
  
  
+ time_t
+ osi_Time()
+ {
+     struct timeval now;
+ 
+     getmicrotime(&now);
+     return now.tv_sec;
+ }
+ 
+ void
+ afs_osi_SetTime(osi_timeval_t * atv)
+ {
+     printf("afs attempted to set clock; use \"afsd -nosettime\"\n");
+ }
+ 
  /* cancel osi_Wait */
  void
  afs_osi_CancelWait(struct afs_osi_WaitHandle *achandle)
***************
*** 76,88 ****
  afs_osi_Wait(afs_int32 ams, struct afs_osi_WaitHandle *ahandle, int aintok)
  {
      int timo, code = 0;
!     struct timeval atv, endTime;
  
      AFS_STATCNT(osi_Wait);
  
      atv.tv_sec = ams / 1000;
      atv.tv_usec = (ams % 1000) * 1000;
!     timeradd(&atv, &time, &endTime);
  
      if (ahandle)
  	ahandle->proc = (caddr_t) curproc;
--- 91,104 ----
  afs_osi_Wait(afs_int32 ams, struct afs_osi_WaitHandle *ahandle, int aintok)
  {
      int timo, code = 0;
!     struct timeval atv, now, endTime;
  
      AFS_STATCNT(osi_Wait);
  
      atv.tv_sec = ams / 1000;
      atv.tv_usec = (ams % 1000) * 1000;
!     getmicrotime(&now);
!     timeradd(&atv, &now, &endTime);
  
      if (ahandle)
  	ahandle->proc = (caddr_t) curproc;
***************
*** 90,96 ****
      AFS_GUNLOCK();
  
      do {
! 	timersub(&endTime, &time, &atv);
  	timo = atv.tv_sec * hz + atv.tv_usec * hz / 1000000 + 1;
  	if (aintok) {
  	    code = tsleep(&waitV, PCATCH | PVFS, "afs_W1", timo);
--- 106,112 ----
      AFS_GUNLOCK();
  
      do {
! 	timersub(&endTime, &now, &atv);
  	timo = atv.tv_sec * hz + atv.tv_usec * hz / 1000000 + 1;
  	if (aintok) {
  	    code = tsleep(&waitV, PCATCH | PVFS, "afs_W1", timo);
***************
*** 104,110 ****
  	    /* we've been signalled */
  	    break;
  	}
!     } while (timercmp(&time, &endTime, <));
  
      AFS_GLOCK();
      return code;
--- 120,127 ----
  	    /* we've been signalled */
  	    break;
  	}
! 	getmicrotime(&now);
!     } while (timercmp(&now, &endTime, <));
  
      AFS_GLOCK();
      return code;
Index: openafs/src/afs/OBSD/osi_vm.c
diff -c openafs/src/afs/OBSD/osi_vm.c:1.2 openafs/src/afs/OBSD/osi_vm.c:1.2.2.1
*** openafs/src/afs/OBSD/osi_vm.c:1.2	Tue Jul 15 19:14:25 2003
--- openafs/src/afs/OBSD/osi_vm.c	Thu Jan  3 12:15:19 2008
***************
*** 22,33 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/OBSD/osi_vm.c,v 1.2 2003/07/15 23:14:25 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afs/afsincludes.h"	/* Afs-based standard headers */
  #include "afs/afs_stats.h"	/* statistics */
! /* #include <vm/vm_ubc.h> */
  #include <limits.h>
  #include <float.h>
  
--- 22,33 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/OBSD/osi_vm.c,v 1.2.2.1 2008/01/03 17:15:19 rees Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afs/afsincludes.h"	/* Afs-based standard headers */
  #include "afs/afs_stats.h"	/* statistics */
! #include <sys/namei.h>
  #include <limits.h>
  #include <float.h>
  
***************
*** 50,55 ****
--- 50,65 ----
  int
  osi_VM_FlushVCache(struct vcache *avc, int *slept)
  {
+     struct vnode *vp = AFSTOV(avc);
+ 
+     if (!vp)
+ 	return 0;
+     AFS_GUNLOCK();
+ 
+     cache_purge(vp);
+     uvm_vnp_uncache(vp);
+ 
+     AFS_GLOCK();
      return 0;
  }
  
***************
*** 57,62 ****
--- 67,73 ----
   *
   * Locking:  the vcache entry's lock is held.  It will usually be dropped and
   * re-obtained.
+  *
   */
  void
  osi_VM_StoreAllSegments(struct vcache *avc)
***************
*** 75,80 ****
--- 86,94 ----
  void
  osi_VM_TryToSmush(struct vcache *avc, struct AFS_UCRED *acred, int sync)
  {
+     ReleaseWriteLock(&avc->lock);
+     osi_VM_FlushVCache(avc, NULL);
+     ObtainWriteLock(&avc->lock, 59);
  }
  
  /* Purge VM for a file when its callback is revoked.
***************
*** 84,89 ****
--- 98,110 ----
  void
  osi_VM_FlushPages(struct vcache *avc, struct AFS_UCRED *credp)
  {
+     struct vnode *vp = AFSTOV(avc);
+ 
+     if (!vp)
+ 	return;
+     cache_purge(vp);
+     uvm_vnp_uncache(vp);
+     uvm_vnp_setsize(vp, avc->m.Length);
  }
  
  /* Purge pages beyond end-of-file, when truncating a file.
***************
*** 95,98 ****
--- 116,120 ----
  void
  osi_VM_Truncate(struct vcache *avc, int alen, struct AFS_UCRED *acred)
  {
+     uvm_vnp_setsize(AFSTOV(avc), alen);
  }
Index: openafs/src/afs/OBSD/osi_vnodeops.c
diff -c openafs/src/afs/OBSD/osi_vnodeops.c:1.18.2.2 openafs/src/afs/OBSD/osi_vnodeops.c:1.18.2.5
*** openafs/src/afs/OBSD/osi_vnodeops.c:1.18.2.2	Fri Jun 23 10:21:12 2006
--- openafs/src/afs/OBSD/osi_vnodeops.c	Tue Jan  8 12:06:59 2008
***************
*** 3,9 ****
   * Original NetBSD version for Transarc afs by John Kohl <jtk@MIT.EDU>
   * OpenBSD version by Jim Rees <rees@umich.edu>
   *
!  * $Id: osi_vnodeops.c,v 1.18.2.2 2006/06/23 14:21:12 rees Exp $
   */
  
  /*
--- 3,9 ----
   * Original NetBSD version for Transarc afs by John Kohl <jtk@MIT.EDU>
   * OpenBSD version by Jim Rees <rees@umich.edu>
   *
!  * $Id: osi_vnodeops.c,v 1.18.2.5 2008/01/08 17:06:59 rees Exp $
   */
  
  /*
***************
*** 99,105 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/OBSD/osi_vnodeops.c,v 1.18.2.2 2006/06/23 14:21:12 rees Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afs/afsincludes.h"	/* Afs-based standard headers */
--- 99,105 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/OBSD/osi_vnodeops.c,v 1.18.2.5 2008/01/08 17:06:59 rees Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afs/afsincludes.h"	/* Afs-based standard headers */
***************
*** 920,925 ****
--- 920,931 ----
  #endif
  }
  
+ #ifdef AFS_OBSD42_ENV
+ #define VP_INTERLOCK NULL
+ #else
+ #define VP_INTERLOCK (&vp->v_interlock)
+ #endif
+ 
  int
  afs_nbsd_lock(void *v)
  {
***************
*** 933,940 ****
  
      if (!vc)
  	panic("afs_nbsd_lock: null vcache");
!     return afs_osi_lockmgr(&vc->rwlock, ap->a_flags | LK_CANRECURSE, &vp->v_interlock,
! 		   ap->a_p);
  }
  
  int
--- 939,945 ----
  
      if (!vc)
  	panic("afs_nbsd_lock: null vcache");
!     return afs_osi_lockmgr(&vc->rwlock, ap->a_flags | LK_CANRECURSE, VP_INTERLOCK, ap->a_p);
  }
  
  int
***************
*** 950,957 ****
  
      if (!vc)
  	panic("afs_nbsd_unlock: null vcache");
!     return afs_osi_lockmgr(&vc->rwlock, ap->a_flags | LK_RELEASE, &vp->v_interlock,
! 		   ap->a_p);
  }
  
  int
--- 955,961 ----
  
      if (!vc)
  	panic("afs_nbsd_unlock: null vcache");
!     return afs_osi_lockmgr(&vc->rwlock, ap->a_flags | LK_RELEASE, VP_INTERLOCK, ap->a_p);
  }
  
  int
***************
*** 968,974 ****
  
      AFS_STATCNT(afs_bmap);
      if (ap->a_bnp)
! 	ap->a_bnp = (daddr_t *) (ap->a_bn * (8192 / DEV_BSIZE));
      if (ap->a_vpp)
  	*ap->a_vpp = (vcp) ? AFSTOV(vcp) : NULL;
      return 0;
--- 972,978 ----
  
      AFS_STATCNT(afs_bmap);
      if (ap->a_bnp)
! 	*ap->a_bnp = ap->a_bn * btodb(8192);
      if (ap->a_vpp)
  	*ap->a_vpp = (vcp) ? AFSTOV(vcp) : NULL;
      return 0;
***************
*** 994,1008 ****
      tuio.afsio_iovcnt = 1;
      tuio.afsio_seg = AFS_UIOSYS;
      tuio.afsio_resid = len;
!     tiovec[0].iov_base = abp->b_un.b_addr;
      tiovec[0].iov_len = len;
  
      AFS_GLOCK();
      if ((abp->b_flags & B_READ) == B_READ) {
  	code = afs_rdwr(tvc, &tuio, UIO_READ, 0, credp);
  	if (code == 0 && tuio.afsio_resid > 0)
! 	    bzero(abp->b_un.b_addr + len - tuio.afsio_resid,
! 		  tuio.afsio_resid);
      } else
  	code = afs_rdwr(tvc, &tuio, UIO_WRITE, 0, credp);
      AFS_GUNLOCK();
--- 998,1011 ----
      tuio.afsio_iovcnt = 1;
      tuio.afsio_seg = AFS_UIOSYS;
      tuio.afsio_resid = len;
!     tiovec[0].iov_base = abp->b_data;
      tiovec[0].iov_len = len;
  
      AFS_GLOCK();
      if ((abp->b_flags & B_READ) == B_READ) {
  	code = afs_rdwr(tvc, &tuio, UIO_READ, 0, credp);
  	if (code == 0 && tuio.afsio_resid > 0)
! 	    bzero(abp->b_data + len - tuio.afsio_resid, tuio.afsio_resid);
      } else
  	code = afs_rdwr(tvc, &tuio, UIO_WRITE, 0, credp);
      AFS_GUNLOCK();
Index: openafs/src/afs/SOLARIS/osi_file.c
diff -c openafs/src/afs/SOLARIS/osi_file.c:1.13.2.1 openafs/src/afs/SOLARIS/osi_file.c:1.13.2.3
*** openafs/src/afs/SOLARIS/osi_file.c:1.13.2.1	Thu Nov  9 18:26:27 2006
--- openafs/src/afs/SOLARIS/osi_file.c	Mon Mar 17 11:28:55 2008
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/SOLARIS/osi_file.c,v 1.13.2.1 2006/11/09 23:26:27 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
--- 11,17 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/SOLARIS/osi_file.c,v 1.13.2.3 2008/03/17 15:28:55 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 86,92 ****
--- 86,96 ----
      struct vattr vattr;
  
      vattr.va_mask = AT_FSID | AT_NODEID;	/* quick return using this mask. */
+ #ifdef AFS_SUN511_ENV
+     code = VOP_GETATTR(vp, &vattr, 0, &afs_osi_cred, NULL);
+ #else
      code = VOP_GETATTR(vp, &vattr, 0, &afs_osi_cred);
+ #endif
      if (code) {
  	osi_Panic("VnodeToIno");
      }
***************
*** 101,107 ****
--- 105,115 ----
  
      vattr.va_mask = AT_FSID | AT_NODEID;	/* quick return using this mask. */
      AFS_GUNLOCK();
+ #ifdef AFS_SUN511_ENV
+     code = VOP_GETATTR(vp, &vattr, 0, &afs_osi_cred, NULL);
+ #else
      code = VOP_GETATTR(vp, &vattr, 0, &afs_osi_cred);
+ #endif
      AFS_GLOCK();
      if (code) {
  	osi_Panic("VnodeToDev");
***************
*** 122,128 ****
--- 130,140 ----
      MObtainWriteLock(&afs_xosi, 578);
      vattr.va_mask = AT_SIZE;
      AFS_GUNLOCK();
+ #ifdef AFS_SUN511_ENV
+     code = VOP_GETATTR(vp, &vattr, 0, &afs_osi_cred, NULL);
+ #else
      code = VOP_GETATTR(vp, &vattr, 0, &afs_osi_cred);
+ #endif
      AFS_GLOCK();
      if (code) {
  	osi_Panic("VnodeToSize");
***************
*** 224,230 ****
--- 236,246 ----
      /* Ufs doesn't seem to care about the flags so we pass 0 for now */
      tvattr.va_mask = AT_ALL;
      AFS_GUNLOCK();
+ #ifdef AFS_SUN511_ENV 
+     code = VOP_GETATTR(afile->vnode, &tvattr, 0, &afs_osi_cred, NULL);
+ #else
      code = VOP_GETATTR(afile->vnode, &tvattr, 0, &afs_osi_cred);
+ #endif
      AFS_GLOCK();
      if (code == 0) {
  	astat->size = tvattr.va_size;
***************
*** 398,405 ****
  void
  shutdown_osifile(void)
  {
-     extern int afs_cold_shutdown;
- 
      AFS_STATCNT(shutdown_osifile);
      if (afs_cold_shutdown) {
  	afs_osicred_initialized = 0;
--- 414,419 ----
Index: openafs/src/afs/SOLARIS/osi_vfsops.c
diff -c openafs/src/afs/SOLARIS/osi_vfsops.c:1.18.2.3 openafs/src/afs/SOLARIS/osi_vfsops.c:1.18.2.6
*** openafs/src/afs/SOLARIS/osi_vfsops.c:1.18.2.3	Tue Jan  2 02:36:10 2007
--- openafs/src/afs/SOLARIS/osi_vfsops.c	Mon Mar 17 11:28:55 2008
***************
*** 14,26 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/SOLARIS/osi_vfsops.c,v 1.18.2.3 2007/01/02 07:36:10 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
  #include "afs/afs_stats.h"	/* statistics stuff */
  #include "h/modctl.h"
  #include "h/syscall.h"
  #include <sys/kobj.h>
  
  
--- 14,29 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/SOLARIS/osi_vfsops.c,v 1.18.2.6 2008/03/17 15:28:55 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
  #include "afs/afs_stats.h"	/* statistics stuff */
  #include "h/modctl.h"
  #include "h/syscall.h"
+ #if defined(AFS_SUN511_ENV)
+ #include <sys/vfs_opreg.h>
+ #endif
  #include <sys/kobj.h>
  
  
***************
*** 100,105 ****
--- 103,109 ----
      register afs_int32 code = 0;
      struct vrequest treq;
      register struct vcache *tvp = 0;
+     struct vcache *gvp;
      struct proc *proc = ttoproc(curthread);
      struct vnode *vp = afsp->vfs_vnodecovered;
      int locked = 0;
***************
*** 115,120 ****
--- 119,125 ----
  
      AFS_STATCNT(afs_root);
  
+ again:
      if (afs_globalVp && (afs_globalVp->states & CStatd)) {
  	tvp = afs_globalVp;
      } else {
***************
*** 125,132 ****
  	}
  
  	if (afs_globalVp) {
! 	    afs_PutVCache(afs_globalVp);
  	    afs_globalVp = NULL;
  	}
  
  	if (!(code = afs_InitReq(&treq, proc->p_cred))
--- 130,138 ----
  	}
  
  	if (afs_globalVp) {
! 	    gvp = afs_globalVp;
  	    afs_globalVp = NULL;
+ 	    afs_PutVCache(gvp);
  	}
  
  	if (!(code = afs_InitReq(&treq, proc->p_cred))
***************
*** 134,139 ****
--- 140,151 ----
  	    tvp = afs_GetVCache(&afs_rootFid, &treq, NULL, NULL);
  	    /* we really want this to stay around */
  	    if (tvp) {
+ 		if (afs_globalVp) {
+ 		    /* someone else got there before us! */
+ 		    afs_PutVCache(tvp);
+ 		    tvp = 0;
+ 		    goto again;
+ 		}
  		afs_globalVp = tvp;
  	    } else
  		code = ENOENT;
***************
*** 245,251 ****
  }
  
  
! #ifdef AFS_SUN510_ENV
  /* The following list must always be NULL-terminated */
  const fs_operation_def_t afs_vfsops_template[] = {
      VFSNAME_MOUNT,		afs_mount,
--- 257,277 ----
  }
  
  
! #if defined(AFS_SUN511_ENV)
! /* The following list must always be NULL-terminated */
! static const fs_operation_def_t afs_vfsops_template[] = {
!     VFSNAME_MOUNT,		{ .vfs_mount = afs_mount },
!     VFSNAME_UNMOUNT,		{ .vfs_unmount = afs_unmount },
!     VFSNAME_ROOT,		{ .vfs_root = afs_root },
!     VFSNAME_STATVFS,		{ .vfs_statvfs = afs_statvfs },
!     VFSNAME_SYNC,		{ .vfs_sync = afs_sync },
!     VFSNAME_VGET,		{ .vfs_vget = afs_vget },
!     VFSNAME_MOUNTROOT,  	{ .vfs_mountroot = afs_mountroot },
!     VFSNAME_FREEVFS,		{ .vfs_freevfs = fs_freevfs },
!     NULL,			NULL
! };
! struct vfsops *afs_vfsopsp;
! #elif defined(AFS_SUN510_ENV)
  /* The following list must always be NULL-terminated */
  const fs_operation_def_t afs_vfsops_template[] = {
      VFSNAME_MOUNT,		afs_mount,
***************
*** 256,262 ****
      VFSNAME_VGET,		afs_vget,
      VFSNAME_MOUNTROOT,  	afs_mountroot,
      VFSNAME_FREEVFS,		fs_freevfs,
!     NULL,                     NULL
  };
  struct vfsops *afs_vfsopsp;
  #else
--- 282,288 ----
      VFSNAME_VGET,		afs_vget,
      VFSNAME_MOUNTROOT,  	afs_mountroot,
      VFSNAME_FREEVFS,		fs_freevfs,
!     NULL,			NULL
  };
  struct vfsops *afs_vfsopsp;
  #else
***************
*** 391,402 ****
--- 417,438 ----
  }
  
  #ifdef AFS_SUN510_ENV
+ #ifdef AFS_SUN511_ENV
+ static struct vfsdef_v4 afs_vfsdef = {
+     VFSDEF_VERSION,
+     "afs",
+     afsinit,
+     0,
+     NULL
+ };
+ #else
  static struct vfsdef_v3 afs_vfsdef = {
      VFSDEF_VERSION,
      "afs",
      afsinit,
      0
  };
+ #endif
  #else
  static struct vfssw afs_vfw = {
      "afs",
Index: openafs/src/afs/SOLARIS/osi_vnodeops.c
diff -c openafs/src/afs/SOLARIS/osi_vnodeops.c:1.20.2.10 openafs/src/afs/SOLARIS/osi_vnodeops.c:1.20.2.12
*** openafs/src/afs/SOLARIS/osi_vnodeops.c:1.20.2.10	Thu Dec 28 17:26:48 2006
--- openafs/src/afs/SOLARIS/osi_vnodeops.c	Mon Mar 17 11:28:55 2008
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/SOLARIS/osi_vnodeops.c,v 1.20.2.10 2006/12/28 22:26:48 shadow Exp $");
  
  /*
   * SOLARIS/osi_vnodeops.c
--- 11,17 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/SOLARIS/osi_vnodeops.c,v 1.20.2.12 2008/03/17 15:28:55 shadow Exp $");
  
  /*
   * SOLARIS/osi_vnodeops.c
***************
*** 47,52 ****
--- 47,55 ----
  #include <vm/seg_map.h>
  #include <vm/seg_vn.h>
  #include <vm/rm.h>
+ #if defined(AFS_SUN511_ENV)
+ #include <sys/vfs_opreg.h>
+ #endif
  #include <sys/modctl.h>
  #include <sys/syscall.h>
  #include <sys/debug.h>
***************
*** 1401,1406 ****
--- 1404,1428 ----
  }
  
  #ifdef	AFS_SUN54_ENV
+ #ifdef	AFS_SUN511_ENV
+ extern void
+ afs_dispose(struct vnode *vp, struct page *p, int fl, int dn, struct cred *cr, struct caller_context_t *ct)
+ {
+     fs_dispose(vp, p, fl, dn, cr,ct);
+ }
+ 
+ int
+ afs_setsecattr(struct vnode *vp, vsecattr_t *vsecattr, int flag, struct cred *creds, struct caller_context_t *ct)
+ {
+     return ENOSYS;
+ }
+ 
+ int
+ afs_getsecattr(struct vnode *vp, vsecattr_t *vsecattr, int flag, struct cred *creds, struct caller_context_t *ct)
+ {
+   return fs_fab_acl(vp, vsecattr, flag, creds,ct);
+ }
+ #else
  extern void
  afs_dispose(vp, p, fl, dn, cr)
       struct vnode *vp;
***************
*** 1431,1436 ****
--- 1453,1459 ----
      return fs_fab_acl(vp, vsecattr, flag, creds);
  }
  #endif
+ #endif
  
  #ifdef	AFS_GLOBAL_SUNLOCK
  extern int gafs_open(), gafs_close(), afs_ioctl(), gafs_access();
***************
*** 1441,1447 ****
  extern int afs_lockctl();
  extern void gafs_inactive();
  
! #ifdef AFS_SUN510_ENV
  /* The following list must always be NULL-terminated */
  const fs_operation_def_t afs_vnodeops_template[] = {
      VOPNAME_OPEN,		gafs_open,
--- 1464,1519 ----
  extern int afs_lockctl();
  extern void gafs_inactive();
  
! #if defined(AFS_SUN511_ENV)
! /* The following list must always be NULL-terminated */
! const fs_operation_def_t afs_vnodeops_template[] = {
!     VOPNAME_OPEN,		{ .vop_open = gafs_open },
!     VOPNAME_CLOSE,		{ .vop_close = gafs_close },
!     VOPNAME_READ,		{ .vop_read = afs_vmread },
!     VOPNAME_WRITE,		{ .vop_write = afs_vmwrite },
!     VOPNAME_IOCTL,		{ .vop_ioctl = afs_ioctl },
!     VOPNAME_SETFL,		{ .vop_setfl = fs_setfl },
!     VOPNAME_GETATTR,		{ .vop_getattr = gafs_getattr },
!     VOPNAME_SETATTR,		{ .vop_setattr = gafs_setattr },
!     VOPNAME_ACCESS,		{ .vop_access = gafs_access },
!     VOPNAME_LOOKUP,		{ .vop_lookup = gafs_lookup },
!     VOPNAME_CREATE,		{ .vop_create = gafs_create },
!     VOPNAME_REMOVE,		{ .vop_remove = gafs_remove },
!     VOPNAME_LINK,		{ .vop_link = gafs_link },
!     VOPNAME_RENAME,		{ .vop_rename = gafs_rename },
!     VOPNAME_MKDIR,		{ .vop_mkdir = gafs_mkdir },
!     VOPNAME_RMDIR,		{ .vop_rmdir = gafs_rmdir },
!     VOPNAME_READDIR,		{ .vop_readdir = gafs_readdir },
!     VOPNAME_SYMLINK,		{ .vop_symlink = gafs_symlink },   
!     VOPNAME_READLINK,		{ .vop_readlink = gafs_readlink },
!     VOPNAME_FSYNC,		{ .vop_fsync = gafs_fsync },
!     VOPNAME_INACTIVE,		{ .vop_inactive = gafs_inactive },
!     VOPNAME_FID,		{ .vop_fid = gafs_fid },
!     VOPNAME_RWLOCK,		{ .vop_rwlock = afs_rwlock },
!     VOPNAME_RWUNLOCK,		{ .vop_rwunlock = afs_rwunlock },
!     VOPNAME_SEEK,		{ .vop_seek = afs_seek },
!     VOPNAME_CMP,		{ .vop_cmp = afs_cmp },
!     VOPNAME_FRLOCK,		{ .vop_frlock = afs_frlock },
!     VOPNAME_SPACE,		{ .vop_space = afs_space },
!     VOPNAME_REALVP,		{ .vop_realvp = afs_realvp },
!     VOPNAME_GETPAGE,		{ .vop_getpage = afs_getpage },
!     VOPNAME_PUTPAGE,		{ .vop_putpage = afs_putpage },
!     VOPNAME_MAP,		{ .vop_map = afs_map },
!     VOPNAME_ADDMAP,		{ .vop_addmap = afs_addmap },
!     VOPNAME_DELMAP,		{ .vop_delmap = afs_delmap },
!     VOPNAME_POLL,		{ .vop_poll = fs_poll },
!     VOPNAME_PATHCONF,		{ .vop_pathconf = afs_pathconf },
!     VOPNAME_PAGEIO,		{ .vop_pageio = afs_pageio },
!     VOPNAME_DUMP,		{ .vop_dump = afs_dump },
!     VOPNAME_DUMPCTL,		{ .vop_dumpctl = afs_dumpctl },   
!     VOPNAME_DISPOSE,		{ .vop_dispose = afs_dispose },
!     VOPNAME_GETSECATTR,		{ .vop_getsecattr = afs_getsecattr },
!     VOPNAME_SETSECATTR, 	{ .vop_setsecattr = afs_setsecattr },
!     VOPNAME_SHRLOCK,		{ .vop_shrlock = fs_shrlock },
!     NULL,			NULL
! };
! vnodeops_t *afs_ops;
! #elif defined(AFS_SUN510_ENV)
  /* The following list must always be NULL-terminated */
  const fs_operation_def_t afs_vnodeops_template[] = {
      VOPNAME_OPEN,		gafs_open,
Index: openafs/src/afs/UKERNEL/afs_usrops.c
diff -c openafs/src/afs/UKERNEL/afs_usrops.c:1.27.2.4 openafs/src/afs/UKERNEL/afs_usrops.c:1.27.2.7
*** openafs/src/afs/UKERNEL/afs_usrops.c:1.27.2.4	Thu Nov  9 23:03:38 2006
--- openafs/src/afs/UKERNEL/afs_usrops.c	Thu Jan 31 15:18:51 2008
***************
*** 15,21 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/UKERNEL/afs_usrops.c,v 1.27.2.4 2006/11/10 04:03:38 shadow Exp $");
  
  
  #ifdef	UKERNEL
--- 15,21 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/UKERNEL/afs_usrops.c,v 1.27.2.7 2008/01/31 20:18:51 shadow Exp $");
  
  
  #ifdef	UKERNEL
***************
*** 183,188 ****
--- 183,189 ----
  ufs_brelse(struct usr_vnode *vp, struct usr_buf *bp)
  {
      usr_assert(0);
+     return 0;
  }
  
  /*
***************
*** 192,203 ****
--- 193,206 ----
  iodone(struct usr_buf *bp)
  {
      usr_assert(0);
+     return 0;
  }
  
  struct usr_file *
  getf(int fd)
  {
      usr_assert(0);
+     return 0;
  }
  
  /*
***************
*** 233,238 ****
--- 236,242 ----
  usr_flock(void)
  {
      usr_assert(0);
+     return 0;
  }
  
  /*
***************
*** 243,248 ****
--- 247,253 ----
  usr_ioctl(void)
  {
      usr_assert(0);
+     return 0;
  }
  
  /*
***************
*** 252,275 ****
--- 257,284 ----
  afs_syscall_icreate(void)
  {
      usr_assert(0);
+     return 0;
  }
  
  int
  afs_syscall_iincdec(void)
  {
      usr_assert(0);
+     return 0;
  }
  
  int
  afs_syscall_iopen(void)
  {
      usr_assert(0);
+     return 0;
  }
  
  int
  afs_syscall_ireadwrite(void)
  {
      usr_assert(0);
+     return 0;
  }
  
  /*
***************
*** 280,303 ****
--- 289,316 ----
  vno_close(void)
  {
      usr_assert(0);
+     return 0;
  }
  
  int
  vno_ioctl(void)
  {
      usr_assert(0);
+     return 0;
  }
  
  int
  vno_rw(void)
  {
      usr_assert(0);
+     return 0;
  }
  
  int
  vno_select(void)
  {
      usr_assert(0);
+     return 0;
  }
  
  /*
***************
*** 374,385 ****
--- 387,400 ----
      if (credp->cr_ref == 0) {
  	afs_osi_Free((char *)credp, sizeof(struct usr_ucred));
      }
+     return 0;
  }
  
  int
  usr_crhold(struct usr_ucred *credp)
  {
      credp->cr_ref++;
+     return 0;
  }
  
  void
***************
*** 517,522 ****
--- 532,538 ----
  	waitp = waitp->next;
      }
      usr_mutex_unlock(&osi_waitq_lock);
+     return 0;
  }
  
  int
***************
*** 608,613 ****
--- 624,630 ----
  	waitp = waitp->timedNext;
      }
      usr_mutex_unlock(&osi_waitq_lock);
+     return 0;
  }
  
  /*
***************
*** 988,993 ****
--- 1005,1016 ----
      return;
  }
  
+ void
+ afs_osi_Visible(void)
+ {
+     return;
+ }
+ 
  int
  osi_GetTime(struct timeval *tv)
  {
***************
*** 1390,1397 ****
      return (0);
  }
  
! static
! ConfigCell(register struct afsconf_cell *aci, char *arock,
  	   struct afsconf_dir *adir)
  {
      register int isHomeCell;
--- 1413,1420 ----
      return (0);
  }
  
! static int
! ConfigCell(register struct afsconf_cell *aci, void *arock,
  	   struct afsconf_dir *adir)
  {
      register int isHomeCell;
***************
*** 1421,1430 ****
  }
  
  static int
! ConfigCellAlias(aca, arock, adir)
! 	struct afsconf_cellalias *aca;
! 	char *arock;
! 	struct afsconf_dir *adir;
  {
  	call_syscall(AFSOP_ADDCELLALIAS, (long)aca->aliasName, 
  		     (long)aca->realName, 0, 0, 0);
--- 1444,1450 ----
  }
  
  static int
! ConfigCellAlias(struct afsconf_cellalias *aca, void *arock, struct afsconf_dir *adir)
  {
  	call_syscall(AFSOP_ADDCELLALIAS, (long)aca->aliasName, 
  		     (long)aca->realName, 0, 0, 0);
***************
*** 1981,1986 ****
--- 2001,2007 ----
  		 sysArgsP->param2, sysArgsP->param3, sysArgsP->param4);
  
      afs_osi_Free(argp, -1);
+     return 0;
  }
  
  fork_syscall(syscall, afscall, param1, param2, param3, param4)
***************
*** 2001,2006 ****
--- 2022,2028 ----
  
      usr_thread_create(&tid, syscallThread, sysArgsP);
      usr_thread_detach(tid);
+     return 0;
  }
  
  call_syscall(syscall, afscall, param1, param2, param3, param4)
***************
*** 2187,2193 ****
      struct usr_vnode *linkVp;
      char *tmpPath;
      char *pathP;
!     char *nextPathP;
  
      AFS_ASSERT_GLOCK();
  
--- 2209,2215 ----
      struct usr_vnode *linkVp;
      char *tmpPath;
      char *pathP;
!     char *nextPathP = NULL;
  
      AFS_ASSERT_GLOCK();
  
Index: openafs/src/afs/UKERNEL/osi_groups.c
diff -c openafs/src/afs/UKERNEL/osi_groups.c:1.7 openafs/src/afs/UKERNEL/osi_groups.c:1.7.2.1
*** openafs/src/afs/UKERNEL/osi_groups.c:1.7	Tue Jul 15 19:14:28 2003
--- openafs/src/afs/UKERNEL/osi_groups.c	Mon Nov 26 16:21:47 2007
***************
*** 15,21 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/UKERNEL/osi_groups.c,v 1.7 2003/07/15 23:14:28 shadow Exp $");
  
  #include "afs/sysincludes.h"
  #include "afsincludes.h"
--- 15,21 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/UKERNEL/osi_groups.c,v 1.7.2.1 2007/11/26 21:21:47 shadow Exp $");
  
  #include "afs/sysincludes.h"
  #include "afsincludes.h"
***************
*** 26,31 ****
--- 26,32 ----
  afs_xsetgroups()
  {
      usr_assert(0);
+     return 0;
  }
  
  static int
Index: openafs/src/afs/VNOPS/afs_vnop_access.c
diff -c openafs/src/afs/VNOPS/afs_vnop_access.c:1.10.2.1 openafs/src/afs/VNOPS/afs_vnop_access.c:1.10.2.2
*** openafs/src/afs/VNOPS/afs_vnop_access.c:1.10.2.1	Wed Aug 25 03:09:35 2004
--- openafs/src/afs/VNOPS/afs_vnop_access.c	Fri Mar  7 12:34:08 2008
***************
*** 23,29 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_access.c,v 1.10.2.1 2004/08/25 07:09:35 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
--- 23,29 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_access.c,v 1.10.2.2 2008/03/07 17:34:08 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 199,205 ****
      if ((code = afs_InitReq(&treq, acred)))
  	return code;
  
!     code = afs_EvalFakeStat(&avc, &fakestate, &treq);
      if (code) {
  	afs_PutFakeStat(&fakestate);
  	return code;
--- 199,214 ----
      if ((code = afs_InitReq(&treq, acred)))
  	return code;
  
!     if (afs_fakestat_enable && avc->mvstat == 1) {
! 	code = afs_TryEvalFakeStat(&avc, &fakestate, &treq);
!         if (code == 0 && avc->mvstat == 1) {
! 	    afs_PutFakeStat(&fakestate);
! 	    return 0;
!         }
!     } else {
! 	code = afs_EvalFakeStat(&avc, &fakestate, &treq);
!     }
! 
      if (code) {
  	afs_PutFakeStat(&fakestate);
  	return code;
Index: openafs/src/afs/VNOPS/afs_vnop_create.c
diff -c openafs/src/afs/VNOPS/afs_vnop_create.c:1.16.2.9 openafs/src/afs/VNOPS/afs_vnop_create.c:1.16.2.10
*** openafs/src/afs/VNOPS/afs_vnop_create.c:1.16.2.9	Fri Oct 13 01:15:58 2006
--- openafs/src/afs/VNOPS/afs_vnop_create.c	Sat Dec  8 13:00:45 2007
***************
*** 17,23 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_create.c,v 1.16.2.9 2006/10/13 05:15:58 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
--- 17,23 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_create.c,v 1.16.2.10 2007/12/08 18:00:45 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 353,359 ****
--- 353,361 ----
  	UpgradeSToWLock(&tdc->lock, 631);
      if (afs_LocalHero(adp, tdc, &OutDirStatus, 1)) {
  	/* we can do it locally */
+ 	ObtainWriteLock(&afs_xdcache, 291);
  	code = afs_dir_Create(tdc, aname, &newFid.Fid);
+ 	ReleaseWriteLock(&afs_xdcache);
  	if (code) {
  	    ZapDCE(tdc);
  	    DZap(tdc);
Index: openafs/src/afs/VNOPS/afs_vnop_dirops.c
diff -c openafs/src/afs/VNOPS/afs_vnop_dirops.c:1.14.2.5 openafs/src/afs/VNOPS/afs_vnop_dirops.c:1.14.2.6
*** openafs/src/afs/VNOPS/afs_vnop_dirops.c:1.14.2.5	Mon May 30 00:05:44 2005
--- openafs/src/afs/VNOPS/afs_vnop_dirops.c	Sat Dec  8 13:00:45 2007
***************
*** 21,27 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_dirops.c,v 1.14.2.5 2005/05/30 04:05:44 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
--- 21,27 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_dirops.c,v 1.14.2.6 2007/12/08 18:00:45 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 132,138 ****
--- 132,140 ----
  	ObtainWriteLock(&tdc->lock, 632);
      if (afs_LocalHero(adp, tdc, &OutDirStatus, 1)) {
  	/* we can do it locally */
+ 	ObtainWriteLock(&afs_xdcache, 294);
  	code = afs_dir_Create(tdc, aname, &newFid.Fid);
+ 	ReleaseWriteLock(&afs_xdcache);
  	if (code) {
  	    ZapDCE(tdc);	/* surprise error -- use invalid value */
  	    DZap(tdc);
Index: openafs/src/afs/VNOPS/afs_vnop_link.c
diff -c openafs/src/afs/VNOPS/afs_vnop_link.c:1.15.2.4 openafs/src/afs/VNOPS/afs_vnop_link.c:1.15.2.5
*** openafs/src/afs/VNOPS/afs_vnop_link.c:1.15.2.4	Sun Jan 30 22:49:15 2005
--- openafs/src/afs/VNOPS/afs_vnop_link.c	Sat Dec  8 13:00:45 2007
***************
*** 17,23 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_link.c,v 1.15.2.4 2005/01/31 03:49:15 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
--- 17,23 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_link.c,v 1.15.2.5 2007/12/08 18:00:45 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 127,133 ****
--- 127,135 ----
  	ObtainWriteLock(&tdc->lock, 635);
      if (afs_LocalHero(adp, tdc, &OutDirStatus, 1)) {
  	/* we can do it locally */
+ 	ObtainWriteLock(&afs_xdcache, 290);
  	code = afs_dir_Create(tdc, aname, &avc->fid.Fid);
+ 	ReleaseWriteLock(&afs_xdcache);
  	if (code) {
  	    ZapDCE(tdc);	/* surprise error -- invalid value */
  	    DZap(tdc);
Index: openafs/src/afs/VNOPS/afs_vnop_lookup.c
diff -c openafs/src/afs/VNOPS/afs_vnop_lookup.c:1.50.2.19 openafs/src/afs/VNOPS/afs_vnop_lookup.c:1.50.2.21
*** openafs/src/afs/VNOPS/afs_vnop_lookup.c:1.50.2.19	Tue Oct 16 18:03:46 2007
--- openafs/src/afs/VNOPS/afs_vnop_lookup.c	Tue Apr 15 08:29:56 2008
***************
*** 18,24 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_lookup.c,v 1.50.2.19 2007/10/16 22:03:46 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
--- 18,24 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_lookup.c,v 1.50.2.21 2008/04/15 12:29:56 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 1120,1125 ****
--- 1120,1126 ----
      register afs_int32 code;
      register afs_int32 bulkcode = 0;
      int pass = 0, hit = 0;
+     int force_eval = afs_fakestat_enable ? 0 : 1;
      long dirCookie;
      extern afs_int32 afs_mariner;	/*Writing activity to log? */
      afs_hyper_t versionNo;
***************
*** 1140,1145 ****
--- 1141,1151 ----
      ndp->ni_dvp = AFSTOV(adp);
  #endif /* AFS_OSF_ENV */
  
+     if (afs_fakestat_enable && adp->mvstat == 1) {
+        if (strcmp(aname, ".directory") == 0)
+            tryEvalOnly = 1;
+     }
+ 
  #if defined(AFS_DARWIN_ENV)
      /* Workaround for MacOSX Finder, which tries to look for
       * .DS_Store and Contents under every directory.
***************
*** 1437,1444 ****
      }				/* sub-block just to reduce stack usage */
  
      if (tvc) {
- 	int force_eval = afs_fakestat_enable ? 0 : 1;
- 
  	if (adp->states & CForeign)
  	    tvc->states |= CForeign;
  	tvc->parentVnode = adp->fid.Fid.Vnode;
--- 1443,1448 ----
***************
*** 1459,1464 ****
--- 1463,1471 ----
  		force_eval = 1;
  	    ReleaseReadLock(&tvc->lock);
  	}
+ 	if (tvc->mvstat == 1 && (tvc->states & CMValid) && tvc->mvid != NULL)
+ 	  force_eval = 1; /* This is now almost for free, get it correct */
+ 
  #if defined(UKERNEL) && defined(AFS_WEB_ENHANCEMENTS)
  	if (!(flags & AFS_LOOKUP_NOEVAL))
  	    /* don't eval mount points */
***************
*** 1584,1590 ****
  	     * rather than the vc of the mount point itself.  we can still find the
  	     * mount point's vc in the vcache by its fid. */
  #endif /* UKERNEL && AFS_WEB_ENHANCEMENTS */
! 	    if (!hit) {
  		osi_dnlc_enter(adp, aname, tvc, &versionNo);
  	    } else {
  #ifdef AFS_LINUX20_ENV
--- 1591,1597 ----
  	     * rather than the vc of the mount point itself.  we can still find the
  	     * mount point's vc in the vcache by its fid. */
  #endif /* UKERNEL && AFS_WEB_ENHANCEMENTS */
! 	    if (!hit && force_eval) {
  		osi_dnlc_enter(adp, aname, tvc, &versionNo);
  	    } else {
  #ifdef AFS_LINUX20_ENV
Index: openafs/src/afs/VNOPS/afs_vnop_read.c
diff -c openafs/src/afs/VNOPS/afs_vnop_read.c:1.26.2.4 openafs/src/afs/VNOPS/afs_vnop_read.c:1.26.2.6
*** openafs/src/afs/VNOPS/afs_vnop_read.c:1.26.2.4	Mon Feb 20 23:47:08 2006
--- openafs/src/afs/VNOPS/afs_vnop_read.c	Sat Apr 26 23:54:27 2008
***************
*** 19,25 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_read.c,v 1.26.2.4 2006/02/21 04:47:08 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
--- 19,25 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_read.c,v 1.26.2.6 2008/04/27 03:54:27 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 117,123 ****
       * Locks held:
       * avc->lock(R)
       */
!     while (totalLength > 0) {
  	/* read all of the cached info */
  	if (filePos >= avc->m.Length)
  	    break;		/* all done */
--- 117,138 ----
       * Locks held:
       * avc->lock(R)
       */
!     if (filePos >= avc->m.Length) {
! 	if (len > AFS_ZEROS)
! 	    len = sizeof(afs_zeros);	/* and in 0 buffer */
! 	len = 0;
! #ifdef AFS_DARWIN80_ENV
! 	trimlen = len;
! 	tuiop = afsio_darwin_partialcopy(auio, trimlen);
! #else
! 	afsio_copy(auio, &tuio, tvec);
! 	trimlen = len;
! 	afsio_trim(&tuio, trimlen);
! #endif
! 	AFS_UIOMOVE(afs_zeros, trimlen, UIO_READ, tuiop, code);
!     }
! 
!     while (avc->m.Length > 0 && totalLength > 0) {
  	/* read all of the cached info */
  	if (filePos >= avc->m.Length)
  	    break;		/* all done */
***************
*** 536,542 ****
      }
  #endif
  
!     while (totalLength > 0) {
  	/* read all of the cached info */
  	if (filePos >= avc->m.Length)
  	    break;		/* all done */
--- 551,572 ----
      }
  #endif
  
!     if (filePos >= avc->m.Length) {
! 	if (len > AFS_ZEROS)
! 	    len = sizeof(afs_zeros);	/* and in 0 buffer */
! 	len = 0;
! #ifdef AFS_DARWIN80_ENV
! 	trimlen = len;
! 	tuiop = afsio_darwin_partialcopy(auio, trimlen);
! #else
! 	afsio_copy(auio, &tuio, tvec);
! 	trimlen = len;
! 	afsio_trim(&tuio, trimlen);
! #endif
! 	AFS_UIOMOVE(afs_zeros, trimlen, UIO_READ, tuiop, code);
!     }
! 
!     while (avc->m.Length > 0 && totalLength > 0) {
  	/* read all of the cached info */
  	if (filePos >= avc->m.Length)
  	    break;		/* all done */
Index: openafs/src/afs/VNOPS/afs_vnop_remove.c
diff -c openafs/src/afs/VNOPS/afs_vnop_remove.c:1.31.2.16 openafs/src/afs/VNOPS/afs_vnop_remove.c:1.31.2.17
*** openafs/src/afs/VNOPS/afs_vnop_remove.c:1.31.2.16	Thu Mar  2 01:34:19 2006
--- openafs/src/afs/VNOPS/afs_vnop_remove.c	Wed Dec 19 15:59:48 2007
***************
*** 21,27 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_remove.c,v 1.31.2.16 2006/03/02 06:34:19 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
--- 21,27 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_remove.c,v 1.31.2.17 2007/12/19 20:59:48 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 415,421 ****
--- 415,425 ----
  	code = afsremove(adp, tdc, tvc, aname, acred, &treq);
      }
      afs_PutFakeStat(&fakestate);
+ #ifndef AFS_DARWIN80_ENV
+     /* we can't track by thread, it's not exported in the KPI; only do
+        this on !macos */
      osi_Assert(!WriteLocked(&adp->lock) || (adp->lock.pid_writer != MyPidxx));
+ #endif
      return code;
  }
  
Index: openafs/src/afs/VNOPS/afs_vnop_rename.c
diff -c openafs/src/afs/VNOPS/afs_vnop_rename.c:1.16.2.11 openafs/src/afs/VNOPS/afs_vnop_rename.c:1.16.2.12
*** openafs/src/afs/VNOPS/afs_vnop_rename.c:1.16.2.11	Fri Dec 23 19:21:45 2005
--- openafs/src/afs/VNOPS/afs_vnop_rename.c	Sat Dec  8 13:00:45 2007
***************
*** 18,24 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_rename.c,v 1.16.2.11 2005/12/24 00:21:45 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
--- 18,24 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_rename.c,v 1.16.2.12 2007/12/08 18:00:45 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 227,233 ****
--- 227,235 ----
  		code = afs_dir_Delete(tdc2, aname2);
  	    }
  	    if (code == 0) {
+ 		ObtainWriteLock(&afs_xdcache, 292);
  		code = afs_dir_Create(tdc2, aname2, &fileFid.Fid);
+ 		ReleaseWriteLock(&afs_xdcache);
  	    }
  	    if (code != 0) {
  		ZapDCE(tdc1);
Index: openafs/src/afs/VNOPS/afs_vnop_symlink.c
diff -c openafs/src/afs/VNOPS/afs_vnop_symlink.c:1.19.2.5 openafs/src/afs/VNOPS/afs_vnop_symlink.c:1.19.2.6
*** openafs/src/afs/VNOPS/afs_vnop_symlink.c:1.19.2.5	Fri Oct 14 22:33:12 2005
--- openafs/src/afs/VNOPS/afs_vnop_symlink.c	Sat Dec  8 13:00:45 2007
***************
*** 22,28 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_symlink.c,v 1.19.2.5 2005/10/15 02:33:12 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
--- 22,28 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_symlink.c,v 1.19.2.6 2007/12/08 18:00:45 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 173,179 ****
--- 173,181 ----
      /* otherwise, we should see if we can make the change to the dir locally */
      if (afs_LocalHero(adp, tdc, &OutDirStatus, 1)) {
  	/* we can do it locally */
+ 	ObtainWriteLock(&afs_xdcache, 293);
  	code = afs_dir_Create(tdc, aname, &newFid.Fid);
+ 	ReleaseWriteLock(&afs_xdcache);
  	if (code) {
  	    ZapDCE(tdc);	/* surprise error -- use invalid value */
  	    DZap(tdc);
Index: openafs/src/afsd/afs.rc.darwin
diff -c openafs/src/afsd/afs.rc.darwin:1.6.2.2 openafs/src/afsd/afs.rc.darwin:1.6.2.3
*** openafs/src/afsd/afs.rc.darwin:1.6.2.2	Tue Feb 14 19:38:36 2006
--- openafs/src/afsd/afs.rc.darwin	Mon Jan 21 16:01:29 2008
***************
*** 36,54 ****
  if [ -x /usr/sbin/kextstat ]; then KMODSTAT=/usr/sbin/kextstat; fi
  if [ -x /usr/sbin/kmodstat ]; then KMODSTAT=/usr/sbin/kmodstat; fi
  
  
  StartService()
  {
      echo "Starting OpenAFS"
  
!     if [ -f $AFSDOPT ]; then
! 	OPTIONS=`cat $AFSDOPT`
      else
! 	OPTIONS="$MEDIUM -fakestat"
      fi
  
      if [ "${NETWORKUP}" = "-NO-" ]; then
!         echo $OPTIONS | grep -e '-dynroot' || exit
      fi
  
  # Need the commands ps, awk, kill, sleep
--- 36,63 ----
  if [ -x /usr/sbin/kextstat ]; then KMODSTAT=/usr/sbin/kextstat; fi
  if [ -x /usr/sbin/kmodstat ]; then KMODSTAT=/usr/sbin/kmodstat; fi
  
+ if [ -f $CONFIG/afs.conf ]; then
+     . $CONFIG/afs.conf
+ fi
+ 
+ # Check this file second so that if users have altered the file, it will
+ # override the default options
+ if [ -f $AFSDOPT ]; then
+     OPTIONS=`cat $AFSDOPT`
+ fi
  
  StartService()
  {
      echo "Starting OpenAFS"
  
!     if [ -z "$OPTIONS" ] || [ "$OPTIONS" = "AUTOMATIC" ] ; then
! 	AFSD_OPTIONS="$VERBOSE"
      else
! 	AFSD_OPTIONS="$OPTIONS $VERBOSE"
      fi
  
      if [ "${NETWORKUP}" = "-NO-" ]; then
!         echo $AFSD_OPTIONS | grep -e '-dynroot' || exit
      fi
  
  # Need the commands ps, awk, kill, sleep
***************
*** 76,82 ****
      if [ -x /usr/afs/bin/bosserver ]; then
  	echo "Starting AFS Server processes"
  	/usr/afs/bin/bosserver
! 	OPTIONS="$OPTIONS -nosettime"
  	sleep 30
      fi
  
--- 85,91 ----
      if [ -x /usr/afs/bin/bosserver ]; then
  	echo "Starting AFS Server processes"
  	/usr/afs/bin/bosserver
! 	AFSD_OPTIONS="$AFSD_OPTIONS -nosettime"
  	sleep 30
      fi
  
***************
*** 107,113 ****
      done
  
      echo "Starting afsd"
!     $AFSD $OPTIONS
  
  #
  # Call afssettings (if it exists) to set customizable parameters
--- 116,128 ----
      done
  
      echo "Starting afsd"
!     $AFSD $AFSD_OPTIONS
! 
! #
! # From /var/db/openafs/etc/config/afs.conf, call a post-init function or
! # command if it's been defined
! #
!     $AFS_POST_INIT
  
  #
  # Call afssettings (if it exists) to set customizable parameters
***************
*** 118,123 ****
--- 133,146 ----
      fi
  
  #
+ # From /var/db/openafs/etc/config/afs.conf, set a sysname list if one was
+ # configured.
+ #
+     if [ -n "$AFS_SYSNAME" ] ; then
+ 	fs sysname $AFS_SYSNAME
+     fi
+ 
+ #
  # Run package to update the disk
  #
      if [ -f /usr/afsws/etc/package -a -f $PACKAGE ]; then
***************
*** 151,156 ****
--- 174,185 ----
  {
      echo "Stopping AFS"
  
+ #
+ # If a pre-shutdown function was defined in /var/db/openafs/etc/config/afs.conf
+ # was defined, then run it
+ #
+     $AFS_PRE_SHUTDOWN
+ 
      if $KMODSTAT | perl -e 'exit not grep /openafs/, <>' ; then
  	echo "Unmounting /afs"
  	umount -f /afs 2>&1 > /dev/console
Index: openafs/src/afsd/afs.rc.linux
diff -c openafs/src/afsd/afs.rc.linux:1.9.2.3 openafs/src/afsd/afs.rc.linux:1.9.2.4
*** openafs/src/afsd/afs.rc.linux:1.9.2.3	Sun Oct  2 23:14:31 2005
--- openafs/src/afsd/afs.rc.linux	Mon Jan 21 16:05:15 2008
***************
*** 58,64 ****
     echo
  }
  
! SYSCNF=/etc/sysconfig/afs
  KERNEL_VERSION=`uname -r`
  
  # Gather up options and post startup script name, if present
--- 58,64 ----
     echo
  }
  
! SYSCNF=${SYSCNF:-/etc/sysconfig/afs}
  KERNEL_VERSION=`uname -r`
  
  # Gather up options and post startup script name, if present
***************
*** 69,74 ****
--- 69,78 ----
  CACHEINFO=${CACHEINFO:-/usr/vice/etc/cacheinfo}
  CACHE=${CACHEDIR:-/usr/vice/cache}
  AFS=${AFSDIR:-/afs}
+ AFSD=${AFSD:-/usr/vice/etc/afsd}
+ BOSSERVER=${BOSSERVER:-/usr/afs/bin/bosserver}
+ BOS=${BOS:-/usr/bin/bos}
+ KILLAFS=${KILLAFS:-/usr/vice/etc/killafs}
  
  # is_on returns 1 if value of arg is "on"
  is_on() {
***************
*** 183,189 ****
  	esac
  }
  
! MODLOADDIR=/usr/vice/etc/modload
  # load_client loads the AFS client module if it's not already loaded. 
  load_client() {
  	# If LIBAFS is set, use it.
--- 187,193 ----
  	esac
  }
  
! MODLOADDIR=${MODLOADDIR:-/usr/vice/etc/modload}
  # load_client loads the AFS client module if it's not already loaded. 
  load_client() {
  	# If LIBAFS is set, use it.
***************
*** 279,291 ****
  
  	echo "Starting AFS services..... "
  	# Start bosserver, it if exists
! 	if  is_on $AFS_SERVER && test -x /usr/afs/bin/bosserver  ; then
! 		/usr/afs/bin/bosserver 
  		test "$afs_rh" && touch /var/lock/subsys/afs
  		if is_on $WAIT_FOR_SALVAGE; then
  			# wait for fileserver to finish salvaging
  			sleep 10
! 			while /usr/bin/bos status localhost fs 2>&1 | grep 'Auxiliary.*salvaging'; do
  				echo "Waiting for salvager to finish..... "
  				sleep 10
  			done
--- 283,295 ----
  
  	echo "Starting AFS services..... "
  	# Start bosserver, it if exists
! 	if  is_on $AFS_SERVER && test -x $BOSSERVER  ; then
! 		$BOSSERVER 
  		test "$afs_rh" && touch /var/lock/subsys/afs
  		if is_on $WAIT_FOR_SALVAGE; then
  			# wait for fileserver to finish salvaging
  			sleep 10
! 			while $BOS status localhost fs 2>&1 | grep 'Auxiliary.*salvaging'; do
  				echo "Waiting for salvager to finish..... "
  				sleep 10
  			done
***************
*** 293,302 ****
  	fi
  
  	# Start AFS client
! 	if  is_on $AFS_CLIENT && test -x /usr/vice/etc/afsd  ; then
  		generate_cacheinfo
  		choose_afsdoptions
! 		/usr/vice/etc/afsd ${AFSD_OPTIONS}
  		test "$afs_rh" && touch /var/lock/subsys/afs
  		$AFS_POST_INIT
  	fi
--- 297,306 ----
  	fi
  
  	# Start AFS client
! 	if  is_on $AFS_CLIENT && test -x $AFSD  ; then
  		generate_cacheinfo
  		choose_afsdoptions
! 		$AFSD ${AFSD_OPTIONS}
  		test "$afs_rh" && touch /var/lock/subsys/afs
  		$AFS_POST_INIT
  	fi
***************
*** 309,324 ****
  	echo "Stopping AFS services..... "
  
  	if  is_on $AFS_CLIENT  ; then
! 		if [ -x /usr/vice/etc/killafs ] ; then
! 			runcmd "Sending all processes using /afs the TERM signal ..." /usr/vice/etc/killafs TERM
! 			runcmd "Sending all processes using /afs the KILL signal ..." /usr/vice/etc/killafs KILL
  		fi
  		umount /afs
  	fi
  
! 	if  is_on $AFS_SERVER && test -x /usr/bin/bos ; then
  		echo "Stopping AFS bosserver"
! 		/usr/bin/bos shutdown localhost -localauth -wait
  		killall -HUP bosserver
  	fi
  
--- 313,328 ----
  	echo "Stopping AFS services..... "
  
  	if  is_on $AFS_CLIENT  ; then
! 		if [ -x $KILLAFS ] ; then
! 			runcmd "Sending all processes using /afs the TERM signal ..." $KILLAFS TERM
! 			runcmd "Sending all processes using /afs the KILL signal ..." $KILLAFS KILL
  		fi
  		umount /afs
  	fi
  
! 	if  is_on $AFS_SERVER && test -x $BOS ; then
  		echo "Stopping AFS bosserver"
! 		$BOS shutdown localhost -localauth -wait
  		killall -HUP bosserver
  	fi
  
Index: openafs/src/afsd/afsd.c
diff -c openafs/src/afsd/afsd.c:1.43.2.23 openafs/src/afsd/afsd.c:1.43.2.25
*** openafs/src/afsd/afsd.c:1.43.2.23	Tue Oct 23 10:31:29 2007
--- openafs/src/afsd/afsd.c	Wed Oct 31 18:32:17 2007
***************
*** 58,64 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/afsd/afsd.c,v 1.43.2.23 2007/10/23 14:31:29 shadow Exp $");
  
  #define VFS 1
  
--- 58,64 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/afsd/afsd.c,v 1.43.2.25 2007/10/31 22:32:17 shadow Exp $");
  
  #define VFS 1
  
***************
*** 1387,1394 ****
      return doSweepAFSCache(vFilesFound, cacheBaseDir, -2, maxDir);
  }
  
! static
! ConfigCell(struct afsconf_cell *aci, char *arock, struct afsconf_dir *adir)
  {
      int isHomeCell;
      int i, code;
--- 1387,1394 ----
      return doSweepAFSCache(vFilesFound, cacheBaseDir, -2, maxDir);
  }
  
! static int
! ConfigCell(struct afsconf_cell *aci, void *arock, struct afsconf_dir *adir)
  {
      int isHomeCell;
      int i, code;
***************
*** 1420,1426 ****
  
  static
  ConfigCellAlias(struct afsconf_cellalias *aca,
! 		char *arock, struct afsconf_dir *adir)
  {
      /* push the alias into the kernel */
      call_syscall(AFSOP_ADDCELLALIAS, aca->aliasName, aca->realName);
--- 1420,1426 ----
  
  static
  ConfigCellAlias(struct afsconf_cellalias *aca,
! 		void *arock, struct afsconf_dir *adir)
  {
      /* push the alias into the kernel */
      call_syscall(AFSOP_ADDCELLALIAS, aca->aliasName, aca->realName);
***************
*** 1513,1519 ****
  #endif
  #endif
  
! mainproc(struct cmd_syndesc *as, char *arock)
  {
      static char rn[] = "afsd";	/*Name of this routine */
      afs_int32 code;		/*Result of fork() */
--- 1513,1519 ----
  #endif
  #endif
  
! mainproc(struct cmd_syndesc *as, void *arock)
  {
      static char rn[] = "afsd";	/*Name of this routine */
      afs_int32 code;		/*Result of fork() */
Index: openafs/src/afsd/vsys.c
diff -c openafs/src/afsd/vsys.c:1.6 openafs/src/afsd/vsys.c:1.6.2.1
*** openafs/src/afsd/vsys.c:1.6	Tue Jul 15 19:14:31 2003
--- openafs/src/afsd/vsys.c	Tue Oct 30 11:23:45 2007
***************
*** 12,30 ****
  #include <stdio.h>
  #include <stdlib.h>
  #include <ctype.h>
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #ifdef HAVE_UNISTD_H
  #include <unistd.h>
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/afsd/vsys.c,v 1.6 2003/07/15 23:14:31 shadow Exp $");
  
  #include <afs/afs_args.h>
  
--- 12,24 ----
  #include <stdio.h>
  #include <stdlib.h>
  #include <ctype.h>
  #include <string.h>
  #ifdef HAVE_UNISTD_H
  #include <unistd.h>
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/afsd/vsys.c,v 1.6.2.1 2007/10/30 15:23:45 shadow Exp $");
  
  #include <afs/afs_args.h>
  
Index: openafs/src/afsmonitor/afsmon-output.c
diff -c openafs/src/afsmonitor/afsmon-output.c:1.9 openafs/src/afsmonitor/afsmon-output.c:1.9.2.1
*** openafs/src/afsmonitor/afsmon-output.c:1.9	Tue Jul 15 19:14:32 2003
--- openafs/src/afsmonitor/afsmon-output.c	Tue Oct 30 11:23:49 2007
***************
*** 19,35 ****
  #include <time.h>
  #include <afsconfig.h>
  #include <afs/param.h>
- 
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/afsmonitor/afsmon-output.c,v 1.9 2003/07/15 23:14:32 shadow Exp $");
  
  #include <afs/xstat_fs.h>
  #include <afs/xstat_cm.h>
--- 19,28 ----
  #include <time.h>
  #include <afsconfig.h>
  #include <afs/param.h>
  #include <string.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/afsmonitor/afsmon-output.c,v 1.9.2.1 2007/10/30 15:23:49 shadow Exp $");
  
  #include <afs/xstat_fs.h>
  #include <afs/xstat_cm.h>
Index: openafs/src/afsmonitor/afsmon-win.c
diff -c openafs/src/afsmonitor/afsmon-win.c:1.10 openafs/src/afsmonitor/afsmon-win.c:1.10.2.2
*** openafs/src/afsmonitor/afsmon-win.c:1.10	Tue Jul 15 19:14:32 2003
--- openafs/src/afsmonitor/afsmon-win.c	Mon Nov 26 16:21:48 2007
***************
*** 16,30 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/afsmonitor/afsmon-win.c,v 1.10 2003/07/15 23:14:32 shadow Exp $");
  
  #include <stdio.h>
  #include <signal.h>
  #include <math.h>
  #include <cmd.h>
- #ifdef HAVE_STRING_H
  #include <string.h>
- #endif
  #undef IN
  #include <time.h>
  
--- 16,28 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/afsmonitor/afsmon-win.c,v 1.10.2.2 2007/11/26 21:21:48 shadow Exp $");
  
  #include <stdio.h>
  #include <signal.h>
  #include <math.h>
  #include <cmd.h>
  #include <string.h>
  #undef IN
  #include <time.h>
  
***************
*** 567,572 ****
--- 565,571 ----
      }
  
      afsmon_Exit(0);
+     return 0; /* not reached */
  }
  
  
***************
*** 1581,1587 ****
  	    }
  	}
      }
! 
  }				/* display_Server_label */
  
  
--- 1580,1586 ----
  	    }
  	}
      }
!     return 0;
  }				/* display_Server_label */
  
  
Index: openafs/src/afsmonitor/afsmonitor.c
diff -c openafs/src/afsmonitor/afsmonitor.c:1.18.2.3 openafs/src/afsmonitor/afsmonitor.c:1.18.2.4
*** openafs/src/afsmonitor/afsmonitor.c:1.18.2.3	Thu Mar  9 01:41:34 2006
--- openafs/src/afsmonitor/afsmonitor.c	Wed Oct 31 00:13:32 2007
***************
*** 19,25 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/afsmonitor/afsmonitor.c,v 1.18.2.3 2006/03/09 06:41:34 shadow Exp $");
  
  #include <stdio.h>
  #include <math.h>
--- 19,25 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/afsmonitor/afsmonitor.c,v 1.18.2.4 2007/10/31 04:13:32 shadow Exp $");
  
  #include <stdio.h>
  #include <math.h>
***************
*** 3880,3887 ****
   *----------------------------------------------------------------------*/
  
  int
! afsmonInit(as)
!      struct cmd_syndesc *as;
  {				/* afsmonInit() */
  
      static char rn[] = "afsmonInit";	/* Routine name */
--- 3880,3886 ----
   *----------------------------------------------------------------------*/
  
  int
! afsmonInit(struct cmd_syndesc *as, void *arock)
  {				/* afsmonInit() */
  
      static char rn[] = "afsmonInit";	/* Routine name */
***************
*** 4185,4191 ****
      /*
       * Set up the commands we understand.
       */
!     ts = cmd_CreateSyntax("initcmd", afsmonInit, 0, "initialize the program");
      cmd_AddParm(ts, "-config", CMD_SINGLE, CMD_OPTIONAL,
  		"configuration file");
      cmd_AddParm(ts, "-frequency", CMD_SINGLE, CMD_OPTIONAL,
--- 4184,4190 ----
      /*
       * Set up the commands we understand.
       */
!     ts = cmd_CreateSyntax("initcmd", afsmonInit, NULL, "initialize the program");
      cmd_AddParm(ts, "-config", CMD_SINGLE, CMD_OPTIONAL,
  		"configuration file");
      cmd_AddParm(ts, "-frequency", CMD_SINGLE, CMD_OPTIONAL,
Index: openafs/src/afsweb/weblog.c
diff -c openafs/src/afsweb/weblog.c:1.8.2.1 openafs/src/afsweb/weblog.c:1.8.2.2
*** openafs/src/afsweb/weblog.c:1.8.2.1	Mon Jul 31 13:07:47 2006
--- openafs/src/afsweb/weblog.c	Wed Oct 31 00:13:33 2007
***************
*** 25,31 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/afsweb/weblog.c,v 1.8.2.1 2006/07/31 17:07:47 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 25,31 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/afsweb/weblog.c,v 1.8.2.2 2007/10/31 04:13:33 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 123,129 ****
      zero_argc = argc;
      zero_argv = argv;
  
!     ts = cmd_CreateSyntax(NULL, CommandProc, 0,
  			  "obtain Kerberos authentication for web servers");
  
  /* define the command line arguments */
--- 123,129 ----
      zero_argc = argc;
      zero_argv = argv;
  
!     ts = cmd_CreateSyntax(NULL, CommandProc, NULL,
  			  "obtain Kerberos authentication for web servers");
  
  /* define the command line arguments */
***************
*** 803,812 ****
   * arrive through a pipe from the httpds, authenticates the user and
   * returns a token (or a failure message) over the pipe
   */
! CommandProc(as, arock)
!      char *arock;
!      struct cmd_syndesc *as;
! 
  {
      char name[MAXKTCNAMELEN];
      char cell[MAXKTCREALMLEN];
--- 803,810 ----
   * arrive through a pipe from the httpds, authenticates the user and
   * returns a token (or a failure message) over the pipe
   */
! static int
! CommandProc(struct cmd_syndesc *as, void *arock)
  {
      char name[MAXKTCNAMELEN];
      char cell[MAXKTCREALMLEN];
Index: openafs/src/aklog/.cvsignore
diff -c /dev/null openafs/src/aklog/.cvsignore:1.2.2.2
*** /dev/null	Mon Apr 28 17:55:43 2008
--- openafs/src/aklog/.cvsignore	Tue Mar 18 12:11:50 2008
***************
*** 0 ****
--- 1,4 ----
+ Makefile
+ aklog
+ asetkey
+ klog
Index: openafs/src/aklog/Makefile.in
diff -c openafs/src/aklog/Makefile.in:1.1.2.9 openafs/src/aklog/Makefile.in:1.1.2.10
*** openafs/src/aklog/Makefile.in:1.1.2.9	Tue Apr 10 14:43:40 2007
--- openafs/src/aklog/Makefile.in	Thu Nov  1 12:51:58 2007
***************
*** 16,22 ****
  SRCS=	aklog.c aklog_main.c  krb_util.c linked_list.c
  OBJS=   aklog.o aklog_main.o krb_util.o linked_list.o
  
! all: aklog asetkey
  
  aklog:	${OBJS} ${AFSLIBS}
  	${CC} -o $@ ${CFLAGS} ${OBJS} ${AKLIBS} ${AFSLIBS} ${XLIBS}
--- 16,22 ----
  SRCS=	aklog.c aklog_main.c  krb_util.c linked_list.c
  OBJS=   aklog.o aklog_main.o krb_util.o linked_list.o
  
! all: aklog asetkey klog
  
  aklog:	${OBJS} ${AFSLIBS}
  	${CC} -o $@ ${CFLAGS} ${OBJS} ${AKLIBS} ${AFSLIBS} ${XLIBS}
***************
*** 24,29 ****
--- 24,33 ----
  asetkey: asetkey.o ${AFSLIBS}
  	${CC} -o $@ ${CFLAGS} asetkey.o ${AKLIBS} ${AFSLIBS} ${XLIBS}
  
+ klog: klog.o skipwrap.o ${AFSLIBS}
+ 	${CC} -o $@ ${CFLAGS} skipwrap.o klog.o ${AKLIBS} ${AFSLIBS} \
+ 		${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/librx.a ${XLIBS}
+ 
  #
  # Installation targets
  #
***************
*** 49,55 ****
  # Misc. targets
  #
  clean:
! 	$(RM) -f *.o ${OBJS} aklog asetkey
  
  include ../config/Makefile.version
  
--- 53,59 ----
  # Misc. targets
  #
  clean:
! 	$(RM) -f *.o ${OBJS} aklog asetkey klog
  
  include ../config/Makefile.version
  
Index: openafs/src/aklog/aklog.c
diff -c openafs/src/aklog/aklog.c:1.1.2.5 openafs/src/aklog/aklog.c:1.1.2.6
*** openafs/src/aklog/aklog.c:1.1.2.5	Fri Jul 15 12:11:24 2005
--- openafs/src/aklog/aklog.c	Tue Apr  1 13:44:52 2008
***************
*** 1,19 ****
  /* 
!  * $Id: aklog.c,v 1.1.2.5 2005/07/15 16:11:24 rra Exp $
   *
   * Copyright 1990,1991 by the Massachusetts Institute of Technology
   * For distribution and copying rights, see the file "mit-copyright.h"
   */
  
  #if !defined(lint) && !defined(SABER)
! static char *rcsid = "$Id: aklog.c,v 1.1.2.5 2005/07/15 16:11:24 rra Exp $";
  #endif /* lint || SABER */
  
  #include <afs/stds.h>
  #include "aklog.h"
  
- #ifndef WINDOWS
- 
  int
  main(int argc, char *argv[])
  {
--- 1,17 ----
  /* 
!  * $Id: aklog.c,v 1.1.2.6 2008/04/01 17:44:52 shadow Exp $
   *
   * Copyright 1990,1991 by the Massachusetts Institute of Technology
   * For distribution and copying rights, see the file "mit-copyright.h"
   */
  
  #if !defined(lint) && !defined(SABER)
! static char *rcsid = "$Id: aklog.c,v 1.1.2.6 2008/04/01 17:44:52 shadow Exp $";
  #endif /* lint || SABER */
  
  #include <afs/stds.h>
  #include "aklog.h"
  
  int
  main(int argc, char *argv[])
  {
***************
*** 21,107 ****
      exit(0);
  }
  
- #else /* WINDOWS */
- 
- #include <windows.h>
- #include <windowsx.h>
- 
- static void parse_cmdline();
- 
- 
- int PASCAL
- WinMain(HINSTANCE hinst, HINSTANCE hprevinstance, LPSTR cmdline, int noshow)
- {
- 	int argc = 0;
- 	char **argv;
- 
-     aklog_params params;
- 
- 	parse_cmdline(cmdline, &argv, &argc);
- 
-     aklog(argc, argv, &params);
- 
- 	return 0;
- }
- 
- /*
-  * Generate agrv/argc here from command line.
-  * Note that windows doesn't pass us the executible name, so
-  * we need to fill that in manually.
-  */
- 
- static void
- parse_cmdline(char *cmdline, char ***pargv, int *pargc)
- {
- 	char **argv;
- 	int argc = 0;
- 	char *arg, *sep = " \t";
- 	int argv_size = 10;		/* to start with */
- 
- 
- 	argv = malloc(argv_size * sizeof(char *));
- 
- 	if (!argv) {
- 		MessageBox(NULL, "Fatal Error: Out of memory", AKLOG_DIALOG_NAME, 
- 				   MB_OK | MB_ICONSTOP);
- 		exit(1);
- 	}
- 
- 	argv[argc++] = "aklog";
- 
- 	arg = strtok(cmdline, sep);
- 
- 	while(arg) {
- 		argv[argc] = strdup(arg);
- 
- 		if (!argv[argc]) {
- 			MessageBox(NULL, "Fatal Error: Out of memory", AKLOG_DIALOG_NAME, 
- 					   MB_OK | MB_ICONSTOP);
- 			exit(1);
- 		}
- 
- 		argc++;
- 
- 		if (argc == argv_size) {
- 			argv_size += 10;
- 			argv = realloc(argv, argv_size * sizeof(char *));
- 
- 			if (!argv) {
- 				MessageBox(NULL, "Fatal Error: Out of memory",
- 						   AKLOG_DIALOG_NAME, 
- 						   MB_OK | MB_ICONSTOP);
- 				exit(1);
- 			}
- 		}
- 
- 		arg = strtok(NULL, sep);
- 	}
- 
- 	argv[argc] = NULL;
- 
- 	*pargv = argv;
- 	*pargc = argc;
- }
- 
- #endif /* WINDOWS */
- 
--- 19,21 ----
Index: openafs/src/aklog/aklog.h
diff -c openafs/src/aklog/aklog.h:1.1.2.6 openafs/src/aklog/aklog.h:1.1.2.7
*** openafs/src/aklog/aklog.h:1.1.2.6	Wed Jul 11 00:32:27 2007
--- openafs/src/aklog/aklog.h	Tue Apr  1 13:44:52 2008
***************
*** 1,5 ****
  /* 
!  * $Id: aklog.h,v 1.1.2.6 2007/07/11 04:32:27 shadow Exp $
   *
   * Copyright 1990,1991 by the Massachusetts Institute of Technology
   * For distribution and copying rights, see the file "mit-copyright.h"
--- 1,5 ----
  /* 
!  * $Id: aklog.h,v 1.1.2.7 2008/04/01 17:44:52 shadow Exp $
   *
   * Copyright 1990,1991 by the Massachusetts Institute of Technology
   * For distribution and copying rights, see the file "mit-copyright.h"
***************
*** 8,17 ****
  #ifndef __AKLOG_H__
  #define __AKLOG_H__
  
- #if !defined(lint) && !defined(SABER)
- static char *rcsid_aklog_h = "$Id: aklog.h,v 1.1.2.6 2007/07/11 04:32:27 shadow Exp $";
- #endif /* lint || SABER */
- 
  #include <krb5.h>
  #include "linked_list.h"
  #include <afsconfig.h>
--- 8,13 ----
Index: openafs/src/aklog/aklog_main.c
diff -c openafs/src/aklog/aklog_main.c:1.1.2.20 openafs/src/aklog/aklog_main.c:1.1.2.26
*** openafs/src/aklog/aklog_main.c:1.1.2.20	Wed Oct 10 13:47:58 2007
--- openafs/src/aklog/aklog_main.c	Tue Apr  1 14:15:53 2008
***************
*** 1,5 ****
  /* 
!  * $Id: aklog_main.c,v 1.1.2.20 2007/10/10 17:47:58 shadow Exp $
   *
   * Copyright 1990,1991 by the Massachusetts Institute of Technology
   * For distribution and copying rights, see the file "mit-copyright.h"
--- 1,5 ----
  /* 
!  * $Id: aklog_main.c,v 1.1.2.26 2008/04/01 18:15:53 shadow Exp $
   *
   * Copyright 1990,1991 by the Massachusetts Institute of Technology
   * For distribution and copying rights, see the file "mit-copyright.h"
***************
*** 34,45 ****
   * such damages.                                                
   */
  
- #if !defined(lint) && !defined(SABER)
- static char *rcsid =
- 	"$Id: aklog_main.c,v 1.1.2.20 2007/10/10 17:47:58 shadow Exp $";
- #endif /* lint || SABER */
- 
  #include <afsconfig.h>
  #include <stdio.h>
  #include <string.h>
  #include <ctype.h>
--- 34,42 ----
   * such damages.                                                
   */
  
  #include <afsconfig.h>
+ RCSID
+      ("$Header: /cvs/openafs/src/aklog/aklog_main.c,v 1.1.2.26 2008/04/01 18:15:53 shadow Exp $");
  #include <stdio.h>
  #include <string.h>
  #include <ctype.h>
***************
*** 58,64 ****
  #include <sys/stat.h>
  #include <fcntl.h>
  
- #ifndef WINDOWS
  #include <sys/param.h>
  #include <sys/errno.h>
  #include <netdb.h>
--- 55,60 ----
***************
*** 66,83 ****
  #include <netinet/in.h>
  #include <arpa/inet.h>
  #include <pwd.h>
- #endif /* WINDOWS */
  
  #include <afs/stds.h>
  #include <krb5.h>
  
- #ifdef WINDOWS
- 
- #include <afs/auth.h>
- #include <rx/rxkad.h>
- #include <afs/dirpath.h>
- 
- #else /* !WINDOWS */
  #ifndef HAVE_KERBEROSV_HEIM_ERR_H
  #include <afs/com_err.h>
  #endif
--- 62,71 ----
***************
*** 93,99 ****
  #include <afs/ptserver.h>
  #include <afs/ptuser.h>
  #include <afs/dirpath.h>
- #endif /* WINDOWS */
  
  #include "aklog.h"
  #include "linked_list.h"
--- 81,86 ----
***************
*** 112,117 ****
--- 99,105 ----
  #define AFS_TRY_FULL_PRINC 1
  #endif /* AFS_TRY_FULL_PRINC */
  
+ #define AKLOG_TRYAGAIN -1
  #define AKLOG_SUCCESS 0
  #define AKLOG_USAGE 1
  #define AKLOG_SOMETHINGSWRONG 2
***************
*** 153,168 ****
  static char linkedcell2[MAXCELLCHARS+1];
  static krb5_ccache  _krb425_ccache = NULL;
  
- #ifdef WINDOWS
- 
- /* libafsconf.dll */
- extern long cm_GetRootCellName();
- extern long cm_SearchCellFile();
- 
- static long cm_SearchCellFile_CallBack();
- 
- #else /* !WINDOWS */
- 
  /*
   * Why doesn't AFS provide these prototypes?
   */
--- 141,146 ----
***************
*** 179,184 ****
--- 157,166 ----
  				  char *, krb5_creds **);
  static int get_user_realm(krb5_context, char *);
  
+ #define TRYAGAIN(x) (x == AKLOG_TRYAGAIN || \
+ 		     x == KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN || \
+ 		     x == KRB5KRB_ERR_GENERIC)
+ 
  #if defined(HAVE_KRB5_PRINC_SIZE) || defined(krb5_princ_size)
  
  #define get_princ_str(c, p, n) krb5_princ_component(c, p, n)->data
***************
*** 199,205 ****
  #error "Must have either krb5_princ_size or krb5_principal_get_comp_string"
  #endif
  
! #if !defined(HAVE_KRB5_ENCRYPT_TKT_PART) && defined(HAVE_ENCODE_KRB5_ENC_TKT_PART)
  krb5_error_code
  krb5_encrypt_tkt_part(krb5_context context,
  		      const krb5_keyblock *key,
--- 181,187 ----
  #error "Must have either krb5_princ_size or krb5_principal_get_comp_string"
  #endif
  
! #if !defined(HAVE_KRB5_ENCRYPT_TKT_PART) && defined(HAVE_ENCODE_KRB5_ENC_TKT_PART) && defined(HAVE_KRB5_C_ENCRYPT) 
  krb5_error_code
  krb5_encrypt_tkt_part(krb5_context context,
  		      const krb5_keyblock *key,
***************
*** 300,306 ****
  
  #define deref_entry_enctype(entry)			\
      deref_keyblock_enctype(&deref_entry_keyblock(entry))
- #endif /* WINDOWS */
  
  /*
   * Provide a replacement for strerror if we don't have it
--- 282,287 ----
***************
*** 343,348 ****
--- 324,340 ----
  }
  
  
+ static char *copy_string(char *string)    
+ {
+     char *new_string;
+ 
+     if ((new_string = (char *)calloc(strlen(string) + 1, sizeof(char))))
+ 	(void) strcpy(new_string, string);
+ 
+     return (new_string);
+ }
+ 
+ 
  static int get_cellconfig(char *cell, struct afsconf_cell *cellconfig, char *local_cell, char *linkedcell)
  {
      int status = AKLOG_SUCCESS;
***************
*** 351,358 ****
      memset(local_cell, 0, sizeof(local_cell));
      memset((char *)cellconfig, 0, sizeof(*cellconfig));
  
- #ifndef WINDOWS
- 
      if (!(configdir = afsconf_Open(AFSDIR_CLIENT_ETC_DIRPATH))) {
  	fprintf(stderr, 
  		"%s: can't get afs configuration (afsconf_Open(%s))\n",
--- 343,348 ----
***************
*** 379,479 ****
  
      (void) afsconf_Close(configdir);
  
- #else /* WINDOWS */
-     /*
-      * We'll try to mimic the GetCellInfo call here and fill in as much
-      * of the afsconf_cell structure as we can.
-      */
-     if (cm_GetRootCellName(local_cell)) {
- 	fprintf(stderr, "%s: can't get local cellname\n", progname);
- 	exit(AKLOG_AFS);
-     }
- 
-     if ((cell == NULL) || (cell[0] == 0))
- 	cell = local_cell;
- 
-     strcpy(cellconfig->name, cell);
- 
-     /* No way of figuring this out as far as I can tell */
-     linkedcell[0] = '\0';
- 
-     /* Initialize server info */
-     cellconfig->numServers = 0;
-     cellconfig->hostName[0][0] = "\0";
- 
-     /*
-      * Get servers of cell. cm_SearchCellFile_CallBack() gets call with
-      * each server.
-      */
-     status = (int) cm_SearchCellFile(cell, NULL, &cm_SearchCellFile_CallBack,
- 				     cellconfig /* rock */);
- 
-     switch(status) {
-     case 0:
- 	break;
- 
-     case -1:
- 	fprintf(stderr, "%s: GetWindowsDirectory() failed.\n", progname);
- 	break;
- 
-     case -2:
- 	fprintf(stderr, "%s: Couldn't open afsdcells.ini for reading\n",
- 		progname);
- 	break;
- 
-     case -3:
- 	fprintf(stderr, "%s: Couldn't find any servers for cell %s\n",
- 		progname, cell);
- 	break;
- 
-     case -4:
- 	fprintf(stderr, "%s: Badly formatted line in afsdcells.ini (does not begin with a \">\" or contain \"#\"\n",
- 		progname);
- 	break;
- 
-     default:
- 	fprintf(stderr, "%s cm_SearchCellFile returned unknown error %d\n",
- 		status);
-     }
- 
-     if (status) {
- 	exit(AKLOG_AFS);
-     }
- 
-     status = AKLOG_SUCCESS;
- 
-     
- #endif /* WINDOWS */
- 
      return(status);
  }
  
- 
- #ifdef WINDOWS
- /*
-  * Callback function for cm_SearchCellFile() in get_cellconfig() above.
-  * This function gets called once for each server that is found for the cell.
-  */
- static long
- cm_SearchCellFile_CallBack(void *rock /* cellconfig */,
- 			   struct sockaddr_in *addr, /* Not used */
- 			   char *server)
- {
-     struct afsconf_cell *cellconfig = rock;
- 
- 
-     /*
-      * Save server name and increment count of servers
-      */
-     strcpy(cellconfig->hostName[cellconfig->numServers++], server);
-     
-     return (long) 0;
- }
- 
-     
- #endif /* WINDOWS */
- 
- 
  /* 
   * Log to a cell.  If the cell has already been logged to, return without
   * doing anything.  Otherwise, log to it and mark that it has been logged
--- 369,377 ----
***************
*** 485,523 ****
      char username[BUFSIZ];	/* To hold client username structure */
      afs_int32 viceId;		/* AFS uid of user */
  
-     char name[ANAME_SZ];	/* Name of afs key */
-     char primary_instance[INST_SZ];	/* Instance of afs key */
-     char secondary_instance[INST_SZ];	/* Backup instance to try */
-     int try_secondary = 0;		/* Flag to indicate if we try second */
      char realm_of_user[REALM_SZ]; /* Kerberos realm of user */
!     char realm_of_cell[REALM_SZ]; /* Kerberos realm of cell */
      char local_cell[MAXCELLCHARS+1];
      char cell_to_use[MAXCELLCHARS+1]; /* Cell to authenticate to */
      static char lastcell[MAXCELLCHARS+1] = { 0 };
- #ifndef WINDOWS
      static char confname[512] = { 0 };
- #endif
      krb5_creds *v5cred = NULL;
      struct ktc_principal aserver;
      struct ktc_principal aclient;
      struct ktc_token atoken, btoken;
  
- #ifdef ALLOW_REGISTER
-     afs_int32 id;
- #endif /* ALLOW_REGISTER */
- 
-     memset(name, 0, sizeof(name));
-     memset(primary_instance, 0, sizeof(primary_instance));
-     memset(secondary_instance, 0, sizeof(secondary_instance));
      memset(realm_of_user, 0, sizeof(realm_of_user));
-     memset(realm_of_cell, 0, sizeof(realm_of_cell));
  
- #ifndef WINDOWS
      if (confname[0] == '\0') {
  	strncpy(confname, AFSDIR_CLIENT_ETC_DIRPATH, sizeof(confname));
  	confname[sizeof(confname) - 2] = '\0';
      }
- #endif /* WINDOWS */
  
      /* NULL or empty cell returns information on local cell */
      if ((status = get_cellconfig(cell, &ak_cellconfig,
--- 383,408 ----
      char username[BUFSIZ];	/* To hold client username structure */
      afs_int32 viceId;		/* AFS uid of user */
  
      char realm_of_user[REALM_SZ]; /* Kerberos realm of user */
!     char *realm_from_princ = 0 ;  /* Calculated realm data */
!     char *realm_of_cell = 0;	  /* Pointer to realm we're using */	
!     int retry;			  /* round, and round we go ... */
!     
      char local_cell[MAXCELLCHARS+1];
      char cell_to_use[MAXCELLCHARS+1]; /* Cell to authenticate to */
      static char lastcell[MAXCELLCHARS+1] = { 0 };
      static char confname[512] = { 0 };
      krb5_creds *v5cred = NULL;
      struct ktc_principal aserver;
      struct ktc_principal aclient;
      struct ktc_token atoken, btoken;
  
      memset(realm_of_user, 0, sizeof(realm_of_user));
  
      if (confname[0] == '\0') {
  	strncpy(confname, AFSDIR_CLIENT_ETC_DIRPATH, sizeof(confname));
  	confname[sizeof(confname) - 2] = '\0';
      }
  
      /* NULL or empty cell returns information on local cell */
      if ((status = get_cellconfig(cell, &ak_cellconfig,
***************
*** 568,718 ****
  		   cell_to_use, ak_cellconfig.hostName[0]);
  	}
  
! 	/*
! 	 * Find out which realm we're supposed to authenticate to.  If one
! 	 * is not included, use the kerberos realm found in the credentials
! 	 * cache.
! 	 */
! 
! 	if (realm && realm[0]) {
! 	    strcpy(realm_of_cell, realm);
! 	    if (dflag) {
! 		printf("We were told to authenticate to realm %s.\n", realm);
! 	    }
! 	}
! 	else {
! 	    char *afs_realm = afs_realm_of_cell(context, &ak_cellconfig, FALSE);
! 
! 	    if (!afs_realm) {
! 		fprintf(stderr, 
! 			"%s: Couldn't figure out realm for cell %s.\n",
! 			progname, cell_to_use);
! 		exit(AKLOG_MISC);
! 	    }
! 
! 	    strcpy(realm_of_cell, afs_realm);
! 
! 	    if (dflag) {
! 		if (realm_of_cell[0])
! 		    printf("We've deduced that we need to authenticate to"
! 			   " realm %s.\n", realm_of_cell);
! 		else
! 		    printf("We've deduced that we need to authenticate "
! 			   "using referrals.\n");
! 	    }
! 	}
! 
! 	/* We use the afs.<cellname> convention here... 
! 	 *
! 	 * Doug Engert's original code had principals of the form:
! 	 *
! 	 * "afsx/cell@realm"
! 	 *
! 	 * in the KDC, so the name wouldn't conflict with DFS.  Since we're
! 	 * not using DFS, I changed it just to look for the following
! 	 * principals:
! 	 *
! 	 * afs/<cell>@<realm>
! 	 * afs@<realm>
! 	 *
! 	 * Because people are transitioning from afs@realm to afs/cell,
! 	 * we configure things so that if the first one isn't found, we
! 	 * try the second one.  You can select which one you prefer with
! 	 * a configure option.
! 	 */
! 
! 	strcpy(name, AFSKEY);
! 
! 	if (AFS_TRY_FULL_PRINC || strcasecmp(cell_to_use, realm_of_cell) != 0) {
! 	    strncpy(primary_instance, cell_to_use, sizeof(primary_instance));
! 	    primary_instance[sizeof(primary_instance)-1] = '\0';
! 	    if (strcasecmp(cell_to_use, realm_of_cell) == 0) {
! 		try_secondary = 1;
! 		secondary_instance[0] = '\0';
! 	    }
! 	} else {
! 	    primary_instance[0] = '\0';
! 	    try_secondary = 1;
! 	    strncpy(secondary_instance, cell_to_use,
! 		    sizeof(secondary_instance));
! 	    secondary_instance[sizeof(secondary_instance)-1] = '\0';
  	}
  
! 	/* 
! 	 * Extract the session key from the ticket file and hand-frob an
! 	 * afs style authenticator.
! 	 */
! 
! 	/*
! 	 * Try to obtain AFS tickets.  Because there are two valid service
! 	 * names, we will try both, but trying the more specific first.
! 	 *
! 	 *	afs/<cell>@<realm> i.e. allow for single name with "."
! 	 * 	afs@<realm>
! 	 */
! 
! 	if (dflag) {
! 	    printf("Getting tickets: %s%s%s@%s\n", name,
! 		   primary_instance[0] ? "/" : "", 
! 		   primary_instance, realm_of_cell);
! 	}
! 
! 	status = get_credv5(context, name, primary_instance, realm_of_cell,
! 			    &v5cred);
! 
! 	if ((status == KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN || status == KRB5KRB_ERR_GENERIC) &&
! 	    !realm_of_cell[0]) {
! 	    char *afs_realm = afs_realm_of_cell(context, &ak_cellconfig, TRUE);
! 
! 	    if (!afs_realm) {
! 		fprintf(stderr, 
! 			"%s: Couldn't figure out realm for cell %s.\n",
! 			progname, cell_to_use);
! 		exit(AKLOG_MISC);
! 	    }
! 
! 	    strcpy(realm_of_cell, afs_realm);
! 
! 	    if (strcasecmp(cell_to_use, realm_of_cell) == 0) {
! 		try_secondary = 1;
! 		secondary_instance[0] = '\0';
! 	    }
! 
! 	    if (dflag) {
! 		printf("We've deduced that we need to authenticate to"
! 			" realm %s.\n", realm_of_cell);
! 		printf("Getting tickets: %s%s%s@%s\n", name,
! 			primary_instance[0] ? "/" : "", 
! 			primary_instance, realm_of_cell);
! 	    }
! 
! 	    status = get_credv5(context, name, primary_instance, realm_of_cell,
! 				 &v5cred);
! 
! 	}
! 	if (status == KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN || status == KRB5KRB_ERR_GENERIC) {
! 	    if (try_secondary) {
  		if (dflag) {
! 		    printf("Principal not found, trying alternate "
! 			   "service name: %s%s%s@%s\n", name,
! 			    secondary_instance[0] ? "/" : "",
! 			    secondary_instance, realm_of_cell);
  		}
! 		status = get_credv5(context, name, secondary_instance,
  				    realm_of_cell, &v5cred);
  	    }
! 	}
  
! 	if (status) {
  	    if (dflag) {
! 		printf("Kerberos error code returned by get_cred: %d\n",
! 			status);
  	    }
  	    fprintf(stderr, "%s: Couldn't get %s AFS tickets:\n",
  		    progname, cell_to_use);
! 		afs_com_err(progname, status, "while getting AFS tickets");
  	    return(AKLOG_KERBEROS);
  	}
  
  	strncpy(aserver.name, AFSKEY, MAXKTCNAMELEN - 1);
  	strncpy(aserver.instance, AFSINST, MAXKTCNAMELEN - 1);
--- 453,607 ----
  		   cell_to_use, ak_cellconfig.hostName[0]);
  	}
  
! 	if ((status = get_user_realm(context, realm_of_user))) {
! 	    fprintf(stderr, "%s: Couldn't determine realm of user:)",
! 		    progname);
! 	    afs_com_err(progname, status, " while getting realm");
! 	    return(AKLOG_KERBEROS);
  	}
  
! 	retry = 1;
! 	
! 	while(retry) {
! 	    
! 	    /* Cell on command line - use that one */
! 	    if (realm && realm[0]) {
! 		realm_of_cell = realm;
! 		status = AKLOG_TRYAGAIN;
! 		if (dflag) {
! 		    printf("We were told to authenticate to realm %s.\n", 
! 			   realm);
! 		}
! 	    } else {
! 		/* Initially, try using afs/cell@USERREALM */
  		if (dflag) {
! 		    printf("Trying to authenticate to user's realm %s.\n",
! 			   realm_of_user);
  		}
! 		
! 		realm_of_cell = realm_of_user;
! 		status = get_credv5(context, AFSKEY, cell_to_use, 
  				    realm_of_cell, &v5cred);
+ 	    
+ 		/* If that failed, try to determine the realm from the name of 
+ 		 * one of the DB servers */
+ 		if (TRYAGAIN(status)) {
+ 		    realm_of_cell = afs_realm_of_cell(context, &ak_cellconfig, 
+ 				    		      FALSE);
+ 		    if (!realm_of_cell) {
+ 			fprintf(stderr, 
+ 				"%s: Couldn't figure out realm for cell %s.\n",
+ 				progname, cell_to_use);
+ 		    	exit(AKLOG_MISC);
+ 	    	    }
+ 
+ 		    if (dflag) {
+ 			if (realm_of_cell[0])
+ 			    printf("We've deduced that we need to authenticate"
+ 				   " to realm %s.\n", realm_of_cell);
+ 		    else
+ 			printf("We've deduced that we need to authenticate "
+ 			       "using referrals.\n");
+ 		    }
+ 		}
  	    }
! 	
! 	    if (TRYAGAIN(status)) {
! 		/* If we've got the full-princ-first option, or we're in a
! 		 * different realm from the cell - use the cell name as the
! 		 * instance */
! 		if (AFS_TRY_FULL_PRINC || 
! 		    strcasecmp(cell_to_use, realm_of_cell)!=0) {
! 		    status = get_credv5(context, AFSKEY, cell_to_use, 
! 				        realm_of_cell, &v5cred);
! 
! 		    /* If we failed & we've got an empty realm, then try 
! 		     * calling afs_realm_for_cell again. */
! 		    if (TRYAGAIN(status) && !realm_of_cell[0]) {
! 			/* This time, get the realm by taking the domain 
! 			 * component of the db server and make it upper case */
! 		    	realm_of_cell = afs_realm_of_cell(context, 
! 							  &ak_cellconfig, TRUE);
! 			if (!realm_of_cell) {
! 			    fprintf(stderr,
! 				    "%s: Couldn't figure out realm for cell "
! 				    "%s.\n", progname, cell_to_use);
! 			    exit(AKLOG_MISC);
! 			}
! 			printf("We've deduced that we need to authenticate to"
! 			       " realm %s.\n", realm_of_cell);
! 		    }
! 		    status = get_credv5(context, AFSKEY, cell_to_use, 
! 				        realm_of_cell, &v5cred);
! 	    	}
! 	   
! 		/* If the realm and cell name match, then try without an 
! 		 * instance, but only if realm is non-empty */
! 	        
! 		if (TRYAGAIN(status) && 
! 		    strcasecmp(cell_to_use, realm_of_cell) == 0) {
! 		    status = get_credv5(context, AFSKEY, NULL, 
! 				        realm_of_cell, &v5cred);
!     		    if (!AFS_TRY_FULL_PRINC && TRYAGAIN(status)) {
! 		        status = get_credv5(context, AFSKEY, cell_to_use,
! 				            realm_of_cell, &v5cred);
! 		    }
! 		}
! 	    }
! 
! 	    /* Try to find a service principal for this cell.
! 	     * Some broken MIT libraries return KRB5KRB_AP_ERR_MSG_TYPE upon 
! 	     * the first attempt, so we try twice to be sure */
  
! 	    if (status == KRB5KRB_AP_ERR_MSG_TYPE && retry == 1)
! 		retry++;
! 	    else
! 		retry = 0;
! 	} 
! 	
! 	if (status != 0) {
  	    if (dflag) {
! 		printf("Kerberos error code returned by get_cred : %d\n",
! 		       status);
  	    }
  	    fprintf(stderr, "%s: Couldn't get %s AFS tickets:\n",
  		    progname, cell_to_use);
! 	    afs_com_err(progname, status, "while getting AFS tickets");
  	    return(AKLOG_KERBEROS);
  	}
+ 	
+ 	/* If we've got a valid ticket, and we still don't know the realm name
+ 	 * try to figure it out from the contents of the ticket
+ 	 */
+ #if !defined(USING_HEIMDAL) && defined(HAVE_KRB5_DECODE_TICKET)
+ 	if (strcmp(realm_of_cell, "") == 0) {
+ 	    krb5_error_code code;
+ 	    krb5_ticket *ticket;
+ 
+ 	    code = krb5_decode_ticket(&v5cred->ticket, &ticket);
+ 
+ 	    if (code != 0) {
+ 		fprintf(stderr,
+ 			"%s: Couldn't decode ticket to determine realm for "
+ 			"cell %s.\n",
+ 		    	progname, cell_to_use);
+ 	    } else {
+ 		int len = realm_len(context, ticket->server);
+ 		/* This really shouldn't happen. */
+ 		if (len > REALM_SZ-1)
+ 		    len = REALM_SZ-1;
+ 
+ 		realm_from_princ = (char *) malloc(sizeof(char) * (len+1));
+ 		
+ 		strncpy(realm_from_princ, realm_data(context, ticket->server), 
+ 			len);
+ 		realm_from_princ[len] = 0;
+ 		realm_of_cell = realm_from_princ;
+ 		
+ 		krb5_free_ticket(context, ticket);
+ 	    }
+ 	}
+ #endif
  
  	strncpy(aserver.name, AFSKEY, MAXKTCNAMELEN - 1);
  	strncpy(aserver.instance, AFSINST, MAXKTCNAMELEN - 1);
***************
*** 809,830 ****
  	noprdb = 1;
  #endif
  
- #ifndef WINDOWS
  	if (noprdb) {
- #endif
  	    if (dflag) {
  		printf("Not resolving name %s to id (-noprdb set)\n",
  			username);
  	    }
- #ifndef WINDOWS
  	}
  	else {
- 	    if ((status = get_user_realm(context, realm_of_user))) {
- 		fprintf(stderr, "%s: Couldn't determine realm of user:)",
- 			progname);
- 		afs_com_err(progname, status, " while getting realm");
- 		return(AKLOG_KERBEROS);
- 	    }
  	    if (strcmp(realm_of_user, realm_of_cell)) {
  		strcat(username, "@");
  		strcat(username, realm_of_user);
--- 698,710 ----
***************
*** 863,881 ****
  		 */
  
  #ifdef ALLOW_REGISTER
! 	if (status == 0) {
! 	    if (viceId != ANONYMOUSID) {
! #else /* ALLOW_REGISTER */
! 	    if ((status == 0) && (viceId != ANONYMOUSID))
! #endif /* ALLOW_REGISTER */
! 		sprintf (username, "AFS ID %d", (int) viceId);
! #ifdef ALLOW_REGISTER
! 	    } else if (strcmp(realm_of_user, realm_of_cell) != 0) {
  		if (dflag) {
  		    printf("doing first-time registration of %s "
  			    "at %s\n", username, cell_to_use);
  		}
! 		id = 0;
  		strncpy(aclient.name, username, MAXKTCNAMELEN - 1);
  		strcpy(aclient.instance, "");
  		strncpy(aclient.cell, realm_of_user, MAXKTCREALMLEN - 1);
--- 743,755 ----
  		 */
  
  #ifdef ALLOW_REGISTER
! 	    if ((status == 0) && (viceId == ANONYMOUSID) &&
! 	 	(strcmp(realm_of_user, realm_of_cell) != 0)) {
  		if (dflag) {
  		    printf("doing first-time registration of %s "
  			    "at %s\n", username, cell_to_use);
  		}
! 		viceId = 0;
  		strncpy(aclient.name, username, MAXKTCNAMELEN - 1);
  		strcpy(aclient.instance, "");
  		strncpy(aclient.cell, realm_of_user, MAXKTCREALMLEN - 1);
***************
*** 896,917 ****
  		    printf("Error %d\n", status);
  		}
  
! 		if ((status = pr_CreateUser(username, &id))) {
  		    fprintf(stderr, "%s: %s so unable to create remote PTS "
  			    "user %s in cell %s (status: %d).\n", progname,
  			    afs_error_message(status), username, cell_to_use,
  			    status);
  		} else {
  		    printf("created cross-cell entry for %s (Id %d) at %s\n",
! 			   username, id, cell_to_use);
! 		    sprintf(username, "AFS ID %d", (int) id);
  		}
  	    }
- 	}
  #endif /* ALLOW_REGISTER */
  
  	}
- #endif /* !WINDOWS */
  
  	if (dflag) {
  	    fprintf(stdout, "Set username to %s\n", username);
--- 770,792 ----
  		    printf("Error %d\n", status);
  		}
  
! 		if ((status = pr_CreateUser(username, &viceId))) {
  		    fprintf(stderr, "%s: %s so unable to create remote PTS "
  			    "user %s in cell %s (status: %d).\n", progname,
  			    afs_error_message(status), username, cell_to_use,
  			    status);
+ 		    viceId = ANONYMOUSID;
  		} else {
  		    printf("created cross-cell entry for %s (Id %d) at %s\n",
! 			   username, viceId, cell_to_use);
  		}
  	    }
  #endif /* ALLOW_REGISTER */
  
+ 	    if ((status == 0) && (viceId != ANONYMOUSID)) {
+ 		sprintf(username, "AFS ID %d", (int) viceId);
+ 	    }
  	}
  
  	if (dflag) {
  	    fprintf(stdout, "Set username to %s\n", username);
***************
*** 929,971 ****
  	    printf("Setting tokens. %s / %s @ %s \n",
  		    aclient.name, aclient.instance, aclient.cell );
  	}
  	/* on AIX 4.1.4 with AFS 3.4a+ if a write is not done before 
  	 * this routine, it will not add the token. It is not clear what 
! 	 * is going on here! So we will do the following operation
  	 */
  	write(2,"",0); /* dummy write */
! #ifndef WINDOWS
  	if ((status = ktc_SetToken(&aserver, &atoken, &aclient, afssetpag))) {
  	    fprintf(stderr, 
  		    "%s: unable to obtain tokens for cell %s (status: %d).\n",
  		    progname, cell_to_use, status);
  	    status = AKLOG_TOKEN;
  	}
- #else /* WINDOWS */
- 	/* Note switched 2nd and 3rd args */
- 	if ((status = ktc_SetToken(&aserver, &atoken, &aclient, afssetpag))) {
- 	    switch(status) {
- 	    case KTC_INVAL:
- 		fprintf(stderr, "%s: Bad ticket length", progname);
- 		break;
- 	    case KTC_PIOCTLFAIL:
- 		fprintf(stderr, "%s: Unknown error contacting AFS service",
- 			progname);
- 		break;
- 	    case KTC_NOCELL:
- 		fprintf(stderr, "%s: Cell name (%s) not recognized by AFS service",
- 			progname, realm_of_cell);
- 		break;
- 	    case KTC_NOCM:
- 		fprintf(stderr, "%s: AFS service is unavailable", progname);
- 		break;
- 	    default:
- 		fprintf(stderr, "%s: Undocumented error (%d) contacting AFS service", progname, status);
- 		break;	
- 	    }
- 	    status = AKLOG_TOKEN;	    
- 	}
- #endif /* !WINDOWS */
      }
      else
  	if (dflag) {
--- 804,823 ----
  	    printf("Setting tokens. %s / %s @ %s \n",
  		    aclient.name, aclient.instance, aclient.cell );
  	}
+ #ifndef AFS_AIX51_ENV
  	/* on AIX 4.1.4 with AFS 3.4a+ if a write is not done before 
  	 * this routine, it will not add the token. It is not clear what 
! 	 * is going on here! So we will do the following operation.
! 	 * On AIX 5, it causes the parent program to die, so we won't.
  	 */
  	write(2,"",0); /* dummy write */
! #endif
  	if ((status = ktc_SetToken(&aserver, &atoken, &aclient, afssetpag))) {
  	    fprintf(stderr, 
  		    "%s: unable to obtain tokens for cell %s (status: %d).\n",
  		    progname, cell_to_use, status);
  	    status = AKLOG_TOKEN;
  	}
      }
      else
  	if (dflag) {
***************
*** 975,982 ****
      return(status);
  }
  
- #ifndef WINDOWS /* struct ViceIoctl missing */
- 
  static int get_afs_mountpoint(char *file, char *mountpoint, int size)
  {
  #ifdef AFS_SUN_ENV
--- 827,832 ----
***************
*** 1073,1080 ****
  	    ? elast_comp - last_comp : strlen(last_comp);
  	strncat(pathtocheck, last_comp, len);
  	memset(linkbuf, 0, sizeof(linkbuf));
! 	if (link = (readlink(pathtocheck, linkbuf, 
! 				    sizeof(linkbuf)) > 0)) {
  	    if (++symlinkcount > MAXSYMLINKS) {
  		fprintf(stderr, "%s: %s\n", progname, strerror(ELOOP));
  		exit(AKLOG_BADPATH);
--- 923,930 ----
  	    ? elast_comp - last_comp : strlen(last_comp);
  	strncat(pathtocheck, last_comp, len);
  	memset(linkbuf, 0, sizeof(linkbuf));
! 	if ((link = (readlink(pathtocheck, linkbuf, 
! 				    sizeof(linkbuf)) > 0))) {
  	    if (++symlinkcount > MAXSYMLINKS) {
  		fprintf(stderr, "%s: %s\n", progname, strerror(ELOOP));
  		exit(AKLOG_BADPATH);
***************
*** 1118,1125 ****
      return(pathtocheck);
  }
  
- #endif /* WINDOWS */
- 
  #if 0
  /*****************************************/
  int dee_gettokens()
--- 968,973 ----
***************
*** 1150,1157 ****
  /*****************************************/
  #endif
  
- #ifndef WINDOWS /* struct ViceIoctl missing */
- 
  static void add_hosts(char *file)
  {
  #ifdef AFS_SUN_ENV
--- 998,1003 ----
***************
*** 1211,1220 ****
      }
  }
  
- #endif /* WINDOWS */
- 
- #ifndef WINDOWS /* next_path(), get_afs_mountpoint() */
- 
  /*
   * This routine descends through a path to a directory, logging to 
   * every cell it encounters along the way.
--- 1057,1062 ----
***************
*** 1302,1309 ****
      return(status);
  }
  
- #endif /* WINDOWS */
- 
  
  /* Print usage message and exit */
  static void usage(void)
--- 1144,1149 ----
***************
*** 1380,1388 ****
  	progname = argv[0];
  
      krb5_init_context(&context);
! #ifndef WINDOWS
! 	initialize_ktc_error_table ();
! #endif
  
      /* Initialize list of cells to which we have authenticated */
      (void)ll_init(&authedcells);
--- 1220,1226 ----
  	progname = argv[0];
  
      krb5_init_context(&context);
!     initialize_ktc_error_table ();
  
      /* Initialize list of cells to which we have authenticated */
      (void)ll_init(&authedcells);
***************
*** 1431,1462 ****
  		usage();
  	else if (((strcmp(argv[i], "-path") == 0) ||
  		  (strcmp(argv[i], "-p") == 0)) && !cmode)
- #ifndef WINDOWS
  	    if (++i < argc) {
  		pmode++;
  		strcpy(path, argv[i]);
  	    }
  	    else
  		usage();
- #else /* WINDOWS */
- 	{
- 	    fprintf(stderr, "%s: path mode not supported.\n", progname);
- 	    exit(AKLOG_MISC);
- 	}
- #endif /* WINDOWS */
  	    
  	else if (argv[i][0] == '-')
  	    usage();
  	else if (!pmode && !cmode) {
  	    if (strchr(argv[i], DIR) || (strcmp(argv[i], ".") == 0) ||
  		(strcmp(argv[i], "..") == 0)) {
- #ifndef WINDOWS
  		pmode++;
  		strcpy(path, argv[i]);
- #else /* WINDOWS */
- 		fprintf(stderr, "%s: path mode not supported.\n", progname);
- 		exit(AKLOG_MISC);
- #endif /* WINDOWS */
  	    }
  	    else { 
  		cmode++;
--- 1269,1288 ----
***************
*** 1497,1508 ****
  	    memset(cell, 0, sizeof(cell));
  	    memset(realm, 0, sizeof(realm));
  	}
- #ifndef WINDOWS
  	else if (pmode) {
  	    /* Add this path to list of paths */
  	    if ((cur_node = ll_add_node(&paths, ll_tail))) {
! 		char *new_path;
! 		if ((new_path = strdup(path)))
  		    ll_add_data(cur_node, new_path);
  		else {
  		    fprintf(stderr, "%s: failure copying path name.\n",
--- 1323,1333 ----
  	    memset(cell, 0, sizeof(cell));
  	    memset(realm, 0, sizeof(realm));
  	}
  	else if (pmode) {
  	    /* Add this path to list of paths */
  	    if ((cur_node = ll_add_node(&paths, ll_tail))) {
! 		char *new_path; 
! 		if ((new_path = copy_string(path)))
  		    ll_add_data(cur_node, new_path);
  		else {
  		    fprintf(stderr, "%s: failure copying path name.\n",
***************
*** 1518,1524 ****
  	    pmode = FALSE;
  	    memset(path, 0, sizeof(path));
  	}
- #endif /* WINDOWS */
      }
  
      /*
--- 1343,1348 ----
***************
*** 1570,1576 ****
  				status = auth_to_cell(context, linkedcell2, NULL);
  		}
  
- #ifndef WINDOWS
  		/*
  		 * Local hack - if the person has a file in their home
  		 * directory called ".xlog", read that for a list of
--- 1394,1399 ----
***************
*** 1611,1617 ****
  			}
  		    }
  		}
- #endif /* WINDOWS */
  	}
      else {
  	/* Log to all cells in the cells list first */
--- 1434,1439 ----
***************
*** 1633,1645 ****
  		}
  	}
  	
- #ifndef WINDOWS
  	/* Then, log to all paths in the paths list */
  	for (cur_node = paths.first; cur_node; cur_node = cur_node->next) {
  	    if ((status = auth_to_path(context, cur_node->data)))
  		somethingswrong++;
  	}
- #endif /* WINDOWS */
  	
  	/* 
  	 * If only one thing was logged to, we'll return the status 
--- 1455,1465 ----
***************
*** 1690,1696 ****
  						int *paddress,
  						krb5_creds** out_creds /* out */ )
  {
! #if defined(USING_HEIMDAL) || (defined(HAVE_ENCODE_KRB5_ENC_TKT) && defined(HAVE_ENCODE_KRB5_TICKET))
      krb5_error_code code;
      krb5_keytab kt = 0;
      krb5_kt_cursor cursor[1];
--- 1510,1516 ----
  						int *paddress,
  						krb5_creds** out_creds /* out */ )
  {
! #if defined(USING_HEIMDAL) || (defined(HAVE_ENCODE_KRB5_ENC_TKT) && defined(HAVE_ENCODE_KRB5_TICKET) && defined(HAVE_KRB5_C_ENCRYPT))
      krb5_error_code code;
      krb5_keytab kt = 0;
      krb5_kt_cursor cursor[1];
***************
*** 1734,1742 ****
      code = krb5_kt_resolve(context, keytab, &kt);
      if (code) {
          if (keytab)
!             com_err(progname, code, "while resolving keytab %s", keytab);
          else
!             com_err(progname, code, "while resolving default keytab");
          goto cleanup;
      }
  
--- 1554,1562 ----
      code = krb5_kt_resolve(context, keytab, &kt);
      if (code) {
          if (keytab)
!             afs_com_err(progname, code, "while resolving keytab %s", keytab);
          else
!             afs_com_err(progname, code, "while resolving default keytab");
          goto cleanup;
      }
  
***************
*** 1755,1761 ****
  	    }
          }
          if (code) {
! 	    com_err(progname, code,"while scanning keytab entries");
  	    goto cleanup;
          }
      } else {
--- 1575,1581 ----
  	    }
          }
          if (code) {
! 	    afs_com_err(progname, code,"while scanning keytab entries");
  	    goto cleanup;
          }
      } else {
***************
*** 1763,1769 ****
          int best = -1;
          memset(new, 0, sizeof *new);
          if ((code == krb5_kt_start_seq_get(context, kt, cursor))) {
!             com_err(progname, code, "while starting keytab scan");
              goto cleanup;
          }
          while (!(code = krb5_kt_next_entry(context, kt, new, cursor))) {
--- 1583,1589 ----
          int best = -1;
          memset(new, 0, sizeof *new);
          if ((code == krb5_kt_start_seq_get(context, kt, cursor))) {
!             afs_com_err(progname, code, "while starting keytab scan");
              goto cleanup;
          }
          while (!(code = krb5_kt_next_entry(context, kt, new, cursor))) {
***************
*** 1779,1790 ****
              } else krb5_free_keytab_entry_contents(context, new);
          }
          if ((i = krb5_kt_end_seq_get(context, kt, cursor))) {
!             com_err(progname, i, "while ending keytab scan");
              code = i;
              goto cleanup;
          }
          if (best < 0) {
!             com_err(progname, code, "while scanning keytab");
              goto cleanup;
          }
          deref_keyblock_enctype(session_key) = deref_entry_enctype(entry);
--- 1599,1610 ----
              } else krb5_free_keytab_entry_contents(context, new);
          }
          if ((i = krb5_kt_end_seq_get(context, kt, cursor))) {
!             afs_com_err(progname, i, "while ending keytab scan");
              code = i;
              goto cleanup;
          }
          if (best < 0) {
!             afs_com_err(progname, code, "while scanning keytab");
              goto cleanup;
          }
          deref_keyblock_enctype(session_key) = deref_entry_enctype(entry);
***************
*** 1795,1801 ****
  #if USING_HEIMDAL
      if ((code = krb5_generate_random_keyblock(context,
  					      deref_keyblock_enctype(session_key), session_key))) {
!         com_err(progname, code, "while making session key");
          goto cleanup;
      }
      enc_tkt_reply->flags.initial = 1;
--- 1615,1621 ----
  #if USING_HEIMDAL
      if ((code = krb5_generate_random_keyblock(context,
  					      deref_keyblock_enctype(session_key), session_key))) {
!         afs_com_err(progname, code, "while making session key");
          goto cleanup;
      }
      enc_tkt_reply->flags.initial = 1;
***************
*** 1818,1824 ****
  #else
      if ((code = krb5_c_make_random_key(context,
  				       deref_keyblock_enctype(session_key), session_key))) {
!         com_err(progname, code, "while making session key");
          goto cleanup;
      }
      enc_tkt_reply->magic = KV5M_ENC_TKT_PART;
--- 1638,1644 ----
  #else
      if ((code = krb5_c_make_random_key(context,
  				       deref_keyblock_enctype(session_key), session_key))) {
!         afs_com_err(progname, code, "while making session key");
          goto cleanup;
      }
      enc_tkt_reply->magic = KV5M_ENC_TKT_PART;
***************
*** 1881,1892 ****
          ASN1_MALLOC_ENCODE(EncTicketPart, buf, buf_size,
  			   enc_tkt_reply, &buf_len, code);
          if(code) {
!             com_err(progname, code, "while encoding ticket");
              goto cleanup;
          }
  
          if(buf_len != buf_size) {
!             com_err(progname, code,
  		    "%d != %d while encoding ticket (internal ASN.1 encoder error",
  		    buf_len, buf_size);
              goto cleanup;
--- 1701,1712 ----
          ASN1_MALLOC_ENCODE(EncTicketPart, buf, buf_size,
  			   enc_tkt_reply, &buf_len, code);
          if(code) {
!             afs_com_err(progname, code, "while encoding ticket");
              goto cleanup;
          }
  
          if(buf_len != buf_size) {
!             afs_com_err(progname, code,
  		    "%d != %d while encoding ticket (internal ASN.1 encoder error",
  		    buf_len, buf_size);
              goto cleanup;
***************
*** 1904,1910 ****
          if (buf) free(buf);
          if (crypto) krb5_crypto_destroy(context, crypto);
          if(code) {
!             com_err(progname, code, "while %s", what);
              goto cleanup;
          }
      } /* crypto block */
--- 1724,1730 ----
          if (buf) free(buf);
          if (crypto) krb5_crypto_destroy(context, crypto);
          if(code) {
!             afs_com_err(progname, code, "while %s", what);
              goto cleanup;
          }
      } /* crypto block */
***************
*** 1916,1922 ****
      ticket_reply->server = service_principal;
      ticket_reply->enc_part2 = enc_tkt_reply;
      if ((code = krb5_encrypt_tkt_part(context, &deref_entry_keyblock(entry), ticket_reply))) {
!         com_err(progname, code, "while making ticket");
          goto cleanup;
      }
      ticket_reply->enc_part.kvno = entry->vno;
--- 1736,1742 ----
      ticket_reply->server = service_principal;
      ticket_reply->enc_part2 = enc_tkt_reply;
      if ((code = krb5_encrypt_tkt_part(context, &deref_entry_keyblock(entry), ticket_reply))) {
!         afs_com_err(progname, code, "while making ticket");
          goto cleanup;
      }
      ticket_reply->enc_part.kvno = entry->vno;
***************
*** 1926,1942 ****
  
      if ((code = krb5_copy_principal(context, service_principal,
  				    &creds->server))) {
!         com_err(progname, code, "while copying service principal");
          goto cleanup;
      }
      if ((code = krb5_copy_principal(context, client_principal,
  				    &creds->client))) {
!         com_err(progname, code, "while copying client principal");
          goto cleanup;
      }
      if ((code = krb5_copy_keyblock_contents(context, session_key,
  					    &deref_session_key(creds)))) {
!         com_err(progname, code, "while copying session key");
          goto cleanup;
      }
  
--- 1746,1762 ----
  
      if ((code = krb5_copy_principal(context, service_principal,
  				    &creds->server))) {
!         afs_com_err(progname, code, "while copying service principal");
          goto cleanup;
      }
      if ((code = krb5_copy_principal(context, client_principal,
  				    &creds->client))) {
!         afs_com_err(progname, code, "while copying client principal");
          goto cleanup;
      }
      if ((code = krb5_copy_keyblock_contents(context, session_key,
  					    &deref_session_key(creds)))) {
!         afs_com_err(progname, code, "while copying session key");
          goto cleanup;
      }
  
***************
*** 1954,1960 ****
          ;
      else if ((code = krb5_copy_addresses(context,
  					 deref_enc_tkt_addrs(enc_tkt_reply), &creds->addresses))) {
!         com_err(progname, code, "while copying addresses");
          goto cleanup;
      }
  
--- 1774,1780 ----
          ;
      else if ((code = krb5_copy_addresses(context,
  					 deref_enc_tkt_addrs(enc_tkt_reply), &creds->addresses))) {
!         afs_com_err(progname, code, "while copying addresses");
          goto cleanup;
      }
  
***************
*** 1964,1976 ****
  	ASN1_MALLOC_ENCODE(Ticket, creds->ticket.data, creds->ticket.length,
  			   ticket_reply, &creds_tkt_len, code);
  	if(code) {
! 	    com_err(progname, code, "while encoding ticket");
  	    goto cleanup;
  	}
      }
  #else
      if ((code = encode_krb5_ticket(ticket_reply, &temp))) {
! 	com_err(progname, code, "while encoding ticket");
  	goto cleanup;
      }
      creds->ticket = *temp;
--- 1784,1796 ----
  	ASN1_MALLOC_ENCODE(Ticket, creds->ticket.data, creds->ticket.length,
  			   ticket_reply, &creds_tkt_len, code);
  	if(code) {
! 	    afs_com_err(progname, code, "while encoding ticket");
  	    goto cleanup;
  	}
      }
  #else
      if ((code = encode_krb5_ticket(ticket_reply, &temp))) {
! 	afs_com_err(progname, code, "while encoding ticket");
  	goto cleanup;
      }
      creds->ticket = *temp;
***************
*** 2008,2013 ****
--- 1828,1838 ----
      krb5_creds increds;
      krb5_error_code r;
      static krb5_principal client_principal = 0;
+ 
+     if (dflag) {
+ 	printf("Getting tickets: %s%s%s@%s\n", name, (inst && inst[0])
+ 	       ? "/" : "", inst ? inst : "", realm);
+     }
      
      memset((char *)&increds, 0, sizeof(increds));
  /* ANL - instance may be ptr to a null string. Pass null then */
Index: openafs/src/aklog/asetkey.c
diff -c openafs/src/aklog/asetkey.c:1.4.2.7 openafs/src/aklog/asetkey.c:1.4.2.10
*** openafs/src/aklog/asetkey.c:1.4.2.7	Tue Apr 10 14:43:40 2007
--- openafs/src/aklog/asetkey.c	Tue Apr  1 13:44:52 2008
***************
*** 1,5 ****
  /*
!  * $Id: asetkey.c,v 1.4.2.7 2007/04/10 18:43:40 shadow Exp $
   *
   * asetkey - Manipulates an AFS KeyFile
   *
--- 1,5 ----
  /*
!  * $Id: asetkey.c,v 1.4.2.10 2008/04/01 17:44:52 shadow Exp $
   *
   * asetkey - Manipulates an AFS KeyFile
   *
***************
*** 7,37 ****
   */
  
  #include <afsconfig.h>
- #include <stdio.h>
  #include <sys/types.h>
  #include <netinet/in.h>
  #include <netdb.h>
  #ifdef HAVE_UNISTD_H
  #include <unistd.h>
  #endif
- #ifdef HAVE_STDLIB_H
  #include <stdlib.h>
- #endif
  #ifdef HAVE_MEMORY_H
  #include <memory.h>
  #endif /* HAVE_MEMORY_H */
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else /* HAVE_STRING_H */
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif /* HAVE_STRINGS_H */
- #endif /* HAVE_STRING_H */
  
  #include <afs/stds.h>
  #include <krb5.h>
  
  #include <afs/com_err.h>
  #include <afs/cellconfig.h>
  #include <afs/keys.h>
  #include <afs/dirpath.h>
--- 7,31 ----
   */
  
  #include <afsconfig.h>
  #include <sys/types.h>
  #include <netinet/in.h>
  #include <netdb.h>
+ #include <stdio.h>
  #ifdef HAVE_UNISTD_H
  #include <unistd.h>
  #endif
  #include <stdlib.h>
  #ifdef HAVE_MEMORY_H
  #include <memory.h>
  #endif /* HAVE_MEMORY_H */
  #include <string.h>
  
  #include <afs/stds.h>
  #include <krb5.h>
  
+ #ifndef HAVE_KERBEROSV_HEIM_ERR_H
  #include <afs/com_err.h>
+ #endif
  #include <afs/cellconfig.h>
  #include <afs/keys.h>
  #include <afs/dirpath.h>
***************
*** 116,122 ****
  
  	code = afsconf_AddKey(tdir, kvno, (char *) deref_key_contents(key), 1);
  	if (code) {
! 	    fprintf(stderr, "%s: failed to set key, code %d.\n", argv[0], code);
  	    exit(1);
  	}
  	krb5_free_principal(context, principal);
--- 110,116 ----
  
  	code = afsconf_AddKey(tdir, kvno, (char *) deref_key_contents(key), 1);
  	if (code) {
! 	    fprintf(stderr, "%s: failed to set key, code %ld.\n", argv[0], code);
  	    exit(1);
  	}
  	krb5_free_principal(context, principal);
***************
*** 132,138 ****
  	kvno = atoi(argv[2]);
  	code = afsconf_DeleteKey(tdir, kvno);
  	if (code) {
! 	    fprintf(stderr, "%s: failed to delete key %d, (code %d)\n",
  		    argv[0], kvno, code);
  	    exit(1);
  	}
--- 126,132 ----
  	kvno = atoi(argv[2]);
  	code = afsconf_DeleteKey(tdir, kvno);
  	if (code) {
! 	    fprintf(stderr, "%s: failed to delete key %ld, (code %ld)\n",
  		    argv[0], kvno, code);
  	    exit(1);
  	}
***************
*** 143,149 ****
  	
  	code = afsconf_GetKeys(tdir, &tkeys);
  	if (code) {
! 	    fprintf(stderr, "%s: failed to get keys, code %d\n", argv[0], code);
  	    exit(1);
  	}
  	for(i=0;i<tkeys.nkeys;i++) {
--- 137,143 ----
  	
  	code = afsconf_GetKeys(tdir, &tkeys);
  	if (code) {
! 	    fprintf(stderr, "%s: failed to get keys, code %ld\n", argv[0], code);
  	    exit(1);
  	}
  	for(i=0;i<tkeys.nkeys;i++) {
Index: openafs/src/aklog/klog.c
diff -c /dev/null openafs/src/aklog/klog.c:1.3.4.9
*** /dev/null	Mon Apr 28 17:55:43 2008
--- openafs/src/aklog/klog.c	Fri Apr 18 16:50:30 2008
***************
*** 0 ****
--- 1,730 ----
+ /*
+  * Copyright 2000, International Business Machines Corporation and others.
+  * All Rights Reserved.
+  * 
+  * This software has been released under the terms of the IBM Public
+  * License.  For details, see the LICENSE file in the top-level source
+  * directory or online at http://www.openafs.org/dl/license10.html
+  */
+ 
+ #include <afsconfig.h>
+ #include <afs/param.h>
+ 
+ #include <afs/stds.h>
+ #include <sys/types.h>
+ #include <rx/xdr.h>
+ #ifdef	AFS_AIX32_ENV
+ #include <signal.h>
+ #endif
+ #ifdef HAVE_STRING_H
+ #include <string.h>
+ #else
+ #ifdef HAVE_STRINGS_H
+ #include <strings.h>
+ #endif
+ #endif
+ #include <errno.h>
+ 
+ #include <lock.h>
+ #include <ubik.h>
+ 
+ #include <stdio.h>
+ #include <pwd.h>
+ #include <afs/com_err.h>
+ #include <afs/auth.h>
+ #include <afs/afsutil.h>
+ #include <afs/cellconfig.h>
+ #ifdef AFS_RXK5
+ #include "rxk5_utilafs.h"
+ #endif
+ #include <afs/ptclient.h>
+ #include <afs/cmd.h>
+ #include <krb5.h>
+ 
+ #ifdef HAVE_KRB5_CREDS_KEYBLOCK
+ #define USING_MIT 1
+ #endif
+ #ifdef HAVE_KRB5_CREDS_SESSION
+ #define USING_HEIMDAL 1
+ #endif
+ 
+ #include "assert.h"
+ #include "skipwrap.h"
+ 
+ /* This code borrowed heavily from the previous version of log.  Here is the
+    intro comment for that program: */
+ 
+ /*
+ 	log -- tell the Andrew Cache Manager your password
+ 	5 June 1985
+ 	modified
+ 	February 1986
+ 
+ 	Further modified in August 1987 to understand cell IDs.
+ 
+ 	Further modified in October 2006 to understand kerberos 5.
+  */
+ 
+ /* Current Usage:
+      klog [principal [password]] [-t] [-c cellname] [-k <k5realm>]
+ 
+      where:
+        principal is of the form 'name' or 'name@cell' which provides the
+ 	  cellname.  See the -c option below.
+        password is the user's password.  This form is NOT recommended for
+ 	  interactive users.
+        -t advises klog to write a Kerberos style ticket file in /tmp.
+        -c identifies cellname as the cell in which authentication is to take
+ 	  place.
+        -k identifies an alternate kerberos realm to use provide
+ 	  authentication services for the cell.
+  */
+ 
+ #define KLOGEXIT(code) rx_Finalize(); \
+                        (exit(!!code))
+ extern int CommandProc(struct cmd_syndesc *as, char *arock);
+ 
+ static int zero_argc;
+ static char **zero_argv;
+ 
+ static krb5_context k5context;
+ static struct afsconf_dir *tdir;
+ static int always_evil = 2;	/* gcc optimizes 0 into bss.  fools. */
+ 
+ int
+ main(int argc, char *argv[])
+ {
+     struct cmd_syndesc *ts;
+     afs_int32 code;
+ #ifdef	AFS_AIX32_ENV
+     /*
+      * The following signal action for AIX is necessary so that in case of a 
+      * crash (i.e. core is generated) we can include the user's data section 
+      * in the core dump. Unfortunately, by default, only a partial core is
+      * generated which, in many cases, isn't too useful.
+      */
+     struct sigaction nsa;
+ 
+     sigemptyset(&nsa.sa_mask);
+     nsa.sa_handler = SIG_DFL;
+     nsa.sa_flags = SA_FULLDUMP;
+     sigaction(SIGABRT, &nsa, NULL);
+     sigaction(SIGSEGV, &nsa, NULL);
+ #endif
+     zero_argc = argc;
+     zero_argv = argv;
+ 
+     ts = cmd_CreateSyntax(NULL, CommandProc, 0,
+ 			  "obtain Kerberos authentication");
+ 
+ #define aXFLAG 0
+ #define aPRINCIPAL 1
+ #define aPASSWORD 2
+ #define aCELL 3
+ #define aKRBREALM 4
+ #define aPIPE 5
+ #define aSILENT 6
+ #define aLIFETIME 7
+ #define aSETPAG 8
+ #define aTMP 9
+ #define aNOPRDB 10
+ #define aUNWRAP 11
+ #define aK5 12
+ #define aK4 13
+ 
+     cmd_AddParm(ts, "-x", CMD_FLAG, CMD_OPTIONAL|CMD_HIDDEN, 0);
+     cmd_Seek(ts, aPRINCIPAL);
+     cmd_AddParm(ts, "-principal", CMD_SINGLE, CMD_OPTIONAL, "user name");
+     cmd_AddParm(ts, "-password", CMD_SINGLE, CMD_OPTIONAL, "user's password");
+     cmd_AddParm(ts, "-cell", CMD_SINGLE, CMD_OPTIONAL, "cell name");
+     cmd_AddParm(ts, "-k", CMD_SINGLE, CMD_OPTIONAL, "krb5 realm");
+     cmd_AddParm(ts, "-pipe", CMD_FLAG, CMD_OPTIONAL,
+ 		"read password from stdin");
+     cmd_AddParm(ts, "-silent", CMD_FLAG, CMD_OPTIONAL, "silent operation");
+     cmd_AddParm(ts, "-lifetime", CMD_SINGLE, CMD_OPTIONAL,
+ 		"ticket lifetime in hh[:mm[:ss]]");
+     cmd_AddParm(ts, "-setpag", CMD_FLAG, CMD_OPTIONAL,
+ 		"Create a new setpag before authenticating");
+     cmd_AddParm(ts, "-tmp", CMD_FLAG, CMD_OPTIONAL,
+ 		"write Kerberos-style ticket file in /tmp");
+     cmd_AddParm(ts, "-noprdb", CMD_FLAG, CMD_OPTIONAL, "don't consult pt");
+     cmd_AddParm(ts, "-unwrap", CMD_FLAG, CMD_OPTIONAL, "perform 524d conversion");
+ #ifdef AFS_RXK5
+     cmd_AddParm(ts, "-k5", CMD_FLAG, CMD_OPTIONAL, "get rxk5 credentials");
+     cmd_AddParm(ts, "-k4", CMD_FLAG, CMD_OPTIONAL, "get rxkad credentials");
+ #else
+     ++ts->nParms;	/* skip -k5 */
+     cmd_AddParm(ts, "-k4", CMD_FLAG, CMD_OPTIONAL|CMD_HIDDEN, 0);
+ #endif
+ 
+     code = cmd_Dispatch(argc, argv);
+     KLOGEXIT(code);
+ }
+ 
+ static char *
+ getpipepass(void)
+ {
+     static char gpbuf[BUFSIZ];
+     /* read a password from stdin, stop on \n or eof */
+     register int i, tc;
+     memset(gpbuf, 0, sizeof(gpbuf));
+     for (i = 0; i < (sizeof(gpbuf) - 1); i++) {
+ 	tc = fgetc(stdin);
+ 	if (tc == '\n' || tc == EOF)
+ 	    break;
+ 	gpbuf[i] = tc;
+     }
+     return gpbuf;
+ }
+ 
+ void
+ silent_errors(const char *who,
+     afs_int32 code,
+     const char *fmt,
+     va_list ap)
+ {
+     /* ignore and don't print error */
+ }
+ 
+ #if defined(HAVE_KRB5_PRINC_SIZE) || defined(krb5_princ_size)
+ 
+ #define get_princ_str(c, p, n) krb5_princ_component(c, p, n)->data
+ #define get_princ_len(c, p, n) krb5_princ_component(c, p, n)->length
+ #define num_comp(c, p) (krb5_princ_size(c, p))
+ #define realm_data(c, p) krb5_princ_realm(c, p)->data
+ #define realm_len(c, p) krb5_princ_realm(c, p)->length
+ 
+ #elif defined(HAVE_KRB5_PRINCIPAL_GET_COMP_STRING)
+ 
+ #define get_princ_str(c, p, n) krb5_principal_get_comp_string(c, p, n)
+ #define get_princ_len(c, p, n) strlen(krb5_principal_get_comp_string(c, p, n))
+ #define num_comp(c, p) ((p)->name.name_string.len)
+ #define realm_data(c, p) krb5_realm_data(krb5_principal_get_realm(c, p))
+ #define realm_len(c, p) krb5_realm_length(krb5_principal_get_realm(c, p))
+ 
+ #else
+ #error "Must have either krb5_princ_size or krb5_principal_get_comp_string"
+ #endif
+ 
+ #if defined(HAVE_KRB5_CREDS_KEYBLOCK)
+ 
+ #define get_cred_keydata(c) c->keyblock.contents
+ #define get_cred_keylen(c) c->keyblock.length
+ #define get_creds_enctype(c) c->keyblock.enctype
+ 
+ #elif defined(HAVE_KRB5_CREDS_SESSION)
+ 
+ #define get_cred_keydata(c) c->session.keyvalue.data
+ #define get_cred_keylen(c) c->session.keyvalue.length
+ #define get_creds_enctype(c) c->session.keytype
+ 
+ #else
+ #error "Must have either keyblock or session member of krb5_creds"
+ #endif
+ 
+ static int
+ whoami(struct ktc_token *atoken,
+     struct afsconf_cell *cellconfig,
+     struct ktc_principal *aclient,
+     int *vicep)
+ {
+     int scIndex;
+     int code;
+     int i;
+     struct ubik_client *ptconn = 0;
+     struct rx_securityClass *sc;
+     struct rx_connection *conns[MAXSERVERS+1];
+     idlist lids[1];
+     namelist lnames[1];
+     char tempname[PR_MAXNAMELEN + 1];
+ 
+     memset(lnames, 0, sizeof *lnames);
+     memset(lids, 0, sizeof *lids);
+     scIndex = 2;
+     sc = rxkad_NewClientSecurityObject(rxkad_auth,
+ 	&atoken->sessionKey, atoken->kvno,
+ 	atoken->ticketLen, atoken->ticket);
+     for (i = 0; i < cellconfig->numServers; ++i)
+ 	conns[i] = rx_NewConnection(cellconfig->hostAddr[i].sin_addr.s_addr,
+ 		cellconfig->hostAddr[i].sin_port, PRSRV, sc, scIndex);
+     conns[i] = 0;
+     ptconn = 0;
+     if ((code = ubik_ClientInit(conns, &ptconn)))
+ 	goto Failed;
+     if (*aclient->instance)
+ 	snprintf (tempname, sizeof tempname, "%s.%s",
+ 	    aclient->name, aclient->instance);
+     else
+ 	snprintf (tempname, sizeof tempname, "%s", aclient->name);
+     lnames->namelist_len = 1;
+     lnames->namelist_val = (prname *) tempname;
+     code = ubik_PR_NameToID(ptconn, 0, lnames, lids);
+     if (lids->idlist_val) {
+ 	*vicep = *lids->idlist_val;
+     }
+ Failed:
+     if (lids->idlist_val) free(lids->idlist_val);
+     if (ptconn) ubik_ClientDestroy(ptconn);
+     return code;
+ }
+ 
+ static void
+ k5_to_k4_name(krb5_context k5context,
+     krb5_principal k5princ,
+     struct ktc_principal *ktcprinc)
+ {
+     int i;
+ 
+     switch(num_comp(k5context, k5princ)) {
+ 	default:
+ 	/* case 2: */
+ 	    i = get_princ_len(k5context, k5princ, 1);
+ 	    if (i > MAXKTCNAMELEN-1) i = MAXKTCNAMELEN-1;
+ 	    memcpy(ktcprinc->instance, get_princ_str(k5context, k5princ, 1), i);
+ 	    /* fall through */
+ 	case 1:
+ 	    i = get_princ_len(k5context, k5princ, 0);
+ 	    if (i > MAXKTCNAMELEN-1) i = MAXKTCNAMELEN-1;
+ 	    memcpy(ktcprinc->name, get_princ_str(k5context, k5princ, 0), i);
+ 	    /* fall through */
+ 	case 0:
+ 	    break;
+ 	}
+ }
+ 
+ /* save and reuse password.  This is necessary to make
+  *  "direct to service" authentication work with most
+  *  flavors of kerberos, when the afs principal has no instance.
+  */
+ struct kp_arg {
+     char **pp, *pstore;
+ };
+ krb5_error_code
+ klog_prompter(krb5_context context,
+     void *a,
+     const char *name,
+     const char *banner,
+     int num_prompts,
+     krb5_prompt prompts[])
+ {
+     krb5_error_code code;
+     int i, type;
+ #if !defined(USING_HEIMDAL) && defined(HAVE_KRB5_GET_PROMPT_TYPES)
+     krb5_prompt_type *types;
+ #endif
+     struct kp_arg *kparg = (struct kp_arg *) a;
+     code = krb5_prompter_posix(context, a, name, banner, num_prompts, prompts);
+     if (code) return code;
+ #if !defined(USING_HEIMDAL) && defined(HAVE_KRB5_GET_PROMPT_TYPES)
+     if ((types = krb5_get_prompt_types(context)))
+ #endif
+     for (i = 0; i < num_prompts; ++i) {
+ #if !defined(USING_HEIMDAL) 
+ #if defined(HAVE_KRB5_GET_PROMPT_TYPES)
+ 	type = types[i];
+ #elif defined(HAVE_KRB5_PROMPT_TYPE)	
+ 	type = prompts[i].type;
+ #else
+ 	/* AIX 5.3 krb5_get_prompt_types is missing. Um... */
+ 	type = ((i == 1)&&(num_prompts == 2)) ? 
+ 	  KRB5_PROMPT_TYPE_NEW_PASSWORD_AGAIN : KRB5_PROMPT_TYPE_PASSWORD;
+ #endif
+ #else
+ 	type = prompts[i].type;
+ #endif
+ #if 0
+ 	printf ("i%d t%d <%.*s>\n", i, type, prompts[i].reply->length,
+ 		prompts[i].reply->data);
+ #endif
+ 	switch(type) {
+ 	case KRB5_PROMPT_TYPE_PASSWORD:
+ 	case KRB5_PROMPT_TYPE_NEW_PASSWORD_AGAIN:
+ 	    memcpy(kparg->pstore, prompts[i].reply->data, prompts[i].reply->length);
+ 	    kparg->pstore[prompts[i].reply->length] = 0;
+ 	    *kparg->pp = kparg->pstore;
+ 	}
+     }
+     return 0;
+ }
+ 
+ int
+ CommandProc(struct cmd_syndesc *as, char *arock)
+ {
+     krb5_principal princ = 0;
+     char *cell, *pname, **hrealms, *service;
+     char service_temp[MAXKTCREALMLEN + 20];
+     krb5_creds incred[1], mcred[1], *outcred = 0, *afscred;
+     krb5_ccache cc = 0;
+     krb5_get_init_creds_opt gic_opts[1];
+     char *tofree, *outname;
+     int code;
+     char *what;
+     int i, dosetpag, evil, noprdb, id;
+ #ifdef AFS_RXK5
+     int authtype;
+ #endif
+     krb5_data enc_part[1];
+     time_t lifetime;		/* requested ticket lifetime */
+     krb5_prompter_fct pf = NULL;
+     char *pass = 0;
+     void *pa = 0;
+     struct kp_arg klog_arg[1];
+ 
+     char passwd[BUFSIZ];
+     struct afsconf_cell cellconfig[1];
+ 
+     static char rn[] = "klog";	/*Routine name */
+     static int Pipe = 0;	/* reading from a pipe */
+     static int Silent = 0;	/* Don't want error messages */
+ 
+     int writeTicketFile = 0;	/* write ticket file to /tmp */
+ 
+     service = 0;
+     memset(incred, 0, sizeof *incred);
+     /* blow away command line arguments */
+     for (i = 1; i < zero_argc; i++)
+ 	memset(zero_argv[i], 0, strlen(zero_argv[i]));
+     zero_argc = 0;
+     memset(klog_arg, 0, sizeof *klog_arg);
+ 
+     /* first determine quiet flag based on -silent switch */
+     Silent = (as->parms[aSILENT].items ? 1 : 0);
+ 
+     if (Silent) {
+ 	afs_set_com_err_hook(silent_errors);
+     }
+ 
+     if ((code = krb5_init_context(&k5context))) {
+ 	afs_com_err(rn, code, "while initializing Kerberos 5 library");
+ 	KLOGEXIT(code);
+     }
+     if ((code = rx_Init(0))) {
+ 	afs_com_err(rn, code, "while initializing rx");
+ 	KLOGEXIT(code);
+     }
+     initialize_U_error_table();
+     /*initialize_krb5_error_table();*/ 
+     initialize_RXK_error_table();
+     initialize_KTC_error_table();
+     initialize_ACFG_error_table();
+     /* initialize_rx_error_table(); */
+     if (!(tdir = afsconf_Open(AFSDIR_CLIENT_ETC_DIRPATH))) {
+ 	afs_com_err(rn, 0, "can't get afs configuration (afsconf_Open(%s))",
+ 	    rn, AFSDIR_CLIENT_ETC_DIRPATH);
+ 	KLOGEXIT(1);
+     }
+ 
+     /* Parse remaining arguments. */
+ 
+     dosetpag = !! as->parms[aSETPAG].items;
+     Pipe = !! as->parms[aPIPE].items;
+     writeTicketFile = !! as->parms[aTMP].items;
+     noprdb = !! as->parms[aNOPRDB].items;
+     evil = (always_evil&1) || !! as->parms[aUNWRAP].items;
+ 
+ #ifdef AFS_RXK5
+     authtype = 0;
+     if (as->parms[aK5].items)
+ 	authtype |= FORCE_RXK5;
+     if (as->parms[aK4].items)
+ 	authtype |= FORCE_RXKAD;
+     if (!authtype)
+ 	authtype |= env_afs_rxk5_default();
+ #endif
+ 
+     cell = as->parms[aCELL].items ? as->parms[aCELL].items->data : 0;
+     if ((code = afsconf_GetCellInfo(tdir, cell, "afsprot", cellconfig))) {
+ 	if (cell)
+ 	    afs_com_err(rn, code, "Can't get cell information for '%s'", cell);
+ 	else
+ 	    afs_com_err(rn, code, "Can't get determine local cell!");
+ 	KLOGEXIT(code);
+     }
+ 
+     if (as->parms[aKRBREALM].items) {
+ 	code = krb5_set_default_realm(k5context,
+ 		(const char *) as->parms[aKRBREALM].items);
+ 	if (code) {
+ 	    afs_com_err(rn, code, "Can't make <%s> the default realm",
+ 		as->parms[aKRBREALM].items);
+ 	    KLOGEXIT(code);
+ 	}
+     }
+     else if ((code = krb5_get_host_realm(k5context, cellconfig->hostName[0], &hrealms))) {
+ 	afs_com_err(rn, code, "Can't get realm for host <%s> in cell <%s>\n",
+ 		cellconfig->hostName[0], cellconfig->name);
+ 	KLOGEXIT(code);
+     } else {
+ 	if (hrealms && *hrealms) {
+ 	    code = krb5_set_default_realm(k5context,
+ 		    *hrealms);
+ 	    if (code) {
+ 		afs_com_err(rn, code, "Can't make <%s> the default realm",
+ 		    *hrealms);
+ 		KLOGEXIT(code);
+ 	    }
+ 	}
+ 	if (hrealms) krb5_free_host_realm(k5context, hrealms);
+     }
+ 
+     id = getuid();
+     if (as->parms[aPRINCIPAL].items) {
+ 	pname = as->parms[aPRINCIPAL].items->data;
+     } else {
+ 	/* No explicit name provided: use Unix uid. */
+ 	struct passwd *pw;
+ 	pw = getpwuid(id);
+ 	if (pw == 0) {
+ 	    afs_com_err(rn, 0,
+ 		"Can't figure out your name from your user id (%d).", id);
+ 	    if (!Silent)
+ 		fprintf(stderr, "%s: Try providing the user name.\n", rn);
+ 	    KLOGEXIT(1);
+ 	}
+ 	pname = pw->pw_name;
+     }
+     code = krb5_parse_name(k5context, pname, &princ);
+     if (code) {
+ 	afs_com_err(rn, code, "Can't parse principal <%s>", pname);
+ 	KLOGEXIT(code);
+     }
+ 
+     if (as->parms[aPASSWORD].items) {
+ 	/*
+ 	 * Current argument is the desired password string.  Remember it in
+ 	 * our local buffer, and zero out the argument string - anyone can
+ 	 * see it there with ps!
+ 	 */
+ 	strncpy(passwd, as->parms[aPASSWORD].items->data, sizeof(passwd));
+ 	memset(as->parms[aPASSWORD].items->data, 0,
+ 	       strlen(as->parms[aPASSWORD].items->data));
+ 	pass = passwd;
+     }
+ 
+     if (as->parms[aLIFETIME].items) {
+ 	char *life = as->parms[aLIFETIME].items->data;
+ 	char *sp;		/* string ptr to rest of life */
+ 	lifetime = 3600 * strtol(life, &sp, 0);	/* hours */
+ 	if (sp == life) {
+ 	  bad_lifetime:
+ 	    if (!Silent)
+ 		fprintf(stderr, "%s: translating '%s' to lifetime failed\n",
+ 			rn, life);
+ 	    return 1;
+ 	}
+ 	if (*sp == ':') {
+ 	    life = sp + 1;	/* skip the colon */
+ 	    lifetime += 60 * strtol(life, &sp, 0);	/* minutes */
+ 	    if (sp == life)
+ 		goto bad_lifetime;
+ 	    if (*sp == ':') {
+ 		life = sp + 1;
+ 		lifetime += strtol(life, &sp, 0);	/* seconds */
+ 		if (sp == life)
+ 		    goto bad_lifetime;
+ 		if (*sp)
+ 		    goto bad_lifetime;
+ 	    } else if (*sp)
+ 		goto bad_lifetime;
+ 	} else if (*sp)
+ 	    goto bad_lifetime;
+     } else
+ 	lifetime = 0;
+ 
+     /* Get the password if it wasn't provided. */
+     if (!pass) {
+ 	if (Pipe) {
+ 	    strncpy(passwd, getpipepass(), sizeof(passwd));
+ 	    pass = passwd;
+ 	} else {
+ 	    pf = klog_prompter;
+ 	    pa = (char *)klog_arg;
+ 	}
+     }
+ 
+     service = 0;
+ #ifdef AFS_RXK5
+     if (authtype & FORCE_RXK5) {
+ 	tofree = get_afs_krb5_svc_princ(cellconfig);
+ 	snprintf(service_temp, sizeof service_temp, "%s", tofree);
+     } else
+ #endif
+     snprintf (service_temp, sizeof service_temp, "afs/%s", cellconfig->name);
+     if (writeTicketFile)
+ 	service = 0;
+     else 
+ 	service = service_temp;
+ 
+     klog_arg->pp = &pass;
+     klog_arg->pstore = passwd;
+     /* XXX should allow k5 to prompt in most cases -- what about expired pw?*/
+     krb5_get_init_creds_opt_init(gic_opts);
+     for (;;) {
+ 	code = krb5_get_init_creds_password(k5context,
+ 	    incred,
+ 	    princ,
+ 	    pass,
+ 	    pf,	/* prompter */
+ 	    pa,	/* data */
+ 	    0,	/* start_time */
+ 	    service,	/* in_tkt_service */
+ 	    gic_opts);
+ 	if (code != KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN || service != service_temp) break;
+ #ifdef AFS_RXK5
+ 	if (authtype & FORCE_RXK5) break;
+ #endif
+ 	service = "afs";
+     }
+     memset(passwd, 0, sizeof(passwd));
+     if (code) {
+ 	char *r = 0;
+ 	if (krb5_get_default_realm(k5context, &r))
+ 	    r = 0;
+ 	if (service)
+ 	    afs_com_err(rn, code, "Unable to authenticate to use %s", service);
+ 	else if (r)
+ 	    afs_com_err(rn, code, "Unable to authenticate in realm %s", r);
+ 	else
+ 	    afs_com_err(rn, code, "Unable to authenticate to use cell %s",
+ 		cellconfig->name);
+ 	if (r) free(r);
+ 	KLOGEXIT(code);
+     }
+ 
+     if (service) {
+ 	afscred = incred;
+     } else {
+ 	for (;;writeTicketFile = 0) {
+ 	    if (writeTicketFile) {
+ 		what = "getting default ccache";
+ 		code = krb5_cc_default(k5context, &cc);
+ 	    } else {
+ 		what = "krb5_cc_resolve";
+ 		code = krb5_cc_resolve(k5context, "MEMORY:core", &cc);
+ 		if (code) goto Failed;
+ 	    }
+ 	    what = "initializing ccache";
+ 	    code = krb5_cc_initialize(k5context, cc, princ);
+ 	    if (code) goto Failed;
+ 	    what = "writing Kerberos ticket file";
+ 	    code = krb5_cc_store_cred(k5context, cc, incred);
+ 	    if (code) goto Failed;
+ 	    if (writeTicketFile)
+ 		fprintf(stderr,
+ 		    "Wrote ticket file to %s\n",
+ 		    krb5_cc_get_name(k5context, cc));
+ 	    break;
+ 	Failed:
+ 	    if (code)
+ 		afs_com_err(rn, code, what);
+ 	    if (writeTicketFile) {
+ 		if (cc) {
+ 		    krb5_cc_close(k5context, cc);
+ 		    cc = 0;
+ 		}
+ 		continue;
+ 	    }
+ 	    KLOGEXIT(code);
+ 	}
+ 
+ 	for (service = service_temp;;service = "afs") {
+ 	    memset(mcred, 0, sizeof *mcred);
+ 	    mcred->client = princ;
+ 	    code = krb5_parse_name(k5context, service, &mcred->server);
+ 	    if (code) {
+ 		afs_com_err(rn, code, "Unable to parse service <%s>\n", service);
+ 		KLOGEXIT(code);
+ 	    }
+ 	    if (tofree) { free(tofree); tofree = 0; }
+ 	    if (!(code = krb5_unparse_name(k5context, mcred->server, &outname)))
+ 		tofree = outname;
+ 	    else outname = service;
+ 	    code = krb5_get_credentials(k5context, 0, cc, mcred, &outcred);
+ 	    krb5_free_principal(k5context, mcred->server);
+ 	    if (code != KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN || service != service_temp) break;
+ #ifdef AFS_RXK5
+ 	    if (authtype & FORCE_RXK5) break;
+ #endif
+ 	}
+ 	afscred = outcred;
+     }
+     if (code) {
+ 	afs_com_err(rn, code, "Unable to get credentials to use %s", outname);
+ 	KLOGEXIT(code);
+     }
+ 
+ #ifdef AFS_RXK5
+     if (authtype & FORCE_RXK5) {
+ 	struct ktc_principal aserver[1];
+ 	int viceid = 555;
+ 
+ 	memset(aserver, 0, sizeof *aserver);
+ 	strncpy(aserver->cell, cellconfig->name, MAXKTCREALMLEN-1);
+ 	code = ktc_SetK5Token(k5context, aserver, afscred, viceid, dosetpag);
+ 	if (code) {
+ 	    afs_com_err(rn, code, "Unable to store tokens for cell %s\n",
+ 		cellconfig->name);
+ 	    KLOGEXIT(1);
+ 	}
+     } else
+ #endif
+     {
+ 	struct ktc_principal aserver[1], aclient[1];
+ 	struct ktc_token atoken[1];
+ 
+ 	memset(atoken, 0, sizeof *atoken);
+ 	if (evil) {
+ 	    atoken->kvno = RXKAD_TKT_TYPE_KERBEROS_V5_ENCPART_ONLY;
+ 	    if (afs_krb5_skip_ticket_wrapper(afscred->ticket.data,
+ 			afscred->ticket.length, &enc_part->data,
+ 			&enc_part->length)) {
+ 		afs_com_err(rn, 0, "Can't unwrap %s AFS credential",
+ 		    cellconfig->name);
+ 		KLOGEXIT(1);
+ 	    }
+ 	} else {
+ 	    atoken->kvno = RXKAD_TKT_TYPE_KERBEROS_V5;
+ 	    *enc_part = afscred->ticket;
+ 	}
+ 	atoken->startTime = afscred->times.starttime;
+ 	atoken->endTime = afscred->times.endtime;
+ 	memcpy(&atoken->sessionKey, get_cred_keydata(afscred),
+ 	    get_cred_keylen(afscred));
+ 	memcpy(atoken->ticket, enc_part->data,
+ 	    atoken->ticketLen = enc_part->length);
+ 	memset(aserver, 0, sizeof *aserver);
+ 	strncpy(aserver->name, "afs", 4);
+ 	strncpy(aserver->cell, cellconfig->name, MAXKTCREALMLEN-1);
+ 	memset(aclient, 0, sizeof *aclient);
+ 	i = realm_len(k5context, afscred->client);
+ 	if (i > MAXKTCREALMLEN-1) i = MAXKTCREALMLEN-1;
+ 	memcpy(aclient->cell, realm_data(k5context, afscred->client), i);
+ 	if (!noprdb) {
+ 	    int viceid;
+ 	    k5_to_k4_name(k5context, afscred->client, aclient);
+ 	    code = whoami(atoken, cellconfig, aclient, &viceid);
+ 	    if (code) {
+ 		afs_com_err(rn, code, "Can't get your viceid", cellconfig->name);
+ 		*aclient->name = 0;
+ 	    } else
+ 		snprintf(aclient->name, MAXKTCNAMELEN-1, "AFS ID %d", viceid);
+ 	}
+ 	if (!*aclient->name)
+ 	    k5_to_k4_name(k5context, afscred->client, aclient);
+ 	code = ktc_SetToken(aserver, atoken, aclient, dosetpag);
+ 	if (code) {
+ 	    afs_com_err(rn, code, "Unable to store tokens for cell %s\n",
+ 		cellconfig->name);
+ 	    KLOGEXIT(1);
+ 	}
+     }
+ 
+     krb5_free_principal(k5context, princ);
+     krb5_free_cred_contents(k5context, incred);
+     if (outcred) krb5_free_creds(k5context, outcred);
+     if (cc)
+ 	krb5_cc_close(k5context, cc);
+     if (tofree) free(tofree);
+ 
+     return 0;
+ }
Index: openafs/src/aklog/krb_util.c
diff -c openafs/src/aklog/krb_util.c:1.1.2.5 openafs/src/aklog/krb_util.c:1.1.2.6
*** openafs/src/aklog/krb_util.c:1.1.2.5	Sat Feb 10 08:56:54 2007
--- openafs/src/aklog/krb_util.c	Tue Apr  1 13:44:52 2008
***************
*** 9,18 ****
   * <mit-copyright.h>.
   */
  
! #ifndef lint
! static char rcsid_send_to_kdc_c[] =
! "$Id: krb_util.c,v 1.1.2.5 2007/02/10 13:56:54 jaltman Exp $";
! #endif /* lint */
  
  #if 0
  #include <kerberosIV/mit-copyright.h>
--- 9,17 ----
   * <mit-copyright.h>.
   */
  
! #include <afsconfig.h>
! RCSID
!     ("$Header: /cvs/openafs/src/aklog/krb_util.c,v 1.1.2.6 2008/04/01 17:44:52 shadow Exp $");
  
  #if 0
  #include <kerberosIV/mit-copyright.h>
***************
*** 25,42 ****
  #define MAX_HSTNM 100
  #endif
  
- #ifdef WINDOWS
- 
- #include "aklog.h"		/* for struct afsconf_cell */
- 
- #else /* !WINDOWS */
- 
- #include <afs/param.h>
  #include <afs/cellconfig.h>
  
- #endif /* WINDOWS */
- 
  #include <string.h>
  
  #define S_AD_SZ sizeof(struct sockaddr_in)
  
--- 24,33 ----
  #define MAX_HSTNM 100
  #endif
  
  #include <afs/cellconfig.h>
  
  #include <string.h>
+ #include <ctype.h>
  
  #define S_AD_SZ sizeof(struct sockaddr_in)
  
***************
*** 61,68 ****
  		*p = toupper(*p);
  	}
      } else {
! 	if (retval = krb5_get_host_realm(context,
! 					 cellconfig->hostName[0], &hrealms))
  	    return 0; 
  	if(!hrealms[0]) return 0;
  	strcpy(krbrlm, hrealms[0]);
--- 52,59 ----
  		*p = toupper(*p);
  	}
      } else {
! 	if ((retval = krb5_get_host_realm(context,
! 					 cellconfig->hostName[0], &hrealms)))
  	    return 0; 
  	if(!hrealms[0]) return 0;
  	strcpy(krbrlm, hrealms[0]);
Index: openafs/src/aklog/linked_list.c
diff -c openafs/src/aklog/linked_list.c:1.1.2.2 openafs/src/aklog/linked_list.c:1.1.2.3
*** openafs/src/aklog/linked_list.c:1.1.2.2	Fri Jul 15 12:11:24 2005
--- openafs/src/aklog/linked_list.c	Tue Apr  1 13:44:52 2008
***************
*** 1,5 ****
  /* 
!  * $Id: linked_list.c,v 1.1.2.2 2005/07/15 16:11:24 rra Exp $
   * 
   * This file contains general linked list routines.
   * 
--- 1,5 ----
  /* 
!  * $Id: linked_list.c,v 1.1.2.3 2008/04/01 17:44:52 shadow Exp $
   * 
   * This file contains general linked list routines.
   * 
***************
*** 7,15 ****
   * For distribution and copying rights, see the file "mit-copyright.h"
   */
  
! #if !defined(lint) && !defined(SABER)
! static char *rcsid_list_c = "$Id: linked_list.c,v 1.1.2.2 2005/07/15 16:11:24 rra Exp $";
! #endif /* lint || SABER */
  
  #include <stdio.h>
  #include <stdlib.h>
--- 7,15 ----
   * For distribution and copying rights, see the file "mit-copyright.h"
   */
  
! #include <afsconfig.h>
! RCSID
!     ("$Header: /cvs/openafs/src/aklog/linked_list.c,v 1.1.2.3 2008/04/01 17:44:52 shadow Exp $");
  
  #include <stdio.h>
  #include <stdlib.h>
***************
*** 46,56 ****
      }
  
      /* This sets everything to zero, which is what we want. */
- #ifdef WINDOWS
- 	memset(list, 0, sizeof(linked_list));
- #else
      bzero((char *)list, sizeof(linked_list));
- #endif /* WINDOWS */
  }
  
  ll_node *ll_add_node(linked_list *list, ll_end which_end)
--- 46,52 ----
***************
*** 164,173 ****
        case ll_s_add:
  	/* Add a string to the list. */
  	if (!ll_string(list, ll_s_check, string)) {
! 	    if (cur_node = ll_add_node(list, ll_tail)) {
  		char *new_string;
! 		if (new_string = (char *)calloc(strlen(string) + 1, 
! 						sizeof(char))) {
  		    strcpy(new_string, string);
  		    ll_add_data(cur_node, new_string);
  		}
--- 160,169 ----
        case ll_s_add:
  	/* Add a string to the list. */
  	if (!ll_string(list, ll_s_check, string)) {
! 	    if ((cur_node = ll_add_node(list, ll_tail))) {
  		char *new_string;
! 		if ((new_string = (char *)calloc(strlen(string) + 1, 
! 						sizeof(char)))) {
  		    strcpy(new_string, string);
  		    ll_add_data(cur_node, new_string);
  		}
Index: openafs/src/aklog/linked_list.h
diff -c openafs/src/aklog/linked_list.h:1.1.2.1 openafs/src/aklog/linked_list.h:1.1.2.2
*** openafs/src/aklog/linked_list.h:1.1.2.1	Tue Dec  7 00:51:24 2004
--- openafs/src/aklog/linked_list.h	Tue Apr  1 13:44:52 2008
***************
*** 1,5 ****
  /* 
!  * $Id: linked_list.h,v 1.1.2.1 2004/12/07 05:51:24 shadow Exp $
   *
   * This is the header file for a general list linked package.
   * 
--- 1,5 ----
  /* 
!  * $Id: linked_list.h,v 1.1.2.2 2008/04/01 17:44:52 shadow Exp $
   *
   * This is the header file for a general list linked package.
   * 
***************
*** 10,19 ****
  #ifndef __LINKED_LIST_H__
  #define __LINKED_LIST_H__
  
- #if !defined(lint) && !defined(SABER)
- static char *rcsid_linked_list_h = "$Id: linked_list.h,v 1.1.2.1 2004/12/07 05:51:24 shadow Exp $";
- #endif /* lint || SABER */
- 
  #define LL_SUCCESS 0
  #define LL_FAILURE -1
  
--- 10,15 ----
Index: openafs/src/aklog/skipwrap.c
diff -c /dev/null openafs/src/aklog/skipwrap.c:1.1.12.3
*** /dev/null	Mon Apr 28 17:55:43 2008
--- openafs/src/aklog/skipwrap.c	Tue Apr  1 13:44:52 2008
***************
*** 0 ****
--- 1,125 ----
+ 
+ /*
+  * Copyright (c) 2006
+  * The Regents of the University of Michigan
+  * ALL RIGHTS RESERVED
+  *
+  * Permission is granted to use, copy, create derivative works
+  * and redistribute this software and such derivative works
+  * for any purpose, so long as the name of the University of
+  * Michigan is not used in any advertising or publicity
+  * pertaining to the use or distribution of this software
+  * without specific, written prior authorization.  If the
+  * above copyright notice or any other identification of the
+  * University of Michigan is included in any copy of any
+  * portion of this software, then the disclaimer below must
+  * also be included.
+  *
+  * This software is provided as is, without representation
+  * from the University of Michigan as to its fitness for any
+  * purpose, and without warranty by the University of
+  * Michigan of any kind, either express or implied, including
+  * without limitation the implied warranties of
+  * merchantability and fitness for a particular purpose.  The
+  * regents of the University of Michigan shall not be liable
+  * for any damages, including special, indirect, incidental, or
+  * consequential damages, with respect to any claim arising
+  * out of or in connection with the use of the software, even
+  * if it has been or is hereafter advised of the possibility of
+  * such damages.
+  */
+ 
+ #include <afsconfig.h>
+ #include <afs/param.h>
+ #include <stdio.h>
+ #include <aklog.h>
+ #include <krb5.h>
+ #include "skipwrap.h"
+ 
+ /* evil hack */
+ #define SEQUENCE 16
+ #define CONSTRUCTED 32
+ #define APPLICATION 64
+ #define CONTEXT_SPECIFIC 128
+ static int skip_get_number(char **pp, size_t *lp, int *np)
+ {
+     unsigned l;
+     int r, n, i;
+     char *p;
+ 
+     l = *lp;
+     if (l < 1) {
+ #ifdef DEBUG
+ 	fprintf(stderr, "skip_bad_number: missing number\n");
+ #endif
+ 	return -1;
+     }
+     p = *pp;
+     r = (unsigned char)*p;
+     ++p; --l;
+     if (r & 0x80) {
+ 	n = (r&0x7f);
+ 	if (l < n) {
+ #ifdef DEBUG
+ 	    fprintf(stderr, "skip_bad_number: truncated number\n");
+ #endif
+ 	    return -1;
+ 	}
+ 	r = 0;
+ 	for (i = n; --i >= 0; ) {
+ 	    r <<= 8;
+ 	    r += (unsigned char)*p;
+ 	    ++p; --l;
+ 	}
+     }
+     *np = r;
+     *pp = p;
+     *lp = l;
+     return 0;
+ }
+ 
+ int
+ afs_krb5_skip_ticket_wrapper(char *tix, size_t tixlen, char **enc, size_t *enclen)
+ {
+     char *p = tix;
+     size_t l = tixlen;
+     int code;
+     int num;
+ 
+     if (l < 1) return -1;
+     if (*p != (char) (CONSTRUCTED+APPLICATION+1)) return -1;
+     ++p; --l;
+     if ((code = skip_get_number(&p, &l, &num))) return code;
+     if (l != num) return -1;
+     if (l < 1) return -1;
+     if (*p != (char)(CONSTRUCTED+SEQUENCE)) return -1;
+     ++p; --l;
+     if ((code = skip_get_number(&p, &l, &num))) return code;
+     if (l != num) return -1;
+     if (l < 1) return -1;
+     if (*p != (char)(CONSTRUCTED+CONTEXT_SPECIFIC+0)) return -1;
+     ++p; --l;
+     if ((code = skip_get_number(&p, &l, &num))) return code;
+     if (l < num) return -1;
+     l -= num; p += num;
+     if (l < 1) return -1;
+     if (*p != (char)(CONSTRUCTED+CONTEXT_SPECIFIC+1)) return -1;
+     ++p; --l;
+     if ((code = skip_get_number(&p, &l, &num))) return code;
+     if (l < num) return -1;
+     l -= num; p += num;
+     if (l < 1) return -1;
+     if (*p != (char)(CONSTRUCTED+CONTEXT_SPECIFIC+2)) return -1;
+     ++p; --l;
+     if ((code = skip_get_number(&p, &l, &num))) return code;
+     if (l < num) return -1;
+     l -= num; p += num;
+     if (l < 1) return -1;
+     if (*p != (char)(CONSTRUCTED+CONTEXT_SPECIFIC+3)) return -1;
+     ++p; --l;
+     if ((code = skip_get_number(&p, &l, &num))) return code;
+     if (l != num) return -1;
+     *enc = p;
+     *enclen = l;
+     return 0;
+ }
Index: openafs/src/aklog/skipwrap.h
diff -c /dev/null openafs/src/aklog/skipwrap.h:1.1.4.2
*** /dev/null	Mon Apr 28 17:55:43 2008
--- openafs/src/aklog/skipwrap.h	Tue Apr  1 13:44:52 2008
***************
*** 0 ****
--- 1,8 ----
+ #ifndef _AKLOG_SKIPWRAP_H
+ #define _AKLOG_SKIPWRAP_H
+ 
+ int afs_krb5_skip_ticket_wrapper(char *tix, size_t tixlen, char **enc, 
+ 				 size_t *enclen);
+ 
+ #endif
+ 
Index: openafs/src/auth/authcon.c
diff -c openafs/src/auth/authcon.c:1.13.2.1 openafs/src/auth/authcon.c:1.13.2.3
*** openafs/src/auth/authcon.c:1.13.2.1	Wed Aug 25 03:09:36 2004
--- openafs/src/auth/authcon.c	Thu Nov  1 12:09:43 2007
***************
*** 15,21 ****
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/auth/authcon.c,v 1.13.2.1 2004/08/25 07:09:36 shadow Exp $");
  
  #if defined(UKERNEL)
  #include "afs/sysincludes.h"
--- 15,21 ----
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/auth/authcon.c,v 1.13.2.3 2007/11/01 16:09:43 shadow Exp $");
  
  #if defined(UKERNEL)
  #include "afs/sysincludes.h"
***************
*** 23,28 ****
--- 23,29 ----
  #include "afs/stds.h"
  #include "afs/pthread_glock.h"
  #include "des/des.h"
+ #include "des/des_prototypes.h"
  #include "rx/rxkad.h"
  #include "rx/rx.h"
  #include "afs/cellconfig.h"
***************
*** 41,47 ****
--- 42,51 ----
  #include <netinet/in.h>
  #include <netdb.h>
  #endif
+ #include <string.h>
+ #include <stdio.h>
  #include <des.h>
+ #include <des_prototypes.h>
  #include <rx/rxkad.h>
  #include <rx/rx.h>
  #include "cellconfig.h"
***************
*** 51,59 ****
  
  /* return a null security object if nothing else can be done */
  static afs_int32
! QuickAuth(astr, aindex)
!      struct rx_securityClass **astr;
!      afs_int32 *aindex;
  {
      register struct rx_securityClass *tc;
      tc = rxnull_NewClientSecurityObject();
--- 55,61 ----
  
  /* return a null security object if nothing else can be done */
  static afs_int32
! QuickAuth(struct rx_securityClass **astr, afs_int32 *aindex)
  {
      register struct rx_securityClass *tc;
      tc = rxnull_NewClientSecurityObject();
***************
*** 65,74 ****
  #if !defined(UKERNEL)
  /* Return an appropriate security class and index */
  afs_int32
! afsconf_ServerAuth(adir, astr, aindex)
!      register struct afsconf_dir *adir;
!      struct rx_securityClass **astr;
!      afs_int32 *aindex;
  {
      register struct rx_securityClass *tclass;
  
--- 67,75 ----
  #if !defined(UKERNEL)
  /* Return an appropriate security class and index */
  afs_int32
! afsconf_ServerAuth(register struct afsconf_dir *adir, 
! 		   struct rx_securityClass **astr, 
! 		   afs_int32 *aindex)
  {
      register struct rx_securityClass *tclass;
  
***************
*** 88,98 ****
  #endif /* !defined(UKERNEL) */
  
  static afs_int32
! GenericAuth(adir, astr, aindex, enclevel)
!      struct afsconf_dir *adir;
!      struct rx_securityClass **astr;
!      afs_int32 *aindex;
!      rxkad_level enclevel;
  {
      char tbuffer[256];
      struct ktc_encryptionKey key, session;
--- 89,98 ----
  #endif /* !defined(UKERNEL) */
  
  static afs_int32
! GenericAuth(struct afsconf_dir *adir, 
! 	    struct rx_securityClass **astr, 
! 	    afs_int32 *aindex, 
! 	    rxkad_level enclevel)
  {
      char tbuffer[256];
      struct ktc_encryptionKey key, session;
***************
*** 159,168 ****
   * tells rxkad to encrypt the data, too.
   */
  afs_int32
! afsconf_ClientAuthSecure(adir, astr, aindex)
!      struct afsconf_dir *adir;
!      struct rx_securityClass **astr;
!      afs_int32 *aindex;
  {
      afs_int32 rc;
  
--- 159,167 ----
   * tells rxkad to encrypt the data, too.
   */
  afs_int32
! afsconf_ClientAuthSecure(struct afsconf_dir *adir, 
! 			 struct rx_securityClass **astr, 
! 			 afs_int32 *aindex)
  {
      afs_int32 rc;
  
Index: openafs/src/auth/cellconfig.c
diff -c openafs/src/auth/cellconfig.c:1.40.2.14 openafs/src/auth/cellconfig.c:1.40.2.19
*** openafs/src/auth/cellconfig.c:1.40.2.14	Sat Dec 30 11:56:39 2006
--- openafs/src/auth/cellconfig.c	Fri Nov  2 14:26:38 2007
***************
*** 11,23 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/auth/cellconfig.c,v 1.40.2.14 2006/12/30 16:56:39 jaltman Exp $");
  
  #include <afs/stds.h>
  #include <afs/pthread_glock.h>
  #ifdef UKERNEL
  #include "afs/sysincludes.h"
  #include "afsincludes.h"
  #else /* UKERNEL */
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
--- 11,25 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/auth/cellconfig.c,v 1.40.2.19 2007/11/02 18:26:38 shadow Exp $");
  
  #include <afs/stds.h>
  #include <afs/pthread_glock.h>
  #ifdef UKERNEL
  #include "afs/sysincludes.h"
  #include "afsincludes.h"
+ #include "des/des.h"
+ #include "rx/rxkad.h"
  #else /* UKERNEL */
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
***************
*** 47,62 ****
  #include <stdlib.h>
  #include <sys/stat.h>
  #include <fcntl.h>
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #ifdef HAVE_UNISTD_H
  #include <unistd.h>
  #endif
  #endif /* UKERNEL */
  #include <afs/afsutil.h>
  #include "cellconfig.h"
--- 49,60 ----
  #include <stdlib.h>
  #include <sys/stat.h>
  #include <fcntl.h>
  #include <string.h>
  #ifdef HAVE_UNISTD_H
  #include <unistd.h>
  #endif
+ #include <rx/rxkad.h>
+ #include <rx/rx.h>
  #endif /* UKERNEL */
  #include <afs/afsutil.h>
  #include "cellconfig.h"
***************
*** 311,317 ****
  static int
  afsconf_Check(register struct afsconf_dir *adir)
  {
!     char tbuffer[256], *p;
      struct stat tstat;
      register afs_int32 code;
  
--- 309,318 ----
  static int
  afsconf_Check(register struct afsconf_dir *adir)
  {
!     char tbuffer[256];
! #ifdef AFS_NT40_ENV
!     char *p;
! #endif
      struct stat tstat;
      register afs_int32 code;
  
***************
*** 357,365 ****
  static int
  afsconf_Touch(register struct afsconf_dir *adir)
  {
!     char tbuffer[256], *p;
  #ifndef AFS_NT40_ENV
      struct timeval tvp[2];
  #endif
  
      adir->timeRead = 0;		/* just in case */
--- 358,368 ----
  static int
  afsconf_Touch(register struct afsconf_dir *adir)
  {
!     char tbuffer[256];
  #ifndef AFS_NT40_ENV
      struct timeval tvp[2];
+ #else
+     char *p;
  #endif
  
      adir->timeRead = 0;		/* just in case */
***************
*** 781,788 ****
  /* call aproc(entry, arock, adir) for all cells.  Proc must return 0, or we'll stop early and return the code it returns */
  int
  afsconf_CellApply(struct afsconf_dir *adir,
! 		  int (*aproc) (struct afsconf_cell * cell, char *arock,
! 				struct afsconf_dir * dir), char *arock)
  {
      register struct afsconf_entry *tde;
      register afs_int32 code;
--- 784,791 ----
  /* call aproc(entry, arock, adir) for all cells.  Proc must return 0, or we'll stop early and return the code it returns */
  int
  afsconf_CellApply(struct afsconf_dir *adir,
! 		  int (*aproc) (struct afsconf_cell * cell, void *arock,
! 				struct afsconf_dir * dir), void *arock)
  {
      register struct afsconf_entry *tde;
      register afs_int32 code;
***************
*** 804,811 ****
  int
  afsconf_CellAliasApply(struct afsconf_dir *adir,
  		       int (*aproc) (struct afsconf_cellalias * alias,
! 				     char *arock, struct afsconf_dir * dir),
! 		       char *arock)
  {
      register struct afsconf_aliasentry *tde;
      register afs_int32 code;
--- 807,814 ----
  int
  afsconf_CellAliasApply(struct afsconf_dir *adir,
  		       int (*aproc) (struct afsconf_cellalias * alias,
! 				     void *arock, struct afsconf_dir * dir),
! 		       void *arock)
  {
      register struct afsconf_aliasentry *tde;
      register afs_int32 code;
***************
*** 1282,1288 ****
  
  /* get latest key */
  afs_int32
! afsconf_GetLatestKey(struct afsconf_dir * adir, afs_int32 * avno, char *akey)
  {
      register int i;
      int maxa;
--- 1285,1292 ----
  
  /* get latest key */
  afs_int32
! afsconf_GetLatestKey(struct afsconf_dir * adir, afs_int32 * avno, 
! 		     struct ktc_encryptionKey *akey)
  {
      register int i;
      int maxa;
***************
*** 1323,1330 ****
  
  /* get a particular key */
  int
! afsconf_GetKey(struct afsconf_dir *adir, afs_int32 avno, char *akey)
  {
      register int i, maxa;
      register struct afsconf_key *tk;
      register afs_int32 code;
--- 1327,1335 ----
  
  /* get a particular key */
  int
! afsconf_GetKey(void *rock, afs_int32 avno, struct ktc_encryptionKey *akey)
  {
+     struct afsconf_dir *adir = (struct afsconf_dir *) rock;
      register int i, maxa;
      register struct afsconf_key *tk;
      register afs_int32 code;
Index: openafs/src/auth/cellconfig.p.h
diff -c openafs/src/auth/cellconfig.p.h:1.11 openafs/src/auth/cellconfig.p.h:1.11.2.2
*** openafs/src/auth/cellconfig.p.h:1.11	Tue Jul 15 19:14:41 2003
--- openafs/src/auth/cellconfig.p.h	Fri Nov  2 13:47:00 2007
***************
*** 101,114 ****
  extern struct afsconf_dir *afsconf_Open(register const char *adir);
  extern int afsconf_CellApply(struct afsconf_dir *adir,
  			     int (*aproc) (struct afsconf_cell * cell,
! 					   char *arock,
  					   struct afsconf_dir * dir),
! 			     char *arock);
  extern int afsconf_CellAliasApply(struct afsconf_dir *adir,
  				  int (*aproc) (struct afsconf_cellalias *
! 						alias, char *arock,
  						struct afsconf_dir * dir),
! 				  char *arock);
  extern int afsconf_GetExtendedCellInfo(struct afsconf_dir *adir,
  				       char *acellName, char *aservice,
  				       struct afsconf_cell *acellInfo,
--- 101,114 ----
  extern struct afsconf_dir *afsconf_Open(register const char *adir);
  extern int afsconf_CellApply(struct afsconf_dir *adir,
  			     int (*aproc) (struct afsconf_cell * cell,
! 					   void *arock,
  					   struct afsconf_dir * dir),
! 			     void *arock);
  extern int afsconf_CellAliasApply(struct afsconf_dir *adir,
  				  int (*aproc) (struct afsconf_cellalias *
! 						alias, void *arock,
  						struct afsconf_dir * dir),
! 				  void *arock);
  extern int afsconf_GetExtendedCellInfo(struct afsconf_dir *adir,
  				       char *acellName, char *aservice,
  				       struct afsconf_cell *acellInfo,
***************
*** 125,133 ****
  extern int afsconf_GetKeys(struct afsconf_dir *adir,
  			   struct afsconf_keys *astr);
  extern afs_int32 afsconf_GetLatestKey(struct afsconf_dir *adir,
! 				      afs_int32 * avno, char *akey);
! extern int afsconf_GetKey(struct afsconf_dir *adir, afs_int32 avno,
! 			  char *akey);
  extern int afsconf_AddKey(struct afsconf_dir *adir, afs_int32 akvno,
  			  char akey[8], afs_int32 overwrite);
  extern int afsconf_DeleteKey(struct afsconf_dir *adir, afs_int32 akvno);
--- 125,134 ----
  extern int afsconf_GetKeys(struct afsconf_dir *adir,
  			   struct afsconf_keys *astr);
  extern afs_int32 afsconf_GetLatestKey(struct afsconf_dir *adir,
! 				      afs_int32 * avno, 
! 				      struct ktc_encryptionKey *akey);
! extern int afsconf_GetKey(void *rock, afs_int32 avno,
! 			  struct ktc_encryptionKey *akey);
  extern int afsconf_AddKey(struct afsconf_dir *adir, afs_int32 akvno,
  			  char akey[8], afs_int32 overwrite);
  extern int afsconf_DeleteKey(struct afsconf_dir *adir, afs_int32 akvno);
Index: openafs/src/auth/copyauth.c
diff -c openafs/src/auth/copyauth.c:1.6 openafs/src/auth/copyauth.c:1.6.2.2
*** openafs/src/auth/copyauth.c:1.6	Tue Jul 15 19:14:41 2003
--- openafs/src/auth/copyauth.c	Thu Nov  1 12:09:43 2007
***************
*** 11,26 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/auth/copyauth.c,v 1.6 2003/07/15 23:14:41 shadow Exp $");
  
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
- 
  #include <sys/types.h>
  #include "auth.h"
  #ifdef AFS_NT40_ENV
--- 11,19 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/auth/copyauth.c,v 1.6.2.2 2007/11/01 16:09:43 shadow Exp $");
  
  #include <string.h>
  #include <sys/types.h>
  #include "auth.h"
  #ifdef AFS_NT40_ENV
***************
*** 35,43 ****
  
  char whoami[256];
  
! main(argc, argv)
!      int argc;
!      char **argv;
  {
      char localName[64];
      register afs_int32 code;
--- 28,35 ----
  
  char whoami[256];
  
! int
! main(int argc, char **argv)
  {
      char localName[64];
      register afs_int32 code;
Index: openafs/src/auth/ktc.c
diff -c openafs/src/auth/ktc.c:1.15.2.7 openafs/src/auth/ktc.c:1.15.2.10
*** openafs/src/auth/ktc.c:1.15.2.7	Thu Aug  9 10:59:54 2007
--- openafs/src/auth/ktc.c	Thu Dec 13 13:54:09 2007
***************
*** 17,23 ****
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/auth/ktc.c,v 1.15.2.7 2007/08/09 14:59:54 shadow Exp $");
  
  #if defined(UKERNEL)
  #include "afs/sysincludes.h"
--- 17,23 ----
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/auth/ktc.c,v 1.15.2.10 2007/12/13 18:54:09 shadow Exp $");
  
  #if defined(UKERNEL)
  #include "afs/sysincludes.h"
***************
*** 40,45 ****
--- 40,46 ----
  #include <unistd.h>
  #endif
  #include <stdio.h>
+ #include <stdlib.h>
  #include <afs/stds.h>
  #include <afs/pthread_glock.h>
  #include <sys/types.h>
***************
*** 49,64 ****
  #include <errno.h>
  #include <sys/ioctl.h>
  #include <netinet/in.h>
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <afs/vice.h>
  #ifdef	AFS_AIX_ENV
  #include <sys/lockf.h>
  #endif
  #ifdef HAVE_UNISTD_H
  #include <unistd.h>
--- 50,63 ----
  #include <errno.h>
  #include <sys/ioctl.h>
  #include <netinet/in.h>
  #include <string.h>
  #include <afs/vice.h>
  #ifdef	AFS_AIX_ENV
  #include <sys/lockf.h>
+ #ifdef AFS_AIX51_ENV
+ #include <sys/cred.h>
+ #include <sys/pag.h>
+ #endif
  #endif
  #ifdef HAVE_UNISTD_H
  #include <unistd.h>
***************
*** 128,137 ****
  /* the following routines aren't static anymore on behalf of the kerberos IV
   * compatibility library built in subtree krb.
   */
! int afs_tf_init(), afs_tf_get_pname(), afs_tf_get_pinst(), afs_tf_get_cred();
! int afs_tf_save_cred(), afs_tf_close(), afs_tf_create();
! int afs_tf_dest_tkt();
! static void ktc_LocalCell();
  #endif /* AFS_KERBEROS_ENV */
  
  #ifdef AFS_DUX40_ENV
--- 127,142 ----
  /* the following routines aren't static anymore on behalf of the kerberos IV
   * compatibility library built in subtree krb.
   */
! int afs_tf_init(char *, int);
! int afs_tf_get_pname(char *);
! int afs_tf_get_pinst(char *);
! int afs_tf_get_cred(struct ktc_principal *, struct ktc_token *);
! int afs_tf_save_cred(struct ktc_principal *, struct ktc_token *, 
! 		     struct ktc_principal *);
! int afs_tf_close(void);
! int afs_tf_create(char *, char *);
! int afs_tf_dest_tkt(void);
! static void ktc_LocalCell(void);
  #endif /* AFS_KERBEROS_ENV */
  
  #ifdef AFS_DUX40_ENV
***************
*** 251,261 ****
   * now. */
  
  static int
! NewSetToken(aserver, atoken, aclient, flags)
!      struct ktc_principal *aserver;
!      struct ktc_principal *aclient;
!      struct ktc_token *atoken;
!      afs_int32 flags;
  {
      TRY_KERNEL(KTC_SETTOKEN_OP, aserver, aclient, atoken,
  	       sizeof(struct ktc_token));
--- 256,265 ----
   * now. */
  
  static int
! NewSetToken(struct ktc_principal *aserver, 
! 	    struct ktc_token *atoken, 
! 	    struct ktc_principal *aclient, 
!             afs_int32 flags)
  {
      TRY_KERNEL(KTC_SETTOKEN_OP, aserver, aclient, atoken,
  	       sizeof(struct ktc_token));
***************
*** 267,276 ****
  (3*sizeof(afs_int32)+MAXKTCTICKETLEN+sizeof(struct ClearToken)+MAXKTCREALMLEN)
  
  static int
! OldSetToken(aserver, atoken, aclient, flags)
!      struct ktc_principal *aserver, *aclient;
!      struct ktc_token *atoken;
!      afs_int32 flags;
  {
      struct ViceIoctl iob;
      char tbuffer[MAXPIOCTLTOKENLEN];
--- 271,278 ----
  (3*sizeof(afs_int32)+MAXKTCTICKETLEN+sizeof(struct ClearToken)+MAXKTCREALMLEN)
  
  static int
! OldSetToken(struct ktc_principal *aserver, struct ktc_token *atoken, 
! 	    struct ktc_principal *aclient, afs_int32 flags)
  {
      struct ViceIoctl iob;
      char tbuffer[MAXPIOCTLTOKENLEN];
***************
*** 414,425 ****
      return 0;
  }
  
! 
! ktc_SetToken(aserver, atoken, aclient, flags)
!      struct ktc_principal *aserver;
!      struct ktc_principal *aclient;
!      struct ktc_token *atoken;
!      afs_int32 flags;
  {
      int ncode, ocode;
  
--- 416,426 ----
      return 0;
  }
  
! int
! ktc_SetToken(struct ktc_principal *aserver,
!     struct ktc_token *atoken,
!     struct ktc_principal *aclient,
!     afs_int32 flags)
  {
      int ncode, ocode;
  
***************
*** 487,496 ****
  /* get token, given server we need and token buffer.  aclient will eventually
   * be set to our identity to the server.
   */
! ktc_GetToken(aserver, atoken, atokenLen, aclient)
!      struct ktc_principal *aserver, *aclient;
!      int atokenLen;
!      struct ktc_token *atoken;
  {
      struct ViceIoctl iob;
      char tbuffer[MAXPIOCTLTOKENLEN];
--- 488,496 ----
  /* get token, given server we need and token buffer.  aclient will eventually
   * be set to our identity to the server.
   */
! int
! ktc_GetToken(struct ktc_principal *aserver, struct ktc_token *atoken, 
! 	     int atokenLen, struct ktc_principal *aclient)
  {
      struct ViceIoctl iob;
      char tbuffer[MAXPIOCTLTOKENLEN];
***************
*** 502,508 ****
--- 502,510 ----
      afs_int32 temp;
      int maxLen;			/* biggest ticket we can copy */
      int tktLen;			/* server ticket length */
+ #ifdef AFS_KERBEROS_ENV
      char found = 0;
+ #endif
  
      LOCK_GLOBAL_MUTEX;
  #ifndef NO_AFS_CLIENT
***************
*** 540,547 ****
  		    found = 1;
  	    } else {
  		char tmpstring[MAXHOSTCHARS];
! 		afs_tf_get_pname(&tmpstring);
! 		afs_tf_get_pinst(&tmpstring);
  		found = 1;
  	    }
  	}
--- 542,549 ----
  		    found = 1;
  	    } else {
  		char tmpstring[MAXHOSTCHARS];
! 		afs_tf_get_pname(tmpstring);
! 		afs_tf_get_pinst(tmpstring);
  		found = 1;
  	    }
  	}
***************
*** 671,678 ****
   * NOT IMPLEMENTED YET!
   */
  #ifndef NO_AFS_CLIENT
! ktc_ForgetToken(aserver)
!      struct ktc_principal *aserver;
  {
      int rc;
  
--- 673,680 ----
   * NOT IMPLEMENTED YET!
   */
  #ifndef NO_AFS_CLIENT
! int
! ktc_ForgetToken(struct ktc_principal *aserver)
  {
      int rc;
  
***************
*** 689,697 ****
   * next rock in (*aindex).  (*aserver) is set to the relevant ticket on
   * success.  */
  
! ktc_ListTokens(aprevIndex, aindex, aserver)
!      int aprevIndex, *aindex;
!      struct ktc_principal *aserver;
  {
      struct ViceIoctl iob;
      char tbuffer[MAXPIOCTLTOKENLEN];
--- 691,700 ----
   * next rock in (*aindex).  (*aserver) is set to the relevant ticket on
   * success.  */
  
! int
! ktc_ListTokens(int aprevIndex,
!     int *aindex,
!     struct ktc_principal *aserver)
  {
      struct ViceIoctl iob;
      char tbuffer[MAXPIOCTLTOKENLEN];
***************
*** 841,847 ****
  /* discard all tokens from this user's cache */
  
  static int
! NewForgetAll()
  {
  #ifndef NO_AFS_CLIENT
      TRY_KERNEL(KTC_FORGETALLTOKENS_OP, 0, 0, 0, 0);
--- 844,850 ----
  /* discard all tokens from this user's cache */
  
  static int
! NewForgetAll(void)
  {
  #ifndef NO_AFS_CLIENT
      TRY_KERNEL(KTC_FORGETALLTOKENS_OP, 0, 0, 0, 0);
***************
*** 850,856 ****
  }
  
  static int
! OldForgetAll()
  {
      struct ViceIoctl iob;
      register afs_int32 code;
--- 853,859 ----
  }
  
  static int
! OldForgetAll(void)
  {
      struct ViceIoctl iob;
      register afs_int32 code;
***************
*** 872,878 ****
  }
  
  int
! ktc_ForgetAllTokens()
  {
      int ncode, ocode;
  
--- 875,881 ----
  }
  
  int
! ktc_ForgetAllTokens(void)
  {
      int ncode, ocode;
  
***************
*** 900,906 ****
  /* ktc_OldPioctl - returns a boolean true if the kernel supports only the old
   * pioctl interface for delivering AFS tickets to the cache manager. */
  
! ktc_OldPioctl()
  {
      int rc;
      LOCK_GLOBAL_MUTEX;
--- 903,910 ----
  /* ktc_OldPioctl - returns a boolean true if the kernel supports only the old
   * pioctl interface for delivering AFS tickets to the cache manager. */
  
! int
! ktc_OldPioctl(void)
  {
      int rc;
      LOCK_GLOBAL_MUTEX;
***************
*** 950,961 ****
   *	c. In tf_close, be sure it gets reinitialized to a negative
   *	   number. 
   */
! static fd = -1;
! static curpos;			/* Position in tfbfr */
! static lastpos;			/* End of tfbfr */
  static char tfbfr[BUFSIZ];	/* Buffer for ticket data */
  
! static tf_gets(), tf_read();
  
  /*
   * This file contains routines for manipulating the ticket cache file.
--- 954,966 ----
   *	c. In tf_close, be sure it gets reinitialized to a negative
   *	   number. 
   */
! static int fd = -1;
! static int curpos;			/* Position in tfbfr */
! static int lastpos;			/* End of tfbfr */
  static char tfbfr[BUFSIZ];	/* Buffer for ticket data */
  
! static int tf_gets(char *, int);
! static int tf_read(char *, int);
  
  /*
   * This file contains routines for manipulating the ticket cache file.
***************
*** 1020,1027 ****
   * TKT_FIL_LCK  - couldn't lock the file, even after a retry
   */
  
! afs_tf_init(tf_name, rw)
!      char *tf_name;
  {
      int wflag;
      int me;
--- 1025,1032 ----
   * TKT_FIL_LCK  - couldn't lock the file, even after a retry
   */
  
! int
! afs_tf_init(char *tf_name, int rw)
  {
      int wflag;
      int me;
***************
*** 1114,1121 ****
   * was longer than MAXKTCNAMELEN, TKT_FIL_FMT is returned. 
   */
  
! afs_tf_get_pname(p)
!      char *p;
  {
      if (fd < 0) {
  	return TKT_FIL_INI;
--- 1119,1126 ----
   * was longer than MAXKTCNAMELEN, TKT_FIL_FMT is returned. 
   */
  
! int
! afs_tf_get_pname(char *p)
  {
      if (fd < 0) {
  	return TKT_FIL_INI;
***************
*** 1135,1142 ****
   * instance may be null. 
   */
  
! afs_tf_get_pinst(inst)
!      char *inst;
  {
      if (fd < 0) {
  	return TKT_FIL_INI;
--- 1140,1147 ----
   * instance may be null. 
   */
  
! int
! afs_tf_get_pinst(char *inst)
  {
      if (fd < 0) {
  	return TKT_FIL_INI;
***************
*** 1157,1165 ****
   * EOF          - end of file encountered
   */
  
! afs_tf_get_cred(principal, token)
!      struct ktc_principal *principal;
!      struct ktc_token *token;
  {
      int k_errno;
      int kvno, lifetime;
--- 1162,1169 ----
   * EOF          - end of file encountered
   */
  
! int
! afs_tf_get_cred(struct ktc_principal *principal, struct ktc_token *token)
  {
      int k_errno;
      int kvno, lifetime;
***************
*** 1217,1223 ****
   * The return value is not defined.
   */
  
! afs_tf_close()
  {
      if (!(fd < 0)) {
  #if defined(AFS_AIX_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV)
--- 1221,1228 ----
   * The return value is not defined.
   */
  
! int
! afs_tf_close(void)
  {
      if (!(fd < 0)) {
  #if defined(AFS_AIX_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV)
***************
*** 1229,1234 ****
--- 1234,1240 ----
  	fd = -1;		/* see declaration of fd above */
      }
      memset(tfbfr, 0, sizeof(tfbfr));
+     return 0;
  }
  
  /*
***************
*** 1249,1259 ****
   *		file is seriously ill.
   */
  
! static
! tf_gets(s, n)
!      register char *s;
  {
!     register count;
  
      if (fd < 0) {
  	return TKT_FIL_INI;
--- 1255,1264 ----
   *		file is seriously ill.
   */
  
! static int
! tf_gets(register char *s, int n)
  {
!     register int count;
  
      if (fd < 0) {
  	return TKT_FIL_INI;
***************
*** 1285,1296 ****
   * 0		on end of file or read error
   */
  
! static
! tf_read(s, n)
!      register char *s;
!      register n;
  {
!     register count;
  
      for (count = n; count > 0; --count) {
  	if (curpos >= sizeof(tfbfr)) {
--- 1290,1299 ----
   * 0		on end of file or read error
   */
  
! static int
! tf_read(register char *s, register int n)
  {
!     register int count;
  
      for (count = n; count > 0; --count) {
  	if (curpos >= sizeof(tfbfr)) {
***************
*** 1305,1312 ****
      return n;
  }
  
- char *tkt_string();
- 
  /*
   * afs_tf_save_cred() appends an incoming ticket to the end of the ticket
   * file.  You must call afs_tf_init() before calling afs_tf_save_cred().
--- 1308,1313 ----
***************
*** 1318,1327 ****
   * called previously, and KFAILURE for anything else that went wrong.
   */
  
! afs_tf_save_cred(aserver, atoken, aclient)
!      struct ktc_principal *aserver;
!      struct ktc_principal *aclient;
!      struct ktc_token *atoken;	/* Token */
  {
      char realm[MAXKTCREALMLEN + 1];
      char junk[MAXKTCNAMELEN];
--- 1319,1328 ----
   * called previously, and KFAILURE for anything else that went wrong.
   */
  
! int
! afs_tf_save_cred(struct ktc_principal *aserver, 
! 		 struct ktc_token *atoken, 
! 		 struct ktc_principal *aclient)
  {
      char realm[MAXKTCREALMLEN + 1];
      char junk[MAXKTCNAMELEN];
***************
*** 1420,1427 ****
   * <mit-copyright.h>.
   */
  
- char *getenv();
- 
  /*
   * This routine is used to generate the name of the file that holds
   * the user's cache of server tickets and associated session keys.
--- 1421,1426 ----
***************
*** 1451,1457 ****
  
      LOCK_GLOBAL_MUTEX;
      if (!*krb_ticket_string) {
! 	if (env = getenv("KRBTKFILE")) {
  	    (void)strncpy(krb_ticket_string, env,
  			  sizeof(krb_ticket_string) - 1);
  	    krb_ticket_string[sizeof(krb_ticket_string) - 1] = '\0';
--- 1450,1456 ----
  
      LOCK_GLOBAL_MUTEX;
      if (!*krb_ticket_string) {
! 	if ((env = getenv("KRBTKFILE"))) {
  	    (void)strncpy(krb_ticket_string, env,
  			  sizeof(krb_ticket_string) - 1);
  	    krb_ticket_string[sizeof(krb_ticket_string) - 1] = '\0';
***************
*** 1494,1502 ****
   * success, or KFAILURE if something goes wrong.
   */
  
! afs_tf_create(pname, pinst)
!      char *pname;
!      char *pinst;
  {
      int tktfile;
      int me, metoo;
--- 1493,1500 ----
   * success, or KFAILURE if something goes wrong.
   */
  
! int
! afs_tf_create(char *pname, char *pinst)
  {
      int tktfile;
      int me, metoo;
***************
*** 1573,1579 ****
   * failure.
   */
  
! afs_tf_dest_tkt()
  {
      char *file = ktc_tkt_string();
      int i, fd;
--- 1571,1578 ----
   * failure.
   */
  
! int
! afs_tf_dest_tkt(void)
  {
      char *file = ktc_tkt_string();
      int i, fd;
***************
*** 1613,1620 ****
  }
  
  static afs_uint32
! curpag()
  {
      gid_t groups[NGROUPS_MAX];
      afs_uint32 g0, g1;
      afs_uint32 h, l, ret;
--- 1612,1625 ----
  }
  
  static afs_uint32
! curpag(void)
  {
+ #if defined(AFS_AIX51_ENV)
+     int code = getpagvalue("afs");
+     if (code < 0 && errno == EINVAL)
+ 	code = 0;
+     return code;
+ #else
      gid_t groups[NGROUPS_MAX];
      afs_uint32 g0, g1;
      afs_uint32 h, l, ret;
***************
*** 1638,1647 ****
  	    return -1;
      }
      return -1;
  }
  
! 
! ktc_newpag()
  {
      extern char **environ;
  
--- 1643,1653 ----
  	    return -1;
      }
      return -1;
+ #endif
  }
  
! int
! ktc_newpag(void)
  {
      extern char **environ;
  
***************
*** 1660,1666 ****
      if (pag == -1) {
  	sprintf(fname, "%s%d", prefix, getuid());
      } else {
! 	sprintf(fname, "%sp%ld", prefix, pag);
      }
      ktc_set_tkt_string(fname);
  
--- 1666,1672 ----
      if (pag == -1) {
  	sprintf(fname, "%s%d", prefix, getuid());
      } else {
! 	sprintf(fname, "%sp%ld", prefix, (long int) pag);
      }
      ktc_set_tkt_string(fname);
  
***************
*** 1668,1674 ****
  	numenv++;
      newenv = (char **)malloc((numenv + 2) * sizeof(char *));
  
!     for (senv = environ, denv = newenv; *senv; *senv++) {
  	if (strncmp(*senv, "KRBTKFILE=", 10) != 0)
  	    *denv++ = *senv;
      }
--- 1674,1680 ----
  	numenv++;
      newenv = (char **)malloc((numenv + 2) * sizeof(char *));
  
!     for (senv = environ, denv = newenv; *senv; senv++) {
  	if (strncmp(*senv, "KRBTKFILE=", 10) != 0)
  	    *denv++ = *senv;
      }
***************
*** 1679,1684 ****
--- 1685,1691 ----
      *++denv = 0;
      environ = newenv;
      UNLOCK_GLOBAL_MUTEX;
+     return 0;
  }
  
  /*
***************
*** 1686,1692 ****
   * find out what the local cell is.
   */
  static void
! ktc_LocalCell()
  {
      int code;
      struct afsconf_dir *conf;
--- 1693,1699 ----
   * find out what the local cell is.
   */
  static void
! ktc_LocalCell(void)
  {
      int code;
      struct afsconf_dir *conf;
Index: openafs/src/auth/setkey.c
diff -c openafs/src/auth/setkey.c:1.8 openafs/src/auth/setkey.c:1.8.2.2
*** openafs/src/auth/setkey.c:1.8	Tue Jul 15 19:14:41 2003
--- openafs/src/auth/setkey.c	Thu Nov  1 12:09:43 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/auth/setkey.c,v 1.8 2003/07/15 23:14:41 shadow Exp $");
  
  #include <sys/types.h>
  #include <stdio.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/auth/setkey.c,v 1.8.2.2 2007/11/01 16:09:43 shadow Exp $");
  
  #include <sys/types.h>
  #include <stdio.h>
***************
*** 21,39 ****
  #include <WINNT/afsreg.h>
  #include <WINNT/afsevent.h>
  #endif
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #ifdef HAVE_NETINET_IN_H
  #include <netinet/in.h>
  #endif
  #ifdef HAVE_NETDB_H
  #include <netdb.h>
  #endif
  #include "cellconfig.h"
  #include "keys.h"
  #include <afs/afsutil.h>
--- 21,34 ----
  #include <WINNT/afsreg.h>
  #include <WINNT/afsevent.h>
  #endif
  #include <string.h>
  #ifdef HAVE_NETINET_IN_H
  #include <netinet/in.h>
  #endif
  #ifdef HAVE_NETDB_H
  #include <netdb.h>
  #endif
+ #include <rx/rxkad.h>
  #include "cellconfig.h"
  #include "keys.h"
  #include <afs/afsutil.h>
***************
*** 43,51 ****
  static int hex2char(char c);
  
  int
! main(argc, argv)
!      int argc;
!      char **argv;
  {
      struct afsconf_dir *tdir;
      register afs_int32 code;
--- 38,44 ----
  static int hex2char(char c);
  
  int
! main(int argc, char **argv)
  {
      struct afsconf_dir *tdir;
      register afs_int32 code;
Index: openafs/src/auth/userok.c
diff -c openafs/src/auth/userok.c:1.12.2.1 openafs/src/auth/userok.c:1.12.2.3
*** openafs/src/auth/userok.c:1.12.2.1	Wed Aug 25 03:09:36 2004
--- openafs/src/auth/userok.c	Thu Feb 28 23:46:20 2008
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/auth/userok.c,v 1.12.2.1 2004/08/25 07:09:36 shadow Exp $");
  
  #include <afs/stds.h>
  #include <afs/pthread_glock.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/auth/userok.c,v 1.12.2.3 2008/02/29 04:46:20 shadow Exp $");
  
  #include <afs/stds.h>
  #include <afs/pthread_glock.h>
***************
*** 46,68 ****
  #include "keys.h"
  #include "afs/audit.h"
  
- afs_int32 afsconf_SuperUser();
- 
  #if !defined(UKERNEL)
  int
! afsconf_CheckAuth(adir, acall)
!      register struct rx_call *acall;
!      register struct afsconf_dir *adir;
  {
      LOCK_GLOBAL_MUTEX;
!     return ((afsconf_SuperUser(adir, acall, NULL) == 0) ? 10029 : 0);
      UNLOCK_GLOBAL_MUTEX;
  }
  #endif /* !defined(UKERNEL) */
  
  static int
! GetNoAuthFlag(adir)
!      struct afsconf_dir *adir;
  {
      if (access(AFSDIR_SERVER_NOAUTH_FILEPATH, 0) == 0) {
  	osi_audit(NoAuthEvent, 0, AUD_END);	/* some random server is running noauth */
--- 46,66 ----
  #include "keys.h"
  #include "afs/audit.h"
  
  #if !defined(UKERNEL)
  int
! afsconf_CheckAuth(register struct afsconf_dir *adir, 
! 		  register struct rx_call *acall)
  {
+     int rc;
      LOCK_GLOBAL_MUTEX;
!     rc = ((afsconf_SuperUser(adir, acall, NULL) == 0) ? 10029 : 0);
      UNLOCK_GLOBAL_MUTEX;
+     return rc;
  }
  #endif /* !defined(UKERNEL) */
  
  static int
! GetNoAuthFlag(struct afsconf_dir *adir)
  {
      if (access(AFSDIR_SERVER_NOAUTH_FILEPATH, 0) == 0) {
  	osi_audit(NoAuthEvent, 0, AUD_END);	/* some random server is running noauth */
***************
*** 73,80 ****
  
  
  int
! afsconf_GetNoAuthFlag(adir)
!      struct afsconf_dir *adir;
  {
      int rc;
  
--- 71,77 ----
  
  
  int
! afsconf_GetNoAuthFlag(struct afsconf_dir *adir)
  {
      int rc;
  
***************
*** 85,93 ****
  }
  
  void
! afsconf_SetNoAuthFlag(adir, aflag)
!      struct afsconf_dir *adir;
!      int aflag;
  {
      register afs_int32 code;
  
--- 82,88 ----
  }
  
  void
! afsconf_SetNoAuthFlag(struct afsconf_dir *adir, int aflag)
  {
      register afs_int32 code;
  
***************
*** 112,120 ****
  
  /* deletes a user from the UserList file */
  int
! afsconf_DeleteUser(adir, auser)
!      struct afsconf_dir *adir;
!      register char *auser;
  {
      char tbuffer[1024];
      char nbuffer[1024];
--- 107,113 ----
  
  /* deletes a user from the UserList file */
  int
! afsconf_DeleteUser(struct afsconf_dir *adir, register char *auser)
  {
      char tbuffer[1024];
      char nbuffer[1024];
***************
*** 204,214 ****
  
  /* returns nth super user from the UserList file */
  int
! afsconf_GetNthUser(adir, an, abuffer, abufferLen)
!      struct afsconf_dir *adir;
!      afs_int32 an;
!      char *abuffer;
!      afs_int32 abufferLen;
  {
      char tbuffer[256];
      register FILE *tf;
--- 197,204 ----
  
  /* returns nth super user from the UserList file */
  int
! afsconf_GetNthUser(struct afsconf_dir *adir, afs_int32 an, char *abuffer, 
! 		   afs_int32 abufferLen)
  {
      char tbuffer[256];
      register FILE *tf;
***************
*** 246,254 ****
  
  /* returns true iff user is in the UserList file */
  static int
! FindUser(adir, auser)
!      struct afsconf_dir *adir;
!      register char *auser;
  {
      char tbuffer[256];
      register bufio_p bp;
--- 236,242 ----
  
  /* returns true iff user is in the UserList file */
  static int
! FindUser(struct afsconf_dir *adir, register char *auser)
  {
      char tbuffer[256];
      register bufio_p bp;
***************
*** 280,288 ****
  
  /* add a user to the user list, checking for duplicates */
  int
! afsconf_AddUser(adir, aname)
!      struct afsconf_dir *adir;
!      char *aname;
  {
      FILE *tf;
      register afs_int32 code;
--- 268,274 ----
  
  /* add a user to the user list, checking for duplicates */
  int
! afsconf_AddUser(struct afsconf_dir *adir, char *aname)
  {
      FILE *tf;
      register afs_int32 code;
***************
*** 316,327 ****
  	otherwise returns NULL. The resulting string should be immediately
  	copied to other storage prior to release of mutex. */
  static char *
! CompFindUser(adir, name, sep, inst, realm)
!      struct afsconf_dir *adir;
!      char *name;
!      char *sep;
!      char *inst;
!      char *realm;
  {
      static char fullname[MAXKTCNAMELEN + MAXKTCNAMELEN + MAXKTCREALMLEN + 3];
  
--- 302,309 ----
  	otherwise returns NULL. The resulting string should be immediately
  	copied to other storage prior to release of mutex. */
  static char *
! CompFindUser(struct afsconf_dir *adir, char *name, char *sep, char *inst, 
! 	     char *realm)
  {
      static char fullname[MAXKTCNAMELEN + MAXKTCNAMELEN + MAXKTCREALMLEN + 3];
  
***************
*** 360,369 ****
      if a pointer is passed.
  */
  afs_int32
! afsconf_SuperUser(adir, acall, namep)
!      struct afsconf_dir *adir;
!      struct rx_call *acall;
!      char *namep;
  {
      register struct rx_connection *tconn;
      register afs_int32 code;
--- 342,348 ----
      if a pointer is passed.
  */
  afs_int32
! afsconf_SuperUser(struct afsconf_dir *adir, struct rx_call *acall, char *namep)
  {
      register struct rx_connection *tconn;
      register afs_int32 code;
***************
*** 429,435 ****
  	tmp = tcell_l;
  	while (*tmp) {
  	    *tmp = tolower(*tmp);
! 	    *tmp++;
  	}
  
  	/* determine local cell name. It's static, so will only get
--- 408,414 ----
  	tmp = tcell_l;
  	while (*tmp) {
  	    *tmp = tolower(*tmp);
! 	    tmp++;
  	}
  
  	/* determine local cell name. It's static, so will only get
Index: openafs/src/auth/writeconfig.c
diff -c openafs/src/auth/writeconfig.c:1.10.2.1 openafs/src/auth/writeconfig.c:1.10.2.3
*** openafs/src/auth/writeconfig.c:1.10.2.1	Wed Aug 25 03:09:36 2004
--- openafs/src/auth/writeconfig.c	Thu Nov  1 12:09:43 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/auth/writeconfig.c,v 1.10.2.1 2004/08/25 07:09:36 shadow Exp $");
  
  #include <afs/pthread_glock.h>
  #include <afs/afsutil.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/auth/writeconfig.c,v 1.10.2.3 2007/11/01 16:09:43 shadow Exp $");
  
  #include <afs/pthread_glock.h>
  #include <afs/afsutil.h>
***************
*** 28,46 ****
  #endif
  #include <stdio.h>
  #include <errno.h>
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #ifdef HAVE_FCNTL_H
  #include <fcntl.h>
  #endif
  #ifdef HAVE_UNISTD_H
  #include <unistd.h>
  #endif
  #include "cellconfig.h"
  #include "keys.h"
  
--- 28,41 ----
  #endif
  #include <stdio.h>
  #include <errno.h>
  #include <string.h>
  #ifdef HAVE_FCNTL_H
  #include <fcntl.h>
  #endif
  #ifdef HAVE_UNISTD_H
  #include <unistd.h>
  #endif
+ #include <rx/rxkad.h>
  #include "cellconfig.h"
  #include "keys.h"
  
***************
*** 49,56 ****
  */
  
  static int
! VerifyEntries(aci)
!      register struct afsconf_cell *aci;
  {
      register int i;
      register struct hostent *th;
--- 44,50 ----
  */
  
  static int
! VerifyEntries(register struct afsconf_cell *aci)
  {
      register int i;
      register struct hostent *th;
***************
*** 91,100 ****
     */
  
  int
! afsconf_SetCellInfo(adir, apath, acellInfo)
!      struct afsconf_dir *adir;
!      char *apath;
!      struct afsconf_cell *acellInfo;
  {
      afs_int32 code;
  
--- 85,92 ----
     */
  
  int
! afsconf_SetCellInfo(struct afsconf_dir *adir, const char *apath, 
! 		    struct afsconf_cell *acellInfo)
  {
      afs_int32 code;
  
***************
*** 103,113 ****
  }
  
  int
! afsconf_SetExtendedCellInfo(adir, apath, acellInfo, clones)
!      struct afsconf_dir *adir;
!      char *apath;
!      struct afsconf_cell *acellInfo;
!      char clones[];
  {
      register afs_int32 code;
      register int fd;
--- 95,103 ----
  }
  
  int
! afsconf_SetExtendedCellInfo(struct afsconf_dir *adir, 
! 			    const char *apath, 
! 			    struct afsconf_cell *acellInfo, char clones[])
  {
      register afs_int32 code;
      register int fd;
Index: openafs/src/auth/test/testcellconf.c
diff -c openafs/src/auth/test/testcellconf.c:1.7 openafs/src/auth/test/testcellconf.c:1.7.2.1
*** openafs/src/auth/test/testcellconf.c:1.7	Tue Jul 15 19:14:42 2003
--- openafs/src/auth/test/testcellconf.c	Wed Oct 31 18:32:18 2007
***************
*** 26,32 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/auth/test/testcellconf.c,v 1.7 2003/07/15 23:14:42 shadow Exp $");
  
  #include <sys/types.h>
  #include <stddef.h>
--- 26,32 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/auth/test/testcellconf.c,v 1.7.2.1 2007/10/31 22:32:18 shadow Exp $");
  
  #include <sys/types.h>
  #include <stddef.h>
***************
*** 40,49 ****
  #endif
  #include <afs/cellconfig.h>
  
! PrintOneCell(ainfo, arock, adir)
!      struct afsconf_cell *ainfo;
!      char *arock;
!      struct afsconf_dir *adir;
  {
      register int i;
      long temp;
--- 40,47 ----
  #endif
  #include <afs/cellconfig.h>
  
! int 
! PrintOneCell(struct afsconf_cell *ainfo, void *arock, struct afsconf_dir *adir)
  {
      register int i;
      long temp;
***************
*** 101,107 ****
  	    printf("failed to find afsprot service (%d)\n", code);
  	else {
  	    printf("AFSPROT service:\n");
! 	    PrintOneCell(&theCell, (char *)NULL, theDir);
  	}
  	code = afsconf_GetCellInfo(theDir, 0, "bozotheclown", &theCell);
  	if (code == 0)
--- 99,105 ----
  	    printf("failed to find afsprot service (%d)\n", code);
  	else {
  	    printf("AFSPROT service:\n");
! 	    PrintOneCell(&theCell, NULL, theDir);
  	}
  	code = afsconf_GetCellInfo(theDir, 0, "bozotheclown", &theCell);
  	if (code == 0)
Index: openafs/src/bozo/Makefile.in
diff -c openafs/src/bozo/Makefile.in:1.13 openafs/src/bozo/Makefile.in:1.13.2.1
*** openafs/src/bozo/Makefile.in:1.13	Fri Jun 27 10:12:06 2003
--- openafs/src/bozo/Makefile.in	Thu Nov  1 12:05:57 2007
***************
*** 48,63 ****
  bosint.cs.o: bosint.cs.c ${RPCINCLS}
  
  bosint.cs.c: bosint.xg
! 	${RXGEN} -x -C -o $@ ${srcdir}/bosint.xg
  
  bosint.ss.c: bosint.xg
! 	${RXGEN} -x -S -o $@ ${srcdir}/bosint.xg
  
  bosint.xdr.c: bosint.xg
! 	${RXGEN} -x -c -o $@ ${srcdir}/bosint.xg
  
  bosint.h: bosint.xg
! 	${RXGEN} -x -h -o $@ ${srcdir}/bosint.xg
  
  bosint.cs.c: bosint.h
  bosint.ss.c: bosint.h
--- 48,63 ----
  bosint.cs.o: bosint.cs.c ${RPCINCLS}
  
  bosint.cs.c: bosint.xg
! 	${RXGEN} -x -A -C -o $@ ${srcdir}/bosint.xg
  
  bosint.ss.c: bosint.xg
! 	${RXGEN} -x -A -S -o $@ ${srcdir}/bosint.xg
  
  bosint.xdr.c: bosint.xg
! 	${RXGEN} -x -A -c -o $@ ${srcdir}/bosint.xg
  
  bosint.h: bosint.xg
! 	${RXGEN} -x -A -h -o $@ ${srcdir}/bosint.xg
  
  bosint.cs.c: bosint.h
  bosint.ss.c: bosint.h
Index: openafs/src/bozo/bnode.c
diff -c openafs/src/bozo/bnode.c:1.17.2.5 openafs/src/bozo/bnode.c:1.17.2.8
*** openafs/src/bozo/bnode.c:1.17.2.5	Thu Dec 21 18:15:34 2006
--- openafs/src/bozo/bnode.c	Mon Mar 10 18:35:33 2008
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bozo/bnode.c,v 1.17.2.5 2006/12/21 23:15:34 shadow Exp $");
  
  #include <stddef.h>
  #include <stdlib.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bozo/bnode.c,v 1.17.2.8 2008/03/10 22:35:33 shadow Exp $");
  
  #include <stddef.h>
  #include <stdlib.h>
***************
*** 28,41 ****
  #include <time.h>
  #endif
  #include <sys/stat.h>
- 
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  
  #include <afs/procmgmt.h>	/* signal(), kill(), wait(), etc. */
  #include <lwp.h>
--- 28,34 ----
***************
*** 43,48 ****
--- 36,42 ----
  #include <afs/afsutil.h>
  #include <afs/fileutil.h>
  #include "bnode.h"
+ #include "bosprototypes.h"
  
  #if defined(AFS_AIX_ENV) || defined(AFS_SUN4_ENV)
  /* All known versions of AIX lack WCOREDUMP but this works */
***************
*** 497,504 ****
  }
  
  /* bnode lwp executes this code repeatedly */
! static int
! bproc()
  {
      register afs_int32 code;
      register struct bnode *tb;
--- 491,498 ----
  }
  
  /* bnode lwp executes this code repeatedly */
! static void *
! bproc(void *unused)
  {
      register afs_int32 code;
      register struct bnode *tb;
***************
*** 647,652 ****
--- 641,647 ----
  	    }
  	}
      }
+     return NULL;
  }
  
  static afs_int32
***************
*** 769,777 ****
  
  /* Called by IOMGR at low priority on IOMGR's stack shortly after a SIGCHLD
   * occurs.  Wakes up bproc do redo things */
! int
! bnode_SoftInt(int asignal)
  {
      IOMGR_Cancel(bproc_pid);
      return 0;
  }
--- 764,774 ----
  
  /* Called by IOMGR at low priority on IOMGR's stack shortly after a SIGCHLD
   * occurs.  Wakes up bproc do redo things */
! void *
! bnode_SoftInt(void *param)
  {
+     /* int asignal = (int) param; */
+ 
      IOMGR_Cancel(bproc_pid);
      return 0;
  }
***************
*** 782,793 ****
  void
  bnode_Int(int asignal)
  {
-     extern void bozo_ShutdownAndExit();
- 
      if (asignal == SIGQUIT) {
! 	IOMGR_SoftSig(bozo_ShutdownAndExit, (char *)asignal);
      } else {
! 	IOMGR_SoftSig(bnode_SoftInt, (char *)asignal);
      }
  }
  
--- 779,788 ----
  void
  bnode_Int(int asignal)
  {
      if (asignal == SIGQUIT) {
! 	IOMGR_SoftSig(bozo_ShutdownAndExit, (void *) asignal);
      } else {
! 	IOMGR_SoftSig(bnode_SoftInt, (void *) asignal);
      }
  }
  
Index: openafs/src/bozo/bos.c
diff -c openafs/src/bozo/bos.c:1.20.2.3 openafs/src/bozo/bos.c:1.20.2.4
*** openafs/src/bozo/bos.c:1.20.2.3	Tue Apr 10 14:43:40 2007
--- openafs/src/bozo/bos.c	Wed Oct 31 00:13:34 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bozo/bos.c,v 1.20.2.3 2007/04/10 18:43:40 shadow Exp $");
  
  #include <afs/stds.h>
  #include <stdlib.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bozo/bos.c,v 1.20.2.4 2007/10/31 04:13:34 shadow Exp $");
  
  #include <afs/stds.h>
  #include <stdlib.h>
***************
*** 277,285 ****
      return tconn;
  }
  
! static
! SetAuth(as)
!      struct cmd_syndesc *as;
  {
      register afs_int32 code;
      register struct rx_connection *tconn;
--- 277,284 ----
      return tconn;
  }
  
! static int
! SetAuth(struct cmd_syndesc *as, void *arock)
  {
      register afs_int32 code;
      register struct rx_connection *tconn;
***************
*** 348,356 ****
      }
  }
  
! static
! Prune(as)
!      register struct cmd_syndesc *as;
  {
      register afs_int32 code;
      register struct rx_connection *tconn;
--- 347,354 ----
      }
  }
  
! static int
! Prune(register struct cmd_syndesc *as, void *arock)
  {
      register afs_int32 code;
      register struct rx_connection *tconn;
***************
*** 372,380 ****
      return code;
  }
  
! static
! Exec(as)
!      register struct cmd_syndesc *as;
  {
      register struct rx_connection *tconn;
      register afs_int32 code;
--- 370,377 ----
      return code;
  }
  
! static int
! Exec(register struct cmd_syndesc *as, void *arock)
  {
      register struct rx_connection *tconn;
      register afs_int32 code;
***************
*** 386,394 ****
      return code;
  }
  
! static
! GetDate(as)
!      register struct cmd_syndesc *as;
  {
      register afs_int32 code;
      char tbuffer[256];
--- 383,390 ----
      return code;
  }
  
! static int
! GetDate(register struct cmd_syndesc *as, void *arock)
  {
      register afs_int32 code;
      char tbuffer[256];
***************
*** 437,445 ****
      return 0;
  }
  
! static
! UnInstall(as)
!      register struct cmd_syndesc *as;
  {
      register afs_int32 code;
      char tbuffer[256];
--- 433,440 ----
      return 0;
  }
  
! static int
! UnInstall(register struct cmd_syndesc *as, void *arock)
  {
      register afs_int32 code;
      char tbuffer[256];
***************
*** 496,504 ****
  	return BSTAT_NORMAL;
  }
  
! static
! Install(as)
!      struct cmd_syndesc *as;
  {
      struct rx_connection *tconn;
      register afs_int32 code;
--- 491,498 ----
  	return BSTAT_NORMAL;
  }
  
! static int
! Install(struct cmd_syndesc *as, void *arock)
  {
      struct rx_connection *tconn;
      register afs_int32 code;
***************
*** 554,562 ****
      return 0;
  }
  
! static
! Shutdown(as)
!      struct cmd_syndesc *as;
  {
      register struct rx_connection *tconn;
      register afs_int32 code;
--- 548,555 ----
      return 0;
  }
  
! static int
! Shutdown(struct cmd_syndesc *as, void *arock)
  {
      register struct rx_connection *tconn;
      register afs_int32 code;
***************
*** 584,593 ****
      return 0;
  }
  
! static
! BlockScannerCmd(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
  {
      register afs_int32 code;
      struct rx_connection *tconn;
--- 577,584 ----
      return 0;
  }
  
! static int
! BlockScannerCmd(struct cmd_syndesc *as, void *arock)
  {
      register afs_int32 code;
      struct rx_connection *tconn;
***************
*** 602,611 ****
      return 0;
  }
  
! static
! UnBlockScannerCmd(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
  {
      register afs_int32 code;
      struct rx_connection *tconn;
--- 593,600 ----
      return 0;
  }
  
! static int
! UnBlockScannerCmd(struct cmd_syndesc *as, void *arock)
  {
      register afs_int32 code;
      struct rx_connection *tconn;
***************
*** 620,629 ****
      return 0;
  }
  
! static
! GetRestartCmd(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
  {
      register afs_int32 code;
      struct ktime generalTime, newBinaryTime;
--- 609,616 ----
      return 0;
  }
  
! static int
! GetRestartCmd(struct cmd_syndesc *as, void *arock)
  {
      register afs_int32 code;
      struct ktime generalTime, newBinaryTime;
***************
*** 665,674 ****
      return 0;
  }
  
! static
! SetRestartCmd(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
  {
      afs_int32 count;
      register afs_int32 code;
--- 652,659 ----
      return 0;
  }
  
! static int
! SetRestartCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 count;
      register afs_int32 code;
***************
*** 707,715 ****
      return 0;
  }
  
! static
! Startup(as)
!      struct cmd_syndesc *as;
  {
      register struct rx_connection *tconn;
      register afs_int32 code;
--- 692,699 ----
      return 0;
  }
  
! static int
! Startup(struct cmd_syndesc *as, void *arock)
  {
      register struct rx_connection *tconn;
      register afs_int32 code;
***************
*** 731,739 ****
      return 0;
  }
  
! static
! Restart(as)
!      struct cmd_syndesc *as;
  {
      register struct rx_connection *tconn;
      register afs_int32 code;
--- 715,722 ----
      return 0;
  }
  
! static int
! Restart(struct cmd_syndesc *as, void *arock)
  {
      register struct rx_connection *tconn;
      register afs_int32 code;
***************
*** 777,785 ****
      return 0;
  }
  
! static
! SetCellName(as)
!      struct cmd_syndesc *as;
  {
      register struct rx_connection *tconn;
      register afs_int32 code;
--- 760,767 ----
      return 0;
  }
  
! static int
! SetCellName(struct cmd_syndesc *as, void *arock)
  {
      register struct rx_connection *tconn;
      register afs_int32 code;
***************
*** 791,799 ****
      return 0;
  }
  
! static
! AddHost(as)
!      register struct cmd_syndesc *as;
  {
      register struct rx_connection *tconn;
      register afs_int32 code;
--- 773,780 ----
      return 0;
  }
  
! static int
! AddHost(register struct cmd_syndesc *as, void *arock)
  {
      register struct rx_connection *tconn;
      register afs_int32 code;
***************
*** 819,827 ****
      return 0;
  }
  
! static
! RemoveHost(as)
!      register struct cmd_syndesc *as;
  {
      register struct rx_connection *tconn;
      register afs_int32 code;
--- 800,807 ----
      return 0;
  }
  
! static int
! RemoveHost(register struct cmd_syndesc *as, void *arock)
  {
      register struct rx_connection *tconn;
      register afs_int32 code;
***************
*** 837,845 ****
      return 0;
  }
  
! static
! ListHosts(as)
!      register struct cmd_syndesc *as;
  {
      register struct rx_connection *tconn;
      register afs_int32 code;
--- 817,824 ----
      return 0;
  }
  
! static int
! ListHosts(register struct cmd_syndesc *as, void *arock)
  {
      register struct rx_connection *tconn;
      register afs_int32 code;
***************
*** 868,876 ****
      return 0;
  }
  
! static
! AddKey(as)
!      register struct cmd_syndesc *as;
  {
      register struct rx_connection *tconn;
      register afs_int32 code;
--- 847,854 ----
      return 0;
  }
  
! static int
! AddKey(register struct cmd_syndesc *as, void *arock)
  {
      register struct rx_connection *tconn;
      register afs_int32 code;
***************
*** 938,946 ****
      return 0;
  }
  
! static
! RemoveKey(as)
!      register struct cmd_syndesc *as;
  {
      register struct rx_connection *tconn;
      register afs_int32 code;
--- 916,923 ----
      return 0;
  }
  
! static int
! RemoveKey(register struct cmd_syndesc *as, void *arock)
  {
      register struct rx_connection *tconn;
      register afs_int32 code;
***************
*** 959,967 ****
      return 0;
  }
  
! static
! ListKeys(as)
!      IN register struct cmd_syndesc *as;
  {
      register struct rx_connection *tconn;
      register afs_int32 code;
--- 936,943 ----
      return 0;
  }
  
! static int
! ListKeys(register struct cmd_syndesc *as, void *arock)
  {
      register struct rx_connection *tconn;
      register afs_int32 code;
***************
*** 1000,1008 ****
      return 0;
  }
  
! static
! AddSUser(as)
!      register struct cmd_syndesc *as;
  {
      register struct rx_connection *tconn;
      register afs_int32 code;
--- 976,983 ----
      return 0;
  }
  
! static int
! AddSUser(register struct cmd_syndesc *as, void *arock)
  {
      register struct rx_connection *tconn;
      register afs_int32 code;
***************
*** 1021,1029 ****
      return failed;
  }
  
! static
! RemoveSUser(as)
!      register struct cmd_syndesc *as;
  {
      register struct rx_connection *tconn;
      register struct cmd_item *ti;
--- 996,1003 ----
      return failed;
  }
  
! static int
! RemoveSUser(register struct cmd_syndesc *as, void *arock)
  {
      register struct rx_connection *tconn;
      register struct cmd_item *ti;
***************
*** 1047,1055 ****
  }
  
  #define	NPERLINE    10		/* dudes to print per line */
! static
! ListSUsers(as)
!      register struct cmd_syndesc *as;
  {
      register struct rx_connection *tconn;
      register int i;
--- 1021,1028 ----
  }
  
  #define	NPERLINE    10		/* dudes to print per line */
! static int
! ListSUsers(register struct cmd_syndesc *as, void *arock)
  {
      register struct rx_connection *tconn;
      register int i;
***************
*** 1087,1095 ****
      return 0;
  }
  
! static
! StatServer(as)
!      register struct cmd_syndesc *as;
  {
      register struct rx_connection *tconn;
      register afs_int32 code;
--- 1060,1067 ----
      return 0;
  }
  
! static int
! StatServer(register struct cmd_syndesc *as, void *arock)
  {
      register struct rx_connection *tconn;
      register afs_int32 code;
***************
*** 1122,1130 ****
      return 0;
  }
  
! static
! CreateServer(as)
!      register struct cmd_syndesc *as;
  {
      register struct rx_connection *tconn;
      register afs_int32 code;
--- 1094,1101 ----
      return 0;
  }
  
! static int
! CreateServer(register struct cmd_syndesc *as, void *arock)
  {
      register struct rx_connection *tconn;
      register afs_int32 code;
***************
*** 1155,1163 ****
      return code;
  }
  
! static
! DeleteServer(as)
!      register struct cmd_syndesc *as;
  {
      register struct rx_connection *tconn;
      register afs_int32 code;
--- 1126,1133 ----
      return code;
  }
  
! static int
! DeleteServer(register struct cmd_syndesc *as, void *arock)
  {
      register struct rx_connection *tconn;
      register afs_int32 code;
***************
*** 1178,1186 ****
      return code;
  }
  
! static
! StartServer(as)
!      register struct cmd_syndesc *as;
  {
      register struct rx_connection *tconn;
      register afs_int32 code;
--- 1148,1155 ----
      return code;
  }
  
! static int
! StartServer(register struct cmd_syndesc *as, void *arock)
  {
      register struct rx_connection *tconn;
      register afs_int32 code;
***************
*** 1197,1205 ****
      return code;
  }
  
! static
! StopServer(as)
!      register struct cmd_syndesc *as;
  {
      register struct rx_connection *tconn;
      register afs_int32 code;
--- 1166,1173 ----
      return code;
  }
  
! static int
! StopServer(register struct cmd_syndesc *as, void *arock)
  {
      register struct rx_connection *tconn;
      register afs_int32 code;
***************
*** 1432,1440 ****
      return code;
  }
  
! static
! GetLogCmd(as)
!      register struct cmd_syndesc *as;
  {
      struct rx_connection *tconn;
      register struct rx_call *tcall;
--- 1400,1407 ----
      return code;
  }
  
! static int
! GetLogCmd(register struct cmd_syndesc *as, void *arock)
  {
      struct rx_connection *tconn;
      register struct rx_call *tcall;
***************
*** 1471,1479 ****
      return code;
  }
  
! static
! SalvageCmd(as)
!      struct cmd_syndesc *as;
  {
      register struct rx_connection *tconn;
      register afs_int32 code, rc, i;
--- 1438,1445 ----
      return code;
  }
  
! static int
! SalvageCmd(struct cmd_syndesc *as, void *arock)
  {
      register struct rx_connection *tconn;
      register afs_int32 code, rc, i;
***************
*** 1867,1875 ****
  }
  
  #ifdef BOS_RESTRICTED_MODE
! static
! GetRestrict(as)
!      struct cmd_syndesc *as;
  {
      register struct rx_connection *tconn;
      afs_int32 code, val;
--- 1833,1840 ----
  }
  
  #ifdef BOS_RESTRICTED_MODE
! static int
! GetRestrict(struct cmd_syndesc *as, void *arock)
  {
      register struct rx_connection *tconn;
      afs_int32 code, val;
***************
*** 1884,1892 ****
      return 0;
  }
  
! static
! SetRestrict(as)
!      struct cmd_syndesc *as;
  {
      register struct rx_connection *tconn;
      afs_int32 code, val;
--- 1849,1856 ----
      return 0;
  }
  
! static int
! SetRestrict(struct cmd_syndesc *as, void *arock)
  {
      register struct rx_connection *tconn;
      afs_int32 code, val;
***************
*** 1959,1970 ****
      initialize_CMD_error_table();
      initialize_BZ_error_table();
  
!     ts = cmd_CreateSyntax("start", StartServer, 0, "start running a server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-instance", CMD_LIST, 0, "server process name");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("stop", StopServer, 0, "halt a server instance");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-instance", CMD_LIST, 0, "server process name");
      cmd_Seek(ts, 8);
--- 1923,1934 ----
      initialize_CMD_error_table();
      initialize_BZ_error_table();
  
!     ts = cmd_CreateSyntax("start", StartServer, NULL, "start running a server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-instance", CMD_LIST, 0, "server process name");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("stop", StopServer, NULL, "halt a server instance");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-instance", CMD_LIST, 0, "server process name");
      cmd_Seek(ts, 8);
***************
*** 1972,1978 ****
  		"wait for process to stop");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("status", StatServer, 0,
  			  "show server instance status");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-instance", CMD_LIST, CMD_OPTIONAL,
--- 1936,1942 ----
  		"wait for process to stop");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("status", StatServer, NULL,
  			  "show server instance status");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-instance", CMD_LIST, CMD_OPTIONAL,
***************
*** 1980,1986 ****
      cmd_AddParm(ts, "-long", CMD_FLAG, CMD_OPTIONAL, "long status");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("shutdown", Shutdown, 0, "shutdown all processes");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-instance", CMD_LIST, CMD_OPTIONAL, "instances");
      cmd_Seek(ts, 8);
--- 1944,1950 ----
      cmd_AddParm(ts, "-long", CMD_FLAG, CMD_OPTIONAL, "long status");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("shutdown", Shutdown, NULL, "shutdown all processes");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-instance", CMD_LIST, CMD_OPTIONAL, "instances");
      cmd_Seek(ts, 8);
***************
*** 1988,1999 ****
  		"wait for process to stop");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("startup", Startup, 0, "start all processes");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-instance", CMD_LIST, CMD_OPTIONAL, "instances");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("restart", Restart, 0, "restart processes");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-instance", CMD_LIST, CMD_OPTIONAL, "instances");
      cmd_AddParm(ts, "-bosserver", CMD_FLAG, CMD_OPTIONAL,
--- 1952,1963 ----
  		"wait for process to stop");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("startup", Startup, NULL, "start all processes");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-instance", CMD_LIST, CMD_OPTIONAL, "instances");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("restart", Restart, NULL, "restart processes");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-instance", CMD_LIST, CMD_OPTIONAL, "instances");
      cmd_AddParm(ts, "-bosserver", CMD_FLAG, CMD_OPTIONAL,
***************
*** 2003,2009 ****
  
  #ifndef OPBOS
  
!     ts = cmd_CreateSyntax("create", CreateServer, 0,
  			  "create a new server instance");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-instance", CMD_SINGLE, 0, "server process name");
--- 1967,1973 ----
  
  #ifndef OPBOS
  
!     ts = cmd_CreateSyntax("create", CreateServer, NULL,
  			  "create a new server instance");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-instance", CMD_SINGLE, 0, "server process name");
***************
*** 2013,2117 ****
  		"Notifier program");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("delete", DeleteServer, 0,
  			  "delete a server instance");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-instance", CMD_LIST, 0, "server process name");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("adduser", AddSUser, 0,
  			  "add users to super-user list");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-user", CMD_LIST, 0, "user names");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("removeuser", RemoveSUser, 0,
  			  "remove users from super-user list");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-user", CMD_LIST, 0, "user names");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("listusers", ListSUsers, 0, "list super-users");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("addkey", AddKey, 0,
  			  "add keys to key dbase (kvno 999 is bcrypt)");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-key", CMD_SINGLE, CMD_OPTIONAL, "key");
      cmd_AddParm(ts, "-kvno", CMD_SINGLE, 0, "key version number");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("removekey", RemoveKey, 0,
  			  "remove keys from key dbase");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-kvno", CMD_LIST, 0, "key version number");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("listkeys", ListKeys, 0, "list keys");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-showkey", CMD_FLAG, CMD_OPTIONAL,
  		"show the actual key rather than the checksum");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("listhosts", ListHosts, 0, "get cell host list");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      add_std_args(ts);
      cmd_CreateAlias(ts, "getcell");
  
!     ts = cmd_CreateSyntax("setcellname", SetCellName, 0, "set cell name");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-name", CMD_SINGLE, 0, "cell name");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("addhost", AddHost, 0, "add host to cell dbase");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-host", CMD_LIST, 0, "host name");
      cmd_AddParm(ts, "-clone", CMD_FLAG, CMD_OPTIONAL, "vote doesn't count");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("removehost", RemoveHost, 0,
  			  "remove host from cell dbase");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-host", CMD_LIST, 0, "host name");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("setauth", SetAuth, 0,
  			  "set authentication required flag");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-authrequired", CMD_SINGLE, 0,
  		"on or off: authentication required for admin requests");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("install", Install, 0, "install program");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-file", CMD_LIST, 0, "files to install");
      cmd_AddParm(ts, "-dir", CMD_SINGLE, CMD_OPTIONAL, "destination dir");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("uninstall", UnInstall, 0, "uninstall program");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-file", CMD_LIST, 0, "files to uninstall");
      cmd_AddParm(ts, "-dir", CMD_SINGLE, CMD_OPTIONAL, "destination dir");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("getlog", GetLogCmd, 0, "examine log file");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-file", CMD_SINGLE, 0, "log file to examine");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("getdate", GetDate, 0, "get dates for programs");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-file", CMD_LIST, 0, "files to check");
      cmd_AddParm(ts, "-dir", CMD_SINGLE, CMD_OPTIONAL, "destination dir");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("exec", Exec, 0, "execute shell command on server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-cmd", CMD_SINGLE, 0, "command to execute");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("prune", Prune, 0, "prune server files");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-bak", CMD_FLAG, CMD_OPTIONAL, "delete .BAK files");
      cmd_AddParm(ts, "-old", CMD_FLAG, CMD_OPTIONAL, "delete .OLD files");
--- 1977,2081 ----
  		"Notifier program");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("delete", DeleteServer, NULL,
  			  "delete a server instance");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-instance", CMD_LIST, 0, "server process name");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("adduser", AddSUser, NULL,
  			  "add users to super-user list");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-user", CMD_LIST, 0, "user names");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("removeuser", RemoveSUser, NULL,
  			  "remove users from super-user list");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-user", CMD_LIST, 0, "user names");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("listusers", ListSUsers, NULL, "list super-users");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("addkey", AddKey, NULL,
  			  "add keys to key dbase (kvno 999 is bcrypt)");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-key", CMD_SINGLE, CMD_OPTIONAL, "key");
      cmd_AddParm(ts, "-kvno", CMD_SINGLE, 0, "key version number");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("removekey", RemoveKey, NULL,
  			  "remove keys from key dbase");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-kvno", CMD_LIST, 0, "key version number");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("listkeys", ListKeys, NULL, "list keys");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-showkey", CMD_FLAG, CMD_OPTIONAL,
  		"show the actual key rather than the checksum");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("listhosts", ListHosts, NULL, "get cell host list");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      add_std_args(ts);
      cmd_CreateAlias(ts, "getcell");
  
!     ts = cmd_CreateSyntax("setcellname", SetCellName, NULL, "set cell name");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-name", CMD_SINGLE, 0, "cell name");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("addhost", AddHost, NULL, "add host to cell dbase");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-host", CMD_LIST, 0, "host name");
      cmd_AddParm(ts, "-clone", CMD_FLAG, CMD_OPTIONAL, "vote doesn't count");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("removehost", RemoveHost, NULL,
  			  "remove host from cell dbase");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-host", CMD_LIST, 0, "host name");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("setauth", SetAuth, NULL,
  			  "set authentication required flag");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-authrequired", CMD_SINGLE, 0,
  		"on or off: authentication required for admin requests");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("install", Install, NULL, "install program");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-file", CMD_LIST, 0, "files to install");
      cmd_AddParm(ts, "-dir", CMD_SINGLE, CMD_OPTIONAL, "destination dir");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("uninstall", UnInstall, NULL, "uninstall program");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-file", CMD_LIST, 0, "files to uninstall");
      cmd_AddParm(ts, "-dir", CMD_SINGLE, CMD_OPTIONAL, "destination dir");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("getlog", GetLogCmd, NULL, "examine log file");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-file", CMD_SINGLE, 0, "log file to examine");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("getdate", GetDate, NULL, "get dates for programs");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-file", CMD_LIST, 0, "files to check");
      cmd_AddParm(ts, "-dir", CMD_SINGLE, CMD_OPTIONAL, "destination dir");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("exec", Exec, NULL, "execute shell command on server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-cmd", CMD_SINGLE, 0, "command to execute");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("prune", Prune, NULL, "prune server files");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-bak", CMD_FLAG, CMD_OPTIONAL, "delete .BAK files");
      cmd_AddParm(ts, "-old", CMD_FLAG, CMD_OPTIONAL, "delete .OLD files");
***************
*** 2119,2125 ****
      cmd_AddParm(ts, "-all", CMD_FLAG, CMD_OPTIONAL, "delete all junk files");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("setrestart", SetRestartCmd, 0,
  			  "set restart times");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "machine name");
      cmd_AddParm(ts, "-time", CMD_SINGLE, CMD_REQUIRED,
--- 2083,2089 ----
      cmd_AddParm(ts, "-all", CMD_FLAG, CMD_OPTIONAL, "delete all junk files");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("setrestart", SetRestartCmd, NULL,
  			  "set restart times");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "machine name");
      cmd_AddParm(ts, "-time", CMD_SINGLE, CMD_REQUIRED,
***************
*** 2130,2141 ****
  		"set new binary restart time");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("getrestart", GetRestartCmd, 0,
  			  "get restart times");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "machine name");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("salvage", SalvageCmd, 0,
  			  "salvage partition or volumes");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_OPTIONAL,
--- 2094,2105 ----
  		"set new binary restart time");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("getrestart", GetRestartCmd, NULL,
  			  "get restart times");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "machine name");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("salvage", SalvageCmd, NULL,
  			  "salvage partition or volumes");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_OPTIONAL,
***************
*** 2191,2213 ****
  		"(MR-AFS) Numeric mask of residencies to be included in the salvage.  Do not use with -SalvageRemote or -SalvageArchival");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("blockscanner", BlockScannerCmd, 0,
  			  "block scanner daemon from making migration requests");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "machine name");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("unblockscanner", UnBlockScannerCmd, 0,
  			  "allow scanner daemon to make migration requests again");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "machine name");
      add_std_args(ts);
  
  #ifdef BOS_RESTRICTED_MODE
!     ts = cmd_CreateSyntax("getrestricted", GetRestrict, 0,
  			  "get restrict mode");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("setrestricted", SetRestrict, 0,
  			  "set restrict mode");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-mode", CMD_SINGLE, 0, "mode to set");
--- 2155,2177 ----
  		"(MR-AFS) Numeric mask of residencies to be included in the salvage.  Do not use with -SalvageRemote or -SalvageArchival");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("blockscanner", BlockScannerCmd, NULL,
  			  "block scanner daemon from making migration requests");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "machine name");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("unblockscanner", UnBlockScannerCmd, NULL,
  			  "allow scanner daemon to make migration requests again");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "machine name");
      add_std_args(ts);
  
  #ifdef BOS_RESTRICTED_MODE
!     ts = cmd_CreateSyntax("getrestricted", GetRestrict, NULL,
  			  "get restrict mode");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("setrestricted", SetRestrict, NULL,
  			  "set restrict mode");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-mode", CMD_SINGLE, 0, "mode to set");
Index: openafs/src/bozo/bos_util.c
diff -c openafs/src/bozo/bos_util.c:1.4 openafs/src/bozo/bos_util.c:1.4.2.1
*** openafs/src/bozo/bos_util.c:1.4	Tue Jul 15 19:14:43 2003
--- openafs/src/bozo/bos_util.c	Tue Oct 30 11:23:50 2007
***************
*** 23,41 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bozo/bos_util.c,v 1.4 2003/07/15 23:14:43 shadow Exp $");
  
  #include <sys/types.h>
  #include <netinet/in.h>
  #include <netdb.h>
- 
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  
  #include <afs/stds.h>
  #include <afs/afsutil.h>
--- 23,34 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bozo/bos_util.c,v 1.4.2.1 2007/10/30 15:23:50 shadow Exp $");
  
  #include <sys/types.h>
  #include <netinet/in.h>
  #include <netdb.h>
  #include <string.h>
  
  #include <afs/stds.h>
  #include <afs/afsutil.h>
Index: openafs/src/bozo/bosoprocs.c
diff -c openafs/src/bozo/bosoprocs.c:1.19.2.1 openafs/src/bozo/bosoprocs.c:1.19.2.4
*** openafs/src/bozo/bosoprocs.c:1.19.2.1	Thu Dec 21 18:15:35 2006
--- openafs/src/bozo/bosoprocs.c	Mon Mar 10 18:35:34 2008
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bozo/bosoprocs.c,v 1.19.2.1 2006/12/21 23:15:35 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bozo/bosoprocs.c,v 1.19.2.4 2008/03/10 22:35:34 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 37,54 ****
  #include <afs/fileutil.h>
  #include <afs/ktime.h>
  #include <afs/audit.h>
- 
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  
  #include "bnode.h"
  #include "bosint.h"
! 
  
  extern struct ktime bozo_nextRestartKT, bozo_nextDayKT;
  
--- 37,47 ----
  #include <afs/fileutil.h>
  #include <afs/ktime.h>
  #include <afs/audit.h>
  #include <string.h>
  
  #include "bnode.h"
  #include "bosint.h"
! #include "bosprototypes.h"
  
  extern struct ktime bozo_nextRestartKT, bozo_nextDayKT;
  
***************
*** 1662,1670 ****
  }
  #endif
  
! void
! bozo_ShutdownAndExit(int asignal)
  {
      int code;
  
      bozo_Log
--- 1655,1664 ----
  }
  #endif
  
! void *
! bozo_ShutdownAndExit(void *param)
  {
+     int asignal = (int) param;
      int code;
  
      bozo_Log
Index: openafs/src/bozo/bosprototypes.h
diff -c /dev/null openafs/src/bozo/bosprototypes.h:1.1.4.3
*** /dev/null	Mon Apr 28 17:55:43 2008
--- openafs/src/bozo/bosprototypes.h	Mon Mar 10 18:35:34 2008
***************
*** 0 ****
--- 1,19 ----
+ /*
+  * Copyright 2000, International Business Machines Corporation and others.
+  * All Rights Reserved.
+  *
+  * This software has been released under the terms of the IBM Public
+  * License.  For details, see the LICENSE file in the top-level source
+  * directory or online at http://www.openafs.org/dl/license10.html
+  */
+ 
+ #ifndef _BOSPROTOTYPES_H_
+ #define _BOSPROTOTYPES_H_
+ 
+ /* bosserver.c */
+ void bozo_Log(char *format, ... );
+ 
+ /* bosoprocs.c */
+ void *bozo_ShutdownAndExit(void *arock /* really int asignal */);
+ 
+ #endif
Index: openafs/src/bozo/bosserver.c
diff -c openafs/src/bozo/bosserver.c:1.23.2.11 openafs/src/bozo/bosserver.c:1.23.2.16
*** openafs/src/bozo/bosserver.c:1.23.2.11	Mon May 14 15:27:49 2007
--- openafs/src/bozo/bosserver.c	Mon Mar 10 18:35:34 2008
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bozo/bosserver.c,v 1.23.2.11 2007/05/14 19:27:49 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bozo/bosserver.c,v 1.23.2.16 2008/03/10 22:35:34 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 21,26 ****
--- 21,27 ----
  #include <string.h>
  #include <stdio.h>
  #include <stdlib.h>
+ #include <stdarg.h>
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #include <direct.h>
***************
*** 37,42 ****
--- 38,44 ----
  #include <rx/rx_globals.h>
  #include "bosint.h"
  #include "bnode.h"
+ #include "bosprototypes.h"
  #include <afs/auth.h>
  #include <afs/keys.h>
  #include <afs/ktime.h>
***************
*** 47,60 ****
  #include <afs/afs_args.h>
  #endif
  
- 
  #define BOZO_LWP_STACKSIZE	16000
  extern int BOZO_ExecuteRequest();
  extern int RXSTATS_ExecuteRequest();
  extern struct bnode_ops fsbnode_ops, ezbnode_ops, cronbnode_ops;
  
- void bozo_Log();
- 
  struct afsconf_dir *bozo_confdir = 0;	/* bozo configuration dir */
  static char *bozo_pid;
  struct rx_securityClass *bozo_rxsc[3];
--- 49,59 ----
***************
*** 72,77 ****
--- 71,77 ----
  struct ktime bozo_nextRestartKT, bozo_nextDayKT;
  int bozo_newKTs;
  int rxBind = 0;
+ int rxkadDisableDotCheck = 0;
  
  #define ADDRSPERSITE 16         /* Same global is in rx/rx_user.c */
  afs_uint32 SHostAddrs[ADDRSPERSITE];
***************
*** 514,521 ****
  
  #define	BOZO_MINSKIP 3600	/* minimum to advance clock */
  /* lwp to handle system restarts */
! static int
! BozoDaemon()
  {
      register afs_int32 now;
  
--- 514,521 ----
  
  #define	BOZO_MINSKIP 3600	/* minimum to advance clock */
  /* lwp to handle system restarts */
! static void *
! BozoDaemon(void *unused)
  {
      register afs_int32 now;
  
***************
*** 550,555 ****
--- 550,556 ----
  	    bnode_ApplyInstance(bdrestart, 0);
  	}
      }
+     return NULL;
  }
  
  #ifdef AFS_AIX32_ENV
***************
*** 822,827 ****
--- 823,831 ----
  	else if (strcmp(argv[code], "-rxbind") == 0) {
  	    rxBind = 1;
  	}
+ 	else if (strcmp(argv[code], "-allow-dotted-principals") == 0) {
+ 	    rxkadDisableDotCheck = 1;
+ 	}
  	else if (!strcmp(argv[i], "-rxmaxmtu")) {
  	    if ((i + 1) >= argc) {
  		fprintf(stderr, "missing argument for -rxmaxmtu\n"); 
***************
*** 830,836 ****
  	    rxMaxMTU = atoi(argv[++i]);
  	    if ((rxMaxMTU < RX_MIN_PACKET_SIZE) || 
  		(rxMaxMTU > RX_MAX_PACKET_DATA_SIZE)) {
! 		printf("rxMaxMTU %d% invalid; must be between %d-%d\n",
  			rxMaxMTU, RX_MIN_PACKET_SIZE, 
  			RX_MAX_PACKET_DATA_SIZE);
  		exit(1);
--- 834,840 ----
  	    rxMaxMTU = atoi(argv[++i]);
  	    if ((rxMaxMTU < RX_MIN_PACKET_SIZE) || 
  		(rxMaxMTU > RX_MAX_PACKET_DATA_SIZE)) {
! 		printf("rxMaxMTU %d invalid; must be between %d-%d\n",
  			rxMaxMTU, RX_MIN_PACKET_SIZE, 
  			RX_MAX_PACKET_DATA_SIZE);
  		exit(1);
***************
*** 873,886 ****
  #ifndef AFS_NT40_ENV
  	    printf("Usage: bosserver [-noauth] [-log] "
  		   "[-auditlog <log path>] "
! 		   "[-rxmaxmtu <bytes>] [-rxbind] "
  		   "[-syslog[=FACILITY]] "
  		   "[-enable_peer_stats] [-enable_process_stats] "
  		   "[-nofork] " "[-help]\n");
  #else
  	    printf("Usage: bosserver [-noauth] [-log] "
  		   "[-auditlog <log path>] "
! 		   "[-rxmaxmtu <bytes>] [-rxbind] "
  		   "[-enable_peer_stats] [-enable_process_stats] "
  		   "[-help]\n");
  #endif
--- 877,890 ----
  #ifndef AFS_NT40_ENV
  	    printf("Usage: bosserver [-noauth] [-log] "
  		   "[-auditlog <log path>] "
! 		   "[-rxmaxmtu <bytes>] [-rxbind] [-allow-dotted-principals]"
  		   "[-syslog[=FACILITY]] "
  		   "[-enable_peer_stats] [-enable_process_stats] "
  		   "[-nofork] " "[-help]\n");
  #else
  	    printf("Usage: bosserver [-noauth] [-log] "
  		   "[-auditlog <log path>] "
! 		   "[-rxmaxmtu <bytes>] [-rxbind] [-allow-dotted-principals]"
  		   "[-enable_peer_stats] [-enable_process_stats] "
  		   "[-help]\n");
  #endif
***************
*** 1063,1068 ****
--- 1067,1077 ----
      rx_SetMinProcs(tservice, 2);
      rx_SetMaxProcs(tservice, 4);
      rx_SetStackSize(tservice, BOZO_LWP_STACKSIZE);	/* so gethostbyname works (in cell stuff) */
+     if (rxkadDisableDotCheck) {
+         rx_SetSecurityConfiguration(tservice, RXS_CONFIG_FLAGS,
+                                     (void *)RXS_CONFIG_FLAGS_DISABLE_DOTCHECK, 
+                                     NULL);
+     }
  
      tservice =
  	rx_NewServiceHost(host, 0, RX_STATS_SERVICE_ID, "rpcstats", bozo_rxsc,
***************
*** 1070,1086 ****
      rx_SetMinProcs(tservice, 2);
      rx_SetMaxProcs(tservice, 4);
      rx_StartServer(1);		/* donate this process */
  }
  
  void
! bozo_Log(char *a, char *b, char *c, char *d, char *e, char *f)
  {
      char tdate[26];
      time_t myTime;
  
      if (DoSyslog) {
  #ifndef AFS_NT40_ENV
! 	syslog(LOG_INFO, a, b, c, d, e, f);
  #endif
      } else {
  	myTime = time(0);
--- 1079,1099 ----
      rx_SetMinProcs(tservice, 2);
      rx_SetMaxProcs(tservice, 4);
      rx_StartServer(1);		/* donate this process */
+     return 0;
  }
  
  void
! bozo_Log(char *format, ...)
  {
      char tdate[26];
      time_t myTime;
+     va_list ap;
+ 
+     va_start(ap, format);
  
      if (DoSyslog) {
  #ifndef AFS_NT40_ENV
! 	vsyslog(LOG_INFO, format, ap);
  #endif
      } else {
  	myTime = time(0);
***************
*** 1098,1110 ****
  
  	if (bozo_logFile) {
  	    fprintf(bozo_logFile, "%s ", tdate);
! 	    fprintf(bozo_logFile, a, b, c, d, e, f);
  	    fflush(bozo_logFile);
  	    /* close so rm BosLog works */
  	    fclose(bozo_logFile);
  	} else {
  	    printf("%s ", tdate);
! 	    printf(a, b, c, d, e, f);
  	}
      }
  }
--- 1111,1123 ----
  
  	if (bozo_logFile) {
  	    fprintf(bozo_logFile, "%s ", tdate);
! 	    vfprintf(bozo_logFile, format, ap);
  	    fflush(bozo_logFile);
  	    /* close so rm BosLog works */
  	    fclose(bozo_logFile);
  	} else {
  	    printf("%s ", tdate);
! 	    vprintf(format, ap);
  	}
      }
  }
Index: openafs/src/bozo/cronbnodeops.c
diff -c openafs/src/bozo/cronbnodeops.c:1.10 openafs/src/bozo/cronbnodeops.c:1.10.2.2
*** openafs/src/bozo/cronbnodeops.c:1.10	Sun Dec  7 17:49:18 2003
--- openafs/src/bozo/cronbnodeops.c	Wed Oct 31 00:21:31 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bozo/cronbnodeops.c,v 1.10 2003/12/07 22:49:18 jaltman Exp $");
  
  #include <sys/types.h>
  #include <sys/stat.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bozo/cronbnodeops.c,v 1.10.2.2 2007/10/31 04:21:31 shadow Exp $");
  
  #include <sys/types.h>
  #include <sys/stat.h>
***************
*** 23,41 ****
  #include <io.h>
  #endif
  
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <stdlib.h>
  
  #include <afs/ktime.h>
  #include <afs/afsutil.h>
  #include <afs/procmgmt.h>	/* signal(), kill(), wait(), etc. */
  #include "bnode.h"
  
  static int cron_timeout(), cron_getstat(), cron_setstat(), cron_delete();
  static int cron_procexit(), cron_getstring(), cron_getparm(), cron_restartp();
--- 23,36 ----
  #include <io.h>
  #endif
  
  #include <string.h>
  #include <stdlib.h>
  
  #include <afs/ktime.h>
  #include <afs/afsutil.h>
  #include <afs/procmgmt.h>	/* signal(), kill(), wait(), etc. */
  #include "bnode.h"
+ #include "bosprototypes.h"
  
  static int cron_timeout(), cron_getstat(), cron_setstat(), cron_delete();
  static int cron_procexit(), cron_getstring(), cron_getparm(), cron_restartp();
Index: openafs/src/bozo/ezbnodeops.c
diff -c openafs/src/bozo/ezbnodeops.c:1.8 openafs/src/bozo/ezbnodeops.c:1.8.2.2
*** openafs/src/bozo/ezbnodeops.c:1.8	Tue Jul 15 19:14:43 2003
--- openafs/src/bozo/ezbnodeops.c	Wed Oct 31 00:21:31 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bozo/ezbnodeops.c,v 1.8 2003/07/15 23:14:43 shadow Exp $");
  
  #include <sys/types.h>
  #include <errno.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bozo/ezbnodeops.c,v 1.8.2.2 2007/10/31 04:21:31 shadow Exp $");
  
  #include <sys/types.h>
  #include <errno.h>
***************
*** 21,38 ****
  #include <io.h>
  #endif
  
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <stdlib.h>
  
  #include <afs/afsutil.h>
  #include <afs/procmgmt.h>	/* signal(), kill(), wait(), etc. */
  #include "bnode.h"
  
  static int ez_timeout(), ez_getstat(), ez_setstat(), ez_delete();
  static int ez_procexit(), ez_getstring(), ez_getparm(), ez_restartp();
--- 21,33 ----
  #include <io.h>
  #endif
  
  #include <string.h>
  #include <stdlib.h>
  
  #include <afs/afsutil.h>
  #include <afs/procmgmt.h>	/* signal(), kill(), wait(), etc. */
  #include "bnode.h"
+ #include "bosprototypes.h"
  
  static int ez_timeout(), ez_getstat(), ez_setstat(), ez_delete();
  static int ez_procexit(), ez_getstring(), ez_getparm(), ez_restartp();
Index: openafs/src/bozo/fsbnodeops.c
diff -c openafs/src/bozo/fsbnodeops.c:1.13 openafs/src/bozo/fsbnodeops.c:1.13.2.3
*** openafs/src/bozo/fsbnodeops.c:1.13	Sun Dec  7 17:49:18 2003
--- openafs/src/bozo/fsbnodeops.c	Mon Nov 26 16:21:49 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bozo/fsbnodeops.c,v 1.13 2003/12/07 22:49:18 jaltman Exp $");
  
  #include <sys/types.h>
  #include <lwp.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bozo/fsbnodeops.c,v 1.13.2.3 2007/11/26 21:21:49 shadow Exp $");
  
  #include <sys/types.h>
  #include <lwp.h>
***************
*** 26,38 ****
  #else
  #include <sys/file.h>
  
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <stdlib.h>
  
  #endif /* AFS_NT40_ENV */
--- 26,32 ----
***************
*** 40,52 ****
  #include <afs/procmgmt.h>	/* signal(), kill(), wait(), etc. */
  #include <afs/afsutil.h>
  #include "bnode.h"
  
  static int fs_timeout(), fs_getstat(), fs_setstat(), fs_delete();
  static int fs_procexit(), fs_getstring(), fs_getparm(), fs_restartp();
  static int fs_hascore();
  struct bnode *fs_create();
  
! static SetNeedsClock();
  static NudgeProcs();
  
  static int emergency = 0;
--- 34,47 ----
  #include <afs/procmgmt.h>	/* signal(), kill(), wait(), etc. */
  #include <afs/afsutil.h>
  #include "bnode.h"
+ #include "bosprototypes.h"
  
  static int fs_timeout(), fs_getstat(), fs_setstat(), fs_delete();
  static int fs_procexit(), fs_getstring(), fs_getparm(), fs_restartp();
  static int fs_hascore();
  struct bnode *fs_create();
  
! static void SetNeedsClock();
  static NudgeProcs();
  
  static int emergency = 0;
***************
*** 515,521 ****
  }
  
  /* make sure we're periodically checking the state if we need to */
! static int
  SetNeedsClock(register struct fsbnode *ab)
  {
      if (ab->b.goal == 1 && ab->fileRunning && ab->volRunning
--- 510,516 ----
  }
  
  /* make sure we're periodically checking the state if we need to */
! static void
  SetNeedsClock(register struct fsbnode *ab)
  {
      if (ab->b.goal == 1 && ab->fileRunning && ab->volRunning
Index: openafs/src/bu_utils/fms.c
diff -c openafs/src/bu_utils/fms.c:1.7 openafs/src/bu_utils/fms.c:1.7.2.2
*** openafs/src/bu_utils/fms.c:1.7	Tue Jul 15 19:14:44 2003
--- openafs/src/bu_utils/fms.c	Mon Nov 26 16:21:49 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bu_utils/fms.c,v 1.7 2003/07/15 23:14:44 shadow Exp $");
  
  #undef	IN
  #include <stdio.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bu_utils/fms.c,v 1.7.2.2 2007/11/26 21:21:49 shadow Exp $");
  
  #undef	IN
  #include <stdio.h>
***************
*** 35,41 ****
  /* prototypes */
  int fileMark(usd_handle_t hTape);
  int fileMarkSize(char *tapeDevice);
! void tt_fileMarkSize(struct cmd_syndesc *as, char *arock);
  
  #define ERROR(evalue)                                           \
          {                                                       \
--- 35,41 ----
  /* prototypes */
  int fileMark(usd_handle_t hTape);
  int fileMarkSize(char *tapeDevice);
! static int tt_fileMarkSize(struct cmd_syndesc *as, void *arock);
  
  #define ERROR(evalue)                                           \
          {                                                       \
***************
*** 64,86 ****
      sigaction(SIGINT, &intaction, &oldaction);
  
      cptr =
! 	cmd_CreateSyntax(NULL, tt_fileMarkSize, 0,
  			 "write a tape full of file marks");
      cmd_AddParm(cptr, "-tape", CMD_SINGLE, CMD_REQUIRED, "tape special file");
  
      cmd_Dispatch(argc, argv);
  }
  
! void
! tt_fileMarkSize(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
  {
      char *tapeDevice;
  
      tapeDevice = as->parms[0].items->data;
  
      fileMarkSize(tapeDevice);
  }
  
  
--- 64,87 ----
      sigaction(SIGINT, &intaction, &oldaction);
  
      cptr =
! 	cmd_CreateSyntax(NULL, tt_fileMarkSize, NULL,
  			 "write a tape full of file marks");
      cmd_AddParm(cptr, "-tape", CMD_SINGLE, CMD_REQUIRED, "tape special file");
  
      cmd_Dispatch(argc, argv);
+     return 0;
  }
  
! static int
! tt_fileMarkSize(struct cmd_syndesc *as, void *arock)
  {
      char *tapeDevice;
  
      tapeDevice = as->parms[0].items->data;
  
      fileMarkSize(tapeDevice);
+ 
+     return 0;
  }
  
  
Index: openafs/src/bubasics/Makefile.in
diff -c openafs/src/bubasics/Makefile.in:1.8 openafs/src/bubasics/Makefile.in:1.8.2.1
*** openafs/src/bubasics/Makefile.in:1.8	Sat Jan 11 02:33:57 2003
--- openafs/src/bubasics/Makefile.in	Thu Nov  1 12:05:58 2007
***************
*** 18,33 ****
  	${RANLIB} libbubasics.a
  
  butc.xdr.c: butc.xg
! 	${RXGEN} -c -o $@ ${srcdir}/butc.xg
  
  butc.ss.c: butc.xg
! 	${RXGEN} -S -o $@ ${srcdir}/butc.xg
  
  butc.cs.c: butc.xg
! 	${RXGEN} -C -o $@ ${srcdir}/butc.xg
  
  butc.h: butc.xg
! 	${RXGEN} -h -o $@ ${srcdir}/butc.xg
  
  butc.xdr.c: butc.h
  butc.cs.c: butc.h
--- 18,33 ----
  	${RANLIB} libbubasics.a
  
  butc.xdr.c: butc.xg
! 	${RXGEN} -A -c -o $@ ${srcdir}/butc.xg
  
  butc.ss.c: butc.xg
! 	${RXGEN} -A -S -o $@ ${srcdir}/butc.xg
  
  butc.cs.c: butc.xg
! 	${RXGEN} -A -C -o $@ ${srcdir}/butc.xg
  
  butc.h: butc.xg
! 	${RXGEN} -A -h -o $@ ${srcdir}/butc.xg
  
  butc.xdr.c: butc.h
  butc.cs.c: butc.h
Index: openafs/src/bucoord/bc.p.h
diff -c openafs/src/bucoord/bc.p.h:1.3.2.3 openafs/src/bucoord/bc.p.h:1.3.2.4
*** openafs/src/bucoord/bc.p.h:1.3.2.3	Fri Jan  5 01:08:24 2007
--- openafs/src/bucoord/bc.p.h	Tue Oct 30 11:23:50 2007
***************
*** 13,23 ****
  #ifdef HAVE_STDIO_H
  #include <stdio.h>
  #endif /* HAVE_STDIO_H */
! #if defined(HAVE_STRING_H)
! # include <string.h>
! #elif defined(HAVE_STRINGS_H)
! # include <strings.h>
! #endif /* HAVE_STRING_H */
  
  /*
   * Represents a host in the config database.
--- 13,20 ----
  #ifdef HAVE_STDIO_H
  #include <stdio.h>
  #endif /* HAVE_STDIO_H */
! 
! #include <string.h>
  
  /*
   * Represents a host in the config database.
Index: openafs/src/bucoord/bc_status.c
diff -c openafs/src/bucoord/bc_status.c:1.11.2.2 openafs/src/bucoord/bc_status.c:1.11.2.3
*** openafs/src/bucoord/bc_status.c:1.11.2.2	Tue Apr 10 14:43:41 2007
--- openafs/src/bucoord/bc_status.c	Mon Mar 10 18:35:34 2008
***************
*** 11,17 ****
  #include <afs/stds.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/bc_status.c,v 1.11.2.2 2007/04/10 18:43:41 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/stds.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/bc_status.c,v 1.11.2.3 2008/03/10 22:35:34 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 105,112 ****
  
  char *cmdLine;
  
! int
! cmdDispatch()
  {
  #define	MAXV	100
      char **targv[MAXV];		/*Ptr to parsed argv stuff */
--- 105,112 ----
  
  char *cmdLine;
  
! void *
! cmdDispatch(void *unused)
  {
  #define	MAXV	100
      char **targv[MAXV];		/*Ptr to parsed argv stuff */
***************
*** 120,126 ****
      code = cmd_ParseLine(internalCmdLine, targv, &targc, MAXV);
      if (code) {
  	printf("Couldn't parse line: '%s'", afs_error_message(code));
! 	return (1);
      }
      free(internalCmdLine);
  
--- 120,126 ----
      code = cmd_ParseLine(internalCmdLine, targv, &targc, MAXV);
      if (code) {
  	printf("Couldn't parse line: '%s'", afs_error_message(code));
! 	return (void *)(1);
      }
      free(internalCmdLine);
  
***************
*** 130,139 ****
       */
      doDispatch(targc, targv, 1);
      cmd_FreeArgv(targv);
!     return(0);
  }
  
! statusWatcher()
  {
      struct rx_connection *tconn = (struct rc_connection *)0;
      statusP curPollPtr = 0;
--- 130,140 ----
       */
      doDispatch(targc, targv, 1);
      cmd_FreeArgv(targv);
!     return(void *)(0);
  }
  
! void *
! statusWatcher(void *unused)
  {
      struct rx_connection *tconn = (struct rc_connection *)0;
      statusP curPollPtr = 0;
***************
*** 395,400 ****
--- 396,402 ----
  	    curPollPtr = 0;
  	}			/*done */
      }				/*w */
+     return NULL;
  }
  
  /* bc_jobNumber
Index: openafs/src/bucoord/bucoord_prototypes.h
diff -c /dev/null openafs/src/bucoord/bucoord_prototypes.h:1.1.4.2
*** /dev/null	Mon Apr 28 17:55:43 2008
--- openafs/src/bucoord/bucoord_prototypes.h	Tue Mar 11 10:06:31 2008
***************
*** 0 ****
--- 1,17 ----
+ /* Copyright 2000, International Business Machines Corporation and others.
+  * All Rights Reserved.
+  * 
+  * This software has been released under the terms of the IBM Public
+  * License.  For details, see the LICENSE file in the top-level source
+  * directory or online at http://www.openafs.org/dl/license10.html
+  */
+ 
+ #ifndef _BUCOORD_PROTOTYPES_H
+ #define _BUCOORD_PROTOTYPES_H
+ 
+ /* bc_status.c */
+ 
+ extern void *statusWatcher(void *);
+ 
+ #endif
+ 
Index: openafs/src/bucoord/commands.c
diff -c openafs/src/bucoord/commands.c:1.14.2.9 openafs/src/bucoord/commands.c:1.14.2.11
*** openafs/src/bucoord/commands.c:1.14.2.9	Sat Jun 23 11:27:22 2007
--- openafs/src/bucoord/commands.c	Mon Nov 26 16:21:50 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/commands.c,v 1.14.2.9 2007/06/23 15:27:22 shadow Exp $");
  
  #include <afs/stds.h>
  #if defined(AFS_LINUX24_ENV)
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/commands.c,v 1.14.2.11 2007/11/26 21:21:50 shadow Exp $");
  
  #include <afs/stds.h>
  #if defined(AFS_LINUX24_ENV)
***************
*** 765,771 ****
  /* printIfStatus
   *	print out an interface status node as received from butc
   */
! 
  printIfStatus(statusPtr)
       struct tciStatusS *statusPtr;
  {
--- 765,772 ----
  /* printIfStatus
   *	print out an interface status node as received from butc
   */
!  
! void
  printIfStatus(statusPtr)
       struct tciStatusS *statusPtr;
  {
***************
*** 822,831 ****
  /* bc_GetTapeStatusCmd
   *	display status of all tasks on a particular tape coordinator
   */
! 
! bc_GetTapeStatusCmd(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
  {
      afs_int32 code;
      struct rx_connection *tconn;
--- 823,830 ----
  /* bc_GetTapeStatusCmd
   *	display status of all tasks on a particular tape coordinator
   */
! int
! bc_GetTapeStatusCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct rx_connection *tconn;
***************
*** 920,929 ****
   * parameters
   *	ignored - a null "as" prints only jobs.
   */
! 
! bc_JobsCmd(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
  {
      afs_int32 prevTime;
      dlqlinkP ptr;
--- 919,926 ----
   * parameters
   *	ignored - a null "as" prints only jobs.
   */
! int
! bc_JobsCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 prevTime;
      dlqlinkP ptr;
***************
*** 1037,1045 ****
      return 0;
  }
  
! bc_KillCmd(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
  {
      afs_int32 i;
      afs_int32 slot;
--- 1034,1041 ----
      return 0;
  }
  
! int
! bc_KillCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 i;
      afs_int32 slot;
***************
*** 1111,1119 ****
  }
  
  /* restore a volume or volumes */
! bc_VolRestoreCmd(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
  {
      /*
       * parm 0 is the new server to restore to
--- 1107,1114 ----
  }
  
  /* restore a volume or volumes */
! int
! bc_VolRestoreCmd(struct cmd_syndesc *as, void *arock)
  {
      /*
       * parm 0 is the new server to restore to
***************
*** 1266,1274 ****
   *	various optional
   */
  
! bc_DiskRestoreCmd(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
  {
      struct bc_volumeSet tvolumeSet;	/* temporary volume set for EvalVolumeSet call */
      struct bc_volumeEntry tvolumeEntry;	/* entry within the volume set */
--- 1261,1268 ----
   *	various optional
   */
  
! int
! bc_DiskRestoreCmd(struct cmd_syndesc *as, void *arock)
  {
      struct bc_volumeSet tvolumeSet;	/* temporary volume set for EvalVolumeSet call */
      struct bc_volumeEntry tvolumeEntry;	/* entry within the volume set */
***************
*** 1423,1431 ****
   *	restore a volumeset or list of volumes.
   */
  
! bc_VolsetRestoreCmd(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
  {
      int oldFlag;
      long fromDate;
--- 1417,1424 ----
   *	restore a volumeset or list of volumes.
   */
  
! int
! bc_VolsetRestoreCmd(struct cmd_syndesc *as, void *arock)
  {
      int oldFlag;
      long fromDate;
***************
*** 1606,1614 ****
  int dontExecute;
  
  int
! bc_DumpCmd(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
  {				/*bc_DumpCmd */
      static char rn[] = "bc_DumpCmd";	/*Routine name */
      char *dumpPath, *vsName;	/*Ptrs to various names */
--- 1599,1605 ----
  int dontExecute;
  
  int
! bc_DumpCmd(struct cmd_syndesc *as, void *arock)
  {				/*bc_DumpCmd */
      static char rn[] = "bc_DumpCmd";	/*Routine name */
      char *dumpPath, *vsName;	/*Ptrs to various names */
***************
*** 1986,1995 ****
   * parameters:
   *	ignored
   */
! 
! bc_QuitCmd(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
  {
      int i;
      struct bc_dumpTask *td;
--- 1977,1984 ----
   * parameters:
   *	ignored
   */
! int
! bc_QuitCmd(struct cmd_syndesc *as, void *arock)
  {
      int i;
      struct bc_dumpTask *td;
***************
*** 2038,2047 ****
   *	Labels a tape i.e. request the tape coordinator to perform this
   *	operation
   */
! 
! bc_LabelTapeCmd(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
  {
      char *tapename = 0, *pname = 0;
      afs_int32 size;
--- 2027,2034 ----
   *	Labels a tape i.e. request the tape coordinator to perform this
   *	operation
   */
! int
! bc_LabelTapeCmd(struct cmd_syndesc *as, void *arock)
  {
      char *tapename = 0, *pname = 0;
      afs_int32 size;
***************
*** 2101,2110 ****
   * params:
   *	optional port number
   */
! 
! bc_ReadLabelCmd(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
  {
      afs_int32 code;
      afs_int32 port = 0;
--- 2088,2095 ----
   * params:
   *	optional port number
   */
! int
! bc_ReadLabelCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      afs_int32 port = 0;
***************
*** 2131,2140 ****
   *	read content information from dump tapes, and if user desires,
   *	add it to the database
   */
! 
! bc_ScanDumpsCmd(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
  {
      afs_int32 port = 0;
      afs_int32 dbAddFlag = 0;
--- 2116,2123 ----
   *	read content information from dump tapes, and if user desires,
   *	add it to the database
   */
! int
! bc_ScanDumpsCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 port = 0;
      afs_int32 dbAddFlag = 0;
***************
*** 2242,2251 ****
   *	Currently a single option, volumename to search for. Reports
   *	all dumps containing the specified volume
   */
! 
! bc_dblookupCmd(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
  {
      struct cmd_item *ciptr;
      afs_int32 code;
--- 2225,2232 ----
   *	Currently a single option, volumename to search for. Reports
   *	all dumps containing the specified volume
   */
! int
! bc_dblookupCmd(struct cmd_syndesc *as, void *arock)
  {
      struct cmd_item *ciptr;
      afs_int32 code;
***************
*** 2261,2270 ****
  
  
  /* for ubik version */
! 
! bc_dbVerifyCmd(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
  {
      afs_int32 status;
      afs_int32 orphans;
--- 2242,2249 ----
  
  
  /* for ubik version */
! int
! bc_dbVerifyCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 status;
      afs_int32 orphans;
***************
*** 2420,2429 ****
   * entry:
   *	dump id - single required arg as param 0.
   */
! 
! bc_deleteDumpCmd(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
  {
      afs_uint32 dumpid;
      afs_int32 code = 0;
--- 2399,2406 ----
   * entry:
   *	dump id - single required arg as param 0.
   */
! int
! bc_deleteDumpCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_uint32 dumpid;
      afs_int32 code = 0;
***************
*** 2576,2584 ****
      return (rcode);
  }
  
! bc_saveDbCmd(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
  {
      struct rx_connection *tconn;
      afs_int32 portOffset = 0;
--- 2553,2560 ----
      return (rcode);
  }
  
! int
! bc_saveDbCmd(struct cmd_syndesc *as, void *arock)
  {
      struct rx_connection *tconn;
      afs_int32 portOffset = 0;
***************
*** 2646,2654 ****
      return (code);
  }
  
! bc_restoreDbCmd(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
  {
      struct rx_connection *tconn;
      afs_int32 portOffset = 0;
--- 2622,2629 ----
      return (code);
  }
  
! int
! bc_restoreDbCmd(struct cmd_syndesc *as, void *arock)
  {
      struct rx_connection *tconn;
      afs_int32 portOffset = 0;
***************
*** 3151,3159 ****
   *	as - name of tape
   *	arock -
   */
! bc_dumpInfoCmd(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
  {
      afs_int32 dumpid;
      afs_int32 detailFlag;
--- 3126,3133 ----
   *	as - name of tape
   *	arock -
   */
! int
! bc_dumpInfoCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 dumpid;
      afs_int32 detailFlag;
Index: openafs/src/bucoord/dlq.c
diff -c openafs/src/bucoord/dlq.c:1.9.2.1 openafs/src/bucoord/dlq.c:1.9.2.2
*** openafs/src/bucoord/dlq.c:1.9.2.1	Thu Jan  4 22:34:09 2007
--- openafs/src/bucoord/dlq.c	Mon Nov 26 16:21:50 2007
***************
*** 12,20 ****
  #ifdef HAVE_STDLIB_H
  #include <stdlib.h>
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/dlq.c,v 1.9.2.1 2007/01/05 03:34:09 shadow Exp $");
  
  #include "bc.h"
  #include <afs/bubasics.h>
--- 12,21 ----
  #ifdef HAVE_STDLIB_H
  #include <stdlib.h>
  #endif
+ #include <stdio.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/dlq.c,v 1.9.2.2 2007/11/26 21:21:50 shadow Exp $");
  
  #include "bc.h"
  #include <afs/bubasics.h>
Index: openafs/src/bucoord/dsstub.c
diff -c openafs/src/bucoord/dsstub.c:1.6.2.2 openafs/src/bucoord/dsstub.c:1.6.2.3
*** openafs/src/bucoord/dsstub.c:1.6.2.2	Thu Jan  4 22:34:09 2007
--- openafs/src/bucoord/dsstub.c	Mon Nov 26 16:21:50 2007
***************
*** 15,21 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/dsstub.c,v 1.6.2.2 2007/01/05 03:34:09 shadow Exp $");
  
  #include <sys/types.h>
  #include <afs/cmd.h>
--- 15,21 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/dsstub.c,v 1.6.2.3 2007/11/26 21:21:50 shadow Exp $");
  
  #include <sys/types.h>
  #include <afs/cmd.h>
***************
*** 26,31 ****
--- 26,33 ----
  #include <netinet/in.h>
  #include <netdb.h>
  #endif
+ #include <stdio.h>
+ #include <string.h>
  #include <dirent.h>
  #include <afs/afsutil.h>
  #include <afs/budb.h>
Index: openafs/src/bucoord/dsvs.c
diff -c openafs/src/bucoord/dsvs.c:1.9.2.2 openafs/src/bucoord/dsvs.c:1.9.2.3
*** openafs/src/bucoord/dsvs.c:1.9.2.2	Thu Jan  4 22:34:09 2007
--- openafs/src/bucoord/dsvs.c	Mon Nov 26 16:21:50 2007
***************
*** 19,25 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/dsvs.c,v 1.9.2.2 2007/01/05 03:34:09 shadow Exp $");
  
  #include <sys/types.h>
  #include <afs/cmd.h>
--- 19,25 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/dsvs.c,v 1.9.2.3 2007/11/26 21:21:50 shadow Exp $");
  
  #include <sys/types.h>
  #include <afs/cmd.h>
***************
*** 44,49 ****
--- 44,51 ----
  extern struct bc_volumeSet *bc_FindVolumeSet(struct bc_config *cf,
  					     char *name);
  
+ static FreeVolumeEntryList();
+ static FreeVolumeEntry();
  
  /* Code to maintain dump schedule and volume set abstractions.
   * A volume set looks like this:
Index: openafs/src/bucoord/dump.c
diff -c openafs/src/bucoord/dump.c:1.12.2.3 openafs/src/bucoord/dump.c:1.12.2.6
*** openafs/src/bucoord/dump.c:1.12.2.3	Tue Apr 10 14:43:41 2007
--- openafs/src/bucoord/dump.c	Wed Apr  9 12:40:16 2008
***************
*** 15,21 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/dump.c,v 1.12.2.3 2007/04/10 18:43:41 shadow Exp $");
  
  #include <sys/types.h>
  #include <afs/cmd.h>
--- 15,21 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/dump.c,v 1.12.2.6 2008/04/09 16:40:16 shadow Exp $");
  
  #include <sys/types.h>
  #include <afs/cmd.h>
***************
*** 178,183 ****
--- 178,184 ----
   *	free the list of volumes used for dumps
   */
  
+ void
  freeDumpTaskVolumeList(vdptr)
       struct bc_volumeDump *vdptr;
  {
***************
*** 198,206 ****
   *     The other half of the dump/restore create process call. In bc_StartDmpRst, 
   *     we allocated a dumpTask entry. Here we do the task and then free the entry.
   */
! bc_DmpRstStart(aindex)
!      afs_int32 aindex;
  {
      register struct bc_dumpTask *tdump;
      register afs_int32 code;
  
--- 199,208 ----
   *     The other half of the dump/restore create process call. In bc_StartDmpRst, 
   *     we allocated a dumpTask entry. Here we do the task and then free the entry.
   */
! void *
! bc_DmpRstStart(void *param)
  {
+     afs_int32 aindex = (afs_int32) param;
      register struct bc_dumpTask *tdump;
      register afs_int32 code;
  
***************
*** 223,229 ****
  	free(tdump->portOffset);
      tdump->flags &= ~BC_DI_INUSE;
  
!     return code;
  }
  
  /* bc_StartDmpRst
--- 225,231 ----
  	free(tdump->portOffset);
      tdump->flags &= ~BC_DI_INUSE;
  
!     return (void *)code;
  }
  
  /* bc_StartDmpRst
Index: openafs/src/bucoord/dump_sched.c
diff -c openafs/src/bucoord/dump_sched.c:1.7.2.5 openafs/src/bucoord/dump_sched.c:1.7.2.7
*** openafs/src/bucoord/dump_sched.c:1.7.2.5	Tue Apr 10 14:43:41 2007
--- openafs/src/bucoord/dump_sched.c	Mon Nov 26 16:21:50 2007
***************
*** 12,22 ****
   */
  
  #include <sys/types.h>
  #include <afsconfig.h>
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/dump_sched.c,v 1.7.2.5 2007/04/10 18:43:41 shadow Exp $");
  
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
--- 12,24 ----
   */
  
  #include <sys/types.h>
+ #include <stdio.h>
+ #include <string.h>
  #include <afsconfig.h>
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/dump_sched.c,v 1.7.2.7 2007/11/26 21:21:50 shadow Exp $");
  
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
***************
*** 43,48 ****
--- 45,51 ----
  extern struct udbHandleS udbHandle;
  extern char *whoami;
  
+ static ListDumpSchedule();
  
  /* ------------------------------------
   * command level routines
***************
*** 56,68 ****
   *	parm 1: expiration date (list)
   */
  
! afs_int32
! bc_AddDumpCmd(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
  {
      register char *dname;	/* dump schedule name */
!     register afs_int32 code;
      afs_int32 expType, expDate;
      register struct cmd_item *ti;
      udbClientTextP ctPtr;
--- 59,69 ----
   *	parm 1: expiration date (list)
   */
  
! int
! bc_AddDumpCmd(struct cmd_syndesc *as, void *arock)
  {
      register char *dname;	/* dump schedule name */
!     register int code;
      afs_int32 expType, expDate;
      register struct cmd_item *ti;
      udbClientTextP ctPtr;
***************
*** 146,161 ****
   *	delete a dump schedule
   */
  
! afs_int32
! bc_DeleteDumpCmd(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
  {
      /* parm 0 is vol set name
       * parm 1 is dump schedule name
       */
      register char *dname;
!     register afs_int32 code;
      udbClientTextP ctPtr;
  
      /* lock schedules and check validity */
--- 147,160 ----
   *	delete a dump schedule
   */
  
! int
! bc_DeleteDumpCmd(struct cmd_syndesc *as, void *arock)
  {
      /* parm 0 is vol set name
       * parm 1 is dump schedule name
       */
      register char *dname;
!     register int code;
      udbClientTextP ctPtr;
  
      /* lock schedules and check validity */
***************
*** 265,275 ****
   *      ignored
   */
  
! afs_int32
! bc_ListDumpScheduleCmd(struct cmd_syndesc *as, char *arock)
  {
      /* no parms */
!     afs_int32 code;
      register struct bc_dumpSchedule *tdump;
  
      /* first check to see if schedules must be updated */
--- 264,274 ----
   *      ignored
   */
  
! int
! bc_ListDumpScheduleCmd(struct cmd_syndesc *as, void *arock)
  {
      /* no parms */
!     int code;
      register struct bc_dumpSchedule *tdump;
  
      /* first check to see if schedules must be updated */
***************
*** 298,314 ****
   *	parm 1: expiration date (list)
   */
  
! afs_int32
! bc_SetExpCmd(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
  {
      register char *dname;	/* dump schedule name */
      register struct cmd_item *ti;
      struct bc_dumpSchedule *node, *parent;
      afs_int32 expType, expDate;
      udbClientTextP ctPtr;
!     register afs_int32 code;
  
      afs_int32 bc_ParseExpiration();
  
--- 297,311 ----
   *	parm 1: expiration date (list)
   */
  
! int
! bc_SetExpCmd(struct cmd_syndesc *as, void *arock)
  {
      register char *dname;	/* dump schedule name */
      register struct cmd_item *ti;
      struct bc_dumpSchedule *node, *parent;
      afs_int32 expType, expDate;
      udbClientTextP ctPtr;
!     register int code;
  
      afs_int32 bc_ParseExpiration();
  
Index: openafs/src/bucoord/main.c
diff -c openafs/src/bucoord/main.c:1.16.2.3 openafs/src/bucoord/main.c:1.16.2.5
*** openafs/src/bucoord/main.c:1.16.2.3	Sat Jun 23 11:27:22 2007
--- openafs/src/bucoord/main.c	Mon Mar 10 18:35:34 2008
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/main.c,v 1.16.2.3 2007/06/23 15:27:22 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/main.c,v 1.16.2.5 2008/03/10 22:35:34 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 45,51 ****
  #include <afs/budb.h>
  
  #include "bc.h"			/*Backup Coordinator structs and defs */
! 
  
  int localauth, interact;
  char tcell[64];
--- 45,51 ----
  #include <afs/budb.h>
  
  #include "bc.h"			/*Backup Coordinator structs and defs */
! #include "bucoord_prototypes.h"
  
  int localauth, interact;
  char tcell[64];
***************
*** 244,251 ****
      PROCESS watcherPid;
      PROCESS pid;		/* LWP process ID */
  
-     extern statusWatcher();
- 
      /* Initialization */
      initialize_CMD_error_table();
  
--- 244,249 ----
***************
*** 326,333 ****
   */
  
  static int
! MyBeforeProc(as)
!      register struct cmd_syndesc *as;
  {
      afs_int32 code;
  
--- 324,330 ----
   */
  
  static int
! MyBeforeProc(register struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
  
***************
*** 462,470 ****
  }
  
  int
! bc_interactCmd(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
  {
      interact = 1;
      return 0;
--- 459,465 ----
  }
  
  int
! bc_interactCmd(struct cmd_syndesc *as, void *arock)
  {
      interact = 1;
      return 0;
***************
*** 516,522 ****
  
      cmd_SetBeforeProc(MyBeforeProc, NULL);
  
!     ts = cmd_CreateSyntax("dump", bc_DumpCmd, 0, "start dump");
      cmd_AddParm(ts, "-volumeset", CMD_SINGLE, CMD_OPTIONAL,
  		"volume set name");
      cmd_AddParm(ts, "-dump", CMD_SINGLE, CMD_OPTIONAL, "dump level name");
--- 511,517 ----
  
      cmd_SetBeforeProc(MyBeforeProc, NULL);
  
!     ts = cmd_CreateSyntax("dump", bc_DumpCmd, NULL, "start dump");
      cmd_AddParm(ts, "-volumeset", CMD_SINGLE, CMD_OPTIONAL,
  		"volume set name");
      cmd_AddParm(ts, "-dump", CMD_SINGLE, CMD_OPTIONAL, "dump level name");
***************
*** 530,536 ****
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("volrestore", bc_VolRestoreCmd, 0,
  			  "restore volume");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"destination machine");
--- 525,531 ----
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("volrestore", bc_VolRestoreCmd, NULL,
  			  "restore volume");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"destination machine");
***************
*** 549,555 ****
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("diskrestore", bc_DiskRestoreCmd, 0,
  			  "restore partition");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"machine to restore");
--- 544,550 ----
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("diskrestore", bc_DiskRestoreCmd, NULL,
  			  "restore partition");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"machine to restore");
***************
*** 567,575 ****
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("quit", bc_QuitCmd, 0, "leave the program");
  
!     ts = cmd_CreateSyntax("volsetrestore", bc_VolsetRestoreCmd, 0,
  			  "restore a set of volumes");
      cmd_AddParm(ts, "-name", CMD_SINGLE, CMD_OPTIONAL, "volume set name");
      cmd_AddParm(ts, "-file", CMD_SINGLE, CMD_OPTIONAL, "file name");
--- 562,570 ----
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("quit", bc_QuitCmd, NULL, "leave the program");
  
!     ts = cmd_CreateSyntax("volsetrestore", bc_VolsetRestoreCmd, NULL,
  			  "restore a set of volumes");
      cmd_AddParm(ts, "-name", CMD_SINGLE, CMD_OPTIONAL, "volume set name");
      cmd_AddParm(ts, "-file", CMD_SINGLE, CMD_OPTIONAL, "file name");
***************
*** 580,586 ****
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("addhost", bc_AddHostCmd, 0, "add host to config");
      cmd_AddParm(ts, "-tapehost", CMD_SINGLE, CMD_REQUIRED,
  		"tape machine name");
      cmd_AddParm(ts, "-portoffset", CMD_SINGLE, CMD_OPTIONAL,
--- 575,581 ----
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("addhost", bc_AddHostCmd, NULL, "add host to config");
      cmd_AddParm(ts, "-tapehost", CMD_SINGLE, CMD_REQUIRED,
  		"tape machine name");
      cmd_AddParm(ts, "-portoffset", CMD_SINGLE, CMD_OPTIONAL,
***************
*** 588,594 ****
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("delhost", bc_DeleteHostCmd, 0,
  			  "delete host to config");
      cmd_AddParm(ts, "-tapehost", CMD_SINGLE, CMD_REQUIRED,
  		"tape machine name");
--- 583,589 ----
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("delhost", bc_DeleteHostCmd, NULL,
  			  "delete host to config");
      cmd_AddParm(ts, "-tapehost", CMD_SINGLE, CMD_REQUIRED,
  		"tape machine name");
***************
*** 597,625 ****
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("listhosts", bc_ListHostsCmd, 0,
  			  "list config hosts");
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("jobs", bc_JobsCmd, 0, "list running jobs");
  
!     ts = cmd_CreateSyntax("kill", bc_KillCmd, 0, "kill running job");
      cmd_AddParm(ts, "-id", CMD_SINGLE, CMD_REQUIRED,
  		"job ID or dump set name");
  
!     ts = cmd_CreateSyntax("listvolsets", bc_ListVolSetCmd, 0,
  			  "list volume sets");
      cmd_AddParm(ts, "-name", CMD_SINGLE, CMD_OPTIONAL, "volume set name");
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("listdumps", bc_ListDumpScheduleCmd, 0,
  			  "list dump schedules");
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("addvolset", bc_AddVolSetCmd, 0,
  			  "create a new volume set");
      cmd_AddParm(ts, "-name", CMD_SINGLE, CMD_REQUIRED, "volume set name");
      cmd_AddParm(ts, "-temporary", CMD_FLAG, CMD_OPTIONAL,
--- 592,620 ----
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("listhosts", bc_ListHostsCmd, NULL,
  			  "list config hosts");
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("jobs", bc_JobsCmd, NULL, "list running jobs");
  
!     ts = cmd_CreateSyntax("kill", bc_KillCmd, NULL, "kill running job");
      cmd_AddParm(ts, "-id", CMD_SINGLE, CMD_REQUIRED,
  		"job ID or dump set name");
  
!     ts = cmd_CreateSyntax("listvolsets", bc_ListVolSetCmd, NULL,
  			  "list volume sets");
      cmd_AddParm(ts, "-name", CMD_SINGLE, CMD_OPTIONAL, "volume set name");
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("listdumps", bc_ListDumpScheduleCmd, NULL,
  			  "list dump schedules");
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("addvolset", bc_AddVolSetCmd, NULL,
  			  "create a new volume set");
      cmd_AddParm(ts, "-name", CMD_SINGLE, CMD_REQUIRED, "volume set name");
      cmd_AddParm(ts, "-temporary", CMD_FLAG, CMD_OPTIONAL,
***************
*** 627,646 ****
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("status", bc_GetTapeStatusCmd, 0,
  			  "get tape coordinator status");
      cmd_AddParm(ts, "-portoffset", CMD_SINGLE, CMD_OPTIONAL,
  		"TC port offset");
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("delvolset", bc_DeleteVolSetCmd, 0,
  			  "delete a volume set");
      cmd_AddParm(ts, "-name", CMD_LIST, CMD_REQUIRED, "volume set name");
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("addvolentry", bc_AddVolEntryCmd, 0,
  			  "add a new volume entry");
      cmd_AddParm(ts, "-name", CMD_SINGLE, CMD_REQUIRED, "volume set name");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "machine name");
--- 622,641 ----
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("status", bc_GetTapeStatusCmd, NULL,
  			  "get tape coordinator status");
      cmd_AddParm(ts, "-portoffset", CMD_SINGLE, CMD_OPTIONAL,
  		"TC port offset");
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("delvolset", bc_DeleteVolSetCmd, NULL,
  			  "delete a volume set");
      cmd_AddParm(ts, "-name", CMD_LIST, CMD_REQUIRED, "volume set name");
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("addvolentry", bc_AddVolEntryCmd, NULL,
  			  "add a new volume entry");
      cmd_AddParm(ts, "-name", CMD_SINGLE, CMD_REQUIRED, "volume set name");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "machine name");
***************
*** 650,675 ****
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("delvolentry", bc_DeleteVolEntryCmd, 0,
  			  "delete a volume set sub-entry");
      cmd_AddParm(ts, "-name", CMD_SINGLE, CMD_REQUIRED, "volume set name");
      cmd_AddParm(ts, "-entry", CMD_SINGLE, CMD_REQUIRED, "volume set index");
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("adddump", bc_AddDumpCmd, 0, "add dump schedule");
      cmd_AddParm(ts, "-dump", CMD_LIST, CMD_REQUIRED, "dump level name");
      cmd_AddParm(ts, "-expires", CMD_LIST, CMD_OPTIONAL, "expiration date");
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("deldump", bc_DeleteDumpCmd, 0,
  			  "delete dump schedule");
      cmd_AddParm(ts, "-dump", CMD_SINGLE, CMD_REQUIRED, "dump level name");
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("labeltape", bc_LabelTapeCmd, 0, "label a tape");
      cmd_AddParm(ts, "-name", CMD_SINGLE, CMD_OPTIONAL,
  		"AFS tape name, defaults to NULL");
      cmd_AddParm(ts, "-size", CMD_SINGLE, CMD_OPTIONAL,
--- 645,670 ----
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("delvolentry", bc_DeleteVolEntryCmd, NULL,
  			  "delete a volume set sub-entry");
      cmd_AddParm(ts, "-name", CMD_SINGLE, CMD_REQUIRED, "volume set name");
      cmd_AddParm(ts, "-entry", CMD_SINGLE, CMD_REQUIRED, "volume set index");
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("adddump", bc_AddDumpCmd, NULL, "add dump schedule");
      cmd_AddParm(ts, "-dump", CMD_LIST, CMD_REQUIRED, "dump level name");
      cmd_AddParm(ts, "-expires", CMD_LIST, CMD_OPTIONAL, "expiration date");
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("deldump", bc_DeleteDumpCmd, NULL,
  			  "delete dump schedule");
      cmd_AddParm(ts, "-dump", CMD_SINGLE, CMD_REQUIRED, "dump level name");
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("labeltape", bc_LabelTapeCmd, NULL, "label a tape");
      cmd_AddParm(ts, "-name", CMD_SINGLE, CMD_OPTIONAL,
  		"AFS tape name, defaults to NULL");
      cmd_AddParm(ts, "-size", CMD_SINGLE, CMD_OPTIONAL,
***************
*** 681,694 ****
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("readlabel", bc_ReadLabelCmd, 0,
  			  "read the label on tape");
      cmd_AddParm(ts, "-portoffset", CMD_SINGLE, CMD_OPTIONAL,
  		"TC port offset");
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("scantape", bc_ScanDumpsCmd, 0,
  			  "dump information recovery from tape");
      cmd_AddParm(ts, "-dbadd", CMD_FLAG, CMD_OPTIONAL,
  		"add information to the database");
--- 676,689 ----
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("readlabel", bc_ReadLabelCmd, NULL,
  			  "read the label on tape");
      cmd_AddParm(ts, "-portoffset", CMD_SINGLE, CMD_OPTIONAL,
  		"TC port offset");
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("scantape", bc_ScanDumpsCmd, NULL,
  			  "dump information recovery from tape");
      cmd_AddParm(ts, "-dbadd", CMD_FLAG, CMD_OPTIONAL,
  		"add information to the database");
***************
*** 697,730 ****
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("volinfo", bc_dblookupCmd, 0,
  			  "query the backup database");
      cmd_AddParm(ts, "-volume", CMD_SINGLE, CMD_REQUIRED, "volume name");
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("setexp", bc_SetExpCmd, 0,
  			  "set/clear dump expiration dates");
      cmd_AddParm(ts, "-dump", CMD_LIST, CMD_REQUIRED, "dump level name");
      cmd_AddParm(ts, "-expires", CMD_LIST, CMD_OPTIONAL, "expiration date");
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("savedb", bc_saveDbCmd, 0, "save backup database");
      cmd_AddParm(ts, "-portoffset", CMD_SINGLE, CMD_OPTIONAL,
  		"TC port offset");
      cmd_AddParm(ts, "-archive", CMD_LIST, CMD_OPTIONAL, "date time");
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("restoredb", bc_restoreDbCmd, 0,
  			  "restore backup database");
      cmd_AddParm(ts, "-portoffset", CMD_SINGLE, CMD_OPTIONAL,
  		"TC port offset");
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("dumpinfo", bc_dumpInfoCmd, 0,
  			  "provide information about a dump in the database");
      cmd_AddParm(ts, "-ndumps", CMD_SINGLE, CMD_OPTIONAL, "no. of dumps");
      cmd_AddParm(ts, "-id", CMD_SINGLE, CMD_OPTIONAL, "dump id");
--- 692,725 ----
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("volinfo", bc_dblookupCmd, NULL,
  			  "query the backup database");
      cmd_AddParm(ts, "-volume", CMD_SINGLE, CMD_REQUIRED, "volume name");
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("setexp", bc_SetExpCmd, NULL,
  			  "set/clear dump expiration dates");
      cmd_AddParm(ts, "-dump", CMD_LIST, CMD_REQUIRED, "dump level name");
      cmd_AddParm(ts, "-expires", CMD_LIST, CMD_OPTIONAL, "expiration date");
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("savedb", bc_saveDbCmd, NULL, "save backup database");
      cmd_AddParm(ts, "-portoffset", CMD_SINGLE, CMD_OPTIONAL,
  		"TC port offset");
      cmd_AddParm(ts, "-archive", CMD_LIST, CMD_OPTIONAL, "date time");
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("restoredb", bc_restoreDbCmd, NULL,
  			  "restore backup database");
      cmd_AddParm(ts, "-portoffset", CMD_SINGLE, CMD_OPTIONAL,
  		"TC port offset");
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("dumpinfo", bc_dumpInfoCmd, NULL,
  			  "provide information about a dump in the database");
      cmd_AddParm(ts, "-ndumps", CMD_SINGLE, CMD_OPTIONAL, "no. of dumps");
      cmd_AddParm(ts, "-id", CMD_SINGLE, CMD_OPTIONAL, "dump id");
***************
*** 733,745 ****
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("dbverify", bc_dbVerifyCmd, 0,
  			  "check ubik database integrity");
      cmd_AddParm(ts, "-detail", CMD_FLAG, CMD_OPTIONAL, "additional details");
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("deletedump", bc_deleteDumpCmd, 0,
  			  "delete dumps from the database");
      cmd_AddParm(ts, "-dumpid", CMD_LIST, CMD_OPTIONAL, "dump id");
      cmd_AddParm(ts, "-from", CMD_LIST, CMD_OPTIONAL, "date time");
--- 728,740 ----
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("dbverify", bc_dbVerifyCmd, NULL,
  			  "check ubik database integrity");
      cmd_AddParm(ts, "-detail", CMD_FLAG, CMD_OPTIONAL, "additional details");
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("deletedump", bc_deleteDumpCmd, NULL,
  			  "delete dumps from the database");
      cmd_AddParm(ts, "-dumpid", CMD_LIST, CMD_OPTIONAL, "dump id");
      cmd_AddParm(ts, "-from", CMD_LIST, CMD_OPTIONAL, "date time");
***************
*** 756,762 ****
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("interactive", bc_interactCmd, 0,
  			  "enter interactive mode");
      add_std_args(ts);
  
--- 751,757 ----
      if (!interact)
  	add_std_args(ts);
  
!     ts = cmd_CreateSyntax("interactive", bc_interactCmd, NULL,
  			  "enter interactive mode");
      add_std_args(ts);
  
Index: openafs/src/bucoord/regex.c
diff -c openafs/src/bucoord/regex.c:1.4.2.1 openafs/src/bucoord/regex.c:1.4.2.2
*** openafs/src/bucoord/regex.c:1.4.2.1	Sun Apr  3 14:48:29 2005
--- openafs/src/bucoord/regex.c	Mon Nov 26 16:21:50 2007
***************
*** 93,98 ****
--- 93,102 ----
  static char expbuf[ESIZE], *braslist[NBRA], *braelist[NBRA];
  static char circf;
  
+ static int advance();
+ static int backref();
+ static int cclass();
+ 
  /*
   * compile the regular expression argument into a dfa
   */
Index: openafs/src/bucoord/restore.c
diff -c openafs/src/bucoord/restore.c:1.8.2.8 openafs/src/bucoord/restore.c:1.8.2.9
*** openafs/src/bucoord/restore.c:1.8.2.8	Tue Oct 16 12:56:48 2007
--- openafs/src/bucoord/restore.c	Mon Nov 26 16:21:50 2007
***************
*** 15,21 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/restore.c,v 1.8.2.8 2007/10/16 16:56:48 jaltman Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 15,21 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/restore.c,v 1.8.2.9 2007/11/26 21:21:50 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 131,136 ****
--- 131,137 ----
      return (atol(sptr));
  }
  
+ void
  viceName(value)
       long value;
  {
Index: openafs/src/bucoord/status.c
diff -c openafs/src/bucoord/status.c:1.7.2.1 openafs/src/bucoord/status.c:1.7.2.2
*** openafs/src/bucoord/status.c:1.7.2.1	Thu Jan  4 22:34:09 2007
--- openafs/src/bucoord/status.c	Mon Nov 26 16:21:50 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/status.c,v 1.7.2.1 2007/01/05 03:34:09 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/status.c,v 1.7.2.2 2007/11/26 21:21:50 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 38,43 ****
--- 38,44 ----
   * These routines are common the backup coordinator and tape coordinator
   */
  
+ void
  initStatus()
  {
      dlqInit(&statusHead);
***************
*** 47,67 ****
--- 48,72 ----
  
  /* lock managment */
  
+ void
  lock_Status()
  {
      ObtainWriteLock(&statusQueueLock);
  }
  
+ void
  unlock_Status()
  {
      ReleaseWriteLock(&statusQueueLock);
  }
  
+ void
  lock_cmdLine()
  {
      ObtainWriteLock(&cmdLineLock);
  }
  
+ void
  unlock_cmdLine()
  {
      ReleaseWriteLock(&cmdLineLock);
***************
*** 109,114 ****
--- 114,120 ----
      return (ptr);
  }
  
+ void
  deleteStatusNode(ptr)
       statusP ptr;
  {
Index: openafs/src/bucoord/tape_hosts.c
diff -c openafs/src/bucoord/tape_hosts.c:1.7.2.3 openafs/src/bucoord/tape_hosts.c:1.7.2.4
*** openafs/src/bucoord/tape_hosts.c:1.7.2.3	Tue Apr 10 14:43:41 2007
--- openafs/src/bucoord/tape_hosts.c	Wed Oct 31 00:13:35 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/tape_hosts.c,v 1.7.2.3 2007/04/10 18:43:41 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/tape_hosts.c,v 1.7.2.4 2007/10/31 04:13:35 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 49,58 ****
   *	Add a host to the tape hosts
   */
  
! afs_int32
! bc_AddHostCmd(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
  {
      struct cmd_item *ti;
      udbClientTextP ctPtr;
--- 49,56 ----
   *	Add a host to the tape hosts
   */
  
! int
! bc_AddHostCmd(struct cmd_syndesc *as, void *arock)
  {
      struct cmd_item *ti;
      udbClientTextP ctPtr;
***************
*** 107,116 ****
      return (code);
  }
  
! afs_int32
! bc_DeleteHostCmd(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
  {
      struct cmd_item *ti;
      afs_int32 port = 0;
--- 105,112 ----
      return (code);
  }
  
! int
! bc_DeleteHostCmd(struct cmd_syndesc *as, void *arock)
  {
      struct cmd_item *ti;
      afs_int32 port = 0;
***************
*** 174,183 ****
   *	ignored
   */
  
! afs_int32
! bc_ListHostsCmd(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
  {
      afs_int32 code;
      register struct bc_hostEntry *tentry;
--- 170,177 ----
   *	ignored
   */
  
! int
! bc_ListHostsCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      register struct bc_hostEntry *tentry;
Index: openafs/src/bucoord/vol_sets.c
diff -c openafs/src/bucoord/vol_sets.c:1.10.2.4 openafs/src/bucoord/vol_sets.c:1.10.2.6
*** openafs/src/bucoord/vol_sets.c:1.10.2.4	Tue Apr 10 14:43:41 2007
--- openafs/src/bucoord/vol_sets.c	Mon Nov 26 16:21:50 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/vol_sets.c,v 1.10.2.4 2007/04/10 18:43:41 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/vol_sets.c,v 1.10.2.6 2007/11/26 21:21:50 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 41,46 ****
--- 41,47 ----
  extern struct bc_volumeSet *bc_FindVolumeSet(struct bc_config *cf, char *name);
  extern void FreeVolumeSet(struct bc_volumeSet *avset);
  
+ static ListVolSet();
  
  /* ------------------------------------
   * command level routines
***************
*** 57,67 ****
   *	parm 3 is volume regexp
   */
  
! bc_AddVolEntryCmd(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
  {
!     register afs_int32 code;
      char *volSetName, *serverName, *partitionName, *volRegExp;
      udbClientTextP ctPtr;
      struct bc_volumeSet *tset;
--- 58,67 ----
   *	parm 3 is volume regexp
   */
  
! int
! bc_AddVolEntryCmd(struct cmd_syndesc *as, void *arock)
  {
!     register int code;
      char *volSetName, *serverName, *partitionName, *volRegExp;
      udbClientTextP ctPtr;
      struct bc_volumeSet *tset;
***************
*** 129,141 ****
   *	name of new volume set
   */
  
! afs_int32
! bc_AddVolSetCmd(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
  {
      /* parm 0 is vol set name */
!     register afs_int32 code;
      register struct cmd_item *ti;
      udbClientTextP ctPtr;
      afs_int32 flags;
--- 129,139 ----
   *	name of new volume set
   */
  
! int
! bc_AddVolSetCmd(struct cmd_syndesc *as, void *arock)
  {
      /* parm 0 is vol set name */
!     register int code;
      register struct cmd_item *ti;
      udbClientTextP ctPtr;
      afs_int32 flags;
***************
*** 190,201 ****
   *	parm 1 is entry # (integer, 1 based)
   */
  
! afs_int32
! bc_DeleteVolEntryCmd(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
  {
!     register afs_int32 code;
      afs_int32 entry;
      char *vsname;
      udbClientTextP ctPtr;
--- 188,197 ----
   *	parm 1 is entry # (integer, 1 based)
   */
  
! int
! bc_DeleteVolEntryCmd(struct cmd_syndesc *as, void *arock)
  {
!     register int code;
      afs_int32 entry;
      char *vsname;
      udbClientTextP ctPtr;
***************
*** 279,291 ****
   *	name of volumeset to delete
   */
  
! afs_int32
! bc_DeleteVolSetCmd(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
  {
      /* parm 0 is vol set name */
!     register afs_int32 code;
      register struct cmd_item *ti;
      udbClientTextP ctPtr;
      afs_int32 c;
--- 275,285 ----
   *	name of volumeset to delete
   */
  
! int
! bc_DeleteVolSetCmd(struct cmd_syndesc *as, void *arock)
  {
      /* parm 0 is vol set name */
!     register int code;
      register struct cmd_item *ti;
      udbClientTextP ctPtr;
      afs_int32 c;
***************
*** 364,376 ****
    *     optional parameter specifies a volumeset name
    */
  
! afs_int32
! bc_ListVolSetCmd(struct cmd_syndesc *as, char *arock)
  {
      /* parm 0 is optional volume set to display */
      register struct bc_volumeSet *tset;
      register struct cmd_item *ti;
!     afs_int32 code = 0;
  
      code = bc_UpdateVolumeSet();
      if (code) {
--- 358,370 ----
    *     optional parameter specifies a volumeset name
    */
  
! int
! bc_ListVolSetCmd(struct cmd_syndesc *as, void *arock)
  {
      /* parm 0 is optional volume set to display */
      register struct bc_volumeSet *tset;
      register struct cmd_item *ti;
!     int code = 0;
  
      code = bc_UpdateVolumeSet();
      if (code) {
Index: openafs/src/budb/Makefile.in
diff -c openafs/src/budb/Makefile.in:1.10.2.1 openafs/src/budb/Makefile.in:1.10.2.2
*** openafs/src/budb/Makefile.in:1.10.2.1	Mon Jul 31 13:07:49 2006
--- openafs/src/budb/Makefile.in	Thu Nov  1 12:05:59 2007
***************
*** 74,89 ****
  	${CC} ${LDFLAGS} -o budb_server $(SERVER_OBJS) ${LIBS} ${XLIBS}
  
  budb.cs.c: budb.rg
! 	${RXGEN} -u -C -o $@ ${srcdir}/budb.rg
  
  budb.ss.c: budb.rg
! 	${RXGEN} -S -o $@ ${srcdir}/budb.rg
  
  budb.xdr.c: budb.rg
! 	${RXGEN} -c -o $@ ${srcdir}/budb.rg
  
  budb.h: budb.rg
! 	${RXGEN} -u -h -o $@ ${srcdir}/budb.rg
  
  budb.cs.c: budb.h
  budb.xdr.c: budb.h
--- 74,89 ----
  	${CC} ${LDFLAGS} -o budb_server $(SERVER_OBJS) ${LIBS} ${XLIBS}
  
  budb.cs.c: budb.rg
! 	${RXGEN} -A -u -C -o $@ ${srcdir}/budb.rg
  
  budb.ss.c: budb.rg
! 	${RXGEN} -A -S -o $@ ${srcdir}/budb.rg
  
  budb.xdr.c: budb.rg
! 	${RXGEN} -A -c -o $@ ${srcdir}/budb.rg
  
  budb.h: budb.rg
! 	${RXGEN} -A -u -h -o $@ ${srcdir}/budb.rg
  
  budb.cs.c: budb.h
  budb.xdr.c: budb.h
Index: openafs/src/budb/database.c
diff -c openafs/src/budb/database.c:1.7.2.1 openafs/src/budb/database.c:1.7.2.2
*** openafs/src/budb/database.c:1.7.2.1	Fri Jul  6 07:34:00 2007
--- openafs/src/budb/database.c	Tue Oct 30 11:23:50 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/budb/database.c,v 1.7.2.1 2007/07/06 11:34:00 jaltman Exp $");
  
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/budb/database.c,v 1.7.2.2 2007/10/30 15:23:50 shadow Exp $");
  
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
***************
*** 27,41 ****
  #include "database.h"
  #include "error_macros.h"
  #include "afs/audit.h"
- 
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
- 
  
  int pollCount;
  struct memoryDB db;		/* really allocate it here */
--- 27,33 ----
Index: openafs/src/budb/db_alloc.c
diff -c openafs/src/budb/db_alloc.c:1.7 openafs/src/budb/db_alloc.c:1.7.2.1
*** openafs/src/budb/db_alloc.c:1.7	Tue Jul 15 19:14:48 2003
--- openafs/src/budb/db_alloc.c	Tue Oct 30 11:23:50 2007
***************
*** 11,30 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/budb/db_alloc.c,v 1.7 2003/07/15 23:14:48 shadow Exp $");
  
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #else
  #include <netinet/in.h>
  #endif
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <sys/types.h>
  #include <afs/stds.h>
  #include <ubik.h>
--- 11,24 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/budb/db_alloc.c,v 1.7.2.1 2007/10/30 15:23:50 shadow Exp $");
  
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #else
  #include <netinet/in.h>
  #endif
  #include <string.h>
  #include <sys/types.h>
  #include <afs/stds.h>
  #include <ubik.h>
Index: openafs/src/budb/db_dump.c
diff -c openafs/src/budb/db_dump.c:1.7 openafs/src/budb/db_dump.c:1.7.2.2
*** openafs/src/budb/db_dump.c:1.7	Tue Jul 15 19:14:48 2003
--- openafs/src/budb/db_dump.c	Mon Nov 26 16:21:50 2007
***************
*** 16,22 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/budb/db_dump.c,v 1.7 2003/07/15 23:14:48 shadow Exp $");
  
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
--- 16,22 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/budb/db_dump.c,v 1.7.2.2 2007/11/26 21:21:50 shadow Exp $");
  
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
***************
*** 28,41 ****
  #include <sys/types.h>
  #include <ubik.h>
  #include <lock.h>
- 
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  
  #include "database.h"
  #include "budb.h"
--- 28,34 ----
***************
*** 100,105 ****
--- 93,99 ----
   *	no return value
   */
  
+ void
  haveWritten(nbytes)
       afs_int32 nbytes;
  {
***************
*** 121,126 ****
--- 115,121 ----
   *	done flag.
   */
  
+ void
  doneWriting(error)
       afs_int32 error;
  {
Index: openafs/src/budb/db_hash.c
diff -c openafs/src/budb/db_hash.c:1.8 openafs/src/budb/db_hash.c:1.8.2.1
*** openafs/src/budb/db_hash.c:1.8	Sat Nov 22 23:53:31 2003
--- openafs/src/budb/db_hash.c	Tue Oct 30 11:23:50 2007
***************
*** 11,30 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/budb/db_hash.c,v 1.8 2003/11/23 04:53:31 jaltman Exp $");
  
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #else
  #include <netinet/in.h>
  #endif
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <sys/types.h>
  #include <afs/stds.h>
  #include <ubik.h>
--- 11,24 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/budb/db_hash.c,v 1.8.2.1 2007/10/30 15:23:50 shadow Exp $");
  
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #else
  #include <netinet/in.h>
  #endif
  #include <string.h>
  #include <sys/types.h>
  #include <afs/stds.h>
  #include <ubik.h>
Index: openafs/src/budb/db_text.c
diff -c openafs/src/budb/db_text.c:1.10.2.2 openafs/src/budb/db_text.c:1.10.2.4
*** openafs/src/budb/db_text.c:1.10.2.2	Mon Jul 11 15:29:34 2005
--- openafs/src/budb/db_text.c	Mon Nov 26 16:21:50 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/budb/db_text.c,v 1.10.2.2 2005/07/11 19:29:34 shadow Exp $");
  
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/budb/db_text.c,v 1.10.2.4 2007/11/26 21:21:50 shadow Exp $");
  
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
***************
*** 22,34 ****
  #include <sys/file.h>
  #include <sys/param.h>
  #endif
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <sys/types.h>
  #include <ubik.h>
  #include <afs/auth.h>
--- 22,28 ----
***************
*** 490,496 ****
  }
  
  /* debug support */
! 
  saveTextToFile(ut, tbPtr)
       struct ubik_trans *ut;
       struct textBlock *tbPtr;
--- 484,490 ----
  }
  
  /* debug support */
! void
  saveTextToFile(ut, tbPtr)
       struct ubik_trans *ut;
       struct textBlock *tbPtr;
Index: openafs/src/budb/dbs_dump.c
diff -c openafs/src/budb/dbs_dump.c:1.11 openafs/src/budb/dbs_dump.c:1.11.2.1
*** openafs/src/budb/dbs_dump.c:1.11	Tue Jul 15 19:14:48 2003
--- openafs/src/budb/dbs_dump.c	Mon Mar 10 18:35:34 2008
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/budb/dbs_dump.c,v 1.11 2003/07/15 23:14:48 shadow Exp $");
  
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/budb/dbs_dump.c,v 1.11.2.1 2008/03/10 22:35:34 shadow Exp $");
  
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
***************
*** 45,50 ****
--- 45,51 ----
  #include "globals.h"
  #include "afs/audit.h"
  
+ void *dumpWatcher(void *);
  
  /* dump ubik database - interface routines */
  
***************
*** 64,72 ****
   *	decode the arguments passed via LWP and dump the database.
   */
  
! setupDbDump(writeFid)
!      int writeFid;
  {
      afs_int32 code = 0;
  
      code = InitRPC(&dumpSyncPtr->ut, LOCKREAD, 1);
--- 65,74 ----
   *	decode the arguments passed via LWP and dump the database.
   */
  
! void *
! setupDbDump(void *param)
  {
+     int writeFid = (int)param;
      afs_int32 code = 0;
  
      code = InitRPC(&dumpSyncPtr->ut, LOCKREAD, 1);
***************
*** 86,92 ****
    error_exit:
      if (dumpSyncPtr->ut)
  	ubik_EndTrans(dumpSyncPtr->ut);
!     return (code);
  }
  
  
--- 88,94 ----
    error_exit:
      if (dumpSyncPtr->ut)
  	ubik_EndTrans(dumpSyncPtr->ut);
!     return (void *)(code);
  }
  
  
***************
*** 117,123 ****
      PROCESS dumperPid, watcherPid;
      int readSize;
      afs_int32 code = 0;
-     extern dumpWatcher();
  
      if (callPermitted(call) == 0)
  	ERROR(BUDB_NOTPERMITTED);
--- 119,124 ----
***************
*** 289,295 ****
   *	transactions can proceed.
   */
  
! dumpWatcher()
  {
      afs_int32 code;
  
--- 290,297 ----
   *	transactions can proceed.
   */
  
! void *
! dumpWatcher(void *unused)
  {
      afs_int32 code;
  
Index: openafs/src/budb/ol_verify.c
diff -c openafs/src/budb/ol_verify.c:1.13.2.1 openafs/src/budb/ol_verify.c:1.13.2.2
*** openafs/src/budb/ol_verify.c:1.13.2.1	Fri Jul  6 07:38:31 2007
--- openafs/src/budb/ol_verify.c	Tue Oct 30 11:23:50 2007
***************
*** 13,19 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/budb/ol_verify.c,v 1.13.2.1 2007/07/06 11:38:31 jaltman Exp $");
  
  #include <stdio.h>
  #ifdef AFS_NT40_ENV
--- 13,19 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/budb/ol_verify.c,v 1.13.2.2 2007/10/30 15:23:50 shadow Exp $");
  
  #include <stdio.h>
  #ifdef AFS_NT40_ENV
***************
*** 22,34 ****
  #include <netinet/in.h>
  #include <netdb.h>
  #endif
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <afs/stds.h>
  #include <sys/types.h>
  #include <lock.h>
--- 22,28 ----
Index: openafs/src/budb/procs.c
diff -c openafs/src/budb/procs.c:1.14 openafs/src/budb/procs.c:1.14.2.1
*** openafs/src/budb/procs.c:1.14	Sun Dec  7 17:49:19 2003
--- openafs/src/budb/procs.c	Tue Oct 30 11:23:50 2007
***************
*** 17,23 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/budb/procs.c,v 1.14 2003/12/07 22:49:19 jaltman Exp $");
  
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
--- 17,23 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/budb/procs.c,v 1.14.2.1 2007/10/30 15:23:50 shadow Exp $");
  
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
***************
*** 29,42 ****
  #include <sys/resource.h>
  #endif
  
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
- 
  #include <sys/types.h>
  #include <afs/stds.h>
  #include <afs/bubasics.h>
--- 29,35 ----
Index: openafs/src/budb/server.c
diff -c openafs/src/budb/server.c:1.14.2.5 openafs/src/budb/server.c:1.14.2.9
*** openafs/src/budb/server.c:1.14.2.5	Tue Apr 10 14:43:41 2007
--- openafs/src/budb/server.c	Mon Mar 10 18:35:34 2008
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/budb/server.c,v 1.14.2.5 2007/04/10 18:43:41 shadow Exp $");
  
  #include <fcntl.h>
  #include <sys/stat.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/budb/server.c,v 1.14.2.9 2008/03/10 22:35:34 shadow Exp $");
  
  #include <fcntl.h>
  #include <sys/stat.h>
***************
*** 24,38 ****
  #include <sys/time.h>
  #include <netdb.h>
  #endif
- 
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
- 
  #include <afs/stds.h>
  #include <sys/types.h>
  #include <time.h>
--- 24,30 ----
***************
*** 62,67 ****
--- 54,61 ----
  struct ubik_dbase *BU_dbase;
  struct afsconf_dir *BU_conf;	/* for getting cell info */
  
+ int argHandler(struct cmd_syndesc *, void *);
+ 
  char lcell[MAXKTCREALMLEN];
  afs_int32 myHost = 0;
  int helpOption;
***************
*** 131,138 ****
   *      If it were, this routine would never have been called.
   */
  static int
! MyBeforeProc(as)
!      register struct cmd_syndesc *as;
  {
      helpOption = 0;
      return 0;
--- 125,131 ----
   *      If it were, this routine would never have been called.
   */
  static int
! MyBeforeProc(register struct cmd_syndesc *as, void *arock)
  {
      helpOption = 0;
      return 0;
***************
*** 142,153 ****
   *	initialize all the supported commands and their arguments
   */
  
  initializeArgHandler()
  {
      struct cmd_syndesc *cptr;
  
-     int argHandler();
- 
      cmd_SetBeforeProc(MyBeforeProc, NULL);
  
      cptr = cmd_CreateSyntax(NULL, argHandler, NULL, "Backup database server");
--- 135,145 ----
   *	initialize all the supported commands and their arguments
   */
  
+ void
  initializeArgHandler()
  {
      struct cmd_syndesc *cptr;
  
      cmd_SetBeforeProc(MyBeforeProc, NULL);
  
      cptr = cmd_CreateSyntax(NULL, argHandler, NULL, "Backup database server");
***************
*** 179,187 ****
  }
  
  int
! argHandler(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
  {
  
      /* globalConfPtr provides the handle for the configuration information */
--- 171,177 ----
  }
  
  int
! argHandler(struct cmd_syndesc *as, void *arock)
  {
  
      /* globalConfPtr provides the handle for the configuration information */
***************
*** 595,608 ****
      currentTime = time(0);
      LogError(0, "Ready to process requests at %s\n", ctime(&currentTime));
  
!     rx_ServerProc();		/* donate this LWP */
  
    error_exit:
      osi_audit(BUDB_FinishEvent, code, AUD_END);
      return (code);
  }
  
! 
  consistencyCheckDb()
  {
      /* do consistency checks on structure sizes */
--- 585,598 ----
      currentTime = time(0);
      LogError(0, "Ready to process requests at %s\n", ctime(&currentTime));
  
!     rx_ServerProc(NULL);		/* donate this LWP */
  
    error_exit:
      osi_audit(BUDB_FinishEvent, code, AUD_END);
      return (code);
  }
  
! void
  consistencyCheckDb()
  {
      /* do consistency checks on structure sizes */
Index: openafs/src/budb/struct_ops.c
diff -c openafs/src/budb/struct_ops.c:1.7 openafs/src/budb/struct_ops.c:1.7.2.1
*** openafs/src/budb/struct_ops.c:1.7	Sun Dec  7 20:45:28 2003
--- openafs/src/budb/struct_ops.c	Mon Nov 26 16:21:50 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/budb/struct_ops.c,v 1.7 2003/12/08 01:45:28 jaltman Exp $");
  
  #include <stdio.h>
  #ifdef AFS_NT40_ENV
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/budb/struct_ops.c,v 1.7.2.1 2007/11/26 21:21:50 shadow Exp $");
  
  #include <stdio.h>
  #ifdef AFS_NT40_ENV
***************
*** 36,41 ****
--- 36,42 ----
   * ----------------------------------
   */
  
+ void
  printDbHeader(ptr)
       struct DbHeader *ptr;
  {
***************
*** 47,52 ****
--- 48,54 ----
      printf("lastTapeId = %d\n", ptr->lastTapeId);
  }
  
+ void
  printDump(fid, dptr)
       FILE *fid;
       struct dump *dptr;
***************
*** 67,72 ****
--- 69,75 ----
  
  }
  
+ void
  printDumpEntry(deptr)
       struct budb_dumpEntry *deptr;
  {
***************
*** 105,110 ****
--- 108,114 ----
   *	print the hash table structure, i.e. the header structure.
   */
  
+ void
  printHashTable(fid, htptr)
       FILE *fid;
       struct hashTable *htptr;
***************
*** 308,313 ****
--- 312,318 ----
   *	currently used for debug only
   */
  
+ void
  volFragment_ntoh(netVfPtr, hostVfPtr)
       struct volFragment *netVfPtr, *hostVfPtr;
  {
***************
*** 324,329 ****
--- 329,335 ----
      hostVfPtr->sequence = ntohs(netVfPtr->sequence);
  }
  
+ void
  volInfo_ntoh(netViPtr, hostViPtr)
       struct volInfo *netViPtr, *hostViPtr;
  {
***************
*** 339,344 ****
--- 345,351 ----
      hostViPtr->nFrags = ntohl(netViPtr->nFrags);
  }
  
+ void
  tape_ntoh(netTapePtr, hostTapePtr)
       struct tape *netTapePtr, *hostTapePtr;
  {
***************
*** 360,365 ****
--- 367,373 ----
      hostTapePtr->useCount = ntohl(netTapePtr->useCount);
  }
  
+ void
  dump_ntoh(netDumpPtr, hostDumpPtr)
       struct dump *netDumpPtr, *hostDumpPtr;
  {
***************
*** 382,387 ****
--- 390,396 ----
      principal_ntoh(&netDumpPtr->dumper, &hostDumpPtr->dumper);
  }
  
+ void
  DbHeader_ntoh(netptr, hostptr)
       struct DbHeader *netptr, *hostptr;
  {
***************
*** 393,398 ****
--- 402,408 ----
      hostptr->lastTapeId = ntohl(netptr->lastTapeId);
  }
  
+ void
  dumpEntry_ntoh(netptr, hostptr)
       struct budb_dumpEntry *netptr, *hostptr;
  {
***************
*** 431,436 ****
--- 441,447 ----
      return 0;
  }
  
+ void
  structDumpHeader_hton(hostPtr, netPtr)
       struct structDumpHeader *hostPtr, *netPtr;
  {
***************
*** 439,444 ****
--- 450,456 ----
      netPtr->size = htonl(hostPtr->size);
  }
  
+ void
  structDumpHeader_ntoh(netPtr, hostPtr)
       struct structDumpHeader *hostPtr, *netPtr;
  {
***************
*** 447,452 ****
--- 459,465 ----
      hostPtr->size = ntohl(netPtr->size);
  }
  
+ void
  tapeEntry_ntoh(netptr, hostptr)
       struct budb_tapeEntry *netptr, *hostptr;
  {
***************
*** 491,496 ****
--- 504,510 ----
      return 0;
  }
  
+ void
  textBlock_hton(hostptr, netptr)
       struct textBlock *hostptr, *netptr;
  {
***************
*** 501,506 ****
--- 515,521 ----
      netptr->newTextAddr = htonl(hostptr->newTextAddr);
  }
  
+ void
  textBlock_ntoh(netptr, hostptr)
       struct textBlock *netptr, *hostptr;
  {
***************
*** 511,516 ****
--- 526,532 ----
      hostptr->newTextAddr = ntohl(netptr->newTextAddr);
  }
  
+ void
  textLock_hton(hostptr, netptr)
       db_lockP hostptr, netptr;
  {
***************
*** 522,527 ****
--- 538,544 ----
      netptr->lockHost = htonl(hostptr->lockHost);
  }
  
+ void
  textLock_ntoh(netptr, hostptr)
       db_lockP netptr, hostptr;
  {
***************
*** 533,538 ****
--- 550,556 ----
      hostptr->lockHost = ntohl(netptr->lockHost);
  }
  
+ void
  volumeEntry_ntoh(netptr, hostptr)
       struct budb_volumeEntry *netptr, *hostptr;
  {
***************
*** 559,565 ****
   * -------------------------------------
   */
  
! 
  copy_ktcPrincipal_to_budbPrincipal(ktcPtr, budbPtr)
       struct ktc_principal *ktcPtr;
       struct budb_principal *budbPtr;
--- 577,583 ----
   * -------------------------------------
   */
  
! void
  copy_ktcPrincipal_to_budbPrincipal(ktcPtr, budbPtr)
       struct ktc_principal *ktcPtr;
       struct budb_principal *budbPtr;
***************
*** 663,666 ****
--- 681,685 ----
      tapesetPtr->a = 1;
      tapesetPtr->b = 1;
      tapesetPtr->maxTapes = 0;
+     return 0;
  }
Index: openafs/src/butc/butc_prototypes.h
diff -c /dev/null openafs/src/butc/butc_prototypes.h:1.1.4.2
*** /dev/null	Mon Apr 28 17:55:43 2008
--- openafs/src/butc/butc_prototypes.h	Tue Mar 11 10:06:30 2008
***************
*** 0 ****
--- 1,36 ----
+ /* Copyright 2000, International Business Machines Corporation and others.
+  * All Rights Reserved.
+  * 
+  * This software has been released under the terms of the IBM Public
+  * License.  For details, see the LICENSE file in the top-level source
+  * directory or online at http://www.openafs.org/dl/license10.html
+  */
+ 
+ #ifndef _BUTC_PROTOTYPES_H
+ #define _BUTC_PROTOTYPES_H
+ 
+ /* dbentries.c */
+ 
+ extern void *dbWatcher(void *);
+ 
+ /* dump.c */
+ 
+ extern void *Dumper(void *);
+ extern void *DeleteDump(void *);
+ 
+ /* lwps.c */
+ extern void *Restorer(void *);
+ extern void *Labeller(void *);
+ 
+ /* recoverdDb.c */
+ 
+ extern void *ScanDumps(void *);
+ 
+ /* tcudbprocs.c */
+ 
+ extern void *saveDbToTape(void *);
+ extern void *restoreDbFromTape(void *);
+ extern void *KeepAlive(void *);
+ 
+ #endif
+ 
Index: openafs/src/butc/dbentries.c
diff -c openafs/src/butc/dbentries.c:1.8.2.1 openafs/src/butc/dbentries.c:1.8.2.5
*** openafs/src/butc/dbentries.c:1.8.2.1	Sat Jul  1 01:04:12 2006
--- openafs/src/butc/dbentries.c	Mon Mar 10 18:35:34 2008
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/butc/dbentries.c,v 1.8.2.1 2006/07/01 05:04:12 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/butc/dbentries.c,v 1.8.2.5 2008/03/10 22:35:34 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
***************
*** 24,29 ****
--- 24,30 ----
  #include <netdb.h>
  #endif
  #include <stdlib.h>
+ #include <string.h>
  #include <rx/xdr.h>
  #include <rx/rx.h>
  #include <lwp.h>
***************
*** 309,321 ****
      if (message) {
  	printf("Updating database - done\n");
      }
  }
  
  #define MAXVOLUMESTOADD 100
  int addvolumes = 1;
  
! void
! dbWatcher()
  {
      dlqlinkP entryPtr;
      struct budb_dumpEntry *dumpPtr;
--- 310,323 ----
      if (message) {
  	printf("Updating database - done\n");
      }
+     return;
  }
  
  #define MAXVOLUMESTOADD 100
  int addvolumes = 1;
  
! void *
! dbWatcher(void *unused)
  {
      dlqlinkP entryPtr;
      struct budb_dumpEntry *dumpPtr;
***************
*** 483,486 ****
--- 485,489 ----
  	IOMGR_Sleep(2);
  #endif
      }
+     return NULL;
  }
Index: openafs/src/butc/dump.c
diff -c openafs/src/butc/dump.c:1.17.2.1 openafs/src/butc/dump.c:1.17.2.3
*** openafs/src/butc/dump.c:1.17.2.1	Sun Apr  3 14:15:45 2005
--- openafs/src/butc/dump.c	Mon Mar 10 18:35:34 2008
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/butc/dump.c,v 1.17.2.1 2005/04/03 18:15:45 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/butc/dump.c,v 1.17.2.3 2008/03/10 22:35:34 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
***************
*** 24,29 ****
--- 24,30 ----
  #include <netdb.h>
  #endif
  #include <stdlib.h>
+ #include <string.h>
  #include <rx/xdr.h>
  #include <rx/rx.h>
  #include <lwp.h>
***************
*** 1116,1124 ****
      return (code);
  }
  
! int
! Dumper(struct dumpNode *nodePtr)
  {
      struct dumpRock dparams;
      struct butm_tapeInfo tapeInfo;
      int pass;
--- 1117,1126 ----
      return (code);
  }
  
! void *
! Dumper(void *param)
  {
+     struct dumpNode *nodePtr = (struct dumpNode *)param;
      struct dumpRock dparams;
      struct butm_tapeInfo tapeInfo;
      int pass;
***************
*** 1368,1374 ****
  
      FreeNode(taskId);		/* free the dump node */
      LeaveDeviceQueue(deviceLatch);
!     return (code);
  }
  
  #define BELLTIME 60		/* 60 seconds before a bell rings */
--- 1370,1376 ----
  
      FreeNode(taskId);		/* free the dump node */
      LeaveDeviceQueue(deviceLatch);
!     return (void *)(code);
  }
  
  #define BELLTIME 60		/* 60 seconds before a bell rings */
***************
*** 2029,2037 ****
  /* DeleteDump
   *
   */
! int
! DeleteDump(struct deleteDumpIf *ptr)
  {
      afs_int32 taskId;
      afs_int32 rc, code = 0;
      afs_uint32 dumpid;
--- 2031,2041 ----
  /* DeleteDump
   *
   */
! void *
! DeleteDump(void *param)
  {
+     struct deleteDumpIf *ptr = (struct deleteDumpIf *)param;
+ 
      afs_int32 taskId;
      afs_int32 rc, code = 0;
      afs_uint32 dumpid;
Index: openafs/src/butc/lwps.c
diff -c openafs/src/butc/lwps.c:1.12.2.3 openafs/src/butc/lwps.c:1.12.2.7
*** openafs/src/butc/lwps.c:1.12.2.3	Tue Apr 10 14:43:41 2007
--- openafs/src/butc/lwps.c	Wed Apr  9 12:40:17 2008
***************
*** 11,19 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/butc/lwps.c,v 1.12.2.3 2007/04/10 18:43:41 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #include <conio.h>
--- 11,20 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/butc/lwps.c,v 1.12.2.7 2008/04/09 16:40:17 shadow Exp $");
  
  #include <sys/types.h>
+ #include <string.h>
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #include <conio.h>
***************
*** 546,551 ****
--- 547,553 ----
   *     Regardless of error, the closecallout routine will be called
   *     (unless a tape is not mounted in the first place).
   */
+ void
  unmountTape(taskId, tapeInfoPtr)
       afs_int32 taskId;
       struct butm_tapeInfo *tapeInfoPtr;
***************
*** 1741,1749 ****
   *	created as a LWP by the server stub, <newNode> is a pointer to all
   *	the parameters Restorer needs
   */
! Restorer(newNode)
!      struct dumpNode *newNode;
! {
      afs_int32 code = 0, tcode;
      afs_uint32 taskId;
      char *newVolName;
--- 1743,1752 ----
   *	created as a LWP by the server stub, <newNode> is a pointer to all
   *	the parameters Restorer needs
   */
! void *
! Restorer(void *param) {
!     struct dumpNode *newNode = (struct dumpNode *) param;
! 
      afs_int32 code = 0, tcode;
      afs_uint32 taskId;
      char *newVolName;
***************
*** 1917,1927 ****
  
      FreeNode(taskId);
      LeaveDeviceQueue(deviceLatch);
!     return (code);
  }
  
  /* this is just scaffolding, creates new tape label with name <tapeName> */
  
  GetNewLabel(tapeInfoPtr, pName, AFSName, tapeLabel)
       struct butm_tapeInfo *tapeInfoPtr;
       char *pName, *AFSName;
--- 1920,1931 ----
  
      FreeNode(taskId);
      LeaveDeviceQueue(deviceLatch);
!     return (void *)(code);
  }
  
  /* this is just scaffolding, creates new tape label with name <tapeName> */
  
+ void
  GetNewLabel(tapeInfoPtr, pName, AFSName, tapeLabel)
       struct butm_tapeInfo *tapeInfoPtr;
       char *pName, *AFSName;
***************
*** 2223,2231 ****
   *	specified by <label>
   */
  
! Labeller(labelIfPtr)
!      struct labelTapeIf *labelIfPtr;
  {
      struct tc_tapeLabel *label = &labelIfPtr->label;
  
      struct butm_tapeLabel newTapeLabel;
--- 2227,2237 ----
   *	specified by <label>
   */
  
! void *
! Labeller(void *param)
  {
+     struct labelTapeIf *labelIfPtr = (struct labelTapeIf *)param;
+ 
      struct tc_tapeLabel *label = &labelIfPtr->label;
  
      struct butm_tapeLabel newTapeLabel;
***************
*** 2276,2288 ****
  
      free(labelIfPtr);
      LeaveDeviceQueue(deviceLatch);
!     return (code);
  }
  
  /* PrintTapeLabel
   *	print out the tape label.
   */
  
  PrintTapeLabel(labelptr)
       struct butm_tapeLabel *labelptr;
  {
--- 2282,2295 ----
  
      free(labelIfPtr);
      LeaveDeviceQueue(deviceLatch);
!     return (void *)(code);
  }
  
  /* PrintTapeLabel
   *	print out the tape label.
   */
  
+ void
  PrintTapeLabel(labelptr)
       struct butm_tapeLabel *labelptr;
  {
Index: openafs/src/butc/read_tape.c
diff -c openafs/src/butc/read_tape.c:1.7 openafs/src/butc/read_tape.c:1.7.2.3
*** openafs/src/butc/read_tape.c:1.7	Tue Jul 15 19:14:49 2003
--- openafs/src/butc/read_tape.c	Mon Nov 26 16:21:51 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/butc/read_tape.c,v 1.7 2003/07/15 23:14:49 shadow Exp $");
  
  #include <afs/cmd.h>
  #include <lock.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/butc/read_tape.c,v 1.7.2.3 2007/11/26 21:21:51 shadow Exp $");
  
  #include <afs/cmd.h>
  #include <lock.h>
***************
*** 21,26 ****
--- 21,27 ----
  #include <netinet/in.h>
  #include <fcntl.h>
  #include <stdio.h>
+ #include <string.h>
  #include <errno.h>
  
  #include <afs/usd.h>
***************
*** 81,86 ****
--- 82,88 ----
      return 0;
  }
  
+ void
  printLabel(tapeLabelPtr)
       struct tapeLabel *tapeLabelPtr;
  {
***************
*** 129,134 ****
--- 131,137 ----
      }
  }
  
+ void
  printHeader(headerPtr, isvolheader)
       struct volumeHeader *headerPtr;
       afs_int32 *isvolheader;
***************
*** 381,389 ****
      return 0;
  }
  
! WorkerBee(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
  {
      char *tapedev;
      struct tapeLabel *label;
--- 384,391 ----
      return 0;
  }
  
! static int
! WorkerBee(struct cmd_syndesc *as, void *arock)
  {
      char *tapedev;
      struct tapeLabel *label;
Index: openafs/src/butc/recoverDb.c
diff -c openafs/src/butc/recoverDb.c:1.10.2.4 openafs/src/butc/recoverDb.c:1.10.2.7
*** openafs/src/butc/recoverDb.c:1.10.2.4	Sat Jul  1 01:04:12 2006
--- openafs/src/butc/recoverDb.c	Mon Mar 10 18:35:34 2008
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/butc/recoverDb.c,v 1.10.2.4 2006/07/01 05:04:12 shadow Exp $");
  
  #include <stdio.h>
  #ifdef AFS_NT40_ENV
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/butc/recoverDb.c,v 1.10.2.7 2008/03/10 22:35:34 shadow Exp $");
  
  #include <stdio.h>
  #ifdef AFS_NT40_ENV
***************
*** 24,29 ****
--- 24,30 ----
  #include <strings.h>
  #endif
  #include <sys/types.h>
+ #include <string.h>
  #include <rx/xdr.h>
  #include <rx/rx.h>
  #include <lwp.h>
***************
*** 51,56 ****
--- 52,59 ----
  extern struct tapeConfig globalTapeConfig;
  extern struct deviceSyncNode *deviceLatch;
  
+ static readDump();
+ 
  /* PrintDumpLabel
   *	print out the tape (dump) label.
   */
***************
*** 689,697 ****
   *	
   */
  
! int
! ScanDumps(struct scanTapeIf *ptr)
  {
      struct butm_tapeInfo curTapeInfo;
      struct tapeScanInfo tapeScanInfo;
      afs_uint32 taskId;
--- 692,702 ----
   *	
   */
  
! void *
! ScanDumps(void *param)
  {
+     struct scanTapeIf *ptr = (struct scanTapeIf *)param;
+     
      struct butm_tapeInfo curTapeInfo;
      struct tapeScanInfo tapeScanInfo;
      afs_uint32 taskId;
***************
*** 748,754 ****
      free(ptr);
      setStatus(taskId, TASK_DONE);
      LeaveDeviceQueue(deviceLatch);
!     return (code);
  }
  
  
--- 753,759 ----
      free(ptr);
      setStatus(taskId, TASK_DONE);
      LeaveDeviceQueue(deviceLatch);
!     return (void *)(code);
  }
  
  
Index: openafs/src/butc/tcmain.c
diff -c openafs/src/butc/tcmain.c:1.14.2.6 openafs/src/butc/tcmain.c:1.14.2.8
*** openafs/src/butc/tcmain.c:1.14.2.6	Sat Jul  1 01:04:12 2006
--- openafs/src/butc/tcmain.c	Mon Mar 10 18:35:34 2008
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/butc/tcmain.c,v 1.14.2.6 2006/07/01 05:04:12 shadow Exp $");
  
  #include <sys/types.h>
  #include <sys/stat.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/butc/tcmain.c,v 1.14.2.8 2008/03/10 22:35:34 shadow Exp $");
  
  #include <sys/types.h>
  #include <sys/stat.h>
***************
*** 57,62 ****
--- 57,63 ----
  #include "afs/butx.h"
  #define XBSA_TCMAIN
  #include "butc_xbsa.h"
+ #include "butc_prototypes.h"
  
  #define N_SECURITY_OBJECTS 3
  #define ERRCODE_RANGE 8		/* from error_table.h */
***************
*** 67,73 ****
  
  struct ubik_client *cstruct;
  extern void TC_ExecuteRequest();
- extern int dbWatcher();
  FILE *logIO, *ErrorlogIO, *centralLogIO, *lastLogIO;
  char lFile[AFSDIR_PATH_MAX];
  char logFile[256];
--- 68,73 ----
***************
*** 830,836 ****
  }
  
  static int
! WorkerBee(struct cmd_syndesc *as, char *arock)
  {
      register afs_int32 code;
      struct rx_securityClass *(securityObjects[3]);
--- 830,836 ----
  }
  
  static int
! WorkerBee(struct cmd_syndesc *as, void *arock)
  {
      register afs_int32 code;
      struct rx_securityClass *(securityObjects[3]);
Index: openafs/src/butc/tcprocs.c
diff -c openafs/src/butc/tcprocs.c:1.12.2.3 openafs/src/butc/tcprocs.c:1.12.2.6
*** openafs/src/butc/tcprocs.c:1.12.2.3	Sat Jul  1 01:04:12 2006
--- openafs/src/butc/tcprocs.c	Mon Mar 10 18:35:34 2008
***************
*** 13,19 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/butc/tcprocs.c,v 1.12.2.3 2006/07/01 05:04:12 shadow Exp $");
  
  #include <sys/types.h>
  #include <errno.h>
--- 13,19 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/butc/tcprocs.c,v 1.12.2.6 2008/03/10 22:35:34 shadow Exp $");
  
  #include <sys/types.h>
  #include <errno.h>
***************
*** 27,32 ****
--- 27,33 ----
  #include <rx/rx.h>
  #include <afs/afsint.h>
  #include <stdio.h>
+ #include <string.h>
  #include <afs/procmgmt.h>
  #include <afs/assert.h>
  #include <afs/prs_fs.h>
***************
*** 41,46 ****
--- 42,53 ----
  #include <afs/tcdata.h>
  #include "error_macros.h"
  #include "butc_xbsa.h"
+ #include "butc_prototypes.h"
+     
+ static CopyDumpDesc();
+ static CopyRestoreDesc();
+ static CopyTapeSetDesc();
+ 
  
  int
  callPermitted(struct rx_call *call)
***************
*** 139,148 ****
      PROCESS pid;
  #endif
      struct labelTapeIf *ptr;
!     statusP statusPtr;
      afs_int32 code;
  
-     extern int Labeller();
      extern statusP createStatusNode();
      extern afs_int32 allocTaskId();
  
--- 146,154 ----
      PROCESS pid;
  #endif
      struct labelTapeIf *ptr;
!     statusP statusPtr = NULL;
      afs_int32 code;
  
      extern statusP createStatusNode();
      extern afs_int32 allocTaskId();
  
***************
*** 223,229 ****
      afs_int32 code = 0;
  
      extern statusP createStatusNode();
-     extern Dumper();
  
      if (callPermitted(rxCallId) == 0)
  	return (TC_NOTPERMITTED);
--- 229,234 ----
***************
*** 311,317 ****
  STC_PerformRestore(struct rx_call *acid, char *dumpSetName, tc_restoreArray *arestores, afs_int32 *taskID)
  {
      struct dumpNode *newNode;
!     statusP statusPtr;
      afs_int32 code = 0;
  #ifdef AFS_PTHREAD_ENV
      pthread_t pid;
--- 316,322 ----
  STC_PerformRestore(struct rx_call *acid, char *dumpSetName, tc_restoreArray *arestores, afs_int32 *taskID)
  {
      struct dumpNode *newNode;
!     statusP statusPtr = 0;
      afs_int32 code = 0;
  #ifdef AFS_PTHREAD_ENV
      pthread_t pid;
***************
*** 321,327 ****
      PROCESS pid;
  #endif
  
-     extern int Restorer();
      extern statusP createStatusNode();
  
      if (callPermitted(acid) == 0)
--- 326,331 ----
***************
*** 417,426 ****
  #else
      PROCESS pid;
  #endif
!     statusP statusPtr;
      afs_int32 code = 0;
  
-     extern afs_int32 restoreDbFromTape();
      extern statusP createStatusNode();
      extern afs_int32 allocTaskId();
  
--- 421,429 ----
  #else
      PROCESS pid;
  #endif
!     statusP statusPtr = 0;
      afs_int32 code = 0;
  
      extern statusP createStatusNode();
      extern afs_int32 allocTaskId();
  
***************
*** 487,497 ****
  #else
      PROCESS pid;
  #endif
!     statusP statusPtr;
      afs_int32 code = 0;
      struct saveDbIf *ptr;
  
-     extern afs_int32 saveDbToTape();
      extern statusP createStatusNode();
      extern afs_int32 allocTaskId();
  
--- 490,499 ----
  #else
      PROCESS pid;
  #endif
!     statusP statusPtr = NULL;
      afs_int32 code = 0;
      struct saveDbIf *ptr;
  
      extern statusP createStatusNode();
      extern afs_int32 allocTaskId();
  
***************
*** 571,580 ****
      PROCESS pid;
  #endif
      struct scanTapeIf *ptr;
!     statusP statusPtr;
      afs_int32 code = 0;
  
-     extern afs_int32 ScanDumps();
      extern afs_int32 allocTaskId();
      extern statusP createStatusNode();
  
--- 573,581 ----
      PROCESS pid;
  #endif
      struct scanTapeIf *ptr;
!     statusP statusPtr = 0;
      afs_int32 code = 0;
  
      extern afs_int32 allocTaskId();
      extern statusP createStatusNode();
  
***************
*** 666,672 ****
      PROCESS pid;
  #endif
  #endif
-     extern afs_int32 DeleteDump();
      extern statusP createStatusNode();
      extern afs_int32 allocTaskId();
  
--- 667,672 ----
Index: openafs/src/butc/tcstatus.c
diff -c openafs/src/butc/tcstatus.c:1.6 openafs/src/butc/tcstatus.c:1.6.2.1
*** openafs/src/butc/tcstatus.c:1.6	Tue Jul 15 19:14:49 2003
--- openafs/src/butc/tcstatus.c	Tue Oct 30 11:23:50 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/butc/tcstatus.c,v 1.6 2003/07/15 23:14:49 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/butc/tcstatus.c,v 1.6.2.1 2007/10/30 15:23:50 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
***************
*** 24,29 ****
--- 24,30 ----
  #include <strings.h>
  #endif
  #include <stdio.h>
+ #include <string.h>
  #include <afs/com_err.h>
  #include <lock.h>
  #include <afs/bubasics.h>
Index: openafs/src/butc/tcudbprocs.c
diff -c openafs/src/butc/tcudbprocs.c:1.14.2.2 openafs/src/butc/tcudbprocs.c:1.14.2.7
*** openafs/src/butc/tcudbprocs.c:1.14.2.2	Mon Jul 31 13:07:50 2006
--- openafs/src/butc/tcudbprocs.c	Fri Apr 18 09:57:31 2008
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/butc/tcudbprocs.c,v 1.14.2.2 2006/07/31 17:07:50 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/butc/tcudbprocs.c,v 1.14.2.7 2008/04/18 13:57:31 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
***************
*** 28,33 ****
--- 28,34 ----
  #include <rx/rx.h>
  #include <afs/afsint.h>
  #include <stdio.h>
+ #include <string.h>
  #include <afs/procmgmt.h>
  #include <afs/assert.h>
  #include <afs/prs_fs.h>
***************
*** 52,57 ****
--- 53,63 ----
  extern int dump_namecheck;
  extern int autoQuery;
  
+ static void initTapeBuffering();
+ static writeDbDump();
+ static restoreDbEntries();
+ 
+ void * KeepAlive(void *);
  /* CreateDBDump
   *      create a dump entry for a saved database 
   */
***************
*** 409,416 ****
      extern struct tapeConfig globalTapeConfig;
      extern struct udbHandleS udbHandle;
  
-     extern int KeepAlive();
- 
      blockSize = BUTM_BLKSIZE;
      writeBlock = (char *)malloc(BUTM_BLOCKSIZE);
      if (!writeBlock)
--- 415,420 ----
***************
*** 620,629 ****
   *	dump backup database to tape
   */
  
! afs_int32
! saveDbToTape(saveDbIfPtr)
!      struct saveDbIf *saveDbIfPtr;
  {
      afs_int32 code = 0;
      afs_int32 i;
      int wroteLabel;
--- 624,633 ----
   *	dump backup database to tape
   */
  
! void *
! saveDbToTape(void *param)
  {
+     struct saveDbIf *saveDbIfPtr = (struct saveDbIf *)param;
      afs_int32 code = 0;
      afs_int32 i;
      int wroteLabel;
***************
*** 741,747 ****
  
      free(saveDbIfPtr);
      LeaveDeviceQueue(deviceLatch);
!     return (code);
  }
  
  struct rstTapeInfo {
--- 745,751 ----
  
      free(saveDbIfPtr);
      LeaveDeviceQueue(deviceLatch);
!     return (void *)(code);
  }
  
  struct rstTapeInfo {
***************
*** 905,911 ****
  }
  
  static afs_int32 nbytes = 0;	/* # bytes left in buffer */
! static
  initTapeBuffering()
  {
      nbytes = 0;
--- 909,915 ----
  }
  
  static afs_int32 nbytes = 0;	/* # bytes left in buffer */
! static void
  initTapeBuffering()
  {
      nbytes = 0;
***************
*** 1014,1023 ****
   *	restore the backup database from tape.
   */
  
! afs_int32
! restoreDbFromTape(taskId)
!      afs_uint32 taskId;
  {
      afs_int32 code = 0;
      afs_int32 i;
      struct butm_tapeInfo tapeInfo;
--- 1018,1027 ----
   *	restore the backup database from tape.
   */
  
! void *
! restoreDbFromTape(void *param)
  {
+     afs_uint32 taskId = (afs_uint32) param;
      afs_int32 code = 0;
      afs_int32 i;
      struct butm_tapeInfo tapeInfo;
***************
*** 1103,1109 ****
      LeaveDeviceQueue(deviceLatch);
      setStatus(taskId, TASK_DONE);
  
!     return (code);
  }
  
  /* KeepAlive
--- 1107,1113 ----
      LeaveDeviceQueue(deviceLatch);
      setStatus(taskId, TASK_DONE);
  
!     return (void *)(code);
  }
  
  /* KeepAlive
***************
*** 1115,1122 ****
   *      
   *      Use the same udbHandle as writeDbDump so we go to the same server.
   */
! int
! KeepAlive()
  {
      charListT charList;
      afs_int32 code;
--- 1119,1126 ----
   *      
   *      Use the same udbHandle as writeDbDump so we go to the same server.
   */
! void *
! KeepAlive(void *unused)
  {
      charListT charList;
      afs_int32 code;
Index: openafs/src/butc/test.c
diff -c openafs/src/butc/test.c:1.5 openafs/src/butc/test.c:1.5.2.1
*** openafs/src/butc/test.c:1.5	Tue Jul 15 19:14:49 2003
--- openafs/src/butc/test.c	Wed Oct 31 00:13:37 2007
***************
*** 81,89 ****
  }
  
  
! static
! PerformDump(as)
!      register struct cmd_syndesc *as;
  {
      struct rx_connection *aconn;
      afs_int32 server;
--- 81,88 ----
  }
  
  
! static int
! PerformDump(register struct cmd_syndesc *as, void *arock)
  {
      struct rx_connection *aconn;
      afs_int32 server;
***************
*** 128,138 ****
  	exit(1);
      }
      printf("dumpid returned %u\n", tdumpID);
  }
  
! static
! PerformRestore(as)
!      register struct cmd_syndesc *as;
  {
      struct rx_connection *aconn;
      afs_int32 server;
--- 127,138 ----
  	exit(1);
      }
      printf("dumpid returned %u\n", tdumpID);
+ 
+     return 0;
  }
  
! static int
! PerformRestore(register struct cmd_syndesc *as, void *arock)
  {
      struct rx_connection *aconn;
      afs_int32 server;
***************
*** 170,180 ****
  	exit(1);
      }
      printf("dumpid returned %u\n", tdumpID);
  }
  
! static
! CheckDump(as)
!      register struct cmd_syndesc *as;
  {
      struct rx_connection *aconn;
      afs_int32 server;
--- 170,180 ----
  	exit(1);
      }
      printf("dumpid returned %u\n", tdumpID);
+     return 0;
  }
  
! static int
! CheckDump(register struct cmd_syndesc *as, void *arock)
  {
      struct rx_connection *aconn;
      afs_int32 server;
***************
*** 190,200 ****
  	printf("call to TC_CheckDump failed %u\n", code);
  	exit(1);
      }
  }
  
! static
! AbortDump(as)
!      register struct cmd_syndesc *as;
  {
      struct rx_connection *aconn;
      afs_int32 server;
--- 190,200 ----
  	printf("call to TC_CheckDump failed %u\n", code);
  	exit(1);
      }
+     return 0;
  }
  
! static int
! AbortDump(register struct cmd_syndesc *as, void *arock)
  {
      struct rx_connection *aconn;
      afs_int32 server;
***************
*** 210,220 ****
  	printf("call to TC_AbortDump failed %u\n", code);
  	exit(1);
      }
  }
  
! static
! WaitForDump(as)
!      register struct cmd_syndesc *as;
  {
      struct rx_connection *aconn;
      afs_int32 server;
--- 210,220 ----
  	printf("call to TC_AbortDump failed %u\n", code);
  	exit(1);
      }
+     return 0;
  }
  
! static int
! WaitForDump(register struct cmd_syndesc *as, void *arock)
  {
      struct rx_connection *aconn;
      afs_int32 server;
***************
*** 230,240 ****
  	printf("call to TC_WaitForDump failed %u\n", code);
  	exit(1);
      }
  }
  
! static
! EndDump(as)
!      register struct cmd_syndesc *as;
  {
      struct rx_connection *aconn;
      afs_int32 server;
--- 230,240 ----
  	printf("call to TC_WaitForDump failed %u\n", code);
  	exit(1);
      }
+     return 0;
  }
  
! static int
! EndDump(register struct cmd_syndesc *as, void *arock)
  {
      struct rx_connection *aconn;
      afs_int32 server;
***************
*** 250,261 ****
  	printf("call to TC_EndDump failed %u\n", code);
  	exit(1);
      }
  }
  
! static
! MyBeforeProc(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
  {
      afs_int32 code;
  
--- 250,260 ----
  	printf("call to TC_EndDump failed %u\n", code);
  	exit(1);
      }
+     return 0;
  }
  
! static int
! MyBeforeProc(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
  
***************
*** 296,315 ****
  #endif
      cmd_SetBeforeProc(MyBeforeProc, NULL);
  
!     ts = cmd_CreateSyntax("dump", PerformDump, 0, "perform a dump");
  
!     ts = cmd_CreateSyntax("restore", PerformRestore, 0, "perform a restore");
  
!     ts = cmd_CreateSyntax("check", CheckDump, 0, "check a dump");
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "dump id");
  
!     ts = cmd_CreateSyntax("abort", AbortDump, 0, "abort a dump");
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "dump id");
  
!     ts = cmd_CreateSyntax("wait", WaitForDump, 0, "wait for a dump");
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "dump id");
  
!     ts = cmd_CreateSyntax("end", EndDump, 0, "end a dump");
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "dump id");
  
      code = cmd_Dispatch(argc, argv);
--- 295,314 ----
  #endif
      cmd_SetBeforeProc(MyBeforeProc, NULL);
  
!     ts = cmd_CreateSyntax("dump", PerformDump, NULL, "perform a dump");
  
!     ts = cmd_CreateSyntax("restore", PerformRestore, NULL, "perform a restore");
  
!     ts = cmd_CreateSyntax("check", CheckDump, NULL, "check a dump");
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "dump id");
  
!     ts = cmd_CreateSyntax("abort", AbortDump, NULL, "abort a dump");
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "dump id");
  
!     ts = cmd_CreateSyntax("wait", WaitForDump, NULL, "wait for a dump");
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "dump id");
  
!     ts = cmd_CreateSyntax("end", EndDump, NULL, "end a dump");
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "dump id");
  
      code = cmd_Dispatch(argc, argv);
Index: openafs/src/butm/file_tm.c
diff -c openafs/src/butm/file_tm.c:1.11.2.2 openafs/src/butm/file_tm.c:1.11.2.4
*** openafs/src/butm/file_tm.c:1.11.2.2	Tue Apr 10 14:43:42 2007
--- openafs/src/butm/file_tm.c	Mon Nov 26 16:21:51 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/butm/file_tm.c,v 1.11.2.2 2007/04/10 18:43:42 shadow Exp $");
  
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/butm/file_tm.c,v 1.11.2.4 2007/11/26 21:21:51 shadow Exp $");
  
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
***************
*** 24,29 ****
--- 24,30 ----
  #include <limits.h>
  #include <sys/stat.h>
  #include <stdio.h>
+ #include <string.h>
  #include <ctype.h>
  #include <lwp.h>
  #include <afs/com_err.h>
***************
*** 626,631 ****
--- 627,633 ----
   *	dataSize - bytes used on the tape
   */
  
+ void
  incSize(info, dataSize)
       struct butm_tapeInfo *info;
       afs_uint32 dataSize;
***************
*** 647,652 ****
--- 649,655 ----
   *	dataSize - bytes used on the tape
   */
  
+ void
  incPosition(info, fid, dataSize)
       struct butm_tapeInfo *info;
       usd_handle_t fid;
Index: openafs/src/cf/kerberos.m4
diff -c openafs/src/cf/kerberos.m4:1.1.2.11 openafs/src/cf/kerberos.m4:1.1.2.16
*** openafs/src/cf/kerberos.m4:1.1.2.11	Wed Oct 10 13:47:59 2007
--- openafs/src/cf/kerberos.m4	Fri Apr 18 16:50:28 2008
***************
*** 1,5 ****
  dnl
! dnl $Id: kerberos.m4,v 1.1.2.11 2007/10/10 17:47:59 shadow Exp $
  dnl
  dnl Kerberos autoconf glue
  dnl
--- 1,5 ----
  dnl
! dnl $Id: kerberos.m4,v 1.1.2.16 2008/04/18 20:50:28 shadow Exp $
  dnl
  dnl Kerberos autoconf glue
  dnl
***************
*** 58,64 ****
  	CPPFLAGS="$CPPFLAGS $KRB5CFLAGS"
  	save_LIBS="$LIBS"
  	LIBS="$LIBS $KRB5LIBS"
! 	AC_CHECK_FUNCS([add_to_error_table add_error_table krb5_princ_size krb5_principal_get_comp_string encode_krb5_enc_tkt_part encode_krb5_ticket])
  	AC_CHECK_FUNCS([krb5_524_convert_creds], ,
  	    [AC_CHECK_FUNCS([krb524_convert_creds_kdc], ,
  		[AC_CHECK_LIB([krb524], [krb524_convert_creds_kdc],
--- 58,64 ----
  	CPPFLAGS="$CPPFLAGS $KRB5CFLAGS"
  	save_LIBS="$LIBS"
  	LIBS="$LIBS $KRB5LIBS"
! 	AC_CHECK_FUNCS([add_to_error_table add_error_table krb5_princ_size krb5_principal_get_comp_string encode_krb5_enc_tkt_part encode_krb5_ticket krb5_c_encrypt krb5_c_encrypt_length krb5_cc_register krb5_decode_ticket krb5_get_prompt_types])
  	AC_CHECK_FUNCS([krb5_524_convert_creds], ,
  	    [AC_CHECK_FUNCS([krb524_convert_creds_kdc], ,
  		[AC_CHECK_LIB([krb524], [krb524_convert_creds_kdc],
***************
*** 91,108 ****
--- 91,126 ----
  ac_cv_krb5_creds_session_exists=no)])
  AC_MSG_RESULT($ac_cv_krb5_creds_session_exists)
  
+ AC_MSG_CHECKING(for krb5_prompt.type existence)
+ AC_CACHE_VAL(ac_cv_krb5_prompt_type_exists,
+ [
+ AC_TRY_COMPILE(
+ [#include <krb5.h>],
+ [krb5_prompt _p;
+ printf("%x\n", _p.type);], 
+ ac_cv_krb5_prompt_type_exists=yes,
+ ac_cv_krb5_prompt_type_exists=no)])
+ AC_MSG_RESULT($ac_cv_krb5_prompt_type_exists)
+ 	
  if test "x$ac_cv_krb5_creds_keyblock_exists" = "xyes"; then
  	AC_DEFINE(HAVE_KRB5_CREDS_KEYBLOCK, 1, [define if krb5_creds has keyblock])
  fi
  if test "x$ac_cv_krb5_creds_session_exists" = "xyes"; then
  	AC_DEFINE(HAVE_KRB5_CREDS_SESSION, 1, [define if krb5_creds has session])
  fi
+ if test "x$ac_cv_krb5_prompt_type_exists" = "xyes"; then
+ 	AC_DEFINE(HAVE_KRB5_PROMPT_TYPE, 1, [define if krb5_prompt has type])
+ fi
  	
  dnl	AC_CHECK_MEMBERS([krb5_creds.keyblock, krb5_creds.session],,, [#include <krb5.h>])
  	CPPFLAGS="$save_CPPFLAGS"
  	LIBS="$save_LIBS"
  fi
  
+ if test "x$ac_cv_krb5_cc_register_exists" = "xyes"; then
+         AC_DEFINE(HAVE_KRB5_CC_REGISTER, 1, [define if krb5_cc_register exists])
+ fi
+ 
  AC_SUBST(BUILD_KRB5)
  AC_SUBST(KRB5CFLAGS)
  AC_SUBST(KRB5LIBS)
Index: openafs/src/cf/linux-test1.m4
diff -c openafs/src/cf/linux-test1.m4:1.3.2.8 openafs/src/cf/linux-test1.m4:1.3.2.12
*** openafs/src/cf/linux-test1.m4:1.3.2.8	Fri Feb  9 13:29:37 2007
--- openafs/src/cf/linux-test1.m4	Mon Jan  7 13:34:59 2008
***************
*** 2,10 ****
  #                 [ACTION-IF-SUCCESS], [ACTION-IF-FAILURE])
  #
  AC_DEFUN([AC_TRY_KBUILD26],[  rm -fr conftest.dir
    if mkdir conftest.dir &&
      cat >conftest.dir/Makefile <<_ACEOF &&
! CFLAGS += $CPPFLAGS
  
  obj-m += conftest.o
  _ACEOF
--- 2,13 ----
  #                 [ACTION-IF-SUCCESS], [ACTION-IF-FAILURE])
  #
  AC_DEFUN([AC_TRY_KBUILD26],[  rm -fr conftest.dir
+   if test "x$ac_linux_kbuild_requires_extra_cflags" = "xyes" ; then
+     CFLAGS_PREFIX='EXTRA_'
+   fi
    if mkdir conftest.dir &&
      cat >conftest.dir/Makefile <<_ACEOF &&
! ${CFLAGS_PREFIX}CFLAGS += $CPPFLAGS
  
  obj-m += conftest.o
  _ACEOF
***************
*** 24,31 ****
  
  MODULE_LICENSE("http://www.openafs.org/dl/license10.html");
  _ACEOF
!     echo make -C $LINUX_KERNEL_PATH M=$SRCDIR_PARENT/conftest.dir modules KBUILD_VERBOSE=1 >&AS_MESSAGE_LOG_FD
!     make -C $LINUX_KERNEL_PATH M=$SRCDIR_PARENT/conftest.dir modules KBUILD_VERBOSE=1 >&AS_MESSAGE_LOG_FD 2>conftest.err
      then [$3]
      else
        sed '/^ *+/d' conftest.err >&AS_MESSAGE_LOG_FD
--- 27,35 ----
  
  MODULE_LICENSE("http://www.openafs.org/dl/license10.html");
  _ACEOF
!     echo make -C $LINUX_KERNEL_PATH M=$SRCDIR_PARENT/conftest.dir modules KBUILD_VERBOSE=1 >&AS_MESSAGE_LOG_FD &&
!     make -C $LINUX_KERNEL_PATH M=$SRCDIR_PARENT/conftest.dir modules KBUILD_VERBOSE=1 >&AS_MESSAGE_LOG_FD 2>conftest.err &&
!     ! grep -i "^WARNING: .* undefined!$" conftest.err >/dev/null 2>&1
      then [$3]
      else
        sed '/^ *+/d' conftest.err >&AS_MESSAGE_LOG_FD
***************
*** 42,49 ****
  #
  AC_DEFUN([AC_TRY_KBUILD24], [
    ac_save_CPPFLAGS="$CPPFLAGS"
!   CPPFLAGS="-I$LINUX_KERNEL_PATH/include -D__KERNEL__ $CPPFLAGS"
!   AC_TRY_COMPILE([$1], [$2], [$3], [$4])
    CPPFLAGS="$ac_save_CPPFLAGS"])
  
  
--- 46,55 ----
  #
  AC_DEFUN([AC_TRY_KBUILD24], [
    ac_save_CPPFLAGS="$CPPFLAGS"
!   CPPFLAGS="-I$LINUX_KERNEL_PATH/include -D__KERNEL__ -Werror-implicit-function-declaration $CPPFLAGS"
!   AC_TRY_COMPILE([
! #include <linux/kernel.h>
! $1], [$2], [$3], [$4])
    CPPFLAGS="$ac_save_CPPFLAGS"])
  
  
***************
*** 65,67 ****
--- 71,86 ----
      [],:,AC_MSG_RESULT(no)
      AC_MSG_FAILURE([Fix problem or use --disable-kernel-module...]))
    AC_MSG_RESULT(yes)])
+ 
+ AC_DEFUN([LINUX_KBUILD_USES_EXTRA_CFLAGS], [
+   AC_MSG_CHECKING([if linux kbuild requires EXTRA_CFLAGS])
+   save_CPPFLAGS="$CPPFLAGS"
+   CPPFLAGS=-Wall
+   AC_TRY_KBUILD(
+ [#include <linux/sched.h>
+ #include <linux/fs.h>],
+     [],
+     ac_linux_kbuild_requires_extra_cflags=no,
+     ac_linux_kbuild_requires_extra_cflags=yes)
+     CPPFLAGS="$save_CPPFLAGS"
+     AC_MSG_RESULT($ac_linux_kbuild_requires_extra_cflags)])
Index: openafs/src/cf/linux-test4.m4
diff -c openafs/src/cf/linux-test4.m4:1.20.2.34 openafs/src/cf/linux-test4.m4:1.20.2.47
*** openafs/src/cf/linux-test4.m4:1.20.2.34	Mon Oct 15 08:42:29 2007
--- openafs/src/cf/linux-test4.m4	Sat Apr 19 17:56:08 2008
***************
*** 72,81 ****
    AC_MSG_CHECKING([for exported init_mm])
    AC_CACHE_VAL([ac_cv_linux_exports_init_mm], [
      AC_TRY_KBUILD(
! [#include <linux/modversions.h>],
! [#ifndef __ver_init_mm
! #error init_mm not exported
! #endif],
        ac_cv_linux_exports_init_mm=yes,
        ac_cv_linux_exports_init_mm=no)])
    AC_MSG_RESULT($ac_cv_linux_exports_init_mm)])
--- 72,80 ----
    AC_MSG_CHECKING([for exported init_mm])
    AC_CACHE_VAL([ac_cv_linux_exports_init_mm], [
      AC_TRY_KBUILD(
! [extern struct mm_struct init_mm;],
! [void *address = &init_mm;
! printk("%p\n", address);],
        ac_cv_linux_exports_init_mm=yes,
        ac_cv_linux_exports_init_mm=no)])
    AC_MSG_RESULT($ac_cv_linux_exports_init_mm)])
***************
*** 719,729 ****
--- 718,745 ----
        ac_cv_linux_statfs_takes_dentry=no)])
    AC_MSG_RESULT($ac_cv_linux_statfs_takes_dentry)])
  
+ 
+ AC_DEFUN([LINUX_KEY_TYPE_H_EXISTS], [
+   AC_MSG_CHECKING([for linux/key-type.h existance])
+   AC_CACHE_VAL([ac_cv_linux_key_type_h_exists], [
+     AC_TRY_KBUILD(
+ [#include <linux/key-type.h>],
+ [return;],
+       ac_cv_linux_key_type_h_exists=yes,
+       ac_cv_linux_key_type_h_exists=no)])
+   AC_MSG_RESULT($ac_cv_linux_key_type_h_exists)
+   if test "x$ac_cv_linux_key_type_h_exists" = "xyes"; then
+     AC_DEFINE([KEY_TYPE_H_EXISTS], 1, [define if linux/key-type.h exists])
+   fi])
+ 
  AC_DEFUN([LINUX_LINUX_KEYRING_SUPPORT], [
    AC_MSG_CHECKING([for linux kernel keyring support])
    AC_CACHE_VAL([ac_cv_linux_keyring_support], [
      AC_TRY_KBUILD(
  [#include <linux/rwsem.h>
+ #ifdef KEY_TYPE_H_EXISTS
+ #include <linux/key-type.h>
+ #endif
  #include <linux/key.h>
  #include <linux/keyctl.h>],
  [#ifdef CONFIG_KEYS
***************
*** 894,896 ****
--- 910,995 ----
        ac_cv_linux_fs_struct_fop_has_sendfile=no)])
    AC_MSG_RESULT($ac_cv_linux_fs_struct_fop_has_sendfile)])
  
+ AC_DEFUN([LINUX_FS_STRUCT_FOP_HAS_SPLICE], [
+   AC_MSG_CHECKING([for splice_write and splice_read in struct file_operations])
+   AC_CACHE_VAL([ac_cv_linux_fs_struct_fop_has_splice], [
+     AC_TRY_KBUILD(
+ [#include <linux/fs.h>],
+ [struct file_operations _fop;
+ _fop.splice_write(NULL, NULL, NULL, 0, 0);
+ _fop.splice_read(NULL, NULL, NULL, 0, 0);],
+       ac_cv_linux_fs_struct_fop_has_splice=yes,
+       ac_cv_linux_fs_struct_fop_has_splice=no)])
+   AC_MSG_RESULT($ac_cv_linux_fs_struct_fop_has_splice)])
+ 
+ AC_DEFUN([LINUX_HAVE_CURRENT_KERNEL_TIME], [
+   AC_MSG_CHECKING([for current_kernel_time()])
+   AC_CACHE_VAL([ac_cv_linux_have_current_kernel_time], [
+     AC_TRY_KBUILD(
+ [#include <linux/time.h>],
+ [struct timespec s = current_kernel_time();],
+       ac_cv_linux_have_current_kernel_time=yes,
+       ac_cv_linux_have_current_kernel_time=no)])
+   AC_MSG_RESULT($ac_cv_linux_have_current_kernel_time)])
+ 
+ AC_DEFUN([LINUX_KMEM_CACHE_INIT], [
+   AC_MSG_CHECKING([for new kmem_cache init function parameters])
+   AC_CACHE_VAL([ac_cv_linux_kmem_cache_init], [
+     AC_TRY_KBUILD(
+ [#include <linux/slab.h>],
+ [extern struct kmem_cache *kmem_cache_create(const char *, size_t, size_t,
+                         unsigned long,
+                         void (*)(struct kmem_cache *, void *));
+ return;],
+       ac_cv_linux_kmem_cache_init=yes,
+       ac_cv_linux_kmem_cache_init=no)])
+   AC_MSG_RESULT($ac_cv_linux_kmem_cache_init)])
+ 
+ AC_DEFUN([LINUX_SYSCTL_TABLE_CHECKING], [
+   AC_MSG_CHECKING([for sysctl table checking])
+   AC_CACHE_VAL([ac_cv_linux_sysctl_table_checking], [
+     AC_TRY_KBUILD(
+ [#include <linux/sysctl.h>],
+ [ extern int sysctl_check_table(int) __attribute__((weak));
+ sysctl_check_table(NULL);],
+  ac_cv_linux_sysctl_table_checking=no,
+  ac_cv_linux_sysctl_table_checking=yes)])
+ AC_MSG_RESULT($ac_cv_linux_sysctl_table_checking)])
+ 
+ AC_DEFUN([LINUX_HAVE_IGET], [
+   AC_MSG_CHECKING([for linux iget()])
+   AC_CACHE_VAL([ac_cv_linux_have_iget], [
+     save_CPPFLAGS="$CPPFLAGS"
+     CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
+     AC_TRY_KBUILD(
+ [#include <linux/fs.h>],
+ [iget(NULL, NULL);],
+       ac_cv_linux_have_iget=yes,
+       ac_cv_linux_have_iget=no)
+     CPPFLAGS="$save_CPPFLAGS"])
+   AC_MSG_RESULT($ac_cv_linux_have_iget)])
+ 
+ AC_DEFUN([LINUX_FS_STRUCT_NAMEIDATA_HAS_PATH], [
+   AC_MSG_CHECKING([for path in struct nameidata])
+   AC_CACHE_VAL([ac_cv_linux_struct_nameidata_has_path], [
+     AC_TRY_KBUILD(
+ [#include <linux/namei.h>],
+ [struct nameidata _nd;
+ printk("%x\n", _nd.path);],
+       ac_cv_linux_struct_nameidata_has_path=yes,
+       ac_cv_linux_struct_nameidata_has_path=no)])
+   AC_MSG_RESULT($ac_cv_linux_struct_nameidata_has_path)])
+ 
+ AC_DEFUN([LINUX_EXPORTS_RCU_READ_LOCK], [
+   AC_MSG_CHECKING([if rcu_read_lock is usable])
+   AC_CACHE_VAL([ac_cv_linux_exports_rcu_read_lock], [
+     AC_TRY_KBUILD(
+ [#include <linux/rcupdate.h>],
+ [rcu_read_lock();],
+       ac_cv_linux_exports_rcu_read_lock=yes,
+       ac_cv_linux_exports_rcu_read_lock=no)])
+   AC_MSG_RESULT($ac_cv_linux_exports_rcu_read_lock)
+   if test "x$ac_cv_linux_exports_rcu_read_lock" = "xyes"; then
+     AC_DEFINE([EXPORTED_RCU_READ_LOCK], 1, [define if rcu_read_lock() is usable])
+   fi])
+  
Index: openafs/src/cf/osconf.m4
diff -c openafs/src/cf/osconf.m4:1.51.2.30 openafs/src/cf/osconf.m4:1.51.2.36
*** openafs/src/cf/osconf.m4:1.51.2.30	Wed Oct 10 13:47:59 2007
--- openafs/src/cf/osconf.m4	Thu Feb 28 09:28:52 2008
***************
*** 18,23 ****
--- 18,25 ----
  OPTMZ=-O
  LWP_DBG=-g
  LWP_OPTMZ=-O
+ NO_STRIP_BIN=-ns
+ NO_STRIP_KRB=-ns
  
  dnl standard programs
  AC_PROG_RANLIB
***************
*** 111,116 ****
--- 113,150 ----
  		SHLIB_LINKER="${MT_CC} -shared"
  		;;
  
+ 	arm_linux24)
+ 		CCOBJ="${CC} -fPIC"
+ 		KERN_OPTMZ=-O2
+ 		LEX="flex -l"
+ 		MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
+ 		MT_LIBS="-lpthread"
+ 		PAM_OPTMZ=-O2
+ 		PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
+ 		SHLIB_CFLAGS="-fPIC"
+ 		SHLIB_LDFLAGS="-shared -Xlinker -x"
+ 		TXLIBS="-lncurses"
+ 		XCFLAGS="-D_LARGEFILE64_SOURCE"
+ 		YACC="bison -y"
+ 		SHLIB_LINKER="${MT_CC} -shared"
+ 		;;
+ 
+ 	arm_linux26)
+ 		CCOBJ="${CC} -fPIC"
+ 		KERN_OPTMZ=-O2
+ 		LEX="flex -l"
+ 		MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
+ 		MT_LIBS="-lpthread"
+ 		PAM_OPTMZ=-O2
+ 		PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
+ 		SHLIB_CFLAGS="-fPIC"
+ 		SHLIB_LDFLAGS="-shared -Xlinker -x"
+ 		TXLIBS="-lncurses"
+ 		XCFLAGS="-D_LARGEFILE64_SOURCE"
+ 		YACC="bison -y"
+ 		SHLIB_LINKER="${MT_CC} -shared"
+ 		;;
+ 
  	hp_ux102)
  		AS="/usr/ccs/bin/as"
  		CC="/opt/ansic/bin/cc -Ae"
***************
*** 244,249 ****
--- 278,284 ----
  		MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
  		MT_LIBS="-lpthread"
  		PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC"
+ 		SHLIB_CFLAGS="-fPIC"
  		SHLIB_LDFLAGS="-shared -Xlinker -x"
  		TXLIBS="-lncurses"
  		XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE -G0"
***************
*** 270,275 ****
--- 305,311 ----
  		MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
  		MT_LIBS="-lpthread"
  		PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC"
+ 		SHLIB_CFLAGS="-fPIC"
  		SHLIB_LDFLAGS="-shared -Xlinker -x"
  		TXLIBS="/usr/lib64/libncurses.so"
  		XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE"
***************
*** 299,304 ****
--- 335,341 ----
  		MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
  		MT_LIBS="-lpthread"
  		PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC"
+ 		SHLIB_CFLAGS="-fPIC"
  		SHLIB_LDFLAGS="-shared -Xlinker -x"
  		TXLIBS="-lncurses"
  		XCFLAGS="-O2 -D_LARGEFILE64_SOURCE"
***************
*** 320,325 ****
--- 357,363 ----
  		LWP_OPTMZ=-O2
  		OPTMZ=-O2
  		PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC"
+ 		SHLIB_CFLAGS="-fPIC"
  		SHLIB_LDFLAGS="-shared -Xlinker -x"
  		TXLIBS="-lncurses"
  		XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE"
***************
*** 340,345 ****
--- 378,384 ----
  		LWP_OPTMZ=-O2
  		OPTMZ=-O2
  		PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC"
+ 		SHLIB_CFLAGS="-fPIC"
  		SHLIB_LDFLAGS="-shared -Xlinker -x"
  		TXLIBS="-lncurses"
  		XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE"
***************
*** 360,365 ****
--- 399,405 ----
  		LWP_OPTMZ=-O2
  		OPTMZ=-O2
  		PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC"
+ 		SHLIB_CFLAGS="-fPIC"
  		SHLIB_LDFLAGS="-shared -Xlinker -x"
  		TXLIBS="-lncurses"
  		XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE"
***************
*** 367,372 ****
--- 407,414 ----
  		;;
  
  	*_obsd*)
+ 		KRB5CFLAGS="-I/usr/include/kerberosV"
+ 		KRB5LIBS="-lkrb5 -lcrypto"
  		LEX="flex -l"
  		MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
  		MT_LIBS="-pthread"
***************
*** 385,390 ****
--- 427,433 ----
  		MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
  		MT_LIBS="-lpthread"
  		PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC"
+ 		SHLIB_CFLAGS="-fPIC"
  		SHLIB_LDFLAGS="-shared -Xlinker -x"
  		TXLIBS="-lncurses"
  		XCFLAGS="-O2 -D_LARGEFILE64_SOURCE"
***************
*** 488,493 ****
--- 531,537 ----
  		MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
  		MT_LIBS="-lpthread"
  		PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC"
+ 		SHLIB_CFLAGS="-fPIC"
  		SHLIB_LDFLAGS="-shared -Xlinker -x"
  		TXLIBS="-lncurses"
  		XCFLAGS="-O2 -D_LARGEFILE64_SOURCE"
***************
*** 566,571 ****
--- 610,616 ----
  		MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
  		MT_LIBS="-lpthread"
  		PAM_CFLAGS="-O -Dlinux -DLINUX_PAM -fPIC"
+ 		SHLIB_CFLAGS="-fPIC"
  		SHLIB_LDFLAGS="-shared -Xlinker -x"
  		TXLIBS="-lncurses"
  		XCFLAGS="-O -g -D_LARGEFILE64_SOURCE"
***************
*** 583,588 ****
--- 628,634 ----
  		MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
  		MT_LIBS="-lpthread"
  		PAM_CFLAGS="-O -Dlinux -DLINUX_PAM -fPIC"
+ 		SHLIB_CFLAGS="-fPIC"
  		SHLIB_LDFLAGS="-shared -Xlinker -x"
  		TXLIBS="-lncurses"
  		XCFLAGS="-O -g -D_LARGEFILE64_SOURCE"
***************
*** 600,605 ****
--- 646,652 ----
  		MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
  		MT_LIBS="-lpthread"
  		PAM_CFLAGS="-O -Dlinux -DLINUX_PAM -fPIC"
+ 		SHLIB_CFLAGS="-fPIC"
  		SHLIB_LDFLAGS="-shared -Xlinker -x -Xlinker -Bsymbolic"
  		TXLIBS="-lncurses"
  		XCFLAGS="-O -g -D_LARGEFILE64_SOURCE -D__s390x__"
***************
*** 675,680 ****
--- 722,728 ----
  		MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
  		MT_LIBS="-lpthread"
  		PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC"
+ 		SHLIB_CFLAGS="-fPIC"
  		SHLIB_LDFLAGS="-shared -Xlinker -x"
  		TXLIBS="-lncurses"
  		XCFLAGS="-O2 -D_LARGEFILE64_SOURCE"
***************
*** 690,695 ****
--- 738,744 ----
  		MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
  		MT_LIBS="-lpthread"
  		PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC"
+ 		SHLIB_CFLAGS="-fPIC"
  		SHLIB_LDFLAGS="-shared -Xlinker -x"
  		TXLIBS="-lncurses"
  		XCFLAGS="-O2 -D_LARGEFILE64_SOURCE"
***************
*** 851,857 ****
  		SHLIB_CFLAGS="-KPIC"
  		SHLIB_LDFLAGS="-G -Bsymbolic"
  		TXLIBS="-lcurses"
! 		XCFLAGS64='${XCFLAGS} -xarch=v9'
  		XCFLAGS="-dy -Bdynamic"
  		XLIBELFA="-lelf"
  		XLIBKVM="-lkvm"
--- 900,906 ----
  		SHLIB_CFLAGS="-KPIC"
  		SHLIB_LDFLAGS="-G -Bsymbolic"
  		TXLIBS="-lcurses"
! 		XCFLAGS64='${XCFLAGS} -m64'
  		XCFLAGS="-dy -Bdynamic"
  		XLIBELFA="-lelf"
  		XLIBKVM="-lkvm"
***************
*** 957,963 ****
  		SHLIB_CFLAGS="-KPIC"
  		SHLIB_LDFLAGS="-G -Bsymbolic"
  		TXLIBS="-lcurses"
! 		XCFLAGS64='${XCFLAGS} -xarch=amd64'
  		XCFLAGS="-dy -Bdynamic"
  		XLIBELFA="-lelf"
  		XLIBKVM="-lkvm"
--- 1006,1012 ----
  		SHLIB_CFLAGS="-KPIC"
  		SHLIB_LDFLAGS="-G -Bsymbolic"
  		TXLIBS="-lcurses"
! 		XCFLAGS64='${XCFLAGS} -m64'
  		XCFLAGS="-dy -Bdynamic"
  		XLIBELFA="-lelf"
  		XLIBKVM="-lkvm"
***************
*** 1013,1018 ****
--- 1062,1069 ----
  
  if test "x$enable_debug" = "xno"; then
    DBG=
+   NO_STRIP_BIN=
+   NO_STRIP_KRB=-s
  fi
  
  if test "x$enable_optimize" = "xno"; then
***************
*** 1027,1032 ****
--- 1078,1102 ----
    LWP_OPTMZ=
  fi
  
+ if test "x$enable_strip_binaries" != "xno"; then
+   if test "x$enable_strip_binaries" = "xmaybe" -a "x$enable_debug" = "xyes"; then
+     NO_STRIP_BIN=-ns
+     NO_STRIP_KRB=-ns
+   else
+     NO_STRIP_BIN=
+     NO_STRIP_KRB=-s
+   fi
+ else
+   NO_STRIP_BIN=-ns
+   NO_STRIP_KRB=-ns
+ fi
+ 
+ if test "x$enable_warnings" = "xyes"; then
+   if test "x$GCC" = "xyes"; then
+     XCFLAGS="${XCFLAGS} -Wall -Wstrict-prototypes -Wold-style-definition"
+   fi
+ fi
+ 
  AC_SUBST(CCXPG2)
  AC_SUBST(CCOBJ)
  AC_SUBST(AFSD_LIBS)
***************
*** 1047,1052 ****
--- 1117,1124 ----
  AC_SUBST(MT_CFLAGS)
  AC_SUBST(MT_LIBS)
  AC_SUBST(MV)
+ AC_SUBST(NO_STRIP_BIN)
+ AC_SUBST(NO_STRIP_KRB)
  AC_SUBST(OPTMZ)
  AC_SUBST(PAM_CFLAGS)
  AC_SUBST(PAM_LIBS)
Index: openafs/src/cmd/cmd.c
diff -c openafs/src/cmd/cmd.c:1.11.2.1 openafs/src/cmd/cmd.c:1.11.2.3
*** openafs/src/cmd/cmd.c:1.11.2.1	Fri Jun 30 15:45:48 2006
--- openafs/src/cmd/cmd.c	Sun Jan 13 10:33:53 2008
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/cmd/cmd.c,v 1.11.2.1 2006/06/30 19:45:48 shadow Exp $");
  
  #include <sys/types.h>
  #include <ctype.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/cmd/cmd.c,v 1.11.2.3 2008/01/13 15:33:53 jaltman Exp $");
  
  #include <sys/types.h>
  #include <ctype.h>
***************
*** 30,38 ****
  static int dummy;		/* non-null ptr used for flag existence */
  static struct cmd_syndesc *allSyntax = 0;
  static int noOpcodes = 0;
! static int (*beforeProc) (struct cmd_syndesc * ts, char *beforeRock) =
!     0, (*afterProc) (struct cmd_syndesc * ts, char *afterRock) = 0;
! static char *beforeRock, *afterRock;
  static char initcmd_opcode[] = "initcmd";	/*Name of initcmd opcode */
  
  /* take name and string, and return null string if name is empty, otherwise return
--- 30,38 ----
  static int dummy;		/* non-null ptr used for flag existence */
  static struct cmd_syndesc *allSyntax = 0;
  static int noOpcodes = 0;
! static int (*beforeProc) (struct cmd_syndesc * ts, void *beforeRock) = NULL;
! static int (*afterProc) (struct cmd_syndesc * ts, void *afterRock) = NULL;
! static void *beforeRock, *afterRock;
  static char initcmd_opcode[] = "initcmd";	/*Name of initcmd opcode */
  
  /* take name and string, and return null string if name is empty, otherwise return
***************
*** 40,52 ****
  static char *
  NName(char *a1, char *a2)
  {
!     static char tbuffer[80];
      if (strlen(a1) == 0) {
! 	return "";
      } else {
! 	strcpy(tbuffer, a1);
! 	strcat(tbuffer, a2);
! 	return tbuffer;
      }
  }
  
--- 40,53 ----
  static char *
  NName(char *a1, char *a2)
  {
!     static char tbuffer[300];
      if (strlen(a1) == 0) {
!         return "";
      } else {
!         strncpy(tbuffer, a1, sizeof(tbuffer));
!         strncat(tbuffer, a2, sizeof(tbuffer));
!         tbuffer[sizeof(tbuffer)-1]='\0';
!         return tbuffer;
      }
  }
  
***************
*** 168,174 ****
  extern char *AFSVersion;
  
  static int
! VersionProc(register struct cmd_syndesc *as, char *arock)
  {
      printf("%s\n", AFSVersion);
      return 0;
--- 169,175 ----
  extern char *AFSVersion;
  
  static int
! VersionProc(register struct cmd_syndesc *as, void *arock)
  {
      printf("%s\n", AFSVersion);
      return 0;
***************
*** 272,278 ****
  }
  
  static int
! AproposProc(register struct cmd_syndesc *as, char *arock)
  {
      register struct cmd_syndesc *ts;
      char *tsub;
--- 273,279 ----
  }
  
  static int
! AproposProc(register struct cmd_syndesc *as, void *arock)
  {
      register struct cmd_syndesc *ts;
      char *tsub;
***************
*** 297,303 ****
  }
  
  static int
! HelpProc(register struct cmd_syndesc *as, char *arock)
  {
      register struct cmd_syndesc *ts;
      register struct cmd_item *ti;
--- 298,304 ----
  }
  
  static int
! HelpProc(register struct cmd_syndesc *as, void *arock)
  {
      register struct cmd_syndesc *ts;
      register struct cmd_item *ti;
***************
*** 344,351 ****
  }
  
  int
! cmd_SetBeforeProc(int (*aproc) (struct cmd_syndesc * ts, char *beforeRock),
! 		  char *arock)
  {
      beforeProc = aproc;
      beforeRock = arock;
--- 345,352 ----
  }
  
  int
! cmd_SetBeforeProc(int (*aproc) (struct cmd_syndesc * ts, void *beforeRock),
! 		  void *arock)
  {
      beforeProc = aproc;
      beforeRock = arock;
***************
*** 353,360 ****
  }
  
  int
! cmd_SetAfterProc(int (*aproc) (struct cmd_syndesc * ts, char *afterRock),
! 		 char *arock)
  {
      afterProc = aproc;
      afterRock = arock;
--- 354,361 ----
  }
  
  int
! cmd_SetAfterProc(int (*aproc) (struct cmd_syndesc * ts, void *afterRock),
! 		 void *arock)
  {
      afterProc = aproc;
      afterRock = arock;
***************
*** 380,387 ****
  
  struct cmd_syndesc *
  cmd_CreateSyntax(char *aname,
! 		 int (*aproc) (struct cmd_syndesc * ts, char *arock),
! 		 char *arock, char *ahelp)
  {
      register struct cmd_syndesc *td;
  
--- 381,388 ----
  
  struct cmd_syndesc *
  cmd_CreateSyntax(char *aname,
! 		 int (*aproc) (struct cmd_syndesc * ts, void *arock),
! 		 void *arock, char *ahelp)
  {
      register struct cmd_syndesc *td;
  
***************
*** 481,487 ****
      strcpy(tp->name, aname);
      tp->type = atype;
      tp->flags = aflags;
!     tp->items = (struct cmd_item *)0;
      if (ahelp) {
  	tp->help = (char *)malloc(strlen(ahelp) + 1);
  	assert(tp->help);
--- 482,488 ----
      strcpy(tp->name, aname);
      tp->type = atype;
      tp->flags = aflags;
!     tp->items = NULL;
      if (ahelp) {
  	tp->help = (char *)malloc(strlen(ahelp) + 1);
  	assert(tp->help);
***************
*** 556,562 ****
  	default:
  	    break;
  	}
! 	tp->items = (struct cmd_item *)0;
      }
  }
  
--- 557,563 ----
  	default:
  	    break;
  	}
! 	tp->items = NULL;
      }
  }
  
Index: openafs/src/cmd/cmd.p.h
diff -c openafs/src/cmd/cmd.p.h:1.7 openafs/src/cmd/cmd.p.h:1.7.2.1
*** openafs/src/cmd/cmd.p.h:1.7	Tue Jul 15 19:14:50 2003
--- openafs/src/cmd/cmd.p.h	Wed Oct 31 00:13:37 2007
***************
*** 51,58 ****
      char *name;			/* subcommand name */
      char *a0name;		/* command name from argv[0] */
      char *help;			/* help description */
!     int (*proc) (struct cmd_syndesc * ts, char *arock);
!     char *rock;
      int nParms;			/* number of parms */
      afs_int32 flags;		/* random flags */
      struct cmd_parmdesc parms[CMD_MAXPARMS];	/* parms themselves */
--- 51,58 ----
      char *name;			/* subcommand name */
      char *a0name;		/* command name from argv[0] */
      char *help;			/* help description */
!     int (*proc) (struct cmd_syndesc * ts, void *arock);
!     void *rock;
      int nParms;			/* number of parms */
      afs_int32 flags;		/* random flags */
      struct cmd_parmdesc parms[CMD_MAXPARMS];	/* parms themselves */
***************
*** 60,73 ****
  
  extern struct cmd_syndesc *cmd_CreateSyntax(char *namep,
  					    int (*aprocp) (struct cmd_syndesc
! 							   * ts, char *arock),
! 					    char *rockp, char *helpp);
  extern int
!   cmd_SetBeforeProc(int (*aproc) (struct cmd_syndesc * ts, char *beforeRock),
! 		    char *arock);
  extern int
!   cmd_SetAfterProc(int (*aproc) (struct cmd_syndesc * ts, char *afterRock),
! 		   char *arock);
  extern int cmd_CreateAlias(struct cmd_syndesc *as, char *aname);
  extern int cmd_Seek(struct cmd_syndesc *as, int apos);
  extern int cmd_AddParm(struct cmd_syndesc *as, char *aname, int atype,
--- 60,73 ----
  
  extern struct cmd_syndesc *cmd_CreateSyntax(char *namep,
  					    int (*aprocp) (struct cmd_syndesc
! 							   * ts, void *arock),
! 					    void *rockp, char *helpp);
  extern int
!   cmd_SetBeforeProc(int (*aproc) (struct cmd_syndesc * ts, void *beforeRock),
! 		    void *arock);
  extern int
!   cmd_SetAfterProc(int (*aproc) (struct cmd_syndesc * ts, void *afterRock),
! 		   void *arock);
  extern int cmd_CreateAlias(struct cmd_syndesc *as, char *aname);
  extern int cmd_Seek(struct cmd_syndesc *as, int apos);
  extern int cmd_AddParm(struct cmd_syndesc *as, char *aname, int atype,
Index: openafs/src/cmd/test/ctest.c
diff -c openafs/src/cmd/test/ctest.c:1.6 openafs/src/cmd/test/ctest.c:1.6.2.1
*** openafs/src/cmd/test/ctest.c:1.6	Tue Jul 15 19:14:52 2003
--- openafs/src/cmd/test/ctest.c	Wed Oct 31 00:13:38 2007
***************
*** 11,34 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/cmd/test/ctest.c,v 1.6 2003/07/15 23:14:52 shadow Exp $");
  
  #include "cmd.h"
  #include <stdio.h>
  
! static
! cproc1(as, arock)
!      char *arock;
!      struct cmd_syndesc *as;
  {
      printf("in the apple command\n");
      return 0;
  }
  
! static
! cproc2(as, arock)
!      char *arock;
!      struct cmd_syndesc *as;
  {
      register struct cmd_item *ti;
      printf("in the pear command\n");
--- 11,30 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/cmd/test/ctest.c,v 1.6.2.1 2007/10/31 04:13:38 shadow Exp $");
  
  #include "cmd.h"
  #include <stdio.h>
  
! static int
! cproc1(struct cmd_syndesc *as, void *arock)
  {
      printf("in the apple command\n");
      return 0;
  }
  
! static int
! cproc2(struct cmd_syndesc *as, void *arock)
  {
      register struct cmd_item *ti;
      printf("in the pear command\n");
***************
*** 43,51 ****
      return 0;
  }
  
! main(argc, argv)
!      int argc;
!      char **argv;
  {
      register struct cmd_syndesc *ts;
  
--- 39,46 ----
      return 0;
  }
  
! int
! main(int argc, char **argv)
  {
      register struct cmd_syndesc *ts;
  
Index: openafs/src/cmd/test/dtest.c
diff -c openafs/src/cmd/test/dtest.c:1.6 openafs/src/cmd/test/dtest.c:1.6.2.1
*** openafs/src/cmd/test/dtest.c:1.6	Tue Jul 15 19:14:52 2003
--- openafs/src/cmd/test/dtest.c	Wed Oct 31 00:13:38 2007
***************
*** 11,25 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/cmd/test/dtest.c,v 1.6 2003/07/15 23:14:52 shadow Exp $");
  
  #include "cmd.h"
  #include <stdio.h>
  
! static
! cproc(as, arock)
!      char *arock;
!      struct cmd_syndesc *as;
  {
      register struct cmd_item *ti;
      printf("in the pear command\n");
--- 11,23 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/cmd/test/dtest.c,v 1.6.2.1 2007/10/31 04:13:38 shadow Exp $");
  
  #include "cmd.h"
  #include <stdio.h>
  
! static int
! cproc(struct cmd_syndesc *as, void *arock)
  {
      register struct cmd_item *ti;
      printf("in the pear command\n");
***************
*** 32,40 ****
      return 0;
  }
  
! main(argc, argv)
!      int argc;
!      char **argv;
  {
      register struct cmd_syndesc *ts;
  
--- 30,37 ----
      return 0;
  }
  
! int
! main(int argc, char **argv)
  {
      register struct cmd_syndesc *ts;
  
Index: openafs/src/cmd/test/itest.c
diff -c openafs/src/cmd/test/itest.c:1.7.2.1 openafs/src/cmd/test/itest.c:1.7.2.2
*** openafs/src/cmd/test/itest.c:1.7.2.1	Tue Apr 10 14:43:42 2007
--- openafs/src/cmd/test/itest.c	Wed Oct 31 00:13:38 2007
***************
*** 11,35 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/cmd/test/itest.c,v 1.7.2.1 2007/04/10 18:43:42 shadow Exp $");
  
  #include "cmd.h"
  #include <stdio.h>
  #include <com_err.h>
  
! static
! cproc1(as, arock)
!      char *arock;
!      struct cmd_syndesc *as;
  {
      printf("in the apple command\n");
      return 0;
  }
  
! static
! cproc2(as, arock)
!      char *arock;
!      struct cmd_syndesc *as;
  {
      register struct cmd_item *ti;
      printf("in the pear command\n");
--- 11,31 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/cmd/test/itest.c,v 1.7.2.2 2007/10/31 04:13:38 shadow Exp $");
  
  #include "cmd.h"
  #include <stdio.h>
  #include <com_err.h>
  
! static int
! cproc1(struct cmd_syndesc *as, void *arock)
  {
      printf("in the apple command\n");
      return 0;
  }
  
! static int
! cproc2(struct cmd_syndesc *as, void *arock)
  {
      register struct cmd_item *ti;
      printf("in the pear command\n");
***************
*** 44,60 ****
      return 0;
  }
  
! static void
! cproc3(as, arock)
!      char *arock;
!      struct cmd_syndesc *as;
  {
      exit(0);
  }
  
! main(argc, argv)
!      int argc;
!      char **argv;
  {
      register struct cmd_syndesc *ts;
      char tline[1000];
--- 40,53 ----
      return 0;
  }
  
! static int
! cproc3(struct cmd_syndesc *as, void *arock)
  {
      exit(0);
  }
  
! int
! main(int argc, char **argv)
  {
      register struct cmd_syndesc *ts;
      char tline[1000];
Index: openafs/src/config/.cvsignore
diff -c openafs/src/config/.cvsignore:1.5 openafs/src/config/.cvsignore:1.5.2.1
*** openafs/src/config/.cvsignore:1.5	Thu Jun 19 12:28:58 2003
--- openafs/src/config/.cvsignore	Fri Jan 11 17:43:40 2008
***************
*** 1,18 ****
  AFS_component_version_number.c
  Makefile
  Makefile.*_*[0123456789]
  Makefile.version
  Makefile.version-NOCML
  afsconfig.h
  afsconfig.h.in
  config
  mkvers
- Makefile.hp_ux102
- Makefile.hp_ux110
- Makefile.i386_linux22
- Makefile.i386_linux24
- Makefile.sun4x_56
- Makefile.sun4x_57
  param.h.new
  Makefile.config
  stamp-h1
--- 1,13 ----
  AFS_component_version_number.c
  Makefile
  Makefile.*_*[0123456789]
+ Makefile.*_*[0123456789].in
  Makefile.version
  Makefile.version-NOCML
  afsconfig.h
  afsconfig.h.in
  config
  mkvers
  param.h.new
  Makefile.config
  stamp-h1
Index: openafs/src/config/Makefile.config.in
diff -c openafs/src/config/Makefile.config.in:1.10.2.1 openafs/src/config/Makefile.config.in:1.10.2.3
*** openafs/src/config/Makefile.config.in:1.10.2.1	Thu Mar  9 01:41:42 2006
--- openafs/src/config/Makefile.config.in	Tue Jan  8 13:57:27 2008
***************
*** 32,37 ****
--- 32,38 ----
  AFSD_LIBS = @AFSD_LIBS@
  AFSD_LDFLAGS = @AFSD_LDFLAGS@
  CC = @CC@
+ CPP = @CPP@
  CCOBJ = @CCOBJ@
  CCXPG2 = @CCXPG2@
  CFLAGS = @CFLAGS@
***************
*** 57,62 ****
--- 58,65 ----
  MT_CFLAGS = @MT_CFLAGS@
  MT_LIBS = @MT_LIBS@
  MV = @MV@
+ NO_STRIP_BIN = @NO_STRIP_BIN@
+ NO_STRIP_KRB = @NO_STRIP_KRB@
  OPTMZ = @OPTMZ@
  PAM_CFLAGS = @PAM_CFLAGS@
  PAM_LIBS = @PAM_LIBS@
***************
*** 113,119 ****
  # Build helper apps
  #
  COMPILE_ET = ${TOP_OBJDIR}/src/comerr/compile_et
! INSTALL = ${TOP_OBJDIR}/src/pinstall/pinstall
  INSTALLex = ${INSTALL} -m 755
  RXGEN = ${TOP_OBJDIR}/src/rxgen/rxgen
  SHELL = /bin/sh
--- 116,122 ----
  # Build helper apps
  #
  COMPILE_ET = ${TOP_OBJDIR}/src/comerr/compile_et
! INSTALL = ${TOP_OBJDIR}/src/pinstall/pinstall ${NO_STRIP_BIN}
  INSTALLex = ${INSTALL} -m 755
  RXGEN = ${TOP_OBJDIR}/src/rxgen/rxgen
  SHELL = /bin/sh
Index: openafs/src/config/afs_args.h
diff -c openafs/src/config/afs_args.h:1.13.2.8 openafs/src/config/afs_args.h:1.13.2.9
*** openafs/src/config/afs_args.h:1.13.2.8	Wed Oct 10 12:57:57 2007
--- openafs/src/config/afs_args.h	Wed Jan 30 16:37:35 2008
***************
*** 122,127 ****
--- 122,128 ----
  /* #define AFSOP_STOP_COMPLETE     215  defined in osi.h	      */
  /* #define AFSOP_STOP_RXK_LISTENER   217     defined in osi.h	      */
  #define AFSOP_STOP_AFSDB	218	/* Stop AFSDB handler */
+ #define AFSOP_STOP_NETIF        219     /* Stop Netif poller */
  
  /* Main afs syscall entry; this number may vary per system (i.e. defined in afs/param.h) */
  #ifndef	AFS_SYSCALL
Index: openafs/src/config/afs_sysnames.h
diff -c openafs/src/config/afs_sysnames.h:1.50.2.28 openafs/src/config/afs_sysnames.h:1.50.2.29
*** openafs/src/config/afs_sysnames.h:1.50.2.28	Mon Oct 15 11:25:44 2007
--- openafs/src/config/afs_sysnames.h	Tue Jan 15 00:14:02 2008
***************
*** 263,268 ****
--- 263,273 ----
  
  #define SYS_NAME_ID_i64_w2k             3500
  
+ #define SYS_NAME_ID_arm_linux2          3800
+ #define SYS_NAME_ID_arm_linux22         3801
+ #define SYS_NAME_ID_arm_linux24         3802
+ #define SYS_NAME_ID_arm_linux26         3803
+ 
  /*
   * Placeholder to keep system-wide standard flags since this file is included by all 
   * files (i.e in afs/param.h)
Index: openafs/src/config/mc.c
diff -c openafs/src/config/mc.c:1.5 openafs/src/config/mc.c:1.5.2.1
*** openafs/src/config/mc.c:1.5	Tue Jul 15 19:14:55 2003
--- openafs/src/config/mc.c	Tue Oct 30 11:23:52 2007
***************
*** 16,24 ****
  #include <stdlib.h>
  
  #include <afsconfig.h>
- #ifdef HAVE_STRING_H
  #include <string.h>
- #endif
  
  #define TOK_DONTUSE 1		/* Don't copy if match and this flag is set. */
  struct token {
--- 16,22 ----
Index: openafs/src/config/param.amd64_nbsd30.h
diff -c /dev/null openafs/src/config/param.amd64_nbsd30.h:1.1.4.2
*** /dev/null	Mon Apr 28 17:55:43 2008
--- openafs/src/config/param.amd64_nbsd30.h	Sat Dec  1 00:44:29 2007
***************
*** 0 ****
--- 1,21 ----
+ #ifndef AFS_AMD64_PARAM_H
+ #define AFS_AMD64_PARAM_H
+ 
+ #define AFS_X86_XBSD_ENV 1
+ #define AFS_X86_ENV 1
+ #define AFSLITTLE_ENDIAN 1
+ 
+ #define SYS_NAME       "amd64_nbsd30"
+ #define SYS_NAME_ID    SYS_NAME_ID_amd64_nbsd30
+ 
+ #define AFS_64BITPOINTER_ENV  1
+ #ifndef UKERNEL
+ /* This section for kernel libafs compiles only */
+ 
+ #else /* !defined(UKERNEL) */
+ 
+ /* This section for user space compiles only */
+ 
+ #endif /* !defined(UKERNEL) */
+ 
+ #endif /* AFS_AMD64_PARAM_H */
Index: openafs/src/config/param.amd64_nbsd40.h
diff -c /dev/null openafs/src/config/param.amd64_nbsd40.h:1.1.4.2
*** /dev/null	Mon Apr 28 17:55:43 2008
--- openafs/src/config/param.amd64_nbsd40.h	Sat Dec  1 00:44:29 2007
***************
*** 0 ****
--- 1,21 ----
+ #ifndef AFS_AMD64_PARAM_H
+ #define AFS_AMD64_PARAM_H
+ 
+ #define AFS_X86_XBSD_ENV 1
+ #define AFS_X86_ENV 1
+ #define AFSLITTLE_ENDIAN 1
+ 
+ #define SYS_NAME       "amd64_nbsd40"
+ #define SYS_NAME_ID    SYS_NAME_ID_amd64_nbsd40
+ 
+ #define AFS_64BITPOINTER_ENV  1
+ #ifndef UKERNEL
+ /* This section for kernel libafs compiles only */
+ 
+ #else /* !defined(UKERNEL) */
+ 
+ /* This section for user space compiles only */
+ 
+ #endif /* !defined(UKERNEL) */
+ 
+ #endif /* AFS_AMD64_PARAM_H */
Index: openafs/src/config/param.arm_linux24.h
diff -c /dev/null openafs/src/config/param.arm_linux24.h:1.1.4.2
*** /dev/null	Mon Apr 28 17:55:43 2008
--- openafs/src/config/param.arm_linux24.h	Tue Jan 15 00:14:02 2008
***************
*** 0 ****
--- 1,146 ----
+ #ifndef UKERNEL
+ /* This section for kernel libafs compiles only */
+ 
+ #ifndef AFS_PARAM_H
+ #define AFS_PARAM_H
+ 
+ /* In user space the AFS_LINUX20_ENV should be sufficient. In the kernel,
+  * it's a judgment call. If something is obviously arm specific, use that
+  * #define instead. Note that "20" refers to the linux 2.0 kernel. The "2"
+  * in the sysname is the current version of the client. This takes into
+  * account the perferred OS user space configuration as well as the kernel.
+  */
+ 
+ #define AFS_LINUX20_ENV        1
+ #define AFS_LINUX22_ENV        1
+ #define AFS_LINUX24_ENV        1
+ #define AFS_ARM_LINUX20_ENV   1
+ #define AFS_ARM_LINUX22_ENV   1
+ #define AFS_ARM_LINUX24_ENV   1
+ #define AFS_NONFSTRANS 1
+ 
+ #define AFS_MOUNT_AFS "afs"	/* The name of the filesystem type. */
+ #define AFS_SYSCALL 137
+ #define AFS_64BIT_IOPS_ENV  1
+ #define AFS_NAMEI_ENV     1	/* User space interface to file system */
+ #define AFS_64BIT_ENV		1
+ #define AFS_64BIT_CLIENT	1
+ 
+ #if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
+ 
+ #ifdef CONFIG_SMP
+ #undef CONFIG_SMP
+ #endif
+ /* Using "AFS_SMP" to map to however many #define's are required to get
+  * MP to compile for Linux
+  */
+ #ifdef AFS_SMP
+ #define CONFIG_SMP 1
+ #ifndef __SMP__
+ #define __SMP__
+ #endif
+ #endif
+ #define AFS_GLOBAL_SUNLOCK
+ 
+ #if defined(MODULE) && defined(CONFIG_MODVERSIONS)
+ #define MODVERSIONS
+ #include <linux/modversions.h>
+ #endif
+ 
+ #endif /* __KERNEL__  && !DUMP_KERNEL */
+ 
+ #include <afs/afs_sysnames.h>
+ #define AFS_USERSPACE_IP_ADDR 1
+ #define RXK_LISTENER_ENV 1
+ #define AFS_GCPAGS       1
+ 
+ #define AFSLITTLE_ENDIAN    1
+ #define AFS_HAVE_FFS        1	/* Use system's ffs. */
+ #define AFS_HAVE_STATVFS    0	/* System doesn't support statvfs */
+ #define AFS_VM_RDWR_ENV            1	/* read/write implemented via VM */
+ #define AFS_USE_GETTIMEOFDAY       1	/* use gettimeofday to implement rx clock */
+ 
+ #ifdef KERNEL
+ #ifndef MIN
+ #define MIN(A,B) ((A) < (B) ? (A) : (B))
+ #endif
+ #ifndef MAX
+ #define MAX(A,B) ((A) > (B) ? (A) : (B))
+ #endif
+ #endif /* KERNEL */
+ 
+ #ifndef KERNEL
+ #define __USE_LARGEFILE64 1
+ #if !defined off64_t
+ #define off64_t __off64_t
+ #endif
+ #endif
+ 
+ /* Machine / Operating system information */
+ #define SYS_NAME       "arm_linux24"
+ #define SYS_NAME_ID    SYS_NAME_ID_arm_linux24
+ 
+ #endif /* AFS_PARAM_H */
+ 
+ 
+ 
+ #else /* !defined(UKERNEL) */
+ 
+ /* This section for user space compiles only */
+ 
+ #ifndef AFS_PARAM_H
+ #define AFS_PARAM_H
+ 
+ /* In user space the AFS_LINUX20_ENV should be sufficient. In the kernel,
+  * it's a judgment call. If something is obviously arm specific, use that
+  * #define instead. Note that "20" refers to the linux 2.0 kernel. The "2"
+  * in the sysname is the current version of the client. This takes into
+  * account the perferred OS user space configuration as well as the kernel.
+  */
+ 
+ #define UKERNEL                        1	/* user space kernel */
+ #define AFS_ENV                        1
+ #define AFS_USR_LINUX20_ENV    1
+ #define AFS_USR_LINUX22_ENV    1
+ #define AFS_USR_LINUX24_ENV    1
+ #define AFS_NONFSTRANS 1
+ 
+ #define AFS_MOUNT_AFS "afs"	/* The name of the filesystem type. */
+ #define AFS_SYSCALL 137
+ #define AFS_64BIT_IOPS_ENV  1
+ #define AFS_NAMEI_ENV     1	/* User space interface to file system */
+ #include <afs/afs_sysnames.h>
+ 
+ #define AFS_USERSPACE_IP_ADDR 1
+ #define RXK_LISTENER_ENV 1
+ #define AFS_GCPAGS             0	/* if nonzero, garbage collect PAGs */
+ 
+ 
+ /* Machine / Operating system information */
+ #define SYS_NAME       "arm_linux24"
+ #define SYS_NAME_ID    SYS_NAME_ID_arm_linux24
+ #define AFSLITTLE_ENDIAN    1
+ #define AFS_HAVE_FFS        1	/* Use system's ffs. */
+ #define AFS_HAVE_STATVFS    0	/* System doesn't support statvfs */
+ #define AFS_VM_RDWR_ENV            1	/* read/write implemented via VM */
+ 
+ #define        afsio_iov       uio_iov
+ #define        afsio_iovcnt    uio_iovcnt
+ #define        afsio_offset    uio_offset
+ #define        afsio_seg       uio_segflg
+ #define        afsio_fmode     uio_fmode
+ #define        afsio_resid     uio_resid
+ #define        AFS_UIOSYS      1
+ #define        AFS_UIOUSER     UIO_USERSPACE
+ #define        AFS_CLBYTES     MCLBYTES
+ #define        AFS_MINCHANGE   2
+ #define        VATTR_NULL      usr_vattr_null
+ 
+ #define AFS_DIRENT
+ #ifndef CMSERVERPREF
+ #define CMSERVERPREF
+ #endif
+ 
+ #endif /* AFS_PARAM_H */
+ 
+ #endif /* !defined(UKERNEL) */
Index: openafs/src/config/param.arm_linux26.h
diff -c /dev/null openafs/src/config/param.arm_linux26.h:1.1.4.4
*** /dev/null	Mon Apr 28 17:55:43 2008
--- openafs/src/config/param.arm_linux26.h	Wed Feb 27 17:31:39 2008
***************
*** 0 ****
--- 1,151 ----
+ #ifndef UKERNEL
+ /* This section for kernel libafs compiles only */
+ 
+ #ifndef AFS_PARAM_H
+ #define AFS_PARAM_H
+ 
+ /* In user space the AFS_LINUX20_ENV should be sufficient. In the kernel,
+  * it's a judgment call. If something is obviously arm specific, use that
+  * #define instead. Note that "20" refers to the linux 2.0 kernel. The "2"
+  * in the sysname is the current version of the client. This takes into
+  * account the perferred OS user space configuration as well as the kernel.
+  */
+ 
+ #define AFS_LINUX20_ENV        1
+ #define AFS_LINUX22_ENV        1
+ #define AFS_LINUX24_ENV        1
+ #define AFS_LINUX26_ENV        1
+ #define AFS_ARM_LINUX20_ENV   1
+ #define AFS_ARM_LINUX22_ENV   1
+ #define AFS_ARM_LINUX24_ENV   1
+ #define AFS_ARM_LINUX26_ENV   1
+ #define AFS_NONFSTRANS 1
+ 
+ #define AFS_MOUNT_AFS "afs"	/* The name of the filesystem type. */
+ #define AFS_SYSCALL 137
+ #ifndef __NR_afs_syscall
+ #define __NR_afs_syscall 137
+ #endif
+ #define AFS_64BIT_IOPS_ENV  1
+ #define AFS_NAMEI_ENV     1	/* User space interface to file system */
+ #define AFS_64BIT_ENV		1
+ #define AFS_64BIT_CLIENT	1
+ 
+ #if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
+ 
+ #ifdef CONFIG_SMP
+ #ifndef AFS_SMP
+ #define AFS_SMP 1
+ #endif
+ #endif
+ /* Using "AFS_SMP" to map to however many #define's are required to get
+  * MP to compile for Linux
+  */
+ #ifdef AFS_SMP
+ #ifndef CONFIG_SMP
+ #define CONFIG_SMP 1
+ #endif
+ #ifndef __SMP__
+ #define __SMP__
+ #endif
+ #endif
+ #define AFS_GLOBAL_SUNLOCK
+ 
+ #endif /* __KERNEL__  && !DUMP_KERNEL */
+ 
+ #include <afs/afs_sysnames.h>
+ #define AFS_USERSPACE_IP_ADDR 1
+ #define RXK_LISTENER_ENV 1
+ #define AFS_GCPAGS       1
+ 
+ #define AFSLITTLE_ENDIAN    1
+ #define AFS_HAVE_FFS        1	/* Use system's ffs. */
+ #define AFS_HAVE_STATVFS    0	/* System doesn't support statvfs */
+ #define AFS_VM_RDWR_ENV            1	/* read/write implemented via VM */
+ #define AFS_USE_GETTIMEOFDAY       1	/* use gettimeofday to implement rx clock */
+ 
+ #ifdef KERNEL
+ #ifndef MIN
+ #define MIN(A,B) ((A) < (B) ? (A) : (B))
+ #endif
+ #ifndef MAX
+ #define MAX(A,B) ((A) > (B) ? (A) : (B))
+ #endif
+ #endif /* KERNEL */
+ 
+ #ifndef KERNEL
+ #define __USE_LARGEFILE64 1
+ #if !defined off64_t
+ #define off64_t __off64_t
+ #endif
+ #endif
+ 
+ /* Machine / Operating system information */
+ #define SYS_NAME       "arm_linux26"
+ #define SYS_NAME_ID    SYS_NAME_ID_arm_linux26
+ 
+ #endif /* AFS_PARAM_H */
+ 
+ 
+ 
+ #else /* !defined(UKERNEL) */
+ 
+ /* This section for user space compiles only */
+ 
+ #ifndef AFS_PARAM_H
+ #define AFS_PARAM_H
+ 
+ /* In user space the AFS_LINUX20_ENV should be sufficient. In the kernel,
+  * it's a judgment call. If something is obviously arm specific, use that
+  * #define instead. Note that "20" refers to the linux 2.0 kernel. The "2"
+  * in the sysname is the current version of the client. This takes into
+  * account the perferred OS user space configuration as well as the kernel.
+  */
+ 
+ #define UKERNEL                        1	/* user space kernel */
+ #define AFS_ENV                        1
+ #define AFS_USR_LINUX20_ENV    1
+ #define AFS_USR_LINUX22_ENV    1
+ #define AFS_USR_LINUX24_ENV    1
+ #define AFS_USR_LINUX26_ENV    1
+ #define AFS_NONFSTRANS 1
+ 
+ #define AFS_MOUNT_AFS "afs"	/* The name of the filesystem type. */
+ #define AFS_SYSCALL 137
+ #define AFS_64BIT_IOPS_ENV  1
+ #define AFS_NAMEI_ENV     1	/* User space interface to file system */
+ #include <afs/afs_sysnames.h>
+ 
+ #define AFS_USERSPACE_IP_ADDR 1
+ #define RXK_LISTENER_ENV 1
+ #define AFS_GCPAGS             0	/* if nonzero, garbage collect PAGs */
+ 
+ 
+ /* Machine / Operating system information */
+ #define SYS_NAME       "arm_linux26"
+ #define SYS_NAME_ID    SYS_NAME_ID_arm_linux26
+ #define AFSLITTLE_ENDIAN    1
+ #define AFS_HAVE_FFS        1	/* Use system's ffs. */
+ #define AFS_HAVE_STATVFS    0	/* System doesn't support statvfs */
+ #define AFS_VM_RDWR_ENV            1	/* read/write implemented via VM */
+ 
+ #define        afsio_iov       uio_iov
+ #define        afsio_iovcnt    uio_iovcnt
+ #define        afsio_offset    uio_offset
+ #define        afsio_seg       uio_segflg
+ #define        afsio_fmode     uio_fmode
+ #define        afsio_resid     uio_resid
+ #define        AFS_UIOSYS      1
+ #define        AFS_UIOUSER     UIO_USERSPACE
+ #define        AFS_CLBYTES     MCLBYTES
+ #define        AFS_MINCHANGE   2
+ #define        VATTR_NULL      usr_vattr_null
+ 
+ #define AFS_DIRENT
+ #ifndef CMSERVERPREF
+ #define CMSERVERPREF
+ #endif
+ 
+ #endif /* AFS_PARAM_H */
+ 
+ #endif /* !defined(UKERNEL) */
Index: openafs/src/config/param.hp_ux110.h
diff -c openafs/src/config/param.hp_ux110.h:1.9 openafs/src/config/param.hp_ux110.h:1.9.2.1
*** openafs/src/config/param.hp_ux110.h:1.9	Fri Aug  8 17:54:39 2003
--- openafs/src/config/param.hp_ux110.h	Mon Mar 10 12:25:26 2008
***************
*** 10,17 ****
   * directory or online at http://www.openafs.org/dl/license10.html
   */
  
- /* THIS FILE IS AUTOMATICALLY GENERATED; DO NOT EDIT */
- 
  #ifndef	AFS_PARAM_H
  #define	AFS_PARAM_H
  
--- 10,15 ----
Index: openafs/src/config/param.hp_ux1123.h
diff -c openafs/src/config/param.hp_ux1123.h:1.1.2.1 openafs/src/config/param.hp_ux1123.h:1.1.2.2
*** openafs/src/config/param.hp_ux1123.h:1.1.2.1	Wed Apr 13 21:40:09 2005
--- openafs/src/config/param.hp_ux1123.h	Mon Mar 10 12:25:26 2008
***************
*** 7,14 ****
   * directory or online at http://www.openafs.org/dl/license10.html
   */
  
- /* THIS FILE IS AUTOMATICALLY GENERATED; DO NOT EDIT */
- 
  #ifndef	AFS_PARAM_H
  #define	AFS_PARAM_H
  
--- 7,12 ----
***************
*** 57,62 ****
--- 55,62 ----
                  }                                       \
                  }
  
+ #define KERNEL_HAVE_UERROR 1
+ 
  /* Extra kernel definitions (from kdefs file) */
  #ifdef KERNEL
  #define _KERNEL 1
Index: openafs/src/config/param.hp_ux11i.h
diff -c openafs/src/config/param.hp_ux11i.h:1.4.2.1 openafs/src/config/param.hp_ux11i.h:1.4.2.2
*** openafs/src/config/param.hp_ux11i.h:1.4.2.1	Wed Nov  2 00:31:39 2005
--- openafs/src/config/param.hp_ux11i.h	Mon Mar 10 12:25:26 2008
***************
*** 10,17 ****
   * directory or online at http://www.openafs.org/dl/license10.html
   */
  
- /* THIS FILE IS AUTOMATICALLY GENERATED; DO NOT EDIT */
- 
  #ifndef	AFS_PARAM_H
  #define	AFS_PARAM_H
  
--- 10,15 ----
Index: openafs/src/config/param.i386_linux26.h
diff -c openafs/src/config/param.i386_linux26.h:1.3.2.5 openafs/src/config/param.i386_linux26.h:1.3.2.7
*** openafs/src/config/param.i386_linux26.h:1.3.2.5	Thu Nov  9 18:18:31 2006
--- openafs/src/config/param.i386_linux26.h	Sat Mar 22 20:54:03 2008
***************
*** 28,33 ****
--- 28,34 ----
  #define AFS_64BIT_ENV		1
  #define AFS_64BIT_CLIENT	1
  
+ 
  #if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
  
  #ifdef CONFIG_SMP
Index: openafs/src/config/param.i386_nbsd30.h
diff -c openafs/src/config/param.i386_nbsd30.h:1.1.2.2 openafs/src/config/param.i386_nbsd30.h:1.1.2.3
*** openafs/src/config/param.i386_nbsd30.h:1.1.2.2	Fri Oct  6 10:57:12 2006
--- openafs/src/config/param.i386_nbsd30.h	Fri Mar 28 13:14:32 2008
***************
*** 5,12 ****
  #define AFS_X86_ENV 1
  #define AFSLITTLE_ENDIAN 1
  
! #define SYS_NAME       "i386_nbsd40"
! #define SYS_NAME_ID    SYS_NAME_ID_i386_nbsd40
  
  #ifndef UKERNEL
  /* This section for kernel libafs compiles only */
--- 5,12 ----
  #define AFS_X86_ENV 1
  #define AFSLITTLE_ENDIAN 1
  
! #define SYS_NAME       "i386_nbsd30"
! #define SYS_NAME_ID    SYS_NAME_ID_i386_nbsd30
  
  #ifndef UKERNEL
  /* This section for kernel libafs compiles only */
Index: openafs/src/config/param.i386_nbsd40.h
diff -c /dev/null openafs/src/config/param.i386_nbsd40.h:1.1.4.2
*** /dev/null	Mon Apr 28 17:55:43 2008
--- openafs/src/config/param.i386_nbsd40.h	Fri Mar 28 13:14:32 2008
***************
*** 0 ****
--- 1,20 ----
+ #ifndef        AFS_I386_PARAM_H
+ #define        AFS_I386_PARAM_H
+ 
+ #define AFS_X86_XBSD_ENV 1
+ #define AFS_X86_ENV 1
+ #define AFSLITTLE_ENDIAN 1
+ 
+ #define SYS_NAME       "i386_nbsd40"
+ #define SYS_NAME_ID    SYS_NAME_ID_i386_nbsd40
+ 
+ #ifndef UKERNEL
+ /* This section for kernel libafs compiles only */
+ 
+ #else /* !defined(UKERNEL) */
+ 
+ /* This section for user space compiles only */
+ 
+ #endif /* !defined(UKERNEL) */
+ 
+ #endif /* AFS_I386_PARAM_H */
Index: openafs/src/config/param.nbsd30.h
diff -c openafs/src/config/param.nbsd30.h:1.1.2.1 openafs/src/config/param.nbsd30.h:1.1.2.2
*** openafs/src/config/param.nbsd30.h:1.1.2.1	Sun Jan 30 23:13:49 2005
--- openafs/src/config/param.nbsd30.h	Sat Dec  1 00:44:29 2007
***************
*** 21,26 ****
--- 21,27 ----
  #define AFS_NBSD15_ENV 1
  #define AFS_NBSD16_ENV 1
  #define AFS_NBSD20_ENV 1
+ #define AFS_NBSD30_ENV 1
  #define AFS_NONFSTRANS 1
  #define AFS_KERBEROS_ENV 1
  
Index: openafs/src/config/param.nbsd40.h
diff -c /dev/null openafs/src/config/param.nbsd40.h:1.1.4.2
*** /dev/null	Mon Apr 28 17:55:43 2008
--- openafs/src/config/param.nbsd40.h	Sat Dec  1 00:44:29 2007
***************
*** 0 ****
--- 1,160 ----
+ /* NetBSD shared section */
+ 
+ #ifndef	AFS_PARAM_COMMON_H
+ #define	AFS_PARAM_COMMON_H 1
+ 
+ #define AFS_64BIT_ENV  1
+ #define AFS_NAMEI_ENV  1	/* User space interface to file system */
+ #define AFS_64BIT_IOPS_ENV 1	/* Needed for NAMEI */
+ #define AFS_64BIT_CLIENT 1
+ 
+ #define AFS_MOUNT_AFS "afs"	/* The name of the filesystem type. */
+ #define AFS_SYSCALL 210
+ 
+ #ifndef	MOUNT_AFS
+ #define	MOUNT_AFS AFS_MOUNT_AFS
+ #endif
+ 
+ #define AFS_XBSD_ENV 1		/* {Free,Open,Net}BSD */
+ 
+ #define AFS_NBSD_ENV 1
+ #define AFS_NBSD15_ENV 1
+ #define AFS_NBSD16_ENV 1
+ #define AFS_NBSD20_ENV 1
+ #define AFS_NBSD30_ENV 1
+ #define AFS_NBSD40_ENV 1
+ #define AFS_NONFSTRANS 1
+ #define AFS_KERBEROS_ENV 1
+ 
+ #define AFS_VFSINCL_ENV 1
+ 
+ #define AFS_HAVE_FFS            1	/* Use system's ffs. */
+ 
+ #if	!defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) && !defined(IGNORE_STDS_H)
+ #define AFS_HAVE_STATVFS    1	/* System supports statvfs */
+ #endif
+ 
+ #ifndef UKERNEL
+ 
+ #if	!defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) && !defined(IGNORE_STDS_H)
+ #include <sys/param.h>
+ #endif
+ 
+ #define FTRUNC O_TRUNC
+ 
+ #define IUPD 0x0010
+ #define IACC 0x0020
+ #define ICHG 0x0040
+ #define IMOD 0x0080
+ 
+ #define IN_LOCK(ip)     lockmgr(&ip->i_lock, LK_EXCLUSIVE, \
+                                 NULL, curproc)
+ #define IN_UNLOCK(ip)   lockmgr(&ip->i_lock, LK_RELEASE, \
+                                 NULL, curproc)
+ 
+ #include <afs/afs_sysnames.h>
+ 
+ #define AFS_VM_RDWR_ENV	1
+ #define AFS_VFS_ENV	1
+ #define AFS_GREEDY43_ENV	1
+ 
+ #define AFS_GCPAGS	        0	/* if nonzero, garbage collect PAGs */
+ #define AFS_USE_GETTIMEOFDAY    1	/* use gettimeofday to implement rx clock */
+ 
+ /* Extra kernel definitions (from kdefs file) */
+ #ifdef _KERNEL
+ #define AFS_GLOBAL_SUNLOCK        1
+ #define	AFS_VFS34	1	/* What is VFS34??? */
+ #define	AFS_SHORTGID	1	/* are group id's short? */
+ #define	afsio_iov	uio_iov
+ #define	afsio_iovcnt	uio_iovcnt
+ #define	afsio_offset	uio_offset
+ #define	afsio_seg	uio_segflg
+ #define	afsio_resid	uio_resid
+ #define	AFS_UIOSYS	UIO_SYSSPACE
+ #define	AFS_UIOUSER	UIO_USERSPACE
+ #define	AFS_CLBYTES	CLBYTES
+ #define	osi_GetTime(x)	microtime(x)
+ #define	AFS_KALLOC(x)	kalloc(x)
+ #define	AFS_KFREE(x,y)	kfree(x,y)
+ #define	v_count		v_usecount
+ #define v_vfsp		v_mount
+ #define vfs_bsize	mnt_stat.f_bsize
+ #define vfs_fsid	mnt_stat.f_fsid
+ #define va_nodeid	va_fileid
+ #define vfs_vnodecovered mnt_vnodecovered
+ #define direct		dirent
+ #define vnode_t		struct vnode
+ 
+ #ifndef MUTEX_DEFAULT
+ #define MUTEX_DEFAULT   0
+ #endif /* MUTEX_DEFAULT */
+ 
+ #ifndef SSYS
+ #define SSYS            0x00002
+ #endif /* SSYS */
+ 
+ #define p_rcred         p_ucred
+ 
+ #define	VN_RELE(vp)	vrele(((struct vnode *)(vp)))
+ #define	VN_HOLD(vp)	VREF(((struct vnode *)(vp)))
+ 
+ #if	!defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) && !defined(IGNORE_STDS_H)
+ enum vcexcl { NONEXCL, EXCL };
+ 
+ #ifdef KERNEL
+ #ifndef MIN
+ #define MIN(A,B) ((A) < (B) ? (A) : (B))
+ #endif
+ #ifndef MAX
+ #define MAX(A,B) ((A) > (B) ? (A) : (B))
+ #endif
+ #endif /* KERNEL */
+ 
+ #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ && !defined(IGNORE_STDS_H) */ 
+ #endif /* _KERNEL */
+ 
+ #else /* !defined(UKERNEL) */
+ 
+ 
+ /* This section for user space compiles only */
+ 
+ #define UKERNEL			1	/* user space kernel */
+ 
+ #include <afs/afs_sysnames.h>
+ 
+ #define AFS_USERSPACE_IP_ADDR 1
+ #define RXK_LISTENER_ENV      1
+ #define AFS_GCPAGS	      0	/* if nonzero, garbage collect PAGs */
+ 
+ #define	afsio_iov	uio_iov
+ #define	afsio_iovcnt	uio_iovcnt
+ #define	afsio_offset	uio_offset
+ #define	afsio_seg	uio_segflg
+ #define	afsio_fmode	uio_fmode
+ #define	afsio_resid	uio_resid
+ #define	AFS_UIOSYS	UIO_SYSSPACE
+ #define	AFS_UIOUSER	UIO_USERSPACE
+ #define	AFS_CLBYTES	MCLBYTES
+ #define	AFS_MINCHANGE	2
+ #define	VATTR_NULL	usr_vattr_null
+ 
+ #define AFS_DIRENT
+ #ifndef CMSERVERPREF
+ #define CMSERVERPREF
+ #endif
+ 
+ #if	!defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) && !defined(IGNORE_STDS_H)
+ #include <limits.h>
+ #include <sys/param.h>
+ #include <sys/types.h>
+ #include <sys/mount.h>
+ #include <sys/fcntl.h>
+ #include <netinet/in.h>
+ #include <sys/uio.h>
+ #include <sys/socket.h>
+ #endif
+ 
+ #endif /* !defined(UKERNEL) */
+ 
+ #endif /* AFS_PARAM_COMMON_H */
Index: openafs/src/dauth/dpass.c
diff -c openafs/src/dauth/dpass.c:1.7.2.1 openafs/src/dauth/dpass.c:1.7.2.2
*** openafs/src/dauth/dpass.c:1.7.2.1	Sat Oct 21 22:08:33 2006
--- openafs/src/dauth/dpass.c	Mon Nov 26 16:21:52 2007
***************
*** 19,25 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/dauth/Attic/dpass.c,v 1.7.2.1 2006/10/22 02:08:33 jaltman Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 19,25 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/dauth/Attic/dpass.c,v 1.7.2.2 2007/11/26 21:21:52 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 136,141 ****
--- 136,142 ----
  #define s(n) ((k(n) << 8) | k(n+1))
      printf("\nThe new DCE password is: %0.4x-%0.4x-%0.4x-%0.4x\n", s(0), s(2),
  	   s(4), s(6));
+     return 0;
  }
  
  main(argc, argv)
Index: openafs/src/des/andrew-conf.h
diff -c openafs/src/des/andrew-conf.h:1.16.2.2 openafs/src/des/andrew-conf.h:1.16.2.3
*** openafs/src/des/andrew-conf.h:1.16.2.2	Thu Mar  9 01:41:43 2006
--- openafs/src/des/andrew-conf.h	Tue Jan 15 00:14:02 2008
***************
*** 82,88 ****
--- 82,92 ----
  #ifdef AFS_PPC64_LINUX20_ENV
  #include "conf-ppc64-linux.h"
  #else
+ #ifdef AFS_ARM_LINUX20_ENV
+ #include "conf-arm-linux.h"
+ #else
  #include "conf-i386-linux.h"
+ #endif /* AFS_ARM_LINUX20_ENV */
  #endif /* AFS_PPC64_LINUX20_ENV */
  #endif /* AFS_AMD64_LINUX20_ENV */
  #endif /* AFS_IA64_LINUX20_ENV */
Index: openafs/src/des/conf-arm-linux.h
diff -c /dev/null openafs/src/des/conf-arm-linux.h:1.1.4.2
*** /dev/null	Mon Apr 28 17:55:44 2008
--- openafs/src/des/conf-arm-linux.h	Tue Jan 15 00:14:02 2008
***************
*** 0 ****
--- 1,14 ----
+ /*
+  * Copyright 1988 by the Massachusetts Institute of Technology.
+  *
+  * For copying and distribution information, please see the file
+  * <mit-copyright.h>.
+  *
+  * Machine-type definitions: Linux on Intel
+  */
+ 
+ #include <mit-cpyright.h>
+ 
+ #define BITS32
+ #define BIG
+ #define LSBFIRST
Index: openafs/src/dir/dir.c
diff -c openafs/src/dir/dir.c:1.21.2.6 openafs/src/dir/dir.c:1.21.2.7
*** openafs/src/dir/dir.c:1.21.2.6	Thu Oct 11 13:48:35 2007
--- openafs/src/dir/dir.c	Tue Oct 30 11:23:52 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/dir/dir.c,v 1.21.2.6 2007/10/11 17:48:35 shadow Exp $");
  
  #ifdef KERNEL
  #if !defined(UKERNEL)
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/dir/dir.c,v 1.21.2.7 2007/10/30 15:23:52 shadow Exp $");
  
  #ifdef KERNEL
  #if !defined(UKERNEL)
***************
*** 100,112 ****
  #include <netinet/in.h>
  #endif
  
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #endif /* KERNEL */
  
  afs_int32 DErrno;
--- 100,106 ----
Index: openafs/src/dir/salvage.c
diff -c openafs/src/dir/salvage.c:1.10 openafs/src/dir/salvage.c:1.10.2.1
*** openafs/src/dir/salvage.c:1.10	Sun Dec  7 17:49:26 2003
--- openafs/src/dir/salvage.c	Tue Oct 30 11:23:52 2007
***************
*** 13,19 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/dir/salvage.c,v 1.10 2003/12/07 22:49:26 jaltman Exp $");
  
  #include <sys/types.h>
  #include <errno.h>
--- 13,19 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/dir/salvage.c,v 1.10.2.1 2007/10/30 15:23:52 shadow Exp $");
  
  #include <sys/types.h>
  #include <errno.h>
***************
*** 23,35 ****
  #include <netinet/in.h>
  #endif
  
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  
  #include "dir.h"
  #define printf	Log		/* To make it work with volume salvager */
--- 23,29 ----
Index: openafs/src/fsint/Makefile.in
diff -c openafs/src/fsint/Makefile.in:1.9 openafs/src/fsint/Makefile.in:1.9.2.1
*** openafs/src/fsint/Makefile.in:1.9	Tue Jun  1 22:40:10 2004
--- openafs/src/fsint/Makefile.in	Thu Nov  1 12:05:59 2007
***************
*** 26,77 ****
  afsaux.o: afsaux.c afsint.h
  
  Kcallback.cs.c: common.xg afscbint.xg Kvice.h Kcallback.h
! 	${RXGEN} -x -k -C -o Kcallback.cs.c ${srcdir}/afscbint.xg
  
  Kcallback.ss.c: common.xg afscbint.xg Kvice.h Kcallback.h
! 	${RXGEN} -x -k -S -o Kcallback.ss.c ${srcdir}/afscbint.xg
  
  Kcallback.xdr.c: common.xg afscbint.xg Kvice.h Kcallback.h
! 	${RXGEN} -x -k -y -c -o Kcallback.xdr.c ${srcdir}/afscbint.xg
  
  Kvice.cs.c: common.xg afsint.xg Kvice.h
! 	${RXGEN} -x -k -C -o Kvice.cs.c ${srcdir}/afsint.xg
  
  Kvice.ss.c: common.xg afsint.xg Kvice.h
! 	${RXGEN} -x -k -S -o Kvice.ss.c ${srcdir}/afsint.xg
  
  Kvice.xdr.c: common.xg afsint.xg
! 	${RXGEN} -x -k -c -o Kvice.xdr.c ${srcdir}/afsint.xg
  
  Kvice.h: common.xg afsint.xg
! 	${RXGEN} -x -k -h -o Kvice.h ${srcdir}/afsint.xg
  
  Kcallback.h: common.xg afscbint.xg
! 	${RXGEN} -x -k -h -o Kcallback.h ${srcdir}/afscbint.xg
  
  afscbint.cs.c: common.xg afscbint.xg afsint.h afscbint.h 
! 	${RXGEN} -x -C -o afscbint.cs.c ${srcdir}/afscbint.xg
  
  afscbint.ss.c: common.xg afscbint.xg afsint.h afscbint.h
! 	${RXGEN} -x -S -o afscbint.ss.c ${srcdir}/afscbint.xg
  
  afscbint.xdr.c: common.xg afscbint.xg afsint.h afscbint.h
! 	${RXGEN} -x -y -c -o afscbint.xdr.c ${srcdir}/afscbint.xg
  
  afsint.cs.c: common.xg afsint.xg afsint.h
! 	${RXGEN} -x -C -o afsint.cs.c ${srcdir}/afsint.xg
  
  afsint.ss.c: common.xg afsint.xg afsint.h
! 	${RXGEN} -x -S -o afsint.ss.c ${srcdir}/afsint.xg
  
  afsint.xdr.c: common.xg afsint.xg
! 	${RXGEN} -x -c -o afsint.xdr.c ${srcdir}/afsint.xg
  
  afsint.h: common.xg afsint.xg
! 	${RXGEN} -x -h -o afsint.h ${srcdir}/afsint.xg
  
  afscbint.h: common.xg afscbint.xg
! 	${RXGEN} -x -h -o afscbint.h ${srcdir}/afscbint.xg
  
  #
  # Installation targets
--- 26,77 ----
  afsaux.o: afsaux.c afsint.h
  
  Kcallback.cs.c: common.xg afscbint.xg Kvice.h Kcallback.h
! 	${RXGEN} -x -k -A -C -o Kcallback.cs.c ${srcdir}/afscbint.xg
  
  Kcallback.ss.c: common.xg afscbint.xg Kvice.h Kcallback.h
! 	${RXGEN} -x -k -A -S -o Kcallback.ss.c ${srcdir}/afscbint.xg
  
  Kcallback.xdr.c: common.xg afscbint.xg Kvice.h Kcallback.h
! 	${RXGEN} -x -k -A -y -c -o Kcallback.xdr.c ${srcdir}/afscbint.xg
  
  Kvice.cs.c: common.xg afsint.xg Kvice.h
! 	${RXGEN} -x -k -A -C -o Kvice.cs.c ${srcdir}/afsint.xg
  
  Kvice.ss.c: common.xg afsint.xg Kvice.h
! 	${RXGEN} -x -k -A -S -o Kvice.ss.c ${srcdir}/afsint.xg
  
  Kvice.xdr.c: common.xg afsint.xg
! 	${RXGEN} -x -k -A -c -o Kvice.xdr.c ${srcdir}/afsint.xg
  
  Kvice.h: common.xg afsint.xg
! 	${RXGEN} -x -k -A -h -o Kvice.h ${srcdir}/afsint.xg
  
  Kcallback.h: common.xg afscbint.xg
! 	${RXGEN} -x -k -A -h -o Kcallback.h ${srcdir}/afscbint.xg
  
  afscbint.cs.c: common.xg afscbint.xg afsint.h afscbint.h 
! 	${RXGEN} -x -A -C -o afscbint.cs.c ${srcdir}/afscbint.xg
  
  afscbint.ss.c: common.xg afscbint.xg afsint.h afscbint.h
! 	${RXGEN} -x -A -S -o afscbint.ss.c ${srcdir}/afscbint.xg
  
  afscbint.xdr.c: common.xg afscbint.xg afsint.h afscbint.h
! 	${RXGEN} -x -y -A -c -o afscbint.xdr.c ${srcdir}/afscbint.xg
  
  afsint.cs.c: common.xg afsint.xg afsint.h
! 	${RXGEN} -x -A -C -o afsint.cs.c ${srcdir}/afsint.xg
  
  afsint.ss.c: common.xg afsint.xg afsint.h
! 	${RXGEN} -x -A -S -o afsint.ss.c ${srcdir}/afsint.xg
  
  afsint.xdr.c: common.xg afsint.xg
! 	${RXGEN} -x -A -c -o afsint.xdr.c ${srcdir}/afsint.xg
  
  afsint.h: common.xg afsint.xg
! 	${RXGEN} -x -A -h -o afsint.h ${srcdir}/afsint.xg
  
  afscbint.h: common.xg afscbint.xg
! 	${RXGEN} -x -A -h -o afscbint.h ${srcdir}/afscbint.xg
  
  #
  # Installation targets
Index: openafs/src/fsint/afsint.xg
diff -c openafs/src/fsint/afsint.xg:1.13 openafs/src/fsint/afsint.xg:1.13.2.1
*** openafs/src/fsint/afsint.xg:1.13	Wed Jun  2 02:57:35 2004
--- openafs/src/fsint/afsint.xg	Tue Feb  5 13:56:27 2008
***************
*** 693,703 ****
  ) split = 65538;
  
  GiveUpAllCallBacks(
! ) = 65539;
  
  GetCapabilities(
    Capabilities *capabilities
! ) = 65540;
  
  CallBackRxConnAddr(
    IN afs_int32 *addr
--- 693,703 ----
  ) split = 65538;
  
  GiveUpAllCallBacks(
! ) multi = 65539;
  
  GetCapabilities(
    Capabilities *capabilities
! ) multi = 65540;
  
  CallBackRxConnAddr(
    IN afs_int32 *addr
Index: openafs/src/fsprobe/fsprobe.c
diff -c openafs/src/fsprobe/fsprobe.c:1.9 openafs/src/fsprobe/fsprobe.c:1.9.2.2
*** openafs/src/fsprobe/fsprobe.c:1.9	Tue Jul 15 19:15:08 2003
--- openafs/src/fsprobe/fsprobe.c	Mon Mar 10 18:35:34 2008
***************
*** 17,32 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/fsprobe/fsprobe.c,v 1.9 2003/07/15 23:15:08 shadow Exp $");
  
  
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  
  #include <fsprobe.h>		/*Interface for this module */
  #include <lwp.h>		/*Lightweight process package */
--- 17,26 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/fsprobe/fsprobe.c,v 1.9.2.2 2008/03/10 22:35:34 shadow Exp $");
  
  
  #include <string.h>
  
  #include <fsprobe.h>		/*Interface for this module */
  #include <lwp.h>		/*Lightweight process package */
***************
*** 237,244 ****
   * Side Effects:
   *	As advertised.
   *------------------------------------------------------------------------*/
! static void
! fsprobe_LWP()
  {				/*fsprobe_LWP */
  
      static char rn[] = "fsprobe_LWP";	/*Routine name */
--- 231,238 ----
   * Side Effects:
   *	As advertised.
   *------------------------------------------------------------------------*/
! static void *
! fsprobe_LWP(void *unused)
  {				/*fsprobe_LWP */
  
      static char rn[] = "fsprobe_LWP";	/*Routine name */
***************
*** 365,370 ****
--- 359,365 ----
  	    fprintf(stderr, "[%s] IOMGR_Select returned code %d\n", rn, code);
      }				/*Service loop */
  
+     return NULL;
  }				/*fsprobe_LWP */
  
  /*list all the partitions on <aserver> */
Index: openafs/src/fsprobe/fsprobe_test.c
diff -c openafs/src/fsprobe/fsprobe_test.c:1.8.2.1 openafs/src/fsprobe/fsprobe_test.c:1.8.2.2
*** openafs/src/fsprobe/fsprobe_test.c:1.8.2.1	Thu Mar  9 01:41:45 2006
--- openafs/src/fsprobe/fsprobe_test.c	Tue Oct 30 11:23:53 2007
***************
*** 17,32 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/fsprobe/fsprobe_test.c,v 1.8.2.1 2006/03/09 06:41:45 shadow Exp $");
  
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
- 
  #include <fsprobe.h>		/*Interface for fsprobe module */
  
  /*
--- 17,25 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/fsprobe/fsprobe_test.c,v 1.8.2.2 2007/10/30 15:23:53 shadow Exp $");
  
  #include <string.h>
  #include <fsprobe.h>		/*Interface for fsprobe module */
  
  /*
Index: openafs/src/gtx/curseswindows.c
diff -c openafs/src/gtx/curseswindows.c:1.10 openafs/src/gtx/curseswindows.c:1.10.2.2
*** openafs/src/gtx/curseswindows.c:1.10	Tue Jul 15 19:15:12 2003
--- openafs/src/gtx/curseswindows.c	Mon Mar 10 18:35:35 2008
***************
*** 14,25 ****
   *	Implementation of the gator curses window facility.
   *
   *------------------------------------------------------------------------*/
! #define	IGNORE_STDS_H
  #include <afsconfig.h>
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/gtx/curseswindows.c,v 1.10 2003/07/15 23:15:12 shadow Exp $");
  
  
  #if defined(AFS_HPUX110_ENV) && !defined(__HP_CURSES)
--- 14,25 ----
   *	Implementation of the gator curses window facility.
   *
   *------------------------------------------------------------------------*/
! 
  #include <afsconfig.h>
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/gtx/curseswindows.c,v 1.10.2.2 2008/03/10 22:35:35 shadow Exp $");
  
  
  #if defined(AFS_HPUX110_ENV) && !defined(__HP_CURSES)
***************
*** 37,52 ****
  #include <stdio.h>
  #include <sys/time.h>
  #include <errno.h>
- 
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <stdlib.h>
  
  #include "gtxcurseswin.h"	/*Interface definition */
  #include "gtxobjects.h"
  #include "gtxframe.h"
--- 37,47 ----
  #include <stdio.h>
  #include <sys/time.h>
  #include <errno.h>
  #include <string.h>
  #include <stdlib.h>
  
+ #include <lwp.h>
+ 
  #include "gtxcurseswin.h"	/*Interface definition */
  #include "gtxobjects.h"
  #include "gtxframe.h"
Index: openafs/src/gtx/frame.c
diff -c openafs/src/gtx/frame.c:1.7 openafs/src/gtx/frame.c:1.7.2.3
*** openafs/src/gtx/frame.c:1.7	Tue Jul 15 19:15:12 2003
--- openafs/src/gtx/frame.c	Mon Mar 10 18:35:35 2008
***************
*** 7,31 ****
   * directory or online at http://www.openafs.org/dl/license10.html
   */
  
- #define	IGNORE_STDS_H
  #include <afsconfig.h>
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/gtx/frame.c,v 1.7 2003/07/15 23:15:12 shadow Exp $");
  
  #ifdef AFS_HPUX_ENV
  #include <sys/types.h>
  #endif
  #include <lwp.h>
  
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <stdlib.h>
  
  #include "gtxobjects.h"
--- 7,24 ----
   * directory or online at http://www.openafs.org/dl/license10.html
   */
  
  #include <afsconfig.h>
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/gtx/frame.c,v 1.7.2.3 2008/03/10 22:35:35 shadow Exp $");
  
  #ifdef AFS_HPUX_ENV
  #include <sys/types.h>
  #endif
  #include <lwp.h>
  
  #include <string.h>
  #include <stdlib.h>
  
  #include "gtxobjects.h"
***************
*** 324,329 ****
--- 317,323 ----
      if (aframe->messageLine)
  	free(aframe->messageLine);
      aframe->messageLine = gtx_CopyString(amsgLine);
+     return 0;
  }
  
  /* Called by input processor to try to clear the dude */
Index: openafs/src/gtx/gtxtest.c
diff -c openafs/src/gtx/gtxtest.c:1.6.2.1 openafs/src/gtx/gtxtest.c:1.6.2.3
*** openafs/src/gtx/gtxtest.c:1.6.2.1	Mon Jul 11 15:29:37 2005
--- openafs/src/gtx/gtxtest.c	Mon Nov 26 16:21:52 2007
***************
*** 11,26 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/gtx/gtxtest.c,v 1.6.2.1 2005/07/11 19:29:37 shadow Exp $");
  
- 
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  
  #include "gtxwindows.h"
  #include "gtxobjects.h"
--- 11,19 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/gtx/gtxtest.c,v 1.6.2.3 2007/11/26 21:21:52 shadow Exp $");
  
  #include <string.h>
  
  #include "gtxwindows.h"
  #include "gtxobjects.h"
***************
*** 253,256 ****
--- 246,250 ----
      keymap_Delete(tmap);
  
      gtx_InputServer(win);
+     return 0;
  }
Index: openafs/src/gtx/input.c
diff -c openafs/src/gtx/input.c:1.7 openafs/src/gtx/input.c:1.7.2.2
*** openafs/src/gtx/input.c:1.7	Tue Jul 15 19:15:12 2003
--- openafs/src/gtx/input.c	Mon Mar 10 18:35:35 2008
***************
*** 7,18 ****
   * directory or online at http://www.openafs.org/dl/license10.html
   */
  
- #define	IGNORE_STDS_H
  #include <afsconfig.h>
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/gtx/input.c,v 1.7 2003/07/15 23:15:12 shadow Exp $");
  
  #ifdef AFS_HPUX_ENV
  #include <sys/types.h>
--- 7,17 ----
   * directory or online at http://www.openafs.org/dl/license10.html
   */
  
  #include <afsconfig.h>
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/gtx/input.c,v 1.7.2.2 2008/03/10 22:35:35 shadow Exp $");
  
  #ifdef AFS_HPUX_ENV
  #include <sys/types.h>
***************
*** 29,37 ****
  
  
  /* process input */
! gtx_InputServer(awin)
!      register struct gwin *awin;
  {
      register int tc;
      register int code;
      register struct gtx_frame *tframe;
--- 28,38 ----
  
  
  /* process input */
! void *
! gtx_InputServer(void *param)
  {
+     struct gwin *awin = (struct gwin *) param;
+     
      register int tc;
      register int code;
      register struct gtx_frame *tframe;
***************
*** 61,66 ****
--- 62,68 ----
  	tframe->flags &= ~GTXFRAME_RECURSIVEEND;
  	WOP_DISPLAY(awin);	/* eventually calls gtxframe_Display */
      }
+     return 0;
  }
  
  struct gwin *
Index: openafs/src/gtx/keymap.c
diff -c openafs/src/gtx/keymap.c:1.7 openafs/src/gtx/keymap.c:1.7.2.1
*** openafs/src/gtx/keymap.c:1.7	Tue Jul 15 19:15:13 2003
--- openafs/src/gtx/keymap.c	Tue Oct 30 11:23:53 2007
***************
*** 11,26 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/gtx/keymap.c,v 1.7 2003/07/15 23:15:13 shadow Exp $");
  
- 
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <stdlib.h>
  
  #include "gtxkeymap.h"
--- 11,19 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/gtx/keymap.c,v 1.7.2.1 2007/10/30 15:23:53 shadow Exp $");
  
  #include <string.h>
  #include <stdlib.h>
  
  #include "gtxkeymap.h"
Index: openafs/src/gtx/lightobject.c
diff -c openafs/src/gtx/lightobject.c:1.6 openafs/src/gtx/lightobject.c:1.6.2.1
*** openafs/src/gtx/lightobject.c:1.6	Tue Jul 15 19:15:13 2003
--- openafs/src/gtx/lightobject.c	Tue Oct 30 11:23:53 2007
***************
*** 17,38 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/gtx/lightobject.c,v 1.6 2003/07/15 23:15:13 shadow Exp $");
  
  #include "gtxlightobj.h"	/*Interface for this module */
  #include <stdio.h>		/*Standard I/O stuff */
  #include <errno.h>
- 
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <stdlib.h>
  
- 
  /*Externally-advertised array of light onode operations*/
  struct onodeops gator_light_ops = {
      gator_light_destroy,
--- 17,30 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/gtx/lightobject.c,v 1.6.2.1 2007/10/30 15:23:53 shadow Exp $");
  
  #include "gtxlightobj.h"	/*Interface for this module */
  #include <stdio.h>		/*Standard I/O stuff */
  #include <errno.h>
  #include <string.h>
  #include <stdlib.h>
  
  /*Externally-advertised array of light onode operations*/
  struct onodeops gator_light_ops = {
      gator_light_destroy,
Index: openafs/src/gtx/object_test.c
diff -c openafs/src/gtx/object_test.c:1.7 openafs/src/gtx/object_test.c:1.7.2.1
*** openafs/src/gtx/object_test.c:1.7	Tue Jul 15 19:15:13 2003
--- openafs/src/gtx/object_test.c	Wed Oct 31 00:13:38 2007
***************
*** 15,21 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/gtx/object_test.c,v 1.7 2003/07/15 23:15:13 shadow Exp $");
  
  #include "gtxscreenobj.h"	/*Gator screen object interface */
  #include "gtxtextobj.h"		/*Gator text object interface */
--- 15,21 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/gtx/object_test.c,v 1.7.2.1 2007/10/31 04:13:38 shadow Exp $");
  
  #include "gtxscreenobj.h"	/*Gator screen object interface */
  #include "gtxtextobj.h"		/*Gator text object interface */
***************
*** 386,395 ****
   *------------------------------------------------------------------------*/
  
  static int
! object_testInit(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
! 
  {				/*object_testInit */
  
      static char rn[] = "object_testInit";	/*Routine name */
--- 386,392 ----
   *------------------------------------------------------------------------*/
  
  static int
! object_testInit(struct cmd_syndesc *as, void *arock)
  {				/*object_testInit */
  
      static char rn[] = "object_testInit";	/*Routine name */
***************
*** 442,448 ****
      /*
       * Set up the commands we understand.
       */
!     ts = cmd_CreateSyntax("initcmd", object_testInit, 0,
  			  "Initialize the program");
      cmd_AddParm(ts, "-package", CMD_SINGLE, CMD_REQUIRED,
  		"Graphics package to use");
--- 439,445 ----
      /*
       * Set up the commands we understand.
       */
!     ts = cmd_CreateSyntax("initcmd", object_testInit, NULL,
  			  "Initialize the program");
      cmd_AddParm(ts, "-package", CMD_SINGLE, CMD_REQUIRED,
  		"Graphics package to use");
Index: openafs/src/gtx/objects.c
diff -c openafs/src/gtx/objects.c:1.6 openafs/src/gtx/objects.c:1.6.2.1
*** openafs/src/gtx/objects.c:1.6	Tue Jul 15 19:15:13 2003
--- openafs/src/gtx/objects.c	Tue Oct 30 11:23:53 2007
***************
*** 17,23 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/gtx/objects.c,v 1.6 2003/07/15 23:15:13 shadow Exp $");
  
  #include "gtxobjects.h"		/*Interface for this module */
  #include "gtxtextobj.h"		/*Text object interface */
--- 17,23 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/gtx/objects.c,v 1.6.2.1 2007/10/30 15:23:53 shadow Exp $");
  
  #include "gtxobjects.h"		/*Interface for this module */
  #include "gtxtextobj.h"		/*Text object interface */
***************
*** 26,39 ****
  #include <stdio.h>		/*Standard I/O stuff */
  #include <errno.h>
  
- 
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <stdlib.h>
  
  /*
--- 26,32 ----
Index: openafs/src/gtx/screen_test.c
diff -c openafs/src/gtx/screen_test.c:1.7 openafs/src/gtx/screen_test.c:1.7.2.1
*** openafs/src/gtx/screen_test.c:1.7	Tue Jul 15 19:15:13 2003
--- openafs/src/gtx/screen_test.c	Wed Oct 31 00:13:38 2007
***************
*** 15,21 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/gtx/screen_test.c,v 1.7 2003/07/15 23:15:13 shadow Exp $");
  
  #include "gtxwindows.h"		/*Generalized window interface */
  #include "gtxcurseswin.h"	/*Curses window interface */
--- 15,21 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/gtx/screen_test.c,v 1.7.2.1 2007/10/31 04:13:38 shadow Exp $");
  
  #include "gtxwindows.h"		/*Generalized window interface */
  #include "gtxcurseswin.h"	/*Curses window interface */
***************
*** 224,233 ****
   *--------------------------------------------------------------------------------*/
  
  static int
! screen_testInit(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
! 
  {				/*screen_testInit */
  
      static char rn[] = "screen_testInit";	/*Routine name */
--- 224,230 ----
   *--------------------------------------------------------------------------------*/
  
  static int
! screen_testInit(struct cmd_syndesc *as, void *arock)
  {				/*screen_testInit */
  
      static char rn[] = "screen_testInit";	/*Routine name */
***************
*** 280,286 ****
       * There really aren't any opcodes here, but we do want to interpret switches
       * from the command line.  So, all we need do is set up the initcmd ``opcode''.
       */
!     ts = cmd_CreateSyntax("initcmd", screen_testInit, 0,
  			  "Initialize, interpret command line");
      cmd_AddParm(ts, "-package", CMD_SINGLE, CMD_REQUIRED,
  		"Graphics package to use");
--- 277,283 ----
       * There really aren't any opcodes here, but we do want to interpret switches
       * from the command line.  So, all we need do is set up the initcmd ``opcode''.
       */
!     ts = cmd_CreateSyntax("initcmd", screen_testInit, NULL,
  			  "Initialize, interpret command line");
      cmd_AddParm(ts, "-package", CMD_SINGLE, CMD_REQUIRED,
  		"Graphics package to use");
Index: openafs/src/gtx/textcb.c
diff -c openafs/src/gtx/textcb.c:1.7 openafs/src/gtx/textcb.c:1.7.2.1
*** openafs/src/gtx/textcb.c:1.7	Tue Jul 15 19:15:13 2003
--- openafs/src/gtx/textcb.c	Tue Oct 30 11:23:53 2007
***************
*** 17,35 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/gtx/textcb.c,v 1.7 2003/07/15 23:15:13 shadow Exp $");
  
  #include "gtxtextcb.h"		/*Module interface */
  #include <stdio.h>		/*Standard I/O stuff */
  #in
