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.26
*** openafs/src/afs/afs_call.c:1.74.2.25	Tue Oct 16 23:51:44 2007
--- openafs/src/afs/afs_call.c	Wed Jan 30 16:18:29 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.26 2008/01/30 21:18:29 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);
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.31
*** openafs/src/afs/afs_pioctl.c:1.81.2.28	Tue Aug 21 22:15:33 2007
--- openafs/src/afs/afs_pioctl.c	Mon Mar 17 12:53:36 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.31 2008/03/17 16:53:36 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #ifdef AFS_OBSD_ENV
***************
*** 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);
--- 982,994 ----
  #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;
--- 2778,2785 ----
  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) {
  
--- 2796,2802 ----
  #endif
      }
      memset(inname, 0, MAXSYSNAME);
!     memcpy(&setsysname, ain, sizeof(afs_int32));
      ain += sizeof(afs_int32);
      if (setsysname) {
  
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.23
*** openafs/src/afs/afs_prototypes.h:1.53.2.20	Wed Jun 27 12:32:12 2007
--- openafs/src/afs/afs_prototypes.h	Tue Feb  5 20:43:44 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);
***************
*** 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
--- 560,565 ----
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_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.15
*** 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	Sat Mar 22 20:54:01 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.15 2008/03/23 00:54:01 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,78 ----
  		  sizeof(struct osi_file));
      }
      memset(afile, 0, sizeof(struct osi_file));
+ #if defined(HAVE_IGET)
      tip = iget(afs_cacheSBp, (u_long) ainode);
! #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;
--- 356,361 ----
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.14
*** 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	Mon Mar 10 12:48:56 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.14 2008/03/10 16:48:56 shadow Exp $");
  
  #include "afs/sysincludes.h"
  #include "afsincludes.h"
***************
*** 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)
--- 222,229 ----
  }
  
  #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,652 ****
  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);
  }
--- 625,656 ----
  void osi_keyring_init(void)
  {
      struct task_struct *p;
+     
+     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)
+ # 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);
  }
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_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.60
*** 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 Nov 27 14:32:43 2007
***************
*** 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.60 2007/11/27 19:32:43 shadow Exp $");
  
  #include "afs/sysincludes.h"
  #include "afsincludes.h"
***************
*** 643,648 ****
--- 643,652 ----
  #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,
***************
*** 878,883 ****
--- 882,896 ----
      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 ****
--- 952,958 ----
  
  	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 ****
--- 998,1005 ----
  	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 ****
--- 1111,1125 ----
              }
              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) */
  }
--- 1847,1850 ----
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.20
*** 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	Fri Mar  7 12:34:08 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.20 2008/03/07 17:34:08 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 1140,1145 ****
--- 1140,1150 ----
      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.
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.5
*** 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	Thu Nov 29 13:36:12 2007
***************
*** 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.5 2007/11/29 18:36:12 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,137 ----
       * Locks held:
       * avc->lock(R)
       */
!     if (filePos >= avc->m.Length) {
! 	if (len > AFS_ZEROS)
! 	    len = sizeof(afs_zeros);	/* and in 0 buffer */
! #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 */
--- 550,571 ----
      }
  #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	Sun Mar 23 21:55:05 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_main.c
diff -c openafs/src/aklog/aklog_main.c:1.1.2.20 openafs/src/aklog/aklog_main.c:1.1.2.23
*** openafs/src/aklog/aklog_main.c:1.1.2.20	Wed Oct 10 13:47:58 2007
--- openafs/src/aklog/aklog_main.c	Fri Jan  4 23:48:40 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.23 2008/01/05 04:48:40 shadow Exp $
   *
   * Copyright 1990,1991 by the Massachusetts Institute of Technology
   * For distribution and copying rights, see the file "mit-copyright.h"
***************
*** 36,42 ****
  
  #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>
--- 36,42 ----
  
  #if !defined(lint) && !defined(SABER)
  static char *rcsid =
! 	"$Id: aklog_main.c,v 1.1.2.23 2008/01/05 04:48:40 shadow Exp $";
  #endif /* lint || SABER */
  
  #include <afsconfig.h>
***************
*** 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,
--- 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) && defined(HAVE_KRB5_C_ENCRYPT) 
  krb5_error_code
  krb5_encrypt_tkt_part(krb5_context context,
  		      const krb5_keyblock *key,
***************
*** 660,665 ****
--- 660,692 ----
  	status = get_credv5(context, name, primary_instance, realm_of_cell,
  			    &v5cred);
  
+ #if !defined(USING_HEIMDAL) && defined(HAVE_KRB5_DECODE_TICKET)
+ 	if (status == 0 && 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;
+ 
+ 		strncpy(realm_of_cell, realm_data(context, ticket->server), 
+ 			len);
+ 		realm_of_cell[len] = 0;
+ 
+ 		krb5_free_ticket(context, ticket);
+ 	    }
+ 	}
+ #endif
+ 
  	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);
***************
*** 929,939 ****
  	    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, 
--- 956,969 ----
  	    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
  #ifndef WINDOWS
  	if ((status = ktc_SetToken(&aserver, &atoken, &aclient, afssetpag))) {
  	    fprintf(stderr, 
***************
*** 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];
--- 1720,1726 ----
  						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];
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.9
*** openafs/src/aklog/asetkey.c:1.4.2.7	Tue Apr 10 14:43:40 2007
--- openafs/src/aklog/asetkey.c	Tue Mar 18 12:11:50 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.9 2008/03/18 16:11:50 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>
Index: openafs/src/aklog/klog.c
diff -c /dev/null openafs/src/aklog/klog.c:1.3.4.4
*** /dev/null	Sun Mar 23 21:55:06 2008
--- openafs/src/aklog/klog.c	Fri Nov 23 09:03:23 2007
***************
*** 0 ****
--- 1,740 ----
+ /*
+  * 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>
+ #if 0
+ #include <afs/com_err.h>
+ #endif
+ #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
+ 
+ #ifndef USING_HEIMDAL
+ extern krb5_cc_ops krb5_mcc_ops;
+ #endif
+ 
+ #include "assert.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;
+ #ifndef USING_HEIMDAL
+     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;
+ #ifndef USING_HEIMDAL
+     if ((types = krb5_get_prompt_types(context)))
+ #endif
+     for (i = 0; i < num_prompts; ++i) {
+ #ifdef USING_HEIMDAL
+ 	type = prompts[i].type;
+ #else
+ 	type = types[i];
+ #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];
+     char realm[MAXKTCREALMLEN];
+     char lrealm[MAXKTCREALMLEN];	/* uppercase copy of local cellname */
+     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 local;			/* explicit cell is same a local one */
+     int writeTicketFile = 0;	/* write ticket file to /tmp */
+ 
+     char *reason;		/* string describing errors */
+ 
+     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) {
+ 	set_com_err_hook(silent_errors);
+     }
+ 
+     if ((code = krb5_init_context(&k5context))) {
+ 	com_err(rn, code, "while initializing Kerberos 5 library");
+ 	KLOGEXIT(code);
+     }
+     if ((code = rx_Init(0))) {
+ 	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))) {
+ 	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 ? cell = as->parms[aCELL].items->data : 0;
+     if ((code = afsconf_GetCellInfo(tdir, cell, "afsprot", cellconfig))) {
+ 	if (cell)
+ 	    com_err(rn, code, "Can't get cell information for '%s'", cell);
+ 	else
+ 	    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) {
+ 	    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))) {
+ 	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) {
+ 		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) {
+ 	    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) {
+ 	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)
+ 	    com_err(rn, code, "Unable to authenticate to use %s", service);
+ 	else if (r)
+ 	    com_err(rn, code, "Unable to authenticate in realm %s", r);
+ 	else
+ 	    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 {
+ #ifdef HAVE_KRB5_CC_REGISTER
+ 		what = "krb5_cc_register";
+ 		code = krb5_cc_register(k5context, &krb5_mcc_ops, FALSE);
+ 		if (code && code != KRB5_CC_TYPE_EXISTS) goto Failed;
+ #endif
+ 		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)
+ 		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) {
+ 		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) {
+ 	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) {
+ 	    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)) {
+ 		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) {
+ 		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) {
+ 	    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/skipwrap.c
diff -c /dev/null openafs/src/aklog/skipwrap.c:1.1.12.2
*** /dev/null	Sun Mar 23 21:55:06 2008
--- openafs/src/aklog/skipwrap.c	Thu Nov  1 12:51:58 2007
***************
*** 0 ****
--- 1,124 ----
+ 
+ /*
+  * 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>
+ 
+ /* 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/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	Sun Mar 23 21:55:06 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	Sun Mar 23 21:55:06 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.5
*** openafs/src/bucoord/dump.c:1.12.2.3	Tue Apr 10 14:43:41 2007
--- openafs/src/bucoord/dump.c	Mon Mar 10 18:35:34 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.5 2008/03/10 22:35:34 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;
  
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	Sun Mar 23 21:55:06 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.6
*** openafs/src/butc/lwps.c:1.12.2.3	Tue Apr 10 14:43:41 2007
--- openafs/src/butc/lwps.c	Mon Mar 10 18:35:34 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.6 2008/03/10 22:35:34 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;
***************
*** 1922,1927 ****
--- 1925,1931 ----
  
  /* 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;
***************
*** 2283,2288 ****
--- 2289,2295 ----
   *	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.5
*** openafs/src/butc/tcudbprocs.c:1.14.2.2	Mon Jul 31 13:07:50 2006
--- openafs/src/butc/tcudbprocs.c	Mon Mar 10 18:35:34 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.5 2008/03/10 22:35:34 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;
***************
*** 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 = (void *)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.14
*** openafs/src/cf/kerberos.m4:1.1.2.11	Wed Oct 10 13:47:59 2007
--- openafs/src/cf/kerberos.m4	Fri Jan  4 23:48:41 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.14 2008/01/05 04:48:41 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])
  	AC_CHECK_FUNCS([krb5_524_convert_creds], ,
  	    [AC_CHECK_FUNCS([krb524_convert_creds_kdc], ,
  		[AC_CHECK_LIB([krb524], [krb524_convert_creds_kdc],
***************
*** 103,108 ****
--- 103,112 ----
  	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.44
*** openafs/src/cf/linux-test4.m4:1.20.2.34	Mon Oct 15 08:42:29 2007
--- openafs/src/cf/linux-test4.m4	Mon Mar 10 15:05:28 2008
***************
*** 719,729 ****
--- 719,746 ----
        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 ****
--- 911,983 ----
        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)])
+ 
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	Sun Mar 23 21:55:06 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	Sun Mar 23 21:55:06 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	Sun Mar 23 21:55:06 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	Sun Mar 23 21:55:06 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.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	Sun Mar 23 21:55:06 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	Sun Mar 23 21:55:07 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 */
  #include <errno.h>
- 
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <stdlib.h>
  
  static int gator_textcb_debug;	/*Is debugging output turned on? */
--- 17,28 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/gtx/textcb.c,v 1.7.2.1 2007/10/30 15:23:53 shadow Exp $");
  
  #include "gtxtextcb.h"		/*Module interface */
  #include <stdio.h>		/*Standard I/O stuff */
  #include <errno.h>
  #include <string.h>
  #include <stdlib.h>
  
  static int gator_textcb_debug;	/*Is debugging output turned on? */
Index: openafs/src/gtx/textobject.c
diff -c openafs/src/gtx/textobject.c:1.6 openafs/src/gtx/textobject.c:1.6.2.2
*** openafs/src/gtx/textobject.c:1.6	Tue Jul 15 19:15:13 2003
--- openafs/src/gtx/textobject.c	Mon Nov 26 16:21:52 2007
***************
*** 16,22 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/gtx/textobject.c,v 1.6 2003/07/15 23:15:13 shadow Exp $");
  
  #include "gtxtextobj.h"		/*Interface for this module */
  #include "gtxwindows.h"		/*Gator window interface */
--- 16,22 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/gtx/textobject.c,v 1.6.2.2 2007/11/26 21:21:52 shadow Exp $");
  
  #include "gtxtextobj.h"		/*Interface for this module */
  #include "gtxwindows.h"		/*Gator window interface */
***************
*** 25,38 ****
  #include "gtxX11win.h"		/*Gator X11 window interface */
  #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 text onode operations*/
--- 25,31 ----
***************
*** 370,376 ****
       * the window empty.
       */
      if (objects_debug)
! 	fprintf(stderr, "[%s:%s] Scrolling text object at 0x%x %d lines %s\n",
  		mn, rn, nlines,
  		(direction == GATOR_TEXT_SCROLL_UP) ? "UP" : "DOWN");
  
--- 363,369 ----
       * the window empty.
       */
      if (objects_debug)
! 	fprintf(stderr, "[%s:%s] Scrolling text object %d lines %s\n",
  		mn, rn, nlines,
  		(direction == GATOR_TEXT_SCROLL_UP) ? "UP" : "DOWN");
  
***************
*** 461,467 ****
      if (objects_debug) {
  	fprintf(stderr,
  		"[%s:%s] Writing %d chars to text object at 0x%x (highlight=%d, skip=%d: '",
! 		rn, numChars, onp, highlight, skip);
  	for (i = 0; i < numChars; i++)
  	    fprintf(stderr, "%c", strToWrite + i);
  	fprintf(stderr, "\n");
--- 454,460 ----
      if (objects_debug) {
  	fprintf(stderr,
  		"[%s:%s] Writing %d chars to text object at 0x%x (highlight=%d, skip=%d: '",
! 		mn, rn, numChars, onp, highlight, skip);
  	for (i = 0; i < numChars; i++)
  	    fprintf(stderr, "%c", strToWrite + i);
  	fprintf(stderr, "\n");
Index: openafs/src/kauth/Makefile.in
diff -c openafs/src/kauth/Makefile.in:1.11.2.3 openafs/src/kauth/Makefile.in:1.11.2.5
*** openafs/src/kauth/Makefile.in:1.11.2.3	Sun Aug 19 18:17:44 2007
--- openafs/src/kauth/Makefile.in	Mon Nov 12 13:31:34 2007
***************
*** 96,124 ****
  $(UKSRCS): kauth.h
  
  kauth.cs.c: kauth.rg
! 	${RXGEN} -u -x -C -o $@ ${srcdir}/kauth.rg
  
  kauth.ss.c: kauth.rg
! 	${RXGEN} -x -S -o $@ ${srcdir}/kauth.rg
  
  kauth.xdr.c: kauth.rg
! 	${RXGEN} -x -c -o $@ ${srcdir}/kauth.rg
  
  kauth.h: kauth.rg
! 	${RXGEN} -u -x -h -o $@ ${srcdir}/kauth.rg
  
  kauth.xdr.c: kauth.h
  kauth.cs.c: kauth.h
  kauth.ss.c: kauth.h
  
  Kkauth.cs.c: kauth.rg Kkauth.h
! 	${RXGEN} -x -k -C -o Kkauth.cs.c ${srcdir}/kauth.rg
  
  Kkauth.xdr.c: kauth.rg
! 	${RXGEN} -x -k -c -o Kkauth.xdr.c ${srcdir}/kauth.rg
  
  Kkauth.h: kauth.rg
! 	${RXGEN} -x -k -h -o Kkauth.h ${srcdir}/kauth.rg
  
  libkauth.a: $(OBJS) AFS_component_version_number.o
  	-$(RM) -f $@
--- 96,124 ----
  $(UKSRCS): kauth.h
  
  kauth.cs.c: kauth.rg
! 	${RXGEN} -A -u -x -C -o $@ ${srcdir}/kauth.rg
  
  kauth.ss.c: kauth.rg
! 	${RXGEN} -A -x -S -o $@ ${srcdir}/kauth.rg
  
  kauth.xdr.c: kauth.rg
! 	${RXGEN} -A -x -c -o $@ ${srcdir}/kauth.rg
  
  kauth.h: kauth.rg
! 	${RXGEN} -A -u -x -h -o $@ ${srcdir}/kauth.rg
  
  kauth.xdr.c: kauth.h
  kauth.cs.c: kauth.h
  kauth.ss.c: kauth.h
  
  Kkauth.cs.c: kauth.rg Kkauth.h
! 	${RXGEN} -A -x -k -C -o Kkauth.cs.c ${srcdir}/kauth.rg
  
  Kkauth.xdr.c: kauth.rg
! 	${RXGEN} -A -x -k -c -o Kkauth.xdr.c ${srcdir}/kauth.rg
  
  Kkauth.h: kauth.rg
! 	${RXGEN} -A -x -k -h -o Kkauth.h ${srcdir}/kauth.rg
  
  libkauth.a: $(OBJS) AFS_component_version_number.o
  	-$(RM) -f $@
***************
*** 249,285 ****
  	${DESTDIR}${includedir}/afs/kaport.h
  
  ${DESTDIR}${afssrvlibexecdir}/kaserver: kaserver
! 	${INSTALL} -s $? $@
  
  ${DESTDIR}${sbindir}/kas: kas
! 	${INSTALL} -s $? $@
  
  ${DESTDIR}${sbindir}/kpwvalid: kpwvalid
  	${INSTALL} $? $@
  
  ${DESTDIR}${afssrvsbindir}/kas: kas
! 	${INSTALL} -s $? $@
  
  ${DESTDIR}${afssrvsbindir}/kpwvalid: kpwvalid
  	${INSTALL} $? $@
  
  ${DESTDIR}${bindir}/klog: klog
! 	${INSTALL} -s $? $@
  
  ${DESTDIR}${bindir}/klog.krb: klog.krb
! 	${INSTALL} -s $? $@
  
  ${DESTDIR}${afssrvbindir}/klog: klog
! 	${INSTALL} -s $? $@
  
  ${DESTDIR}${afssrvbindir}/klog.krb: klog.krb
! 	${INSTALL} -s $? $@
  
  ${DESTDIR}${bindir}/knfs: knfs
! 	${INSTALL} -s $? $@
  
  ${DESTDIR}${bindir}/kpasswd: kpasswd
! 	${INSTALL} -s $? $@
  
  ${DESTDIR}${bindir}/kpwvalid: kpwvalid
  	${INSTALL} $? $@
--- 249,285 ----
  	${DESTDIR}${includedir}/afs/kaport.h
  
  ${DESTDIR}${afssrvlibexecdir}/kaserver: kaserver
! 	${INSTALL} $? $@
  
  ${DESTDIR}${sbindir}/kas: kas
! 	${INSTALL} $? $@
  
  ${DESTDIR}${sbindir}/kpwvalid: kpwvalid
  	${INSTALL} $? $@
  
  ${DESTDIR}${afssrvsbindir}/kas: kas
! 	${INSTALL} $? $@
  
  ${DESTDIR}${afssrvsbindir}/kpwvalid: kpwvalid
  	${INSTALL} $? $@
  
  ${DESTDIR}${bindir}/klog: klog
! 	${INSTALL} $? $@
  
  ${DESTDIR}${bindir}/klog.krb: klog.krb
! 	${INSTALL} ${NO_STRIP_KRB} $? $@
  
  ${DESTDIR}${afssrvbindir}/klog: klog
! 	${INSTALL} $? $@
  
  ${DESTDIR}${afssrvbindir}/klog.krb: klog.krb
! 	${INSTALL} ${NO_STRIP_KRB} $? $@
  
  ${DESTDIR}${bindir}/knfs: knfs
! 	${INSTALL} $? $@
  
  ${DESTDIR}${bindir}/kpasswd: kpasswd
! 	${INSTALL} $? $@
  
  ${DESTDIR}${bindir}/kpwvalid: kpwvalid
  	${INSTALL} $? $@
***************
*** 294,300 ****
  	${INSTALL} -f $? $@
  
  ${DESTDIR}${afssrvsbindir}/kdb: kdb
! 	${INSTALL} -s $? $@
  
  ${DESTDIR}${afssrvsbindir}/ka-forwarder: ka-forwarder
  	${INSTALL} $? $@
--- 294,300 ----
  	${INSTALL} -f $? $@
  
  ${DESTDIR}${afssrvsbindir}/kdb: kdb
! 	${INSTALL} $? $@
  
  ${DESTDIR}${afssrvsbindir}/ka-forwarder: ka-forwarder
  	${INSTALL} $? $@
***************
*** 331,355 ****
  	${DEST}/include/afs/kaport.h
  
  ${DEST}/root.server/usr/afs/bin/kaserver: kaserver
! 	${INSTALL} -s $? $@
  
  ${DEST}/etc/kas ${DEST}/root.server/usr/afs/bin/kas: kas 
! 	${INSTALL} -s $? $@
  
  ${DEST}/bin/kpwvalid ${DEST}/etc/kpwvalid ${DEST}/root.server/usr/afs/bin/kpwvalid: kpwvalid 
  	${INSTALL} $? $@
  
  ${DEST}/bin/klog ${DEST}/root.server/usr/afs/bin/klog: klog 
! 	${INSTALL} -s $? $@
  
  ${DEST}/bin/klog.krb ${DEST}/root.server/usr/afs/bin/klog.krb: klog.krb 
! 	${INSTALL} -s $? $@
  
  ${DEST}/bin/knfs: knfs 
! 	${INSTALL} -s $? $@
  
  ${DEST}/bin/kpasswd: kpasswd 
! 	${INSTALL} -s $? $@
  
  ${DEST}/lib/afs/libkauth.a: libkauth.a 
  	${INSTALL} $? $@
--- 331,355 ----
  	${DEST}/include/afs/kaport.h
  
  ${DEST}/root.server/usr/afs/bin/kaserver: kaserver
! 	${INSTALL} $? $@
  
  ${DEST}/etc/kas ${DEST}/root.server/usr/afs/bin/kas: kas 
! 	${INSTALL} $? $@
  
  ${DEST}/bin/kpwvalid ${DEST}/etc/kpwvalid ${DEST}/root.server/usr/afs/bin/kpwvalid: kpwvalid 
  	${INSTALL} $? $@
  
  ${DEST}/bin/klog ${DEST}/root.server/usr/afs/bin/klog: klog 
! 	${INSTALL} $? $@
  
  ${DEST}/bin/klog.krb ${DEST}/root.server/usr/afs/bin/klog.krb: klog.krb 
! 	${INSTALL} ${NO_STRIP_KRB} $? $@
  
  ${DEST}/bin/knfs: knfs 
! 	${INSTALL} $? $@
  
  ${DEST}/bin/kpasswd: kpasswd 
! 	${INSTALL} $? $@
  
  ${DEST}/lib/afs/libkauth.a: libkauth.a 
  	${INSTALL} $? $@
***************
*** 361,367 ****
  	${INSTALL} -f $? $@
  
  ${DEST}/etc/kdb: kdb 
! 	${INSTALL} -s $? $@
  
  ${DEST}/root.server/usr/afs/bin/ka-forwarder: ka-forwarder
  	${INSTALL} $? $@
--- 361,367 ----
  	${INSTALL} -f $? $@
  
  ${DEST}/etc/kdb: kdb 
! 	${INSTALL} $? $@
  
  ${DEST}/root.server/usr/afs/bin/ka-forwarder: ka-forwarder
  	${INSTALL} $? $@
Index: openafs/src/kauth/admin_tools.c
diff -c openafs/src/kauth/admin_tools.c:1.16.2.4 openafs/src/kauth/admin_tools.c:1.16.2.5
*** openafs/src/kauth/admin_tools.c:1.16.2.4	Tue Apr 10 14:43:43 2007
--- openafs/src/kauth/admin_tools.c	Wed Oct 31 00:13:39 2007
***************
*** 16,22 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/admin_tools.c,v 1.16.2.4 2007/04/10 18:43:43 shadow Exp $");
  
  #include <afs/stds.h>
  #include <afs/debug.h>
--- 16,22 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/admin_tools.c,v 1.16.2.5 2007/10/31 04:13:39 shadow Exp $");
  
  #include <afs/stds.h>
  #include <afs/debug.h>
***************
*** 234,240 ****
  }
  
  int
! ListUsers(struct cmd_syndesc *as, char *arock)
  {
      struct kaident name;
      afs_int32 index;
--- 234,240 ----
  }
  
  int
! ListUsers(struct cmd_syndesc *as, void *arock)
  {
      struct kaident name;
      afs_int32 index;
***************
*** 273,279 ****
  
  
  int
! ExamineUser(struct cmd_syndesc *as, char *arock)
  {
      int showkey = (as->parms[1].items != NULL);
      return DumpUser(as->parms[0].items->data, arock, 0, showkey, NULL);
--- 273,279 ----
  
  
  int
! ExamineUser(struct cmd_syndesc *as, void *arock)
  {
      int showkey = (as->parms[1].items != NULL);
      return DumpUser(as->parms[0].items->data, arock, 0, showkey, NULL);
***************
*** 318,324 ****
  }
  
  int
! CreateUser(struct cmd_syndesc *as, char *arock)
  {
      int code;
      char name[MAXKTCNAMELEN];
--- 318,324 ----
  }
  
  int
! CreateUser(struct cmd_syndesc *as, void *arock)
  {
      int code;
      char name[MAXKTCNAMELEN];
***************
*** 348,354 ****
  }
  
  int
! DeleteUser(struct cmd_syndesc *as, char *arock)
  {
      int code;
      char name[MAXKTCNAMELEN];
--- 348,354 ----
  }
  
  int
! DeleteUser(struct cmd_syndesc *as, void *arock)
  {
      int code;
      char name[MAXKTCNAMELEN];
***************
*** 532,538 ****
  }
  
  int
! Unlock(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code, rcode = 0;
      afs_int32 count;
--- 532,538 ----
  }
  
  int
! Unlock(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code, rcode = 0;
      afs_int32 count;
***************
*** 573,579 ****
  }
  
  int
! SetFields(struct cmd_syndesc *as, char *arock)
  {
      int code;
      char name[MAXKTCNAMELEN];
--- 573,579 ----
  }
  
  int
! SetFields(struct cmd_syndesc *as, void *arock)
  {
      int code;
      char name[MAXKTCNAMELEN];
***************
*** 735,741 ****
  }
  
  int
! StringToKey(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      char realm[MAXKTCREALMLEN];
--- 735,741 ----
  }
  
  int
! StringToKey(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      char realm[MAXKTCREALMLEN];
***************
*** 772,778 ****
  }
  
  int
! SetPassword(struct cmd_syndesc *as, char *arock)
  {
      int code;
      char name[MAXKTCNAMELEN];
--- 772,778 ----
  }
  
  int
! SetPassword(struct cmd_syndesc *as, void *arock)
  {
      int code;
      char name[MAXKTCNAMELEN];
***************
*** 964,970 ****
  }
  
  static
! GetTicket(struct cmd_syndesc *as, char *arock)
  {
      int code;
      struct ktc_principal server;
--- 964,970 ----
  }
  
  static
! GetTicket(struct cmd_syndesc *as, void *arock)
  {
      int code;
      struct ktc_principal server;
***************
*** 1010,1016 ****
  }
  
  static
! GetPassword(struct cmd_syndesc *as, char *arock)
  {
      int code;
      char name[MAXKTCNAMELEN];
--- 1010,1016 ----
  }
  
  static
! GetPassword(struct cmd_syndesc *as, void *arock)
  {
      int code;
      char name[MAXKTCNAMELEN];
***************
*** 1062,1068 ****
  }
  
  int
! GetRandomKey(struct cmd_syndesc *as, char *arock)
  {
      int code;
      struct ktc_encryptionKey key;
--- 1062,1068 ----
  }
  
  int
! GetRandomKey(struct cmd_syndesc *as, void *arock)
  {
      int code;
      struct ktc_encryptionKey key;
***************
*** 1088,1094 ****
  }
  
  int
! Statistics(struct cmd_syndesc *as, char *arock)
  {
      int code;
      kasstats statics;
--- 1088,1094 ----
  }
  
  int
! Statistics(struct cmd_syndesc *as, void *arock)
  {
      int code;
      kasstats statics;
***************
*** 1141,1147 ****
  }
  
  int
! DebugInfo(struct cmd_syndesc *as, char *arock)
  {
      int code;
      struct ka_debugInfo info;
--- 1141,1147 ----
  }
  
  int
! DebugInfo(struct cmd_syndesc *as, void *arock)
  {
      int code;
      struct ka_debugInfo info;
***************
*** 1237,1257 ****
  }
  
  int
! Interactive(struct cmd_syndesc *as, char *arock)
  {
      finished = 0;
      return 0;
  }
  
  int
! Quit(struct cmd_syndesc *as, char *arock)
  {
      finished = 1;
      return 0;
  }
  
  int
! MyAfterProc(struct cmd_syndesc *as)
  {
      if (!strcmp(as->name, "help"))
  	return 0;
--- 1237,1257 ----
  }
  
  int
! Interactive(struct cmd_syndesc *as, void *arock)
  {
      finished = 0;
      return 0;
  }
  
  int
! Quit(struct cmd_syndesc *as, void *arock)
  {
      finished = 1;
      return 0;
  }
  
  int
! MyAfterProc(struct cmd_syndesc *as, void *arock)
  {
      if (!strcmp(as->name, "help"))
  	return 0;
***************
*** 1274,1287 ****
  afs_int32 serverList[MAXSERVERS];
  
  int
! NoAuth(struct cmd_syndesc *as, char *arock)
  {
      noauth = 1;
      return 0;
  }
  
  static int
! MyBeforeProc(struct cmd_syndesc *as, char *arock)
  {
      extern struct passwd *getpwuid();
      struct ktc_encryptionKey key;
--- 1274,1287 ----
  afs_int32 serverList[MAXSERVERS];
  
  int
! NoAuth(struct cmd_syndesc *as, void *arock)
  {
      noauth = 1;
      return 0;
  }
  
  static int
! MyBeforeProc(struct cmd_syndesc *as, void *arock)
  {
      extern struct passwd *getpwuid();
      struct ktc_encryptionKey key;
***************
*** 1539,1545 ****
  /* These are some helpful command that deal with the cache managers tokens. */
  
  static
! ForgetTicket(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
  
--- 1539,1545 ----
  /* These are some helpful command that deal with the cache managers tokens. */
  
  static
! ForgetTicket(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
  
***************
*** 1593,1599 ****
  }
  
  static
! ListTickets(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code = 0;
      int index, newIndex;
--- 1593,1599 ----
  }
  
  static
! ListTickets(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code = 0;
      int index, newIndex;
***************
*** 1666,1679 ****
      cmd_SetBeforeProc(MyBeforeProc, NULL);
      cmd_SetAfterProc(MyAfterProc, NULL);
  
!     ts = cmd_CreateSyntax("interactive", Interactive, 0,
  			  "enter interactive mode");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("noauthentication", NoAuth, 0,
  			  "connect to AuthServer w/o using token");
  
!     ts = cmd_CreateSyntax("list", ListUsers, 0, "list all users in database");
      cmd_AddParm(ts, "-long", CMD_FLAG, CMD_OPTIONAL,
  		"show detailed info about each user");
      cmd_AddParm(ts, "-showadmin", CMD_FLAG, CMD_OPTIONAL,
--- 1666,1680 ----
      cmd_SetBeforeProc(MyBeforeProc, NULL);
      cmd_SetAfterProc(MyAfterProc, NULL);
  
!     ts = cmd_CreateSyntax("interactive", Interactive, NULL,
  			  "enter interactive mode");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("noauthentication", NoAuth, NULL,
  			  "connect to AuthServer w/o using token");
  
!     ts = cmd_CreateSyntax("list", ListUsers, NULL, 
! 			  "list all users in database");
      cmd_AddParm(ts, "-long", CMD_FLAG, CMD_OPTIONAL,
  		"show detailed info about each user");
      cmd_AddParm(ts, "-showadmin", CMD_FLAG, CMD_OPTIONAL,
***************
*** 1683,1708 ****
      add_std_args(ts);
      cmd_CreateAlias(ts, "ls");
  
!     ts = cmd_CreateSyntax("examine", ExamineUser, 0,
  			  "examine the entry for a user");
      cmd_AddParm(ts, "-name", CMD_SINGLE, 0, "name of user");
      cmd_AddParm(ts, "-showkey", CMD_FLAG, CMD_OPTIONAL,
  		"show the user's actual key rather than the checksum");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("create", CreateUser, 0,
  			  "create an entry for a user");
      cmd_AddParm(ts, "-name", CMD_SINGLE, 0, "name of user");
      cmd_AddParm(ts, "-initial_password", CMD_SINGLE, CMD_OPTIONAL,
  		"initial password");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("delete", DeleteUser, 0, "delete a user");
      cmd_AddParm(ts, "-name", CMD_SINGLE, 0, "name of user");
      add_std_args(ts);
      cmd_CreateAlias(ts, "rm");
  
!     ts = cmd_CreateSyntax("setfields", SetFields, 0,
  			  "set various fields in a user's entry");
      cmd_AddParm(ts, "-name", CMD_SINGLE, 0, "name of user");
      cmd_AddParm(ts, "-flags", CMD_SINGLE, CMD_OPTIONAL,
--- 1684,1709 ----
      add_std_args(ts);
      cmd_CreateAlias(ts, "ls");
  
!     ts = cmd_CreateSyntax("examine", ExamineUser, NULL,
  			  "examine the entry for a user");
      cmd_AddParm(ts, "-name", CMD_SINGLE, 0, "name of user");
      cmd_AddParm(ts, "-showkey", CMD_FLAG, CMD_OPTIONAL,
  		"show the user's actual key rather than the checksum");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("create", CreateUser, NULL,
  			  "create an entry for a user");
      cmd_AddParm(ts, "-name", CMD_SINGLE, 0, "name of user");
      cmd_AddParm(ts, "-initial_password", CMD_SINGLE, CMD_OPTIONAL,
  		"initial password");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("delete", DeleteUser, NULL, "delete a user");
      cmd_AddParm(ts, "-name", CMD_SINGLE, 0, "name of user");
      add_std_args(ts);
      cmd_CreateAlias(ts, "rm");
  
!     ts = cmd_CreateSyntax("setfields", SetFields, NULL,
  			  "set various fields in a user's entry");
      cmd_AddParm(ts, "-name", CMD_SINGLE, 0, "name of user");
      cmd_AddParm(ts, "-flags", CMD_SINGLE, CMD_OPTIONAL,
***************
*** 1727,1744 ****
      cmd_CreateAlias(ts, "sf");
  
  
!     ts = cmd_CreateSyntax("unlock", Unlock, 0,
  			  "Enable authentication ID after max failed attempts exceeded");
      cmd_AddParm(ts, "-name", CMD_SINGLE, 0, "authentication ID");
      add_std_args(ts);
  
  
!     ts = cmd_CreateSyntax("stringtokey", StringToKey, 0,
  			  "convert a string to a key");
      cmd_AddParm(ts, "-string", CMD_SINGLE, 0, "password string");
      cmd_AddParm(ts, "-cell", CMD_SINGLE, CMD_OPTIONAL, "cell name");
  
!     ts = cmd_CreateSyntax("setpassword", SetPassword, 0,
  			  "set a user's password");
      cmd_AddParm(ts, "-name", CMD_SINGLE, 0, "name of user");
      cmd_AddParm(ts, "-new_password", CMD_SINGLE, CMD_OPTIONAL,
--- 1728,1745 ----
      cmd_CreateAlias(ts, "sf");
  
  
!     ts = cmd_CreateSyntax("unlock", Unlock, NULL,
  			  "Enable authentication ID after max failed attempts exceeded");
      cmd_AddParm(ts, "-name", CMD_SINGLE, 0, "authentication ID");
      add_std_args(ts);
  
  
!     ts = cmd_CreateSyntax("stringtokey", StringToKey, NULL,
  			  "convert a string to a key");
      cmd_AddParm(ts, "-string", CMD_SINGLE, 0, "password string");
      cmd_AddParm(ts, "-cell", CMD_SINGLE, CMD_OPTIONAL, "cell name");
  
!     ts = cmd_CreateSyntax("setpassword", SetPassword, NULL,
  			  "set a user's password");
      cmd_AddParm(ts, "-name", CMD_SINGLE, 0, "name of user");
      cmd_AddParm(ts, "-new_password", CMD_SINGLE, CMD_OPTIONAL,
***************
*** 1752,1758 ****
  #endif
  
      /* set a user's key */
!     ts = cmd_CreateSyntax("setkey", SetPassword, 0, (char *)CMD_HIDDEN);
      cmd_AddParm(ts, "-name", CMD_SINGLE, 0, "name of user");
      cmd_Seek(ts, 2);
      cmd_AddParm(ts, "-new_key", CMD_SINGLE, 0, "eight byte new key");
--- 1753,1759 ----
  #endif
  
      /* set a user's key */
!     ts = cmd_CreateSyntax("setkey", SetPassword, NULL, (char *)CMD_HIDDEN);
      cmd_AddParm(ts, "-name", CMD_SINGLE, 0, "name of user");
      cmd_Seek(ts, 2);
      cmd_AddParm(ts, "-new_key", CMD_SINGLE, 0, "eight byte new key");
***************
*** 1761,1767 ****
      add_std_args(ts);
  
      /* get a user's password */
!     ts = cmd_CreateSyntax("getpassword", GetPassword, 0, (char *)CMD_HIDDEN);
      cmd_AddParm(ts, "-name", CMD_SINGLE, 0, "name of user");
      /* don't take standard args */
      /* add_std_args (ts); */
--- 1762,1768 ----
      add_std_args(ts);
  
      /* get a user's password */
!     ts = cmd_CreateSyntax("getpassword", GetPassword, NULL, (char *)CMD_HIDDEN);
      cmd_AddParm(ts, "-name", CMD_SINGLE, 0, "name of user");
      /* don't take standard args */
      /* add_std_args (ts); */
***************
*** 1770,1796 ****
  #endif
  
      /* get a random key */
!     ts = cmd_CreateSyntax("getrandomkey", GetRandomKey, 0,
  			  (char *)CMD_HIDDEN);
      add_std_args(ts);
  
      /* get a ticket for a specific server */
!     ts = cmd_CreateSyntax("getticket", GetTicket, 0, (char *)CMD_HIDDEN);
      cmd_AddParm(ts, "-name", CMD_SINGLE, 0, "name of server");
      cmd_AddParm(ts, "-lifetime", CMD_SINGLE, CMD_OPTIONAL, "ticket lifetime");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("statistics", Statistics, 0,
  			  "show statistics for AuthServer");
      add_std_args(ts);
  
      /* show debugging info from AuthServer */
!     ts = cmd_CreateSyntax("debuginfo", DebugInfo, 0, (char *)CMD_HIDDEN);
      cmd_AddParm(ts, "-hostname", CMD_SINGLE, CMD_OPTIONAL,
  		"authentication server host name");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("forgetticket", ForgetTicket, 0,
  			  "delete user's tickets");
  #ifdef notdef
      cmd_AddParm(ts, "-name", CMD_SINGLE, (CMD_OPTIONAL | CMD_HIDE),
--- 1771,1797 ----
  #endif
  
      /* get a random key */
!     ts = cmd_CreateSyntax("getrandomkey", GetRandomKey, NULL,
  			  (char *)CMD_HIDDEN);
      add_std_args(ts);
  
      /* get a ticket for a specific server */
!     ts = cmd_CreateSyntax("getticket", GetTicket, NULL, (char *)CMD_HIDDEN);
      cmd_AddParm(ts, "-name", CMD_SINGLE, 0, "name of server");
      cmd_AddParm(ts, "-lifetime", CMD_SINGLE, CMD_OPTIONAL, "ticket lifetime");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("statistics", Statistics, NULL,
  			  "show statistics for AuthServer");
      add_std_args(ts);
  
      /* show debugging info from AuthServer */
!     ts = cmd_CreateSyntax("debuginfo", DebugInfo, NULL, (char *)CMD_HIDDEN);
      cmd_AddParm(ts, "-hostname", CMD_SINGLE, CMD_OPTIONAL,
  		"authentication server host name");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("forgetticket", ForgetTicket, NULL,
  			  "delete user's tickets");
  #ifdef notdef
      cmd_AddParm(ts, "-name", CMD_SINGLE, (CMD_OPTIONAL | CMD_HIDE),
***************
*** 1798,1810 ****
  #endif
      cmd_AddParm(ts, "-all", CMD_FLAG, CMD_OPTIONAL, "delete all tickets");
  
!     ts = cmd_CreateSyntax("listtickets", ListTickets, 0,
  			  "show all cache manager tickets");
      cmd_AddParm(ts, "-name", CMD_SINGLE, CMD_OPTIONAL, "name of server");
      cmd_AddParm(ts, "-long", CMD_FLAG, CMD_OPTIONAL,
  		"show session key and ticket");
  
!     ts = cmd_CreateSyntax("quit", Quit, 0, "exit program");
  
      finished = 1;
      conn = 0;			/* no connection yet */
--- 1799,1811 ----
  #endif
      cmd_AddParm(ts, "-all", CMD_FLAG, CMD_OPTIONAL, "delete all tickets");
  
!     ts = cmd_CreateSyntax("listtickets", ListTickets, NULL,
  			  "show all cache manager tickets");
      cmd_AddParm(ts, "-name", CMD_SINGLE, CMD_OPTIONAL, "name of server");
      cmd_AddParm(ts, "-long", CMD_FLAG, CMD_OPTIONAL,
  		"show session key and ticket");
  
!     ts = cmd_CreateSyntax("quit", Quit, NULL, "exit program");
  
      finished = 1;
      conn = 0;			/* no connection yet */
Index: openafs/src/kauth/authclient.c
diff -c openafs/src/kauth/authclient.c:1.14.2.6 openafs/src/kauth/authclient.c:1.14.2.8
*** openafs/src/kauth/authclient.c:1.14.2.6	Thu Sep 21 07:39:43 2006
--- openafs/src/kauth/authclient.c	Mon Nov 26 15:41:54 2007
***************
*** 17,23 ****
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/authclient.c,v 1.14.2.6 2006/09/21 11:39:43 shadow Exp $");
  
  #if defined(UKERNEL)
  #include "afs/sysincludes.h"
--- 17,23 ----
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/authclient.c,v 1.14.2.8 2007/11/26 20:41:54 shadow Exp $");
  
  #if defined(UKERNEL)
  #include "afs/sysincludes.h"
***************
*** 46,58 ****
  #include <sys/socket.h>
  #include <netinet/in.h>
  #endif
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <rx/rxkad.h>
  #include <afs/cellconfig.h>
  #include <ubik.h>
--- 46,52 ----
***************
*** 559,573 ****
  
      version = 2;
      code =
! 	kawrap_ubik_Call(KAA_AuthenticateV2, conn, 0, name, instance, start,
! 			 end, &arequest, &oanswer);
      if (code == RXGEN_OPCODE) {
  	oanswer.MaxSeqLen = sizeof(answer);
  	oanswer.SeqBody = (char *)&answer;
  	version = 1;
  	code =
  	    ubik_Call(KAA_Authenticate, conn, 0, name, instance, start, end,
! 		      &arequest, &oanswer);
  	if (code == RXGEN_OPCODE) {
  	    extern int KAA_Authenticate_old();
  	    oanswer.MaxSeqLen = sizeof(answer_old);
--- 553,567 ----
  
      version = 2;
      code =
! 	kawrap_ubik_Call(KAA_AuthenticateV2, conn, 0, name, instance,
! 			 start, end, &arequest, &oanswer, 0, 0);
      if (code == RXGEN_OPCODE) {
  	oanswer.MaxSeqLen = sizeof(answer);
  	oanswer.SeqBody = (char *)&answer;
  	version = 1;
  	code =
  	    ubik_Call(KAA_Authenticate, conn, 0, name, instance, start, end,
! 		      &arequest, &oanswer, 0, 0);
  	if (code == RXGEN_OPCODE) {
  	    extern int KAA_Authenticate_old();
  	    oanswer.MaxSeqLen = sizeof(answer_old);
Index: openafs/src/kauth/client.c
diff -c openafs/src/kauth/client.c:1.12.2.2 openafs/src/kauth/client.c:1.12.2.3
*** openafs/src/kauth/client.c:1.12.2.2	Mon Jul 11 15:29:38 2005
--- openafs/src/kauth/client.c	Tue Oct 30 11:23:53 2007
***************
*** 15,21 ****
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/client.c,v 1.12.2.2 2005/07/11 19:29:38 shadow Exp $");
  
  #if defined(UKERNEL)
  #ifdef HAVE_UNISTD_H
--- 15,21 ----
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/client.c,v 1.12.2.3 2007/10/30 15:23:53 shadow Exp $");
  
  #if defined(UKERNEL)
  #ifdef HAVE_UNISTD_H
***************
*** 41,53 ****
  #include <winsock2.h>
  #include <crypt.h>
  #endif
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #ifdef HAVE_UNISTD_H
  #define __USE_XOPEN
  #include <unistd.h>
--- 41,47 ----
Index: openafs/src/kauth/kaauxdb.c
diff -c openafs/src/kauth/kaauxdb.c:1.9 openafs/src/kauth/kaauxdb.c:1.9.2.1
*** openafs/src/kauth/kaauxdb.c:1.9	Sat Nov 22 23:53:35 2003
--- openafs/src/kauth/kaauxdb.c	Tue Oct 30 11:23:53 2007
***************
*** 15,21 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/kaauxdb.c,v 1.9 2003/11/23 04:53:35 jaltman Exp $");
  
  #ifdef AFS_NT40_ENV
  #include <io.h>
--- 15,21 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/kaauxdb.c,v 1.9.2.1 2007/10/30 15:23:53 shadow Exp $");
  
  #ifdef AFS_NT40_ENV
  #include <io.h>
***************
*** 25,37 ****
  #ifdef HAVE_FCNTL_H
  #include <fcntl.h>
  #endif
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <rx/rxkad.h>
  #include "ubik_int.h"
  #include "kauth.h"
--- 25,31 ----
Index: openafs/src/kauth/kadatabase.c
diff -c openafs/src/kauth/kadatabase.c:1.10.2.1 openafs/src/kauth/kadatabase.c:1.10.2.3
*** openafs/src/kauth/kadatabase.c:1.10.2.1	Wed Aug 25 03:09:38 2004
--- openafs/src/kauth/kadatabase.c	Mon Nov 26 16:21:52 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/kadatabase.c,v 1.10.2.1 2004/08/25 07:09:38 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/kadatabase.c,v 1.10.2.3 2007/11/26 21:21:52 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
***************
*** 19,32 ****
  #else
  #include <netinet/in.h>
  #endif
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
- #include <lock.h>
  #include <ubik.h>
  #include <rx/xdr.h>
  #include <rx/rx.h>
--- 19,25 ----
***************
*** 114,119 ****
--- 107,113 ----
  static afs_int32 maxKeyLifetime;
  static int dbfixup = 0;
  
+ void
  init_kadatabase(initFlags)
       int initFlags;		/* same as init_kaprocs (see which) */
  {
Index: openafs/src/kauth/kalocalcell.c
diff -c openafs/src/kauth/kalocalcell.c:1.8.2.1 openafs/src/kauth/kalocalcell.c:1.8.2.2
*** openafs/src/kauth/kalocalcell.c:1.8.2.1	Wed Aug 25 03:09:38 2004
--- openafs/src/kauth/kalocalcell.c	Tue Oct 30 11:23:53 2007
***************
*** 15,21 ****
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/kalocalcell.c,v 1.8.2.1 2004/08/25 07:09:38 shadow Exp $");
  
  #if defined(UKERNEL)
  #include "afs/pthread_glock.h"
--- 15,21 ----
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/kalocalcell.c,v 1.8.2.2 2007/10/30 15:23:53 shadow Exp $");
  
  #if defined(UKERNEL)
  #include "afs/pthread_glock.h"
***************
*** 37,49 ****
  #else
  #include <netinet/in.h>
  #endif
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <afs/cellconfig.h>
  #include <rx/xdr.h>
  #include <rx/rx.h>
--- 37,43 ----
Index: openafs/src/kauth/kalog.c
diff -c openafs/src/kauth/kalog.c:1.6 openafs/src/kauth/kalog.c:1.6.2.1
*** openafs/src/kauth/kalog.c:1.6	Tue Jul 15 19:15:16 2003
--- openafs/src/kauth/kalog.c	Tue Oct 30 11:23:53 2007
***************
*** 20,36 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/kalog.c,v 1.6 2003/07/15 23:15:16 shadow Exp $");
  
  #include <stdio.h>
  #include <afs/afsutil.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
--- 20,30 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/kalog.c,v 1.6.2.1 2007/10/30 15:23:53 shadow Exp $");
  
  #include <stdio.h>
  #include <afs/afsutil.h>
  #include <string.h>
  #ifdef HAVE_FCNTL_H
  #include <fcntl.h>
  #endif
Index: openafs/src/kauth/kas.c
diff -c openafs/src/kauth/kas.c:1.7.2.1 openafs/src/kauth/kas.c:1.7.2.2
*** openafs/src/kauth/kas.c:1.7.2.1	Tue Apr 10 14:43:43 2007
--- openafs/src/kauth/kas.c	Tue Oct 30 11:23:53 2007
***************
*** 12,18 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/kas.c,v 1.7.2.1 2007/04/10 18:43:43 shadow Exp $");
  
  #include <afs/stds.h>
  #ifdef	AFS_AIX32_ENV
--- 12,18 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/kas.c,v 1.7.2.2 2007/10/30 15:23:53 shadow Exp $");
  
  #include <afs/stds.h>
  #ifdef	AFS_AIX32_ENV
***************
*** 29,41 ****
  #else
  #include <WINNT/afsevent.h>
  #endif
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <afs/cellconfig.h>
  #include <afs/com_err.h>
  
--- 29,35 ----
Index: openafs/src/kauth/kaserver.c
diff -c openafs/src/kauth/kaserver.c:1.17.2.6 openafs/src/kauth/kaserver.c:1.17.2.8
*** openafs/src/kauth/kaserver.c:1.17.2.6	Tue Apr 10 14:43:43 2007
--- openafs/src/kauth/kaserver.c	Mon Mar 10 18:35:35 2008
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/kaserver.c,v 1.17.2.6 2007/04/10 18:43:43 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/kaserver.c,v 1.17.2.8 2008/03/10 22:35:35 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 26,38 ****
  #include "kalog.h"		/* for OpenLog() */
  #include <time.h>
  #include <stdio.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
--- 26,32 ----
***************
*** 497,502 ****
      }
  
      ViceLog(0, ("Starting to process AuthServer requests\n"));
!     rx_ServerProc();		/* donate this LWP */
      return 0;
  }
--- 491,496 ----
      }
  
      ViceLog(0, ("Starting to process AuthServer requests\n"));
!     rx_ServerProc(NULL);		/* donate this LWP */
      return 0;
  }
Index: openafs/src/kauth/kautils.c
diff -c openafs/src/kauth/kautils.c:1.9 openafs/src/kauth/kautils.c:1.9.2.1
*** openafs/src/kauth/kautils.c:1.9	Tue Jul 15 19:15:16 2003
--- openafs/src/kauth/kautils.c	Tue Oct 30 11:23:54 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/kautils.c,v 1.9 2003/07/15 23:15:16 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/kautils.c,v 1.9.2.1 2007/10/30 15:23:54 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 22,34 ****
  #include <netinet/in.h>
  #include <sys/file.h>
  #endif
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <time.h>
  #include <stdio.h>
  #include <ctype.h>
--- 22,28 ----
Index: openafs/src/kauth/kdb.c
diff -c openafs/src/kauth/kdb.c:1.7.2.1 openafs/src/kauth/kdb.c:1.7.2.3
*** openafs/src/kauth/kdb.c:1.7.2.1	Wed Aug 25 03:18:06 2004
--- openafs/src/kauth/kdb.c	Mon Nov 26 16:21:52 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/kdb.c,v 1.7.2.1 2004/08/25 07:18:06 shadow Exp $");
  
  #include <fcntl.h>
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/kdb.c,v 1.7.2.3 2007/11/26 21:21:52 shadow Exp $");
  
  #include <fcntl.h>
  #include <sys/types.h>
***************
*** 29,36 ****
  
  char *dbmfile;
  
! static
! cmdproc(register struct cmd_syndesc *as, afs_int32 arock)
  {
      DBM *kdb;
      datum key, data;
--- 29,36 ----
  
  char *dbmfile;
  
! static int
! cmdproc(register struct cmd_syndesc *as, void * arock)
  {
      DBM *kdb;
      datum key, data;
***************
*** 96,101 ****
--- 96,102 ----
  	}
      }
      dbm_close(kdb);
+     return 0;
  }
  
  
***************
*** 111,117 ****
      sprintf(dbmfile_help, "dbmfile to use (default %s)",
  	    AFSDIR_SERVER_KALOGDB_FILEPATH);
      dbmfile = AFSDIR_SERVER_KALOGDB_FILEPATH;
!     ts = cmd_CreateSyntax(NULL, cmdproc, 0, "Dump contents of dbm database");
      cmd_AddParm(ts, "-dbmfile", CMD_SINGLE, CMD_OPTIONAL, dbmfile_help);
      cmd_AddParm(ts, "-key", CMD_SINGLE, CMD_OPTIONAL,
  		"extract entries that match specified key");
--- 112,118 ----
      sprintf(dbmfile_help, "dbmfile to use (default %s)",
  	    AFSDIR_SERVER_KALOGDB_FILEPATH);
      dbmfile = AFSDIR_SERVER_KALOGDB_FILEPATH;
!     ts = cmd_CreateSyntax(NULL, cmdproc, NULL, "Dump contents of dbm database");
      cmd_AddParm(ts, "-dbmfile", CMD_SINGLE, CMD_OPTIONAL, dbmfile_help);
      cmd_AddParm(ts, "-key", CMD_SINGLE, CMD_OPTIONAL,
  		"extract entries that match specified key");
***************
*** 128,132 ****
--- 129,134 ----
  main(void)
  {
      printf("kdb not supported\n");
+     return 1;
  }
  #endif
Index: openafs/src/kauth/kkids.c
diff -c openafs/src/kauth/kkids.c:1.6 openafs/src/kauth/kkids.c:1.6.2.1
*** openafs/src/kauth/kkids.c:1.6	Tue Jul 15 19:15:16 2003
--- openafs/src/kauth/kkids.c	Mon Nov 26 16:21:52 2007
***************
*** 16,22 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/kkids.c,v 1.6 2003/07/15 23:15:16 shadow Exp $");
  
  #include <stdio.h>
  #include <sys/types.h>
--- 16,22 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/kkids.c,v 1.6.2.1 2007/11/26 21:21:52 shadow Exp $");
  
  #include <stdio.h>
  #include <sys/types.h>
***************
*** 422,427 ****
--- 422,428 ----
  	argv[1] = NULL;
  	argv[0] = dirpath;
  	execv(dirpath, argv);
+ 	return 0;
      } else {
  	using_child = pid;	/* save it for later */
  	childin = fdopen(pipe1[1], "w");
Index: openafs/src/kauth/klog.c
diff -c openafs/src/kauth/klog.c:1.8.2.1 openafs/src/kauth/klog.c:1.8.2.3
*** openafs/src/kauth/klog.c:1.8.2.1	Tue Apr 10 14:43:43 2007
--- openafs/src/kauth/klog.c	Wed Oct 31 00:13:39 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/klog.c,v 1.8.2.1 2007/04/10 18:43:43 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/klog.c,v 1.8.2.3 2007/10/31 04:13:39 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 19,32 ****
  #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 <lock.h>
  #include <ubik.h>
  
--- 19,25 ----
***************
*** 71,77 ****
  #define KLOGEXIT(code) assert(!code || code >= KAMINERROR); \
                         rx_Finalize(); \
                         (!code ? exit(0) : exit((code)-KAMINERROR+1))
! extern int CommandProc(struct cmd_syndesc *as, char *arock);
  
  static int zero_argc;
  static char **zero_argv;
--- 64,70 ----
  #define KLOGEXIT(code) assert(!code || code >= KAMINERROR); \
                         rx_Finalize(); \
                         (!code ? exit(0) : exit((code)-KAMINERROR+1))
! int CommandProc(struct cmd_syndesc *as, void *arock);
  
  static int zero_argc;
  static char **zero_argv;
***************
*** 105,111 ****
      zero_argc = argc;
      zero_argv = argv;
  
!     ts = cmd_CreateSyntax(NULL, CommandProc, 0,
  			  "obtain Kerberos authentication");
  
  #define aXFLAG 0
--- 98,104 ----
      zero_argc = argc;
      zero_argv = argv;
  
!     ts = cmd_CreateSyntax(NULL, CommandProc, NULL,
  			  "obtain Kerberos authentication");
  
  #define aXFLAG 0
***************
*** 158,164 ****
  }
  
  int
! CommandProc(struct cmd_syndesc *as, char *arock)
  {
      char name[MAXKTCNAMELEN];
      char instance[MAXKTCNAMELEN];
--- 151,157 ----
  }
  
  int
! CommandProc(struct cmd_syndesc *as, void *arock)
  {
      char name[MAXKTCNAMELEN];
      char instance[MAXKTCNAMELEN];
Index: openafs/src/kauth/knfs.c
diff -c openafs/src/kauth/knfs.c:1.8 openafs/src/kauth/knfs.c:1.8.2.2
*** openafs/src/kauth/knfs.c:1.8	Tue Jul 15 19:15:16 2003
--- openafs/src/kauth/knfs.c	Wed Oct 31 00:13:39 2007
***************
*** 15,21 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/knfs.c,v 1.8 2003/07/15 23:15:16 shadow Exp $");
  
  #include <stdio.h>
  #include <afs/stds.h>
--- 15,21 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/knfs.c,v 1.8.2.2 2007/10/31 04:13:39 shadow Exp $");
  
  #include <stdio.h>
  #include <afs/stds.h>
***************
*** 27,47 ****
  #include <netdb.h>
  #include <errno.h>
  #include <sys/ioctl.h>
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <afs/vice.h>
  #include <afs/cmd.h>
  #include <afs/auth.h>
  #include <afs/afsutil.h>
  
- 
- extern struct cmd_syndesc *cmd_CreateSyntax();
- 
  /*
  Modifications:
  
--- 27,38 ----
***************
*** 358,367 ****
      return code;
  }
  
! static
! cmdproc(as, arock)
!      register struct cmd_syndesc *as;
!      afs_int32 arock;
  {
      register struct hostent *the;
      char *tp, *sysname = 0;
--- 349,356 ----
      return code;
  }
  
! static int
! cmdproc(register struct cmd_syndesc *as, void *arock)
  {
      register struct hostent *the;
      char *tp, *sysname = 0;
***************
*** 469,475 ****
      sigaction(SIGSEGV, &nsa, NULL);
  #endif
  
!     ts = cmd_CreateSyntax(NULL, cmdproc, 0, "copy tickets for NFS");
      cmd_AddParm(ts, "-host", CMD_SINGLE, CMD_REQUIRED, "host name");
      cmd_AddParm(ts, "-id", CMD_SINGLE, CMD_OPTIONAL, "user ID (decimal)");
      cmd_AddParm(ts, "-sysname", CMD_SINGLE, CMD_OPTIONAL,
--- 458,464 ----
      sigaction(SIGSEGV, &nsa, NULL);
  #endif
  
!     ts = cmd_CreateSyntax(NULL, cmdproc, NULL, "copy tickets for NFS");
      cmd_AddParm(ts, "-host", CMD_SINGLE, CMD_REQUIRED, "host name");
      cmd_AddParm(ts, "-id", CMD_SINGLE, CMD_OPTIONAL, "user ID (decimal)");
      cmd_AddParm(ts, "-sysname", CMD_SINGLE, CMD_OPTIONAL,
Index: openafs/src/kauth/kpasswd.c
diff -c openafs/src/kauth/kpasswd.c:1.14.2.2 openafs/src/kauth/kpasswd.c:1.14.2.4
*** openafs/src/kauth/kpasswd.c:1.14.2.2	Tue Apr 10 14:43:43 2007
--- openafs/src/kauth/kpasswd.c	Wed Oct 31 00:13:39 2007
***************
*** 12,18 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/kpasswd.c,v 1.14.2.2 2007/04/10 18:43:43 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 12,18 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/kpasswd.c,v 1.14.2.4 2007/10/31 04:13:39 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 29,41 ****
  #ifndef AFS_NT40_ENV
  #include <pwd.h>
  #endif
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <signal.h>
  #include <afs/com_err.h>
  #include <afs/auth.h>
--- 29,35 ----
***************
*** 79,85 ****
  
  /* The following code to make use of libcmd.a also stolen from klog.c. */
  
! int CommandProc();
  
  static int zero_argc;
  static char **zero_argv;
--- 73,79 ----
  
  /* The following code to make use of libcmd.a also stolen from klog.c. */
  
! int CommandProc(struct cmd_syndesc *, void *);
  
  static int zero_argc;
  static char **zero_argv;
***************
*** 207,215 ****
  #endif
  
  char passwd[BUFSIZ], npasswd[BUFSIZ], verify[BUFSIZ];
! CommandProc(as, arock)
!      char *arock;
!      struct cmd_syndesc *as;
  {
      char name[MAXKTCNAMELEN] = "";
      char instance[MAXKTCNAMELEN] = "";
--- 201,207 ----
  #endif
  
  char passwd[BUFSIZ], npasswd[BUFSIZ], verify[BUFSIZ];
! CommandProc(struct cmd_syndesc *as, void *arock)
  {
      char name[MAXKTCNAMELEN] = "";
      char instance[MAXKTCNAMELEN] = "";
Index: openafs/src/kauth/kpwvalid.c
diff -c openafs/src/kauth/kpwvalid.c:1.6 openafs/src/kauth/kpwvalid.c:1.6.2.2
*** openafs/src/kauth/kpwvalid.c:1.6	Tue Jul 15 19:15:17 2003
--- openafs/src/kauth/kpwvalid.c	Mon Nov 26 16:21:52 2007
***************
*** 11,26 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/kpwvalid.c,v 1.6 2003/07/15 23:15:17 shadow Exp $");
  
  #include <stdio.h>
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #ifdef AFS_NT40_ENV
  #include <WINNT/afsevent.h>
  #endif
--- 11,20 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/kpwvalid.c,v 1.6.2.2 2007/11/26 21:21:52 shadow Exp $");
  
  #include <stdio.h>
  #include <string.h>
  #ifdef AFS_NT40_ENV
  #include <WINNT/afsevent.h>
  #endif
***************
*** 49,52 ****
--- 43,47 ----
  		fflush(stdout);
  	    }
  	}
+     return rc;
  }
Index: openafs/src/kauth/krb_tf.c
diff -c openafs/src/kauth/krb_tf.c:1.6.2.2 openafs/src/kauth/krb_tf.c:1.6.2.3
*** openafs/src/kauth/krb_tf.c:1.6.2.2	Mon Aug 20 13:29:25 2007
--- openafs/src/kauth/krb_tf.c	Tue Oct 30 11:23:54 2007
***************
*** 48,54 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/krb_tf.c,v 1.6.2.2 2007/08/20 17:29:25 shadow Exp $");
  
  #ifdef HAVE_FCNTL_H
  #include <fcntl.h>
--- 48,54 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/krb_tf.c,v 1.6.2.3 2007/10/30 15:23:54 shadow Exp $");
  
  #ifdef HAVE_FCNTL_H
  #include <fcntl.h>
***************
*** 58,70 ****
  #else
  #include <sys/file.h>
  #endif
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <sys/types.h>
  #include <rx/xdr.h>
  #include <errno.h>
--- 58,64 ----
Index: openafs/src/kauth/krb_udp.c
diff -c openafs/src/kauth/krb_udp.c:1.23.2.1 openafs/src/kauth/krb_udp.c:1.23.2.5
*** openafs/src/kauth/krb_udp.c:1.23.2.1	Tue Apr 10 14:43:43 2007
--- openafs/src/kauth/krb_udp.c	Mon Mar 10 18:35:35 2008
***************
*** 16,22 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/krb_udp.c,v 1.23.2.1 2007/04/10 18:43:43 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 16,22 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/krb_udp.c,v 1.23.2.5 2008/03/10 22:35:35 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 30,42 ****
  #include <netdb.h>
  #include <netinet/in.h>
  #endif
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <afs/afsutil.h>
  #include <time.h>
  #include <afs/com_err.h>
--- 30,36 ----
***************
*** 66,71 ****
--- 60,68 ----
  #define	KDC_GEN_ERR	20
  #endif
  
+ #ifndef AFS_NT40_ENV
+ #define closesocket close
+ #endif
  
  int krb_udp_debug = 0;
  
***************
*** 107,114 ****
  
  int fiveminutes = 300;
  
! static
! FiveMinuteCheckLWP()
  {
  
      printf("start 5 min check lwp\n");
--- 104,111 ----
  
  int fiveminutes = 300;
  
! static void *
! FiveMinuteCheckLWP(void *unused)
  {
  
      printf("start 5 min check lwp\n");
***************
*** 118,123 ****
--- 115,121 ----
  	/* close the log so it can be removed */
  	ReOpenLog(AFSDIR_SERVER_KALOG_FILEPATH);	/* no trunc, just append */
      }
+     return NULL;
  }
  
  
***************
*** 823,830 ****
      return;
  }
  
! static
! SocketListener()
  {
      fd_set rfds;
      struct timeval tv;
--- 821,828 ----
      return;
  }
  
! static void *
! SocketListener(void *unused)
  {
      fd_set rfds;
      struct timeval tv;
***************
*** 898,911 ****
  	}
      }
      if (sock_kerb >= 0) {
! 	close(sock_kerb);
  	sock_kerb = -1;
      }
      if (sock_kerb5 >= 0) {
! 	close(sock_kerb5);
  	sock_kerb5 = -1;
      }
      printf("UDP SocketListener exiting due to error\n");
  }
  
  #if MAIN
--- 896,911 ----
  	}
      }
      if (sock_kerb >= 0) {
! 	closesocket(sock_kerb);
  	sock_kerb = -1;
      }
      if (sock_kerb5 >= 0) {
! 	closesocket(sock_kerb5);
  	sock_kerb5 = -1;
      }
      printf("UDP SocketListener exiting due to error\n");
+ 
+     return NULL;
  }
  
  #if MAIN
Index: openafs/src/kauth/manyklog.c
diff -c openafs/src/kauth/manyklog.c:1.7.2.1 openafs/src/kauth/manyklog.c:1.7.2.2
*** openafs/src/kauth/manyklog.c:1.7.2.1	Tue Apr 10 14:43:43 2007
--- openafs/src/kauth/manyklog.c	Wed Oct 31 00:13:39 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/manyklog.c,v 1.7.2.1 2007/04/10 18:43:43 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/manyklog.c,v 1.7.2.2 2007/10/31 04:13:39 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 63,69 ****
  #define KLOGEXIT(code) assert(!code || code >= KAMINERROR); \
                         rx_Finalize(); \
                         (!code ? exit(0) : exit((code)-KAMINERROR+1))
! int CommandProc();
  
  static int zero_argc;
  static char **zero_argv;
--- 63,69 ----
  #define KLOGEXIT(code) assert(!code || code >= KAMINERROR); \
                         rx_Finalize(); \
                         (!code ? exit(0) : exit((code)-KAMINERROR+1))
! static int CommandProc(struct cmd_syndesc *, void *);
  
  static int zero_argc;
  static char **zero_argv;
***************
*** 97,103 ****
      zero_argc = argc;
      zero_argv = argv;
  
!     ts = cmd_CreateSyntax(NULL, CommandProc, 0,
  			  "obtain Kerberos authentication");
  
  #define aXFLAG 0
--- 97,103 ----
      zero_argc = argc;
      zero_argv = argv;
  
!     ts = cmd_CreateSyntax(NULL, CommandProc, NULL,
  			  "obtain Kerberos authentication");
  
  #define aXFLAG 0
***************
*** 152,160 ****
      return gpbuf;
  }
  
! CommandProc(as, arock)
!      char *arock;
!      struct cmd_syndesc *as;
  {
      char name[MAXKTCNAMELEN];
      char instance[MAXKTCNAMELEN];
--- 152,159 ----
      return gpbuf;
  }
  
! static int
! CommandProc(struct cmd_syndesc *as, void *arock)
  {
      char name[MAXKTCNAMELEN];
      char instance[MAXKTCNAMELEN];
Index: openafs/src/kauth/read_passwd.c
diff -c openafs/src/kauth/read_passwd.c:1.6 openafs/src/kauth/read_passwd.c:1.6.2.1
*** openafs/src/kauth/read_passwd.c:1.6	Tue Jul 15 19:15:17 2003
--- openafs/src/kauth/read_passwd.c	Tue Oct 30 11:23:54 2007
***************
*** 14,20 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/read_passwd.c,v 1.6 2003/07/15 23:15:17 shadow Exp $");
  
  #include <mit-cpyright.h>
  #include <des.h>
--- 14,20 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/read_passwd.c,v 1.6.2.1 2007/10/30 15:23:54 shadow Exp $");
  
  #include <mit-cpyright.h>
  #include <des.h>
***************
*** 35,48 ****
  #if defined(AFS_SGI_ENV)
  #include <signal.h>
  #endif
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
- 
  
  #if	defined	(AFS_AIX_ENV) || defined(AFS_SGI_ENV)
  /* Just temp till we figure out the aix stuff */
--- 35,41 ----
Index: openafs/src/kauth/rebuild.c
diff -c openafs/src/kauth/rebuild.c:1.11.2.2 openafs/src/kauth/rebuild.c:1.11.2.5
*** openafs/src/kauth/rebuild.c:1.11.2.2	Tue Apr 10 14:43:43 2007
--- openafs/src/kauth/rebuild.c	Mon Nov 26 16:21:52 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/rebuild.c,v 1.11.2.2 2007/04/10 18:43:43 shadow Exp $");
  
  #include <sys/types.h>
  #include <sys/stat.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/rebuild.c,v 1.11.2.5 2007/11/26 21:21:52 shadow Exp $");
  
  #include <sys/types.h>
  #include <sys/stat.h>
***************
*** 23,35 ****
  #include <sys/file.h>
  #include <netinet/in.h>
  #endif
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <stdio.h>
  #include <errno.h>
  #include <time.h>
--- 23,29 ----
***************
*** 220,225 ****
--- 214,220 ----
  }
  
  /* ntohEntry - convert back to host-order */
+ void
  ntohEntry(struct kaentry *entryp)
  {
      entryp->flags = ntohl(entryp->flags);
***************
*** 399,411 ****
  	afs_com_err(whoami, errno, "reading db got %d bytes", code);
  	exit(3);
      }
  }
  
  #include "AFS_component_version_number.c"
  
! WorkerBee(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
  {
      afs_int32 code;
      char *dbFile;
--- 394,406 ----
  	afs_com_err(whoami, errno, "reading db got %d bytes", code);
  	exit(3);
      }
+     return 0;
  }
  
  #include "AFS_component_version_number.c"
  
! static int
! WorkerBee(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      char *dbFile;
Index: openafs/src/kauth/token.c
diff -c openafs/src/kauth/token.c:1.9.2.1 openafs/src/kauth/token.c:1.9.2.2
*** openafs/src/kauth/token.c:1.9.2.1	Wed Aug 25 03:09:38 2004
--- openafs/src/kauth/token.c	Tue Oct 30 11:23:54 2007
***************
*** 19,25 ****
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/token.c,v 1.9.2.1 2004/08/25 07:09:38 shadow Exp $");
  
  #if defined(UKERNEL)
  #include "afs/sysincludes.h"
--- 19,25 ----
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/token.c,v 1.9.2.2 2007/10/30 15:23:54 shadow Exp $");
  
  #if defined(UKERNEL)
  #include "afs/sysincludes.h"
***************
*** 44,56 ****
  #include <sys/socket.h>
  #include <netinet/in.h>
  #endif
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  /* netinet/in.h and cellconfig.h  are needed together */
  #include <afs/cellconfig.h>
      /* these are needed together */
--- 44,50 ----
Index: openafs/src/kauth/user.c
diff -c openafs/src/kauth/user.c:1.11.2.2 openafs/src/kauth/user.c:1.11.2.3
*** openafs/src/kauth/user.c:1.11.2.2	Tue Apr 10 14:43:43 2007
--- openafs/src/kauth/user.c	Tue Oct 30 11:23:54 2007
***************
*** 18,24 ****
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/user.c,v 1.11.2.2 2007/04/10 18:43:43 shadow Exp $");
  
  #if defined(UKERNEL)
  #include "afs/sysincludes.h"
--- 18,24 ----
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/user.c,v 1.11.2.3 2007/10/30 15:23:54 shadow Exp $");
  
  #if defined(UKERNEL)
  #include "afs/sysincludes.h"
***************
*** 45,57 ****
  #else
  #include <netinet/in.h>
  #endif
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <afs/cellconfig.h>
  #include <afs/auth.h>
  #include <afs/ptint.h>
--- 45,51 ----
Index: openafs/src/kauth/test/multiklog.c
diff -c openafs/src/kauth/test/multiklog.c:1.7.2.1 openafs/src/kauth/test/multiklog.c:1.7.2.2
*** openafs/src/kauth/test/multiklog.c:1.7.2.1	Tue Apr 10 14:43:43 2007
--- openafs/src/kauth/test/multiklog.c	Wed Oct 31 00:13:40 2007
***************
*** 18,24 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/test/multiklog.c,v 1.7.2.1 2007/04/10 18:43:43 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 18,24 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/test/multiklog.c,v 1.7.2.2 2007/10/31 04:13:40 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 53,59 ****
         -repeat is the number of times to iterate over the authentication
   */
  
! int CommandProc();
  
  static int zero_argc;
  static char **zero_argv;
--- 53,59 ----
         -repeat is the number of times to iterate over the authentication
   */
  
! static int CommandProc(struct cmd_syndesc *, void *);
  
  static int zero_argc;
  static char **zero_argv;
***************
*** 76,82 ****
      zero_argc = argc;
      zero_argv = argv;
  
!     ts = cmd_CreateSyntax(NULL, CommandProc, 0,
  			  "obtain Kerberos authentication");
  
  #define aXFLAG 0
--- 76,82 ----
      zero_argc = argc;
      zero_argv = argv;
  
!     ts = cmd_CreateSyntax(NULL, CommandProc, NULL,
  			  "obtain Kerberos authentication");
  
  #define aXFLAG 0
***************
*** 129,137 ****
      return gpbuf;
  }
  
! CommandProc(as, arock)
!      char *arock;
!      struct cmd_syndesc *as;
  {
      char name[MAXKTCNAMELEN];
      char instance[MAXKTCNAMELEN];
--- 129,136 ----
      return gpbuf;
  }
  
! static int
! CommandProc(struct cmd_syndesc *as, void *arock)
  {
      char name[MAXKTCNAMELEN];
      char instance[MAXKTCNAMELEN];
Index: openafs/src/kauth/test/test_getticket.c
diff -c openafs/src/kauth/test/test_getticket.c:1.7.2.2 openafs/src/kauth/test/test_getticket.c:1.7.2.3
*** openafs/src/kauth/test/test_getticket.c:1.7.2.2	Tue Apr 10 14:43:43 2007
--- openafs/src/kauth/test/test_getticket.c	Wed Oct 31 00:13:40 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/test/test_getticket.c,v 1.7.2.2 2007/04/10 18:43:43 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/test/test_getticket.c,v 1.7.2.3 2007/10/31 04:13:40 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 207,218 ****
      CheckLife(t.endTime, t.startTime, expectedLife, match);
  }
  
! static long
! Main(as, arock)
!      IN struct cmd_syndesc *as;
!      IN char *arock;
  {
!     long code;
      char name[MAXKTCNAMELEN];
      char instance[MAXKTCNAMELEN];
      char newCell[MAXKTCREALMLEN];
--- 207,216 ----
      CheckLife(t.endTime, t.startTime, expectedLife, match);
  }
  
! static int
! Main(struct cmd_syndesc *as, void *arock)
  {
!     int code;
      char name[MAXKTCNAMELEN];
      char instance[MAXKTCNAMELEN];
      char newCell[MAXKTCREALMLEN];
***************
*** 510,516 ****
      initialize_ACFG_error_table();
      initialize_KA_error_table();
  
!     ts = cmd_CreateSyntax(0, Main, 0, "Main program");
      /* 0 */ cmd_AddParm(ts, "-patient", CMD_FLAG, CMD_OPTIONAL,
  			"wait for TGS ticket to age");
      cmd_Seek(ts, 12);
--- 508,514 ----
      initialize_ACFG_error_table();
      initialize_KA_error_table();
  
!     ts = cmd_CreateSyntax(NULL, Main, NULL, "Main program");
      /* 0 */ cmd_AddParm(ts, "-patient", CMD_FLAG, CMD_OPTIONAL,
  			"wait for TGS ticket to age");
      cmd_Seek(ts, 12);
Index: openafs/src/kauth/test/test_rxkad_free.c
diff -c openafs/src/kauth/test/test_rxkad_free.c:1.7.2.2 openafs/src/kauth/test/test_rxkad_free.c:1.7.2.3
*** openafs/src/kauth/test/test_rxkad_free.c:1.7.2.2	Tue Apr 10 14:43:43 2007
--- openafs/src/kauth/test/test_rxkad_free.c	Wed Oct 31 00:13:40 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/test/test_rxkad_free.c,v 1.7.2.2 2007/04/10 18:43:43 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/test/test_rxkad_free.c,v 1.7.2.3 2007/10/31 04:13:40 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 52,63 ****
  	   rxkad_stats.destroyUnauth);
  }
  
! static long
! Main(as, arock)
!      IN struct cmd_syndesc *as;
!      IN char *arock;
  {
!     long code;
      char name[MAXKTCNAMELEN];
      char instance[MAXKTCNAMELEN];
      char newCell[MAXKTCREALMLEN];
--- 52,61 ----
  	   rxkad_stats.destroyUnauth);
  }
  
! static int
! Main(struct cmd_syndesc *as, void *arock)
  {
!     int code;
      char name[MAXKTCNAMELEN];
      char instance[MAXKTCNAMELEN];
      char newCell[MAXKTCREALMLEN];
***************
*** 373,379 ****
      initialize_ACFG_error_table();
      initialize_KA_error_table();
  
!     ts = cmd_CreateSyntax(0, Main, 0, "Main program");
      /* 0 */ cmd_AddParm(ts, "-number", CMD_SINGLE, CMD_OPTIONAL,
  			"number of iterations");
      /* 1 */ cmd_AddParm(ts, "-long", CMD_FLAG, CMD_OPTIONAL,
--- 371,377 ----
      initialize_ACFG_error_table();
      initialize_KA_error_table();
  
!     ts = cmd_CreateSyntax(NULL, Main, NULL, "Main program");
      /* 0 */ cmd_AddParm(ts, "-number", CMD_SINGLE, CMD_OPTIONAL,
  			"number of iterations");
      /* 1 */ cmd_AddParm(ts, "-long", CMD_FLAG, CMD_OPTIONAL,
Index: openafs/src/libacl/aclprocs.c
diff -c openafs/src/libacl/aclprocs.c:1.13 openafs/src/libacl/aclprocs.c:1.13.2.1
*** openafs/src/libacl/aclprocs.c:1.13	Sun Apr 18 02:13:49 2004
--- openafs/src/libacl/aclprocs.c	Tue Oct 30 11:23:54 2007
***************
*** 17,23 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libacl/aclprocs.c,v 1.13 2004/04/18 06:13:49 kolya Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
--- 17,23 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libacl/aclprocs.c,v 1.13.2.1 2007/10/30 15:23:54 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
***************
*** 25,33 ****
  #else
  #include <netinet/in.h>
  #endif
- #ifdef HAVE_STRING_H
  #include <string.h>
- #endif
  #include <rx/xdr.h>
  #include <rx/rx.h>
  #include <afs/ptclient.h>
--- 25,31 ----
Index: openafs/src/libadmin/bos/Makefile.in
diff -c openafs/src/libadmin/bos/Makefile.in:1.7 openafs/src/libadmin/bos/Makefile.in:1.7.2.1
*** openafs/src/libadmin/bos/Makefile.in:1.7	Sat Jan 11 02:34:29 2003
--- openafs/src/libadmin/bos/Makefile.in	Mon Jan 21 13:40:11 2008
***************
*** 12,18 ****
  CFLAGS=${COMMON_CFLAGS} ${MT_CFLAGS}
  CCRULE = ${CC} ${CFLAGS} -c $?
  
! BOZO = ../../bozo/
  
  ADMINOBJS = afs_bosAdmin.o
  
--- 12,18 ----
  CFLAGS=${COMMON_CFLAGS} ${MT_CFLAGS}
  CCRULE = ${CC} ${CFLAGS} -c $?
  
! BOZO = ../../bozo
  
  ADMINOBJS = afs_bosAdmin.o
  
Index: openafs/src/libadmin/bos/afs_bosAdmin.c
diff -c openafs/src/libadmin/bos/afs_bosAdmin.c:1.11 openafs/src/libadmin/bos/afs_bosAdmin.c:1.11.2.1
*** openafs/src/libadmin/bos/afs_bosAdmin.c:1.11	Sun Dec  7 17:49:29 2003
--- openafs/src/libadmin/bos/afs_bosAdmin.c	Tue Oct 30 11:23:54 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/bos/afs_bosAdmin.c,v 1.11 2003/12/07 22:49:29 jaltman Exp $");
  
  #include <stdio.h>
  #include <afs/stds.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/bos/afs_bosAdmin.c,v 1.11.2.1 2007/10/30 15:23:54 shadow Exp $");
  
  #include <stdio.h>
  #include <afs/stds.h>
***************
*** 32,45 ****
  #else
  #include <unistd.h>
  #endif
- 
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  
  typedef struct bos_server {
      int begin_magic;
--- 32,38 ----
Index: openafs/src/libadmin/cfg/cfgclient.c
diff -c openafs/src/libadmin/cfg/cfgclient.c:1.6 openafs/src/libadmin/cfg/cfgclient.c:1.6.2.2
*** openafs/src/libadmin/cfg/cfgclient.c:1.6	Tue Jul 15 19:15:25 2003
--- openafs/src/libadmin/cfg/cfgclient.c	Mon Nov 26 16:21:53 2007
***************
*** 15,21 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/cfg/cfgclient.c,v 1.6 2003/07/15 23:15:25 shadow Exp $");
  
  #include <afs/stds.h>
  
--- 15,21 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/cfg/cfgclient.c,v 1.6.2.2 2007/11/26 21:21:53 shadow Exp $");
  
  #include <afs/stds.h>
  
***************
*** 23,37 ****
  #include <stdlib.h>
  #include <stdio.h>
  #include <errno.h>
- 
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
- 
  #include <pthread.h>
  
  #include <afs/afs_Admin.h>
--- 23,29 ----
***************
*** 104,110 ****
      afs_status_t clientSt = 0;
      char *clientCellName = NULL;
      short cmInstalled = 0;
!     unsigned cmVersion;
  
      /* validate parameters */
  
--- 96,102 ----
      afs_status_t clientSt = 0;
      char *clientCellName = NULL;
      short cmInstalled = 0;
!     unsigned cmVersion = 0;
  
      /* validate parameters */
  
Index: openafs/src/libadmin/cfg/cfginternal.c
diff -c openafs/src/libadmin/cfg/cfginternal.c:1.6 openafs/src/libadmin/cfg/cfginternal.c:1.6.2.1
*** openafs/src/libadmin/cfg/cfginternal.c:1.6	Fri Apr  2 01:54:05 2004
--- openafs/src/libadmin/cfg/cfginternal.c	Mon Nov 26 16:21:53 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/cfg/cfginternal.c,v 1.6 2004/04/02 06:54:05 jaltman Exp $");
  
  #include <afs/stds.h>
  
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/cfg/cfginternal.c,v 1.6.2.1 2007/11/26 21:21:53 shadow Exp $");
  
  #include <afs/stds.h>
  
***************
*** 480,487 ****
  {
      int rc = 1;
      afs_status_t tst = 0;
!     int aCount;
!     afs_int32 *aList;
  
  #ifdef AFS_NT40_ENV
      /* Note: gethostbyname() allocs hostent on a per-thread basis */
--- 480,487 ----
  {
      int rc = 1;
      afs_status_t tst = 0;
!     int aCount = 0;
!     afs_int32 *aList = NULL;
  
  #ifdef AFS_NT40_ENV
      /* Note: gethostbyname() allocs hostent on a per-thread basis */
Index: openafs/src/libadmin/cfg/test/cfgtest.c
diff -c openafs/src/libadmin/cfg/test/cfgtest.c:1.5 openafs/src/libadmin/cfg/test/cfgtest.c:1.5.2.1
*** openafs/src/libadmin/cfg/test/cfgtest.c:1.5	Tue Jul 15 19:15:28 2003
--- openafs/src/libadmin/cfg/test/cfgtest.c	Wed Oct 31 00:13:41 2007
***************
*** 13,19 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/cfg/test/cfgtest.c,v 1.5 2003/07/15 23:15:28 shadow Exp $");
  
  #include <afs/stds.h>
  
--- 13,19 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/cfg/test/cfgtest.c,v 1.5.2.1 2007/10/31 04:13:41 shadow Exp $");
  
  #include <afs/stds.h>
  
***************
*** 90,96 ****
  
  
  static int
! DoCellServDbAddHost(struct cmd_syndesc *as, char *arock)
  {
      afs_status_t st = 0;
      int maxUpdates;
--- 90,96 ----
  
  
  static int
! DoCellServDbAddHost(struct cmd_syndesc *as, void *arock)
  {
      afs_status_t st = 0;
      int maxUpdates;
***************
*** 135,141 ****
  
  
  static int
! DoCellServDbRemoveHost(struct cmd_syndesc *as, char *arock)
  {
      afs_status_t st = 0;
      int maxUpdates;
--- 135,141 ----
  
  
  static int
! DoCellServDbRemoveHost(struct cmd_syndesc *as, void *arock)
  {
      afs_status_t st = 0;
      int maxUpdates;
***************
*** 181,187 ****
  
  
  static int
! DoCellServDbEnumerate(struct cmd_syndesc *as, char *arock)
  {
      afs_status_t st = 0;
      char *fsDbHost = as->parms[0].items->data;
--- 181,187 ----
  
  
  static int
! DoCellServDbEnumerate(struct cmd_syndesc *as, void *arock)
  {
      afs_status_t st = 0;
      char *fsDbHost = as->parms[0].items->data;
***************
*** 216,236 ****
  {
      struct cmd_syndesc *ts;
  
!     ts = cmd_CreateSyntax("CellServDbAddHost", DoCellServDbAddHost, 0,
  			  "add configuration target to server CellServDB");
      cmd_AddParm(ts, "-cfghost", CMD_SINGLE, CMD_REQUIRED,
  		"configuration host");
      cmd_AddParm(ts, "-syshost", CMD_SINGLE, CMD_OPTIONAL,
  		"system control host");
  
!     ts = cmd_CreateSyntax("CellServDbRemoveHost", DoCellServDbRemoveHost, 0,
  			  "remove configuration target from server CellServDB");
      cmd_AddParm(ts, "-cfghost", CMD_SINGLE, CMD_REQUIRED,
  		"configuration host");
      cmd_AddParm(ts, "-syshost", CMD_SINGLE, CMD_OPTIONAL,
  		"system control host");
  
!     ts = cmd_CreateSyntax("CellServDbEnumerate", DoCellServDbEnumerate, 0,
  			  "enumerate server CellServDB from specified host");
      cmd_AddParm(ts, "-host", CMD_SINGLE, CMD_REQUIRED, "host name");
  
--- 216,236 ----
  {
      struct cmd_syndesc *ts;
  
!     ts = cmd_CreateSyntax("CellServDbAddHost", DoCellServDbAddHost, NULL,
  			  "add configuration target to server CellServDB");
      cmd_AddParm(ts, "-cfghost", CMD_SINGLE, CMD_REQUIRED,
  		"configuration host");
      cmd_AddParm(ts, "-syshost", CMD_SINGLE, CMD_OPTIONAL,
  		"system control host");
  
!     ts = cmd_CreateSyntax("CellServDbRemoveHost", DoCellServDbRemoveHost, NULL,
  			  "remove configuration target from server CellServDB");
      cmd_AddParm(ts, "-cfghost", CMD_SINGLE, CMD_REQUIRED,
  		"configuration host");
      cmd_AddParm(ts, "-syshost", CMD_SINGLE, CMD_OPTIONAL,
  		"system control host");
  
!     ts = cmd_CreateSyntax("CellServDbEnumerate", DoCellServDbEnumerate, NULL,
  			  "enumerate server CellServDB from specified host");
      cmd_AddParm(ts, "-host", CMD_SINGLE, CMD_REQUIRED, "host name");
  
***************
*** 245,251 ****
  
  
  static int
! DoDbServersWaitForQuorum(struct cmd_syndesc *as, char *arock)
  {
      afs_status_t st = 0;
      void *hostHandle;
--- 245,251 ----
  
  
  static int
! DoDbServersWaitForQuorum(struct cmd_syndesc *as, void *arock)
  {
      afs_status_t st = 0;
      void *hostHandle;
***************
*** 273,279 ****
  
  
  static int
! DoFileServerStop(struct cmd_syndesc *as, char *arock)
  {
      afs_status_t st = 0;
      void *hostHandle;
--- 273,279 ----
  
  
  static int
! DoFileServerStop(struct cmd_syndesc *as, void *arock)
  {
      afs_status_t st = 0;
      void *hostHandle;
***************
*** 294,300 ****
  }
  
  static int
! DoFileServerStart(struct cmd_syndesc *as, char *arock)
  {
      afs_status_t st = 0;
      void *hostHandle;
--- 294,300 ----
  }
  
  static int
! DoFileServerStart(struct cmd_syndesc *as, void *arock)
  {
      afs_status_t st = 0;
      void *hostHandle;
***************
*** 321,338 ****
      struct cmd_syndesc *ts;
  
      ts = cmd_CreateSyntax("DbServersWaitForQuorum", DoDbServersWaitForQuorum,
! 			  0, "wait for database servers to achieve quorum");
      cmd_AddParm(ts, "-cfghost", CMD_SINGLE, CMD_REQUIRED,
  		"configuration host");
      cmd_AddParm(ts, "-timeout", CMD_SINGLE, CMD_OPTIONAL,
  		"timeout in seconds");
  
!     ts = cmd_CreateSyntax("FileServerStop", DoFileServerStop, 0,
  			  "stop and unconfigure fileserver on specified host");
      cmd_AddParm(ts, "-cfghost", CMD_SINGLE, CMD_REQUIRED,
  		"configuration host");
  
!     ts = cmd_CreateSyntax("FileServerStart", DoFileServerStart, 0,
  			  "start the fileserver on specified host");
      cmd_AddParm(ts, "-cfghost", CMD_SINGLE, CMD_REQUIRED,
  		"configuration host");
--- 321,338 ----
      struct cmd_syndesc *ts;
  
      ts = cmd_CreateSyntax("DbServersWaitForQuorum", DoDbServersWaitForQuorum,
! 			  NULL, "wait for database servers to achieve quorum");
      cmd_AddParm(ts, "-cfghost", CMD_SINGLE, CMD_REQUIRED,
  		"configuration host");
      cmd_AddParm(ts, "-timeout", CMD_SINGLE, CMD_OPTIONAL,
  		"timeout in seconds");
  
!     ts = cmd_CreateSyntax("FileServerStop", DoFileServerStop, NULL,
  			  "stop and unconfigure fileserver on specified host");
      cmd_AddParm(ts, "-cfghost", CMD_SINGLE, CMD_REQUIRED,
  		"configuration host");
  
!     ts = cmd_CreateSyntax("FileServerStart", DoFileServerStart, NULL,
  			  "start the fileserver on specified host");
      cmd_AddParm(ts, "-cfghost", CMD_SINGLE, CMD_REQUIRED,
  		"configuration host");
***************
*** 344,350 ****
  
  
  static int
! DoHostPartitionTableEnumerate(struct cmd_syndesc *as, char *arock)
  {
      afs_status_t st = 0;
      cfg_partitionEntry_t *vptable;
--- 344,350 ----
  
  
  static int
! DoHostPartitionTableEnumerate(struct cmd_syndesc *as, void *arock)
  {
      afs_status_t st = 0;
      cfg_partitionEntry_t *vptable;
***************
*** 385,391 ****
      struct cmd_syndesc *ts;
  
      ts = cmd_CreateSyntax("HostPartitionTableEnumerate",
! 			  DoHostPartitionTableEnumerate, 0,
  			  "enumerate vice partition table");
      cmd_AddParm(ts, "-cfghost", CMD_SINGLE, CMD_REQUIRED,
  		"configuration host");
--- 385,391 ----
      struct cmd_syndesc *ts;
  
      ts = cmd_CreateSyntax("HostPartitionTableEnumerate",
! 			  DoHostPartitionTableEnumerate, NULL,
  			  "enumerate vice partition table");
      cmd_AddParm(ts, "-cfghost", CMD_SINGLE, CMD_REQUIRED,
  		"configuration host");
***************
*** 398,404 ****
  
  
  static int
! DoClientCellServDbAdd(struct cmd_syndesc *as, char *arock)
  {
      afs_status_t st = 0;
      void *hostHandle;
--- 398,404 ----
  
  
  static int
! DoClientCellServDbAdd(struct cmd_syndesc *as, void *arock)
  {
      afs_status_t st = 0;
      void *hostHandle;
***************
*** 422,428 ****
  
  
  static int
! DoClientCellServDbRemove(struct cmd_syndesc *as, char *arock)
  {
      afs_status_t st = 0;
      void *hostHandle;
--- 422,428 ----
  
  
  static int
! DoClientCellServDbRemove(struct cmd_syndesc *as, void *arock)
  {
      afs_status_t st = 0;
      void *hostHandle;
***************
*** 447,453 ****
  
  
  static int
! DoClientStart(struct cmd_syndesc *as, char *arock)
  {
      afs_status_t st = 0;
      void *hostHandle;
--- 447,453 ----
  
  
  static int
! DoClientStart(struct cmd_syndesc *as, void *arock)
  {
      afs_status_t st = 0;
      void *hostHandle;
***************
*** 474,480 ****
  
  
  static int
! DoClientStop(struct cmd_syndesc *as, char *arock)
  {
      afs_status_t st = 0;
      void *hostHandle;
--- 474,480 ----
  
  
  static int
! DoClientStop(struct cmd_syndesc *as, void *arock)
  {
      afs_status_t st = 0;
      void *hostHandle;
***************
*** 501,507 ****
  
  
  static int
! DoClientSetCell(struct cmd_syndesc *as, char *arock)
  {
      afs_status_t st = 0;
      void *hostHandle;
--- 501,507 ----
  
  
  static int
! DoClientSetCell(struct cmd_syndesc *as, void *arock)
  {
      afs_status_t st = 0;
      void *hostHandle;
***************
*** 544,550 ****
  
  
  static int
! DoClientQueryStatus(struct cmd_syndesc *as, char *arock)
  {
      afs_status_t st = 0;
      char *cfgHost = as->parms[0].items->data;
--- 544,550 ----
  
  
  static int
! DoClientQueryStatus(struct cmd_syndesc *as, void *arock)
  {
      afs_status_t st = 0;
      char *cfgHost = as->parms[0].items->data;
***************
*** 578,584 ****
  
  
  static int
! DoHostQueryStatus(struct cmd_syndesc *as, char *arock)
  {
      afs_status_t st = 0;
      char *cfgHost = as->parms[0].items->data;
--- 578,584 ----
  
  
  static int
! DoHostQueryStatus(struct cmd_syndesc *as, void *arock)
  {
      afs_status_t st = 0;
      char *cfgHost = as->parms[0].items->data;
***************
*** 610,616 ****
  {
      struct cmd_syndesc *ts;
  
!     ts = cmd_CreateSyntax("ClientCellServDbAdd", DoClientCellServDbAdd, 0,
  			  "add host entry to client CellServDB");
      cmd_AddParm(ts, "-cfghost", CMD_SINGLE, CMD_REQUIRED,
  		"configuration host");
--- 610,616 ----
  {
      struct cmd_syndesc *ts;
  
!     ts = cmd_CreateSyntax("ClientCellServDbAdd", DoClientCellServDbAdd, NULL,
  			  "add host entry to client CellServDB");
      cmd_AddParm(ts, "-cfghost", CMD_SINGLE, CMD_REQUIRED,
  		"configuration host");
***************
*** 618,655 ****
      cmd_AddParm(ts, "-dbhost", CMD_SINGLE, CMD_REQUIRED, "host to add");
  
      ts = cmd_CreateSyntax("ClientCellServDbRemove", DoClientCellServDbRemove,
! 			  0, "remove host entry from client CellServDB");
      cmd_AddParm(ts, "-cfghost", CMD_SINGLE, CMD_REQUIRED,
  		"configuration host");
      cmd_AddParm(ts, "-cell", CMD_SINGLE, CMD_REQUIRED, "cell name");
      cmd_AddParm(ts, "-dbhost", CMD_SINGLE, CMD_REQUIRED, "host to remove");
  
!     ts = cmd_CreateSyntax("ClientSetCell", DoClientSetCell, 0,
  			  "set default client cell");
      cmd_AddParm(ts, "-cfghost", CMD_SINGLE, CMD_REQUIRED,
  		"configuration host");
      cmd_AddParm(ts, "-cell", CMD_SINGLE, CMD_REQUIRED, "cell name");
      cmd_AddParm(ts, "-dbhosts", CMD_LIST, CMD_REQUIRED, "database hosts");
  
!     ts = cmd_CreateSyntax("ClientQueryStatus", DoClientQueryStatus, 0,
  			  "query status of client on host");
      cmd_AddParm(ts, "-cfghost", CMD_SINGLE, CMD_REQUIRED,
  		"configuration host");
  
!     ts = cmd_CreateSyntax("HostQueryStatus", DoHostQueryStatus, 0,
  			  "query status of server on host");
      cmd_AddParm(ts, "-cfghost", CMD_SINGLE, CMD_REQUIRED,
  		"configuration host");
  
  
!     ts = cmd_CreateSyntax("ClientStart", DoClientStart, 0,
  			  "start the client");
      cmd_AddParm(ts, "-cfghost", CMD_SINGLE, CMD_REQUIRED,
  		"configuration host");
      cmd_AddParm(ts, "-timeout", CMD_SINGLE, CMD_REQUIRED, "wait timeout");
  
  
!     ts = cmd_CreateSyntax("ClientStop", DoClientStop, 0, "stop the client");
      cmd_AddParm(ts, "-cfghost", CMD_SINGLE, CMD_REQUIRED,
  		"configuration host");
      cmd_AddParm(ts, "-timeout", CMD_SINGLE, CMD_REQUIRED, "wait timeout");
--- 618,655 ----
      cmd_AddParm(ts, "-dbhost", CMD_SINGLE, CMD_REQUIRED, "host to add");
  
      ts = cmd_CreateSyntax("ClientCellServDbRemove", DoClientCellServDbRemove,
! 			  NULL, "remove host entry from client CellServDB");
      cmd_AddParm(ts, "-cfghost", CMD_SINGLE, CMD_REQUIRED,
  		"configuration host");
      cmd_AddParm(ts, "-cell", CMD_SINGLE, CMD_REQUIRED, "cell name");
      cmd_AddParm(ts, "-dbhost", CMD_SINGLE, CMD_REQUIRED, "host to remove");
  
!     ts = cmd_CreateSyntax("ClientSetCell", DoClientSetCell, NULL,
  			  "set default client cell");
      cmd_AddParm(ts, "-cfghost", CMD_SINGLE, CMD_REQUIRED,
  		"configuration host");
      cmd_AddParm(ts, "-cell", CMD_SINGLE, CMD_REQUIRED, "cell name");
      cmd_AddParm(ts, "-dbhosts", CMD_LIST, CMD_REQUIRED, "database hosts");
  
!     ts = cmd_CreateSyntax("ClientQueryStatus", DoClientQueryStatus, NULL,
  			  "query status of client on host");
      cmd_AddParm(ts, "-cfghost", CMD_SINGLE, CMD_REQUIRED,
  		"configuration host");
  
!     ts = cmd_CreateSyntax("HostQueryStatus", DoHostQueryStatus, NULL,
  			  "query status of server on host");
      cmd_AddParm(ts, "-cfghost", CMD_SINGLE, CMD_REQUIRED,
  		"configuration host");
  
  
!     ts = cmd_CreateSyntax("ClientStart", DoClientStart, NULL,
  			  "start the client");
      cmd_AddParm(ts, "-cfghost", CMD_SINGLE, CMD_REQUIRED,
  		"configuration host");
      cmd_AddParm(ts, "-timeout", CMD_SINGLE, CMD_REQUIRED, "wait timeout");
  
  
!     ts = cmd_CreateSyntax("ClientStop", DoClientStop, NULL, "stop the client");
      cmd_AddParm(ts, "-cfghost", CMD_SINGLE, CMD_REQUIRED,
  		"configuration host");
      cmd_AddParm(ts, "-timeout", CMD_SINGLE, CMD_REQUIRED, "wait timeout");
Index: openafs/src/libadmin/kas/Makefile.in
diff -c openafs/src/libadmin/kas/Makefile.in:1.7 openafs/src/libadmin/kas/Makefile.in:1.7.2.1
*** openafs/src/libadmin/kas/Makefile.in:1.7	Sat Jan 11 02:34:35 2003
--- openafs/src/libadmin/kas/Makefile.in	Mon Jan 21 13:40:11 2008
***************
*** 12,18 ****
  CFLAGS=${COMMON_CFLAGS} ${MT_CFLAGS} -I../../kauth -I${srcdir}/../../kauth
  CCRULE = ${CC} ${CFLAGS} -c $?
  
! KAUTH= ${srcdir}/../../kauth/
  
  ADMINOBJS = afs_kasAdmin.o
  
--- 12,18 ----
  CFLAGS=${COMMON_CFLAGS} ${MT_CFLAGS} -I../../kauth -I${srcdir}/../../kauth
  CCRULE = ${CC} ${CFLAGS} -c $?
  
! KAUTH= ${srcdir}/../../kauth
  
  ADMINOBJS = afs_kasAdmin.o
  
Index: openafs/src/libadmin/kas/afs_kasAdmin.c
diff -c openafs/src/libadmin/kas/afs_kasAdmin.c:1.9.2.4 openafs/src/libadmin/kas/afs_kasAdmin.c:1.9.2.5
*** openafs/src/libadmin/kas/afs_kasAdmin.c:1.9.2.4	Sun Jul 15 20:00:37 2007
--- openafs/src/libadmin/kas/afs_kasAdmin.c	Tue Oct 30 11:23:56 2007
***************
*** 11,27 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/kas/afs_kasAdmin.c,v 1.9.2.4 2007/07/16 00:00:37 jaltman Exp $");
  
  #include <stdio.h>
- 
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  
  #include <afs/stds.h>
  #include "afs_kasAdmin.h"
--- 11,20 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/kas/afs_kasAdmin.c,v 1.9.2.5 2007/10/30 15:23:56 shadow Exp $");
  
  #include <stdio.h>
  #include <string.h>
  
  #include <afs/stds.h>
  #include "afs_kasAdmin.h"
Index: openafs/src/libadmin/pts/Makefile.in
diff -c openafs/src/libadmin/pts/Makefile.in:1.7 openafs/src/libadmin/pts/Makefile.in:1.7.2.1
*** openafs/src/libadmin/pts/Makefile.in:1.7	Sat Jan 11 02:34:36 2003
--- openafs/src/libadmin/pts/Makefile.in	Mon Jan 21 13:40:11 2008
***************
*** 12,18 ****
  CFLAGS=${COMMON_CFLAGS} ${MT_CFLAGS}
  CCRULE = ${CC} ${CFLAGS} -c $?
  
! PTSERVER = ../../ptserver/
  
  ADMINOBJS = \
  	afs_ptsAdmin.o
--- 12,18 ----
  CFLAGS=${COMMON_CFLAGS} ${MT_CFLAGS}
  CCRULE = ${CC} ${CFLAGS} -c $?
  
! PTSERVER = ../../ptserver
  
  ADMINOBJS = \
  	afs_ptsAdmin.o
Index: openafs/src/libadmin/pts/afs_ptsAdmin.c
diff -c openafs/src/libadmin/pts/afs_ptsAdmin.c:1.11.2.1 openafs/src/libadmin/pts/afs_ptsAdmin.c:1.11.2.2
*** openafs/src/libadmin/pts/afs_ptsAdmin.c:1.11.2.1	Sun Jul 15 20:00:37 2007
--- openafs/src/libadmin/pts/afs_ptsAdmin.c	Tue Oct 30 11:23:57 2007
***************
*** 11,28 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/pts/afs_ptsAdmin.c,v 1.11.2.1 2007/07/16 00:00:37 jaltman Exp $");
  
  #include <stdio.h>
- 
- #ifdef HAVE_STRING_H
- #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
- 
  #include <afs/stds.h>
  #include "afs_ptsAdmin.h"
  #include "../adminutil/afs_AdminInternal.h"
--- 11,19 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/pts/afs_ptsAdmin.c,v 1.11.2.2 2007/10/30 15:23:57 shadow Exp $");
  
  #include <stdio.h>
  #include <afs/stds.h>
  #include "afs_ptsAdmin.h"
  #include "../adminutil/afs_AdminInternal.h"
Index: openafs/src/libadmin/samples/rxdebug_conns.c
diff -c openafs/src/libadmin/samples/rxdebug_conns.c:1.6 openafs/src/libadmin/samples/rxdebug_conns.c:1.6.2.1
*** openafs/src/libadmin/samples/rxdebug_conns.c:1.6	Fri Oct 24 02:26:10 2003
--- openafs/src/libadmin/samples/rxdebug_conns.c	Mon Nov 26 16:21:54 2007
***************
*** 17,23 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/samples/rxdebug_conns.c,v 1.6 2003/10/24 06:26:10 shadow Exp $");
  
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
--- 17,23 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/samples/rxdebug_conns.c,v 1.6.2.1 2007/11/26 21:21:54 shadow Exp $");
  
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
***************
*** 69,75 ****
      struct rx_debugConn conn;
      afs_uint32 supportedStats;
      afs_uint32 supportedValues;
!     int allconns;
      int i;
  
      ParseArgs(argc, argv, &srvrName, &srvrPort);
--- 69,75 ----
      struct rx_debugConn conn;
      afs_uint32 supportedStats;
      afs_uint32 supportedValues;
!     int allconns = 1;
      int i;
  
      ParseArgs(argc, argv, &srvrName, &srvrPort);
Index: openafs/src/libadmin/samples/rxdebug_rx_stats.c
diff -c openafs/src/libadmin/samples/rxdebug_rx_stats.c:1.7 openafs/src/libadmin/samples/rxdebug_rx_stats.c:1.7.2.1
*** openafs/src/libadmin/samples/rxdebug_rx_stats.c:1.7	Fri Oct 24 02:26:10 2003
--- openafs/src/libadmin/samples/rxdebug_rx_stats.c	Tue Oct 30 11:23:57 2007
***************
*** 17,37 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/samples/rxdebug_rx_stats.c,v 1.7 2003/10/24 06:26:10 shadow Exp $");
  
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #include <pthread.h>
  #endif
- 
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
- 
  #include <afs/afs_Admin.h>
  #include <afs/afs_clientAdmin.h>
  #include <afs/afs_utilAdmin.h>
--- 17,29 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/samples/rxdebug_rx_stats.c,v 1.7.2.1 2007/10/30 15:23:57 shadow Exp $");
  
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #include <pthread.h>
  #endif
  #include <string.h>
  #include <afs/afs_Admin.h>
  #include <afs/afs_clientAdmin.h>
  #include <afs/afs_utilAdmin.h>
Index: openafs/src/libadmin/samples/rxstat_get_peer.c
diff -c openafs/src/libadmin/samples/rxstat_get_peer.c:1.7 openafs/src/libadmin/samples/rxstat_get_peer.c:1.7.2.1
*** openafs/src/libadmin/samples/rxstat_get_peer.c:1.7	Fri Oct 24 02:26:10 2003
--- openafs/src/libadmin/samples/rxstat_get_peer.c	Tue Oct 30 11:23:57 2007
***************
*** 17,36 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/samples/rxstat_get_peer.c,v 1.7 2003/10/24 06:26:10 shadow Exp $");
  
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #include <pthread.h>
  #endif
  
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  
  #include <afs/afs_Admin.h>
  #include <afs/afs_AdminErrors.h>
--- 17,30 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/samples/rxstat_get_peer.c,v 1.7.2.1 2007/10/30 15:23:57 shadow Exp $");
  
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #include <pthread.h>
  #endif
  
  #include <string.h>
  
  #include <afs/afs_Admin.h>
  #include <afs/afs_AdminErrors.h>
Index: openafs/src/libadmin/samples/rxstat_get_process.c
diff -c openafs/src/libadmin/samples/rxstat_get_process.c:1.7 openafs/src/libadmin/samples/rxstat_get_process.c:1.7.2.1
*** openafs/src/libadmin/samples/rxstat_get_process.c:1.7	Fri Oct 24 02:26:10 2003
--- openafs/src/libadmin/samples/rxstat_get_process.c	Tue Oct 30 11:23:57 2007
***************
*** 17,36 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/samples/rxstat_get_process.c,v 1.7 2003/10/24 06:26:10 shadow Exp $");
  
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #include <pthread.h>
  #endif
- 
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  
  #include <afs/afs_Admin.h>
  #include <afs/afs_AdminErrors.h>
--- 17,29 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/samples/rxstat_get_process.c,v 1.7.2.1 2007/10/30 15:23:57 shadow Exp $");
  
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #include <pthread.h>
  #endif
  #include <string.h>
  
  #include <afs/afs_Admin.h>
  #include <afs/afs_AdminErrors.h>
Index: openafs/src/libadmin/test/afscp.c
diff -c openafs/src/libadmin/test/afscp.c:1.7 openafs/src/libadmin/test/afscp.c:1.7.2.1
*** openafs/src/libadmin/test/afscp.c:1.7	Fri Oct 24 02:26:10 2003
--- openafs/src/libadmin/test/afscp.c	Wed Oct 31 00:13:42 2007
***************
*** 15,21 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/test/afscp.c,v 1.7 2003/10/24 06:26:10 shadow Exp $");
  
  #include <afs/stds.h>
  
--- 15,21 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/test/afscp.c,v 1.7.2.1 2007/10/31 04:13:42 shadow Exp $");
  
  #include <afs/stds.h>
  
***************
*** 59,65 ****
   */
  
  static int
! MyBeforeProc(struct cmd_syndesc *as, char *arock)
  {
      afs_status_t st = 0;
      int no_auth = 0;
--- 59,65 ----
   */
  
  static int
! MyBeforeProc(struct cmd_syndesc *as, void *arock)
  {
      afs_status_t st = 0;
      int no_auth = 0;
***************
*** 149,155 ****
  }
  
  static int
! MyAfterProc(struct cmd_syndesc *as)
  {
  
      afsclient_CellClose(cellHandle, (afs_status_p) 0);
--- 149,155 ----
  }
  
  static int
! MyAfterProc(struct cmd_syndesc *as,void *arock)
  {
  
      afsclient_CellClose(cellHandle, (afs_status_p) 0);
Index: openafs/src/libadmin/test/bos.c
diff -c openafs/src/libadmin/test/bos.c:1.10 openafs/src/libadmin/test/bos.c:1.10.2.1
*** openafs/src/libadmin/test/bos.c:1.10	Sat Nov 29 17:08:13 2003
--- openafs/src/libadmin/test/bos.c	Wed Oct 31 00:13:42 2007
***************
*** 15,21 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/test/bos.c,v 1.10 2003/11/29 22:08:13 jaltman Exp $");
  
  #include "bos.h"
  
--- 15,21 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/test/bos.c,v 1.10.2.1 2007/10/31 04:13:42 shadow Exp $");
  
  #include "bos.h"
  
***************
*** 268,274 ****
  }
  
  int
! DoBosProcessCreate(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, PROCESS, BINARY, CRON, CRONTIME,
  	NOTIFIER
--- 268,274 ----
  }
  
  int
! DoBosProcessCreate(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, PROCESS, BINARY, CRON, CRONTIME,
  	NOTIFIER
***************
*** 334,340 ****
  }
  
  int
! DoBosFSProcessCreate(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, PROCESS, FILESERVER, VOLSERVER, SALVAGER,
  	NOTIFIER
--- 334,340 ----
  }
  
  int
! DoBosFSProcessCreate(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, PROCESS, FILESERVER, VOLSERVER, SALVAGER,
  	NOTIFIER
***************
*** 386,392 ****
  }
  
  int
! DoBosProcessDelete(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, PROCESS } DoBosProcessDelete_parm_t;
      afs_status_t st = 0;
--- 386,392 ----
  }
  
  int
! DoBosProcessDelete(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, PROCESS } DoBosProcessDelete_parm_t;
      afs_status_t st = 0;
***************
*** 435,441 ****
  }
  
  int
! DoBosProcessExecutionStateGet(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, PROCESS } DoBosProcessExecutionStateGet_parm_t;
      afs_status_t st = 0;
--- 435,441 ----
  }
  
  int
! DoBosProcessExecutionStateGet(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, PROCESS } DoBosProcessExecutionStateGet_parm_t;
      afs_status_t st = 0;
***************
*** 471,477 ****
  }
  
  int
! DoBosProcessExecutionStateSet(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, PROCESS, STOPPED,
  	RUNNING
--- 471,477 ----
  }
  
  int
! DoBosProcessExecutionStateSet(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, PROCESS, STOPPED,
  	RUNNING
***************
*** 522,528 ****
  }
  
  int
! DoBosProcessExecutionStateSetTemporary(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, PROCESS, STOPPED,
  	RUNNING
--- 522,528 ----
  }
  
  int
! DoBosProcessExecutionStateSetTemporary(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, PROCESS, STOPPED,
  	RUNNING
***************
*** 574,580 ****
  }
  
  int
! DoBosProcessNameList(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER } DoBosProcessNameList_parm_t;
      afs_status_t st = 0;
--- 574,580 ----
  }
  
  int
! DoBosProcessNameList(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER } DoBosProcessNameList_parm_t;
      afs_status_t st = 0;
***************
*** 663,669 ****
  }
  
  int
! DoBosProcessInfoGet(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, PROCESS } DoBosProcessInfoGet_parm_t;
      afs_status_t st = 0;
--- 663,669 ----
  }
  
  int
! DoBosProcessInfoGet(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, PROCESS } DoBosProcessInfoGet_parm_t;
      afs_status_t st = 0;
***************
*** 694,700 ****
  }
  
  int
! DoBosProcessParameterList(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, PROCESS } DoBosProcessParameterList_parm_t;
      afs_status_t st = 0;
--- 694,700 ----
  }
  
  int
! DoBosProcessParameterList(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, PROCESS } DoBosProcessParameterList_parm_t;
      afs_status_t st = 0;
***************
*** 738,744 ****
  }
  
  int
! DoBosProcessNotifierGet(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, PROCESS } DoBosProcessNotifierGet_parm_t;
      afs_status_t st = 0;
--- 738,744 ----
  }
  
  int
! DoBosProcessNotifierGet(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, PROCESS } DoBosProcessNotifierGet_parm_t;
      afs_status_t st = 0;
***************
*** 773,779 ****
  }
  
  int
! DoBosProcessRestart(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, PROCESS } DoBosProcessRestart_parm_t;
      afs_status_t st = 0;
--- 773,779 ----
  }
  
  int
! DoBosProcessRestart(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, PROCESS } DoBosProcessRestart_parm_t;
      afs_status_t st = 0;
***************
*** 801,807 ****
  }
  
  int
! DoBosProcessAllStop(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER } DoBosProcessAllStop_parm_t;
      afs_status_t st = 0;
--- 801,807 ----
  }
  
  int
! DoBosProcessAllStop(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER } DoBosProcessAllStop_parm_t;
      afs_status_t st = 0;
***************
*** 824,830 ****
  }
  
  int
! DoBosProcessAllStart(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER } DoBosProcessAllStart_parm_t;
      afs_status_t st = 0;
--- 824,830 ----
  }
  
  int
! DoBosProcessAllStart(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER } DoBosProcessAllStart_parm_t;
      afs_status_t st = 0;
***************
*** 847,853 ****
  }
  
  int
! DoBosProcessAllWaitStop(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER } DoBosProcessAllWaitStop_parm_t;
      afs_status_t st = 0;
--- 847,853 ----
  }
  
  int
! DoBosProcessAllWaitStop(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER } DoBosProcessAllWaitStop_parm_t;
      afs_status_t st = 0;
***************
*** 870,876 ****
  }
  
  int
! DoBosProcessAllWaitTransition(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER } DoBosProcessAllWaitTransition_parm_t;
      afs_status_t st = 0;
--- 870,876 ----
  }
  
  int
! DoBosProcessAllWaitTransition(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER } DoBosProcessAllWaitTransition_parm_t;
      afs_status_t st = 0;
***************
*** 893,899 ****
  }
  
  int
! DoBosProcessAllStopAndRestart(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, INCLUDEBOS } DoBosProcessAllStopAndRestart_parm_t;
      afs_status_t st = 0;
--- 893,899 ----
  }
  
  int
! DoBosProcessAllStopAndRestart(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, INCLUDEBOS } DoBosProcessAllStopAndRestart_parm_t;
      afs_status_t st = 0;
***************
*** 921,927 ****
  }
  
  int
! DoBosAdminCreate(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, ADMIN } DoBosAdminCreate_parm_t;
      afs_status_t st = 0;
--- 921,927 ----
  }
  
  int
! DoBosAdminCreate(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, ADMIN } DoBosAdminCreate_parm_t;
      afs_status_t st = 0;
***************
*** 949,955 ****
  }
  
  int
! DoBosAdminDelete(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, ADMIN } DoBosAdminDelete_parm_t;
      afs_status_t st = 0;
--- 949,955 ----
  }
  
  int
! DoBosAdminDelete(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, ADMIN } DoBosAdminDelete_parm_t;
      afs_status_t st = 0;
***************
*** 977,983 ****
  }
  
  int
! DoBosAdminList(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER } DoBosAdminList_parm_t;
      afs_status_t st = 0;
--- 977,983 ----
  }
  
  int
! DoBosAdminList(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER } DoBosAdminList_parm_t;
      afs_status_t st = 0;
***************
*** 1016,1022 ****
  }
  
  int
! DoBosKeyCreate(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, VERSIONNUMBER, KEY } DoBosKeyCreate_parm_t;
      afs_status_t st = 0;
--- 1016,1022 ----
  }
  
  int
! DoBosKeyCreate(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, VERSIONNUMBER, KEY } DoBosKeyCreate_parm_t;
      afs_status_t st = 0;
***************
*** 1058,1064 ****
  }
  
  int
! DoBosKeyDelete(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, VERSIONNUMBER } DoBosKeyDelete_parm_t;
      afs_status_t st = 0;
--- 1058,1064 ----
  }
  
  int
! DoBosKeyDelete(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, VERSIONNUMBER } DoBosKeyDelete_parm_t;
      afs_status_t st = 0;
***************
*** 1106,1112 ****
  }
  
  int
! DoBosKeyList(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER } DoBosKeyList_parm_t;
      afs_status_t st = 0;
--- 1106,1112 ----
  }
  
  int
! DoBosKeyList(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER } DoBosKeyList_parm_t;
      afs_status_t st = 0;
***************
*** 1145,1151 ****
  }
  
  int
! DoBosCellSet(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, CELL } DoBosCellSet_parm_t;
      afs_status_t st = 0;
--- 1145,1151 ----
  }
  
  int
! DoBosCellSet(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, CELL } DoBosCellSet_parm_t;
      afs_status_t st = 0;
***************
*** 1173,1179 ****
  }
  
  int
! DoBosCellGet(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER } DoBosCellGet_parm_t;
      afs_status_t st = 0;
--- 1173,1179 ----
  }
  
  int
! DoBosCellGet(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER } DoBosCellGet_parm_t;
      afs_status_t st = 0;
***************
*** 1199,1205 ****
  }
  
  int
! DoBosHostCreate(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, HOST } DoBosHostCreate_parm_t;
      afs_status_t st = 0;
--- 1199,1205 ----
  }
  
  int
! DoBosHostCreate(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, HOST } DoBosHostCreate_parm_t;
      afs_status_t st = 0;
***************
*** 1227,1233 ****
  }
  
  int
! DoBosHostDelete(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, HOST } DoBosHostDelete_parm_t;
      afs_status_t st = 0;
--- 1227,1233 ----
  }
  
  int
! DoBosHostDelete(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, HOST } DoBosHostDelete_parm_t;
      afs_status_t st = 0;
***************
*** 1255,1261 ****
  }
  
  int
! DoBosHostList(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER } DoBosHostList_parm_t;
      afs_status_t st = 0;
--- 1255,1261 ----
  }
  
  int
! DoBosHostList(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER } DoBosHostList_parm_t;
      afs_status_t st = 0;
***************
*** 1294,1300 ****
  }
  
  int
! DoBosExecutableCreate(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, BINARY, DEST } DoBosExecutableCreate_parm_t;
      afs_status_t st = 0;
--- 1294,1300 ----
  }
  
  int
! DoBosExecutableCreate(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, BINARY, DEST } DoBosExecutableCreate_parm_t;
      afs_status_t st = 0;
***************
*** 1327,1333 ****
  }
  
  int
! DoBosExecutableRevert(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, EXECUTABLE } DoBosExecutableRevert_parm_t;
      afs_status_t st = 0;
--- 1327,1333 ----
  }
  
  int
! DoBosExecutableRevert(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, EXECUTABLE } DoBosExecutableRevert_parm_t;
      afs_status_t st = 0;
***************
*** 1355,1361 ****
  }
  
  int
! DoBosExecutableTimestampGet(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, EXECUTABLE } DoBosExecutableTimestampGet_parm_t;
      afs_status_t st = 0;
--- 1355,1361 ----
  }
  
  int
! DoBosExecutableTimestampGet(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, EXECUTABLE } DoBosExecutableTimestampGet_parm_t;
      afs_status_t st = 0;
***************
*** 1387,1393 ****
  }
  
  int
! DoBosExecutablePrune(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, OLDFILES, BAKFILES,
  	COREFILES
--- 1387,1393 ----
  }
  
  int
! DoBosExecutablePrune(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, OLDFILES, BAKFILES,
  	COREFILES
***************
*** 1428,1434 ****
  }
  
  int
! DoBosExecutableRestartTimeSet(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, DAILY, WEEKLY,
  	TIME
--- 1428,1434 ----
  }
  
  int
! DoBosExecutableRestartTimeSet(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, DAILY, WEEKLY,
  	TIME
***************
*** 1527,1533 ****
  }
  
  int
! DoBosExecutableRestartTimeGet(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, DAILY,
  	WEEKLY
--- 1527,1533 ----
  }
  
  int
! DoBosExecutableRestartTimeGet(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, DAILY,
  	WEEKLY
***************
*** 1578,1584 ****
  #define INITIAL_BUF_SIZE 4096
  
  int
! DoBosLogGet(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, LOGFILE } DoBosLogGet_parm_t;
      afs_status_t st = 0;
--- 1578,1584 ----
  #define INITIAL_BUF_SIZE 4096
  
  int
! DoBosLogGet(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, LOGFILE } DoBosLogGet_parm_t;
      afs_status_t st = 0;
***************
*** 1626,1632 ****
  }
  
  int
! DoBosAuthSet(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, REQUIREAUTH, DISABLEAUTH } DoBosAuthSet_parm_t;
      afs_status_t st = 0;
--- 1626,1632 ----
  }
  
  int
! DoBosAuthSet(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, REQUIREAUTH, DISABLEAUTH } DoBosAuthSet_parm_t;
      afs_status_t st = 0;
***************
*** 1670,1676 ****
  }
  
  int
! DoBosCommandExecute(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, COMMAND } DoBosCommandExecute_parm_t;
      afs_status_t st = 0;
--- 1670,1676 ----
  }
  
  int
! DoBosCommandExecute(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, COMMAND } DoBosCommandExecute_parm_t;
      afs_status_t st = 0;
***************
*** 1698,1704 ****
  }
  
  int
! DoBosSalvage(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, PARTITION, VOLUME, NUMSALVAGERS, TMPDIR, LOGFILE,
  	FORCE, NOWRITE, INODES, ROOTINODES, SALVAGEDIRS, BLOCKREADS
--- 1698,1704 ----
  }
  
  int
! DoBosSalvage(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, PARTITION, VOLUME, NUMSALVAGERS, TMPDIR, LOGFILE,
  	FORCE, NOWRITE, INODES, ROOTINODES, SALVAGEDIRS, BLOCKREADS
***************
*** 1802,1808 ****
  {
      struct cmd_syndesc *ts;
  
!     ts = cmd_CreateSyntax("BosProcessCreate", DoBosProcessCreate, 0,
  			  "create a new bos process");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where process will be created");
--- 1802,1808 ----
  {
      struct cmd_syndesc *ts;
  
!     ts = cmd_CreateSyntax("BosProcessCreate", DoBosProcessCreate, NULL,
  			  "create a new bos process");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where process will be created");
***************
*** 1818,1824 ****
  		"path to notifier binary that is run when process terminates");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosFSProcessCreate", DoBosFSProcessCreate, 0,
  			  "create a fs bos process");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where process will be created");
--- 1818,1824 ----
  		"path to notifier binary that is run when process terminates");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosFSProcessCreate", DoBosFSProcessCreate, NULL,
  			  "create a fs bos process");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where process will be created");
***************
*** 1834,1840 ****
  		"path to notifier binary that is run when process terminates");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosProcessDelete", DoBosProcessDelete, 0,
  			  "delete a bos process");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where process will be deleted");
--- 1834,1840 ----
  		"path to notifier binary that is run when process terminates");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosProcessDelete", DoBosProcessDelete, NULL,
  			  "delete a bos process");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where process will be deleted");
***************
*** 1843,1849 ****
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("BosProcessExecutionStateGet",
! 			  DoBosProcessExecutionStateGet, 0,
  			  "get the process execution state of a process");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where process exists");
--- 1843,1849 ----
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("BosProcessExecutionStateGet",
! 			  DoBosProcessExecutionStateGet, NULL,
  			  "get the process execution state of a process");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where process exists");
***************
*** 1852,1858 ****
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("BosProcessExecutionStateSet",
! 			  DoBosProcessExecutionStateSet, 0,
  			  "set the process execution state of a process");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where process exists");
--- 1852,1858 ----
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("BosProcessExecutionStateSet",
! 			  DoBosProcessExecutionStateSet, NULL,
  			  "set the process execution state of a process");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where process exists");
***************
*** 1865,1871 ****
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("BosProcessExecutionStateSetTemporary",
! 			  DoBosProcessExecutionStateSetTemporary, 0,
  			  "set the process execution state "
  			  "of a process temporarily");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
--- 1865,1871 ----
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("BosProcessExecutionStateSetTemporary",
! 			  DoBosProcessExecutionStateSetTemporary, NULL,
  			  "set the process execution state "
  			  "of a process temporarily");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
***************
*** 1878,1889 ****
  		"set the process state to running");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosProcessNameList", DoBosProcessNameList, 0,
  			  "list the names of all processes at a bos server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server to query");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosProcessInfoGet", DoBosProcessInfoGet, 0,
  			  "get information about a process");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where process exists");
--- 1878,1889 ----
  		"set the process state to running");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosProcessNameList", DoBosProcessNameList, NULL,
  			  "list the names of all processes at a bos server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server to query");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosProcessInfoGet", DoBosProcessInfoGet, NULL,
  			  "get information about a process");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where process exists");
***************
*** 1892,1898 ****
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("BosProcessParameterList",
! 			  DoBosProcessParameterList, 0,
  			  "list the parameters of a process");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where process exists");
--- 1892,1898 ----
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("BosProcessParameterList",
! 			  DoBosProcessParameterList, NULL,
  			  "list the parameters of a process");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where process exists");
***************
*** 1900,1906 ****
  		"the name of the process");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosProcessNotifierGet", DoBosProcessNotifierGet, 0,
  			  "get the notifier for a process");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where process exists");
--- 1900,1906 ----
  		"the name of the process");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosProcessNotifierGet", DoBosProcessNotifierGet, NULL,
  			  "get the notifier for a process");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where process exists");
***************
*** 1908,1914 ****
  		"the name of the process");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosProcessRestart", DoBosProcessRestart, 0,
  			  "restart a process");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where process exists");
--- 1908,1914 ----
  		"the name of the process");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosProcessRestart", DoBosProcessRestart, NULL,
  			  "restart a process");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where process exists");
***************
*** 1916,1928 ****
  		"the name of the process");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosProcessAllStop", DoBosProcessAllStop, 0,
  			  "stop all processes at a bos server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where processes exists");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosProcessAllWaitStop", DoBosProcessAllWaitStop, 0,
  			  "stop all processes at a bos server and block "
  			  "until they all exit");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
--- 1916,1928 ----
  		"the name of the process");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosProcessAllStop", DoBosProcessAllStop, NULL,
  			  "stop all processes at a bos server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where processes exists");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosProcessAllWaitStop", DoBosProcessAllWaitStop, NULL,
  			  "stop all processes at a bos server and block "
  			  "until they all exit");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
***************
*** 1930,1936 ****
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("BosProcessAllWaitTransition",
! 			  DoBosProcessAllWaitTransition, 0,
  			  "wait until all processes have transitioned to "
  			  "their desired state");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
--- 1930,1936 ----
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("BosProcessAllWaitTransition",
! 			  DoBosProcessAllWaitTransition, NULL,
  			  "wait until all processes have transitioned to "
  			  "their desired state");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
***************
*** 1938,1944 ****
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("BosProcessAllStopAndRestart",
! 			  DoBosProcessAllStopAndRestart, 0,
  			  "stop all processes at a bos server and "
  			  "then restart them");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
--- 1938,1944 ----
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("BosProcessAllStopAndRestart",
! 			  DoBosProcessAllStopAndRestart, NULL,
  			  "stop all processes at a bos server and "
  			  "then restart them");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
***************
*** 1947,1953 ****
  		"include the bos server in the processes to be restarted");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosAdminCreate", DoBosAdminCreate, 0,
  			  "create an admin user at a bos server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where admin will be created");
--- 1947,1953 ----
  		"include the bos server in the processes to be restarted");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosAdminCreate", DoBosAdminCreate, NULL,
  			  "create an admin user at a bos server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where admin will be created");
***************
*** 1955,1961 ****
  		"the name of the administrator to add");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosAdminDelete", DoBosAdminDelete, 0,
  			  "delete an admin user at a bos server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where admin will be deleted");
--- 1955,1961 ----
  		"the name of the administrator to add");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosAdminDelete", DoBosAdminDelete, NULL,
  			  "delete an admin user at a bos server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where admin will be deleted");
***************
*** 1963,1975 ****
  		"the name of the administrator to delete");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosAdminList", DoBosAdminList, 0,
  			  "list all admin users at a bos server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where admins will be listed");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosKeyCreate", DoBosKeyCreate, 0,
  			  "create a key at a bos server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where key will be created");
--- 1963,1975 ----
  		"the name of the administrator to delete");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosAdminList", DoBosAdminList, NULL,
  			  "list all admin users at a bos server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where admins will be listed");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosKeyCreate", DoBosKeyCreate, NULL,
  			  "create a key at a bos server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where key will be created");
***************
*** 1978,1984 ****
      cmd_AddParm(ts, "-key", CMD_SINGLE, CMD_REQUIRED, "new encryption key");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosKeyDelete", DoBosKeyDelete, 0,
  			  "delete a key at a bos server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where key will be deleted");
--- 1978,1984 ----
      cmd_AddParm(ts, "-key", CMD_SINGLE, CMD_REQUIRED, "new encryption key");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosKeyDelete", DoBosKeyDelete, NULL,
  			  "delete a key at a bos server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where key will be deleted");
***************
*** 1986,2026 ****
  		"version number of the key");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosKeyList", DoBosKeyList, 0,
  			  "list keys at a bos server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where keys exist");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosCellSet", DoBosCellSet, 0,
  			  "set the cell at a bos server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server to modify");
      cmd_AddParm(ts, "-cell", CMD_SINGLE, CMD_REQUIRED, "new cell");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosCellGet", DoBosCellGet, 0,
  			  "get the cell at a bos server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server to query");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosHostCreate", DoBosHostCreate, 0,
  			  "add a host entry to the server CellServDB");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server to modify");
      cmd_AddParm(ts, "-host", CMD_SINGLE, CMD_REQUIRED, "host to add");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosHostDelete", DoBosHostDelete, 0,
  			  "delete a host entry from the server CellServDB");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server to modify");
      cmd_AddParm(ts, "-host", CMD_SINGLE, CMD_REQUIRED, "host to delete");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosHostList", DoBosHostList, 0,
  			  "list all host entries from the server CellServDB");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server to query");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosExecutableCreate", DoBosExecutableCreate, 0,
  			  "create a new binary at a bos server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server to modify");
      cmd_AddParm(ts, "-binary", CMD_SINGLE, CMD_REQUIRED,
--- 1986,2026 ----
  		"version number of the key");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosKeyList", DoBosKeyList, NULL,
  			  "list keys at a bos server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where keys exist");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosCellSet", DoBosCellSet, NULL,
  			  "set the cell at a bos server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server to modify");
      cmd_AddParm(ts, "-cell", CMD_SINGLE, CMD_REQUIRED, "new cell");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosCellGet", DoBosCellGet, NULL,
  			  "get the cell at a bos server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server to query");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosHostCreate", DoBosHostCreate, NULL,
  			  "add a host entry to the server CellServDB");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server to modify");
      cmd_AddParm(ts, "-host", CMD_SINGLE, CMD_REQUIRED, "host to add");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosHostDelete", DoBosHostDelete, NULL,
  			  "delete a host entry from the server CellServDB");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server to modify");
      cmd_AddParm(ts, "-host", CMD_SINGLE, CMD_REQUIRED, "host to delete");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosHostList", DoBosHostList, NULL,
  			  "list all host entries from the server CellServDB");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server to query");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosExecutableCreate", DoBosExecutableCreate, NULL,
  			  "create a new binary at a bos server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server to modify");
      cmd_AddParm(ts, "-binary", CMD_SINGLE, CMD_REQUIRED,
***************
*** 2029,2035 ****
  		"path where the binary will be stored");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosExecutableRevert", DoBosExecutableRevert, 0,
  			  "revert a binary at a bos server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server to modify");
      cmd_AddParm(ts, "-executable", CMD_SINGLE, CMD_REQUIRED,
--- 2029,2035 ----
  		"path where the binary will be stored");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosExecutableRevert", DoBosExecutableRevert, NULL,
  			  "revert a binary at a bos server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server to modify");
      cmd_AddParm(ts, "-executable", CMD_SINGLE, CMD_REQUIRED,
***************
*** 2037,2050 ****
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("BosExecutableTimestampGet",
! 			  DoBosExecutableTimestampGet, 0,
  			  "get the timestamps for a binary at bos server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server to query");
      cmd_AddParm(ts, "-executable", CMD_SINGLE, CMD_REQUIRED,
  		"path to the binary to revert");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosExecutablePrune", DoBosExecutablePrune, 0,
  			  "prune various files at bos server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server to modify");
      cmd_AddParm(ts, "-oldfiles", CMD_FLAG, CMD_OPTIONAL, "prune .old files");
--- 2037,2050 ----
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("BosExecutableTimestampGet",
! 			  DoBosExecutableTimestampGet, NULL,
  			  "get the timestamps for a binary at bos server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server to query");
      cmd_AddParm(ts, "-executable", CMD_SINGLE, CMD_REQUIRED,
  		"path to the binary to revert");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosExecutablePrune", DoBosExecutablePrune, NULL,
  			  "prune various files at bos server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server to modify");
      cmd_AddParm(ts, "-oldfiles", CMD_FLAG, CMD_OPTIONAL, "prune .old files");
***************
*** 2053,2059 ****
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("BosExecutableRestartTimeSet",
! 			  DoBosExecutableRestartTimeSet, 0,
  			  "set the restart times at a bos server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server to modify");
      cmd_AddParm(ts, "-daily", CMD_FLAG, CMD_OPTIONAL,
--- 2053,2059 ----
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("BosExecutableRestartTimeSet",
! 			  DoBosExecutableRestartTimeSet, NULL,
  			  "set the restart times at a bos server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server to modify");
      cmd_AddParm(ts, "-daily", CMD_FLAG, CMD_OPTIONAL,
***************
*** 2065,2071 ****
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("BosExecutableRestartTimeGet",
! 			  DoBosExecutableRestartTimeGet, 0,
  			  "get the restart times at a bos server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server to query");
      cmd_AddParm(ts, "-daily", CMD_FLAG, CMD_OPTIONAL,
--- 2065,2071 ----
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("BosExecutableRestartTimeGet",
! 			  DoBosExecutableRestartTimeGet, NULL,
  			  "get the restart times at a bos server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server to query");
      cmd_AddParm(ts, "-daily", CMD_FLAG, CMD_OPTIONAL,
***************
*** 2074,2087 ****
  		"get weekly restart time");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosLogGet", DoBosLogGet, 0,
  			  "get a log file from the bos server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server to query");
      cmd_AddParm(ts, "-logfile", CMD_SINGLE, CMD_REQUIRED,
  		"path to the log file to retrieve");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosAuthSet", DoBosAuthSet, 0,
  			  "set the authorization level at a bos server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server to modify");
      cmd_AddParm(ts, "-requireauth", CMD_FLAG, CMD_OPTIONAL,
--- 2074,2087 ----
  		"get weekly restart time");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosLogGet", DoBosLogGet, NULL,
  			  "get a log file from the bos server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server to query");
      cmd_AddParm(ts, "-logfile", CMD_SINGLE, CMD_REQUIRED,
  		"path to the log file to retrieve");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosAuthSet", DoBosAuthSet, NULL,
  			  "set the authorization level at a bos server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server to modify");
      cmd_AddParm(ts, "-requireauth", CMD_FLAG, CMD_OPTIONAL,
***************
*** 2098,2104 ****
  		"command to execute");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosSalvage", DoBosSalvage, 0,
  			  "execute a salvage command at a bos server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where salvager will execute");
--- 2098,2104 ----
  		"command to execute");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("BosSalvage", DoBosSalvage, NULL,
  			  "execute a salvage command at a bos server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where salvager will execute");
Index: openafs/src/libadmin/test/client.c
diff -c openafs/src/libadmin/test/client.c:1.8 openafs/src/libadmin/test/client.c:1.8.2.1
*** openafs/src/libadmin/test/client.c:1.8	Fri Dec 12 18:37:37 2003
--- openafs/src/libadmin/test/client.c	Wed Oct 31 00:13:42 2007
***************
*** 15,21 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/test/client.c,v 1.8 2003/12/12 23:37:37 shadow Exp $");
  
  #include "client.h"
  #include <afs/cellconfig.h>
--- 15,21 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/test/client.c,v 1.8.2.1 2007/10/31 04:13:42 shadow Exp $");
  
  #include "client.h"
  #include <afs/cellconfig.h>
***************
*** 262,268 ****
   */
  
  int
! DoClientLocalCellGet(struct cmd_syndesc *as, char *arock)
  {
      afs_status_t st = 0;
      char cellName[MAXCELLCHARS];
--- 262,268 ----
   */
  
  int
! DoClientLocalCellGet(struct cmd_syndesc *as, void *arock)
  {
      afs_status_t st = 0;
      char cellName[MAXCELLCHARS];
***************
*** 277,283 ****
  }
  
  int
! DoClientMountPointCreate(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { DIRECTORY, VOLUME, READWRITE,
  	CHECK
--- 277,283 ----
  }
  
  int
! DoClientMountPointCreate(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { DIRECTORY, VOLUME, READWRITE,
  	CHECK
***************
*** 331,337 ****
  }
  
  int
! DoClientAFSServerGet(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER } DoClientAFSServerGet_parm_t;
      afs_status_t st = 0;
--- 331,337 ----
  }
  
  int
! DoClientAFSServerGet(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER } DoClientAFSServerGet_parm_t;
      afs_status_t st = 0;
***************
*** 352,358 ****
  }
  
  int
! DoClientAFSServerList(struct cmd_syndesc *as, char *arock)
  {
      afs_status_t st = 0;
      afs_serverEntry_t entry;
--- 352,358 ----
  }
  
  int
! DoClientAFSServerList(struct cmd_syndesc *as, void *arock)
  {
      afs_status_t st = 0;
      afs_serverEntry_t entry;
***************
*** 476,482 ****
  }
  
  int
! DoClientRPCStatsStateGet(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, PROCESS,
  	STAT_TYPE
--- 476,482 ----
  }
  
  int
! DoClientRPCStatsStateGet(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, PROCESS,
  	STAT_TYPE
***************
*** 536,542 ****
  }
  
  int
! DoClientRPCStatsStateEnable(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, PROCESS, STAT_TYPE } DoClientRPCStatsEnable_parm_t;
      afs_status_t st = 0;
--- 536,542 ----
  }
  
  int
! DoClientRPCStatsStateEnable(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, PROCESS, STAT_TYPE } DoClientRPCStatsEnable_parm_t;
      afs_status_t st = 0;
***************
*** 590,596 ****
  }
  
  int
! DoClientRPCStatsStateDisable(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, PROCESS,
  	STAT_TYPE
--- 590,596 ----
  }
  
  int
! DoClientRPCStatsStateDisable(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, PROCESS,
  	STAT_TYPE
***************
*** 694,700 ****
  }
  
  int
! DoClientRPCStatsList(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, PROCESS, STAT_TYPE } DoClientRPCStatsList_parm_t;
      afs_status_t st = 0;
--- 694,700 ----
  }
  
  int
! DoClientRPCStatsList(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, PROCESS, STAT_TYPE } DoClientRPCStatsList_parm_t;
      afs_status_t st = 0;
***************
*** 819,825 ****
  }
  
  int
! DoClientRPCStatsClear(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, PROCESS, STAT_TYPE, CLEAR_ALL, CLEAR_INVOCATIONS,
  	CLEAR_BYTES_SENT, CLEAR_BYTES_RCVD,
--- 819,825 ----
  }
  
  int
! DoClientRPCStatsClear(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, PROCESS, STAT_TYPE, CLEAR_ALL, CLEAR_INVOCATIONS,
  	CLEAR_BYTES_SENT, CLEAR_BYTES_RCVD,
***************
*** 991,997 ****
  }
  
  int
! DoClientRPCStatsVersionGet(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, PROCESS } DoClientRPCStatsVersionGet_parm_t;
      afs_status_t st = 0;
--- 991,997 ----
  }
  
  int
! DoClientRPCStatsVersionGet(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, PROCESS } DoClientRPCStatsVersionGet_parm_t;
      afs_status_t st = 0;
***************
*** 1047,1053 ****
  }
  
  int
! DoClientCMGetServerPrefs(struct cmd_syndesc *as, char *arock)
  {
      afs_status_t st = 0;
      typedef enum { SERVER, PORT } DoClientCMGetServerPrefs_parm_t;
--- 1047,1053 ----
  }
  
  int
! DoClientCMGetServerPrefs(struct cmd_syndesc *as, void *arock)
  {
      afs_status_t st = 0;
      typedef enum { SERVER, PORT } DoClientCMGetServerPrefs_parm_t;
***************
*** 1117,1123 ****
  }
  
  int
! DoClientCMListCells(struct cmd_syndesc *as, char *arock)
  {
      afs_status_t st = 0;
      typedef enum { SERVER, PORT } DoClientCMListCells_parm_t;
--- 1117,1123 ----
  }
  
  int
! DoClientCMListCells(struct cmd_syndesc *as, void *arock)
  {
      afs_status_t st = 0;
      typedef enum { SERVER, PORT } DoClientCMListCells_parm_t;
***************
*** 1172,1178 ****
  }
  
  int
! DoClientCMLocalCell(struct cmd_syndesc *as, char *arock)
  {
      afs_status_t st = 0;
      typedef enum { SERVER, PORT } DoClientCMLocalCell_parm_t;
--- 1172,1178 ----
  }
  
  int
! DoClientCMLocalCell(struct cmd_syndesc *as, void *arock)
  {
      afs_status_t st = 0;
      typedef enum { SERVER, PORT } DoClientCMLocalCell_parm_t;
***************
*** 1231,1237 ****
  }
  
  int
! DoClientCMClientConfig(struct cmd_syndesc *as, char *arock)
  {
      afs_status_t st = 0;
      typedef enum { SERVER, PORT } DoClientCMLocalCell_parm_t;
--- 1231,1237 ----
  }
  
  int
! DoClientCMClientConfig(struct cmd_syndesc *as, void *arock)
  {
      afs_status_t st = 0;
      typedef enum { SERVER, PORT } DoClientCMLocalCell_parm_t;
***************
*** 1280,1291 ****
  {
      struct cmd_syndesc *ts;
  
!     ts = cmd_CreateSyntax("ClientLocalCellGet", DoClientLocalCellGet, 0,
  			  "get the name of this machine's cell");
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("ClientMountPointCreate", DoClientMountPointCreate,
! 			  0, "create a mount point");
      cmd_AddParm(ts, "-directory", CMD_SINGLE, CMD_REQUIRED,
  		"directory where mount point will be created");
      cmd_AddParm(ts, "-volume", CMD_SINGLE, CMD_REQUIRED,
--- 1280,1291 ----
  {
      struct cmd_syndesc *ts;
  
!     ts = cmd_CreateSyntax("ClientLocalCellGet", DoClientLocalCellGet, NULL,
  			  "get the name of this machine's cell");
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("ClientMountPointCreate", DoClientMountPointCreate,
! 			  NULL, "create a mount point");
      cmd_AddParm(ts, "-directory", CMD_SINGLE, CMD_REQUIRED,
  		"directory where mount point will be created");
      cmd_AddParm(ts, "-volume", CMD_SINGLE, CMD_REQUIRED,
***************
*** 1296,1307 ****
  		"check that the volume exists before mounting");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("ClientAFSServerGet", DoClientAFSServerGet, 0,
  			  "retrieve information about an afs server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server to query");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("ClientAFSServerList", DoClientAFSServerList, 0,
  			  "retrieve information about all afs "
  			  "servers in a cell");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
--- 1296,1307 ----
  		"check that the volume exists before mounting");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("ClientAFSServerGet", DoClientAFSServerGet, NULL,
  			  "retrieve information about an afs server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server to query");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("ClientAFSServerList", DoClientAFSServerList, NULL,
  			  "retrieve information about all afs "
  			  "servers in a cell");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
***************
*** 1314,1320 ****
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("ClientRPCStatsStateGet", DoClientRPCStatsStateGet,
! 			  0, "retrieve the rpc stat collection state");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where command will execute");
      cmd_AddParm(ts, "-process", CMD_SINGLE, CMD_REQUIRED,
--- 1314,1320 ----
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("ClientRPCStatsStateGet", DoClientRPCStatsStateGet,
! 			  NULL, "retrieve the rpc stat collection state");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where command will execute");
      cmd_AddParm(ts, "-process", CMD_SINGLE, CMD_REQUIRED,
***************
*** 1325,1331 ****
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("ClientRPCStatsStateEnable",
! 			  DoClientRPCStatsStateEnable, 0,
  			  "set the rpc stat collection state to on");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where command will execute");
--- 1325,1331 ----
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("ClientRPCStatsStateEnable",
! 			  DoClientRPCStatsStateEnable, NULL,
  			  "set the rpc stat collection state to on");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where command will execute");
***************
*** 1337,1343 ****
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("ClientRPCStatsStateDisable",
! 			  DoClientRPCStatsStateDisable, 0,
  			  "set the rpc stat collection state to off");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where command will execute");
--- 1337,1343 ----
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("ClientRPCStatsStateDisable",
! 			  DoClientRPCStatsStateDisable, NULL,
  			  "set the rpc stat collection state to off");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where command will execute");
***************
*** 1348,1354 ****
  		"stats to retrieve <peer or process>");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("ClientRPCStatsList", DoClientRPCStatsList, 0,
  			  "list the rpc stats");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where command will execute");
--- 1348,1354 ----
  		"stats to retrieve <peer or process>");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("ClientRPCStatsList", DoClientRPCStatsList, NULL,
  			  "list the rpc stats");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where command will execute");
***************
*** 1359,1365 ****
  		"stats to retrieve <peer or process>");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("ClientRPCStatsClear", DoClientRPCStatsClear, 0,
  			  "reset rpc stat counters");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where command will execute");
--- 1359,1365 ----
  		"stats to retrieve <peer or process>");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("ClientRPCStatsClear", DoClientRPCStatsClear, NULL,
  			  "reset rpc stat counters");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where command will execute");
***************
*** 1395,1401 ****
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("ClientRPCStatsVersionGet",
! 			  DoClientRPCStatsVersionGet, 0,
  			  "list the server's rpc stats version");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where command will execute");
--- 1395,1401 ----
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("ClientRPCStatsVersionGet",
! 			  DoClientRPCStatsVersionGet, NULL,
  			  "list the server's rpc stats version");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where command will execute");
***************
*** 1405,1431 ****
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("ClientCMGetServerPrefs", DoClientCMGetServerPrefs,
! 			  0, "list a client's server preferences ");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where command will execute");
      cmd_AddParm(ts, "-port", CMD_SINGLE, CMD_OPTIONAL, "UDP port to query");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("ClientCMListCells", DoClientCMListCells, 0,
  			  "list a client's CellServDB ");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where command will execute");
      cmd_AddParm(ts, "-port", CMD_SINGLE, CMD_OPTIONAL, "UDP port to query");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("ClientCMLocalCell", DoClientCMLocalCell, 0,
  			  "get the name of the client's local cell");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where command will execute");
      cmd_AddParm(ts, "-port", CMD_SINGLE, CMD_OPTIONAL, "UDP port to query");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("ClientCMClientConfig", DoClientCMClientConfig, 0,
  			  "get the client's cache configuration");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where command will execute");
--- 1405,1431 ----
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("ClientCMGetServerPrefs", DoClientCMGetServerPrefs,
! 			  NULL, "list a client's server preferences ");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where command will execute");
      cmd_AddParm(ts, "-port", CMD_SINGLE, CMD_OPTIONAL, "UDP port to query");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("ClientCMListCells", DoClientCMListCells, NULL,
  			  "list a client's CellServDB ");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where command will execute");
      cmd_AddParm(ts, "-port", CMD_SINGLE, CMD_OPTIONAL, "UDP port to query");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("ClientCMLocalCell", DoClientCMLocalCell, NULL,
  			  "get the name of the client's local cell");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where command will execute");
      cmd_AddParm(ts, "-port", CMD_SINGLE, CMD_OPTIONAL, "UDP port to query");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("ClientCMClientConfig", DoClientCMClientConfig, NULL,
  			  "get the client's cache configuration");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where command will execute");
Index: openafs/src/libadmin/test/kas.c
diff -c openafs/src/libadmin/test/kas.c:1.8 openafs/src/libadmin/test/kas.c:1.8.2.1
*** openafs/src/libadmin/test/kas.c:1.8	Sat Nov 29 17:08:13 2003
--- openafs/src/libadmin/test/kas.c	Wed Oct 31 00:13:42 2007
***************
*** 15,21 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/test/kas.c,v 1.8 2003/11/29 22:08:13 jaltman Exp $");
  
  #include "kas.h"
  #include <time.h>
--- 15,21 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/test/kas.c,v 1.8.2.1 2007/10/31 04:13:42 shadow Exp $");
  
  #include "kas.h"
  #include <time.h>
***************
*** 45,51 ****
  }
  
  int
! DoKasPrincipalCreate(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { PRINCIPAL, INSTANCE,
  	PASSWORD
--- 45,51 ----
  }
  
  int
! DoKasPrincipalCreate(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { PRINCIPAL, INSTANCE,
  	PASSWORD
***************
*** 73,79 ****
  }
  
  int
! DoKasPrincipalDelete(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { PRINCIPAL, INSTANCE } DoKasPrincipalGet_parm_t;
      afs_status_t st = 0;
--- 73,79 ----
  }
  
  int
! DoKasPrincipalDelete(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { PRINCIPAL, INSTANCE } DoKasPrincipalGet_parm_t;
      afs_status_t st = 0;
***************
*** 160,166 ****
  }
  
  int
! DoKasPrincipalGet(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { PRINCIPAL, INSTANCE } DoKasPrincipalGet_parm_t;
      afs_status_t st = 0;
--- 160,166 ----
  }
  
  int
! DoKasPrincipalGet(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { PRINCIPAL, INSTANCE } DoKasPrincipalGet_parm_t;
      afs_status_t st = 0;
***************
*** 186,192 ****
  }
  
  int
! DoKasPrincipalList(struct cmd_syndesc *as, char *arock)
  {
      afs_status_t st = 0;
      void *iter;
--- 186,192 ----
  }
  
  int
! DoKasPrincipalList(struct cmd_syndesc *as, void *arock)
  {
      afs_status_t st = 0;
      void *iter;
***************
*** 218,224 ****
  }
  
  int
! DoKasPrincipalKeySet(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { PRINCIPAL, INSTANCE, PASSWORD,
  	KEYVERSION
--- 218,224 ----
  }
  
  int
! DoKasPrincipalKeySet(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { PRINCIPAL, INSTANCE, PASSWORD,
  	KEYVERSION
***************
*** 258,264 ****
  }
  
  int
! DoKasPrincipalLockStatusGet(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { PRINCIPAL, INSTANCE } DoKasPrincipalLockStatusGet_parm_t;
      afs_status_t st = 0;
--- 258,264 ----
  }
  
  int
! DoKasPrincipalLockStatusGet(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { PRINCIPAL, INSTANCE } DoKasPrincipalLockStatusGet_parm_t;
      afs_status_t st = 0;
***************
*** 284,290 ****
  }
  
  int
! DoKasPrincipalUnlock(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { PRINCIPAL, INSTANCE } DoKasPrincipalUnlock_parm_t;
      afs_status_t st = 0;
--- 284,290 ----
  }
  
  int
! DoKasPrincipalUnlock(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { PRINCIPAL, INSTANCE } DoKasPrincipalUnlock_parm_t;
      afs_status_t st = 0;
***************
*** 307,313 ****
  }
  
  int
! DoKasPrincipalFieldsSet(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { PRINCIPAL, INSTANCE, ADMIN, NOADMIN, GRANTTICKET,
  	NOGRANTTICKET, ENCRYPT2, NOENCRYPT, CHANGEPASSWORD,
--- 307,313 ----
  }
  
  int
! DoKasPrincipalFieldsSet(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { PRINCIPAL, INSTANCE, ADMIN, NOADMIN, GRANTTICKET,
  	NOGRANTTICKET, ENCRYPT2, NOENCRYPT, CHANGEPASSWORD,
***************
*** 549,555 ****
  }
  
  int
! DoKasServerStatsGet(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER } DoKasServerStatsGet_parm_t;
      afs_status_t st = 0;
--- 549,555 ----
  }
  
  int
! DoKasServerStatsGet(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER } DoKasServerStatsGet_parm_t;
      afs_status_t st = 0;
***************
*** 634,640 ****
  }
  
  int
! DoKasServerDebugGet(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER } DoKasServerDebugGet_parm_t;
      afs_status_t st = 0;
--- 634,640 ----
  }
  
  int
! DoKasServerDebugGet(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER } DoKasServerDebugGet_parm_t;
      afs_status_t st = 0;
***************
*** 662,668 ****
  }
  
  int
! DoKasServerRandomKeyGet(struct cmd_syndesc *as, char *arock)
  {
      afs_status_t st = 0;
      kas_encryptionKey_t key;
--- 662,668 ----
  }
  
  int
! DoKasServerRandomKeyGet(struct cmd_syndesc *as, void *arock)
  {
      afs_status_t st = 0;
      kas_encryptionKey_t key;
***************
*** 686,692 ****
  {
      struct cmd_syndesc *ts;
  
!     ts = cmd_CreateSyntax("KasPrincipalCreate", DoKasPrincipalCreate, 0,
  			  "create a new principal");
      cmd_AddParm(ts, "-principal", CMD_SINGLE, CMD_REQUIRED,
  		"principal to create");
--- 686,692 ----
  {
      struct cmd_syndesc *ts;
  
!     ts = cmd_CreateSyntax("KasPrincipalCreate", DoKasPrincipalCreate, NULL,
  			  "create a new principal");
      cmd_AddParm(ts, "-principal", CMD_SINGLE, CMD_REQUIRED,
  		"principal to create");
***************
*** 696,702 ****
  		"initial principal password");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("KasPrincipalDelete", DoKasPrincipalDelete, 0,
  			  "delete a principal");
      cmd_AddParm(ts, "-principal", CMD_SINGLE, CMD_REQUIRED,
  		"principal to delete");
--- 696,702 ----
  		"initial principal password");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("KasPrincipalDelete", DoKasPrincipalDelete, NULL,
  			  "delete a principal");
      cmd_AddParm(ts, "-principal", CMD_SINGLE, CMD_REQUIRED,
  		"principal to delete");
***************
*** 704,710 ****
  		"principal instance");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("KasPrincipalGet", DoKasPrincipalGet, 0,
  			  "get information about a principal");
      cmd_AddParm(ts, "-principal", CMD_SINGLE, CMD_REQUIRED,
  		"principal to get");
--- 704,710 ----
  		"principal instance");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("KasPrincipalGet", DoKasPrincipalGet, NULL,
  			  "get information about a principal");
      cmd_AddParm(ts, "-principal", CMD_SINGLE, CMD_REQUIRED,
  		"principal to get");
***************
*** 712,722 ****
  		"principal instance");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("KasPrincipalList", DoKasPrincipalList, 0,
  			  "list all principals");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("KasPrincipalKeySet", DoKasPrincipalKeySet, 0,
  			  "set the password for a principal");
      cmd_AddParm(ts, "-principal", CMD_SINGLE, CMD_REQUIRED,
  		"principal to modify");
--- 712,722 ----
  		"principal instance");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("KasPrincipalList", DoKasPrincipalList, NULL,
  			  "list all principals");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("KasPrincipalKeySet", DoKasPrincipalKeySet, NULL,
  			  "set the password for a principal");
      cmd_AddParm(ts, "-principal", CMD_SINGLE, CMD_REQUIRED,
  		"principal to modify");
***************
*** 729,735 ****
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("KasPrincipalLockStatusGet",
! 			  DoKasPrincipalLockStatusGet, 0,
  			  "get the lock status of a principal");
      cmd_AddParm(ts, "-principal", CMD_SINGLE, CMD_REQUIRED,
  		"principal to query");
--- 729,735 ----
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("KasPrincipalLockStatusGet",
! 			  DoKasPrincipalLockStatusGet, NULL,
  			  "get the lock status of a principal");
      cmd_AddParm(ts, "-principal", CMD_SINGLE, CMD_REQUIRED,
  		"principal to query");
***************
*** 737,743 ****
  		"principal instance");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("KasPrincipalUnlock", DoKasPrincipalUnlock, 0,
  			  "unlock a principal");
      cmd_AddParm(ts, "-principal", CMD_SINGLE, CMD_REQUIRED,
  		"principal to unlock");
--- 737,743 ----
  		"principal instance");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("KasPrincipalUnlock", DoKasPrincipalUnlock, NULL,
  			  "unlock a principal");
      cmd_AddParm(ts, "-principal", CMD_SINGLE, CMD_REQUIRED,
  		"principal to unlock");
***************
*** 745,751 ****
  		"principal instance");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("KasPrincipalFieldsSet", DoKasPrincipalFieldsSet, 0,
  			  "modify a principal");
      cmd_AddParm(ts, "-principal", CMD_SINGLE, CMD_REQUIRED,
  		"principal to modify");
--- 745,751 ----
  		"principal instance");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("KasPrincipalFieldsSet", DoKasPrincipalFieldsSet, NULL,
  			  "modify a principal");
      cmd_AddParm(ts, "-principal", CMD_SINGLE, CMD_REQUIRED,
  		"principal to modify");
***************
*** 785,801 ****
  		"maximum failed password attempts is exceeded");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("KasServerStatsGet", DoKasServerStatsGet, 0,
  			  "get stats on a kaserver");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server to query");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("KasServerDebugGet", DoKasServerDebugGet, 0,
  			  "get debug info from a kaserver");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server to query");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("KasServerRandomKeyGet", DoKasServerRandomKeyGet, 0,
  			  "create a random key");
      SetupCommonCmdArgs(ts);
  
--- 785,801 ----
  		"maximum failed password attempts is exceeded");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("KasServerStatsGet", DoKasServerStatsGet, NULL,
  			  "get stats on a kaserver");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server to query");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("KasServerDebugGet", DoKasServerDebugGet, NULL,
  			  "get debug info from a kaserver");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server to query");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("KasServerRandomKeyGet", DoKasServerRandomKeyGet, NULL,
  			  "create a random key");
      SetupCommonCmdArgs(ts);
  
Index: openafs/src/libadmin/test/pts.c
diff -c openafs/src/libadmin/test/pts.c:1.5 openafs/src/libadmin/test/pts.c:1.5.2.1
*** openafs/src/libadmin/test/pts.c:1.5	Tue Jul 15 19:15:34 2003
--- openafs/src/libadmin/test/pts.c	Wed Oct 31 00:13:42 2007
***************
*** 15,21 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/test/pts.c,v 1.5 2003/07/15 23:15:34 shadow Exp $");
  
  #include "pts.h"
  
--- 15,21 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/test/pts.c,v 1.5.2.1 2007/10/31 04:13:42 shadow Exp $");
  
  #include "pts.h"
  
***************
*** 90,96 ****
  }
  
  int
! DoPtsGroupMemberAdd(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { USER, GROUP } DoPtsGroupMemberAdd_parm_t;
      afs_status_t st = 0;
--- 90,96 ----
  }
  
  int
! DoPtsGroupMemberAdd(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { USER, GROUP } DoPtsGroupMemberAdd_parm_t;
      afs_status_t st = 0;
***************
*** 105,111 ****
  }
  
  int
! DoPtsGroupOwnerChange(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { OWNER, GROUP } DoPtsGroupOwnerChange_parm_t;
      afs_status_t st = 0;
--- 105,111 ----
  }
  
  int
! DoPtsGroupOwnerChange(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { OWNER, GROUP } DoPtsGroupOwnerChange_parm_t;
      afs_status_t st = 0;
***************
*** 120,126 ****
  }
  
  int
! DoPtsGroupCreate(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { OWNER, GROUP } DoPtsGroupCreate_parm_t;
      afs_status_t st = 0;
--- 120,126 ----
  }
  
  int
! DoPtsGroupCreate(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { OWNER, GROUP } DoPtsGroupCreate_parm_t;
      afs_status_t st = 0;
***************
*** 170,176 ****
  }
  
  int
! DoPtsGroupGet(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { GROUP } DoPtsGroupGet_parm_t;
      afs_status_t st = 0;
--- 170,176 ----
  }
  
  int
! DoPtsGroupGet(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { GROUP } DoPtsGroupGet_parm_t;
      afs_status_t st = 0;
***************
*** 187,193 ****
  }
  
  int
! DoPtsGroupDelete(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { GROUP } DoPtsGroupDelete_parm_t;
      afs_status_t st = 0;
--- 187,193 ----
  }
  
  int
! DoPtsGroupDelete(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { GROUP } DoPtsGroupDelete_parm_t;
      afs_status_t st = 0;
***************
*** 201,207 ****
  }
  
  int
! DoPtsGroupMaxGet(struct cmd_syndesc *as, char *arock)
  {
      afs_status_t st = 0;
      int max_group_id;
--- 201,207 ----
  }
  
  int
! DoPtsGroupMaxGet(struct cmd_syndesc *as, void *arock)
  {
      afs_status_t st = 0;
      int max_group_id;
***************
*** 214,220 ****
  }
  
  int
! DoPtsGroupMaxSet(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { MAX } DoPtsGroupMaxSet_parm_t;
      afs_status_t st = 0;
--- 214,220 ----
  }
  
  int
! DoPtsGroupMaxSet(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { MAX } DoPtsGroupMaxSet_parm_t;
      afs_status_t st = 0;
***************
*** 231,237 ****
  }
  
  int
! DoPtsGroupMemberList(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { GROUP } DoPtsGroupMemberList_parm_t;
      afs_status_t st = 0;
--- 231,237 ----
  }
  
  int
! DoPtsGroupMemberList(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { GROUP } DoPtsGroupMemberList_parm_t;
      afs_status_t st = 0;
***************
*** 260,266 ****
  }
  
  int
! DoPtsGroupMemberRemove(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { USER, GROUP } DoPtsGroupMemberRemove_parm_t;
      afs_status_t st = 0;
--- 260,266 ----
  }
  
  int
! DoPtsGroupMemberRemove(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { USER, GROUP } DoPtsGroupMemberRemove_parm_t;
      afs_status_t st = 0;
***************
*** 275,281 ****
  }
  
  int
! DoPtsGroupRename(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { GROUP, NEWNAME } DoPtsGroupRename_parm_t;
      afs_status_t st = 0;
--- 275,281 ----
  }
  
  int
! DoPtsGroupRename(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { GROUP, NEWNAME } DoPtsGroupRename_parm_t;
      afs_status_t st = 0;
***************
*** 290,296 ****
  }
  
  int
! DoPtsGroupModify(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { GROUP, LISTSTATUS, LISTGROUPSOWNED, LISTMEMBERSHIP,
  	LISTADD, LISTDELTE
--- 290,296 ----
  }
  
  int
! DoPtsGroupModify(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { GROUP, LISTSTATUS, LISTGROUPSOWNED, LISTMEMBERSHIP,
  	LISTADD, LISTDELTE
***************
*** 323,329 ****
  }
  
  int
! DoPtsUserCreate(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { USER } DoPtsUserCreate_parm_t;
      afs_status_t st = 0;
--- 323,329 ----
  }
  
  int
! DoPtsUserCreate(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { USER } DoPtsUserCreate_parm_t;
      afs_status_t st = 0;
***************
*** 340,346 ****
  }
  
  int
! DoPtsUserDelete(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { USER } DoPtsUserDelete_parm_t;
      afs_status_t st = 0;
--- 340,346 ----
  }
  
  int
! DoPtsUserDelete(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { USER } DoPtsUserDelete_parm_t;
      afs_status_t st = 0;
***************
*** 383,389 ****
  }
  
  int
! DoPtsUserGet(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { USER } DoPtsUserGet_parm_t;
      afs_status_t st = 0;
--- 383,389 ----
  }
  
  int
! DoPtsUserGet(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { USER } DoPtsUserGet_parm_t;
      afs_status_t st = 0;
***************
*** 400,406 ****
  }
  
  int
! DoPtsUserRename(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { USER, NEWNAME } DoPtsUserRename_parm_t;
      afs_status_t st = 0;
--- 400,406 ----
  }
  
  int
! DoPtsUserRename(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { USER, NEWNAME } DoPtsUserRename_parm_t;
      afs_status_t st = 0;
***************
*** 415,421 ****
  }
  
  int
! DoPtsUserModify(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { USER, GROUPQUOTA, LISTSTATUS, LISTGROUPSOWNED,
  	LISTMEMBERSHIP
--- 415,421 ----
  }
  
  int
! DoPtsUserModify(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { USER, GROUPQUOTA, LISTSTATUS, LISTGROUPSOWNED,
  	LISTMEMBERSHIP
***************
*** 481,487 ****
  }
  
  int
! DoPtsUserMaxGet(struct cmd_syndesc *as, char *arock)
  {
      afs_status_t st = 0;
      int max_user_id;
--- 481,487 ----
  }
  
  int
! DoPtsUserMaxGet(struct cmd_syndesc *as, void *arock)
  {
      afs_status_t st = 0;
      int max_user_id;
***************
*** 494,500 ****
  }
  
  int
! DoPtsUserMaxSet(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { MAX } DoPtsUserMaxSet_parm_t;
      afs_status_t st = 0;
--- 494,500 ----
  }
  
  int
! DoPtsUserMaxSet(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { MAX } DoPtsUserMaxSet_parm_t;
      afs_status_t st = 0;
***************
*** 511,517 ****
  }
  
  int
! DoPtsUserMemberList(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { USER } DoPtsUserMemberList_parm_t;
      afs_status_t st = 0;
--- 511,517 ----
  }
  
  int
! DoPtsUserMemberList(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { USER } DoPtsUserMemberList_parm_t;
      afs_status_t st = 0;
***************
*** 541,547 ****
  }
  
  int
! DoPtsOwnedGroupList(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { USER } DoPtsOwnedGroupList_parm_t;
      afs_status_t st = 0;
--- 541,547 ----
  }
  
  int
! DoPtsOwnedGroupList(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { USER } DoPtsOwnedGroupList_parm_t;
      afs_status_t st = 0;
***************
*** 575,635 ****
  {
      struct cmd_syndesc *ts;
  
!     ts = cmd_CreateSyntax("PtsGroupMemberAdd", DoPtsGroupMemberAdd, 0,
  			  "add a user to a group");
      cmd_AddParm(ts, "-user", CMD_SINGLE, CMD_REQUIRED, "user to add");
      cmd_AddParm(ts, "-group", CMD_SINGLE, CMD_REQUIRED, "group to modify");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("PtsGroupOwnerChange", DoPtsGroupOwnerChange, 0,
  			  "change the owner of a group");
      cmd_AddParm(ts, "-owner", CMD_SINGLE, CMD_REQUIRED, "new owner");
      cmd_AddParm(ts, "-group", CMD_SINGLE, CMD_REQUIRED, "group to modify");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("PtsGroupCreate", DoPtsGroupCreate, 0,
  			  "create a new group");
      cmd_AddParm(ts, "-owner", CMD_SINGLE, CMD_REQUIRED, "owner of group");
      cmd_AddParm(ts, "-group", CMD_SINGLE, CMD_REQUIRED, "group to create");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("PtsGroupGet", DoPtsGroupGet, 0,
  			  "get information about a group");
      cmd_AddParm(ts, "-group", CMD_SINGLE, CMD_REQUIRED, "group to query");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("PtsGroupDelete", DoPtsGroupDelete, 0,
  			  "delete a group");
      cmd_AddParm(ts, "-group", CMD_SINGLE, CMD_REQUIRED, "group to delete");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("PtsGroupMaxGet", DoPtsGroupMaxGet, 0,
  			  "get the maximum group id");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("PtsGroupMaxSet", DoPtsGroupMaxSet, 0,
  			  "set the maximum group id");
      cmd_AddParm(ts, "-max", CMD_SINGLE, CMD_REQUIRED, "new max group id");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("PtsGroupMemberList", DoPtsGroupMemberList, 0,
  			  "list members of a group");
      cmd_AddParm(ts, "-group", CMD_SINGLE, CMD_REQUIRED, "group to query");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("PtsGroupMemberRemove", DoPtsGroupMemberRemove, 0,
  			  "remove a member from a group");
      cmd_AddParm(ts, "-user", CMD_SINGLE, CMD_REQUIRED, "user to remove");
      cmd_AddParm(ts, "-group", CMD_SINGLE, CMD_REQUIRED, "group to modify");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("PtsGroupRename", DoPtsGroupRename, 0,
  			  "rename a group");
      cmd_AddParm(ts, "-group", CMD_SINGLE, CMD_REQUIRED, "group to modify");
      cmd_AddParm(ts, "-newname", CMD_SINGLE, CMD_REQUIRED, "new group name");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("PtsGroupModify", DoPtsGroupModify, 0,
  			  "modify a group");
      cmd_AddParm(ts, "-group", CMD_SINGLE, CMD_REQUIRED, "group to modify");
      cmd_AddParm(ts, "-liststatus", CMD_SINGLE, CMD_REQUIRED,
--- 575,635 ----
  {
      struct cmd_syndesc *ts;
  
!     ts = cmd_CreateSyntax("PtsGroupMemberAdd", DoPtsGroupMemberAdd, NULL,
  			  "add a user to a group");
      cmd_AddParm(ts, "-user", CMD_SINGLE, CMD_REQUIRED, "user to add");
      cmd_AddParm(ts, "-group", CMD_SINGLE, CMD_REQUIRED, "group to modify");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("PtsGroupOwnerChange", DoPtsGroupOwnerChange, NULL,
  			  "change the owner of a group");
      cmd_AddParm(ts, "-owner", CMD_SINGLE, CMD_REQUIRED, "new owner");
      cmd_AddParm(ts, "-group", CMD_SINGLE, CMD_REQUIRED, "group to modify");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("PtsGroupCreate", DoPtsGroupCreate, NULL,
  			  "create a new group");
      cmd_AddParm(ts, "-owner", CMD_SINGLE, CMD_REQUIRED, "owner of group");
      cmd_AddParm(ts, "-group", CMD_SINGLE, CMD_REQUIRED, "group to create");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("PtsGroupGet", DoPtsGroupGet, NULL,
  			  "get information about a group");
      cmd_AddParm(ts, "-group", CMD_SINGLE, CMD_REQUIRED, "group to query");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("PtsGroupDelete", DoPtsGroupDelete, NULL,
  			  "delete a group");
      cmd_AddParm(ts, "-group", CMD_SINGLE, CMD_REQUIRED, "group to delete");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("PtsGroupMaxGet", DoPtsGroupMaxGet, NULL,
  			  "get the maximum group id");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("PtsGroupMaxSet", DoPtsGroupMaxSet, NULL,
  			  "set the maximum group id");
      cmd_AddParm(ts, "-max", CMD_SINGLE, CMD_REQUIRED, "new max group id");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("PtsGroupMemberList", DoPtsGroupMemberList, NULL,
  			  "list members of a group");
      cmd_AddParm(ts, "-group", CMD_SINGLE, CMD_REQUIRED, "group to query");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("PtsGroupMemberRemove", DoPtsGroupMemberRemove, NULL,
  			  "remove a member from a group");
      cmd_AddParm(ts, "-user", CMD_SINGLE, CMD_REQUIRED, "user to remove");
      cmd_AddParm(ts, "-group", CMD_SINGLE, CMD_REQUIRED, "group to modify");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("PtsGroupRename", DoPtsGroupRename, NULL,
  			  "rename a group");
      cmd_AddParm(ts, "-group", CMD_SINGLE, CMD_REQUIRED, "group to modify");
      cmd_AddParm(ts, "-newname", CMD_SINGLE, CMD_REQUIRED, "new group name");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("PtsGroupModify", DoPtsGroupModify, NULL,
  			  "modify a group");
      cmd_AddParm(ts, "-group", CMD_SINGLE, CMD_REQUIRED, "group to modify");
      cmd_AddParm(ts, "-liststatus", CMD_SINGLE, CMD_REQUIRED,
***************
*** 644,671 ****
  		"list delete permission <owner | group>");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("PtsUserCreate", DoPtsUserCreate, 0,
  			  "create a new user");
      cmd_AddParm(ts, "-user", CMD_SINGLE, CMD_REQUIRED, "user to create");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("PtsUserDelete", DoPtsUserDelete, 0,
  			  "delete a user");
      cmd_AddParm(ts, "-user", CMD_SINGLE, CMD_REQUIRED, "user to delete");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("PtsUserGet", DoPtsUserGet, 0,
  			  "get information about a user");
      cmd_AddParm(ts, "-user", CMD_SINGLE, CMD_REQUIRED, "user to query");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("PtsUserRename", DoPtsUserRename, 0,
  			  "rename a user");
      cmd_AddParm(ts, "-user", CMD_SINGLE, CMD_REQUIRED, "user to modify");
      cmd_AddParm(ts, "-newname", CMD_SINGLE, CMD_REQUIRED, "new user name");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("PtsUserModify", DoPtsUserModify, 0,
  			  "change a user");
      cmd_AddParm(ts, "-user", CMD_SINGLE, CMD_REQUIRED, "user to modify");
      cmd_AddParm(ts, "-groupquota", CMD_SINGLE, CMD_OPTIONAL,
--- 644,671 ----
  		"list delete permission <owner | group>");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("PtsUserCreate", DoPtsUserCreate, NULL,
  			  "create a new user");
      cmd_AddParm(ts, "-user", CMD_SINGLE, CMD_REQUIRED, "user to create");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("PtsUserDelete", DoPtsUserDelete, NULL,
  			  "delete a user");
      cmd_AddParm(ts, "-user", CMD_SINGLE, CMD_REQUIRED, "user to delete");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("PtsUserGet", DoPtsUserGet, NULL,
  			  "get information about a user");
      cmd_AddParm(ts, "-user", CMD_SINGLE, CMD_REQUIRED, "user to query");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("PtsUserRename", DoPtsUserRename, NULL,
  			  "rename a user");
      cmd_AddParm(ts, "-user", CMD_SINGLE, CMD_REQUIRED, "user to modify");
      cmd_AddParm(ts, "-newname", CMD_SINGLE, CMD_REQUIRED, "new user name");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("PtsUserModify", DoPtsUserModify, NULL,
  			  "change a user");
      cmd_AddParm(ts, "-user", CMD_SINGLE, CMD_REQUIRED, "user to modify");
      cmd_AddParm(ts, "-groupquota", CMD_SINGLE, CMD_OPTIONAL,
***************
*** 678,698 ****
  		"list membership permission <owner | any>");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("PtsUserMaxGet", DoPtsUserMaxGet, 0,
  			  "get the max user id");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("PtsUserMaxSet", DoPtsUserMaxSet, 0,
  			  "set the max user id");
      cmd_AddParm(ts, "-max", CMD_SINGLE, CMD_REQUIRED, "max user id");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("PtsUserMemberList", DoPtsUserMemberList, 0,
  			  "list group membership for a user");
      cmd_AddParm(ts, "-user", CMD_SINGLE, CMD_REQUIRED, "user to query");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("PtsOwnedGroupList", DoPtsOwnedGroupList, 0,
  			  "list groups owned by a user");
      cmd_AddParm(ts, "-user", CMD_SINGLE, CMD_REQUIRED, "user to query");
      SetupCommonCmdArgs(ts);
--- 678,698 ----
  		"list membership permission <owner | any>");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("PtsUserMaxGet", DoPtsUserMaxGet, NULL,
  			  "get the max user id");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("PtsUserMaxSet", DoPtsUserMaxSet, NULL,
  			  "set the max user id");
      cmd_AddParm(ts, "-max", CMD_SINGLE, CMD_REQUIRED, "max user id");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("PtsUserMemberList", DoPtsUserMemberList, NULL,
  			  "list group membership for a user");
      cmd_AddParm(ts, "-user", CMD_SINGLE, CMD_REQUIRED, "user to query");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("PtsOwnedGroupList", DoPtsOwnedGroupList, NULL,
  			  "list groups owned by a user");
      cmd_AddParm(ts, "-user", CMD_SINGLE, CMD_REQUIRED, "user to query");
      SetupCommonCmdArgs(ts);
Index: openafs/src/libadmin/test/util.c
diff -c openafs/src/libadmin/test/util.c:1.5 openafs/src/libadmin/test/util.c:1.5.2.1
*** openafs/src/libadmin/test/util.c:1.5	Tue Jul 15 19:15:34 2003
--- openafs/src/libadmin/test/util.c	Wed Oct 31 00:13:42 2007
***************
*** 15,26 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/test/util.c,v 1.5 2003/07/15 23:15:34 shadow Exp $");
  
  #include "util.h"
  
  int
! DoUtilErrorTranslate(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { ERROR_CODE } DoUtilErrorTranslate_parm_t;
      afs_status_t st = 0;
--- 15,26 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/test/util.c,v 1.5.2.1 2007/10/31 04:13:42 shadow Exp $");
  
  #include "util.h"
  
  int
! DoUtilErrorTranslate(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { ERROR_CODE } DoUtilErrorTranslate_parm_t;
      afs_status_t st = 0;
***************
*** 37,43 ****
  }
  
  int
! DoUtilDatabaseServerList(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { CELL_NAME } DoUtilDatabaseServerList_parm_t;
      afs_status_t st = 0;
--- 37,43 ----
  }
  
  int
! DoUtilDatabaseServerList(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { CELL_NAME } DoUtilDatabaseServerList_parm_t;
      afs_status_t st = 0;
***************
*** 66,72 ****
  }
  
  int
! DoUtilNameToAddress(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER_NAME } DoUtilNameToAddress_parm_t;
      afs_status_t st = 0;
--- 66,72 ----
  }
  
  int
! DoUtilNameToAddress(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER_NAME } DoUtilNameToAddress_parm_t;
      afs_status_t st = 0;
***************
*** 88,104 ****
  {
      struct cmd_syndesc *ts;
  
!     ts = cmd_CreateSyntax("UtilErrorTranslate", DoUtilErrorTranslate, 0,
  			  "translate an error code");
      cmd_AddParm(ts, "-error", CMD_SINGLE, CMD_REQUIRED, "error code");
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("UtilDatabaseServerList", DoUtilDatabaseServerList,
! 			  0, "list the database servers in a cell");
      cmd_AddParm(ts, "-cell", CMD_SINGLE, CMD_REQUIRED, "cell to list");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("UtilNameToAddress", DoUtilNameToAddress, 0,
  			  "translate a host name to an address");
      cmd_AddParm(ts, "-host", CMD_SINGLE, CMD_REQUIRED, "host name");
      SetupCommonCmdArgs(ts);
--- 88,104 ----
  {
      struct cmd_syndesc *ts;
  
!     ts = cmd_CreateSyntax("UtilErrorTranslate", DoUtilErrorTranslate, NULL,
  			  "translate an error code");
      cmd_AddParm(ts, "-error", CMD_SINGLE, CMD_REQUIRED, "error code");
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("UtilDatabaseServerList", DoUtilDatabaseServerList,
! 			  NULL, "list the database servers in a cell");
      cmd_AddParm(ts, "-cell", CMD_SINGLE, CMD_REQUIRED, "cell to list");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("UtilNameToAddress", DoUtilNameToAddress, NULL,
  			  "translate a host name to an address");
      cmd_AddParm(ts, "-host", CMD_SINGLE, CMD_REQUIRED, "host name");
      SetupCommonCmdArgs(ts);
Index: openafs/src/libadmin/test/util.h
diff -c openafs/src/libadmin/test/util.h:1.4 openafs/src/libadmin/test/util.h:1.4.2.1
*** openafs/src/libadmin/test/util.h:1.4	Tue Jul 15 19:15:34 2003
--- openafs/src/libadmin/test/util.h	Wed Oct 31 00:13:42 2007
***************
*** 29,41 ****
  #include "common.h"
  
  int
!   DoUtilErrorTranslate(struct cmd_syndesc *as, char *arock);
  
  int
!   DoUtilDatabaseServerList(struct cmd_syndesc *as, char *arock);
  
  int
!   DoUtilNameToAddress(struct cmd_syndesc *as, char *arock);
  
  void
    SetupUtilAdminCmd(void);
--- 29,41 ----
  #include "common.h"
  
  int
!   DoUtilErrorTranslate(struct cmd_syndesc *as, void *arock);
  
  int
!   DoUtilDatabaseServerList(struct cmd_syndesc *as, void *arock);
  
  int
!   DoUtilNameToAddress(struct cmd_syndesc *as, void *arock);
  
  void
    SetupUtilAdminCmd(void);
Index: openafs/src/libadmin/test/vos.c
diff -c openafs/src/libadmin/test/vos.c:1.6 openafs/src/libadmin/test/vos.c:1.6.2.1
*** openafs/src/libadmin/test/vos.c:1.6	Fri Aug  8 17:54:41 2003
--- openafs/src/libadmin/test/vos.c	Wed Oct 31 00:13:42 2007
***************
*** 15,21 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/test/vos.c,v 1.6 2003/08/08 21:54:41 shadow Exp $");
  
  #include "vos.h"
  
--- 15,21 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/test/vos.c,v 1.6.2.1 2007/10/31 04:13:42 shadow Exp $");
  
  #include "vos.h"
  
***************
*** 141,147 ****
  }
  
  int
! DoVosBackupVolumeCreate(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { VOLUME } DoVosBackupVolumeCreate_parm_t;
      afs_status_t st = 0;
--- 141,147 ----
  }
  
  int
! DoVosBackupVolumeCreate(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { VOLUME } DoVosBackupVolumeCreate_parm_t;
      afs_status_t st = 0;
***************
*** 159,165 ****
  }
  
  int
! DoVosBackupVolumeCreateMultiple(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, PARTITION, PREFIX,
  	EXCLUDE
--- 159,165 ----
  }
  
  int
! DoVosBackupVolumeCreateMultiple(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, PARTITION, PREFIX,
  	EXCLUDE
***************
*** 211,217 ****
  }
  
  int
! DoVosPartitionGet(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, PARTITION } DoVosPartitionGet_parm_t;
      afs_status_t st = 0;
--- 211,217 ----
  }
  
  int
! DoVosPartitionGet(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, PARTITION } DoVosPartitionGet_parm_t;
      afs_status_t st = 0;
***************
*** 242,248 ****
  }
  
  int
! DoVosPartitionList(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER } DoVosPartitionGet_parm_t;
      afs_status_t st = 0;
--- 242,248 ----
  }
  
  int
! DoVosPartitionList(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER } DoVosPartitionGet_parm_t;
      afs_status_t st = 0;
***************
*** 278,284 ****
  }
  
  int
! DoVosServerSync(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, PARTITION } DoVosServerSync_parm_t;
      afs_status_t st = 0;
--- 278,284 ----
  }
  
  int
! DoVosServerSync(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, PARTITION } DoVosServerSync_parm_t;
      afs_status_t st = 0;
***************
*** 306,312 ****
  }
  
  int
! DoVosFileServerAddressChange(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { OLDADDRESS,
  	NEWADDRESS
--- 306,312 ----
  }
  
  int
! DoVosFileServerAddressChange(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { OLDADDRESS,
  	NEWADDRESS
***************
*** 331,337 ****
  }
  
  int
! DoVosFileServerAddressRemove(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { ADDRESS } DoVosFileServerAddressRemove_parm_t;
      afs_status_t st = 0;
--- 331,337 ----
  }
  
  int
! DoVosFileServerAddressRemove(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { ADDRESS } DoVosFileServerAddressRemove_parm_t;
      afs_status_t st = 0;
***************
*** 360,366 ****
  }
  
  int
! DoVosFileServerList(struct cmd_syndesc *as, char *arock)
  {
      afs_status_t st = 0;
      void *iter;
--- 360,366 ----
  }
  
  int
! DoVosFileServerList(struct cmd_syndesc *as, void *arock)
  {
      afs_status_t st = 0;
      void *iter;
***************
*** 411,417 ****
  }
  
  int
! DoVosServerTransactionStatusList(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER } DoVosServerTransactionStatusList_parm_t;
      afs_status_t st = 0;
--- 411,417 ----
  }
  
  int
! DoVosServerTransactionStatusList(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER } DoVosServerTransactionStatusList_parm_t;
      afs_status_t st = 0;
***************
*** 519,525 ****
  }
  
  int
! DoVosVLDBGet(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { VOLUME } DoVosVLDBGet_parm_t;
      afs_status_t st = 0;
--- 519,525 ----
  }
  
  int
! DoVosVLDBGet(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { VOLUME } DoVosVLDBGet_parm_t;
      afs_status_t st = 0;
***************
*** 543,549 ****
  }
  
  int
! DoVosVLDBList(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, PARTITION } DoVosVLDBList_parm_t;
      afs_status_t st = 0;
--- 543,549 ----
  }
  
  int
! DoVosVLDBList(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, PARTITION } DoVosVLDBList_parm_t;
      afs_status_t st = 0;
***************
*** 591,597 ****
  }
  
  int
! DoVosVLDBEntryRemove(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, PARTITION, VOLUME } DoVosVLDBEntryRemove_parm_t;
      afs_status_t st = 0;
--- 591,597 ----
  }
  
  int
! DoVosVLDBEntryRemove(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, PARTITION, VOLUME } DoVosVLDBEntryRemove_parm_t;
      afs_status_t st = 0;
***************
*** 634,640 ****
  }
  
  int
! DoVosVLDBUnlock(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, PARTITION } DoVosVLDBUnlock_parm_t;
      afs_status_t st = 0;
--- 634,640 ----
  }
  
  int
! DoVosVLDBUnlock(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, PARTITION } DoVosVLDBUnlock_parm_t;
      afs_status_t st = 0;
***************
*** 668,674 ****
  }
  
  int
! DoVosVLDBEntryLock(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { VOLUME } DoVosVLDBEntryLoc_parm_tk;
      afs_status_t st = 0;
--- 668,674 ----
  }
  
  int
! DoVosVLDBEntryLock(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { VOLUME } DoVosVLDBEntryLoc_parm_tk;
      afs_status_t st = 0;
***************
*** 687,693 ****
  }
  
  int
! DoVosVLDBEntryUnlock(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { VOLUME } DoVosVLDBEntryUnlock_parm_t;
      afs_status_t st = 0;
--- 687,693 ----
  }
  
  int
! DoVosVLDBEntryUnlock(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { VOLUME } DoVosVLDBEntryUnlock_parm_t;
      afs_status_t st = 0;
***************
*** 706,712 ****
  }
  
  int
! DoVosVLDBReadOnlySiteCreate(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, PARTITION,
  	VOLUME
--- 706,712 ----
  }
  
  int
! DoVosVLDBReadOnlySiteCreate(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, PARTITION,
  	VOLUME
***************
*** 741,747 ****
  }
  
  int
! DoVosVLDBReadOnlySiteDelete(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, PARTITION,
  	VOLUME
--- 741,747 ----
  }
  
  int
! DoVosVLDBReadOnlySiteDelete(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, PARTITION,
  	VOLUME
***************
*** 777,783 ****
  }
  
  int
! DoVosVLDBSync(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, PARTITION, FORCE } DoVosVLDBSync_parm_t;
      afs_status_t st = 0;
--- 777,783 ----
  }
  
  int
! DoVosVLDBSync(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, PARTITION, FORCE } DoVosVLDBSync_parm_t;
      afs_status_t st = 0;
***************
*** 816,822 ****
  }
  
  int
! DoVosVolumeCreate(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, PARTITION, VOLUME,
  	QUOTA
--- 816,822 ----
  }
  
  int
! DoVosVolumeCreate(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, PARTITION, VOLUME,
  	QUOTA
***************
*** 861,867 ****
  }
  
  int
! DoVosVolumeDelete(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, PARTITION, VOLUME } DoVosVolumeDelete_parm_t;
      afs_status_t st = 0;
--- 861,867 ----
  }
  
  int
! DoVosVolumeDelete(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, PARTITION, VOLUME } DoVosVolumeDelete_parm_t;
      afs_status_t st = 0;
***************
*** 895,901 ****
  }
  
  int
! DoVosVolumeRename(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { OLDVOLUME, NEWVOLUME } DoVosVolumeRename_parm_t;
      afs_status_t st = 0;
--- 895,901 ----
  }
  
  int
! DoVosVolumeRename(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { OLDVOLUME, NEWVOLUME } DoVosVolumeRename_parm_t;
      afs_status_t st = 0;
***************
*** 919,925 ****
  }
  
  int
! DoVosVolumeDump(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, PARTITION, VOLUME, STARTTIME,
  	DUMPFILE
--- 919,925 ----
  }
  
  int
! DoVosVolumeDump(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, PARTITION, VOLUME, STARTTIME,
  	DUMPFILE
***************
*** 975,981 ****
  }
  
  int
! DoVosVolumeRestore(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, PARTITION, ID, VOLUME, DUMPFILE,
  	FULL
--- 975,981 ----
  }
  
  int
! DoVosVolumeRestore(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, PARTITION, ID, VOLUME, DUMPFILE,
  	FULL
***************
*** 1029,1035 ****
  }
  
  int
! DoVosVolumeOnline(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, PARTITION, VOLUME, SLEEP,
  	BUSY
--- 1029,1035 ----
  }
  
  int
! DoVosVolumeOnline(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, PARTITION, VOLUME, SLEEP,
  	BUSY
***************
*** 1077,1083 ****
  }
  
  int
! DoVosVolumeOffline(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, PARTITION, VOLUME } DoVosVolumeOffline_parm_t;
      afs_status_t st = 0;
--- 1077,1083 ----
  }
  
  int
! DoVosVolumeOffline(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, PARTITION, VOLUME } DoVosVolumeOffline_parm_t;
      afs_status_t st = 0;
***************
*** 1334,1340 ****
  }
  
  int
! DoVosVolumeGet(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, PARTITION, VOLUME } DoVosVolumeGet_parm_t;
      afs_status_t st = 0;
--- 1334,1340 ----
  }
  
  int
! DoVosVolumeGet(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, PARTITION, VOLUME } DoVosVolumeGet_parm_t;
      afs_status_t st = 0;
***************
*** 1371,1377 ****
  }
  
  int
! DoVosVolumeList(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, PARTITION } DoVosVolumeList_parm_t;
      afs_status_t st = 0;
--- 1371,1377 ----
  }
  
  int
! DoVosVolumeList(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, PARTITION } DoVosVolumeList_parm_t;
      afs_status_t st = 0;
***************
*** 1417,1423 ****
  }
  
  int
! DoVosVolumeMove(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { VOLUME, FROMSERVER, FROMPARTITION, TOSERVER,
  	TOPARTITION
--- 1417,1423 ----
  }
  
  int
! DoVosVolumeMove(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { VOLUME, FROMSERVER, FROMPARTITION, TOSERVER,
  	TOPARTITION
***************
*** 1469,1475 ****
  }
  
  int
! DoVosVolumeRelease(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { VOLUME, FORCE } DoVosVolumeRelease_parm_t;
      afs_status_t st = 0;
--- 1469,1475 ----
  }
  
  int
! DoVosVolumeRelease(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { VOLUME, FORCE } DoVosVolumeRelease_parm_t;
      afs_status_t st = 0;
***************
*** 1492,1498 ****
  }
  
  int
! DoVosVolumeZap(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, PARTITION, VOLUME, FORCE } DoVosVolumeZap_parm_t;
      afs_status_t st = 0;
--- 1492,1498 ----
  }
  
  int
! DoVosVolumeZap(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, PARTITION, VOLUME, FORCE } DoVosVolumeZap_parm_t;
      afs_status_t st = 0;
***************
*** 1531,1537 ****
  }
  
  int
! DoVosPartitionNameToId(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { PARTITION } DoVosPartitionNameToId_parm_t;
      afs_status_t st = 0;
--- 1531,1537 ----
  }
  
  int
! DoVosPartitionNameToId(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { PARTITION } DoVosPartitionNameToId_parm_t;
      afs_status_t st = 0;
***************
*** 1549,1555 ****
  }
  
  int
! DoVosPartitionIdToName(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { PARTITIONID } DoVosPartitionIdToName_parm_t;
      afs_status_t st = 0;
--- 1549,1555 ----
  }
  
  int
! DoVosPartitionIdToName(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { PARTITIONID } DoVosPartitionIdToName_parm_t;
      afs_status_t st = 0;
***************
*** 1572,1578 ****
  }
  
  int
! DoVosVolumeQuotaChange(struct cmd_syndesc *as, char *arock)
  {
      typedef enum { SERVER, PARTITION, VOLUME,
  	QUOTA
--- 1572,1578 ----
  }
  
  int
! DoVosVolumeQuotaChange(struct cmd_syndesc *as, void *arock)
  {
      typedef enum { SERVER, PARTITION, VOLUME,
  	QUOTA
***************
*** 1618,1630 ****
  {
      struct cmd_syndesc *ts;
  
!     ts = cmd_CreateSyntax("VosBackupVolumeCreate", DoVosBackupVolumeCreate, 0,
  			  "create a backup volume");
      cmd_AddParm(ts, "-volume", CMD_SINGLE, CMD_REQUIRED, "volume to back up");
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("VosBackupVolumeCreateMultiple",
! 			  DoVosBackupVolumeCreateMultiple, 0,
  			  "create a backup volume");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_OPTIONAL,
  		"server housing volumes to back up");
--- 1618,1630 ----
  {
      struct cmd_syndesc *ts;
  
!     ts = cmd_CreateSyntax("VosBackupVolumeCreate", DoVosBackupVolumeCreate, NULL,
  			  "create a backup volume");
      cmd_AddParm(ts, "-volume", CMD_SINGLE, CMD_REQUIRED, "volume to back up");
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("VosBackupVolumeCreateMultiple",
! 			  DoVosBackupVolumeCreateMultiple, NULL,
  			  "create a backup volume");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_OPTIONAL,
  		"server housing volumes to back up");
***************
*** 1636,1642 ****
  		"exclude volumes from backup that match prefix");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosPartitionGet", DoVosPartitionGet, 0,
  			  "get information about a partition");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server housing partition of interest");
--- 1636,1642 ----
  		"exclude volumes from backup that match prefix");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosPartitionGet", DoVosPartitionGet, NULL,
  			  "get information about a partition");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server housing partition of interest");
***************
*** 1644,1656 ****
  		"partition to query");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosPartitionList", DoVosPartitionList, 0,
  			  "list information about all partitions at a server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server housing partitions of interest");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosServerSync", DoVosServerSync, 0,
  			  "sync server with vldb");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server to sync");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_OPTIONAL,
--- 1644,1656 ----
  		"partition to query");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosPartitionList", DoVosPartitionList, NULL,
  			  "list information about all partitions at a server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server housing partitions of interest");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosServerSync", DoVosServerSync, NULL,
  			  "sync server with vldb");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server to sync");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_OPTIONAL,
***************
*** 1658,1664 ****
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("VosFileServerAddressChange",
! 			  DoVosFileServerAddressChange, 0,
  			  "change a server's address in the vldb");
      cmd_AddParm(ts, "-oldaddress", CMD_SINGLE, CMD_REQUIRED,
  		"old address to change");
--- 1658,1664 ----
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("VosFileServerAddressChange",
! 			  DoVosFileServerAddressChange, NULL,
  			  "change a server's address in the vldb");
      cmd_AddParm(ts, "-oldaddress", CMD_SINGLE, CMD_REQUIRED,
  		"old address to change");
***************
*** 1666,1694 ****
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("VosFileServerAddressRemove",
! 			  DoVosFileServerAddressRemove, 0,
  			  "remove a server's address from the vldb");
      cmd_AddParm(ts, "-address", CMD_SINGLE, CMD_REQUIRED,
  		"address to remove");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosFileServerList", DoVosFileServerList, 0,
  			  "list the file servers in a cell");
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("VosServerTransactionStatusList",
! 			  DoVosServerTransactionStatusList, 0,
  			  "list the active transactions at a server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server to query");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosVLDBGet", DoVosVLDBGet, 0,
  			  "get a vldb entry for a volume");
      cmd_AddParm(ts, "-volume", CMD_SINGLE, CMD_REQUIRED,
  		"volume to retrieve");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosVLDBList", DoVosVLDBList, 0,
  			  "list a group of vldb entries");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_OPTIONAL,
  		"limit entries to a particular server");
--- 1666,1694 ----
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("VosFileServerAddressRemove",
! 			  DoVosFileServerAddressRemove, NULL,
  			  "remove a server's address from the vldb");
      cmd_AddParm(ts, "-address", CMD_SINGLE, CMD_REQUIRED,
  		"address to remove");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosFileServerList", DoVosFileServerList, NULL,
  			  "list the file servers in a cell");
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("VosServerTransactionStatusList",
! 			  DoVosServerTransactionStatusList, NULL,
  			  "list the active transactions at a server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server to query");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosVLDBGet", DoVosVLDBGet, NULL,
  			  "get a vldb entry for a volume");
      cmd_AddParm(ts, "-volume", CMD_SINGLE, CMD_REQUIRED,
  		"volume to retrieve");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosVLDBList", DoVosVLDBList, NULL,
  			  "list a group of vldb entries");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_OPTIONAL,
  		"limit entries to a particular server");
***************
*** 1696,1702 ****
  		"limit entries to a particular partition");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosVLDBEntryRemove", DoVosVLDBEntryRemove, 0,
  			  "remove vldb entries");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_OPTIONAL,
  		"limit entries to a particular server");
--- 1696,1702 ----
  		"limit entries to a particular partition");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosVLDBEntryRemove", DoVosVLDBEntryRemove, NULL,
  			  "remove vldb entries");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_OPTIONAL,
  		"limit entries to a particular server");
***************
*** 1705,1711 ****
      cmd_AddParm(ts, "-volume", CMD_SINGLE, CMD_OPTIONAL, "volume to remove");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosVLDBUnlock", DoVosVLDBUnlock, 0,
  			  "unlock a group of vldb entries");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_OPTIONAL,
  		"limit entries to a particular server");
--- 1705,1711 ----
      cmd_AddParm(ts, "-volume", CMD_SINGLE, CMD_OPTIONAL, "volume to remove");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosVLDBUnlock", DoVosVLDBUnlock, NULL,
  			  "unlock a group of vldb entries");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_OPTIONAL,
  		"limit entries to a particular server");
***************
*** 1713,1730 ****
  		"limit entries to a particular partition");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosVLDBEntryLock", DoVosVLDBList, 0,
  			  "lock a single vldb entry");
      cmd_AddParm(ts, "-volume", CMD_SINGLE, CMD_REQUIRED, "volume to lock");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosVLDBEntryUnlock", DoVosVLDBEntryUnlock, 0,
  			  "unlock a single vldb entry");
      cmd_AddParm(ts, "-volume", CMD_SINGLE, CMD_REQUIRED, "volume to unlock");
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("VosVLDBReadOnlySiteCreate",
! 			  DoVosVLDBReadOnlySiteCreate, 0,
  			  "create a read only site");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where read only will be created");
--- 1713,1730 ----
  		"limit entries to a particular partition");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosVLDBEntryLock", DoVosVLDBList, NULL,
  			  "lock a single vldb entry");
      cmd_AddParm(ts, "-volume", CMD_SINGLE, CMD_REQUIRED, "volume to lock");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosVLDBEntryUnlock", DoVosVLDBEntryUnlock, NULL,
  			  "unlock a single vldb entry");
      cmd_AddParm(ts, "-volume", CMD_SINGLE, CMD_REQUIRED, "volume to unlock");
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("VosVLDBReadOnlySiteCreate",
! 			  DoVosVLDBReadOnlySiteCreate, NULL,
  			  "create a read only site");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where read only will be created");
***************
*** 1735,1741 ****
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("VosVLDBReadOnlySiteDelete",
! 			  DoVosVLDBReadOnlySiteDelete, 0,
  			  "delete a read only site before initial replication");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_OPTIONAL,
  		"server where read only will be deleted");
--- 1735,1741 ----
      SetupCommonCmdArgs(ts);
  
      ts = cmd_CreateSyntax("VosVLDBReadOnlySiteDelete",
! 			  DoVosVLDBReadOnlySiteDelete, NULL,
  			  "delete a read only site before initial replication");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_OPTIONAL,
  		"server where read only will be deleted");
***************
*** 1744,1750 ****
      cmd_AddParm(ts, "-volume", CMD_SINGLE, CMD_REQUIRED, "volume to delete");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosVLDBSync", DoVosVLDBSync, 0,
  			  "sync vldb with server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server to sync");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_OPTIONAL,
--- 1744,1750 ----
      cmd_AddParm(ts, "-volume", CMD_SINGLE, CMD_REQUIRED, "volume to delete");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosVLDBSync", DoVosVLDBSync, NULL,
  			  "sync vldb with server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server to sync");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_OPTIONAL,
***************
*** 1752,1758 ****
      cmd_AddParm(ts, "-force", CMD_FLAG, CMD_OPTIONAL, "force sync to occur");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosVolumeCreate", DoVosVolumeCreate, 0,
  			  "create a read write volume");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where volume will be created");
--- 1752,1758 ----
      cmd_AddParm(ts, "-force", CMD_FLAG, CMD_OPTIONAL, "force sync to occur");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosVolumeCreate", DoVosVolumeCreate, NULL,
  			  "create a read write volume");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where volume will be created");
***************
*** 1764,1770 ****
  		"size quota of new volume in 1kb units");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosVolumeDelete", DoVosVolumeDelete, 0,
  			  "delete a volume");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where volume exists");
--- 1764,1770 ----
  		"size quota of new volume in 1kb units");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosVolumeDelete", DoVosVolumeDelete, NULL,
  			  "delete a volume");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server where volume exists");
***************
*** 1773,1785 ****
      cmd_AddParm(ts, "-volume", CMD_SINGLE, CMD_REQUIRED, "volume to delete");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosVolumeRename", DoVosVolumeRename, 0,
  			  "rename a volume");
      cmd_AddParm(ts, "-oldname", CMD_SINGLE, CMD_REQUIRED, "old volume name");
      cmd_AddParm(ts, "-newname", CMD_SINGLE, CMD_REQUIRED, "new volume name");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosVolumeDump", DoVosVolumeDump, 0,
  			  "dump a volume to a file");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_OPTIONAL,
  		"dump volume at a particular server");
--- 1773,1785 ----
      cmd_AddParm(ts, "-volume", CMD_SINGLE, CMD_REQUIRED, "volume to delete");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosVolumeRename", DoVosVolumeRename, NULL,
  			  "rename a volume");
      cmd_AddParm(ts, "-oldname", CMD_SINGLE, CMD_REQUIRED, "old volume name");
      cmd_AddParm(ts, "-newname", CMD_SINGLE, CMD_REQUIRED, "new volume name");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosVolumeDump", DoVosVolumeDump, NULL,
  			  "dump a volume to a file");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_OPTIONAL,
  		"dump volume at a particular server");
***************
*** 1792,1798 ****
  		"file to contain dump results");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosVolumeRestore", DoVosVolumeRestore, 0,
  			  "restore a volume from a dumpfile");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server that houses volume to restore");
--- 1792,1798 ----
  		"file to contain dump results");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosVolumeRestore", DoVosVolumeRestore, NULL,
  			  "restore a volume from a dumpfile");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server that houses volume to restore");
***************
*** 1807,1813 ****
  		"does a full restore of volume");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosVolumeOnline", DoVosVolumeOnline, 0,
  			  "bring a volume online");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server that houses volume");
--- 1807,1813 ----
  		"does a full restore of volume");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosVolumeOnline", DoVosVolumeOnline, NULL,
  			  "bring a volume online");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server that houses volume");
***************
*** 1819,1825 ****
      cmd_AddParm(ts, "-busy", CMD_FLAG, CMD_OPTIONAL, "mark volume busy");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosVolumeOffline", DoVosVolumeOffline, 0,
  			  "take a volume offline");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server that houses volume");
--- 1819,1825 ----
      cmd_AddParm(ts, "-busy", CMD_FLAG, CMD_OPTIONAL, "mark volume busy");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosVolumeOffline", DoVosVolumeOffline, NULL,
  			  "take a volume offline");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server that houses volume");
***************
*** 1829,1835 ****
  		"volume to bring offline");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosVolumeGet", DoVosVolumeGet, 0,
  			  "get a volume entry");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server that houses volume");
--- 1829,1835 ----
  		"volume to bring offline");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosVolumeGet", DoVosVolumeGet, NULL,
  			  "get a volume entry");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server that houses volume");
***************
*** 1839,1845 ****
  		"volume to retrieve");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosVolumeList", DoVosVolumeList, 0,
  			  "list a group of volumes");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"limit volumes to a particular server");
--- 1839,1845 ----
  		"volume to retrieve");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosVolumeList", DoVosVolumeList, NULL,
  			  "list a group of volumes");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"limit volumes to a particular server");
***************
*** 1847,1853 ****
  		"limit volumes to a particular partition");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosVolumeMove", DoVosVolumeMove, 0,
  			  "move a volume");
      cmd_AddParm(ts, "-volume", CMD_SINGLE, CMD_REQUIRED, "volume to move");
      cmd_AddParm(ts, "-fromserver", CMD_SINGLE, CMD_REQUIRED, "source server");
--- 1847,1853 ----
  		"limit volumes to a particular partition");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosVolumeMove", DoVosVolumeMove, NULL,
  			  "move a volume");
      cmd_AddParm(ts, "-volume", CMD_SINGLE, CMD_REQUIRED, "volume to move");
      cmd_AddParm(ts, "-fromserver", CMD_SINGLE, CMD_REQUIRED, "source server");
***************
*** 1859,1865 ****
  		"destination partition");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosVolumeRelease", DoVosVolumeRelease, 0,
  			  "release updates to read only");
      cmd_AddParm(ts, "-volume", CMD_SINGLE, CMD_REQUIRED,
  		"volume to replicate");
--- 1859,1865 ----
  		"destination partition");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosVolumeRelease", DoVosVolumeRelease, NULL,
  			  "release updates to read only");
      cmd_AddParm(ts, "-volume", CMD_SINGLE, CMD_REQUIRED,
  		"volume to replicate");
***************
*** 1867,1873 ****
  		"force release to occur");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosVolumeZap", DoVosVolumeZap, 0, "zap a volume");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server that houses the volume to zap");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_REQUIRED,
--- 1867,1873 ----
  		"force release to occur");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosVolumeZap", DoVosVolumeZap, NULL, "zap a volume");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server that houses the volume to zap");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_REQUIRED,
***************
*** 1876,1893 ****
      cmd_AddParm(ts, "-force", CMD_FLAG, CMD_OPTIONAL, "force zap");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosPartitionNameToId", DoVosPartitionNameToId, 0,
  			  "convert a partition name to a number");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_REQUIRED,
  		"partition to convert");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosPartitionIdToName", DoVosPartitionIdToName, 0,
  			  "convert a number to a partition");
      cmd_AddParm(ts, "-id", CMD_SINGLE, CMD_REQUIRED, "number to convert");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosVolumeQuotaChange", DoVosVolumeQuotaChange, 0,
  			  "change the quota for a partition");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server that houses the volume");
--- 1876,1893 ----
      cmd_AddParm(ts, "-force", CMD_FLAG, CMD_OPTIONAL, "force zap");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosPartitionNameToId", DoVosPartitionNameToId, NULL,
  			  "convert a partition name to a number");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_REQUIRED,
  		"partition to convert");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosPartitionIdToName", DoVosPartitionIdToName, NULL,
  			  "convert a number to a partition");
      cmd_AddParm(ts, "-id", CMD_SINGLE, CMD_REQUIRED, "number to convert");
      SetupCommonCmdArgs(ts);
  
!     ts = cmd_CreateSyntax("VosVolumeQuotaChange", DoVosVolumeQuotaChange, NULL,
  			  "change the quota for a partition");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED,
  		"server that houses the volume");
Index: openafs/src/libadmin/vos/Makefile.in
diff -c openafs/src/libadmin/vos/Makefile.in:1.7 openafs/src/libadmin/vos/Makefile.in:1.7.2.1
*** openafs/src/libadmin/vos/Makefile.in:1.7	Sat Jan 11 02:34:39 2003
--- openafs/src/libadmin/vos/Makefile.in	Mon Jan 21 13:40:12 2008
***************
*** 12,20 ****
  CFLAGS=${COMMON_CFLAGS} ${MT_CFLAGS}
  CCRULE = ${CC} ${CFLAGS} -c $?
  
! VLSERVER = ../../vlserver/
! VOLSER = ../../volser/
! FSINT = ../../fsint/
  
  ADMINOBJS =\
  	afs_vosAdmin.o \
--- 12,20 ----
  CFLAGS=${COMMON_CFLAGS} ${MT_CFLAGS}
  CCRULE = ${CC} ${CFLAGS} -c $?
  
! VLSERVER = ../../vlserver
! VOLSER = ../../volser
! FSINT = ../../fsint
  
  ADMINOBJS =\
  	afs_vosAdmin.o \
Index: openafs/src/libadmin/vos/afs_vosAdmin.c
diff -c openafs/src/libadmin/vos/afs_vosAdmin.c:1.9.2.2 openafs/src/libadmin/vos/afs_vosAdmin.c:1.9.2.3
*** openafs/src/libadmin/vos/afs_vosAdmin.c:1.9.2.2	Sun Jul 15 20:00:38 2007
--- openafs/src/libadmin/vos/afs_vosAdmin.c	Tue Oct 30 11:23:57 2007
***************
*** 11,27 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/vos/afs_vosAdmin.c,v 1.9.2.2 2007/07/16 00:00:38 jaltman Exp $");
  
  #include <afs/stds.h>
  #include <stdio.h>
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <ctype.h>
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
--- 11,21 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/vos/afs_vosAdmin.c,v 1.9.2.3 2007/10/30 15:23:57 shadow Exp $");
  
  #include <afs/stds.h>
  #include <stdio.h>
  #include <string.h>
  #include <ctype.h>
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
Index: openafs/src/libadmin/vos/lockprocs.c
diff -c openafs/src/libadmin/vos/lockprocs.c:1.9 openafs/src/libadmin/vos/lockprocs.c:1.9.2.1
*** openafs/src/libadmin/vos/lockprocs.c:1.9	Tue Jul 15 19:15:36 2003
--- openafs/src/libadmin/vos/lockprocs.c	Tue Oct 30 11:23:58 2007
***************
*** 11,26 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/vos/lockprocs.c,v 1.9 2003/07/15 23:15:36 shadow Exp $");
  
  #include "lockprocs.h"
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  
  /* Finds an index in VLDB entry that matches the volume type, server, and partition.
   * If type is zero, will match first index of ANY type (RW, BK, or RO).
--- 11,20 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/vos/lockprocs.c,v 1.9.2.1 2007/10/30 15:23:58 shadow Exp $");
  
  #include "lockprocs.h"
  #include <string.h>
  
  /* Finds an index in VLDB entry that matches the volume type, server, and partition.
   * If type is zero, will match first index of ANY type (RW, BK, or RO).
Index: openafs/src/libadmin/vos/vosutils.c
diff -c openafs/src/libadmin/vos/vosutils.c:1.10.2.3 openafs/src/libadmin/vos/vosutils.c:1.10.2.4
*** openafs/src/libadmin/vos/vosutils.c:1.10.2.3	Sun Jul 15 20:00:38 2007
--- openafs/src/libadmin/vos/vosutils.c	Tue Oct 30 11:23:58 2007
***************
*** 11,29 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/vos/vosutils.c,v 1.10.2.3 2007/07/16 00:00:38 jaltman Exp $");
  
  #include "vosutils.h"
  #include "vsprocs.h"
  #include "lockprocs.h"
  #include <afs/afs_AdminErrors.h>
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  
  /*
   * VLDB entry conversion routines.
--- 11,23 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/vos/vosutils.c,v 1.10.2.4 2007/10/30 15:23:58 shadow Exp $");
  
  #include "vosutils.h"
  #include "vsprocs.h"
  #include "lockprocs.h"
  #include <afs/afs_AdminErrors.h>
  #include <string.h>
  
  /*
   * VLDB entry conversion routines.
Index: openafs/src/libadmin/vos/vsprocs.c
diff -c openafs/src/libadmin/vos/vsprocs.c:1.11.2.3 openafs/src/libadmin/vos/vsprocs.c:1.11.2.4
*** openafs/src/libadmin/vos/vsprocs.c:1.11.2.3	Wed Jul 18 10:24:30 2007
--- openafs/src/libadmin/vos/vsprocs.c	Tue Oct 30 11:23:58 2007
***************
*** 22,28 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/vos/vsprocs.c,v 1.11.2.3 2007/07/18 14:24:30 shadow Exp $");
  
  #include "vsprocs.h"
  #include "vosutils.h"
--- 22,28 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/vos/vsprocs.c,v 1.11.2.4 2007/10/30 15:23:58 shadow Exp $");
  
  #include "vsprocs.h"
  #include "vosutils.h"
***************
*** 30,42 ****
  #include "../adminutil/afs_AdminInternal.h"
  #include <afs/afs_AdminErrors.h>
  #include "afs_vosAdmin.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
--- 30,36 ----
Index: openafs/src/libafs/MakefileProto.LINUX.in
diff -c openafs/src/libafs/MakefileProto.LINUX.in:1.40.2.13 openafs/src/libafs/MakefileProto.LINUX.in:1.40.2.14
*** openafs/src/libafs/MakefileProto.LINUX.in:1.40.2.13	Thu Dec  1 10:19:38 2005
--- openafs/src/libafs/MakefileProto.LINUX.in	Tue Feb 19 10:07:48 2008
***************
*** 169,175 ****
  	ln -fs ${LINUX_KERNEL_PATH}/arch/um/include/sysdep
  <amd64_linux24 amd64_linux26>
  	ln -fs ${LINUX_KERNEL_PATH}/include/asm-x86_64 asm
! <s390_linux22 s390_linux24 s390_linux26 s390x_linux26>
  	ln -fs ${LINUX_KERNEL_PATH}/include/asm-s390 asm
  <s390x_linux22 s390x_linux24 s390x_linux26>
  	ln -fs ${LINUX_KERNEL_PATH}/include/asm-s390x asm
--- 169,175 ----
  	ln -fs ${LINUX_KERNEL_PATH}/arch/um/include/sysdep
  <amd64_linux24 amd64_linux26>
  	ln -fs ${LINUX_KERNEL_PATH}/include/asm-x86_64 asm
! <s390_linux22 s390_linux24 s390_linux26>
  	ln -fs ${LINUX_KERNEL_PATH}/include/asm-s390 asm
  <s390x_linux22 s390x_linux24 s390x_linux26>
  	ln -fs ${LINUX_KERNEL_PATH}/include/asm-s390x asm
Index: openafs/src/libafsrpc/Makefile.in
diff -c openafs/src/libafsrpc/Makefile.in:1.29.2.7 openafs/src/libafsrpc/Makefile.in:1.29.2.9
*** openafs/src/libafsrpc/Makefile.in:1.29.2.7	Sun Mar  5 19:33:23 2006
--- openafs/src/libafsrpc/Makefile.in	Tue Jan  8 13:57:27 2008
***************
*** 272,278 ****
  #
  #   $ what /opt/langtools/bin/pxdb32
  #   /opt/langtools/bin/pxdb32:
! #           HP92453-02 A.10.0A HP-UX SYMBOLIC DEBUGGER (PXDB) $Revision: 1.29.2.7 $
  #
  # The problem occurs when -g and -O are both used when compiling des.c.
  # The simplest way to work around the problem is to leave out either -g or -O.
--- 272,278 ----
  #
  #   $ what /opt/langtools/bin/pxdb32
  #   /opt/langtools/bin/pxdb32:
! #           HP92453-02 A.10.0A HP-UX SYMBOLIC DEBUGGER (PXDB) $Revision: 1.29.2.9 $
  #
  # The problem occurs when -g and -O are both used when compiling des.c.
  # The simplest way to work around the problem is to leave out either -g or -O.
***************
*** 354,360 ****
  syscall.o: ${SYS}/syscall.s
  	case "$(SYS_NAME)" in \
  	     sun4x_5* | sunx86_5*) \
! 		/usr/ccs/lib/cpp  ${SFLAGS} ${SYS}/syscall.s syscall.ss; \
  		as -o syscall.o syscall.ss;		\
  		$(RM) syscall.ss;;				\
  	 sgi_* | *_darwin_* ) \
--- 354,360 ----
  syscall.o: ${SYS}/syscall.s
  	case "$(SYS_NAME)" in \
  	     sun4x_5* | sunx86_5*) \
! 		$(CPP)  ${SFLAGS} ${SYS}/syscall.s syscall.ss; \
  		as -o syscall.o syscall.ss;		\
  		$(RM) syscall.ss;;				\
  	 sgi_* | *_darwin_* ) \
***************
*** 366,372 ****
  	 *bsd* ) \
  		touch syscall.o ;; \
  	 *) \
! 		/lib/cpp  ${SFLAGS} ${SYS}/syscall.s syscall.ss; \
  		as -o syscall.o syscall.ss;		\
  		$(RM) syscall.ss;;				\
  	esac
--- 366,372 ----
  	 *bsd* ) \
  		touch syscall.o ;; \
  	 *) \
! 		$(CPP)  ${SFLAGS} ${SYS}/syscall.s syscall.ss; \
  		as -o syscall.o syscall.ss;		\
  		$(RM) syscall.ss;;				\
  	esac
***************
*** 380,387 ****
  rxstat.ss.o: ${TOP_OBJDIR}/src/rxstat/rxstat.ss.c
  	${CCRULE} ${TOP_OBJDIR}/src/rxstat/rxstat.ss.c
  
! rxstat.xdr.o: ${TOP_OBJDIR}/src/rxstat//rxstat.xdr.c
! 	${CCRULE} ${TOP_OBJDIR}/src/rxstat//rxstat.xdr.c
  
  afsint.cs.o: ${TOP_OBJDIR}/src/fsint/afsint.cs.c
  	${CCRULE} ${TOP_OBJDIR}/src/fsint/afsint.cs.c
--- 380,387 ----
  rxstat.ss.o: ${TOP_OBJDIR}/src/rxstat/rxstat.ss.c
  	${CCRULE} ${TOP_OBJDIR}/src/rxstat/rxstat.ss.c
  
! rxstat.xdr.o: ${TOP_OBJDIR}/src/rxstat/rxstat.xdr.c
! 	${CCRULE} ${TOP_OBJDIR}/src/rxstat/rxstat.xdr.c
  
  afsint.cs.o: ${TOP_OBJDIR}/src/fsint/afsint.cs.c
  	${CCRULE} ${TOP_OBJDIR}/src/fsint/afsint.cs.c
Index: openafs/src/libuafs/Makefile.common.in
diff -c openafs/src/libuafs/Makefile.common.in:1.12.2.4 openafs/src/libuafs/Makefile.common.in:1.12.2.5
*** openafs/src/libuafs/Makefile.common.in:1.12.2.4	Tue Jun 20 17:40:46 2006
--- openafs/src/libuafs/Makefile.common.in	Mon Jan 21 13:40:12 2008
***************
*** 815,823 ****
  
  # These files are for the netscape plugin
  
! $(WEBOBJ)/afs_atomlist.o: $(TOP_SRCDIR)/util//afs_atomlist.c
  	$(CRULE2)
! $(WEBOBJ)/afs_lhash.o: $(TOP_SRCDIR)/util//afs_lhash.c
  	$(CRULE2)
  $(WEBOBJ)/afs_analyze.o: $(TOP_SRC_AFS)/afs_analyze.c
  	$(CRULE2)
--- 815,823 ----
  
  # These files are for the netscape plugin
  
! $(WEBOBJ)/afs_atomlist.o: $(TOP_SRCDIR)/util/afs_atomlist.c
  	$(CRULE2)
! $(WEBOBJ)/afs_lhash.o: $(TOP_SRCDIR)/util/afs_lhash.c
  	$(CRULE2)
  $(WEBOBJ)/afs_analyze.o: $(TOP_SRC_AFS)/afs_analyze.c
  	$(CRULE2)
***************
*** 1070,1076 ****
  
  $(JUAFS)/afs_atomlist.o: $(TOP_SRCDIR)/util/afs_atomlist.c
  	$(CRULE1)
! $(JUAFS)/afs_lhash.o: $(TOP_SRCDIR)/util//afs_lhash.c
  	$(CRULE1)
  $(JUAFS)/afs_analyze.o: $(TOP_SRC_AFS)/afs_analyze.c
  	$(CRULE1)
--- 1070,1076 ----
  
  $(JUAFS)/afs_atomlist.o: $(TOP_SRCDIR)/util/afs_atomlist.c
  	$(CRULE1)
! $(JUAFS)/afs_lhash.o: $(TOP_SRCDIR)/util/afs_lhash.c
  	$(CRULE1)
  $(JUAFS)/afs_analyze.o: $(TOP_SRC_AFS)/afs_analyze.c
  	$(CRULE1)
Index: openafs/src/log/Makefile.in
diff -c openafs/src/log/Makefile.in:1.7.2.1 openafs/src/log/Makefile.in:1.7.2.2
*** openafs/src/log/Makefile.in:1.7.2.1	Sun Aug 19 18:31:27 2007
--- openafs/src/log/Makefile.in	Mon Nov 12 13:31:35 2007
***************
*** 76,88 ****
  	${INSTALL} $? $@
  
  ${DEST}/bin/tokens.krb: tokens.krb
! 	${INSTALL} $? $@
  
  ${DEST}/root.server/usr/afs/bin/tokens: tokens
  	${INSTALL} $? $@
  
  ${DEST}/root.server/usr/afs/bin/tokens.krb: tokens.krb
! 	${INSTALL} $? $@
  
  ${DEST}/etc/kseal: kseal
  	${INSTALL} $? $@
--- 76,88 ----
  	${INSTALL} $? $@
  
  ${DEST}/bin/tokens.krb: tokens.krb
! 	${INSTALL} ${NO_STRIP_KRB} $? $@
  
  ${DEST}/root.server/usr/afs/bin/tokens: tokens
  	${INSTALL} $? $@
  
  ${DEST}/root.server/usr/afs/bin/tokens.krb: tokens.krb
! 	${INSTALL} ${NO_STRIP_KRB} $? $@
  
  ${DEST}/etc/kseal: kseal
  	${INSTALL} $? $@
***************
*** 105,117 ****
  	${INSTALL} $? $@
  
  ${DESTDIR}${bindir}/tokens.krb: tokens.krb
! 	${INSTALL} $? $@
  
  ${DESTDIR}${afssrvbindir}/tokens: tokens
  	${INSTALL} $? $@
  
  ${DESTDIR}${afssrvbindir}/tokens.krb: tokens.krb
! 	${INSTALL} $? $@
  
  ${DESTDIR}${sbindir}/kseal: kseal
  	${INSTALL} $? $@
--- 105,117 ----
  	${INSTALL} $? $@
  
  ${DESTDIR}${bindir}/tokens.krb: tokens.krb
! 	${INSTALL} ${NO_STRIP_KRB} $? $@
  
  ${DESTDIR}${afssrvbindir}/tokens: tokens
  	${INSTALL} $? $@
  
  ${DESTDIR}${afssrvbindir}/tokens.krb: tokens.krb
! 	${INSTALL} ${NO_STRIP_KRB} $? $@
  
  ${DESTDIR}${sbindir}/kseal: kseal
  	${INSTALL} $? $@
Index: openafs/src/log/kseal.c
diff -c openafs/src/log/kseal.c:1.7.2.1 openafs/src/log/kseal.c:1.7.2.2
*** openafs/src/log/kseal.c:1.7.2.1	Mon Jul 11 15:46:16 2005
--- openafs/src/log/kseal.c	Tue Oct 30 11:23:58 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/log/kseal.c,v 1.7.2.1 2005/07/11 19:46:16 shadow Exp $");
  
  #include <sys/types.h>
  #include <netinet/in.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/log/kseal.c,v 1.7.2.2 2007/10/30 15:23:58 shadow Exp $");
  
  #include <sys/types.h>
  #include <netinet/in.h>
***************
*** 19,31 ****
  #include <signal.h>
  #endif
  
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  
  #include <afs/cellconfig.h>
  #include <afs/afsutil.h>
--- 19,25 ----
Index: openafs/src/log/tokens.c
diff -c openafs/src/log/tokens.c:1.6.2.2 openafs/src/log/tokens.c:1.6.2.3
*** openafs/src/log/tokens.c:1.6.2.2	Wed Mar 15 13:29:03 2006
--- openafs/src/log/tokens.c	Tue Oct 30 11:23:58 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/log/tokens.c,v 1.6.2.2 2006/03/15 18:29:03 shadow Exp $");
  
  #include <stdio.h>
  #ifdef	AFS_AIX32_ENV
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/log/tokens.c,v 1.6.2.3 2007/10/30 15:23:58 shadow Exp $");
  
  #include <stdio.h>
  #ifdef	AFS_AIX32_ENV
***************
*** 25,38 ****
  #include <time.h>		/*time(), ctime() */
  #include <pwd.h>
  
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
- 
  
  #define VIRTUE
  #define VICE
--- 25,31 ----
Index: openafs/src/log/unlog.c
diff -c openafs/src/log/unlog.c:1.6.2.1 openafs/src/log/unlog.c:1.6.2.4
*** openafs/src/log/unlog.c:1.6.2.1	Mon Jul 11 15:46:16 2005
--- openafs/src/log/unlog.c	Mon Nov 26 16:21:54 2007
***************
*** 30,36 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/log/unlog.c,v 1.6.2.1 2005/07/11 19:46:16 shadow Exp $");
  
  #include <stdio.h>
  #include <potpourri.h>
--- 30,36 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/log/unlog.c,v 1.6.2.4 2007/11/26 21:21:54 shadow Exp $");
  
  #include <stdio.h>
  #include <potpourri.h>
***************
*** 38,51 ****
  #include <signal.h>
  #endif
  
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
- 
  #include <sys/types.h>
  #include <sys/stat.h>
  #include <errno.h>
--- 38,44 ----
***************
*** 71,77 ****
  
  
  int 
! CommandProc(struct cmd_syndesc *as, char *arock)
  {
  #define	MAXCELLS 20		/* XXX */
      struct cmd_item *itp;
--- 64,70 ----
  
  
  int 
! CommandProc(struct cmd_syndesc *as, void *arock)
  {
  #define	MAXCELLS 20		/* XXX */
      struct cmd_item *itp;
***************
*** 122,128 ****
      sigaction(SIGSEGV, &nsa, NULL);
  #endif
  
!     ts = cmd_CreateSyntax(NULL, CommandProc, 0,
  			  "Release Kerberos authentication");
      cmd_AddParm(ts, "-cell", CMD_LIST, CMD_OPTIONAL, "cell name");
  
--- 115,121 ----
      sigaction(SIGSEGV, &nsa, NULL);
  #endif
  
!     ts = cmd_CreateSyntax(NULL, CommandProc, NULL,
  			  "Release Kerberos authentication");
      cmd_AddParm(ts, "-cell", CMD_LIST, CMD_OPTIONAL, "cell name");
  
***************
*** 266,271 ****
--- 259,265 ----
  	*list = newCellName;
      }
      afsconf_Close(conf);
+     return 0;
  }
  
  /*
***************
*** 290,293 ****
--- 284,288 ----
  	    fprintf(stderr, "unlog: Warning - no tokens held for cell %s\n",
  		    cellList[index]);
      }
+     return 0;
  }
Index: openafs/src/lwp/Makefile.in
diff -c openafs/src/lwp/Makefile.in:1.29.2.8 openafs/src/lwp/Makefile.in:1.29.2.10
*** openafs/src/lwp/Makefile.in:1.29.2.8	Thu Mar  9 01:41:50 2006
--- openafs/src/lwp/Makefile.in	Wed Feb 27 17:31:37 2008
***************
*** 36,43 ****
  	@set -x; case "$(SYS_NAME)" in \
  	pmax_he1) \
  		$(CCOBJ) ${LWP_DBG} ${LWP_OPTMZ} -c -I${TOP_INCDIR} process.s;; \
! 	sun4c_51 | sun4c_52 | sun4m_51 | sun4m_52 | sun4c_53 | sun4m_53  | sun4_53 | sun4_52 | sun4_54 | sun4c_54 | sun4m_54 | sun4x_5* ) \
! 		/usr/ccs/lib/cpp -P -I${TOP_INCDIR} ${srcdir}/process.s process.ss; \
  		${AS} process.ss -o process.o; \
  			$(RM) process.ss ;; \
  	sgi_5* ) \
--- 36,43 ----
  	@set -x; case "$(SYS_NAME)" in \
  	pmax_he1) \
  		$(CCOBJ) ${LWP_DBG} ${LWP_OPTMZ} -c -I${TOP_INCDIR} process.s;; \
! 	sun4c_51 | sun4c_52 | sun4m_51 | sun4m_52 | sun4c_53 | sun4m_53  | sun4_53 | sun4_52 | sun4_54 | sun4c_54 | sun4m_54 | sun4x_5* | arm_linux* ) \
! 		$(CPP) -P -I${TOP_INCDIR} ${srcdir}/process.s process.ss; \
  		${AS} process.ss -o process.o; \
  			$(RM) process.ss ;; \
  	sgi_5* ) \
***************
*** 45,55 ****
  	sgi_61 | sgi_62 | sgi_63 ) \
  		$(CCOBJ) ${LWP_DBG} ${LWP_OPTMZ} -c ${XCFLAGS} ${ARCHFLAGS} -I${TOP_INCDIR} -KPIC -G0  ${srcdir}/process.s;; \
  	s390_*) \
! 		/lib/cpp -P -I${TOP_INCDIR} ${srcdir}/process.s390.s >process.ss; \
  		${AS} -ahlns process.ss -o process.o >process.lst; \
  		$(RM) process.ss ;; \
  	s390x_*) \
! 		/lib/cpp -P -I${TOP_INCDIR} ${srcdir}/process.s390x.s >process.ss; \
  		${AS} -ahlns process.ss -o process.o >process.lst; \
  		$(RM) process.ss ;; \
  	*_darwin* ) \
--- 45,55 ----
  	sgi_61 | sgi_62 | sgi_63 ) \
  		$(CCOBJ) ${LWP_DBG} ${LWP_OPTMZ} -c ${XCFLAGS} ${ARCHFLAGS} -I${TOP_INCDIR} -KPIC -G0  ${srcdir}/process.s;; \
  	s390_*) \
! 		$(CPP) -P -I${TOP_INCDIR} ${srcdir}/process.s390.s >process.ss; \
  		${AS} -ahlns process.ss -o process.o >process.lst; \
  		$(RM) process.ss ;; \
  	s390x_*) \
! 		$(CPP) -P -I${TOP_INCDIR} ${srcdir}/process.s390x.s >process.ss; \
  		${AS} -ahlns process.ss -o process.o >process.lst; \
  		$(RM) process.ss ;; \
  	*_darwin* ) \
***************
*** 88,98 ****
  		${AS} process.ss -o process.o ;  \
  		$(RM) -f process.S ;;\
  	ncrx86_* | sunx86_*) \
! 		/usr/ccs/lib/cpp -P -D__sun -D__i386 -DIGNORE_STDS_H -I${TOP_INCDIR} -I${srcdir} ${srcdir}/process.i386.s process.ss; \
  		${AS} -o process.o process.ss; \
  		$(RM) process.ss ;; \
  	alpha_nbsd* ) \
! 		/usr/bin/cpp -DASSEMBLER -P -I${TOP_INCDIR} ${srcdir}/process.s > process.ss; \
  		${AS} -o process.o process.ss; \
  		$(RM) process.ss ;; \
  	hp* | *_linux* | *_umlinux* | sgi_64 | sgi_65 ) \
--- 88,98 ----
  		${AS} process.ss -o process.o ;  \
  		$(RM) -f process.S ;;\
  	ncrx86_* | sunx86_*) \
! 		$(CPP) -P -D__sun -D__i386 -DIGNORE_STDS_H -I${TOP_INCDIR} -I${srcdir} ${srcdir}/process.i386.s process.ss; \
  		${AS} -o process.o process.ss; \
  		$(RM) process.ss ;; \
  	alpha_nbsd* ) \
! 		$(CPP) -DASSEMBLER -P -I${TOP_INCDIR} ${srcdir}/process.s > process.ss; \
  		${AS} -o process.o process.ss; \
  		$(RM) process.ss ;; \
  	hp* | *_linux* | *_umlinux* | sgi_64 | sgi_65 ) \
***************
*** 103,113 ****
  	ia64_hpux11* | hp_ux11* ) \
  		${CC} ${CFLAGS} -c ${srcdir}/process.c;; \
  	i386_*) \
! 		/lib/cpp -P -I${TOP_INCDIR} -I${srcdir} ${srcdir}/process.i386.s process.ss; \
  		${AS} process.ss -o process.o; \
  		$(RM) process.ss ;; \
  	*) \
! 		/lib/cpp -P -I${TOP_INCDIR} ${srcdir}/process.s process.ss; \
  		${AS} process.ss -o process.o; \
  		$(RM) process.ss ;; \
  	esac
--- 103,113 ----
  	ia64_hpux11* | hp_ux11* ) \
  		${CC} ${CFLAGS} -c ${srcdir}/process.c;; \
  	i386_*) \
! 		$(CPP) -P -I${TOP_INCDIR} -I${srcdir} ${srcdir}/process.i386.s process.ss; \
  		${AS} process.ss -o process.o; \
  		$(RM) process.ss ;; \
  	*) \
! 		$(CPP) -P -I${TOP_INCDIR} ${srcdir}/process.s process.ss; \
  		${AS} process.ss -o process.o; \
  		$(RM) process.ss ;; \
  	esac
Index: openafs/src/lwp/iomgr.c
diff -c openafs/src/lwp/iomgr.c:1.13.2.1 openafs/src/lwp/iomgr.c:1.13.2.2
*** openafs/src/lwp/iomgr.c:1.13.2.1	Sun Feb 20 20:13:50 2005
--- openafs/src/lwp/iomgr.c	Mon Mar 10 18:35:35 2008
***************
*** 36,42 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /cvs/openafs/src/lwp/iomgr.c,v 1.13.2.1 2005/02/21 01:13:50 shadow Exp $");
  
  #include <stdio.h>
  #include <stdlib.h>
--- 36,42 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /cvs/openafs/src/lwp/iomgr.c,v 1.13.2.2 2008/03/10 22:35:35 shadow Exp $");
  
  #include <stdio.h>
  #include <stdlib.h>
***************
*** 107,113 ****
  #define NSIG 8*sizeof(sigset_t)
  #endif
  
! static int SignalSignals();
  
  /********************************\
  * 				 *
--- 107,113 ----
  #define NSIG 8*sizeof(sigset_t)
  #endif
  
! static int SignalSignals(void);
  
  /********************************\
  * 				 *
***************
*** 161,168 ****
  					   to write it */
  /* software 'signals' */
  #define NSOFTSIG		4
! static int (*sigProc[NSOFTSIG])();
! static char *sigRock[NSOFTSIG];
  
  
  static struct IoRequest *iorFreeList = 0;
--- 161,168 ----
  					   to write it */
  /* software 'signals' */
  #define NSOFTSIG		4
! static void *(*sigProc[NSOFTSIG])(void *);
! static void *sigRock[NSOFTSIG];
  
  
  static struct IoRequest *iorFreeList = 0;
***************
*** 230,236 ****
  
  #define FreeRequest(x) ((x)->result = (long) iorFreeList, iorFreeList = (x))
  
! static struct IoRequest *NewRequest()
  {
      struct IoRequest *request;
  
--- 230,236 ----
  
  #define FreeRequest(x) ((x)->result = (long) iorFreeList, iorFreeList = (x))
  
! static struct IoRequest *NewRequest(void)
  {
      struct IoRequest *request;
  
***************
*** 410,416 ****
  static fd_set IOMGR_readfds, IOMGR_writefds, IOMGR_exceptfds;
  static int IOMGR_nfds = 0;
  
! static int IOMGR(void *dummy)
  {
      for (;;) {
  	int code;
--- 410,416 ----
  static fd_set IOMGR_readfds, IOMGR_writefds, IOMGR_exceptfds;
  static int IOMGR_nfds = 0;
  
! static void *IOMGR(void *dummy)
  {
      for (;;) {
  	int code;
***************
*** 664,670 ****
  	}
  	LWP_DispatchProcess();
      }
!     return -1; /* keeps compilers happy. */
  }
  
  /************************\
--- 664,670 ----
  	}
  	LWP_DispatchProcess();
      }
!     return (void *)-1; /* keeps compilers happy. */
  }
  
  /************************\
***************
*** 721,728 ****
  *  signalling routines, above).			      *
  *						      *
  \*****************************************************/
! static void SigHandler (signo)
!     int signo;
  {
      if (badsig(signo) || (sigsHandled & mysigmask(signo)) == 0)
  	return;		/* can't happen. */
--- 721,727 ----
  *  signalling routines, above).			      *
  *						      *
  \*****************************************************/
! static void SigHandler (int signo)
  {
      if (badsig(signo) || (sigsHandled & mysigmask(signo)) == 0)
  	return;		/* can't happen. */
***************
*** 739,745 ****
  {
      bool gotone = FALSE;
      register int i;
!     register int (*p)();
      afs_int32 stackSize;
  
      anySigsDelivered = FALSE;
--- 738,744 ----
  {
      bool gotone = FALSE;
      register int i;
!     register void *(*p)(void *);
      afs_int32 stackSize;
  
      anySigsDelivered = FALSE;
***************
*** 748,756 ****
      stackSize = (AFS_LWP_MINSTACKSIZE < lwp_MaxStackSeen? lwp_MaxStackSeen : AFS_LWP_MINSTACKSIZE);
      for (i=0; i < NSOFTSIG; i++) {
  	PROCESS pid;
! 	if (p=sigProc[i]) /* This yields!!! */
  	    LWP_CreateProcess2(p, stackSize, LWP_NORMAL_PRIORITY, 
! 			       (void *) sigRock[i], "SignalHandler", &pid);
  	sigProc[i] = 0;
      }
  
--- 747,755 ----
      stackSize = (AFS_LWP_MINSTACKSIZE < lwp_MaxStackSeen? lwp_MaxStackSeen : AFS_LWP_MINSTACKSIZE);
      for (i=0; i < NSOFTSIG; i++) {
  	PROCESS pid;
! 	if ((p=sigProc[i])) /* This yields!!! */
  	    LWP_CreateProcess2(p, stackSize, LWP_NORMAL_PRIORITY, 
! 			       sigRock[i], "SignalHandler", &pid);
  	sigProc[i] = 0;
      }
  
***************
*** 774,782 ****
  /* Keep IOMGR process id */
  static PROCESS IOMGR_Id = NULL;
  
! int IOMGR_SoftSig(aproc, arock)
! int (*aproc)();
! char *arock; {
      register int i;
      for (i=0;i<NSOFTSIG;i++) {
  	if (sigProc[i] == 0) {
--- 773,780 ----
  /* Keep IOMGR process id */
  static PROCESS IOMGR_Id = NULL;
  
! int IOMGR_SoftSig(void *(*aproc)(void *), void *arock)
! {
      register int i;
      for (i=0;i<NSOFTSIG;i++) {
  	if (sigProc[i] == 0) {
***************
*** 797,803 ****
  
  int IOMGR_Initialize(void)
  {
-     extern int TM_Init();
      PROCESS pid;
  
      /* If lready initialized, just return */
--- 795,800 ----
***************
*** 824,830 ****
  			     "IO MANAGER", &IOMGR_Id);
  }
  
! int IOMGR_Finalize()
  {
      int status;
  
--- 821,827 ----
  			     "IO MANAGER", &IOMGR_Id);
  }
  
! int IOMGR_Finalize(void)
  {
      int status;
  
***************
*** 912,921 ****
      return 0;
  }
  
! int IOMGR_Select(fds, readfds, writefds, exceptfds, timeout)
!      int fds;
!      fd_set *readfds, *writefds, *exceptfds;
!      struct timeval *timeout;
  {
      register struct IoRequest *request;
      int result;
--- 909,916 ----
      return 0;
  }
  
! int IOMGR_Select(int fds, fd_set *readfds, fd_set *writefds, 
! 		 fd_set *exceptfds, struct timeval *timeout)
  {
      register struct IoRequest *request;
      int result;
***************
*** 936,942 ****
--- 931,939 ----
  #ifdef DEBUG
  	    if (lwp_debug != 0) puts("[Polling SELECT]");
  #endif /* DEBUG */
+ #if	defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_AIX32_ENV) || defined(AFS_NT40_ENV)
  again:
+ #endif
  	    code = select(fds, readfds, writefds, exceptfds, timeout);
  #if	defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_AIX32_ENV)
  	    /*
Index: openafs/src/lwp/lock.c
diff -c openafs/src/lwp/lock.c:1.5 openafs/src/lwp/lock.c:1.5.2.1
*** openafs/src/lwp/lock.c:1.5	Tue Jul 15 19:15:45 2003
--- openafs/src/lwp/lock.c	Mon Mar 10 18:35:35 2008
***************
*** 26,32 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/lwp/lock.c,v 1.5 2003/07/15 23:15:45 shadow Exp $");
  
  #ifdef AFS_PTHREAD_ENV
  #include <afs/assert.h>
--- 26,32 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/lwp/lock.c,v 1.5.2.1 2008/03/10 22:35:35 shadow Exp $");
  
  #ifdef AFS_PTHREAD_ENV
  #include <afs/assert.h>
***************
*** 197,205 ****
  
  /* release a write lock and sleep on an address, atomically */
  void
! LWP_WaitProcessR(addr, alock)
!      register char *addr;
!      register struct Lock *alock;
  {
      ReleaseReadLock(alock);
      LWP_WaitProcess(addr);
--- 197,203 ----
  
  /* release a write lock and sleep on an address, atomically */
  void
! LWP_WaitProcessR(register void *addr, register struct Lock *alock)
  {
      ReleaseReadLock(alock);
      LWP_WaitProcess(addr);
***************
*** 207,215 ****
  
  /* release a write lock and sleep on an address, atomically */
  void
! LWP_WaitProcessW(addr, alock)
!      register char *addr;
!      register struct Lock *alock;
  {
      ReleaseWriteLock(alock);
      LWP_WaitProcess(addr);
--- 205,211 ----
  
  /* release a write lock and sleep on an address, atomically */
  void
! LWP_WaitProcessW(register void *addr, register struct Lock *alock)
  {
      ReleaseWriteLock(alock);
      LWP_WaitProcess(addr);
***************
*** 217,225 ****
  
  /* release a write lock and sleep on an address, atomically */
  void
! LWP_WaitProcessS(addr, alock)
!      register char *addr;
!      register struct Lock *alock;
  {
      ReleaseSharedLock(alock);
      LWP_WaitProcess(addr);
--- 213,219 ----
  
  /* release a write lock and sleep on an address, atomically */
  void
! LWP_WaitProcessS(register void *addr, register struct Lock *alock)
  {
      ReleaseSharedLock(alock);
      LWP_WaitProcess(addr);
Index: openafs/src/lwp/lock.h
diff -c openafs/src/lwp/lock.h:1.6.2.1 openafs/src/lwp/lock.h:1.6.2.2
*** openafs/src/lwp/lock.h:1.6.2.1	Wed Aug 25 03:09:40 2004
--- openafs/src/lwp/lock.h	Mon Mar 10 18:35:35 2008
***************
*** 68,73 ****
--- 68,74 ----
  extern void Afs_Lock_Obtain(struct Lock *lock, int how);
  extern void Afs_Lock_ReleaseR(struct Lock *lock);
  extern void Afs_Lock_ReleaseW(struct Lock *lock);
+ extern void Afs_Lock_WakeupR(struct Lock *lock);
  void Lock_Init(struct Lock *lock);
  void Lock_Destroy(struct Lock *lock);
  
Index: openafs/src/lwp/lwp.c
diff -c openafs/src/lwp/lwp.c:1.27.2.8 openafs/src/lwp/lwp.c:1.27.2.13
*** openafs/src/lwp/lwp.c:1.27.2.8	Wed Jun  6 13:23:24 2007
--- openafs/src/lwp/lwp.c	Thu Mar 13 09:42:31 2008
***************
*** 17,23 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /cvs/openafs/src/lwp/lwp.c,v 1.27.2.8 2007/06/06 17:23:24 shadow Exp $");
  
  #include <stdlib.h>
  #include <stdio.h>
--- 17,23 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /cvs/openafs/src/lwp/lwp.c,v 1.27.2.13 2008/03/13 13:42:31 shadow Exp $");
  
  #include <stdlib.h>
  #include <stdio.h>
***************
*** 39,51 ****
  extern char *getenv();
  #include <time.h>
  #endif
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  
  #if	!defined(USE_PTHREADS) && !defined(USE_SOLARIS_THREADS)
  
--- 39,45 ----
***************
*** 53,63 ****
--- 47,59 ----
  extern void *malloc(int size);
  extern void *realloc(void *ptr, int size);
  #endif
+ #ifndef AFS_ARM_LINUX20_ENV
  #if defined(AFS_OSF_ENV) || defined(AFS_S390_LINUX20_ENV)
  extern int PRE_Block;		/* from preempt.c */
  #else
  extern char PRE_Block;		/* from preempt.c */
  #endif
+ #endif
  
  #define ON		1
  #define OFF		0
***************
*** 104,123 ****
  } while (0)
  #endif
  
! static int Dispatcher();
! static int Create_Process_Part2();
! static int Exit_LWP();
! static afs_int32 Initialize_Stack();
! static int Stack_Used();
! char (*RC_to_ASCII());
! 
! static void Abort_LWP();
! static void Overflow_Complain();
! static void Initialize_PCB();
! static void Dispose_of_Dead_PCB();
! static void Free_PCB();
! static int Internal_Signal();
! static purge_dead_pcbs();
  
  #define MAX_PRIORITIES	(LWP_MAX_PRIORITY+1)
  
--- 100,122 ----
  } while (0)
  #endif
  
! static void Dispatcher(void);
! static void Create_Process_Part2(void);
! static void Exit_LWP(void);
! static afs_int32 Initialize_Stack(char *stackptr, int stacksize);
! static int Stack_Used(register char *stackptr, int stacksize);
! 
! static void Abort_LWP(char *msg);
! static void Overflow_Complain(void);
! static void Initialize_PCB(PROCESS temp, int priority, char *stack,
! 			   int stacksize, void *(*ep)(void *), void *parm, 
! 			   char *name);
! static void Dispose_of_Dead_PCB(PROCESS cur);
! static void Free_PCB(PROCESS pid);
! static int Internal_Signal(void *event);
! static int purge_dead_pcbs(void);
! static int LWP_MwaitProcess(int wcount, void *evlist[]);
! 	
  
  #define MAX_PRIORITIES	(LWP_MAX_PRIORITY+1)
  
***************
*** 125,131 ****
      PROCESS head;
      int count;
  } runnable[MAX_PRIORITIES], blocked, qwaiting;
! /* Invariant for runnable queues: The head of each queue points to the currently running process if it is in that queue, or it points to the next process in that queue that should run. */
  
  /* Offset of stack field within pcb -- used by stack checking stuff */
  int stack_offset;
--- 124,132 ----
      PROCESS head;
      int count;
  } runnable[MAX_PRIORITIES], blocked, qwaiting;
! /* Invariant for runnable queues: The head of each queue points to the 
!  * currently running process if it is in that queue, or it points to the 
!  * next process in that queue that should run. */
  
  /* Offset of stack field within pcb -- used by stack checking stuff */
  int stack_offset;
***************
*** 266,272 ****
  #endif
  
  int
! LWP_CreateProcess(int (*ep) (), int stacksize, int priority, void *parm,
  		  char *name, PROCESS * pid)
  {
      PROCESS temp, temp2;
--- 267,273 ----
  #endif
  
  int
! LWP_CreateProcess(void *(*ep) (void *), int stacksize, int priority, void *parm,
  		  char *name, PROCESS * pid)
  {
      PROCESS temp, temp2;
***************
*** 373,383 ****
--- 374,386 ----
  	Initialize_PCB(temp, priority, stackmemory, stacksize, ep, parm, name);
  	insert(temp, &runnable[priority]);
  	temp2 = lwp_cpptr;
+ #ifndef AFS_ARM_LINUX20_ENV
  	if (PRE_Block != 0)
  	    Abort_LWP("PRE_Block not 0");
  
  	/* Gross hack: beware! */
  	PRE_Block = 1;
+ #endif
  	lwp_cpptr = temp;
  #if defined(AFS_PARISC_LINUX24_ENV)
  	savecontext(Create_Process_Part2, &temp2->context,
***************
*** 421,427 ****
  
  #ifdef	AFS_AIX32_ENV
  int
! LWP_CreateProcess2(int (*ep) (), int stacksize, int priority, void *parm,
  		   char *name, PROCESS * pid)
  {
      PROCESS temp, temp2;
--- 424,430 ----
  
  #ifdef	AFS_AIX32_ENV
  int
! LWP_CreateProcess2(void *(*ep) (void *), int stacksize, int priority, void *parm,
  		   char *name, PROCESS * pid)
  {
      PROCESS temp, temp2;
***************
*** 466,476 ****
--- 469,481 ----
  	Initialize_PCB(temp, priority, stackptr, stacksize, ep, parm, name);
  	insert(temp, &runnable[priority]);
  	temp2 = lwp_cpptr;
+ #ifndef AFS_ARM_LINUX20_ENV
  	if (PRE_Block != 0)
  	    Abort_LWP("PRE_Block not 0");
  
  	/* Gross hack: beware! */
  	PRE_Block = 1;
+ #endif
  	lwp_cpptr = temp;
  	savecontext(Create_Process_Part2, &temp2->context,
  		    stackptr + stacksize - sizeof(void *));
***************
*** 650,656 ****
  }
  
  int
! LWP_INTERNALSIGNAL(char *event, int yield)
  {				/* signal the occurence of an event */
      Debug(2, ("Entered LWP_SignalProcess"));
      if (lwp_init) {
--- 655,661 ----
  }
  
  int
! LWP_INTERNALSIGNAL(void *event, int yield)
  {				/* signal the occurence of an event */
      Debug(2, ("Entered LWP_SignalProcess"));
      if (lwp_init) {
***************
*** 689,697 ****
  }
  
  int
! LWP_WaitProcess(char *event)
  {				/* wait on a single event */
!     char *tempev[2];
  
      Debug(2, ("Entered Wait_Process"));
      if (event == NULL)
--- 694,702 ----
  }
  
  int
! LWP_WaitProcess(void *event)
  {				/* wait on a single event */
!     void *tempev[2];
  
      Debug(2, ("Entered Wait_Process"));
      if (event == NULL)
***************
*** 702,708 ****
  }
  
  int
! LWP_MwaitProcess(int wcount, char *evlist[])
  {				/* wait on m of n events */
      register int ecount, i;
  
--- 707,713 ----
  }
  
  int
! LWP_MwaitProcess(int wcount, void *evlist[])
  {				/* wait on m of n events */
      register int ecount, i;
  
***************
*** 730,737 ****
  	if (ecount > lwp_cpptr->eventlistsize) {
  
  	    lwp_cpptr->eventlist =
! 		(char **)realloc(lwp_cpptr->eventlist,
! 				 ecount * sizeof(char *));
  	    lwp_cpptr->eventlistsize = ecount;
  	}
  	for (i = 0; i < ecount; i++)
--- 735,742 ----
  	if (ecount > lwp_cpptr->eventlistsize) {
  
  	    lwp_cpptr->eventlist =
! 		(void **)realloc(lwp_cpptr->eventlist,
! 				 ecount * sizeof(void *));
  	    lwp_cpptr->eventlistsize = ecount;
  	}
  	for (i = 0; i < ecount; i++)
***************
*** 787,793 ****
      return;
  }
  
! static int
  Create_Process_Part2(void)
  {				/* creates a context for the new process */
      PROCESS temp;
--- 792,798 ----
      return;
  }
  
! static void
  Create_Process_Part2(void)
  {				/* creates a context for the new process */
      PROCESS temp;
***************
*** 797,803 ****
      savecontext(Dispatcher, &temp->context, NULL);
      (*temp->ep) (temp->parm);
      LWP_DestroyProcess(temp);
!     return 0;
  }
  
  static int
--- 802,808 ----
      savecontext(Dispatcher, &temp->context, NULL);
      (*temp->ep) (temp->parm);
      LWP_DestroyProcess(temp);
!     return;
  }
  
  static int
***************
*** 876,882 ****
  
  int LWP_TraceProcesses = 0;
  
! static int
  Dispatcher(void)
  {				/* Lightweight process dispatcher */
      register int i;
--- 881,887 ----
  
  int LWP_TraceProcesses = 0;
  
! static void
  Dispatcher(void)
  {				/* Lightweight process dispatcher */
      register int i;
***************
*** 928,934 ****
  	printf("stackcheck = %u: stack = %u \n", lwp_cpptr->stackcheck,
  	       *(int *)lwp_cpptr->stack);
  	printf("topstack = 0x%x: stackptr = 0x%x: stacksize = 0x%x\n",
! 	       lwp_cpptr->context.topstack, lwp_cpptr->stack,
  	       lwp_cpptr->stacksize);
  
  	switch (lwp_overflowAction) {
--- 933,940 ----
  	printf("stackcheck = %u: stack = %u \n", lwp_cpptr->stackcheck,
  	       *(int *)lwp_cpptr->stack);
  	printf("topstack = 0x%x: stackptr = 0x%x: stacksize = 0x%x\n",
! 	       (unsigned int)lwp_cpptr->context.topstack, 
! 	       (unsigned int)lwp_cpptr->stack,
  	       lwp_cpptr->stacksize);
  
  	switch (lwp_overflowAction) {
***************
*** 962,972 ****
--- 968,982 ----
  	printf("Dispatch %d [PCB at 0x%x] \"%s\"\n", ++dispatch_count,
  	       runnable[i].head, runnable[i].head->name);
  #endif
+ #ifndef AFS_ARM_LINUX20_ENV
      if (PRE_Block != 1)
  	Abort_LWP("PRE_Block not 1");
+ #endif
      lwp_cpptr = runnable[i].head;
  
      returnto(&lwp_cpptr->context);
+     
+     return; /* not reachable */
  }
  
  /* Complain of a stack overflow to stderr without using stdio. */
***************
*** 999,1005 ****
  */
  }
  
! static int
  Exit_LWP(void)
  {
      abort();
--- 1009,1015 ----
  */
  }
  
! static void
  Exit_LWP(void)
  {
      abort();
***************
*** 1024,1030 ****
  
  static void
  Initialize_PCB(PROCESS temp, int priority, char *stack, int stacksize,
! 	       int (*ep) (), void *parm, char *name)
  {
      register int i = 0;
  
--- 1034,1040 ----
  
  static void
  Initialize_PCB(PROCESS temp, int priority, char *stack, int stacksize,
! 	       void *(*ep) (void *), void *parm, char *name)
  {
      register int i = 0;
  
***************
*** 1034,1040 ****
  	    i++;
      temp->name[31] = '\0';
      temp->status = READY;
!     temp->eventlist = (char **)malloc(EVINITSIZE * sizeof(char *));
      temp->eventlistsize = EVINITSIZE;
      temp->eventcnt = 0;
      temp->wakevent = 0;
--- 1044,1050 ----
  	    i++;
      temp->name[31] = '\0';
      temp->status = READY;
!     temp->eventlist = (void **)malloc(EVINITSIZE * sizeof(void *));
      temp->eventlistsize = EVINITSIZE;
      temp->eventcnt = 0;
      temp->wakevent = 0;
***************
*** 1062,1068 ****
  }
  
  static int
! Internal_Signal(register char *event)
  {
      int rc = LWP_ENOWAIT;
      register int i;
--- 1072,1078 ----
  }
  
  static int
! Internal_Signal(register void *event)
  {
      int rc = LWP_ENOWAIT;
      register int i;
***************
*** 1252,1264 ****
  
  #ifdef	AFS_SUN5_ENV
  int
! LWP_NoYieldSignal(char *event)
  {
      return (LWP_INTERNALSIGNAL(event, 0));
  }
  
  int
! LWP_SignalProcess(char *event)
  {
      return (LWP_INTERNALSIGNAL(event, 1));
  }
--- 1262,1274 ----
  
  #ifdef	AFS_SUN5_ENV
  int
! LWP_NoYieldSignal(void *event)
  {
      return (LWP_INTERNALSIGNAL(event, 0));
  }
  
  int
! LWP_SignalProcess(void *event)
  {
      return (LWP_INTERNALSIGNAL(event, 1));
  }
***************
*** 1283,1289 ****
  
  typedef struct event {
      struct event *next;		/* next in hash chain */
!     char *event;		/* lwp event: an address */
      int refcount;		/* Is it in use? */
      pthread_cond_t cond;	/* Currently associated condition variable */
      int seq;			/* Sequence number: this is incremented
--- 1293,1299 ----
  
  typedef struct event {
      struct event *next;		/* next in hash chain */
!     void *event;		/* lwp event: an address */
      int refcount;		/* Is it in use? */
      pthread_cond_t cond;	/* Currently associated condition variable */
      int seq;			/* Sequence number: this is incremented
***************
*** 1508,1514 ****
  
  /* Get and initialize event structure corresponding to lwp event (i.e. address) */
  static event_t *
! getevent(char *event)
  {
      event_t *evp, *newp;
      int hashcode;
--- 1518,1524 ----
  
  /* Get and initialize event structure corresponding to lwp event (i.e. address) */
  static event_t *
! getevent(void *event)
  {
      event_t *evp, *newp;
      int hashcode;
***************
*** 1542,1548 ****
  #define relevent(evp) ((evp)->refcount--)
  
  int
! LWP_WaitProcess(char *event)
  {				/* wait on a single event */
      struct event *ev;
      int seq;
--- 1552,1558 ----
  #define relevent(evp) ((evp)->refcount--)
  
  int
! LWP_WaitProcess(void *event)
  {				/* wait on a single event */
      struct event *ev;
      int seq;
***************
*** 1566,1572 ****
  }
  
  int
! LWP_NoYieldSignal(char *event)
  {
      struct event *ev;
      debugf(("%s: no yield signal (%x)\n", lwp_process_string(), event));
--- 1576,1582 ----
  }
  
  int
! LWP_NoYieldSignal(void *event)
  {
      struct event *ev;
      debugf(("%s: no yield signal (%x)\n", lwp_process_string(), event));
***************
*** 1582,1588 ****
  }
  
  int
! LWP_SignalProcess(char *event)
  {
      struct event *ev;
      debugf(("%s: signal process (%x)\n", lwp_process_string(), event));
--- 1592,1598 ----
  }
  
  int
! LWP_SignalProcess(void *event)
  {
      struct event *ev;
      debugf(("%s: signal process (%x)\n", lwp_process_string(), event));
Index: openafs/src/lwp/lwp.h
diff -c openafs/src/lwp/lwp.h:1.14.2.3 openafs/src/lwp/lwp.h:1.14.2.5
*** openafs/src/lwp/lwp.h:1.14.2.3	Sun Apr  3 14:18:54 2005
--- openafs/src/lwp/lwp.h	Thu Mar 13 09:42:31 2008
***************
*** 223,229 ****
      char blockflag;		/* if (blockflag), process blocked */
      char eventlistsize;		/* size of eventlist array */
      char padding;		/* force 32-bit alignment */
!     char **eventlist;		/* ptr to array of eventids */
      int eventcnt;		/* no. of events currently in eventlist array */
      int wakevent;		/* index of eventid causing wakeup */
      int waitcnt;		/* min number of events awaited */
--- 223,229 ----
      char blockflag;		/* if (blockflag), process blocked */
      char eventlistsize;		/* size of eventlist array */
      char padding;		/* force 32-bit alignment */
!     void **eventlist;		/* ptr to array of eventids */
      int eventcnt;		/* no. of events currently in eventlist array */
      int wakevent;		/* index of eventid causing wakeup */
      int waitcnt;		/* min number of events awaited */
***************
*** 232,238 ****
      char *stack;		/* ptr to process stack */
      int stacksize;		/* size of stack */
      int stackcheck;		/* first word of stack for overflow checking */
!     int (*ep) ();		/* initial entry point */
      char *parm;			/* initial parm for process */
      struct lwp_context
        context;			/* saved context for next dispatch */
--- 232,238 ----
      char *stack;		/* ptr to process stack */
      int stacksize;		/* size of stack */
      int stackcheck;		/* first word of stack for overflow checking */
!     void *(*ep)(void *);	/* initial entry point */
      char *parm;			/* initial parm for process */
      struct lwp_context
        context;			/* saved context for next dispatch */
***************
*** 348,354 ****
  extern int IOMGR_Cancel(PROCESS pid);
  extern int IOMGR_Initialize(void);
  extern void IOMGR_FreeFDSet(fd_set * fds);
! extern int IOMGR_SoftSig(int (*aproc) (), char *arock);
  
  
  /* fasttime.c */
--- 348,354 ----
  extern int IOMGR_Cancel(PROCESS pid);
  extern int IOMGR_Initialize(void);
  extern void IOMGR_FreeFDSet(fd_set * fds);
! extern int IOMGR_SoftSig(void *(*aproc) (void *), void *arock);
  
  
  /* fasttime.c */
***************
*** 374,388 ****
  extern int LWP_QSignal(PROCESS pid);
  #else
  extern int LWP_CurrentProcess(PROCESS * pid);
! extern int LWP_INTERNALSIGNAL(char *event, int yield);
  extern int LWP_InitializeProcessSupport(int priority, PROCESS * pid);
! extern int LWP_CreateProcess(int (*ep) (), int stacksize, int priority,
  			     void *parm, char *name, PROCESS * pid);
  extern int LWP_DestroyProcess(PROCESS pid);
! extern int LWP_WaitProcess(char *event);
  extern PROCESS LWP_ThreadId(void);
  #endif
  
  #ifdef AFS_LINUX24_ENV
  /* max time we are allowed to spend in a select call on Linux to avoid 
   lost signal issues */
--- 374,395 ----
  extern int LWP_QSignal(PROCESS pid);
  #else
  extern int LWP_CurrentProcess(PROCESS * pid);
! extern int LWP_INTERNALSIGNAL(void *event, int yield);
  extern int LWP_InitializeProcessSupport(int priority, PROCESS * pid);
! extern int LWP_CreateProcess(void *(*ep)(void *), int stacksize, int priority,
  			     void *parm, char *name, PROCESS * pid);
  extern int LWP_DestroyProcess(PROCESS pid);
! extern int LWP_DispatchProcess(void);
! extern int LWP_WaitProcess(void *event);
  extern PROCESS LWP_ThreadId(void);
+ extern int LWP_QWait(void);
+ extern int LWP_QSignal(register PROCESS pid);
  #endif
  
+ extern afs_int32 savecontext(void (*ep)(void), 
+ 			     struct lwp_context *savearea, char *sp);
+ extern void returnto(struct lwp_context *savearea);
+ 
  #ifdef AFS_LINUX24_ENV
  /* max time we are allowed to spend in a select call on Linux to avoid 
   lost signal issues */
Index: openafs/src/lwp/preempt.c
diff -c openafs/src/lwp/preempt.c:1.16.2.1 openafs/src/lwp/preempt.c:1.16.2.2
*** openafs/src/lwp/preempt.c:1.16.2.1	Mon Jul 11 14:59:55 2005
--- openafs/src/lwp/preempt.c	Mon Mar 10 18:35:35 2008
***************
*** 17,23 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/lwp/preempt.c,v 1.16.2.1 2005/07/11 18:59:55 shadow Exp $");
  
  
  #include "lwp.h"
--- 17,23 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/lwp/preempt.c,v 1.16.2.2 2008/03/10 22:35:35 shadow Exp $");
  
  
  #include "lwp.h"
***************
*** 34,40 ****
  }
  
  int
! PRE_EndPreempt()
  {
      return LWP_SUCCESS;
  }
--- 34,40 ----
  }
  
  int
! PRE_EndPreempt(void)
  {
      return LWP_SUCCESS;
  }
Index: openafs/src/lwp/process.c
diff -c openafs/src/lwp/process.c:1.21.2.4 openafs/src/lwp/process.c:1.21.2.8
*** openafs/src/lwp/process.c:1.21.2.4	Mon Jul 16 23:13:59 2007
--- openafs/src/lwp/process.c	Thu Mar 13 09:42:31 2008
***************
*** 13,19 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/lwp/process.c,v 1.21.2.4 2007/07/17 03:13:59 shadow Exp $");
  
  #include <stdio.h>
  #include <assert.h>
--- 13,19 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/lwp/process.c,v 1.21.2.8 2008/03/13 13:42:31 shadow Exp $");
  
  #include <stdio.h>
  #include <assert.h>
***************
*** 31,37 ****
  #if defined(USE_UCONTEXT) && defined(HAVE_UCONTEXT_H)
  
  afs_int32
! savecontext(char (*ep) (), struct lwp_context *savearea, char *newsp)
  {
  #if defined(AFS_LINUX20_ENV)
      /* getcontext does not export stack info */
--- 31,37 ----
  #if defined(USE_UCONTEXT) && defined(HAVE_UCONTEXT_H)
  
  afs_int32
! savecontext(void (*ep) (void), struct lwp_context *savearea, char *newsp)
  {
  #if defined(AFS_LINUX20_ENV)
      /* getcontext does not export stack info */
***************
*** 69,76 ****
  }
  
  void
! returnto(savearea)
!      struct lwp_context *savearea;
  {
      PRE_Block = 0;
  
--- 69,75 ----
  }
  
  void
! returnto(struct lwp_context *savearea)
  {
      PRE_Block = 0;
  
***************
*** 138,144 ****
  #endif /*SGI*/
  
      static jmp_buf jmp_tmp;
! static char (*EP) ();
  static int rc;
  static jmp_buf_type *jmpBuffer;
  
--- 137,143 ----
  #endif /*SGI*/
  
      static jmp_buf jmp_tmp;
! static void *(*EP) (void);
  static int rc;
  static jmp_buf_type *jmpBuffer;
  
***************
*** 172,181 ****
  
  
  afs_int32
! savecontext(ep, savearea, sp)
!      char (*ep) ();
!      struct lwp_context *savearea;
!      char *sp;
  {
      int code;
  
--- 171,177 ----
  
  
  afs_int32
! savecontext(void (*ep)(void), struct lwp_context *savearea, char *sp)
  {
      int code;
  
***************
*** 233,239 ****
      return 0;
  }
  
! afs_int32
  returnto(struct lwp_context * savearea)
  {
  #if	defined(DEBUG)
--- 229,235 ----
      return 0;
  }
  
! void
  returnto(struct lwp_context * savearea)
  {
  #if	defined(DEBUG)
***************
*** 249,255 ****
  #endif
      PRE_Block = 0;
      longjmp(savearea->setjmp_buffer, 2);
!     return 0;
  }
  
  #endif
--- 245,251 ----
  #endif
      PRE_Block = 0;
      longjmp(savearea->setjmp_buffer, 2);
!     return;
  }
  
  #endif
Index: openafs/src/lwp/process.s
diff -c openafs/src/lwp/process.s:1.11.2.1 openafs/src/lwp/process.s:1.11.2.3
*** openafs/src/lwp/process.s:1.11.2.1	Wed Aug 25 03:03:40 2004
--- openafs/src/lwp/process.s	Tue Jan 15 09:11:18 2008
***************
*** 12,19 ****
  #include <afs/param.h>
  /*#endif /* AFS_DJGPP_ENV */
  
! #if defined(RIOS)
  
  /*                 I don't know if we have to save the TOC (R2) or not...
   *		   Note that stack-frame is supposed to be aligned on 
   *		   a double-word boundary.
--- 12,74 ----
  #include <afs/param.h>
  /*#endif /* AFS_DJGPP_ENV */
  
! #if defined(__arm32__) || defined(__arm__)
!        /* register definitions */
!        fp      .req    r11
!        ip      .req    r12
!        sp      .req    r13
!        lp      .req    r14
!        pc      .req    r15
!        
!        /*
!           savecontext(f, area1, newsp)
!                int (*f)()#if defined(RIOS);
!                struct savearea *area1;
!                char *newsp;
!        */
! 
!        /* Arguments appear as:	   f in r0, area1 in r1, newsp in r2 */
! 
!        .text
!        .align  0
!        .globl  savecontext
!        .type   savecontext, #function
! savecontext:
!        @ build the frame
!        mov     ip, sp
!        stmfd   sp!, {fp, ip, lr, pc}
!        sub     fp, ip, #4
!        @ stack r0 - r10, current fp
!        stmfd   sp!, {r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, fp}
!        str     sp, [r1, #0]
!        @ check if newsp is zero
!        movs    r2, r2
!        movne   sp, r2
!        @ call function ...
!        mov     pc, r0
! 
!        /*      should never get here ... */
!        /*      bl      EXT(abort) */
! 
!        /*
!          returnto(area2)
!             struct savearea *area2;
!        */
  
+        /* area2 is in r0. */
+ 
+        .globl returnto
+        .type  returnto, #function
+ returnto:
+        @ restore r0-r10, fp
+        ldr     r0, [r0, #0]
+        ldmfd   r0, {r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, fp}
+        @ return from function call
+        ldmea   fp, {fp, sp, pc}
+ 
+ #endif /* __arm32__ or __arm__ */
+ 
+ #if defined(RIOS)
  /*                 I don't know if we have to save the TOC (R2) or not...
   *		   Note that stack-frame is supposed to be aligned on 
   *		   a double-word boundary.
Index: openafs/src/lwp/threadname.c
diff -c openafs/src/lwp/threadname.c:1.10 openafs/src/lwp/threadname.c:1.10.2.1
*** openafs/src/lwp/threadname.c:1.10	Sat Nov 29 17:08:14 2003
--- openafs/src/lwp/threadname.c	Tue Oct 30 11:23:59 2007
***************
*** 23,37 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/lwp/threadname.c,v 1.10 2003/11/29 22:08:14 jaltman Exp $");
  
- #ifdef HAVE_STRING_H
  #include <string.h>
! #else
! #ifdef HAVE_STRINGS_H
! #include <strings.h>
! #endif
! #endif
  #if defined(AFS_PTHREAD_ENV)
  #include <pthread.h>
  #else /* defined(AFS_PTHREAD_ENV) */
--- 23,32 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/lwp/threadname.c,v 1.10.2.1 2007/10/30 15:23:59 shadow Exp $");
  
  #include <string.h>
! 
  #if defined(AFS_PTHREAD_ENV)
  #include <pthread.h>
  #else /* defined(AFS_PTHREAD_ENV) */
Index: openafs/src/lwp/timer.h
diff -c openafs/src/lwp/timer.h:1.5 openafs/src/lwp/timer.h:1.5.2.1
*** openafs/src/lwp/timer.h:1.5	Tue Jul 15 19:15:46 2003
--- openafs/src/lwp/timer.h	Mon Mar 10 18:35:35 2008
***************
*** 30,42 ****
  #ifndef _TIMER_IMPL_
  #define Tm_Insert(list, elem) openafs_insque(list, elem)
  #define TM_Remove(list, elem) openafs_remque(elem)
! extern int TM_Rescan();
! void TM_Insert();
! extern struct TM_Elem *TM_GetExpired();
! extern struct TM_Elem *TM_GetEarliest();
  #endif
  
! extern int TM_Final();
  
  #define FOR_ALL_ELTS(var, list, body)\
  	{\
--- 30,43 ----
  #ifndef _TIMER_IMPL_
  #define Tm_Insert(list, elem) openafs_insque(list, elem)
  #define TM_Remove(list, elem) openafs_remque(elem)
! extern int TM_Rescan(struct TM_Elem *tlist);
! void TM_Insert(struct TM_Elem *tlistPtr, struct TM_Elem *elem);
! extern struct TM_Elem *TM_GetExpired(struct TM_Elem *tlist);
! extern struct TM_Elem *TM_GetEarliest(struct TM_Elem *tlist);
  #endif
  
! extern int TM_Init(register struct TM_Elem **list);
! extern int TM_Final(register struct TM_Elem **list);
  
  #define FOR_ALL_ELTS(var, list, body)\
  	{\
Index: openafs/src/lwp/waitkey.c
diff -c openafs/src/lwp/waitkey.c:1.13 openafs/src/lwp/waitkey.c:1.13.2.1
*** openafs/src/lwp/waitkey.c:1.13	Sat Nov 29 17:08:14 2003
--- openafs/src/lwp/waitkey.c	Tue Oct 30 11:23:59 2007
***************
*** 23,29 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/lwp/waitkey.c,v 1.13 2003/11/29 22:08:14 jaltman Exp $");
  
  #include <stdio.h>
  #include <sys/types.h>
--- 23,29 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/lwp/waitkey.c,v 1.13.2.1 2007/10/30 15:23:59 shadow Exp $");
  
  #include <stdio.h>
  #include <sys/types.h>
***************
*** 35,47 ****
  #include <sys/time.h>
  #include <unistd.h>
  #endif
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include "lwp.h"
  
  #define LWP_KEYSTROKE_DELAY   250	/* 250ms. Must be < 1000 */
--- 35,41 ----
Index: openafs/src/null/null.c
diff -c openafs/src/null/null.c:1.3 openafs/src/null/null.c:1.3.2.1
*** openafs/src/null/null.c:1.3	Tue Jul 15 19:15:52 2003
--- openafs/src/null/null.c	Mon Nov 26 16:21:54 2007
***************
*** 20,23 ****
--- 20,24 ----
       * Shortest routine in history.
       */
  
+     return 0; 
  }				/*main */
Index: openafs/src/packaging/MacOS/DS_Store
Index: openafs/src/packaging/MacOS/OpenAFS.post_install
diff -c openafs/src/packaging/MacOS/OpenAFS.post_install:1.3.2.7 openafs/src/packaging/MacOS/OpenAFS.post_install:1.3.2.8
*** openafs/src/packaging/MacOS/OpenAFS.post_install:1.3.2.7	Wed Oct 24 23:45:16 2007
--- openafs/src/packaging/MacOS/OpenAFS.post_install	Mon Jan 21 16:01:30 2008
***************
*** 44,51 ****
  fi
  rm -f config/afsd.options.broken
  
! if [ ! -f config/afsd.options -a -f config/afsd.options.sample ]; then
!    cp config/afsd.options.sample config/afsd.options
  fi
  
  # testing case -- upgrading from pre 1.2.7, but .last file exists.
--- 44,60 ----
  fi
  rm -f config/afsd.options.broken
  
! # if the user hasn't changed these settings, then they should just use the new
! # afsd.conf file
! rm -f config/afsd.options.old
! echo '-afsdb -stat 2000 -dcache 800 -daemons 3 -volumes 70 -dynroot -fakestat-all' >config/afsd.options.old
! if cmp -s config/afsd.options.old config/afsd.options ; then
!    rm -f config/afsd.options
! fi
! rm -f config/afsd.options.old
! 
! if [ ! -f config/afs.conf -a -f config/afs.conf.sample ]; then
!    cp config/afs.conf.sample config/afs.conf
  fi
  
  # testing case -- upgrading from pre 1.2.7, but .last file exists.
Index: openafs/src/packaging/MacOS/ReadMe.rtf
diff -c openafs/src/packaging/MacOS/ReadMe.rtf:1.2.2.4 openafs/src/packaging/MacOS/ReadMe.rtf:removed
*** openafs/src/packaging/MacOS/ReadMe.rtf:1.2.2.4	Mon Apr 10 16:29:43 2006
--- openafs/src/packaging/MacOS/ReadMe.rtf	Sun Mar 23 21:55:08 2008
***************
*** 1,13 ****
- {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf100
- {\fonttbl\f0\fswiss\fcharset77 Helvetica;}
- {\colortbl;\red255\green255\blue255;}
- \margl1440\margr1440\vieww9000\viewh9000\viewkind0
- \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
- 
- \f0\fs20 \cf0 This release of OpenAFS is targeted at MacOS 10.4.x. 
- \
- Select a client cell name by editing /var/db/openafs/etc/ThisCell\
- \
- The included afssettings program is distributed under the Apple Public Source License, version 2.0. See http://www.opensource.apple.com/apsl/2.0.txt or the included file 2.0.txt.\
- \
- Reboot when all of this is done.}
--- 0 ----
Index: openafs/src/packaging/MacOS/ReadMe.rtf.8
diff -c /dev/null openafs/src/packaging/MacOS/ReadMe.rtf.8:1.1.4.2
*** /dev/null	Sun Mar 23 21:55:08 2008
--- openafs/src/packaging/MacOS/ReadMe.rtf.8	Fri Nov  9 14:36:28 2007
***************
*** 0 ****
--- 1,13 ----
+ {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf100
+ {\fonttbl\f0\fswiss\fcharset77 Helvetica;}
+ {\colortbl;\red255\green255\blue255;}
+ \margl1440\margr1440\vieww9000\viewh9000\viewkind0
+ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+ 
+ \f0\fs20 \cf0 This release of OpenAFS is targeted at MacOS 10.4. (Tiger)
+ \
+ Select a client cell name by editing /var/db/openafs/etc/ThisCell\
+ \
+ The included afssettings program is distributed under the Apple Public Source License, version 2.0. See http://www.opensource.apple.com/apsl/2.0.txt or the included file 2.0.txt.\
+ \
+ Reboot when all of this is done.}
Index: openafs/src/packaging/MacOS/ReadMe.rtf.9
diff -c /dev/null openafs/src/packaging/MacOS/ReadMe.rtf.9:1.1.4.2
*** /dev/null	Sun Mar 23 21:55:08 2008
--- openafs/src/packaging/MacOS/ReadMe.rtf.9	Fri Nov  9 14:36:28 2007
***************
*** 0 ****
--- 1,13 ----
+ {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf100
+ {\fonttbl\f0\fswiss\fcharset77 Helvetica;}
+ {\colortbl;\red255\green255\blue255;}
+ \margl1440\margr1440\vieww9000\viewh9000\viewkind0
+ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+ 
+ \f0\fs20 \cf0 This release of OpenAFS is targeted at MacOS 10.5. (Leopard)
+ \
+ Select a client cell name by editing /var/db/openafs/etc/ThisCell\
+ \
+ The included afssettings program is distributed under the Apple Public Source License, version 2.0. See http://www.opensource.apple.com/apsl/2.0.txt or the included file 2.0.txt.\
+ \
+ Reboot when all of this is done.}
Index: openafs/src/packaging/MacOS/afs.conf
diff -c /dev/null openafs/src/packaging/MacOS/afs.conf:1.1.4.2
*** /dev/null	Sun Mar 23 21:55:08 2008
--- openafs/src/packaging/MacOS/afs.conf	Mon Jan 21 16:01:30 2008
***************
*** 0 ****
--- 1,94 ----
+ # -*- sh -*-
+ # WARNING: this file is ignored if /var/db/openafs/etc/config/afsd.options
+ # exists. 
+ #
+ # 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
+ 
+ # Configuration information for AFS client.
+ 
+ # Set to "-verbose" for a lot of debugging information from afsd.  Only useful
+ # for debugging as it prints a LOT of information.
+ VERBOSE=
+ 
+ # AFS client configuration options.
+ #
+ # Here is a (mostly) complete list of flags that afsd accepts and that are
+ # useful here:
+ #
+ #   -blocks     The number of blocks available in the workstation cache.
+ #   -files      The target number of files in the workstation cache (Default:
+ #               1000).
+ #   -rootvol    The name of the root volume to use.
+ #   -stat       The number of stat cache entries.
+ #   -hosts      List of servers to check for volume location info FOR THE
+ #               HOME CELL.
+ #   -memcache   Use an in-memory cache rather than disk.
+ #   -cachedir   The base directory for the workstation cache.
+ #   -mountdir   The directory on which the AFS is to be mounted.
+ #   -confdir    The configuration directory.
+ #   -nosettime  Don't keep checking the time to avoid drift (default).
+ #   -settime    Keep checking the time to avoid drift.
+ #   -verbose    Be chatty.
+ #   -debug      Print out additional debugging info.
+ #   -daemons    The number of background daemons to start (Default: 2).
+ #   -rmtsys     Also fires up an afs remote sys call (e.g. pioctl, setpag)
+ #               support daemon 
+ #   -chunksize  2^n is the chunksize to be used (Default: use a kernel
+ #               module default).
+ #   -dcache     The number of data cache entries.
+ #   -prealloc   Number of preallocated "small" memory blocks
+ #   -waitclose  Make close calls always synchronous (slows them down, though)
+ #   -files_per_subdir   Number of files per cache subdir (Default: 2048).
+ #
+ # Using the memory cache is not recommended.  It's less stable than the disk
+ # cache and doesn't improve performance as much as it might sound.
+ #
+ # The default behavior is to let afsd automatically choose an apporpriate set
+ # of flags.  This should produce reasonable behavior for most working sets
+ # provided that one is using a modern AFS client (1.4.2 or later).
+ #
+ # You can override that default behavior by setting OPTIONS to a specific set
+ # of flags.
+ OPTIONS="-afsdb -stat 2000 -dcache 800 -daemons 3 -volumes 70 -dynroot -fakestat-all"
+ 
+ # The default value for the client sysname (as returned by fs sysname) is
+ # determined during the kernel module build and is taken from the architecture
+ # and the major Linux kernel version.  Accesses to directories named "@sys" in
+ # AFS will be internally redirected to a directory by this name by the AFS
+ # client, allowing a single path to resolve to different directories depending
+ # on the client architecture.
+ #
+ # If you would like to override the client sysname, uncomment this line and
+ # set the variable to a space-separated list of sysnames.  The AFS client will
+ # attempt to resolve @sys to each directory name in the order given.
+ AFS_SYSNAME=""
+ 
+ # If you want to prefer particular servers for replicated volumes, you can
+ # configure that by defining an afs_server_prefs function here and then
+ # uncommenting the setting of AFS_POST_INIT below.  For more information, see
+ # fs help setserverprefs and fs getserverprefs (for the current values).
+ 
+ #afs_server_prefs() {
+ #    fs setserverprefs <host> <rank>
+ #}
+ 
+ # If you want to always run some command after starting OpenAFS, you can put
+ # it here.  Note that you cannot run multiple commands, even combined with &&
+ # or ; or similar shell meta-characters.  If you want to run multiple
+ # commands, define a shell function instead and put the name of the shell
+ # function here.
+ AFS_POST_INIT=
+ 
+ # Uncomment this line if you defined an afs_server_prefs function.  (If you
+ # have other commands that you also want to run, you'll have to put them in
+ # that function, as you can only run one function.)
+ #AFS_POST_INIT=afs_server_prefs
+ 
+ # If you want to always run some command before shutting down OpenAFS, you can
+ # put it here.  The same caveat applies about multiple commands.
+ AFS_PRE_SHUTDOWN=
Index: openafs/src/packaging/MacOS/afslogo.jpg
Index: openafs/src/packaging/MacOS/background.jpg
Index: openafs/src/packaging/MacOS/buildpkg.sh
diff -c openafs/src/packaging/MacOS/buildpkg.sh:1.4.2.21 openafs/src/packaging/MacOS/buildpkg.sh:removed
*** openafs/src/packaging/MacOS/buildpkg.sh:1.4.2.21	Wed Oct 24 23:45:16 2007
--- openafs/src/packaging/MacOS/buildpkg.sh	Sun Mar 23 21:55:08 2008
***************
*** 1,248 ****
- #!/bin/sh
- # Portions Copyright (c) 2003, 2006 Apple Computer, Inc.  All rights reserved.
- 
- if [ -z "$1" ]; then
-     echo Usage: buildpkg binary-dir
-     echo '  or'
-     echo 'Usage: buildpkg [-firstpass] binary-dir'
-     echo '            (customize pkgroot)'
-     echo '       buildpkg [-secondpass]'
-     exit 1
- fi
- 
- firstpass=yes
- secondpass=yes
- if [ "$1" = "-firstpass" ]; then
-     secondpass=no
-     shift
- elif [ "$1" = "-secondpass" ]; then
-     firstpass=no
-     shift
- fi
- 
- BINDEST=`cd $1 && pwd`
- CURDIR=`pwd`
- RESSRC=`dirname $0`
- RESSRC=`cd $RESSRC && pwd`
- majorvers=`uname -r | sed 's/\..*//'`
- 
- PKGROOT=$CURDIR/pkgroot
- PKGRES=$CURDIR/pkgres
- if [ $majorvers -ge 7 ]; then
-     SEP=:
-     package=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
-     if [ ! -x $package ]; then
-        echo "PackageMaker does not exist. Please run this script on a MacOS X system"
-       echo "with the DeveloperTools package installed"
-       exit 1
-     fi
- else
-     SEP=.
-     package=/usr/bin/package
-     if [ ! -f $package ]; then
-        echo "$package does not exist. Please run this script on a MacOS X system"
-       echo "with the BSD subsystem installed"
-       exit 1
-     fi
-     if grep -q 'set resDir = ""' $package ; then
-        echo $package is buggy.
-        echo remove the line \''set resDir = ""'\' from $package and try again
-        exit 1
-     fi
- fi
- 
- if [ $firstpass = yes ]; then
-     if [ -x /usr/bin/curl ]; then
- 	/usr/bin/curl -f -O http://dl.central.org/dl/cellservdb/CellServDB
-     fi
- 
-     if [ ! -f CellServDB ]; then
-        echo "A CellServDB file must be placed in the working directory"
-        die=1
-     else
-        if grep -q 'GCO Public CellServDB' CellServDB ; then
-          touch CellServDB
-        else
-           echo "A proper CellServDB file must be placed in the working directory"
-           die=1
-        fi
-     fi
-     FILES="ReadMe.rtf License.rtf CellServDB.list OpenAFS.info OpenAFS.post_install OpenAFS.pre_upgrade csrvdbmerge.pl 2.0.txt"
-     for f in $FILES; do
-        if [ ! -f $RESSRC/$f ]; then
- 	 echo "file missing: " $RESSRC/$f
- 	 die=1
-        fi
-     done
-     if [ "$die" ]; then
-       echo "Correct above errors; then retry"
-       exit 1
-     fi
-     if [ ! -f $BINDEST/bin/translate_et ]; then
-       die=1
-     fi
-     if [ ! -f $BINDEST/root.client/usr/vice/etc/afs.kext/Contents/MacOS/afs ]; then
-       die=1
-     fi
-     if [ "$die" ]; then
-        echo $BINDEST " is not a valid binary dir. it should be the result of"
-        echo "make dest"
-        exit 1
-     fi
- 
-     rm -rf $PKGROOT
-     mkdir $PKGROOT
- 
-     mkdir -p $PKGROOT/Library
-     chown root${SEP}admin $PKGROOT
-     chmod 775 $PKGROOT $PKGROOT/Library
-     mkdir -p $PKGROOT/Library/OpenAFS/Tools
-     (cd $BINDEST && pax -rw * $PKGROOT/Library/OpenAFS/Tools)
-     cd $RESSRC
-     mkdir -p $PKGROOT/Library/StartupItems/OpenAFS
-     cp $BINDEST/root.client/usr/vice/etc/afs.rc  $PKGROOT/Library/StartupItems/OpenAFS/OpenAFS
-     chmod a+x $PKGROOT/Library/StartupItems/OpenAFS/OpenAFS
-     cp $BINDEST/root.client/usr/vice/etc/StartupParameters.plist  $PKGROOT/Library/StartupItems/OpenAFS/StartupParameters.plist
-     chown -R root${SEP}admin $PKGROOT/Library
-     chmod -R o-w $PKGROOT/Library
-     chmod -R g+w $PKGROOT/Library
-     chown -R root${SEP}wheel $PKGROOT/Library/StartupItems
-     chmod -R og-w $PKGROOT/Library/StartupItems
-     chown -R root${SEP}wheel $PKGROOT/Library/OpenAFS/Tools
-     chmod -R og-w $PKGROOT/Library/OpenAFS/Tools
- 
-     mkdir -p $PKGROOT/private/var/db/openafs/cache
-     mkdir -p $PKGROOT/private/var/db/openafs/etc/config
-     cp $CURDIR/CellServDB $PKGROOT/private/var/db/openafs/etc/CellServDB.master
-     echo grand.central.org > $PKGROOT/private/var/db/openafs/etc/ThisCell.sample
-     if [ $majorvers -ge 7 ]; then
- 	echo /afs:/var/db/openafs/cache:30000 > $PKGROOT/private/var/db/openafs/etc/cacheinfo.sample
-         cp -RP $PKGROOT/Library/OpenAFS/Tools/etc/afssettings $PKGROOT/private/var/db/openafs/etc/config
- 	cp settings.plist $PKGROOT/private/var/db/openafs/etc/config/settings.plist.orig
-     else
- 	echo /Network/afs:/var/db/openafs/cache:30000 > $PKGROOT/private/var/db/openafs/etc/cacheinfo.sample
-     fi
-     echo '-afsdb -stat 2000 -dcache 800 -daemons 3 -volumes 70 -dynroot -fakestat-all' > $PKGROOT/private/var/db/openafs/etc/config/afsd.options.sample
- 
-     strip -X -S $PKGROOT/Library/OpenAFS/Tools/root.client/usr/vice/etc/afs.kext/Contents/MacOS/afs
- 
-     cp -RP $PKGROOT/Library/OpenAFS/Tools/root.client/usr/vice/etc/afs.kext $PKGROOT/private/var/db/openafs/etc
-     cp -RP $PKGROOT/Library/OpenAFS/Tools/root.client/usr/vice/etc/C $PKGROOT/private/var/db/openafs/etc
- 
-     chown -R root${SEP}wheel $PKGROOT/private
-     chmod -R og-w $PKGROOT/private
-     chmod  og-rx $PKGROOT/private/var/db/openafs/cache
- 
-     mkdir -p $PKGROOT/usr/bin $PKGROOT/usr/sbin $PKGROOT/usr/share/man/man1 $PKGROOT/usr/share/man/man5 $PKGROOT/usr/share/man/man8
- 
-     BINLIST="fs klog klog.krb pagsh pagsh.krb pts sys tokens tokens.krb unlog unlog.krb aklog"
-     ETCLIST="vos"
- 
- # Should these be linked into /usr too?
-     OTHER_BINLIST="bos cmdebug rxgen translate_et udebug xstat_cm_test xstat_fs_test"
-     OTHER_ETCLIST="rxdebug"
- 
-     for f in $BINLIST; do
-        ln -s ../../Library/OpenAFS/Tools/bin/$f $PKGROOT/usr/bin/$f
-     done
-     for f in $ETCLIST; do
-        ln -s ../../Library/OpenAFS/Tools/etc/$f $PKGROOT/usr/sbin/$f
-     done
-     for f in `ls $PKGROOT/Library/OpenAFS/Tools/man/man1`; do
- 	gzip -9 $PKGROOT/Library/OpenAFS/Tools/man/man1/$f
- 	ln -s ../../../../Library/OpenAFS/Tools/man/man1/$f.gz $PKGROOT/usr/share/man/man1/$f.gz
-     done
-     for f in `ls $PKGROOT/Library/OpenAFS/Tools/man/man5`; do
- 	gzip -9 $PKGROOT/Library/OpenAFS/Tools/man/man5/$f
- 	ln -s ../../../../Library/OpenAFS/Tools/man/man5/$f.gz $PKGROOT/usr/share/man/man5/$f.gz
-     done
-     for f in `ls $PKGROOT/Library/OpenAFS/Tools/man/man8`; do
- 	gzip -9 $PKGROOT/Library/OpenAFS/Tools/man/man8/$f
- 	ln -s ../../../../Library/OpenAFS/Tools/man/man8/$f.gz $PKGROOT/usr/share/man/man8/$f.gz
-     done
- 
-     ln -s ../../Library/OpenAFS/Tools/bin/kpasswd $PKGROOT/usr/bin/kpasswd.afs
- 
-     ln -s ../../Library/OpenAFS/Tools/root.client/usr/vice/etc/afsd $PKGROOT/usr/sbin/afsd
- 
- #    mkdir -p $PKGROOT/Library/Kerberos\ Plug-Ins
- #    ln -s ../../Library/OpenAFS/Tools/root.client/Library/Kerberos\ Plug-Ins/aklog.loginLogout $PKGROOT/Library/Kerberos\ Plug-Ins/
- 
-     chown -R root${SEP}wheel $PKGROOT/usr
-     chmod -R og-w $PKGROOT/usr
- fi
- 
- if [ $secondpass = yes ]; then
-     rm -rf $PKGRES
-     mkdir $PKGRES
- 
-     cd $RESSRC
-     if [ $majorvers -ge 7 ]; then
- 	cp OpenAFS.post_install $PKGRES/postinstall
- 	cp OpenAFS.pre_upgrade $PKGRES/preupgrade
- 	cp OpenAFS.post_install $PKGRES/postupgrade
- 	cp background.jpg $PKGRES/background.jpg
- 	if [ $majorvers -ge 8 ]; then
- 	    cp InstallationCheck.$majorvers $PKGRES/InstallationCheck
- 	    mkdir -p $PKGRES/English.lproj
- 	    cp InstallationCheck.$majorvers $PKGRES/English.lproj/InstallationCheck
- 	    chmod a+x $PKGRES/InstallationCheck
- 	fi
- 	chmod a+x $PKGRES/postinstall $PKGRES/postupgrade $PKGRES/preupgrade
-     else
- 	cp OpenAFS.post_install OpenAFS.pre_upgrade $PKGRES
- 	cp OpenAFS.post_install $PKGRES/OpenAFS.post_upgrade
- 	chmod a+x $PKGRES/OpenAFS.post_install $PKGRES/OpenAFS.post_upgrade $PKGRES/OpenAFS.pre_upgrade
-     fi
-     cp License.rtf ReadMe.rtf $PKGRES
-     cp csrvdbmerge.pl $PKGRES
-     chmod a+x $PKGRES/csrvdbmerge.pl
-     cp CellServDB.list $PKGRES
-     chown -R root${SEP}wheel $PKGRES
-     rm -rf $CURDIR/OpenAFS.pkg
- 
-     # once we have cm cleanup in 10.4 this can go
-     if [ $majorvers -le 8 ]; then
- 	cat $RESSRC/OpenAFS.info|sed 's/RequiresReboot NO/RequiresReboot YES/'>$RESSRC/OpenAFS.info.new
- 	rm -f $RESSRC/OpenAFS.info
- 	mv $RESSRC/OpenAFS.info.new $RESSRC/OpenAFS.info
-     fi
- 
-     if [ $majorvers -ge 7 ]; then
- 	echo $package -build -p $CURDIR/OpenAFS.pkg -f $PKGROOT -r $PKGRES \
- 	    -i OpenAFS.Info.plist -d OpenAFS.Description.plist
- 	$package -build -p $CURDIR/OpenAFS.pkg -f $PKGROOT -r $PKGRES \
- 	    -i OpenAFS.Info.plist -d OpenAFS.Description.plist
-     else
- 	echo $package $PKGROOT $RESSRC/OpenAFS.info -r $PKGRES
- 	(cd $CURDIR && $package $PKGROOT $RESSRC/OpenAFS.info -r $PKGRES)
- 	#old versions of package didn't handle this properly
- 	if [ ! -r $CURDIR/OpenAFS.pkg/Contents ]; then
- 		mkdir -p $CURDIR/OpenAFS.pkg/Contents/Resources
- 		mv $CURDIR/OpenAFS.pkg/OpenAFS.* $CURDIR/OpenAFS.pkg/Contents/Resources
- 		mv $CURDIR/OpenAFS.pkg/*.rtf $CURDIR/OpenAFS.pkg/Contents/Resources
- 		mv $CURDIR/OpenAFS.pkg/csrvdbmerge.pl $CURDIR/OpenAFS.pkg/Contents/Resources
- 		mv $CURDIR/OpenAFS.pkg/CellServDB* $CURDIR/OpenAFS.pkg/Contents/Resources
- 	fi
-     fi
- 
-     rm -rf $PKGROOT $PKGRES
-     mkdir $CURDIR/dmg
-     mv $CURDIR/OpenAFS.pkg $CURDIR/dmg
-     rm -rf $CURDIR/OpenAFS.dmg
-     cp Uninstall $CURDIR/dmg/Uninstall.command
-     cp DS_Store $CURDIR/dmg/.DS_Store
-     mkdir $CURDIR/dmg/.background
-     cp afslogo.jpg $CURDIR/dmg/.background
- #    hdiutil create -srcfolder $CURDIR/dmg -volname OpenAFS -anyowners $CURDIR/OpenAFS.dmg
-     hdiutil makehybrid -hfs -hfs-volume-name OpenAFS -hfs-openfolder $CURDIR/dmg $CURDIR/dmg -o $CURDIR/TMP.dmg
-     hdiutil convert -format UDZO $CURDIR/TMP.dmg -o $CURDIR/OpenAFS.dmg
-     rm $CURDIR/TMP.dmg
-     rm -rf $CURDIR/dmg
-     # Unfortunately, sudo sets $USER to root, so I can't chown the 
-     #.pkg dir back to myself
-     #chown -R $USER $CURDIR/OpenAFS.pkg
- else
-     echo "First pass completed.  Customize pkgroot and then run:"
-     echo "    $0 -secondpass"
- fi
--- 0 ----
Index: openafs/src/packaging/MacOS/buildpkg.sh.in
diff -c /dev/null openafs/src/packaging/MacOS/buildpkg.sh.in:1.1.4.4
*** /dev/null	Sun Mar 23 21:55:08 2008
--- openafs/src/packaging/MacOS/buildpkg.sh.in	Mon Jan 21 16:01:30 2008
***************
*** 0 ****
--- 1,258 ----
+ #!/bin/sh
+ # Portions Copyright (c) 2003, 2006 Apple Computer, Inc.  All rights reserved.
+ 
+ if [ -z "$1" ]; then
+     echo Usage: buildpkg binary-dir
+     echo '  or'
+     echo 'Usage: buildpkg [-firstpass] binary-dir'
+     echo '            (customize pkgroot)'
+     echo '       buildpkg [-secondpass]'
+     exit 1
+ fi
+ 
+ firstpass=yes
+ secondpass=yes
+ if [ "$1" = "-firstpass" ]; then
+     secondpass=no
+     shift
+ elif [ "$1" = "-secondpass" ]; then
+     firstpass=no
+     shift
+ fi
+ 
+ BINDEST=`cd $1 && pwd`
+ CURDIR=`pwd`
+ RESSRC=`dirname $0`
+ RESSRC=`cd $RESSRC && pwd`
+ majorvers=`uname -r | sed 's/\..*//'`
+ if [ $majorvers -eq 7 ]; then
+   RELNAME="Panther"
+ fi
+ if [ $majorvers -eq 8 ]; then
+   RELNAME="Tiger"
+ fi
+ if [ $majorvers -eq 9 ]; then
+   RELNAME="Leopard"
+ fi
+ 
+ PKGROOT=$CURDIR/pkgroot
+ PKGRES=$CURDIR/pkgres
+ if [ $majorvers -ge 7 ]; then
+     SEP=:
+     package=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
+     if [ ! -x $package ]; then
+        echo "PackageMaker does not exist. Please run this script on a MacOS X system"
+       echo "with the DeveloperTools package installed"
+       exit 1
+     fi
+ else
+     SEP=.
+     package=/usr/bin/package
+     if [ ! -f $package ]; then
+        echo "$package does not exist. Please run this script on a MacOS X system"
+       echo "with the BSD subsystem installed"
+       exit 1
+     fi
+     if grep -q 'set resDir = ""' $package ; then
+        echo $package is buggy.
+        echo remove the line \''set resDir = ""'\' from $package and try again
+        exit 1
+     fi
+ fi
+ 
+ if [ $firstpass = yes ]; then
+     if [ -x /usr/bin/curl ]; then
+ 	/usr/bin/curl -f -O http://dl.central.org/dl/cellservdb/CellServDB
+     fi
+ 
+     if [ ! -f CellServDB ]; then
+        echo "A CellServDB file must be placed in the working directory"
+        die=1
+     else
+        if grep -q 'GCO Public CellServDB' CellServDB ; then
+          touch CellServDB
+        else
+           echo "A proper CellServDB file must be placed in the working directory"
+           die=1
+        fi
+     fi
+     FILES="ReadMe.rtf.$majorvers License.rtf CellServDB.list OpenAFS.info OpenAFS.post_install OpenAFS.pre_upgrade csrvdbmerge.pl 2.0.txt"
+     for f in $FILES; do
+        if [ ! -f $RESSRC/$f ]; then
+ 	 echo "file missing: " $RESSRC/$f
+ 	 die=1
+        fi
+     done
+     if [ "$die" ]; then
+       echo "Correct above errors; then retry"
+       exit 1
+     fi
+     if [ ! -f $BINDEST/bin/translate_et ]; then
+       die=1
+     fi
+     if [ ! -f $BINDEST/root.client/usr/vice/etc/afs.kext/Contents/MacOS/afs ]; then
+       die=1
+     fi
+     if [ "$die" ]; then
+        echo $BINDEST " is not a valid binary dir. it should be the result of"
+        echo "make dest"
+        exit 1
+     fi
+ 
+     rm -rf $PKGROOT
+     mkdir $PKGROOT
+ 
+     mkdir -p $PKGROOT/Library
+     chown root${SEP}admin $PKGROOT
+     chmod 775 $PKGROOT $PKGROOT/Library
+     mkdir -p $PKGROOT/Library/OpenAFS/Tools
+     (cd $BINDEST && pax -rw * $PKGROOT/Library/OpenAFS/Tools)
+     cd $RESSRC
+     mkdir -p $PKGROOT/Library/StartupItems/OpenAFS
+     cp $BINDEST/root.client/usr/vice/etc/afs.rc  $PKGROOT/Library/StartupItems/OpenAFS/OpenAFS
+     chmod a+x $PKGROOT/Library/StartupItems/OpenAFS/OpenAFS
+     cp $BINDEST/root.client/usr/vice/etc/StartupParameters.plist  $PKGROOT/Library/StartupItems/OpenAFS/StartupParameters.plist
+     chown -R root${SEP}admin $PKGROOT/Library
+     chmod -R o-w $PKGROOT/Library
+     chmod -R g+w $PKGROOT/Library
+     chown -R root${SEP}wheel $PKGROOT/Library/StartupItems
+     chmod -R og-w $PKGROOT/Library/StartupItems
+     chown -R root${SEP}wheel $PKGROOT/Library/OpenAFS/Tools
+     chmod -R og-w $PKGROOT/Library/OpenAFS/Tools
+ 
+     mkdir -p $PKGROOT/private/var/db/openafs/cache
+     mkdir -p $PKGROOT/private/var/db/openafs/etc/config
+     cp $CURDIR/CellServDB $PKGROOT/private/var/db/openafs/etc/CellServDB.master
+     echo grand.central.org > $PKGROOT/private/var/db/openafs/etc/ThisCell.sample
+     if [ $majorvers -ge 7 ]; then
+ 	echo /afs:/var/db/openafs/cache:30000 > $PKGROOT/private/var/db/openafs/etc/cacheinfo.sample
+         cp -RP $PKGROOT/Library/OpenAFS/Tools/etc/afssettings $PKGROOT/private/var/db/openafs/etc/config
+ 	cp settings.plist $PKGROOT/private/var/db/openafs/etc/config/settings.plist.orig
+     else
+ 	echo /Network/afs:/var/db/openafs/cache:30000 > $PKGROOT/private/var/db/openafs/etc/cacheinfo.sample
+     fi
+     cp afs.conf $PKGROOT/private/var/db/openafs/etc/config/afs.conf.sample
+ 
+     strip -X -S $PKGROOT/Library/OpenAFS/Tools/root.client/usr/vice/etc/afs.kext/Contents/MacOS/afs
+ 
+     cp -RP $PKGROOT/Library/OpenAFS/Tools/root.client/usr/vice/etc/afs.kext $PKGROOT/private/var/db/openafs/etc
+     cp -RP $PKGROOT/Library/OpenAFS/Tools/root.client/usr/vice/etc/C $PKGROOT/private/var/db/openafs/etc
+ 
+     chown -R root${SEP}wheel $PKGROOT/private
+     chmod -R og-w $PKGROOT/private
+     chmod  og-rx $PKGROOT/private/var/db/openafs/cache
+ 
+     mkdir -p $PKGROOT/usr/bin $PKGROOT/usr/sbin $PKGROOT/usr/share/man/man1 $PKGROOT/usr/share/man/man5 $PKGROOT/usr/share/man/man8
+ 
+     BINLIST="fs klog klog.krb pagsh pagsh.krb pts sys tokens tokens.krb unlog unlog.krb aklog"
+     ETCLIST="vos"
+ 
+ # Should these be linked into /usr too?
+     OTHER_BINLIST="bos cmdebug rxgen translate_et udebug xstat_cm_test xstat_fs_test"
+     OTHER_ETCLIST="rxdebug"
+ 
+     for f in $BINLIST; do
+        ln -s ../../Library/OpenAFS/Tools/bin/$f $PKGROOT/usr/bin/$f
+     done
+     for f in $ETCLIST; do
+        ln -s ../../Library/OpenAFS/Tools/etc/$f $PKGROOT/usr/sbin/$f
+     done
+     for f in `ls $PKGROOT/Library/OpenAFS/Tools/man/man1`; do
+ 	gzip -9 $PKGROOT/Library/OpenAFS/Tools/man/man1/$f
+ 	ln -s ../../../../Library/OpenAFS/Tools/man/man1/$f.gz $PKGROOT/usr/share/man/man1/$f.gz
+     done
+     for f in `ls $PKGROOT/Library/OpenAFS/Tools/man/man5`; do
+ 	gzip -9 $PKGROOT/Library/OpenAFS/Tools/man/man5/$f
+ 	ln -s ../../../../Library/OpenAFS/Tools/man/man5/$f.gz $PKGROOT/usr/share/man/man5/$f.gz
+     done
+     for f in `ls $PKGROOT/Library/OpenAFS/Tools/man/man8`; do
+ 	gzip -9 $PKGROOT/Library/OpenAFS/Tools/man/man8/$f
+ 	ln -s ../../../../Library/OpenAFS/Tools/man/man8/$f.gz $PKGROOT/usr/share/man/man8/$f.gz
+     done
+ 
+     ln -s ../../Library/OpenAFS/Tools/bin/kpasswd $PKGROOT/usr/bin/kpasswd.afs
+ 
+     ln -s ../../Library/OpenAFS/Tools/root.client/usr/vice/etc/afsd $PKGROOT/usr/sbin/afsd
+ 
+ #    mkdir -p $PKGROOT/Library/Kerberos\ Plug-Ins
+ #    ln -s ../../Library/OpenAFS/Tools/root.client/Library/Kerberos\ Plug-Ins/aklog.loginLogout $PKGROOT/Library/Kerberos\ Plug-Ins/
+ 
+     chown -R root${SEP}wheel $PKGROOT/usr
+     chmod -R og-w $PKGROOT/usr
+ fi
+ 
+ if [ $secondpass = yes ]; then
+     rm -rf $PKGRES
+     mkdir $PKGRES
+ 
+     cd $RESSRC
+     if [ $majorvers -ge 7 ]; then
+ 	cp OpenAFS.post_install $PKGRES/postinstall
+ 	cp OpenAFS.pre_upgrade $PKGRES/preupgrade
+ 	cp OpenAFS.post_install $PKGRES/postupgrade
+ 	cp background.jpg $PKGRES/background.jpg
+ 	if [ $majorvers -ge 8 ]; then
+ 	    cp InstallationCheck.$majorvers $PKGRES/InstallationCheck
+ 	    mkdir -p $PKGRES/English.lproj
+ 	    cp InstallationCheck.$majorvers $PKGRES/English.lproj/InstallationCheck
+ 	    chmod a+x $PKGRES/InstallationCheck
+ 	fi
+ 	chmod a+x $PKGRES/postinstall $PKGRES/postupgrade $PKGRES/preupgrade
+     else
+ 	cp OpenAFS.post_install OpenAFS.pre_upgrade $PKGRES
+ 	cp OpenAFS.post_install $PKGRES/OpenAFS.post_upgrade
+ 	chmod a+x $PKGRES/OpenAFS.post_install $PKGRES/OpenAFS.post_upgrade $PKGRES/OpenAFS.pre_upgrade
+     fi
+     cp License.rtf $PKGRES
+     cp ReadMe.rtf.$majorvers $PKGRES/ReadMe.rtf
+     cp csrvdbmerge.pl $PKGRES
+     chmod a+x $PKGRES/csrvdbmerge.pl
+     cp CellServDB.list $PKGRES
+     chown -R root${SEP}wheel $PKGRES
+     rm -rf $CURDIR/OpenAFS.pkg
+ 
+     # once we have cm cleanup in 10.4 this can go
+     if [ $majorvers -le 8 ]; then
+ 	cat $RESSRC/OpenAFS.info|sed 's/RequiresReboot NO/RequiresReboot YES/'>$RESSRC/OpenAFS.info.new
+ 	rm -f $RESSRC/OpenAFS.info
+ 	mv $RESSRC/OpenAFS.info.new $RESSRC/OpenAFS.info
+     fi
+ 
+     if [ $majorvers -ge 7 ]; then
+ 	echo $package -build -p $CURDIR/OpenAFS.pkg -f $PKGROOT -r $PKGRES \
+ 	    -i OpenAFS.Info.plist -d OpenAFS.Description.plist
+ 	$package -build -p $CURDIR/OpenAFS.pkg -f $PKGROOT -r $PKGRES \
+ 	    -i OpenAFS.Info.plist -d OpenAFS.Description.plist
+     else
+ 	echo $package $PKGROOT $RESSRC/OpenAFS.info -r $PKGRES
+ 	(cd $CURDIR && $package $PKGROOT $RESSRC/OpenAFS.info -r $PKGRES)
+ 	#old versions of package didn't handle this properly
+ 	if [ ! -r $CURDIR/OpenAFS.pkg/Contents ]; then
+ 		mkdir -p $CURDIR/OpenAFS.pkg/Contents/Resources
+ 		mv $CURDIR/OpenAFS.pkg/OpenAFS.* $CURDIR/OpenAFS.pkg/Contents/Resources
+ 		mv $CURDIR/OpenAFS.pkg/*.rtf $CURDIR/OpenAFS.pkg/Contents/Resources
+ 		mv $CURDIR/OpenAFS.pkg/csrvdbmerge.pl $CURDIR/OpenAFS.pkg/Contents/Resources
+ 		mv $CURDIR/OpenAFS.pkg/CellServDB* $CURDIR/OpenAFS.pkg/Contents/Resources
+ 	fi
+     fi
+ 
+     rm -rf $PKGROOT $PKGRES
+     mkdir $CURDIR/dmg
+     mv $CURDIR/OpenAFS.pkg $CURDIR/dmg
+     rm -rf $CURDIR/OpenAFS-@VERSION@-$RELNAME.dmg
+     cp Uninstall $CURDIR/dmg/Uninstall.command
+     cp DS_Store $CURDIR/dmg/.DS_Store
+     mkdir $CURDIR/dmg/.background
+     cp afslogo.jpg $CURDIR/dmg/.background
+ #    hdiutil create -srcfolder $CURDIR/dmg -volname OpenAFS -anyowners $CURDIR/OpenAFS.dmg
+     hdiutil makehybrid -hfs -hfs-volume-name OpenAFS -hfs-openfolder $CURDIR/dmg $CURDIR/dmg -o $CURDIR/TMP.dmg
+     hdiutil convert -format UDZO $CURDIR/TMP.dmg -o $CURDIR/OpenAFS-@VERSION@-$RELNAME.dmg
+     rm $CURDIR/TMP.dmg
+     rm -rf $CURDIR/dmg
+     # Unfortunately, sudo sets $USER to root, so I can't chown the 
+     #.pkg dir back to myself
+     #chown -R $USER $CURDIR/OpenAFS.pkg
+ else
+     echo "First pass completed.  Customize pkgroot and then run:"
+     echo "    $0 -secondpass"
+ fi
Index: openafs/src/packaging/MacOS/decode-panic
diff -c /dev/null openafs/src/packaging/MacOS/decode-panic:1.1.4.2
*** /dev/null	Sun Mar 23 21:55:08 2008
--- openafs/src/packaging/MacOS/decode-panic	Sun Jan 27 13:48:12 2008
***************
*** 0 ****
--- 1,302 ----
+ #!/usr/bin/perl
+ 
+ # decode-panic - decode a Mac OS panic log to show source line numbers
+ # see the end of the file for full documentation and license.
+ 
+ use Carp;
+ use English qw( -no_match_vars ) ;
+ use File::Basename;
+ use File::Temp qw( tempdir );
+ use Getopt::Long;
+ use IO::Dir;
+ use IO::File;
+ use Pod::Usage;
+ use warnings;
+ use strict;
+ 
+ my $panic_file = "/Library/Logs/panic.log";
+ my %crash_info;
+ my $backtrace;
+ my $kextload   = "/sbin/kextload";
+ my $gdb        = "/usr/bin/gdb";
+ my $gdb_file   = "gdb.input";
+ my $temp_dir   = tempdir( "afsdebugXXXXXX", DIR => File::Spec->tmpdir,
+                         TMPDIR => 1, CLEANUP => 1 );
+ my $dump_file  = "/var/db/openafs/logs/crash.dump";
+ 
+ my $option_quiet;
+ my $option_help;
+ my $result = GetOptions ("input=s"  => \$panic_file,
+                          "output=s" => \$dump_file,
+                          "quiet"    => \$option_quiet,
+                          "help"     => \$option_help
+                      );
+ 
+ if ( !$result ) {
+     pod2usage(-message => "Syntax error.",
+               -exitval => 2,
+               -verbose => 1,
+               -output  => \*STDERR);
+     
+     exit;
+ }
+ 
+ if ($option_help) {
+     pod2usage(-message => "",
+               -exitval => 2,
+               -verbose => 3,
+               -output  => \*STDERR);
+     exit;
+ }
+ 
+ # check for necessary programs & panic file
+ for my $program ( $kextload, $gdb ) {
+     if ( ! -x $program ) {
+         if ( $option_quiet ) {
+             exit 1;
+         } else {
+             croak "Can't find $program!\n"
+         }
+     }
+ }
+ 
+ croak "Can't find panic file: $panic_file!\n" if ( ! -r $panic_file );
+ 
+ read_panic( $panic_file, \%crash_info );
+ 
+ generate_symbol_files( $crash_info{"afs_kernel_address"}, $temp_dir );
+ 
+ write_gdb_input_file( $temp_dir, $gdb_file, $crash_info{ "backtrace" } );
+ 
+ my $gdb_output = `$gdb /mach_kernel -batch -x $temp_dir/$gdb_file`;
+ croak "gdb failed!\n" if $CHILD_ERROR;
+ 
+ write_dump_file( $dump_file, \%crash_info, $gdb_output );
+ 
+ # read the panic file and parse out the addresses
+ sub read_panic {
+ 
+     my $filename      = shift;
+     my $hash_ref      = shift;
+ 
+     my $kernel_line;
+     my $line;
+     my @panic_section_positions = ( 0 );
+ 
+     
+     my $panic_fh = IO::File->new( $filename, '<' )
+         or croak "Can't open backtrace file $filename: $OS_ERROR\n";
+ 
+     # find the last panic section as denoted by "*********"
+     while ( $line = <$panic_fh> ) {
+         chomp $line;
+         if ( $line eq "*********" ) {
+             # skip a line
+             $line = <$panic_fh>;
+             push @panic_section_positions, $panic_fh->tell;
+         }
+     }
+ 
+     # ignore the empty last section
+     if ( @panic_section_positions > 2 ) {
+         pop @panic_section_positions
+     }
+ 
+     # Seek to last full panic section
+     # or the beginning of the file if appropriate
+     $panic_fh->seek( $panic_section_positions[-1], 0 );
+ 
+     $hash_ref->{ "date" } = <$panic_fh>;
+     chomp $hash_ref->{ "date" };
+ 
+     while ( $line = <$panic_fh> ) {
+         chomp $line;
+     
+         #skip lines until "Backtrace" is seen
+         $line =~ /^\s*(Backtrace,|Backtrace:)/;
+         $backtrace = $1;
+         last if $backtrace;
+     }
+     
+     if ( !$backtrace ) {
+         if ( $option_quiet ) {
+             exit 1;
+         } else {
+             croak "Couldn't find a backtrace in $filename\n";
+         }
+     }
+     
+     # gather the backtrace addresses
+     if ( $backtrace eq "Backtrace:" ) {
+         # ppc format panic
+         while ( $line = <$panic_fh> ) {
+             chomp $line;
+             last if $line !~ /^\s*(0x[0-9a-fA-F]{8})/;
+             my @memory_addresses = split /\s+/, $line;
+ 
+             # add non-empty array elements to the list
+             push @{ $hash_ref->{ "backtrace" } },
+                 grep { /0x/ } @memory_addresses;
+         }
+     } else {
+         # intel format panic
+         while ( $line = <$panic_fh> ) {
+             chomp $line;
+             last if $line !~ /^\s*0x[0-9a-fA-F]{8} : (0x[0-9a-fA-F]*)/;
+             push @{ $hash_ref->{ "backtrace" } }, $1;
+         }
+     }
+ 
+     # now we need the address for the afs kernel module
+     while ( $line = <$panic_fh> ) {
+         chomp $line;
+         next if ( $line !~ /org\.openafs\.filesystems\.afs/ );
+ 
+         $kernel_line = $line;
+         $line =~ /\@(0x[0-9a-fA-F]+)/;
+         $hash_ref->{ "afs_kernel_address" } = $1;
+         $kernel_line =~ /^\s+([^@]+)@.+/;
+         $hash_ref->{ "afs_info" } = $1;
+ 
+         last;
+     }
+ 
+     # grab the kernel version
+     while ( $line = <$panic_fh> ) {
+         chomp $line;
+         next if ( $line !~ /^Darwin Kernel Version/ );
+         $hash_ref->{ "kernel_version" } = $line;
+     }
+     
+     $panic_fh->close()
+         or croak "Can't close file $filename: $OS_ERROR\n";
+     
+     if ( !$kernel_line ) {
+         if ( $option_quiet ) {
+             exit 1;
+         } else {
+             croak "No OpenAFS reference found in latest panic!";
+         }
+     }
+ }
+ 
+ # generate the symbol files that will be read by gdb
+ sub generate_symbol_files {
+     my $kernel_address   = shift;
+     my $symbol_write_dir = shift;
+ 
+     system( "/sbin/kextload",
+             "-s",  $temp_dir,
+             "-a", 'org.openafs.filesystems.afs@' . $kernel_address,
+             "-n", "/Library/OpenAFS/Tools/root.client/usr/vice/etc/afs.kext/" );
+     if ( $CHILD_ERROR ) {
+         # error
+         croak "kextload failed to run: $OS_ERROR\n";
+     }
+ }
+ 
+ 
+ sub write_gdb_input_file {
+ 
+     my $write_dir     = shift;
+     my $filename      = shift;
+     my $backtrace_ref = shift;
+     
+     my @symbol_files = ( $write_dir . "/org.openafs.filesystems.afs.sym" );
+         
+     my $fh = IO::File->new( $write_dir . "/" . $filename, '>' )
+         or croak "Can't open gdb file $filename for writing: $OS_ERROR\n";
+ 
+     for my $symbol ( @symbol_files ) {
+         print $fh "add-symbol-file $symbol\n";
+     }
+ 
+     print $fh "set print asm-demangle on\n";
+ 
+     for my $address ( @{ $backtrace_ref } ) {
+         print $fh "x/i $address\n";
+     }
+ 
+    $fh->close()
+         or croak "Can't close file $filename: $OS_ERROR\n";
+ }
+ 
+ # write out the pertinent details to a file.
+ sub write_dump_file {
+     my $filename = shift;
+     my $hash_ref = shift;
+     my $output   = shift;
+ 
+     my $log_dir  = dirname $filename;
+ 
+     if ( ! -d $log_dir ) {
+         mkdir $log_dir, 0755;
+         croak "Can't create directory $log_dir: $OS_ERROR\n" if $CHILD_ERROR;
+     }
+ 
+     croak "Can't write to folder $log_dir." if ( ! -w $log_dir );
+ 
+     my $fh = IO::File->new( $filename, '>', 0664 )
+         or croak "Can't open dump file $filename for writing: $OS_ERROR\n";
+     
+     print $fh "Panic Date:      ", $hash_ref->{ "date" }, "\n";
+     print $fh "Kernel Version:  ", $hash_ref->{ "kernel_version" }, "\n";
+     print $fh "OpenAFS Version: ", $hash_ref->{ "afs_info" }, "\n";
+     print $fh "=============\n";
+     print $fh $output;
+     
+     $fh->close()
+         or croak "Can't close file $filename: $OS_ERROR\n";
+ }
+ 
+ __END__
+ 
+ =head1 NAME
+ 
+ decode-panic - decode a Mac OS panic log to show source line numbers
+ 
+ =head1 VERSION
+ 
+ This documentation refers to decode-panic version $Revision: 1.1.4.2 $
+ 
+ =head1 SYNOPSIS
+  
+    decode-panic [-i <input panic log>] [-o <output dump file>] [-q]
+ 
+ =head1 OPTIONS
+ 
+    -i The path to the panic log that should be read
+    -o The path to where the decoded panic log should be written
+    -q Quiet mode - don't complain if there is a problem.
+    -h print full help
+ 
+ =head1 DESCRIPTION
+ 
+ It parses the panic log for Mac OS X kernel panics that are caused by
+ openafs in order to produce a human-readable backtrace.
+ 
+ This program uses crash isolation procedure as outlined in
+ http://developer.apple.com/technotes/tn2002/tn2063.html#IsolatingCrash
+ 
+ Here is an example file that is fed to gdb:
+ 
+    add-symbol-file /tmp/afsdebugt8dGOb/org.openafs.filesystems.afs.sym
+    set print asm-demangle on
+    x/i 0x2ED1F7C0
+    x/i 0x2ED0D1A4
+ 
+ =head1 DEPENDENCIES
+ 
+ This program needs gdb and kextload.
+ 
+ =head1 BUGS AND LIMITATIONS
+ 
+ It clobbers the output file.
+ 
+ =head1 AUTHOR
+ 
+ Copyright 2008. Jason Edgecombe <jason@rampaginggeek.com>
+ 
+ This documentation is covered by the BSD License as written in the
+ doc/LICENSE file in the OpenAFS source tree. This program was written by
+ Jason Edgecombe for OpenAFS.
Index: openafs/src/packaging/OpenBSD/buildpkg.sh
diff -c openafs/src/packaging/OpenBSD/buildpkg.sh:1.3.2.1 openafs/src/packaging/OpenBSD/buildpkg.sh:1.3.2.3
*** openafs/src/packaging/OpenBSD/buildpkg.sh:1.3.2.1	Fri Jun 23 10:21:12 2006
--- openafs/src/packaging/OpenBSD/buildpkg.sh	Wed Jan  2 21:30:37 2008
***************
*** 1,4 ****
! # $Id: buildpkg.sh,v 1.3.2.1 2006/06/23 14:21:12 rees Exp $
  
  # This doesn't actually build a package any more
  
--- 1,4 ----
! # $Id: buildpkg.sh,v 1.3.2.3 2008/01/03 02:30:37 rees Exp $
  
  # This doesn't actually build a package any more
  
***************
*** 13,19 ****
    $SRC/comerr/compile_et \
    $SRC/venus/fs \
    $SRC/kauth/kas \
!   $SRC/kauth/klog \
    $SRC/sys/pagsh \
    $SRC/ptserver/pts \
    $SRC/log/tokens \
--- 13,19 ----
    $SRC/comerr/compile_et \
    $SRC/venus/fs \
    $SRC/kauth/kas \
!   $SRC/aklog/klog \
    $SRC/sys/pagsh \
    $SRC/ptserver/pts \
    $SRC/log/tokens \
***************
*** 21,27 ****
    $SRC/volser/vos \
    $SRC/bozo/bos \
    usr/vice/bin
- ln -s $SRC/pinstall/pinstall usr/vice/bin/install
  
  ln -s \
    $SRC/afsd/afsd \
--- 21,26 ----
Index: openafs/src/packaging/RedHat/.cvsignore
diff -c /dev/null openafs/src/packaging/RedHat/.cvsignore:1.1.2.2
*** /dev/null	Sun Mar 23 21:55:08 2008
--- openafs/src/packaging/RedHat/.cvsignore	Wed Jan  2 10:12:50 2008
***************
*** 0 ****
--- 1 ----
+ openafs.spec
Index: openafs/src/packaging/RedHat/RPM-build-notes
diff -c /dev/null openafs/src/packaging/RedHat/RPM-build-notes:1.1.4.2
*** /dev/null	Sun Mar 23 21:55:08 2008
--- openafs/src/packaging/RedHat/RPM-build-notes	Mon Nov 12 19:05:16 2007
***************
*** 0 ****
--- 1,35 ----
+ Beginning with the 1.4.5 release, OpenAFS's prebuilt binaries use a new
+ mechanism for packaging kernel modules on Fedora Core (all versions)
+ and RHEL 5 (and derivatives). This new mechanism allows the
+ installation of modules for multiple kernel variants simultaneously,
+ and is identical to the technique used by Fedora and Red Hat's own
+ out of tree kernel modules.
+ 
+ The difference is that instead of a single 'openafs-kernel' module,
+ multiple kmod-openafs-<variant> RPMs are produced. When manually
+ upgrading to OpenAFS 1.4.5, it may be necessary to remove any openafs-
+ kernel modules left behind by your old installation, and to ensure
+ that the appropriate kmod-openafs module is installed.
+ 
+ If you wish to build 'kmod' modules for new kernel release, this may
+ be done by rebuilding the SRPM  with 'fedorakmod' defined, and the
+ 'kvariants' parameter set to the list of kernel variants you wish to
+ build modules for (a kernel-devel package must be installed for each
+ of these variants). Note that supplying '' as a variant will build
+ for a normal kernel. The 'kernvers' variable can be set to specify 
+ what kernel release version you wish to build for.
+ 
+ For example:
+        rpmbuild -bb --define "fedorakmod 1" \
+             --target i686 \
+             --define "build_modules 1" \
+             --define "kvariants '' PAE"  \
+             openafs.spec
+ 
+ would build a kernel module for the normal and PAE variants of the
+ currently running kernel.
+ 
+ Old-style packages may still be built in the same way as previous
+ releases. However, note that you must use userland RPMs which match
+ the packaging of your kernel module. Old style kernel modules will
+ not work with a set of userland RPMs which expect kmod-style packages.
Index: openafs/src/packaging/RedHat/afs-krb5-2.0-com_err.patch
diff -c openafs/src/packaging/RedHat/afs-krb5-2.0-com_err.patch:1.1.2.1 openafs/src/packaging/RedHat/afs-krb5-2.0-com_err.patch:removed
*** openafs/src/packaging/RedHat/afs-krb5-2.0-com_err.patch:1.1.2.1	Mon Aug 21 15:55:20 2006
--- openafs/src/packaging/RedHat/afs-krb5-2.0-com_err.patch	Sun Mar 23 21:55:08 2008
***************
*** 1,24 ****
- diff -uNr afs-krb5.orig/src/configure.in afs-krb5/src/configure.in
- --- afs-krb5.orig/src/configure.in	2005-04-14 16:06:15.597138000 -0400
- +++ afs-krb5/src/configure.in	2005-04-14 16:06:44.201789856 -0400
- @@ -143,7 +143,19 @@
-  LIBS="$ac_save_LIBS"])
-  if test "x$afs_cv_func_getDirPath" = "xyes"; then
-  	AC_MSG_RESULT([Setting compilation parameters for AFS 3.5 and later])
- -	AKLOG_EXTRA_OBJ=adderrtable.o
- +	AC_MSG_CHECKING([for add_to_error_table])
- +dnl
- +dnl We may be using libcom_err from Kerberos (shared libraries), and
- +dnl already have add_to_error_table
- +dnl
- +	AC_TRY_LINK_FUNC(add_to_error_table, have_adderr=yes, have_adderr=no)
- +	if test $have_adderr != yes; then
- +		AC_MSG_RESULT([no, adding adderrtable.o])
- +		AKLOG_EXTRA_OBJ=adderrtable.o
- +	else
- +		AC_MSG_RESULT([yes])
- +		AKLOG_EXTRA_OBJ=
- +	fi
-  else
-  	AC_MSG_RESULT([Setting compilation parameters for pre-AFS 3.5])
-  	AC_DEFINE(PRE_AFS35)
--- 0 ----
Index: openafs/src/packaging/RedHat/afs-krb5-2.0-krb524.patch
diff -c openafs/src/packaging/RedHat/afs-krb5-2.0-krb524.patch:1.1.2.1 openafs/src/packaging/RedHat/afs-krb5-2.0-krb524.patch:removed
*** openafs/src/packaging/RedHat/afs-krb5-2.0-krb524.patch:1.1.2.1	Mon Aug 21 15:55:20 2006
--- openafs/src/packaging/RedHat/afs-krb5-2.0-krb524.patch	Sun Mar 23 21:55:08 2008
***************
*** 1,31 ****
- --- afs-krb5/src/configure.in-orig	2003-03-16 20:13:34.000000000 -0500
- +++ afs-krb5/src/configure.in	2005-09-14 17:20:46.000000000 -0400
- @@ -179,14 +197,20 @@
-  [	EXTRA_INC="$EXTRA_INC -I$with_krb5_obj/include -I$with_krb5_obj/include/krb5"
-  	KADM_LIBS=`echo $KADM_LIBS | sed -e "s#-ldb#$with_krb5_obj/lib/libdb.a#"`])
-  dnl
- -dnl Sigh, why is this so complicated?  Right now, just assume that 
- -dnl the 524 library is always called krb524 and will be picked up by the
- -dnl Kerberos link line
- -dnl
- -dnl AC_CHECK_LIB(krb524, krb524_convert_princs, [KRB524LIB="-lkrb524"], [
- -dnl	AC_MSG_ERROR([Cannot find 524 library, exiting])
- -dnl ])
- -KRB524LIB=-lkrb524
- +dnl The krb524 functions may be included in libkrb5 itself, or else in a 
- +dnl separate library named libkrb524
- +dnl
- +ac_save_LIBS="$LIBS"
- +KRB524LIB=
- +AC_MSG_CHECKING([for krb524 library])
- +AC_CHECK_FUNC(krb524_init_ets, have_krb524=yes, have_krb524=no)
- +
- +if test "$have_krb524" = no; then
- +	LIBS="$LIBS -lkrb524"
- +	AC_CHECK_LIB(krb524, krb524_init_ets, [KRB524LIB="-lkrb524"],
- +			     [AC_MSG_ERROR([Unable to find krb524 library])])
- +fi
- +LIBS="$ac_save_LIBS"
-  
-  dnl AC_CHECK_LIB(kdb5, krb5_db_fetch_mkey, [KD_LIBS="-lkdb5"],[
-  dnl 	AC_MSG_WARN([Cannot find Kerberos 5 DB library, will not be able to build DB utilities])
--- 0 ----
Index: openafs/src/packaging/RedHat/afs-krb5-2.0-libsocket.patch
diff -c openafs/src/packaging/RedHat/afs-krb5-2.0-libsocket.patch:1.1.2.1 openafs/src/packaging/RedHat/afs-krb5-2.0-libsocket.patch:removed
*** openafs/src/packaging/RedHat/afs-krb5-2.0-libsocket.patch:1.1.2.1	Mon Aug 21 15:55:20 2006
--- openafs/src/packaging/RedHat/afs-krb5-2.0-libsocket.patch	Sun Mar 23 21:55:08 2008
***************
*** 1,39 ****
- diff -uNr afs-krb5.orig/src/configure.in afs-krb5/src/configure.in
- --- afs-krb5.orig/src/configure.in	2003-03-16 20:13:34.000000000 -0500
- +++ afs-krb5/src/configure.in	2003-07-30 11:52:55.000000000 -0400
- @@ -44,14 +44,6 @@
-  if test $retval -ne 0; then
-  	AC_MSG_ERROR($krb5_config failed with error code of $retval)
-  fi
- -AC_MSG_RESULT([Adding $krb5_cflags to CFLAGS])
- -AC_MSG_RESULT([Adding $krb5_libs to LIBS])
- -AC_MSG_RESULT([Setting KADM_CFLAGS to $krb5_cflags_kadm])
- -AC_MSG_RESULT([Setting KADM_LIBS to $krb5_libs_kadm])
- -CFLAGS="$CFLAGS $krb5_cflags"
- -LIBS="$LIBS $krb5_libs"
- -KADM_CFLAGS="$krb5_cflags_kadm"
- -KADM_LIBS="$krb5_libs_kadm"
-  dnl
-  dnl Check for various network libraries
-  dnl
- @@ -105,6 +97,20 @@
-  	AC_MSG_ERROR([Unable to find res_search function])
-  fi
-  LIBS="$save_LIBS"
- +
- +dnl
- +dnl Don't add these to LIBS until after we've already looked for 
- +dnl libsocket, etc. Otherwise ka-forwarder won't build properly
- +dnl
- +AC_MSG_RESULT([Adding $krb5_cflags to CFLAGS])
- +AC_MSG_RESULT([Adding $krb5_libs to LIBS])
- +AC_MSG_RESULT([Setting KADM_CFLAGS to $krb5_cflags_kadm])
- +AC_MSG_RESULT([Setting KADM_LIBS to $krb5_libs_kadm])
- +CFLAGS="$CFLAGS $krb5_cflags"
- +LIBS="$LIBS $krb5_libs"
- +KADM_CFLAGS="$krb5_cflags_kadm"
- +KADM_LIBS="$krb5_libs_kadm"
- +
-  dnl
-  dnl Optional support for AFS
-  dnl
--- 0 ----
Index: openafs/src/packaging/RedHat/afs-krb5-2.0-openafs1.3.patch
diff -c openafs/src/packaging/RedHat/afs-krb5-2.0-openafs1.3.patch:1.1.2.1 openafs/src/packaging/RedHat/afs-krb5-2.0-openafs1.3.patch:removed
*** openafs/src/packaging/RedHat/afs-krb5-2.0-openafs1.3.patch:1.1.2.1	Mon Aug 21 15:55:20 2006
--- openafs/src/packaging/RedHat/afs-krb5-2.0-openafs1.3.patch	Sun Mar 23 21:55:08 2008
***************
*** 1,12 ****
- diff -uNr afs-krb5.orig/src/asetkey.c afs-krb5/src/asetkey.c
- --- afs-krb5.orig/src/asetkey.c	2005-04-08 15:55:35.637620000 -0400
- +++ afs-krb5/src/asetkey.c	2005-04-08 15:55:57.614279120 -0400
- @@ -81,7 +81,7 @@
-  		exit(1);
-  	}
-  
- -	code = afsconf_AddKey(tdir, kvno, key->contents);
- +	code = afsconf_AddKey(tdir, kvno, key->contents, 1);
-  	if (code) {
-  	    printf("setkey: failed to set key, code %ld.\n", code);
-  	    exit(1);
--- 0 ----
Index: openafs/src/packaging/RedHat/afs-krb5-2.0-res_search.patch
diff -c openafs/src/packaging/RedHat/afs-krb5-2.0-res_search.patch:1.1.2.1 openafs/src/packaging/RedHat/afs-krb5-2.0-res_search.patch:removed
*** openafs/src/packaging/RedHat/afs-krb5-2.0-res_search.patch:1.1.2.1	Mon Aug 21 15:55:20 2006
--- openafs/src/packaging/RedHat/afs-krb5-2.0-res_search.patch	Sun Mar 23 21:55:08 2008
***************
*** 1,14 ****
- --- afs-krb5/src/configure.in.res_search	2005-09-30 12:53:38.000000000 -0400
- +++ afs-krb5/src/configure.in	2005-09-30 14:40:38.000000000 -0400
- @@ -89,7 +89,10 @@
-  		if test "$have_res_search" != yes; then
-  			AC_CHECK_LIB(${lib}, res_search,
-  				     [have_res_search=yes
- -				      NETLIBS="$NETLIBS -l${lib}"])
- +				      NETLIBS="$NETLIBS -l${lib}"],
- +			             [AC_CHECK_LIB(${lib}, __res_search,
- +				       [have_res_search=yes
- +					NETLIBS="$NETLIBS -l${lib}"])])
-  		fi
-  	done
-  fi
--- 0 ----
Index: openafs/src/packaging/RedHat/kmodtool
diff -c openafs/src/packaging/RedHat/kmodtool:1.1.4.2 openafs/src/packaging/RedHat/kmodtool:removed
*** openafs/src/packaging/RedHat/kmodtool:1.1.4.2	Thu Oct 11 10:16:23 2007
--- openafs/src/packaging/RedHat/kmodtool	Sun Mar 23 21:55:08 2008
***************
*** 1,172 ****
- #!/bin/bash
- 
- # kmodtool - Helper script for building kernel module RPMs
- # Copyright (c) 2003-2007 Ville Skyttä <ville.skytta@iki.fi>,
- #                         Thorsten Leemhuis <fedora@leemhuis.info>
- #
- # Permission is hereby granted, free of charge, to any person obtaining
- # a copy of this software and associated documentation files (the
- # "Software"), to deal in the Software without restriction, including
- # without limitation the rights to use, copy, modify, merge, publish,
- # distribute, sublicense, and/or sell copies of the Software, and to
- # permit persons to whom the Software is furnished to do so, subject to
- # the following conditions:
- #
- # The above copyright notice and this permission notice shall be
- # included in all copies or substantial portions of the Software.
- #
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- 
- shopt -s extglob
- 
- myprog="kmodtool"
- myver="0.10.13"
- knownvariants=@(BOOT|PAE?(-debug)|@(big|huge)mem|debug|enterprise|kdump|?(large)smp?(-debug)|uml|xen?([0U])?(-PAE))
- kmod_name=
- kver=
- verrel=
- variant=
- 
- get_verrel ()
- {
-   verrel=${1:-$(uname -r)}
-   verrel=${verrel%%$knownvariants}
- }
- 
- print_verrel ()
- {
-   get_verrel $@
-   echo "${verrel}"
- }
- 
- get_variant ()
- {
-   get_verrel $@
-   variant=${1:-$(uname -r)}
-   variant=${variant##$verrel}
-   variant=${variant:-'""'}
- }
- 
- print_variant ()
- {
-   get_variant $@
-   echo "${variant}"
- }
- 
- 
- get_rpmtemplate ()
- {
-     local variant="${1}"
-     local dashvariant="${variant:+-${variant}}"
-     case "$verrel" in
-         *.EL*) kdep="kernel${dashvariant}-%{_target_cpu} = ${verrel}" ;;
-         *)     kdep="kernel-%{_target_cpu} = ${verrel}${variant}"     ;;
-     esac
-     cat <<EOF
- %package       -n kmod-${kmod_name}${dashvariant}
- Summary:          ${kmod_name} kernel module(s)
- Group:            System Environment/Kernel
- Provides:         kernel-modules = ${verrel}${variant}
- Provides:         ${kmod_name}-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
- Requires:         ${kdep}
- Requires:         ${kmod_name}-kmod-common >= %{?epoch:%{epoch}:}%{version}
- Requires(post):   /sbin/depmod
- Requires(postun): /sbin/depmod
- BuildRequires:    kernel${dashvariant}-devel-%{_target_cpu} = ${verrel}
- %description   -n kmod-${kmod_name}${dashvariant}
- This package provides the ${kmod_name} kernel modules built for the Linux
- kernel ${verrel}${variant} for the %{_target_cpu} family of processors.
- %post          -n kmod-${kmod_name}${dashvariant}
- /sbin/depmod -aeF /boot/System.map-${verrel}${variant} ${verrel}${variant} > /dev/null || :
- %postun        -n kmod-${kmod_name}${dashvariant}
- /sbin/depmod -aF /boot/System.map-${verrel}${variant} ${verrel}${variant} &> /dev/null || :
- %files         -n kmod-${kmod_name}${dashvariant}
- %defattr(644,root,root,755)
- /lib/modules/${verrel}${variant}/extra/${kmod_name}/
- 
- EOF
- }
- 
- print_rpmtemplate ()
- {
-   kmod_name="${1}"
-   shift
-   kver="${1}"
-   get_verrel "${1}"
-   shift
-   if [ -z "${kmod_name}" ] ; then
-     echo "Please provide the kmodule-name as first parameter." >&2
-     exit 2
-   elif [ -z "${kver}" ] ; then
-     echo "Please provide the kver as second parameter." >&2
-     exit 2
-   elif [ -z "${verrel}" ] ; then
-     echo "Couldn't find out the verrel." >&2
-     exit 2
-   fi
- 
-   for variant in "$@" ; do
-     get_rpmtemplate "${variant}"
-   done
- }
- 
- usage ()
- {
-   cat <<EOF
- You called: ${invocation}
- 
- Usage: ${myprog} <command> <option>+
-  Commands:
-   verrel <uname>                               
-     - Get "base" version-release.
-   variant <uname>                               
-     - Get variant from uname.
-   rpmtemplate <mainpgkname> <uname> <variants> 
-     - Return a template for
-   version  
-     - Output version number and exit.
- EOF
- }
- 
- invocation="$(basename ${0}) $@"
- while [ "${1}" ] ; do
-   case "${1}" in
-     verrel)
-       shift
-       print_verrel $@
-       exit $?
-       ;;
-     variant)
-       shift
-       print_variant $@
-       exit $?
-       ;;
-     rpmtemplate)
-       shift
-       print_rpmtemplate "$@"
-       exit $?
-       ;;
-     version)
-       echo "${myprog} ${myver}"
-       exit 0
-       ;;
-     *)
-       echo "Error: Unknown option '${1}'." >&2
-       usage >&2
-       exit 2
-       ;;
-   esac
- done
- 
- # Local variables:
- # mode: sh
- # sh-indentation: 2
- # indent-tabs-mode: nil
- # End:
- # ex: ts=2 sw=2 et
--- 0 ----
Index: openafs/src/packaging/RedHat/makesrpm.pl
diff -c /dev/null openafs/src/packaging/RedHat/makesrpm.pl:1.1.4.3
*** /dev/null	Sun Mar 23 21:55:08 2008
--- openafs/src/packaging/RedHat/makesrpm.pl	Tue Jan 15 18:45:14 2008
***************
*** 0 ****
--- 1,136 ----
+ #!/usr/bin/perl
+ 
+ use strict;
+ use warnings;
+ 
+ use IO::Dir;
+ use IO::File;
+ use File::Path;
+ use File::Copy;
+ use File::Temp;
+ 
+ # Build an SRPM for OpenAFS, given a src and doc tarball, release notes,
+ # and ChangeLog.
+ 
+ my $srcball = shift;
+ my $docball = shift;
+ my $relnotes = shift;
+ my $changelog = shift;
+ my $cellservdb = shift;
+ 
+ if (!$srcball && !$docball) {
+   printf "Usage:  <version> <src.tar.gz> <doc.tar.gz> [<relnotes> [<changelog> [<cellservdb>]]]\n";
+   exit(1);
+ }
+ 
+ if (! -f $srcball) {
+   die "Unable to open $srcball\n";
+ }
+ 
+ my $tmpdir = File::Temp::tempdir(CLEANUP => 1);
+ 
+ system("tar -C $tmpdir -xvjf $srcball \*/configure.in ".
+        "\*/src/packaging/RedHat > /dev/null")==0
+   or die "Unable to unpack src tar ball\n";
+ 
+ my $dirh = IO::Dir->new($tmpdir);
+ my $vdir;
+ while (defined($vdir = $dirh->read) && $vdir=~/^\./) {};
+ 
+ die "Unable to find unpacked source code\n" if !$vdir;
+ 
+ my $srcdir = $tmpdir."/".$vdir;
+ 
+ # Work out which version we're dealing with from the configure.in file
+ my $version;
+ my $fh = new IO::File $srcdir."/configure.in"
+   or die "Unable to find unpacked configure.in file";
+ while(<$fh>) {
+   if (/AM_INIT_AUTOMAKE\(openafs,(.*)\)/) {
+     $version = $1;
+     last;
+   }
+ }
+ undef $fh;
+ 
+ # Build the RPM root
+ 
+ print "Building version $version\n";
+ File::Path::mkpath([ $tmpdir."/rpmdir/SPECS",
+ 		     $tmpdir."/rpmdir/SRPMS",
+ 		     $tmpdir."/rpmdir/SOURCES"], 0, 0755);
+ 
+ File::Copy::copy($srcball, 
+ 		 $tmpdir."/rpmdir/SOURCES/openafs-$version-src.tar.bz2")
+   or die "Unable to copy $srcball into position\n";
+ 
+ File::Copy::copy($docball,
+ 		 $tmpdir."/rpmdir/SOURCES/openafs-$version-doc.tar.bz2")
+   or die "Unable to copy $docball into position\n";
+ 
+ # Populate it with all the stuff in the packaging directory, except the 
+ # specfile
+ my $pkgdirh = IO::Dir->new($srcdir."/src/packaging/RedHat")
+   or die "Unable to find RedHat packaging directory\n";
+ my $file;
+ while (defined($file = $pkgdirh->read)) {
+   if (-f $srcdir."/src/packaging/RedHat/".$file) {
+      next if $file eq "openafs.spec.in";
+ 
+      print "Copying $file into place\n";
+      File::Copy::copy($srcdir."/src/packaging/RedHat/".$file, 
+ 		      $tmpdir."/rpmdir/SOURCES/".$file);
+   }
+ }
+ undef $dirh;
+ 
+ # Some files need particular modes.
+ chmod 0755, $tmpdir."/rpmdir/SOURCES/openafs-kernel-version.sh";
+ chmod 0755, $tmpdir."/rpmdir/SOURCES/openafs-kvers-is.sh";
+ 
+ # Create the specfile. Use sed for this, cos its easier
+ system("cat ".$srcdir."/src/packaging/RedHat/openafs.spec.in | ".
+        "sed -e 's/\@VERSION\@/$version/g' ".
+        "    -e 's/\%define afsvers.*/%define afsvers $version/g' ".
+        "    -e 's/\%define pkgvers.*/%define pkgvers $version/g' > ".
+        $tmpdir."/rpmdir/SPECS/openafs.spec") == 0
+   or die "sed failed : $!\n";
+ 
+ if ($cellservdb) {
+     File::Copy::copy($cellservdb,
+ 		     $tmpdir."/rpmdir/SOURCES/$cellservdb")
+ 	or die "Unable to copy $cellservdb into position\n";
+ } else {
+     system("cd ".$tmpdir."/rpmdir/SOURCES && wget `cat ".$srcdir."/src/packaging/RedHat/openafs.spec.in |grep dl/cellservdb |awk '{print \$2}'`")
+ }
+ 
+ if ($relnotes) {
+   File::Copy::copy($relnotes,
+ 		   $tmpdir."/rpmdir/SOURCES/RELNOTES-$version")
+   or die "Unable to copy $relnotes into position\n";
+ } else {
+   print "WARNING: No release notes provided. Using empty file\n";
+   system("touch $tmpdir/rpmdir/SOURCES/RELNOTES-$version");
+ }
+ 
+ if ($changelog) {
+   File::Copy::copy($changelog,
+ 		   $tmpdir."/rpmdir/SOURCES/ChangeLog")
+   or die "Unable to copy $changelog into position\n";
+ } else {
+   print "WARNING: No changelog provided. Using empty file\n";
+   system("touch $tmpdir/rpmdir/SOURCES/ChangeLog");
+ }
+ 
+ # Build an RPM
+ system("rpmbuild -bs --define \"_topdir $tmpdir/rpmdir\" ".
+        "$tmpdir/rpmdir/SPECS/openafs.spec > /dev/null") == 0
+   or die "rpmbuild failed : $!\n";
+ 
+ # Copy it out to somewhere useful
+ File::Copy::copy("$tmpdir/rpmdir/SRPMS/openafs-$version-1.1.src.rpm",
+ 	         "openafs-$version-1.1.src.rpm")
+   or die "Unable to copy output RPM : $!\n";
+ 
+ print "SRPM is openafs-$version-1.1.src.rpm\n";
+ 
Index: openafs/src/packaging/RedHat/mockbuild.pl
diff -c /dev/null openafs/src/packaging/RedHat/mockbuild.pl:1.1.2.2
*** /dev/null	Sun Mar 23 21:55:08 2008
--- openafs/src/packaging/RedHat/mockbuild.pl	Thu Feb 14 14:30:10 2008
***************
*** 0 ****
--- 1,313 ----
+ #!/usr/bin/perl
+ # mockbuild - mass RPM build driver for use with mock and many kernel-devel
+ #             RPMs
+ # from Simon Wilkinson for OpenAFS
+ # for "modern" yum, use "showdupesfromrepos=1" in all cfg files in /etc/mock
+ 
+ use strict;
+ use warnings;
+ 
+ use Getopt::Long;
+ use File::Path;
+ use IO::Dir;
+ 
+ my $suser="nsu";
+ my $rootbase="/var/lib/mock/";
+ my $resultbase="/tmp/result/";
+ my $stashbase="/disk/scratch/repository/";
+ my $mockcommand = "/usr/bin/mock";
+ my $buildall = 0;
+ 
+ my @newrpms;
+ 
+ my %platconf = ( "fedora-5-i386" => { osver => "fc5",
+ 				      kmod => '1',
+ 				      basearch => 'i386',
+ 				      updaterepo => 'updates-released',
+ 				      results => 'fc5/i386' },
+ 		 "fedora-5-x86_64" => { osver => "fc5",
+ 				       kmod => '1',
+ 				       basearch => 'x86_64',
+ 				       updaterepo => 'updates-released',
+ 				       results => 'fc5/x86_64' },
+ 		 "fedora-6-i386" => { osver => "fc6", 
+ 				      kmod => '1', 
+ 				      basearch => 'i386',
+ 				      updaterepo => 'updates-released',
+ 				      results => "fc6/i386" },
+ 		 "fedora-6-x86_64" => { osver => "fc6",
+ 					kmod => '1',
+ 					basearch => 'x86_64',
+ 				        updaterepo => 'updates-released',
+ 					results => "fc6/x86_64" },
+ 		 "fedora-7-i386" => { osver => "fc7", 
+ 				      kmod => '1', 
+ 				      basearch => 'i386',
+ 				      updaterepo => 'updates-released',
+ 				      results => "fc7/i386" },
+ 		 "fedora-7-x86_64" => { osver => "fc7",
+ 					kmod => '1',
+ 					basearch => 'x86_64',
+ 				        updaterepo => 'updates-released',
+ 					results => "fc7/x86_64" },
+ 		 "fedora-8-i386" => { osver => "fc8", 
+ 				      kmod => '1', 
+ 				      basearch => 'i386',
+ 				      updaterepo => 'updates-released',
+ 				      results => "fc8/i386" },
+ 		 "fedora-8-x86_64" => { osver => "fc8",
+ 					kmod => '1',
+ 					basearch => 'x86_64',
+ 				        updaterepo => 'updates-released',
+ 					results => "fc8/x86_64" },
+ 		 "centos-4-i386" => { osver => "el4",
+ 				     kmod => '1',
+ 				     basearch => 'i386',
+ 				     updaterepo => 'update',
+ 				     results => 'el4/i386' },
+ 		 "centos-4-x86_64" => { osver => "el4",
+ 				       kmod => '1',
+ 				       basearch => 'x86_64',
+ 				       updaterepo => 'update',
+ 				       results => "el4/x86_64" },
+ 		 "centos-5-i386" => { osver => "el5", 
+ 				      kmod => '1', 
+ 				      basearch => 'i386',
+ 				      updaterepo => 'update',
+ 				      results => "el5/i386" },
+ 		 "centos-5-x86_64" => { osver => "el5",
+ 					kmod => '1',
+ 				   	basearch => 'x86_64',
+ 				        updaterepo => 'update',
+ 					results => "el5/x86_64" },
+ #		 "fedora-development-i386" => { osver => "fcd",
+ #					  kmod => '1',
+ #					  basearch => 'i386',
+ #					  results => 'fedora-devel/i386'},
+ #		 "fedora-development-x86_64" => { osver => "fcd",
+ #					    kmod => '1',
+ #					    basearch => 'x86_64',
+ #					    results => 'fedora-devel/x86_64'} 
+ );
+ 
+ # The following are kernels that we can't successfully build modules against
+ # due to issues in the packaged kernel-devel RPM.
+ 
+ my %badkernels = (
+ 	"2.6.21-2950.fc8" => { "xen" => 1} # Missing build ID
+ );
+ 
+ my @platforms = @ARGV;
+ my $srpm = pop @platforms;
+ 
+ if (!$srpm || $#platforms==-1) {
+   print "Usage: $0 <platform> [<platform> [<platform> ...] ]  <srpm>\n";
+   print "    Platform may be:\n";
+   foreach ("all", sort(keys(%platconf))) { print "        ".$_."\n"; };
+   exit(1);
+ }
+ 
+ my $oafsversion = `rpm -q --queryformat=%{VERSION} -p $srpm` or die $!;
+ chomp $oafsversion;
+ my $oafsrelease = `rpm -q --queryformat=%{RELEASE} -p $srpm` or die $!;
+ chomp $oafsrelease;
+ $oafsrelease=~s/^[^\.]*\.(.*)$/$1/;
+ 
+ print "Release is $oafsrelease\n";
+ 
+ if ($platforms[0] eq "all" and $#platforms == 0) {
+   @platforms = keys(%platconf);
+ }
+ 
+ foreach my $platform (@platforms) {
+   print "*******************************************************************\n";
+   print "Building for $platform\n";
+   die "Unknown platform $platform" if !$platconf{$platform};
+   my $osver = $platconf{$platform}{'osver'};
+   my $root = $rootbase.$platform."/root";
+   my $mockresults = $rootbase.$platform."/result";
+   my $resultdir = $resultbase.$platconf{$platform}{'results'};
+   my $basearch = $platconf{$platform}{'basearch'};
+   my $rpmstashdir = $stashbase.$platconf{$platform}{'results'}."/";
+ 
+   my $yumcachedir;
+   if (exists($platconf{$platform}{'updaterepo'})) {
+     $yumcachedir = $rootbase."cache/".$platform."/yum_cache/".
+ 		   $platconf{$platform}{'updaterepo'}."/packages/";
+   }
+ 
+   File::Path::mkpath($resultdir, 0, 0755);
+ 
+   if (system($mockcommand, "-r", $platform, "init") != 0) {
+     die "Initialising the root failed: $?\n";
+   }
+ 
+   my %modulelist;
+ 
+   print "-------------------------------------------------------------------\n";
+   print "Finding available kernel modules\n";
+ 
+   my $arbitraryversion = "";
+   my $modules=`$suser -c 'yum --installroot $root provides kernel-devel'`;
+   if ($modules eq "") {
+       $modules=`$suser -c 'yum -d 2 --installroot $root provides kernel-devel'`;
+       my $modulen;
+       my %modulel;
+       foreach $modulen (split(/\n/, $modules)) {
+ 	  my ($pk, $colon, $comment)=split(/\s+/, $modulen);
+ 	  if ($pk =~ /^kernel/) {
+ 	      $modulel{$pk} = "$pk";
+ 	  } 
+       }
+       $modulen=join(" ", keys(%modulel));
+       $modules=`$suser -c 'yum --installroot $root list $modulen'`;
+   }
+   foreach my $module (split(/\n/, $modules)) {
+       my ($package, $version, $repo)=split(/\s+/, $module);
+       my ($arch) = ($package=~/\.(.*)$/);
+       my ($variant) = ($package=~/kernel-(.*)-devel/);
+       $variant = "" if !defined($variant);
+       next if ($package !~ /^kernel/);
+       next if ($arch eq "noarch");
+       next 
+ 	  if (exists($badkernels{$version}) && ($badkernels{$version}{$variant}));
+       if ($platform=~/fedora-5/) {
+ 	  next if ($variant eq "xen0"); # Fedora 5 has some bad xen0 kernel-devels
+ 	  next if ($variant eq "smp");
+       }
+       print "$arch : $variant : $version\n";
+       $modulelist{$arch} ={} if !$modulelist{$arch};
+       $modulelist{$arch}{$version} = {} if !$modulelist{$arch}{$version};
+       $modulelist{$arch}{$version}{$variant} = 1;
+       $arbitraryversion = $version;
+   }
+ 
+   if (!$arbitraryversion) {
+     die "Unable to find a valid kernel-devel package for $platform\n";
+   }
+ 
+   print "-------------------------------------------------------------------\n";
+   print "Building the userland RPMs\n";
+   my @rpms = ('', '-authlibs', '-authlibs-devel', '-client', '-compat',
+ 	      '-debuginfo', '-devel', '-docs', '-kernel-source', '-kpasswd',
+ 	      '-krb5', '-server');
+ 
+   my $missing = 0;
+   foreach my $rpm (@rpms) {
+     if (! -f $resultdir."/openafs".$rpm."-".$oafsversion."-".$osver.".".
+ 	     $oafsrelease.".".$basearch.".rpm") {
+       $missing++;
+       print $resultdir."/openafs".$rpm."-".$oafsversion."-".$osver.".".
+ 	    $oafsrelease.".".$basearch.".rpm is missing!\n"
+     }
+   }
+   if ($missing) {
+     system($mockcommand." -r ".$platform." rebuild ".
+ 		        ' --define "fedorakmod 1" '.
+ 		        ' --define "kernvers '.$arbitraryversion.'" '.
+ 		        ' --define "osvers '.$osver.'" '.
+ 		        ' --define "build_modules 0" '.
+ 		        ' --define "build_userspace 1" '.
+ 		        ' --define "build_authlibs 1" '.
+ 		        $srpm) == 0
+       or die "build failed with : $!\n";
+     foreach my $rpm (@rpms) {
+       system("cp ".$mockresults."/openafs".$rpm."-".$oafsversion."-".
+ 		   $osver.".".$oafsrelease.".".$basearch.".rpm ".
+ 		   $resultdir) == 0
+           or die "Copy failed with : $!\n";
+       push @newrpms, $mockresults."/openafs".$rpm."-".$oafsversion."-".
+ 		     $osver.".".$oafsrelease.".".$basearch.".rpm";
+     }
+   } else {
+     print "All userland RPMs present for $platform. Skipping build\n";
+   }
+ 
+    print "-------------------------------------------------------------------\n";
+   print "Building kernel modules\n";
+ 
+  foreach my $arch (keys(%modulelist)) {
+     foreach my $version (keys(%{$modulelist{$arch}})) {
+       my $kversion = $version;
+       $kversion=~s/-/_/g;
+       my @tobuild;
+ 
+       if ($buildall) {
+ 	@tobuild = keys(%{$modulelist{$arch}{$version}});
+       } else {
+         foreach my $variant (keys(%{$modulelist{$arch}{$version}})) {
+           my $dvariant=$variant;
+           $dvariant.="-" if ($dvariant);
+           if (!-f $resultdir."/kmod-openafs-".$dvariant.
+ 		  $oafsversion."-".$oafsrelease.".".$kversion.".".
+ 		  $arch.".rpm") {
+ 	    push @tobuild, $variant;
+ 	    print $resultdir."/kmod-openafs-".$dvariant.
+                   $oafsversion."-".$oafsrelease.".".$kversion.".".
+                   $arch.".rpm is missing\n";
+           }
+         }
+       }
+ 
+       if ($#tobuild>=0) {
+         my $variants = join(" ", map {$_ or '\\\\\"\\\\\"'} @tobuild);
+         print "Building $arch module for kernel $version with variants $variants\n";
+         system ("setarch $arch $mockcommand -r $platform rebuild ".
+ 			     " --arch ".$arch.
+ 			     ' --define "fedorakmod 1" '.
+ 			     ' --define "osvers '.$osver.'" '.
+ 			     ' --define "kernvers '.$version.'" '.
+ 			     ' --define "kvariants '.$variants.'" '.
+ 			     ' --define "build_modules 1" '.
+ 			     ' --define "build_userspace 0" '.
+ 			     $srpm) == 0
+           or die "Build failed with : $!\n";
+         foreach my $variant (@tobuild) {
+           if ($variant) {
+             $variant.="-";
+           }
+           system("cp ".$mockresults."/kmod-openafs-".$variant.$oafsversion."-".$oafsrelease.".".$kversion.".".$arch.".rpm $resultdir") == 0
+             or die "Copy failed with : $!\n";
+ 	  push @newrpms, $mockresults."/kmod-openafs-".$variant.$oafsversion."-".$oafsrelease.".".$kversion.".".$arch.".rpm";
+         }
+       } else {
+          print "All kernel modules already built for $version on $arch\n";
+       }
+     }
+   }
+   print "-------------------------------------------------------------------\n";
+   print "Creating repository data\n";
+   system ("cd $resultdir; createrepo .") == 0
+     or die "Unable to build repository data\n";
+ 
+   if ($yumcachedir) {
+     print "-------------------------------------------------------------------\n";
+     print "Stashing kernel-devel RPMs\n";
+   
+     my $changed;
+     my $dirh = IO::Dir->new($yumcachedir);
+     if (defined($dirh)) {
+       my $file;
+       while (defined($file = $dirh->read)) {
+         if ( $file=~/^kernel-devel/ &&
+               -f $yumcachedir.$file && ! -f $rpmstashdir.$file) {
+           print "Stashing $file for later use\n";
+           system("cp ".$yumcachedir.$file." ".$rpmstashdir.$file) == 0
+             or die "Copy failed with : $!\n";
+           $changed++;
+         }
+       }
+     }
+  
+     if ($changed) {
+       print "Updating stash repodata\n";
+       system ("cd $rpmstashdir; createrepo .") == 0
+         or die "Unable to update RPM stash repository data\n";
+     }
+   }
+ }
+ 
+ print "=====================================================================\n";
+ print "All builds complete\nBuilt:\n";
+ print join("\n",@newrpms);
+ 
Index: openafs/src/packaging/RedHat/openafs-buildall.sh
diff -c openafs/src/packaging/RedHat/openafs-buildall.sh:1.1.2.3 openafs/src/packaging/RedHat/openafs-buildall.sh:1.1.2.4
*** openafs/src/packaging/RedHat/openafs-buildall.sh:1.1.2.3	Thu Oct 18 00:07:13 2007
--- openafs/src/packaging/RedHat/openafs-buildall.sh	Thu Jan 24 19:00:18 2008
***************
*** 4,10 ****
  #
  # Written by:  Derek Atkins <warlord@MIT.EDU>
  #
! # $Revision: 1.1.2.3 $
  #
  
  # Define where the Specfile is located.
--- 4,10 ----
  #
  # Written by:  Derek Atkins <warlord@MIT.EDU>
  #
! # $Revision: 1.1.2.4 $
  #
  
  # Define where the Specfile is located.
***************
*** 35,41 ****
  elif [ `echo $rhrel | grep -c 'Red Hat Linux'` = 1 ] ; then
    ostype='rh'
    osrel=`echo $rhrel | sed -e 's/^.*release \([^ ]*\).*$/\1/' -e 's/\.//g'`
! elif [ `echo $rhrel | grep -c 'SUSE LINUX'` = 1 ] ; then
    ostype='suse'
    specdir=/usr/src/packages/SPECS 
    osrel=`grep VERSION /etc/SuSE-release|awk '{print $3}'`
--- 35,41 ----
  elif [ `echo $rhrel | grep -c 'Red Hat Linux'` = 1 ] ; then
    ostype='rh'
    osrel=`echo $rhrel | sed -e 's/^.*release \([^ ]*\).*$/\1/' -e 's/\.//g'`
! elif [ `echo $rhrel | grep -c 'SUSE'` = 1 ] ; then
    ostype='suse'
    specdir=/usr/src/packages/SPECS 
    osrel=`grep VERSION /etc/SuSE-release|awk '{print $3}'`
Index: openafs/src/packaging/RedHat/openafs-buildfedora.pl
diff -c /dev/null openafs/src/packaging/RedHat/openafs-buildfedora.pl:1.1.4.5
*** /dev/null	Sun Mar 23 21:55:08 2008
--- openafs/src/packaging/RedHat/openafs-buildfedora.pl	Mon Nov 12 19:33:21 2007
***************
*** 0 ****
--- 1,49 ----
+ #!/usr/bin/perl
+ 
+ use strict;
+ use warnings;
+ 
+ my $specdir="/usr/src/redhat/SPECS";
+ 
+ my $fedoraversion=`rpm -q fedora-release --queryformat %{VERSION}`;
+ die "Unable to determine fedora version" if !$fedoraversion;
+ 
+ my %list;
+ foreach my $variant ('', 'PAE', 'kdump', 'xen') {
+   print "Working out variants - currently processing $variant\n";
+   my $append = "";
+   $append="-$variant" if $variant;
+   my @results=split(' ', `rpm -q --queryformat "%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH} " kernel$append-devel`);
+   if ($?) {
+     print "RPM lookup for variant $variant failed. Skipping\n";
+     next;
+   }
+   print join(' ', @results)."\n";
+   foreach my $package (@results) {
+     print "Got $package\n";
+     $package=~/([^\-]*\-[^\-]*)\.([^\.]*)$/;
+     my ($version, $arch) = ($1,$2);
+     die "Couldn't extract version and architecture" if !$version or !$arch;
+     my @archs=map {/^.*\-([^\-]*)/;$1;} split(' ',`ls -d /usr/src/kernels/$version$append-*`);
+     foreach my $arch (@archs) {
+       print "Adding $variant, version $version for $arch\n";
+       $list{$arch} = {} if !$list{$arch};
+       $list{$arch}{$version} =[] if !$list{$arch}{$version};
+       push @{$list{$arch}{$version}}, $variant;
+     }
+   } 
+ }
+ # Build the base package
+ print "Building the base system\n";
+ system("rpmbuild -ba --define \"fedorakmod 1\" --define \"osvers fc$fedoraversion\" $specdir/openafs.spec") == 0 or exit 1;
+ 
+ print "Building kernel modules\n";
+ 
+ foreach my $arch (keys(%list)) {
+   foreach my $version (keys(%{$list{$arch}})) {
+     my $variants = join(" ", map {$_ or "''"} @{$list{$arch}{$version}});
+     print "Building with $version for $arch with variants $variants\n";
+     system("rpmbuild -bb --define \"fedorakmod 1\" --define \"osvers fc$fedoraversion\" --target $arch --define \"build_modules 1\" --define \"kernvers $version\" --define \"kvariants $variants\" $specdir/openafs.spec") == 0 or exit 1;
+   }
+ }
+ 
Index: openafs/src/packaging/RedHat/openafs-client.init
diff -c openafs/src/packaging/RedHat/openafs-client.init:1.1.2.3 openafs/src/packaging/RedHat/openafs-client.init:1.1.2.5
*** openafs/src/packaging/RedHat/openafs-client.init:1.1.2.3	Fri Dec  1 13:34:13 2006
--- openafs/src/packaging/RedHat/openafs-client.init	Thu Jan 24 19:00:18 2008
***************
*** 4,11 ****
  #
  # chkconfig: 2345 50 50
  # description: OpenAFS is a distributed filesystem.
  #
! # $Revision: 1.1.2.3 $
  
  [ -f /etc/init.d/functions ] && . /etc/init.d/functions
  [ -f /etc/sysconfig/openafs ] && . /etc/sysconfig/openafs
--- 4,12 ----
  #
  # chkconfig: 2345 50 50
  # description: OpenAFS is a distributed filesystem.
+ # Should-Start: dkms
  #
! # $Revision: 1.1.2.5 $
  
  [ -f /etc/init.d/functions ] && . /etc/init.d/functions
  [ -f /etc/sysconfig/openafs ] && . /etc/sysconfig/openafs
***************
*** 17,27 ****
                 /usr/vice/etc/CellServDB
          chmod 644 /usr/vice/etc/CellServDB
          echo
-         echo -n $"Updating SuidCells: "
-         cat /usr/vice/etc/SuidCells.local /usr/vice/etc/SuidCells.dist > \
-                /usr/vice/etc/SuidCells
-         chmod 644 /usr/vice/etc/SuidCells
-         echo
  	echo -n $"Starting openafs-client: "
  	if [ -e /var/lock/subsys/openafs-client ] ; then
  		echo -n $"cannot start openafs-client: already running"
--- 18,23 ----
Index: openafs/src/packaging/RedHat/openafs-kmodtool
diff -c /dev/null openafs/src/packaging/RedHat/openafs-kmodtool:1.1.4.2
*** /dev/null	Sun Mar 23 21:55:08 2008
--- openafs/src/packaging/RedHat/openafs-kmodtool	Wed Feb 13 00:31:02 2008
***************
*** 0 ****
--- 1,176 ----
+ #!/bin/bash
+ 
+ # kmodtool - Helper script for building kernel module RPMs
+ # Copyright (c) 2003-2007 Ville Skyttä <ville.skytta@iki.fi>,
+ #                         Thorsten Leemhuis <fedora@leemhuis.info>
+ #
+ # Modified by Simon Wilkinson for OpenAFS
+ 
+ # Permission is hereby granted, free of charge, to any person obtaining
+ # a copy of this software and associated documentation files (the
+ # "Software"), to deal in the Software without restriction, including
+ # without limitation the rights to use, copy, modify, merge, publish,
+ # distribute, sublicense, and/or sell copies of the Software, and to
+ # permit persons to whom the Software is furnished to do so, subject to
+ # the following conditions:
+ #
+ # The above copyright notice and this permission notice shall be
+ # included in all copies or substantial portions of the Software.
+ #
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ 
+ shopt -s extglob
+ 
+ myprog="kmodtool"
+ myver="0.10.13"
+ knownvariants=@(BOOT|PAE?(-debug)|@(big|huge)mem|debug|enterprise|kdump|?(large)smp?(-debug)|uml|xen?([0U])?(-PAE))
+ kmod_name=
+ kver=
+ verrel=
+ variant=
+ 
+ get_verrel ()
+ {
+   verrel=${1:-$(uname -r)}
+   verrel=${verrel%%$knownvariants}
+ }
+ 
+ print_verrel ()
+ {
+   get_verrel $@
+   echo "${verrel}"
+ }
+ 
+ get_variant ()
+ {
+   get_verrel $@
+   variant=${1:-$(uname -r)}
+   variant=${variant##$verrel}
+   variant=${variant:-'""'}
+ }
+ 
+ print_variant ()
+ {
+   get_variant $@
+   echo "${variant}"
+ }
+ 
+ 
+ get_rpmtemplate ()
+ {
+     local variant="${1}"
+     local dashvariant="${variant:+-${variant}}"
+     case "$verrel" in
+         *.EL*) kdep="kernel${dashvariant}-%{_target_cpu} = ${verrel}" ;;
+         *)     kdep="kernel-%{_target_cpu} = ${verrel}${variant}"     ;;
+     esac
+     cat <<EOF
+ %package       -n kmod-${kmod_name}${dashvariant}
+ Summary:          ${kmod_name} kernel module(s)
+ Group:            System Environment/Kernel
+ Provides:         kernel-modules = ${verrel}${variant}
+ Provides:         ${kmod_name}-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
+ Provides:         openafs-kernel = %{PACKAGE_VERSION}
+ Requires:         ${kdep}
+ Requires:         ${kmod_name}-kmod-common >= %{?epoch:%{epoch}:}%{version}
+ Requires(post):   /sbin/depmod
+ Requires(postun): /sbin/depmod
+ Release:          %{pkgrel}.%(echo ${verrel} | tr - _)
+ BuildRequires:    kernel${dashvariant}-devel-%{_target_cpu} = ${verrel}
+ %description   -n kmod-${kmod_name}${dashvariant}
+ This package provides the ${kmod_name} kernel modules built for the Linux
+ kernel ${verrel}${variant} for the %{_target_cpu} family of processors.
+ %post          -n kmod-${kmod_name}${dashvariant}
+ /sbin/depmod -aeF /boot/System.map-${verrel}${variant} ${verrel}${variant} > /dev/null || :
+ %postun        -n kmod-${kmod_name}${dashvariant}
+ /sbin/depmod -aF /boot/System.map-${verrel}${variant} ${verrel}${variant} &> /dev/null || :
+ %files         -n kmod-${kmod_name}${dashvariant}
+ %defattr(644,root,root,755)
+ /lib/modules/${verrel}${variant}/extra/${kmod_name}/
+ 
+ EOF
+ }
+ 
+ print_rpmtemplate ()
+ {
+   kmod_name="${1}"
+   shift
+   kver="${1}"
+   get_verrel "${1}"
+   shift
+   if [ -z "${kmod_name}" ] ; then
+     echo "Please provide the kmodule-name as first parameter." >&2
+     exit 2
+   elif [ -z "${kver}" ] ; then
+     echo "Please provide the kver as second parameter." >&2
+     exit 2
+   elif [ -z "${verrel}" ] ; then
+     echo "Couldn't find out the verrel." >&2
+     exit 2
+   fi
+ 
+   for variant in "$@" ; do
+     get_rpmtemplate "${variant}"
+   done
+ }
+ 
+ usage ()
+ {
+   cat <<EOF
+ You called: ${invocation}
+ 
+ Usage: ${myprog} <command> <option>+
+  Commands:
+   verrel <uname>                               
+     - Get "base" version-release.
+   variant <uname>                               
+     - Get variant from uname.
+   rpmtemplate <mainpgkname> <uname> <variants> 
+     - Return a template for
+   version  
+     - Output version number and exit.
+ EOF
+ }
+ 
+ invocation="$(basename ${0}) $@"
+ while [ "${1}" ] ; do
+   case "${1}" in
+     verrel)
+       shift
+       print_verrel $@
+       exit $?
+       ;;
+     variant)
+       shift
+       print_variant $@
+       exit $?
+       ;;
+     rpmtemplate)
+       shift
+       print_rpmtemplate "$@"
+       exit $?
+       ;;
+     version)
+       echo "${myprog} ${myver}"
+       exit 0
+       ;;
+     *)
+       echo "Error: Unknown option '${1}'." >&2
+       usage >&2
+       exit 2
+       ;;
+   esac
+ done
+ 
+ # Local variables:
+ # mode: sh
+ # sh-indentation: 2
+ # indent-tabs-mode: nil
+ # End:
+ # ex: ts=2 sw=2 et
Index: openafs/src/packaging/RedHat/openafs-krb5-2.0.tar.gz
Index: openafs/src/packaging/RedHat/openafs.spec.in
diff -c openafs/src/packaging/RedHat/openafs.spec.in:1.1.2.6 openafs/src/packaging/RedHat/openafs.spec.in:1.1.2.18
*** openafs/src/packaging/RedHat/openafs.spec.in:1.1.2.6	Thu Oct 18 00:14:18 2007
--- openafs/src/packaging/RedHat/openafs.spec.in	Wed Feb 13 00:31:02 2008
***************
*** 1,7 ****
! # Openafs Spec $Revision: 1.1.2.6 $
  
! %define afsvers 1.4.5pre1
! %define pkgvers 1.4.5pre1
  # for beta/rc releases make pkgrel 0.X.<tag>
  # for real releases make pkgrel 1 (or more for extra releases)
  #%define pkgrel 0.1.rc1
--- 1,7 ----
! # Openafs Spec $Revision: 1.1.2.18 $
  
! %define afsvers @VERSION@
! %define pkgvers @VERSION@
  # for beta/rc releases make pkgrel 0.X.<tag>
  # for real releases make pkgrel 1 (or more for extra releases)
  #%define pkgrel 0.1.rc1
***************
*** 11,17 ****
  %define osvers 1
  %endif
  
! %{!?fedorakmod: %define fedorakmod 0}
  
  # Determine presence of rpmbuild command line --define arguments used for
  # option specification
--- 11,18 ----
  %define osvers 1
  %endif
  
! %{!?fedorakmod: %define fedorakmod 1}
! %{!?build_dkmspkg: %define build_dkmspkg 1}
  
  # Determine presence of rpmbuild command line --define arguments used for
  # option specification
***************
*** 20,26 ****
  %define build_modules_on_cmdline %{?build_modules:1}%{!?build_modules:0}
  
  # Determine the version of the kernel to build against
! # - automatically select the latest kernel with sources from /lib/modules
  # - note that this can be overridden on the command line
  #
  %if !%{kernvers_on_cmdline}
--- 21,27 ----
  %define build_modules_on_cmdline %{?build_modules:1}%{!?build_modules:0}
  
  # Determine the version of the kernel to build against
! # - automatically select running kernel if there are sources in /lib/modules
  # - note that this can be overridden on the command line
  #
  %if !%{kernvers_on_cmdline}
***************
*** 28,52 ****
  %endif
  
  %if %{fedorakmod}
! %define kmodtool bash %{_sourcedir}/kmodtool
  
  %define kmod_name openafs
  %define kverrel %(%{kmodtool} verrel %{?kernvers} 2>/dev/null)
  
  %define upvar ""
! %ifarch i686
! %define paevar PAE
! %endif
! %ifarch ppc
! %define smpvar smp
! %endif
! %ifarch i686 x86_64
! %define xenvar xen
! %define kdumpvar kdump
! %endif
! %{!?kvariants: %define kvariants %{?upvar} %{?smpvar} %{?paevar} %{?xenvar} %{?kdumpvar}}
  
! %define ksrcdir %{_usrsrc}/kernels/%{kverrel}-%{_target_cpu}
  
  %else # Legacy kernel build stuff 
  
--- 29,43 ----
  %endif
  
  %if %{fedorakmod}
! %define kmodtool bash %{_sourcedir}/openafs-kmodtool
  
  %define kmod_name openafs
  %define kverrel %(%{kmodtool} verrel %{?kernvers} 2>/dev/null)
  
  %define upvar ""
! %{!?kvariants: %define kvariants %{?upvar}}
  
! %{!?ksrcdir: %define ksrcdir %{_usrsrc}/kernels/%{kverrel}-%{_target_cpu}}
  
  %else # Legacy kernel build stuff 
  
***************
*** 80,85 ****
--- 71,78 ----
  # End legacy kernel build stuff
  %endif 
  
+ %define dkms_version %{osvers}.%{pkgrel}
+ 
  # Set 'debugspec' to 1 if you want to debug the spec file.  This will
  # not remove the installed tree as part of the %clean operation
  %if %{?debugspec:0}%{!?debugspec:1}
***************
*** 90,95 ****
--- 83,94 ----
  # to distribute aklog and asetkey
  %define krb5support %{?_without_krb5:0}%{!?_without_krb5:1}
  
+ %if %{krb5support}
+ %if %{?krb5config:0}%{!?krb5config:1}
+ %define krb5config /usr/kerberos/bin/krb5-config
+ %endif
+ %endif
+ 
  # Set 'bootkernelsupport' to 1 if you want to build the
  # kernel module for Red Hat BOOT Kernels on x86.
  %define bootkernelsupport %{?_with_bootkernel:1}%{!?_with_bootkernel:0}
***************
*** 227,239 ****
  License: IBM Public License
  URL: http://www.openafs.org
  BuildRoot: %{_tmppath}/%{name}-%{version}-root
! Packager: Derek Atkins <warlord@MIT.EDU>
  Group: Networking/Filesystems
  BuildRequires: %{?kdepend:%{kdepend}, } pam-devel, ncurses-devel, flex, bison
! %if %{build_userspace}
! BuildRequires: autoconf
  %endif
! ExclusiveArch: %{ix86} x86_64 ia64
  
  #    http://dl.openafs.org/dl/openafs/candidate/%{afsvers}/...
  Source0: http://www.openafs.org/dl/openafs/%{afsvers}/openafs-%{afsvers}-src.tar.bz2
--- 226,238 ----
  License: IBM Public License
  URL: http://www.openafs.org
  BuildRoot: %{_tmppath}/%{name}-%{version}-root
! Packager: OpenAFS Gatekeepers <openafs-gatekeepers@openafs.org>
  Group: Networking/Filesystems
  BuildRequires: %{?kdepend:%{kdepend}, } pam-devel, ncurses-devel, flex, bison
! %if %{krb5support}
! BuildRequires: krb5-devel
  %endif
! ExclusiveArch: %{ix86} x86_64 ia64 s390 s390x sparc64 ppc ppc64
  
  #    http://dl.openafs.org/dl/openafs/candidate/%{afsvers}/...
  Source0: http://www.openafs.org/dl/openafs/%{afsvers}/openafs-%{afsvers}-src.tar.bz2
***************
*** 243,251 ****
  Source10: http://www.openafs.org/dl/openafs/%{afsvers}/RELNOTES-%{afsvers}
  Source11: http://www.openafs.org/dl/openafs/%{afsvers}/ChangeLog
  
  Source30: openafs-kernel-version.sh
  Source998: openafs-buildall.sh
! Source999: kmodtool
  
  Patch0:  openafs-1.4.0-kmodule26.patch
  
--- 242,254 ----
  Source10: http://www.openafs.org/dl/openafs/%{afsvers}/RELNOTES-%{afsvers}
  Source11: http://www.openafs.org/dl/openafs/%{afsvers}/ChangeLog
  
+ Source20: http://dl.central.org/dl/cellservdb/CellServDB.2007-10-25 
+ 
  Source30: openafs-kernel-version.sh
+ Source996: openafs-kvers-is.sh
+ Source997: openafs-buildfedora.pl
  Source998: openafs-buildall.sh
! Source999: openafs-kmodtool
  
  Patch0:  openafs-1.4.0-kmodule26.patch
  
***************
*** 291,297 ****
                                    will be installed.  You probably don't
                                    need to change this ever.
  
!  --define "fedorakmod 1"	  Build 'Fedora' style kernel modules
  
  To a kernel module for your running kernel, just run:
    rpmbuild --rebuild --target=`uname -m` openafs-%{pkgvers}-%{osvers}.%{pkgrel}.src.rpm
--- 294,309 ----
                                    will be installed.  You probably don't
                                    need to change this ever.
  
!  --define "fedorakmod 0"	  Disable the building of 'Fedora' style kernel 
! 				  modules, and use the old format.
! 
!  --define "kvariants <variants>"  When building Fedora style kernel modules,
!                                   this defines the set of kernel variants
!                                   to build.
!                                   <variants> is a space seperated list which
!                                   may contain one or more of
!                                   '' (for the generic kernel), smp, PAE, xen
!                                   or kdump 
  
  To a kernel module for your running kernel, just run:
    rpmbuild --rebuild --target=`uname -m` openafs-%{pkgvers}-%{osvers}.%{pkgrel}.src.rpm
***************
*** 339,344 ****
--- 351,379 ----
  This package provides basic server support to host files in an AFS
  Cell.
  
+ %if %{build_dkmspkg}
+ %package -n dkms-%{name}
+ Summary:        DKMS-ready kernel source for AFS distributed filesystem
+ Group:          Development/Kernel
+ Provides:       openafs-kernel = %{PACKAGE_VERSION}
+ %if %{fedorakmod}
+ Provides: %{name}-kmod = %{PACKAGE_VERSION}
+ %endif
+ Requires(pre):  dkms
+ Requires(pre):  flex
+ Requires(post): dkms
+ Requires:	%{name}-kmod-common = %{version}
+ 
+ %description -n dkms-%{name}
+ The AFS distributed filesystem.  AFS is a distributed filesystem
+ allowing cross-platform sharing of files among multiple computers.
+ Facilities are provided for access control, authentication, backup and
+ administrative management.
+ 
+ This package provides the source code to allow DKMS to build an
+ AFS kernel module.
+ %endif
+ 
  %if %{build_authlibs}
  %package authlibs
  Summary: OpenAFS authentication shared libraries
***************
*** 455,461 ****
  Summary: OpenAFS programs to use with krb5
  Requires: openafs = %{PACKAGE_VERSION}
  Group: Networking/Filesystems
! BuildRequires: krb5-devel, autoconf, automake
  
  %description krb5
  The AFS distributed filesystem.  AFS is a distributed filesystem
--- 490,496 ----
  Summary: OpenAFS programs to use with krb5
  Requires: openafs = %{PACKAGE_VERSION}
  Group: Networking/Filesystems
! BuildRequires: krb5-devel
  
  %description krb5
  The AFS distributed filesystem.  AFS is a distributed filesystem
***************
*** 638,674 ****
  # Patch openafs to build a kernel module named "openafs" instead of "libafs"
  %patch0 -p1 -b .kmod26
  
- %if %{build_userspace}
- # Save some time -- install these if we're building userspace
- 
- # Install the Krb5 Migration Kit
- tar -xzf src/packaging/RedHat/openafs-krb5-2.0.tar.gz
- 
- #
- # patch afs-krb5 migration kit to work with openafs-1.3 and krb5-1.3;
- # add some features and fix bugs
- #
- 
- # krb524 is no longer in a separate library as of krb5-1.3; handle this
- patch -p0 -b -z .krb524 < src/packaging/RedHat/afs-krb5-2.0-krb524.patch
- 
- # make sure NETLIBS gets added to the proper programs (seems to be 
- # needed only for Solaris)
- patch -p0 -b -z .libsocket < src/packaging/RedHat/afs-krb5-2.0-libsocket.patch
- 
- # find an existing libcom_err and use that
- patch -p0 -b -z .com_err < src/packaging/RedHat/afs-krb5-2.0-com_err.patch
- 
- # make afs-krb5 work with recent OpenAFS; includes and prototypes
- patch -p0 -b -z .openafs13 < src/packaging/RedHat/afs-krb5-2.0-openafs1.3.patch
- 
- # nothing in afs-krb5 actually uses res_search
- patch -p0 -b -z .res_search < src/packaging/RedHat/afs-krb5-2.0-res_search.patch
- 
- (cd afs-krb5/src && autoreconf) || exit 1
- 
- %endif
- 
  ##############################################################################
  #
  # building
--- 673,678 ----
***************
*** 809,814 ****
--- 813,834 ----
  
  # Configure AFS
  
+ # If we're using Fedora kmods, work out which is the best kernel module to 
+ # use for the userland configuration step. If no variants have been specified,
+ # then use the standard kernel. If variants are specified, use the standard kernel
+ # if it's listed, otherwise pick the first listed kernel.
+ ksrc=""
+ %if %{fedorakmod} 
+   for kvariant in %{kvariants} ; do
+     if [ -z "${kvariant}" -o -z "$ksrc" ] ; then
+       ksrc=%{_usrsrc}/kernels/%{kverrel}${kvariant:+-$kvariant}-%{_target_cpu}
+     fi
+   done
+ %endif
+ if [ -z "$ksrc" ] ; then
+ ksrc=%{ksrcdir}
+ fi
+ 
  CFLAGS="$RPM_OPT_FLAGS"; export CFLAGS
  
  ./configure --with-afs-sysname=${sysname} \
***************
*** 816,826 ****
         --libdir=%{_libdir} \
         --bindir=%{_bindir} \
         --sbindir=%{_sbindir} \
  %if %{build_modules}
!        --with-linux-kernel-headers=%{ksrcdir} \
  %endif
  %if %{krb5support}
! 	--with-krb5-conf \
  %endif
         $config_opts \
         || exit 1
--- 836,847 ----
         --libdir=%{_libdir} \
         --bindir=%{_bindir} \
         --sbindir=%{_sbindir} \
+        --disable-strip-binaries \
  %if %{build_modules}
!        --with-linux-kernel-headers=${ksrc} \
  %endif
  %if %{krb5support}
! 	--with-krb5-conf=%{krb5config} \
  %endif
         $config_opts \
         || exit 1
***************
*** 832,880 ****
  
  %if %{fedorakmod} && %{build_modules}
  for kvariant in %{kvariants} ; do
!   cp -R libafs_tree _kmod_build_${kvariant}
!   pushd _kmod_build_${kvariant}
!   ./configure --with-afs-sysname=${sysname} \
    	--prefix=%{_prefix} \
  	--libdir=%{_libdir} \
  	--bindir=%{_bindir} \
  	--sbindir=%{_sbindir} \
  	--with-linux-kernel-headers=%{_usrsrc}/kernels/%{kverrel}${kvariant:+-$kvariant}-%{_target_cpu} \
  %if %{krb5support}
! 	--with-krb5-conf \
  %endif
  	$config_opts \
  	|| exit 1
!   popd
  done
  %endif
  
  %if %{build_userspace}
  # Build the user-space AFS stuff
  make dest_nolibafs || exit 1
- 
- %if %{krb5support}
- # Now build ka-forwarder
- (cd afs-krb5/src &&
- 	./configure --prefix=%{_prefix} --with-krb5=%{_prefix}/kerberos \
-                --libdir=%{_libdir} \
-                --bindir=%{_bindir} \
-                --sbindir=%{_sbindir} \
-                --with-afs=`pwd`/../../${sysname}/dest/ && \
- 	make all PROGS="ka-forwarder" && \
- 	install -c -s ka-forwarder `pwd`/../../${sysname}/dest/etc ) \
- 	|| exit 1
- %endif
- 
  %endif
  
  %if %{build_modules}
  %if %{fedorakmod}
  for kvariant in %{kvariants}
  do
!   pushd _kmod_build_$kvariant;
!   make all MPS=SP
!   popd
  done
  
  %else
--- 853,893 ----
  
  %if %{fedorakmod} && %{build_modules}
  for kvariant in %{kvariants} ; do
!   if [ -n "${kvariant}" ] ; then
!     cp -R libafs_tree _kmod_build_${kvariant}
!     pushd _kmod_build_${kvariant}
!     ./configure --with-afs-sysname=${sysname} \
    	--prefix=%{_prefix} \
  	--libdir=%{_libdir} \
  	--bindir=%{_bindir} \
  	--sbindir=%{_sbindir} \
  	--with-linux-kernel-headers=%{_usrsrc}/kernels/%{kverrel}${kvariant:+-$kvariant}-%{_target_cpu} \
  %if %{krb5support}
! 	--with-krb5-conf=/usr/kerberos/bin/krb5-config \
  %endif
  	$config_opts \
  	|| exit 1
!     popd
!   fi
  done
  %endif
  
  %if %{build_userspace}
  # Build the user-space AFS stuff
  make dest_nolibafs || exit 1
  %endif
  
  %if %{build_modules}
  %if %{fedorakmod}
  for kvariant in %{kvariants}
  do
!   if [ -n "${kvariant}" ] ; then
!     pushd _kmod_build_$kvariant;
!     make all MPS=SP
!     popd
!   else
!     make dest_only_libafs MPS=SP
!   fi
  done
  
  %else
***************
*** 987,996 ****
  # Populate /usr/vice/etc
  uve=$RPM_BUILD_ROOT%{_prefix}/vice/etc
  install -p -m 644 src/packaging/RedHat/openafs-ThisCell $uve/ThisCell
! install -p -m 644 src/afsd/CellServDB $uve/CellServDB.dist
  install -p -m 644 src/packaging/RedHat/openafs-cacheinfo $uve/cacheinfo
  
  #
  # install kernel-source
  #
  
--- 1000,1031 ----
  # Populate /usr/vice/etc
  uve=$RPM_BUILD_ROOT%{_prefix}/vice/etc
  install -p -m 644 src/packaging/RedHat/openafs-ThisCell $uve/ThisCell
! install -p -m 644 %{SOURCE20} $uve/CellServDB.dist
  install -p -m 644 src/packaging/RedHat/openafs-cacheinfo $uve/cacheinfo
  
  #
+ # install dkms source
+ #
+ install -d -m 755 $RPM_BUILD_ROOT%{_prefix}/src
+ cp -a libafs_tree $RPM_BUILD_ROOT%{_prefix}/src/%{name}-%{dkms_version}
+ 
+ cat > $RPM_BUILD_ROOT%{_prefix}/src/%{name}-%{dkms_version}/dkms.conf <<EOF
+ 
+ PACKAGE_VERSION="%{dkms_version}"
+ 
+ # Items below here should not have to change with each driver version
+ PACKAGE_NAME="%{name}"
+ MAKE[0]="SMP=SP; eval \\\`grep CONFIG_SMP /boot/config-\${kernelver_array[0]}\\\`; [ -n \"\\\$CONFIG_SMP\" ] && SMP=MP; ./configure --with-linux-kernel-headers=\${kernel_source_dir}; make MPS=\\\$SMP; mv src/libafs/MODLOAD-*/openafs.ko ."
+ CLEAN="make -C src/libafs clean"
+ 
+ BUILT_MODULE_NAME[0]="\$PACKAGE_NAME"
+ DEST_MODULE_LOCATION[0]="/kernel/3rdparty/\$PACKAGE_NAME/"
+ 
+ AUTOINSTALL=yes
+ 
+ EOF
+ 
+ #
  # install kernel-source
  #
  
***************
*** 1030,1036 ****
  
  # remove unused man pages
  for x in afs_ftpd afs_inetd afs_login afs_rcp afs_rlogind afs_rsh \
!     dkload knfs package runntp; do
  	rm -f $RPM_BUILD_ROOT%{_mandir}/man1/${x}.1
  done
  
--- 1065,1072 ----
  
  # remove unused man pages
  for x in afs_ftpd afs_inetd afs_login afs_rcp afs_rlogind afs_rsh \
!     dkload knfs package runntp symlink symlink_list symlink_make \
!     symlink_remove; do
  	rm -f $RPM_BUILD_ROOT%{_mandir}/man1/${x}.1
  done
  
***************
*** 1050,1056 ****
  	>openafs-man5files
  
  /bin/ls $RPM_BUILD_ROOT%{_mandir}/man8 \
! 	|egrep '^backup|^bos|^butc|^fms|^fstrace|^kas|^uss' \
  	>openafs-man8files
  
  #
--- 1086,1092 ----
  	>openafs-man5files
  
  /bin/ls $RPM_BUILD_ROOT%{_mandir}/man8 \
! 	|egrep '^backup|^bos|^butc|^fms|^fstrace|^kas|^read_tape|^uss' \
  	>openafs-man8files
  
  #
***************
*** 1146,1159 ****
    rm -f $RPM_BUILD_ROOT%{_libdir}/$f
  done
  
- # Remove empty files from the krb5 migration
- for f in afs2k5db fakeka ; do
-   rm -f $RPM_BUILD_ROOT%{_sbindir}/$f
- done
- 
  %if !%{build_authlibs}
  rm -f $RPM_BUILD_ROOT%{_libdir}/libafsauthent.so
  rm -f $RPM_BUILD_ROOT%{_libdir}/libafsrpc.so
  %endif
  
  %endif
--- 1182,1192 ----
    rm -f $RPM_BUILD_ROOT%{_libdir}/$f
  done
  
  %if !%{build_authlibs}
  rm -f $RPM_BUILD_ROOT%{_libdir}/libafsauthent.so
  rm -f $RPM_BUILD_ROOT%{_libdir}/libafsrpc.so
+ rm -f $RPM_BUILD_ROOT%{_libdir}/libafsauthent.so.*
+ rm -f $RPM_BUILD_ROOT%{_libdir}/libafsrpc.so.*
  %endif
  
  %endif
***************
*** 1162,1174 ****
  %if %{fedorakmod}
  for kvariant in %{kvariants}
  do
!     pushd _kmod_build_$kvariant
!     srcdir=src/libafs/MODLOAD-%{kverrel}${kvariant}-SP
!     dstdir=$RPM_BUILD_ROOT/lib/modules/%{kverrel}${kvariant}/extra/openafs
  
!     mkdir -p ${dstdir}
!     install -m 744 ${srcdir}/libafs-%{kverrel}${kvariant}.ko $dstdir/openafs.ko
!     popd
  done
  %else
  # Install the kernel modules
--- 1195,1209 ----
  %if %{fedorakmod}
  for kvariant in %{kvariants}
  do
!   if [ -n "$kvariant" ] ; then
!     srcdir=_kmod_build_$kvariant/src/libafs/MODLOAD-%{kverrel}${kvariant}-SP
!   else
!     srcdir=${sysname}/dest/root.client%{_prefix}/vice/etc/modload
!   fi
  
!   dstdir=$RPM_BUILD_ROOT/lib/modules/%{kverrel}${kvariant}/extra/openafs
!   mkdir -p ${dstdir}
!   install -m 755 ${srcdir}/libafs-%{kverrel}${kvariant}.ko $dstdir/openafs.ko
  done
  %else
  # Install the kernel modules
***************
*** 1188,1196 ****
  
      mkdir -p ${dstdir}
  
!     # Mark kernel modules as executable; otherwise they won't get stripped 
!     # by /usr/lib/rpm/brp-strip
!     install -m 744 ${srcdir}/${modname} ${dstdir}/openafs${kmodend}
  done
  %endif
  %endif
--- 1223,1229 ----
  
      mkdir -p ${dstdir}
  
!     install -m 755 ${srcdir}/${modname} ${dstdir}/openafs${kmodend}
  done
  %endif
  %endif
***************
*** 1277,1282 ****
--- 1310,1324 ----
          chkconfig --del openafs-server
  fi
  
+ %if %{build_dkmspkg}
+ %post -n dkms-%{name}
+ dkms add -m %{name} -v %{dkms_version} --rpm_safe_upgrade
+ dkms build -m %{name} -v %{dkms_version} --rpm_safe_upgrade
+ dkms install -m %{name} -v %{dkms_version} --rpm_safe_upgrade
+ 
+ %preun -n dkms-%{name}
+ dkms remove -m %{namee} -v %{dkms_version} --rpm_safe_upgrade --all ||:
+ %endif
  %endif
  
  %if %{build_modules}
***************
*** 1324,1330 ****
  %endif
  %endif
  
- 
  ##############################################################################
  ###
  ### file lists
--- 1366,1371 ----
***************
*** 1474,1479 ****
--- 1515,1526 ----
  %{_libdir}/libubik.a
  %{_mandir}/man1/rxgen.*
  
+ %if %{build_dkmspkg}
+ %files -n dkms-%{name}
+ %defattr(-,root,root)
+ %{_prefix}/src/%{name}-%{dkms_version}
+ %endif
+ 
  %files kernel-source
  %defattr(-,root,root)
  %{_prefix}/src/openafs-kernel-%{afsvers}/LICENSE.IBM
***************
*** 1495,1501 ****
  %defattr(-,root,root)
  %{_bindir}/aklog
  %{_sbindir}/asetkey
- %{_sbindir}/ka-forwarder
  %{_mandir}/man1/aklog.*
  %{_mandir}/man8/asetkey.*
  %endif
--- 1542,1547 ----
***************
*** 1532,1538 ****
  %if %{hugemem_package}
  %files kernel-hugemem
  %defattr(-,root,root)
! %{kxmoddir}%{?hugemem_ext:%{hugemem_ext}}/kernel/fs/openafs/openafs.*
  %endif
  %endif
  
--- 1578,1584 ----
  %if %{hugemem_package}
  %files kernel-hugemem
  %defattr(-,root,root)
! %{kxmoddir}%{?hugemem_ext:%{hugemem_ext}}/fs/openafs/openafs.*
  %endif
  %endif
  
***************
*** 1544,1549 ****
--- 1590,1603 ----
  ###
  ##############################################################################
  %changelog
+ * Wed Dec 12 2007  Simon Wilkinson <simon@sxw.org.uk> 1.4.5
+ - Make the RPM mockable
+ 
+ * Tue Oct 29 2007  Simon Wilkinson <simon@sxw.org.uk> 1.4.5
+ - Update to match the shipped 1.4.5 RPMS
+ - Fix the kvariant stuff to only configure the 'standard' case once
+ - Add openafs-kvers.sh back in
+ 
  * Wed Oct 10 2007  Simon Wilkinson <simon@sxw.org.uk> 1.4.5pre1-1
  - Use Fedora style kmods, which allows us to install multiple kernel types
  
Index: openafs/src/pam/afs_pam_msg.c
diff -c openafs/src/pam/afs_pam_msg.c:1.6 openafs/src/pam/afs_pam_msg.c:1.6.2.1
*** openafs/src/pam/afs_pam_msg.c:1.6	Tue Jul 15 19:15:56 2003
--- openafs/src/pam/afs_pam_msg.c	Tue Oct 30 11:23:59 2007
***************
*** 11,26 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/pam/afs_pam_msg.c,v 1.6 2003/07/15 23:15:56 shadow Exp $");
  
  #include <stdio.h>
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <stdlib.h>
  #include <security/pam_appl.h>
  #include "afs_pam_msg.h"
--- 11,20 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/pam/afs_pam_msg.c,v 1.6.2.1 2007/10/30 15:23:59 shadow Exp $");
  
  #include <stdio.h>
  #include <string.h>
  #include <stdlib.h>
  #include <security/pam_appl.h>
  #include "afs_pam_msg.h"
Index: openafs/src/pam/afs_setcred.c
diff -c openafs/src/pam/afs_setcred.c:1.13.2.1 openafs/src/pam/afs_setcred.c:1.13.2.2
*** openafs/src/pam/afs_setcred.c:1.13.2.1	Sun May 29 23:37:48 2005
--- openafs/src/pam/afs_setcred.c	Mon Dec 10 13:29:41 2007
***************
*** 20,26 ****
  #include <security/pam_modules.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/pam/afs_setcred.c,v 1.13.2.1 2005/05/30 03:37:48 shadow Exp $");
  
  #include <sys/param.h>
  #include <afs/kautils.h>
--- 20,26 ----
  #include <security/pam_modules.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/pam/afs_setcred.c,v 1.13.2.2 2007/12/10 18:29:41 shadow Exp $");
  
  #include <sys/param.h>
  #include <afs/kautils.h>
***************
*** 62,68 ****
      int auth_ok = 0;
      char *lh;
      char *user = NULL;
!     long password_expires = -1;
      char *reason = NULL;
      struct passwd unix_pwd, *upwd = NULL;
      char upwd_buf[2048];	/* size is a guess. */
--- 62,68 ----
      int auth_ok = 0;
      char *lh;
      char *user = NULL;
!     int password_expires = -1;
      char *reason = NULL;
      struct passwd unix_pwd, *upwd = NULL;
      char upwd_buf[2048];	/* size is a guess. */
Index: openafs/src/pam/afs_util.c
diff -c openafs/src/pam/afs_util.c:1.12.2.4 openafs/src/pam/afs_util.c:1.12.2.6
*** openafs/src/pam/afs_util.c:1.12.2.4	Mon Oct  9 23:23:39 2006
--- openafs/src/pam/afs_util.c	Thu Dec 13 13:54:08 2007
***************
*** 17,33 ****
  #include <afs/param.h>
  #include <sys/wait.h>
  #include <limits.h>
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <stdlib.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/pam/afs_util.c,v 1.12.2.4 2006/10/10 03:23:39 shadow Exp $");
  
  #include "afs_util.h"
  
--- 17,31 ----
  #include <afs/param.h>
  #include <sys/wait.h>
  #include <limits.h>
  #include <string.h>
  #include <stdlib.h>
+ #ifdef AFS_AIX51_ENV
+ #include <sys/cred.h>
+ #include <sys/pag.h>
+ #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/pam/afs_util.c,v 1.12.2.6 2007/12/13 18:54:08 shadow Exp $");
  
  #include "afs_util.h"
  
***************
*** 180,185 ****
--- 178,189 ----
  static afs_int32
  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;
***************
*** 203,208 ****
--- 207,213 ----
  	    return -1;
      }
      return -1;
+ #endif
  }
  
  /* Returns the AFS pag number, if any, otherwise return -1 */
Index: openafs/src/platform/DARWIN/Makefile.in
diff -c openafs/src/platform/DARWIN/Makefile.in:1.2.4.5 openafs/src/platform/DARWIN/Makefile.in:1.2.4.6
*** openafs/src/platform/DARWIN/Makefile.in:1.2.4.5	Tue Aug  1 23:48:48 2006
--- openafs/src/platform/DARWIN/Makefile.in	Mon Nov 12 13:31:35 2007
***************
*** 21,30 ****
  	${DEST}/etc/afssettings
  
  ${DESTDIR}${sbindir}/afssettings: afssettings
! 	${INSTALL} -s $? $@
  
  ${DEST}/etc/afssettings: afssettings
! 	${INSTALL} -s $? $@
  
  clean:
  	$(RM) -f *.o core afssettings AFS_component_version_number.c 
--- 21,30 ----
  	${DEST}/etc/afssettings
  
  ${DESTDIR}${sbindir}/afssettings: afssettings
! 	${INSTALL} $? $@
  
  ${DEST}/etc/afssettings: afssettings
! 	${INSTALL} $? $@
  
  clean:
  	$(RM) -f *.o core afssettings AFS_component_version_number.c 
Index: openafs/src/ptserver/Makefile.in
diff -c openafs/src/ptserver/Makefile.in:1.14.2.3 openafs/src/ptserver/Makefile.in:1.14.2.4
*** openafs/src/ptserver/Makefile.in:1.14.2.3	Mon Jul 31 13:07:50 2006
--- openafs/src/ptserver/Makefile.in	Thu Nov  1 12:05:59 2007
***************
*** 75,103 ****
  ptint.xdr.o: ptint.xdr.c ptint.h ptint.xg
  
  ptint.cs.c: ptint.xg
! 	${RXGEN} -x -C -u -o $@ ${srcdir}/ptint.xg
  
  ptint.ss.c: ptint.xg
! 	${RXGEN} -x -S -o $@ ${srcdir}/ptint.xg
  
  ptint.xdr.c: ptint.xg
! 	${RXGEN} -x -c -o $@ ${srcdir}/ptint.xg
  
  ptint.h: ptint.xg
! 	${RXGEN} -x -h -u -o $@ ${srcdir}/ptint.xg
  
  ptint.cs.c: ptint.h
  ptint.ss.c: ptint.h
  ptint.xdr.c: ptint.h
  
  Kptint.cs.c: ptint.xg Kptint.h
! 	${RXGEN} -x -k -C -o Kptint.cs.c ${srcdir}/ptint.xg
   
  Kptint.xdr.c: ptint.xg
! 	${RXGEN} -x -k -c -o Kptint.xdr.c ${srcdir}/ptint.xg
   
  Kptint.h: ptint.xg
! 	${RXGEN} -x -k -h -o Kptint.h ${srcdir}/ptint.xg
  
  display.o: display.c ${INCLS}
  
--- 75,103 ----
  ptint.xdr.o: ptint.xdr.c ptint.h ptint.xg
  
  ptint.cs.c: ptint.xg
! 	${RXGEN} -x -C -A -u -o $@ ${srcdir}/ptint.xg
  
  ptint.ss.c: ptint.xg
! 	${RXGEN} -x -S -A -o $@ ${srcdir}/ptint.xg
  
  ptint.xdr.c: ptint.xg
! 	${RXGEN} -x -c -A -o $@ ${srcdir}/ptint.xg
  
  ptint.h: ptint.xg
! 	${RXGEN} -x -h -A -u -o $@ ${srcdir}/ptint.xg
  
  ptint.cs.c: ptint.h
  ptint.ss.c: ptint.h
  ptint.xdr.c: ptint.h
  
  Kptint.cs.c: ptint.xg Kptint.h
! 	${RXGEN} -x -k -A -C -o Kptint.cs.c ${srcdir}/ptint.xg
   
  Kptint.xdr.c: ptint.xg
! 	${RXGEN} -x -k -A -c -o Kptint.xdr.c ${srcdir}/ptint.xg
   
  Kptint.h: ptint.xg
! 	${RXGEN} -x -k -A -h -o Kptint.h ${srcdir}/ptint.xg
  
  display.o: display.c ${INCLS}
  
Index: openafs/src/ptserver/db_verify.c
diff -c openafs/src/ptserver/db_verify.c:1.16.2.3 openafs/src/ptserver/db_verify.c:1.16.2.5
*** openafs/src/ptserver/db_verify.c:1.16.2.3	Sat Aug 11 19:50:02 2007
--- openafs/src/ptserver/db_verify.c	Wed Oct 31 00:13:43 2007
***************
*** 12,18 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/db_verify.c,v 1.16.2.3 2007/08/11 23:50:02 jaltman Exp $");
  
  /*
   *                      (3) Define a structure, idused, instead of an
--- 12,18 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/db_verify.c,v 1.16.2.5 2007/10/31 04:13:43 shadow Exp $");
  
  /*
   *                      (3) Define a structure, idused, instead of an
***************
*** 44,56 ****
  #include <sys/file.h>
  #endif
  #include <stdio.h>
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <errno.h>
  #include <fcntl.h>
  #include <afs/cellconfig.h>
--- 44,50 ----
***************
*** 1433,1439 ****
  #include "AFS_component_version_number.c"
  
  int
! WorkerBee(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      char *recreateFile;
--- 1427,1433 ----
  #include "AFS_component_version_number.c"
  
  int
! WorkerBee(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      char *recreateFile;
Index: openafs/src/ptserver/display.c
diff -c openafs/src/ptserver/display.c:1.9 openafs/src/ptserver/display.c:1.9.2.1
*** openafs/src/ptserver/display.c:1.9	Wed Jun 23 10:27:41 2004
--- openafs/src/ptserver/display.c	Tue Oct 30 11:24:02 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/display.c,v 1.9 2004/06/23 14:27:41 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/display.c,v 1.9.2.1 2007/10/30 15:24:02 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 20,32 ****
  #else
  #include <netinet/in.h>
  #endif
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <stdio.h>
  #include "ptserver.h"
  
--- 20,26 ----
Index: openafs/src/ptserver/pt_util.c
diff -c openafs/src/ptserver/pt_util.c:1.9.2.3 openafs/src/ptserver/pt_util.c:1.9.2.5
*** openafs/src/ptserver/pt_util.c:1.9.2.3	Tue Apr 10 14:43:45 2007
--- openafs/src/ptserver/pt_util.c	Sat Mar  8 20:41:27 2008
***************
*** 1,4 ****
! /* $Id: pt_util.c,v 1.9.2.3 2007/04/10 18:43:45 shadow Exp $ */
  
  /*
   *
--- 1,4 ----
! /* $Id: pt_util.c,v 1.9.2.5 2008/03/09 01:41:27 jaltman Exp $ */
  
  /*
   *
***************
*** 23,29 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/pt_util.c,v 1.9.2.3 2007/04/10 18:43:45 shadow Exp $");
  
  #include <afs/cmd.h>		/*Command line parsing */
  #include <errno.h>
--- 23,29 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/pt_util.c,v 1.9.2.5 2008/03/09 01:41:27 jaltman Exp $");
  
  #include <afs/cmd.h>		/*Command line parsing */
  #include <errno.h>
***************
*** 33,38 ****
--- 33,39 ----
  #include <ubik.h>
  #include <rx/xdr.h>
  #include <rx/rx.h>
+ #include <afs/com_err.h>
  #include "ptint.h"
  #include "ptserver.h"
  #include "pterror.h"
***************
*** 53,59 ****
  char *checkin();
  char *check_core();
  char *id_to_name();
! int CommandProc(struct cmd_syndesc *);
  
  struct hash_entry {
      char h_name[PR_MAXNAMELEN];
--- 54,60 ----
  char *checkin();
  char *check_core();
  char *id_to_name();
! int CommandProc(struct cmd_syndesc *, void *);
  
  struct hash_entry {
      char h_name[PR_MAXNAMELEN];
***************
*** 105,111 ****
      register struct cmd_syndesc *cs;	/*Command line syntax descriptor */
      register afs_int32 code;	/*Return code */
  
!     cs = cmd_CreateSyntax((char *)0, CommandProc, 0,
  			  "access protection database");
      cmd_AddParm(cs, "-w", CMD_FLAG, CMD_OPTIONAL,
  		"update prdb with contents of data file");
--- 106,112 ----
      register struct cmd_syndesc *cs;	/*Command line syntax descriptor */
      register afs_int32 code;	/*Return code */
  
!     cs = cmd_CreateSyntax(NULL, CommandProc, NULL,
  			  "access protection database");
      cmd_AddParm(cs, "-w", CMD_FLAG, CMD_OPTIONAL,
  		"update prdb with contents of data file");
***************
*** 128,134 ****
  }
  
  int
! CommandProc(register struct cmd_syndesc *a_as)
  {
      register int i;
      register long code;
--- 129,135 ----
  }
  
  int
! CommandProc(register struct cmd_syndesc *a_as, void *arock)
  {
      register int i;
      register long code;
Index: openafs/src/ptserver/ptprocs.c
diff -c openafs/src/ptserver/ptprocs.c:1.21.2.8 openafs/src/ptserver/ptprocs.c:1.21.2.9
*** openafs/src/ptserver/ptprocs.c:1.21.2.8	Mon Jul 31 13:15:48 2006
--- openafs/src/ptserver/ptprocs.c	Tue Oct 30 11:24:02 2007
***************
*** 51,57 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/ptprocs.c,v 1.21.2.8 2006/07/31 17:15:48 shadow Exp $");
  
  #include <afs/stds.h>
  #include <ctype.h>
--- 51,57 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/ptprocs.c,v 1.21.2.9 2007/10/30 15:24:02 shadow Exp $");
  
  #include <afs/stds.h>
  #include <ctype.h>
***************
*** 69,81 ****
  #include <netinet/in.h>
  #include <arpa/inet.h>
  #endif
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include "ptserver.h"
  #include "pterror.h"
  #include "ptprototypes.h"
--- 69,75 ----
Index: openafs/src/ptserver/pts.c
diff -c openafs/src/ptserver/pts.c:1.13.2.4 openafs/src/ptserver/pts.c:1.13.2.7
*** openafs/src/ptserver/pts.c:1.13.2.4	Sat Aug 11 19:54:04 2007
--- openafs/src/ptserver/pts.c	Tue Mar 18 11:59:07 2008
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/pts.c,v 1.13.2.4 2007/08/11 23:54:04 jaltman Exp $");
  
  #include <stdio.h>
  #include <string.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/pts.c,v 1.13.2.7 2008/03/18 15:59:07 shadow Exp $");
  
  #include <stdio.h>
  #include <string.h>
***************
*** 50,58 ****
--- 50,65 ----
      FILE *s_file;
  } *shead;
  
+ struct authstate {
+     int sec;
+     const char *confdir;
+     char cell[MAXCELLCHARS];
+ };
+ 
  int
  pts_Interactive(register struct cmd_syndesc *as)
  {
+     source = stdin;
      finished = 0;
      return 0;
  }
***************
*** 130,168 ****
  }
  
  int
! GetGlobals(register struct cmd_syndesc *as)
  {
!     register afs_int32 code;
!     char *cell;
!     afs_int32 sec = 1;
  
      whoami = as->a0name;
  
      if (!strcmp(as->name, "help"))
  	return 0;
!     if (as->parms[16].items)
  	cell = as->parms[16].items->data;
!     else
! 	cell = 0;
!     if (as->parms[17].items)
  	sec = 0;
! 
!     if (as->parms[18].items) {	/* testing? */
! 	code = pr_Initialize(sec, AFSDIR_SERVER_ETC_DIRPATH, cell);
      } else {
! 	code = pr_Initialize(sec, AFSDIR_CLIENT_ETC_DIRPATH, cell);
      }
      if (code) {
  	afs_com_err(whoami, code, "while initializing");
  	return code;
      }
      if (as->parms[19].items)
  	force = 1;
      return code;
  }
  
  int
! CleanUp(register struct cmd_syndesc *as)
  {
      if (as && !strcmp(as->name, "help"))
  	return 0;
--- 137,214 ----
  }
  
  int
! GetGlobals(struct cmd_syndesc *as, void *arock)
  {
!     struct authstate *state = (struct authstate *) arock;
!     afs_int32 code;
!     char *cell = NULL;
!     afs_int32 sec;
!     int changed = 0;
!     const char* confdir;
  
      whoami = as->a0name;
  
      if (!strcmp(as->name, "help"))
  	return 0;
! 
!     if (*state->cell) {
! 	cell = state->cell;
!     }
!     sec = state->sec;
! 
!     if (state->confdir == NULL) {
! 	changed = 1;
!     }
! 
!     if (as->parms[16].items) {
! 	changed = 1;
  	cell = as->parms[16].items->data;
!     }
!     if (as->parms[17].items) { /* -noauth */
! 	changed = 1;
  	sec = 0;
!     }
!     if (as->parms[20].items) { /* -localauth */
! 	changed = 1;
! 	sec = 2;
!     }
!     if (as->parms[21].items) { /* -auth */
! 	changed = 1;
! 	sec = 1;
!     }
!     if (as->parms[18].items || as->parms[20].items) {	/* -test, -localauth */
! 	changed = 1;
! 	confdir = AFSDIR_SERVER_ETC_DIRPATH;
!     } else {
! 	if (sec == 2)
! 	    confdir = AFSDIR_SERVER_ETC_DIRPATH;
! 	else 
! 	    confdir = AFSDIR_CLIENT_ETC_DIRPATH;
!     }
!     if (changed) {
! 	CleanUp(as, arock);
! 	code = pr_Initialize(sec, confdir, cell);
      } else {
! 	code = 0;
      }
      if (code) {
  	afs_com_err(whoami, code, "while initializing");
  	return code;
      }
+     state->sec = sec;
+     state->confdir = confdir;
+     if (cell && cell != state->cell)
+ 	strncpy(state->cell, cell, MAXCELLCHARS-1);
+ 
+     force = 0;
      if (as->parms[19].items)
  	force = 1;
+ 
      return code;
  }
  
  int
! CleanUp(register struct cmd_syndesc *as, void *arock)
  {
      if (as && !strcmp(as->name, "help"))
  	return 0;
***************
*** 704,710 ****
  	    pr_ListEntries(flag, startindex, &nentries, &entriesp,
  			   &nextstartindex);
  	if (code) {
! 	    afs_com_err(whoami, code, "; unable to list entries\n");
  	    if (entriesp)
  		free(entriesp);
  	    break;
--- 750,756 ----
  	    pr_ListEntries(flag, startindex, &nentries, &entriesp,
  			   &nextstartindex);
  	if (code) {
! 	    afs_com_err(whoami, code, "; unable to list entries");
  	    if (entriesp)
  		free(entriesp);
  	    break;
***************
*** 972,977 ****
--- 1018,1027 ----
      cmd_AddParm(ts, "-test", CMD_FLAG, CMD_OPTIONAL | CMD_HIDE, test_help);
      cmd_AddParm(ts, "-force", CMD_FLAG, CMD_OPTIONAL,
  		"Continue oper despite reasonable errors");
+     cmd_AddParm(ts, "-localauth", CMD_FLAG, CMD_OPTIONAL,
+ 		"use local authentication");
+     cmd_AddParm(ts, "-auth", CMD_FLAG, CMD_OPTIONAL,
+ 		"use user's authentication (default)");
  }
  
  /*
***************
*** 996,1001 ****
--- 1046,1052 ----
      int parsec;
      char *parsev[CMD_MAXPARMS];
      char *savec;
+     struct authstate state;
  
  #ifdef WIN32
      WSADATA WSAjunk;
***************
*** 1020,1026 ****
      sigaction(SIGSEGV, &nsa, NULL);
  #endif
  
!     ts = cmd_CreateSyntax("creategroup", CreateGroup, 0,
  			  "create a new group");
      cmd_AddParm(ts, "-name", CMD_LIST, 0, "group name");
      cmd_AddParm(ts, "-owner", CMD_SINGLE, CMD_OPTIONAL, "owner of the group");
--- 1071,1080 ----
      sigaction(SIGSEGV, &nsa, NULL);
  #endif
  
!     memset(&state, 0, sizeof(state));
!     state.sec = 1; /* default is auth */
! 
!     ts = cmd_CreateSyntax("creategroup", CreateGroup, NULL,
  			  "create a new group");
      cmd_AddParm(ts, "-name", CMD_LIST, 0, "group name");
      cmd_AddParm(ts, "-owner", CMD_SINGLE, CMD_OPTIONAL, "owner of the group");
***************
*** 1029,1088 ****
      add_std_args(ts);
      cmd_CreateAlias(ts, "cg");
  
!     ts = cmd_CreateSyntax("createuser", CreateUser, 0, "create a new user");
      cmd_AddParm(ts, "-name", CMD_LIST, 0, "user name");
      cmd_AddParm(ts, "-id", CMD_LIST, CMD_OPTIONAL, "user id");
      add_std_args(ts);
      cmd_CreateAlias(ts, "cu");
  
!     ts = cmd_CreateSyntax("adduser", AddToGroup, 0, "add a user to a group");
      cmd_AddParm(ts, "-user", CMD_LIST, 0, "user name");
      cmd_AddParm(ts, "-group", CMD_LIST, 0, "group name");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("removeuser", RemoveFromGroup, 0,
  			  "remove a user from a group");
      cmd_AddParm(ts, "-user", CMD_LIST, 0, "user name");
      cmd_AddParm(ts, "-group", CMD_LIST, 0, "group name");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("membership", ListMembership, 0,
  			  "list membership of a user or group");
      cmd_AddParm(ts, "-nameorid", CMD_LIST, 0, "user or group name or id");
      add_std_args(ts);
      cmd_CreateAlias(ts, "groups");
  
!     ts = cmd_CreateSyntax("delete", Delete, 0,
  			  "delete a user or group from database");
      cmd_AddParm(ts, "-nameorid", CMD_LIST, 0, "user or group name or id");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("examine", CheckEntry, 0, "examine an entry");
      cmd_AddParm(ts, "-nameorid", CMD_LIST, 0, "user or group name or id");
      add_std_args(ts);
      cmd_CreateAlias(ts, "check");
  
!     ts = cmd_CreateSyntax("chown", ChownGroup, 0,
  			  "change ownership of a group");
      cmd_AddParm(ts, "-name", CMD_SINGLE, 0, "group name");
      cmd_AddParm(ts, "-owner", CMD_SINGLE, 0, "new owner");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("rename", ChangeName, 0, "rename user or group");
      cmd_AddParm(ts, "-oldname", CMD_SINGLE, 0, "old name");
      cmd_AddParm(ts, "-newname", CMD_SINGLE, 0, "new name");
      add_std_args(ts);
      cmd_CreateAlias(ts, "chname");
  
!     ts = cmd_CreateSyntax("listmax", ListMax, 0, "list max id");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("setmax", SetMax, 0, "set max id");
      cmd_AddParm(ts, "-group", CMD_SINGLE, CMD_OPTIONAL, "group max");
      cmd_AddParm(ts, "-user", CMD_SINGLE, CMD_OPTIONAL, "user max");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("setfields", SetFields, 0,
  			  "set fields for an entry");
      cmd_AddParm(ts, "-nameorid", CMD_LIST, 0, "user or group name or id");
      cmd_AddParm(ts, "-access", CMD_SINGLE, CMD_OPTIONAL, "set privacy flags");
--- 1083,1142 ----
      add_std_args(ts);
      cmd_CreateAlias(ts, "cg");
  
!     ts = cmd_CreateSyntax("createuser", CreateUser, NULL, "create a new user");
      cmd_AddParm(ts, "-name", CMD_LIST, 0, "user name");
      cmd_AddParm(ts, "-id", CMD_LIST, CMD_OPTIONAL, "user id");
      add_std_args(ts);
      cmd_CreateAlias(ts, "cu");
  
!     ts = cmd_CreateSyntax("adduser", AddToGroup, NULL, "add a user to a group");
      cmd_AddParm(ts, "-user", CMD_LIST, 0, "user name");
      cmd_AddParm(ts, "-group", CMD_LIST, 0, "group name");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("removeuser", RemoveFromGroup, NULL,
  			  "remove a user from a group");
      cmd_AddParm(ts, "-user", CMD_LIST, 0, "user name");
      cmd_AddParm(ts, "-group", CMD_LIST, 0, "group name");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("membership", ListMembership, NULL,
  			  "list membership of a user or group");
      cmd_AddParm(ts, "-nameorid", CMD_LIST, 0, "user or group name or id");
      add_std_args(ts);
      cmd_CreateAlias(ts, "groups");
  
!     ts = cmd_CreateSyntax("delete", Delete, NULL,
  			  "delete a user or group from database");
      cmd_AddParm(ts, "-nameorid", CMD_LIST, 0, "user or group name or id");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("examine", CheckEntry, NULL, "examine an entry");
      cmd_AddParm(ts, "-nameorid", CMD_LIST, 0, "user or group name or id");
      add_std_args(ts);
      cmd_CreateAlias(ts, "check");
  
!     ts = cmd_CreateSyntax("chown", ChownGroup, NULL,
  			  "change ownership of a group");
      cmd_AddParm(ts, "-name", CMD_SINGLE, 0, "group name");
      cmd_AddParm(ts, "-owner", CMD_SINGLE, 0, "new owner");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("rename", ChangeName, NULL, "rename user or group");
      cmd_AddParm(ts, "-oldname", CMD_SINGLE, 0, "old name");
      cmd_AddParm(ts, "-newname", CMD_SINGLE, 0, "new name");
      add_std_args(ts);
      cmd_CreateAlias(ts, "chname");
  
!     ts = cmd_CreateSyntax("listmax", ListMax, NULL, "list max id");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("setmax", SetMax, NULL, "set max id");
      cmd_AddParm(ts, "-group", CMD_SINGLE, CMD_OPTIONAL, "group max");
      cmd_AddParm(ts, "-user", CMD_SINGLE, CMD_OPTIONAL, "user max");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("setfields", SetFields, NULL,
  			  "set fields for an entry");
      cmd_AddParm(ts, "-nameorid", CMD_LIST, 0, "user or group name or id");
      cmd_AddParm(ts, "-access", CMD_SINGLE, CMD_OPTIONAL, "set privacy flags");
***************
*** 1094,1135 ****
  #endif
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("listowned", ListOwned, 0,
  			  "list groups owned by an entry or zero id gets orphaned groups");
      cmd_AddParm(ts, "-nameorid", CMD_LIST, 0, "user or group name or id");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("listentries", ListEntries, 0,
  			  "list users/groups in the protection database");
      cmd_AddParm(ts, "-users", CMD_FLAG, CMD_OPTIONAL, "list user entries");
      cmd_AddParm(ts, "-groups", CMD_FLAG, CMD_OPTIONAL, "list group entries");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("interactive", pts_Interactive, 0,
  			  "enter interactive mode");
      add_std_args(ts);
      cmd_CreateAlias(ts, "in");
  
!     ts = cmd_CreateSyntax("quit", pts_Quit, 0, "exit program");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("source", pts_Source, 0, "read commands from file");
      cmd_AddParm(ts, "-file", CMD_SINGLE, 0, "filename");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("sleep", pts_Sleep, 0, "pause for a bit");
      cmd_AddParm(ts, "-delay", CMD_SINGLE, 0, "seconds");
      add_std_args(ts);
  
!     cmd_SetBeforeProc(GetGlobals, 0);
  
      finished = 1;
      if (code = cmd_Dispatch(argc, argv)) {
! 	CleanUp(0);
  	exit(1);
      }
!     source = stdin;
!     while (!finished) {
  	if (isatty(fileno(source)))
  	    fprintf(stderr, "pts> ");
  	if (!fgets(line, sizeof line, source)) {
--- 1148,1189 ----
  #endif
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("listowned", ListOwned, NULL,
  			  "list groups owned by an entry or zero id gets orphaned groups");
      cmd_AddParm(ts, "-nameorid", CMD_LIST, 0, "user or group name or id");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("listentries", ListEntries, NULL,
  			  "list users/groups in the protection database");
      cmd_AddParm(ts, "-users", CMD_FLAG, CMD_OPTIONAL, "list user entries");
      cmd_AddParm(ts, "-groups", CMD_FLAG, CMD_OPTIONAL, "list group entries");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("interactive", pts_Interactive, NULL,
  			  "enter interactive mode");
      add_std_args(ts);
      cmd_CreateAlias(ts, "in");
  
!     ts = cmd_CreateSyntax("quit", pts_Quit, NULL, "exit program");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("source", pts_Source, NULL, "read commands from file");
      cmd_AddParm(ts, "-file", CMD_SINGLE, 0, "filename");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("sleep", pts_Sleep, NULL, "pause for a bit");
      cmd_AddParm(ts, "-delay", CMD_SINGLE, 0, "seconds");
      add_std_args(ts);
  
!     cmd_SetBeforeProc(GetGlobals, &state);
  
      finished = 1;
+     source = NULL;
      if (code = cmd_Dispatch(argc, argv)) {
! 	CleanUp(NULL, NULL);
  	exit(1);
      }
!     while (source && !finished) {
  	if (isatty(fileno(source)))
  	    fprintf(stderr, "pts> ");
  	if (!fgets(line, sizeof line, source)) {
***************
*** 1160,1166 ****
  	parsev[0] = savec;
  	cmd_FreeArgv(parsev);
      }
!     CleanUp(0);
      exit(0);
  }
  
--- 1214,1220 ----
  	parsev[0] = savec;
  	cmd_FreeArgv(parsev);
      }
!     CleanUp(NULL, NULL);
      exit(0);
  }
  
Index: openafs/src/ptserver/ptserver.c
diff -c openafs/src/ptserver/ptserver.c:1.21.2.8 openafs/src/ptserver/ptserver.c:1.21.2.11
*** openafs/src/ptserver/ptserver.c:1.21.2.8	Tue Apr 10 14:43:45 2007
--- openafs/src/ptserver/ptserver.c	Sun Feb  3 22:53:58 2008
***************
*** 113,119 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/ptserver.c,v 1.21.2.8 2007/04/10 18:43:45 shadow Exp $");
  
  #include <afs/stds.h>
  #ifdef	AFS_AIX32_ENV
--- 113,119 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/ptserver.c,v 1.21.2.11 2008/02/04 03:53:58 jaltman Exp $");
  
  #include <afs/stds.h>
  #ifdef	AFS_AIX32_ENV
***************
*** 130,142 ****
  #include <netdb.h>
  #include <netinet/in.h>
  #endif
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <rx/xdr.h>
  #include <rx/rx.h>
  #include <rx/rx_globals.h>
--- 130,136 ----
***************
*** 170,175 ****
--- 164,170 ----
  int restricted = 0;
  int rxMaxMTU = -1;
  int rxBind = 0;
+ int rxkadDisableDotCheck = 0;
  
  #define ADDRSPERSITE 16         /* Same global is in rx/rx_user.c */
  afs_uint32 SHostAddrs[ADDRSPERSITE];
***************
*** 315,320 ****
--- 310,318 ----
  	else if (strncmp(arg, "-rxbind", alen) == 0) {
  	    rxBind = 1;
  	}
+ 	else if (strncmp(arg, "-allow-dotted-principals", alen) == 0) {
+ 	    rxkadDisableDotCheck = 1;
+ 	}
  	else if (strncmp(arg, "-enable_peer_stats", alen) == 0) {
  	    rx_enablePeerRPCStats();
  	} else if (strncmp(arg, "-enable_process_stats", alen) == 0) {
***************
*** 368,374 ****
  	    rxMaxMTU = atoi(argv[++a]);
  	    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);
  		PT_EXIT(1);
--- 366,372 ----
  	    rxMaxMTU = atoi(argv[++a]);
  	    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);
  		PT_EXIT(1);
***************
*** 385,390 ****
--- 383,389 ----
  		   "[-p <number of processes>] [-rebuild] "
  		   "[-groupdepth <depth>] "
  		   "[-restricted] [-rxmaxmtu <bytes>] [-rxbind] "
+ 		   "[-allow-dotted-principals] "
  		   "[-enable_peer_stats] [-enable_process_stats] "
  		   "[-default_access default_user_access default_group_access] "
  		   "[-help]\n");
***************
*** 392,397 ****
--- 391,397 ----
  	    printf("Usage: ptserver [-database <db path>] "
  		   "[-auditlog <log path>] "
  		   "[-p <number of processes>] [-rebuild] [-rxbind] "
+ 		   "[-allow-dotted-principals] "
  		   "[-default_access default_user_access default_group_access] "
  		   "[-restricted] [-rxmaxmtu <bytes>] [-rxbind] "
  		   "[-groupdepth <depth>] " "[-help]\n");
***************
*** 405,416 ****
--- 405,418 ----
  		   "[-enable_peer_stats] [-enable_process_stats] "
  		   "[-default_access default_user_access default_group_access] "
  		   "[-restricted] [-rxmaxmtu <bytes>] [-rxbind] "
+ 		   "[-allow-dotted-principals] "
  		   "[-help]\n");
  #else /* AFS_NT40_ENV */
  	    printf("Usage: ptserver [-database <db path>] "
  		   "[-auditlog <log path>] "
  		   "[-default_access default_user_access default_group_access] "
  		   "[-restricted] [-rxmaxmtu <bytes>] [-rxbind] "
+ 		   "[-allow-dotted-principals] "
  		   "[-p <number of processes>] [-rebuild] " "[-help]\n");
  #endif
  #endif
***************
*** 559,564 ****
--- 561,571 ----
      }
      rx_SetMinProcs(tservice, 2);
      rx_SetMaxProcs(tservice, lwps);
+     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", sc, 3,
Index: openafs/src/ptserver/ptuser.c
diff -c openafs/src/ptserver/ptuser.c:1.16.2.15 openafs/src/ptserver/ptuser.c:1.16.2.17
*** openafs/src/ptserver/ptuser.c:1.16.2.15	Tue Apr 10 14:43:45 2007
--- openafs/src/ptserver/ptuser.c	Mon Feb  4 12:53:56 2008
***************
*** 15,21 ****
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/ptuser.c,v 1.16.2.15 2007/04/10 18:43:45 shadow Exp $");
  
  #if defined(UKERNEL)
  #include "afs/sysincludes.h"
--- 15,21 ----
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/ptuser.c,v 1.16.2.17 2008/02/04 17:53:56 shadow Exp $");
  
  #if defined(UKERNEL)
  #include "afs/sysincludes.h"
***************
*** 41,53 ****
  #include <netinet/in.h>
  #endif
  #include <stdio.h>
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <rx/rx.h>
  #include <rx/xdr.h>
  #include <rx/rxkad.h>
--- 41,47 ----
***************
*** 99,109 ****
  	if (!tdir) {
  	    if (confDir && strcmp(confDir, ""))
  		fprintf(stderr,
! 			"libprot: Could not open configuration directory: %s.\n",
! 			confDir);
              else
  		fprintf(stderr,
! 			"libprot: No configuration directory specified.\n");
  	    return -1;
  	}
          gottdir = 1;
--- 93,104 ----
  	if (!tdir) {
  	    if (confDir && strcmp(confDir, ""))
  		fprintf(stderr,
! 			"%s: Could not open configuration directory: %s.\n",
! 			whoami, confDir);
              else
  		fprintf(stderr,
! 			"%s: No configuration directory specified.\n",
! 			whoami);
  	    return -1;
  	}
          gottdir = 1;
***************
*** 181,196 ****
      /* Most callers use secLevel==1, however, the fileserver uses secLevel==2
       * to force use of the KeyFile.  secLevel == 0 implies -noauth was
       * specified. */
!     if ((secLevel == 2) && (afsconf_GetLatestKey(tdir, 0, 0) == 0)) {
! 	/* If secLevel is two assume we're on a file server and use
! 	 * ClientAuthSecure if possible. */
! 	code = afsconf_ClientAuthSecure(tdir, &sc[2], &scIndex);
! 	if (code)
! 	    fprintf(stderr,
! 		    "libprot: clientauthsecure returns %d %s"
! 		    " (so trying noauth)\n", code, afs_error_message(code));
! 	if (code)
! 	    scIndex = 0;	/* use noauth */
  	if (scIndex != 2)
  	    /* if there was a problem, an unauthenticated conn is returned */
  	    sc[scIndex] = sc[2];
--- 176,197 ----
      /* Most callers use secLevel==1, however, the fileserver uses secLevel==2
       * to force use of the KeyFile.  secLevel == 0 implies -noauth was
       * specified. */
!     if (secLevel == 2) {
! 	code = afsconf_GetLatestKey(tdir, 0, 0);
! 	if (code) {
! 	    afs_com_err(whoami, code, 
! 			"(getting key from local KeyFile)\n");
! 	    scIndex = 0; /* use noauth */
! 	} else {
! 	    /* If secLevel is two assume we're on a file server and use
! 	     * ClientAuthSecure if possible. */
! 	    code = afsconf_ClientAuthSecure(tdir, &sc[2], &scIndex);
! 	    if (code) {
! 		afs_com_err(whoami, code,
! 			    "(calling client secure)\n");
! 		scIndex = 0;	/* use noauth */
! 	    }
!         }
  	if (scIndex != 2)
  	    /* if there was a problem, an unauthenticated conn is returned */
  	    sc[scIndex] = sc[2];
***************
*** 200,215 ****
  	sname.instance[0] = 0;
  	strcpy(sname.name, "afs");
  	code = ktc_GetToken(&sname, &ttoken, sizeof(ttoken), NULL);
! 	if (code)
  	    scIndex = 0;
! 	else {
  	    if (ttoken.kvno >= 0 && ttoken.kvno <= 256)
  		/* this is a kerberos ticket, set scIndex accordingly */
  		scIndex = 2;
  	    else {
  		fprintf(stderr,
! 			"libprot: funny kvno (%d) in ticket, proceeding\n",
! 			ttoken.kvno);
  		scIndex = 2;
  	    }
  	    sc[2] =
--- 201,217 ----
  	sname.instance[0] = 0;
  	strcpy(sname.name, "afs");
  	code = ktc_GetToken(&sname, &ttoken, sizeof(ttoken), NULL);
! 	if (code) {
! 	    afs_com_err(whoami, code, "(getting token)");
  	    scIndex = 0;
! 	} else {
  	    if (ttoken.kvno >= 0 && ttoken.kvno <= 256)
  		/* this is a kerberos ticket, set scIndex accordingly */
  		scIndex = 2;
  	    else {
  		fprintf(stderr,
! 			"%s: funny kvno (%d) in ticket, proceeding\n",
! 			whoami, ttoken.kvno);
  		scIndex = 2;
  	    }
  	    sc[2] =
***************
*** 224,231 ****
      if ((scIndex == 0) && (sc[0] == 0))
  	sc[0] = rxnull_NewClientSecurityObject();
      if ((scIndex == 0) && (secLevel != 0))
! 	afs_com_err(whoami, code,
! 		"Could not get afs tokens, running unauthenticated.");
  
      memset(serverconns, 0, sizeof(serverconns));	/* terminate list!!! */
      for (i = 0; i < info.numServers; i++)
--- 226,234 ----
      if ((scIndex == 0) && (sc[0] == 0))
  	sc[0] = rxnull_NewClientSecurityObject();
      if ((scIndex == 0) && (secLevel != 0))
! 	fprintf(stderr,
! 		"%s: Could not get afs tokens, running unauthenticated\n",
! 		whoami);
  
      memset(serverconns, 0, sizeof(serverconns));	/* terminate list!!! */
      for (i = 0; i < info.numServers; i++)
Index: openafs/src/ptserver/ptutils.c
diff -c openafs/src/ptserver/ptutils.c:1.18.2.4 openafs/src/ptserver/ptutils.c:1.18.2.5
*** openafs/src/ptserver/ptutils.c:1.18.2.4	Sat Aug 11 19:50:02 2007
--- openafs/src/ptserver/ptutils.c	Tue Oct 30 11:24:03 2007
***************
*** 24,30 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/ptutils.c,v 1.18.2.4 2007/08/11 23:50:02 jaltman Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 24,30 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/ptutils.c,v 1.18.2.5 2007/10/30 15:24:03 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 34,46 ****
  #else
  #include <netinet/in.h>
  #endif
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <lock.h>
  #include <ubik.h>
  #include <rx/xdr.h>
--- 34,40 ----
Index: openafs/src/ptserver/readgroup.c
diff -c openafs/src/ptserver/readgroup.c:1.10.2.1 openafs/src/ptserver/readgroup.c:1.10.2.3
*** openafs/src/ptserver/readgroup.c:1.10.2.1	Tue Apr 10 14:43:45 2007
--- openafs/src/ptserver/readgroup.c	Mon Nov 26 16:21:54 2007
***************
*** 11,30 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/readgroup.c,v 1.10.2.1 2007/04/10 18:43:45 shadow Exp $");
  
  #include <stdio.h>
  #ifdef AFS_NT40_ENV
  #include <WINNT/afsevent.h>
  #endif
  #include <ctype.h>
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <rx/rx.h>
  #include <rx/xdr.h>
  #include <afs/cellconfig.h>
--- 11,24 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/readgroup.c,v 1.10.2.3 2007/11/26 21:21:54 shadow Exp $");
  
  #include <stdio.h>
  #ifdef AFS_NT40_ENV
  #include <WINNT/afsevent.h>
  #endif
  #include <ctype.h>
  #include <string.h>
  #include <rx/rx.h>
  #include <rx/xdr.h>
  #include <afs/cellconfig.h>
***************
*** 212,217 ****
--- 206,212 ----
  	    }
  	}
      }
+     return 0;
  }
  
  void
Index: openafs/src/ptserver/readpwd.c
diff -c openafs/src/ptserver/readpwd.c:1.9.2.1 openafs/src/ptserver/readpwd.c:1.9.2.3
*** openafs/src/ptserver/readpwd.c:1.9.2.1	Tue Apr 10 14:43:45 2007
--- openafs/src/ptserver/readpwd.c	Mon Nov 26 16:21:54 2007
***************
*** 11,29 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/readpwd.c,v 1.9.2.1 2007/04/10 18:43:45 shadow Exp $");
  
  #include <stdio.h>
  #ifdef AFS_NT40_ENV
  #include <WINNT/afsevent.h>
  #endif
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <rx/rx.h>
  #include <rx/xdr.h>
  #include <afs/cellconfig.h>
--- 11,23 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/readpwd.c,v 1.9.2.3 2007/11/26 21:21:54 shadow Exp $");
  
  #include <stdio.h>
  #ifdef AFS_NT40_ENV
  #include <WINNT/afsevent.h>
  #endif
  #include <string.h>
  #include <rx/rx.h>
  #include <rx/xdr.h>
  #include <afs/cellconfig.h>
***************
*** 105,108 ****
--- 99,103 ----
  	    fprintf(stderr, "%s (%d).\n", pr_ErrorMsg(code), code);
  	}
      }
+     return 0;
  }
Index: openafs/src/ptserver/testpt.c
diff -c openafs/src/ptserver/testpt.c:1.14.2.2 openafs/src/ptserver/testpt.c:1.14.2.4
*** openafs/src/ptserver/testpt.c:1.14.2.2	Sat Aug 11 19:50:02 2007
--- openafs/src/ptserver/testpt.c	Wed Oct 31 00:13:43 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/testpt.c,v 1.14.2.2 2007/08/11 23:50:02 jaltman Exp $");
  
  #include <ctype.h>
  #include <errno.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/testpt.c,v 1.14.2.4 2007/10/31 04:13:43 shadow Exp $");
  
  #include <ctype.h>
  #include <errno.h>
***************
*** 24,36 ****
  #include <netdb.h>
  #include <netinet/in.h>
  #endif
- #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
--- 24,30 ----
***************
*** 57,63 ****
  static char lcell[MAXCELLCHARS];
  
  int
! ListUsedIds(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      namelist lnames;
--- 51,57 ----
  static char lcell[MAXCELLCHARS];
  
  int
! ListUsedIds(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      namelist lnames;
***************
*** 410,416 ****
  }
  
  int
! TestManyMembers(struct cmd_syndesc *as, char *arock)
  {
      char *filled;		/* users filled up */
      char *cleaned;		/* users cleaned up */
--- 404,410 ----
  }
  
  int
! TestManyMembers(struct cmd_syndesc *as, void *arock)
  {
      char *filled;		/* users filled up */
      char *cleaned;		/* users cleaned up */
***************
*** 767,773 ****
   */
  
  int
! TestPrServ(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 id;
      char name[PR_MAXNAMELEN + 1];
--- 761,767 ----
   */
  
  int
! TestPrServ(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 id;
      char name[PR_MAXNAMELEN + 1];
***************
*** 913,919 ****
  static char tmp_noauth_file[128] = "";
  
  static int
! MyAfterProc(struct cmd_syndesc *as, char *arock)
  {
      if (strlen(tmp_conf_file))
  	unlink(tmp_conf_file);
--- 907,913 ----
  static char tmp_noauth_file[128] = "";
  
  static int
! MyAfterProc(struct cmd_syndesc *as, void *arock)
  {
      if (strlen(tmp_conf_file))
  	unlink(tmp_conf_file);
***************
*** 927,933 ****
  }
  
  static int
! MyBeforeProc(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      int i;
--- 921,927 ----
  }
  
  static int
! MyBeforeProc(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      int i;
***************
*** 1109,1115 ****
      cmd_SetBeforeProc(MyBeforeProc, NULL);
      cmd_SetAfterProc(MyAfterProc, NULL);
  
!     ts = cmd_CreateSyntax("usedIds", ListUsedIds, 0,
  			  "Find used (or unused) user (or group) ids");
      cmd_AddParm(ts, "-startId", CMD_SINGLE, CMD_OPTIONAL,
  		"id to start checking");
--- 1103,1109 ----
      cmd_SetBeforeProc(MyBeforeProc, NULL);
      cmd_SetAfterProc(MyAfterProc, NULL);
  
!     ts = cmd_CreateSyntax("usedIds", ListUsedIds, NULL,
  			  "Find used (or unused) user (or group) ids");
      cmd_AddParm(ts, "-startId", CMD_SINGLE, CMD_OPTIONAL,
  		"id to start checking");
***************
*** 1118,1127 ****
      cmd_AddParm(ts, "-unused", CMD_FLAG, CMD_OPTIONAL, "print unused ids");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("initcmd", TestPrServ, 0, "test the prserver");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("testmanymembers", TestManyMembers, 0,
  			  "test creating users and groups w/ many members");
      cmd_AddParm(ts, "-number", CMD_SINGLE, 0,
  		"number of users/groups to create");
--- 1112,1121 ----
      cmd_AddParm(ts, "-unused", CMD_FLAG, CMD_OPTIONAL, "print unused ids");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("initcmd", TestPrServ, NULL, "test the prserver");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("testmanymembers", TestManyMembers, NULL,
  			  "test creating users and groups w/ many members");
      cmd_AddParm(ts, "-number", CMD_SINGLE, 0,
  		"number of users/groups to create");
Index: openafs/src/ptserver/ubik.c
diff -c openafs/src/ptserver/ubik.c:1.7.2.1 openafs/src/ptserver/ubik.c:1.7.2.2
*** openafs/src/ptserver/ubik.c:1.7.2.1	Thu Mar  9 01:41:54 2006
--- openafs/src/ptserver/ubik.c	Tue Oct 30 11:24:03 2007
***************
*** 1,21 ****
! /* $Id: ubik.c,v 1.7.2.1 2006/03/09 06:41:54 shadow Exp $ */
  
  #include <afsconfig.h>
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/ubik.c,v 1.7.2.1 2006/03/09 06:41:54 shadow Exp $");
  
  #include <sys/types.h>
  #include <netinet/in.h>
- 
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  
  #include <lock.h>
  #define UBIK_INTERNALS
--- 1,14 ----
! /* $Id: ubik.c,v 1.7.2.2 2007/10/30 15:24:03 shadow Exp $ */
  
  #include <afsconfig.h>
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/ubik.c,v 1.7.2.2 2007/10/30 15:24:03 shadow Exp $");
  
  #include <sys/types.h>
  #include <netinet/in.h>
  #include <string.h>
  
  #include <lock.h>
  #define UBIK_INTERNALS
Index: openafs/src/ptserver/utils.c
diff -c openafs/src/ptserver/utils.c:1.15 openafs/src/ptserver/utils.c:1.15.2.2
*** openafs/src/ptserver/utils.c:1.15	Wed Jun 23 10:27:42 2004
--- openafs/src/ptserver/utils.c	Mon Feb  4 12:53:56 2008
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/utils.c,v 1.15 2004/06/23 14:27:42 shadow Exp $");
  
  #include <sys/types.h>
  #include <lock.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/utils.c,v 1.15.2.2 2008/02/04 17:53:56 shadow Exp $");
  
  #include <sys/types.h>
  #include <lock.h>
***************
*** 23,35 ****
  #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 "ptserver.h"
  #include "pterror.h"
  
--- 23,29 ----
***************
*** 830,835 ****
--- 824,832 ----
  	return 1;
      if (gid == AUTHUSERID && aid != ANONYMOUSID)
  	return 1;
+     /* check -localauth case */
+     if (gid == SYSADMINID && aid == SYSADMINID)
+         return 1;
      if ((gid == 0) || (aid == 0))
  	return 0;
  #if defined(SUPERGROUPS)
Index: openafs/src/rx/rx.c
diff -c openafs/src/rx/rx.c:1.58.2.39 openafs/src/rx/rx.c:1.58.2.45
*** openafs/src/rx/rx.c:1.58.2.39	Wed May 16 16:46:47 2007
--- openafs/src/rx/rx.c	Mon Mar 17 13:57:41 2008
***************
*** 17,23 ****
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx.c,v 1.58.2.39 2007/05/16 20:46:47 shadow Exp $");
  
  #ifdef KERNEL
  #include "afs/sysincludes.h"
--- 17,23 ----
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx.c,v 1.58.2.45 2008/03/17 17:57:41 shadow Exp $");
  
  #ifdef KERNEL
  #include "afs/sysincludes.h"
***************
*** 79,84 ****
--- 79,85 ----
  # include "rxgen_consts.h"
  #else /* KERNEL */
  # include <sys/types.h>
+ # include <string.h>
  # include <errno.h>
  #ifdef AFS_NT40_ENV
  # include <stdlib.h>
***************
*** 92,104 ****
  # include <netinet/in.h>
  # include <sys/time.h>
  #endif
- #ifdef HAVE_STRING_H
- #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  # include "rx.h"
  # include "rx_user.h"
  # include "rx_clock.h"
--- 93,98 ----
***************
*** 724,730 ****
  	    (*registerProgram) (pid, name);
  #endif /* KERNEL */
  #endif /* AFS_NT40_ENV */
! 	rx_ServerProc();	/* Never returns */
      }
  #ifdef RX_ENABLE_TSFPQ
      /* no use leaving packets around in this thread's local queue if
--- 718,724 ----
  	    (*registerProgram) (pid, name);
  #endif /* KERNEL */
  #endif /* AFS_NT40_ENV */
! 	rx_ServerProc(NULL);	/* Never returns */
      }
  #ifdef RX_ENABLE_TSFPQ
      /* no use leaving packets around in this thread's local queue if
***************
*** 769,777 ****
      conn->peer = rxi_FindPeer(shost, sport, 0, 1);
      conn->serviceId = sservice;
      conn->securityObject = securityObject;
!     /* This doesn't work in all compilers with void (they're buggy), so fake it
!      * with VOID */
!     conn->securityData = (VOID *) 0;
      conn->securityIndex = serviceSecurityIndex;
      rx_SetConnDeadTime(conn, rx_connDeadTime);
      conn->ackRate = RX_FAST_ACK_RATE;
--- 763,769 ----
      conn->peer = rxi_FindPeer(shost, sport, 0, 1);
      conn->serviceId = sservice;
      conn->securityObject = securityObject;
!     conn->securityData = (void *) 0;
      conn->securityIndex = serviceSecurityIndex;
      rx_SetConnDeadTime(conn, rx_connDeadTime);
      conn->ackRate = RX_FAST_ACK_RATE;
***************
*** 1348,1353 ****
--- 1340,1362 ----
      return 0;
  }
  
+ /* Set configuration options for all of a service's security objects */
+ 
+ afs_int32 
+ rx_SetSecurityConfiguration(struct rx_service *service, 
+ 			    rx_securityConfigVariables type,
+ 			    void *value)
+ {
+     int i;
+     for (i = 0; i<service->nSecurityObjects; i++) {
+ 	if (service->securityObjects[i]) {
+ 	    RXS_SetConfiguration(service->securityObjects[i], NULL, type, 
+ 				 value, NULL);
+ 	}
+     }
+     return 0;
+ }
+ 
  struct rx_service *
  rx_NewService(u_short port, u_short serviceId, char *serviceName,
  	      struct rx_securityClass **securityObjects, int nSecurityObjects,
***************
*** 1827,1835 ****
  void
  rx_SetArrivalProc(register struct rx_call *call,
  		  register void (*proc) (register struct rx_call * call,
! 					register VOID * mh,
  					register int index),
! 		  register VOID * handle, register int arg)
  {
      call->arrivalProc = proc;
      call->arrivalProcHandle = handle;
--- 1836,1844 ----
  void
  rx_SetArrivalProc(register struct rx_call *call,
  		  register void (*proc) (register struct rx_call * call,
! 					register void * mh,
  					register int index),
! 		  register void * handle, register int arg)
  {
      call->arrivalProc = proc;
      call->arrivalProcHandle = handle;
***************
*** 2979,2985 ****
  		    struct rx_call *acall)
  {
      struct rx_call *call = acall;
!     struct clock when;
      int i, waiting;
  
      MUTEX_ENTER(&conn->conn_data_lock);
--- 2988,2994 ----
  		    struct rx_call *acall)
  {
      struct rx_call *call = acall;
!     struct clock when, now;
      int i, waiting;
  
      MUTEX_ENTER(&conn->conn_data_lock);
***************
*** 3018,3030 ****
  	    if (call != acall)
  		MUTEX_EXIT(&call->lock);
  
! 	    clock_GetTime(&when);
  	    when.sec += RX_CHECKREACH_TIMEOUT;
  	    MUTEX_ENTER(&conn->conn_data_lock);
  	    if (!conn->checkReachEvent) {
  		conn->refCount++;
  		conn->checkReachEvent =
! 		    rxevent_Post(&when, rxi_CheckReachEvent, conn, NULL);
  	    }
  	    MUTEX_EXIT(&conn->conn_data_lock);
  	}
--- 3027,3041 ----
  	    if (call != acall)
  		MUTEX_EXIT(&call->lock);
  
! 	    clock_GetTime(&now);
! 	    when = now;
  	    when.sec += RX_CHECKREACH_TIMEOUT;
  	    MUTEX_ENTER(&conn->conn_data_lock);
  	    if (!conn->checkReachEvent) {
  		conn->refCount++;
  		conn->checkReachEvent =
! 		    rxevent_PostNow(&when, &now, rxi_CheckReachEvent, conn, 
! 				    NULL);
  	    }
  	    MUTEX_EXIT(&conn->conn_data_lock);
  	}
***************
*** 3101,3107 ****
      afs_uint32 seq, serial, flags;
      int isFirst;
      struct rx_packet *tnp;
!     struct clock when;
      MUTEX_ENTER(&rx_stats_mutex);
      rx_stats.dataPacketsRead++;
      MUTEX_EXIT(&rx_stats_mutex);
--- 3112,3118 ----
      afs_uint32 seq, serial, flags;
      int isFirst;
      struct rx_packet *tnp;
!     struct clock when, now;
      MUTEX_ENTER(&rx_stats_mutex);
      rx_stats.dataPacketsRead++;
      MUTEX_EXIT(&rx_stats_mutex);
***************
*** 3122,3128 ****
  	dpf(("packet %x dropped on receipt - quota problems", np));
  	if (rxi_doreclaim)
  	    rxi_ClearReceiveQueue(call);
! 	clock_GetTime(&when);
  	clock_Add(&when, &rx_softAckDelay);
  	if (!call->delayedAckEvent
  	    || clock_Gt(&call->delayedAckEvent->eventTime, &when)) {
--- 3133,3140 ----
  	dpf(("packet %x dropped on receipt - quota problems", np));
  	if (rxi_doreclaim)
  	    rxi_ClearReceiveQueue(call);
! 	clock_GetTime(&now);
! 	when = now;
  	clock_Add(&when, &rx_softAckDelay);
  	if (!call->delayedAckEvent
  	    || clock_Gt(&call->delayedAckEvent->eventTime, &when)) {
***************
*** 3130,3136 ****
  			   RX_CALL_REFCOUNT_DELAY);
  	    CALL_HOLD(call, RX_CALL_REFCOUNT_DELAY);
  	    call->delayedAckEvent =
! 		rxevent_Post(&when, rxi_SendDelayedAck, call, 0);
  	}
  	/* we've damaged this call already, might as well do it in. */
  	return np;
--- 3142,3148 ----
  			   RX_CALL_REFCOUNT_DELAY);
  	    CALL_HOLD(call, RX_CALL_REFCOUNT_DELAY);
  	    call->delayedAckEvent =
! 		rxevent_PostNow(&when, &now, rxi_SendDelayedAck, call, 0);
  	}
  	/* we've damaged this call already, might as well do it in. */
  	return np;
***************
*** 3408,3414 ****
  	rxevent_Cancel(call->delayedAckEvent, call, RX_CALL_REFCOUNT_DELAY);
  	np = rxi_SendAck(call, np, serial, RX_ACK_IDLE, istack);
      } else if (call->nSoftAcks) {
! 	clock_GetTime(&when);
  	if (haveLast && !(flags & RX_CLIENT_INITIATED)) {
  	    clock_Add(&when, &rx_lastAckDelay);
  	} else {
--- 3420,3427 ----
  	rxevent_Cancel(call->delayedAckEvent, call, RX_CALL_REFCOUNT_DELAY);
  	np = rxi_SendAck(call, np, serial, RX_ACK_IDLE, istack);
      } else if (call->nSoftAcks) {
! 	clock_GetTime(&now);
! 	when = now;
  	if (haveLast && !(flags & RX_CLIENT_INITIATED)) {
  	    clock_Add(&when, &rx_lastAckDelay);
  	} else {
***************
*** 3420,3426 ****
  			   RX_CALL_REFCOUNT_DELAY);
  	    CALL_HOLD(call, RX_CALL_REFCOUNT_DELAY);
  	    call->delayedAckEvent =
! 		rxevent_Post(&when, rxi_SendDelayedAck, call, 0);
  	}
      } else if (call->flags & RX_CALL_RECEIVE_DONE) {
  	rxevent_Cancel(call->delayedAckEvent, call, RX_CALL_REFCOUNT_DELAY);
--- 3433,3439 ----
  			   RX_CALL_REFCOUNT_DELAY);
  	    CALL_HOLD(call, RX_CALL_REFCOUNT_DELAY);
  	    call->delayedAckEvent =
! 		rxevent_PostNow(&when, &now, rxi_SendDelayedAck, call, 0);
  	}
      } else if (call->flags & RX_CALL_RECEIVE_DONE) {
  	rxevent_Cancel(call->delayedAckEvent, call, RX_CALL_REFCOUNT_DELAY);
***************
*** 3811,3819 ****
  	    call->nNacks = nNacked;
  	}
      } else {
! 	if (newAckCount) {
! 	    call->nAcks++;
! 	}
  	call->nNacks = 0;
      }
  
--- 3824,3830 ----
  	    call->nNacks = nNacked;
  	}
      } else {
! 	call->nAcks += newAckCount;
  	call->nNacks = 0;
      }
  
***************
*** 4247,4253 ****
  		  int istack, int force)
  {
      afs_int32 error;
!     struct clock when;
  
      if (!call->error)
  	return packet;
--- 4258,4264 ----
  		  int istack, int force)
  {
      afs_int32 error;
!     struct clock when, now;
  
      if (!call->error)
  	return packet;
***************
*** 4273,4283 ****
  	    rxi_SendSpecial(call, call->conn, packet, RX_PACKET_TYPE_ABORT,
  			    (char *)&error, sizeof(error), istack);
      } else if (!call->delayedAbortEvent) {
! 	clock_GetTime(&when);
  	clock_Addmsec(&when, rxi_callAbortDelay);
  	CALL_HOLD(call, RX_CALL_REFCOUNT_ABORT);
  	call->delayedAbortEvent =
! 	    rxevent_Post(&when, rxi_SendDelayedCallAbort, call, 0);
      }
      return packet;
  }
--- 4284,4295 ----
  	    rxi_SendSpecial(call, call->conn, packet, RX_PACKET_TYPE_ABORT,
  			    (char *)&error, sizeof(error), istack);
      } else if (!call->delayedAbortEvent) {
! 	clock_GetTime(&now);
! 	when = now;
  	clock_Addmsec(&when, rxi_callAbortDelay);
  	CALL_HOLD(call, RX_CALL_REFCOUNT_ABORT);
  	call->delayedAbortEvent =
! 	    rxevent_PostNow(&when, &now, rxi_SendDelayedCallAbort, call, 0);
      }
      return packet;
  }
***************
*** 4296,4302 ****
  			struct rx_packet *packet, int istack, int force)
  {
      afs_int32 error;
!     struct clock when;
  
      if (!conn->error)
  	return packet;
--- 4308,4314 ----
  			struct rx_packet *packet, int istack, int force)
  {
      afs_int32 error;
!     struct clock when, now;
  
      if (!conn->error)
  	return packet;
***************
*** 4319,4328 ****
  			    sizeof(error), istack);
  	MUTEX_ENTER(&conn->conn_data_lock);
      } else if (!conn->delayedAbortEvent) {
! 	clock_GetTime(&when);
  	clock_Addmsec(&when, rxi_connAbortDelay);
  	conn->delayedAbortEvent =
! 	    rxevent_Post(&when, rxi_SendDelayedConnAbort, conn, 0);
      }
      return packet;
  }
--- 4331,4341 ----
  			    sizeof(error), istack);
  	MUTEX_ENTER(&conn->conn_data_lock);
      } else if (!conn->delayedAbortEvent) {
! 	clock_GetTime(&now);
! 	when = now;
  	clock_Addmsec(&when, rxi_connAbortDelay);
  	conn->delayedAbortEvent =
! 	    rxevent_PostNow(&when, &now, rxi_SendDelayedConnAbort, conn, 0);
      }
      return packet;
  }
***************
*** 4989,4995 ****
      struct rx_packet *p;
      register struct rx_packet *nxp;	/* Next pointer for queue_Scan */
      struct rx_peer *peer = call->conn->peer;
!     struct clock now, retryTime;
      int haveEvent;
      int nXmitPackets;
      int maxXmitPackets;
--- 5002,5008 ----
      struct rx_packet *p;
      register struct rx_packet *nxp;	/* Next pointer for queue_Scan */
      struct rx_peer *peer = call->conn->peer;
!     struct clock now, usenow, retryTime;
      int haveEvent;
      int nXmitPackets;
      int maxXmitPackets;
***************
*** 5061,5073 ****
  	 * in this burst.  Note, if we back off, it's reasonable to
  	 * back off all of the packets in the same manner, even if
  	 * some of them have been retransmitted more times than more
! 	 * recent additions */
! 	clock_GetTime(&now);
! 	retryTime = now;	/* initialize before use */
  	MUTEX_ENTER(&peer->peer_lock);
  	clock_Add(&retryTime, &peer->timeout);
  	MUTEX_EXIT(&peer->peer_lock);
! 
  	/* Send (or resend) any packets that need it, subject to
  	 * window restrictions and congestion burst control
  	 * restrictions.  Ask for an ack on the last packet sent in
--- 5074,5088 ----
  	 * in this burst.  Note, if we back off, it's reasonable to
  	 * back off all of the packets in the same manner, even if
  	 * some of them have been retransmitted more times than more
! 	 * recent additions.
! 	 * Do a dance to avoid blocking after setting now. */
! 	clock_Zero(&retryTime);
  	MUTEX_ENTER(&peer->peer_lock);
  	clock_Add(&retryTime, &peer->timeout);
  	MUTEX_EXIT(&peer->peer_lock);
! 	clock_GetTime(&now);
! 	clock_Add(&retryTime, &now);
! 	usenow = now;
  	/* Send (or resend) any packets that need it, subject to
  	 * window restrictions and congestion burst control
  	 * restrictions.  Ask for an ack on the last packet sent in
***************
*** 5117,5122 ****
--- 5132,5139 ----
  			osi_Panic("rxi_Start: xmit queue clobbered");
  		    }
  		    if (p->flags & RX_PKTFLAG_ACKED) {
+ 			/* Since we may block, don't trust this */
+ 			usenow.sec = usenow.usec = 0;
  			MUTEX_ENTER(&rx_stats_mutex);
  			rx_stats.ignoreAckedPacket++;
  			MUTEX_EXIT(&rx_stats_mutex);
***************
*** 5262,5273 ****
  #ifdef RX_ENABLE_LOCKS
  			CALL_HOLD(call, RX_CALL_REFCOUNT_RESEND);
  			call->resendEvent =
! 			    rxevent_Post2(&retryTime, rxi_StartUnlocked,
! 					 (void *)call, 0, istack);
  #else /* RX_ENABLE_LOCKS */
  			call->resendEvent =
! 			    rxevent_Post2(&retryTime, rxi_Start, (void *)call,
! 					 0, istack);
  #endif /* RX_ENABLE_LOCKS */
  		    }
  		}
--- 5279,5291 ----
  #ifdef RX_ENABLE_LOCKS
  			CALL_HOLD(call, RX_CALL_REFCOUNT_RESEND);
  			call->resendEvent =
! 			    rxevent_PostNow2(&retryTime, &usenow, 
! 					     rxi_StartUnlocked,
! 					     (void *)call, 0, istack);
  #else /* RX_ENABLE_LOCKS */
  			call->resendEvent =
! 			    rxevent_PostNow2(&retryTime, &usenow, rxi_Start, 
! 					     (void *)call, 0, istack);
  #endif /* RX_ENABLE_LOCKS */
  		    }
  		}
***************
*** 5464,5475 ****
  rxi_ScheduleKeepAliveEvent(register struct rx_call *call)
  {
      if (!call->keepAliveEvent) {
! 	struct clock when;
! 	clock_GetTime(&when);
  	when.sec += call->conn->secondsUntilPing;
  	CALL_HOLD(call, RX_CALL_REFCOUNT_ALIVE);
  	call->keepAliveEvent =
! 	    rxevent_Post(&when, rxi_KeepAliveEvent, call, 0);
      }
  }
  
--- 5482,5494 ----
  rxi_ScheduleKeepAliveEvent(register struct rx_call *call)
  {
      if (!call->keepAliveEvent) {
! 	struct clock when, now;
! 	clock_GetTime(&now);
! 	when = now;
  	when.sec += call->conn->secondsUntilPing;
  	CALL_HOLD(call, RX_CALL_REFCOUNT_ALIVE);
  	call->keepAliveEvent =
! 	    rxevent_PostNow(&when, &now, rxi_KeepAliveEvent, call, 0);
      }
  }
  
***************
*** 5545,5551 ****
      conn->challengeEvent = NULL;
      if (RXS_CheckAuthentication(conn->securityObject, conn) != 0) {
  	register struct rx_packet *packet;
! 	struct clock when;
  
  	if (tries <= 0) {
  	    /* We've failed to authenticate for too long.
--- 5564,5570 ----
      conn->challengeEvent = NULL;
      if (RXS_CheckAuthentication(conn->securityObject, conn) != 0) {
  	register struct rx_packet *packet;
! 	struct clock when, now;
  
  	if (tries <= 0) {
  	    /* We've failed to authenticate for too long.
***************
*** 5578,5587 ****
  			    RX_PACKET_TYPE_CHALLENGE, NULL, -1, 0);
  	    rxi_FreePacket(packet);
  	}
! 	clock_GetTime(&when);
  	when.sec += RX_CHALLENGE_TIMEOUT;
  	conn->challengeEvent =
! 	    rxevent_Post2(&when, rxi_ChallengeEvent, conn, 0,
  			 (tries - 1));
      }
  }
--- 5597,5607 ----
  			    RX_PACKET_TYPE_CHALLENGE, NULL, -1, 0);
  	    rxi_FreePacket(packet);
  	}
! 	clock_GetTime(&now);
! 	when = now;
  	when.sec += RX_CHALLENGE_TIMEOUT;
  	conn->challengeEvent =
! 	    rxevent_PostNow2(&when, &now, rxi_ChallengeEvent, conn, 0,
  			 (tries - 1));
      }
  }
***************
*** 5703,5709 ****
  void
  rxi_ReapConnections(void)
  {
!     struct clock now;
      clock_GetTime(&now);
  
      /* Find server connection structures that haven't been used for
--- 5723,5729 ----
  void
  rxi_ReapConnections(void)
  {
!     struct clock now, when;
      clock_GetTime(&now);
  
      /* Find server connection structures that haven't been used for
***************
*** 5854,5861 ****
      }
      MUTEX_EXIT(&rx_freePktQ_lock);
  
!     now.sec += RX_REAP_TIME;	/* Check every RX_REAP_TIME seconds */
!     rxevent_Post(&now, rxi_ReapConnections, 0, 0);
  }
  
  
--- 5874,5882 ----
      }
      MUTEX_EXIT(&rx_freePktQ_lock);
  
!     when = now;
!     when.sec += RX_REAP_TIME;	/* Check every RX_REAP_TIME seconds */
!     rxevent_Post(&when, rxi_ReapConnections, 0, 0);
  }
  
  
Index: openafs/src/rx/rx.h
diff -c openafs/src/rx/rx.h:1.22.2.6 openafs/src/rx/rx.h:1.22.2.9
*** openafs/src/rx/rx.h:1.22.2.6	Wed May 16 16:53:05 2007
--- openafs/src/rx/rx.h	Fri Feb  8 16:25:14 2008
***************
*** 23,34 ****
  #define _RX_
  
  #ifndef KDUMP_RX_LOCK
- /* Substitute VOID (char) for void, because some compilers are confused by void
-  * in some situations */
- #ifndef AFS_NT40_ENV
- #define	VOID	char
- #endif
- 
  #ifdef	KERNEL
  #include "rx_kmutex.h"
  #include "rx_kernel.h"
--- 23,28 ----
***************
*** 46,51 ****
--- 40,46 ----
  #else /* KERNEL */
  # include <sys/types.h>
  # include <stdio.h>
+ # include <string.h>
  #ifdef AFS_PTHREAD_ENV
  # include "rx_pthread.h"
  #else
***************
*** 257,263 ****
      u_char securityIndex;	/* corresponds to the security class of the */
      /* securityObject for this conn */
      struct rx_securityClass *securityObject;	/* Security object for this connection */
!     VOID *securityData;		/* Private data for this conn's security class */
      u_short securityHeaderSize;	/* Length of security module's packet header data */
      u_short securityMaxTrailerSize;	/* Length of security module's packet trailer data */
  
--- 252,258 ----
      u_char securityIndex;	/* corresponds to the security class of the */
      /* securityObject for this conn */
      struct rx_securityClass *securityObject;	/* Security object for this connection */
!     void *securityData;		/* Private data for this conn's security class */
      u_short securityHeaderSize;	/* Length of security module's packet header data */
      u_short securityMaxTrailerSize;	/* Length of security module's packet trailer data */
  
***************
*** 508,515 ****
      int abortCount;		/* number of times last error was sent */
      u_int lastSendTime;		/* Last time a packet was sent on this call */
      u_int lastReceiveTime;	/* Last time a packet was received for this call */
!     void (*arrivalProc) (register struct rx_call * call, register VOID * mh, register int index);	/* Procedure to call when reply is received */
!     VOID *arrivalProcHandle;	/* Handle to pass to replyFunc */
      int arrivalProcArg;         /* Additional arg to pass to reply Proc */
      afs_uint32 lastAcked;	/* last packet "hard" acked by receiver */
      afs_uint32 startWait;	/* time server began waiting for input data/send quota */
--- 503,510 ----
      int abortCount;		/* number of times last error was sent */
      u_int lastSendTime;		/* Last time a packet was sent on this call */
      u_int lastReceiveTime;	/* Last time a packet was received for this call */
!     void (*arrivalProc) (register struct rx_call * call, register void * mh, register int index);	/* Procedure to call when reply is received */
!     void *arrivalProcHandle;	/* Handle to pass to replyFunc */
      int arrivalProcArg;         /* Additional arg to pass to reply Proc */
      afs_uint32 lastAcked;	/* last packet "hard" acked by receiver */
      afs_uint32 startWait;	/* time server began waiting for input data/send quota */
***************
*** 693,698 ****
--- 688,708 ----
      afs_int32 sparel[8];
  };
  
+ /* Configuration settings */
+ 
+ /* Enum for storing configuration variables which can be set via the 
+  * SetConfiguration method in the rx_securityClass, below
+  */
+ 
+ typedef enum {
+      RXS_CONFIG_FLAGS /* afs_uint32 set of bitwise flags */
+ } rx_securityConfigVariables;
+ 
+ /* For the RXS_CONFIG_FLAGS, the following bit values are defined */
+ 
+ /* Disable the principal name contains dot check in rxkad */
+ #define RXS_CONFIG_FLAGS_DISABLE_DOTCHECK	0x01
+ 
  /* XXXX (rewrite this description) A security class object contains a set of
   * procedures and some private data to implement a security model for rx
   * connections.  These routines are called by rx as appropriate.  Rx knows
***************
*** 733,743 ****
  	int (*op_GetStats) (struct rx_securityClass * aobj,
  			    struct rx_connection * aconn,
  			    struct rx_securityObjectStats * astats);
! 	int (*op_Spare1) (void);
  	int (*op_Spare2) (void);
  	int (*op_Spare3) (void);
      } *ops;
!     VOID *privateData;
      int refCount;
  };
  
--- 743,757 ----
  	int (*op_GetStats) (struct rx_securityClass * aobj,
  			    struct rx_connection * aconn,
  			    struct rx_securityObjectStats * astats);
! 	int (*op_SetConfiguration) (struct rx_securityClass * aobj,
! 				    struct rx_connection * aconn,
! 				    rx_securityConfigVariables atype,
! 				    void * avalue,
! 				    void ** acurrentValue);
  	int (*op_Spare2) (void);
  	int (*op_Spare3) (void);
      } *ops;
!     void *privateData;
      int refCount;
  };
  
***************
*** 755,761 ****
  #define RXS_CheckPacket(obj,call,packet) RXS_OP(obj,CheckPacket,(obj,call,packet))
  #define RXS_DestroyConnection(obj,conn) RXS_OP(obj,DestroyConnection,(obj,conn))
  #define RXS_GetStats(obj,conn,stats) RXS_OP(obj,GetStats,(obj,conn,stats))
! 
  
  
  /* Structure for keeping rx statistics.  Note that this structure is returned
--- 769,775 ----
  #define RXS_CheckPacket(obj,call,packet) RXS_OP(obj,CheckPacket,(obj,call,packet))
  #define RXS_DestroyConnection(obj,conn) RXS_OP(obj,DestroyConnection,(obj,conn))
  #define RXS_GetStats(obj,conn,stats) RXS_OP(obj,GetStats,(obj,conn,stats))
! #define RXS_SetConfiguration(obj, conn, type, value, currentValue) RXS_OP(obj, SetConfiguration,(obj,conn,type,value,currentValue))
  
  
  /* Structure for keeping rx statistics.  Note that this structure is returned
Index: openafs/src/rx/rx_event.c
diff -c openafs/src/rx/rx_event.c:1.14.2.3 openafs/src/rx/rx_event.c:1.14.2.4
*** openafs/src/rx/rx_event.c:1.14.2.3	Wed Apr 13 22:31:44 2005
--- openafs/src/rx/rx_event.c	Mon Mar 17 11:38:40 2008
***************
*** 19,25 ****
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx_event.c,v 1.14.2.3 2005/04/14 02:31:44 shadow Exp $");
  
  #ifdef KERNEL
  #ifndef UKERNEL
--- 19,25 ----
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx_event.c,v 1.14.2.4 2008/03/17 15:38:40 shadow Exp $");
  
  #ifdef KERNEL
  #ifndef UKERNEL
***************
*** 90,95 ****
--- 90,96 ----
  static struct xfreelist *xfreemallocs = 0, *xsp = 0;
  
  struct clock rxevent_nextRaiseEvents;	/* Time of next call to raise events */
+ struct clock rxevent_lastEvent;        /* backwards time detection */
  int rxevent_raiseScheduled;	/* true if raise events is scheduled */
  
  #ifdef RX_ENABLE_LOCKS
***************
*** 117,122 ****
--- 118,145 ----
  #endif /* AFS_PTHREAD_ENV */
  
  
+ int
+ rxevent_adjTimes(struct clock *adjTime)
+ {
+     /* backwards clock correction */
+     int nAdjusted = 0;
+     struct rxepoch *qep, *nqep;
+     struct rxevent *qev, *nqev;
+     
+     for (queue_Scan(&rxepoch_queue, qep, nqep, rxepoch)) {
+ 	for (queue_Scan(&qep->events, qev, nqev, rxevent)) {
+ 	    if (clock_Gt(&qev->eventTime, adjTime)) {
+ 		clock_Sub(&qev->eventTime, adjTime); 
+ 		nAdjusted++;
+ 	    }
+ 	}
+ 	if (qep->epochSec > adjTime->sec) {
+ 	    qep->epochSec -= adjTime->sec;
+ 	}
+     }
+     return nAdjusted;
+ }
+ 
  /* Pass in the number of events to allocate at a time */
  int rxevent_initialized = 0;
  void
***************
*** 139,144 ****
--- 162,168 ----
      rxevent_ScheduledEarlierEvent = scheduler;
      rxevent_initialized = 1;
      clock_Zero(&rxevent_nextRaiseEvents);
+     clock_Zero(&rxevent_lastEvent);
      rxevent_raiseScheduled = 0;
      UNLOCK_EV_INIT;
  }
***************
*** 181,197 ****
   * "when" argument specifies when "func" should be called, in clock (clock.h)
   * units. */
  
- #if 0
- struct rxevent *
- rxevent_Post(struct clock *when,
- 	     void (*func) (struct rxevent * event,
- 			   struct rx_connection * conn,
- 			   struct rx_call * acall), void *arg, void *arg1)
- #else
  static struct rxevent *
! _rxevent_Post(struct clock *when, void (*func) (), void *arg, void *arg1,
! 	      int arg2, int newargs)
! #endif
  {
      register struct rxevent *ev, *evqe, *evqpr;
      register struct rxepoch *ep, *epqe, *epqpr;
--- 205,213 ----
   * "when" argument specifies when "func" should be called, in clock (clock.h)
   * units. */
  
  static struct rxevent *
! _rxevent_Post(struct clock *when, struct clock *now, void (*func) (), 
! 	      void *arg, void *arg1, int arg2, int newargs)
  {
      register struct rxevent *ev, *evqe, *evqpr;
      register struct rxepoch *ep, *epqe, *epqpr;
***************
*** 200,214 ****
      MUTEX_ENTER(&rxevent_lock);
  #ifdef RXDEBUG
      if (rx_Log_event) {
! 	struct clock now;
! 	clock_GetTime(&now);
  	fprintf(rx_Log_event, "%d.%d: rxevent_Post(%d.%d, %lx, %lx, %lx, %d)\n",
! 		(int)now.sec, (int)now.usec, (int)when->sec, (int)when->usec,
  		(unsigned long)func, (unsigned long)arg,
  		(unsigned long)arg1, arg2);
      }
  #endif
! 
      /* Get a pointer to the epoch for this event, if none is found then
       * create a new epoch and insert it into the sorted list */
      for (ep = NULL, queue_ScanBackwards(&rxepoch_queue, epqe, epqpr, rxepoch)) {
--- 216,238 ----
      MUTEX_ENTER(&rxevent_lock);
  #ifdef RXDEBUG
      if (rx_Log_event) {
! 	struct clock now1;
! 	clock_GetTime(&now1);
  	fprintf(rx_Log_event, "%d.%d: rxevent_Post(%d.%d, %lx, %lx, %lx, %d)\n",
! 		(int)now1.sec, (int)now1.usec, (int)when->sec, (int)when->usec,
  		(unsigned long)func, (unsigned long)arg,
  		(unsigned long)arg1, arg2);
      }
  #endif
!     /* If a time was provided, check for consistency */
!     if (now->sec) {
! 	if (clock_Gt(&rxevent_lastEvent, now)) {
! 	    struct clock adjTime = rxevent_lastEvent;
! 	    clock_Sub(&adjTime, now);
! 	    rxevent_adjTimes(&adjTime);
! 	}
! 	rxevent_lastEvent = *now;
!     }
      /* Get a pointer to the epoch for this event, if none is found then
       * create a new epoch and insert it into the sorted list */
      for (ep = NULL, queue_ScanBackwards(&rxepoch_queue, epqe, epqpr, rxepoch)) {
***************
*** 297,310 ****
  struct rxevent *
  rxevent_Post(struct clock *when, void (*func) (), void *arg, void *arg1)
  {
!     return _rxevent_Post(when, func, arg, arg1, 0, 0);
  }
  
  struct rxevent *
  rxevent_Post2(struct clock *when, void (*func) (), void *arg, void *arg1,
  	      int arg2)
  {
!     return _rxevent_Post(when, func, arg, arg1, arg2, 1);
  }
  
  /* Cancel an event by moving it from the event queue to the free list.
--- 321,352 ----
  struct rxevent *
  rxevent_Post(struct clock *when, void (*func) (), void *arg, void *arg1)
  {
!     struct clock now;
!     clock_Zero(&now);
!     return _rxevent_Post(when, &now, func, arg, arg1, 0, 0);
  }
  
  struct rxevent *
  rxevent_Post2(struct clock *when, void (*func) (), void *arg, void *arg1,
  	      int arg2)
  {
!     struct clock now;
!     clock_Zero(&now);
!     return _rxevent_Post(when, &now, func, arg, arg1, arg2, 1);
! }
! 
! struct rxevent *
! rxevent_PostNow(struct clock *when, struct clock *now, void (*func) (), 
! 		void *arg, void *arg1)
! {
!     return _rxevent_Post(when, now, func, arg, arg1, 0, 0);
! }
! 
! struct rxevent *
! rxevent_PostNow2(struct clock *when, struct clock *now, void (*func) (), 
! 		 void *arg, void *arg1, int arg2)
! {
!     return _rxevent_Post(when, now, func, arg, arg1, arg2, 1);
  }
  
  /* Cancel an event by moving it from the event queue to the free list.
***************
*** 378,384 ****
      register struct rxepoch *ep;
      register struct rxevent *ev;
      volatile struct clock now;
- 
      MUTEX_ENTER(&rxevent_lock);
  
      /* Events are sorted by time, so only scan until an event is found that has
--- 420,425 ----
***************
*** 394,410 ****
  	    continue;
  	}
  	do {
  	    ev = queue_First(&ep->events, rxevent);
  	    if (clock_Lt(&now, &ev->eventTime)) {
  		clock_GetTime(&now);
! 		if (clock_Lt(&now, &ev->eventTime)) {
! 		    *next = rxevent_nextRaiseEvents = ev->eventTime;
! 		    rxevent_raiseScheduled = 1;
! 		    clock_Sub(next, &now);
! 		    MUTEX_EXIT(&rxevent_lock);
! 		    return 1;
  		}
! 	    }
  	    queue_Remove(ev);
  	    rxevent_nPosted--;
  	    MUTEX_EXIT(&rxevent_lock);
--- 435,461 ----
  	    continue;
  	}
  	do {
+ 	reraise:
  	    ev = queue_First(&ep->events, rxevent);
  	    if (clock_Lt(&now, &ev->eventTime)) {
  		clock_GetTime(&now);
! 		if (clock_Gt(&rxevent_lastEvent, &now)) {
! 		    struct clock adjTime = rxevent_lastEvent;
! 		    int adjusted;
! 		    clock_Sub(&adjTime, &now);
! 		    adjusted = rxevent_adjTimes(&adjTime);
! 		    rxevent_lastEvent = now;
! 		    if (adjusted > 0)
! 			goto reraise;
  		}
! 		if (clock_Lt(&now, &ev->eventTime)) {
!                     *next = rxevent_nextRaiseEvents = ev->eventTime;
!                     rxevent_raiseScheduled = 1;
!                     clock_Sub(next, &now);
!                     MUTEX_EXIT(&rxevent_lock);
!                     return 1;
!                 }
!             }
  	    queue_Remove(ev);
  	    rxevent_nPosted--;
  	    MUTEX_EXIT(&rxevent_lock);
Index: openafs/src/rx/rx_kcommon.c
diff -c openafs/src/rx/rx_kcommon.c:1.44.2.15 openafs/src/rx/rx_kcommon.c:1.44.2.18
*** openafs/src/rx/rx_kcommon.c:1.44.2.15	Thu Feb  8 19:20:28 2007
--- openafs/src/rx/rx_kcommon.c	Mon Mar 10 18:35:36 2008
***************
*** 15,21 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx_kcommon.c,v 1.44.2.15 2007/02/09 00:20:28 shadow Exp $");
  
  #include "rx/rx_kcommon.h"
  
--- 15,21 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx_kcommon.c,v 1.44.2.18 2008/03/10 22:35:36 shadow Exp $");
  
  #include "rx/rx_kcommon.h"
  
***************
*** 273,280 ****
  #ifndef UKERNEL
  /* This is the server process request loop. Kernel server
   * processes never become listener threads */
! void
! rx_ServerProc(void)
  {
      int threadID;
  
--- 273,280 ----
  #ifndef UKERNEL
  /* This is the server process request loop. Kernel server
   * processes never become listener threads */
! void *
! rx_ServerProc(void *unused)
  {
      int threadID;
  
***************
*** 1093,1100 ****
--- 1093,1104 ----
  #ifdef RXK_LISTENER_ENV
  	    afs_termState = AFSOP_STOP_RXK_LISTENER;
  #else
+ #ifdef AFS_SUN510_ENV
+ 	    afs_termState = AFSOP_STOP_NETIF;
+ #else
  	    afs_termState = AFSOP_STOP_COMPLETE;
  #endif
+ #endif
  	    osi_rxWakeup(&afs_termState);
  	    return;
  	}
***************
*** 1206,1211 ****
--- 1210,1218 ----
   * OS's socket receive routine returns as a result of a signal.
   */
  int rxk_ListenerPid;		/* Used to signal process to wakeup at shutdown */
+ #ifdef AFS_LINUX20_ENV
+ struct task_struct *rxk_ListenerTask;
+ #endif
  
  #ifdef AFS_SUN5_ENV
  /*
***************
*** 1235,1240 ****
--- 1242,1248 ----
  
  #ifdef AFS_LINUX20_ENV
      rxk_ListenerPid = current->pid;
+     rxk_ListenerTask = current;
  #endif
  #ifdef AFS_SUN5_ENV
      rxk_ListenerPid = 1;	/* No PID, just a flag that we're alive */
***************
*** 1267,1277 ****
      AFS_GLOCK();
  #endif /* RX_ENABLE_LOCKS */
      if (afs_termState == AFSOP_STOP_RXK_LISTENER) {
  	afs_termState = AFSOP_STOP_COMPLETE;
  	osi_rxWakeup(&afs_termState);
      }
      rxk_ListenerPid = 0;
! #if defined(AFS_LINUX22_ENV) || defined(AFS_SUN5_ENV)
      osi_rxWakeup(&rxk_ListenerPid);
  #endif
  #ifdef AFS_SUN5_ENV
--- 1275,1293 ----
      AFS_GLOCK();
  #endif /* RX_ENABLE_LOCKS */
      if (afs_termState == AFSOP_STOP_RXK_LISTENER) {
+ #ifdef AFS_SUN510_ENV
+ 	afs_termState = AFSOP_STOP_NETIF;
+ #else
  	afs_termState = AFSOP_STOP_COMPLETE;
+ #endif
  	osi_rxWakeup(&afs_termState);
      }
      rxk_ListenerPid = 0;
! #ifdef AFS_LINUX20_ENV
!     rxk_ListenerTask = 0;
!     osi_rxWakeup(&rxk_ListenerTask);
! #endif
! #if defined(AFS_SUN5_ENV)
      osi_rxWakeup(&rxk_ListenerPid);
  #endif
  #ifdef AFS_SUN5_ENV
Index: openafs/src/rx/rx_lwp.c
diff -c openafs/src/rx/rx_lwp.c:1.17.2.2 openafs/src/rx/rx_lwp.c:1.17.2.3
*** openafs/src/rx/rx_lwp.c:1.17.2.2	Thu Jun 14 15:05:03 2007
--- openafs/src/rx/rx_lwp.c	Mon Mar 10 18:35:36 2008
***************
*** 22,28 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx_lwp.c,v 1.17.2.2 2007/06/14 19:05:03 jaltman Exp $");
  
  # include <sys/types.h>		/* fd_set on older platforms */
  # include <errno.h>
--- 22,28 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx_lwp.c,v 1.17.2.3 2008/03/10 22:35:36 shadow Exp $");
  
  # include <sys/types.h>		/* fd_set on older platforms */
  # include <errno.h>
***************
*** 75,81 ****
  }
  
  PROCESS rx_listenerPid = 0;	/* LWP process id of socket listener process */
! static int rx_ListenerProc(void *dummy);
  
  /*
   * Delay the current thread the specified number of seconds.
--- 75,81 ----
  }
  
  PROCESS rx_listenerPid = 0;	/* LWP process id of socket listener process */
! static void* rx_ListenerProc(void *dummy);
  
  /*
   * Delay the current thread the specified number of seconds.
***************
*** 119,132 ****
  }
  
  void
! rxi_StartServerProc(void (*proc) (void), int stacksize)
  {
      PROCESS scratchPid;
      static int number = 0;
      char name[32];
  
      sprintf(name, "srv_%d", ++number);
!     LWP_CreateProcess((int (*)(void *))proc, stacksize, RX_PROCESS_PRIORITY, (void *)0,
  		      "rx_ServerProc", &scratchPid);
      if (registerProgram)
  	(*registerProgram) (scratchPid, name);
--- 119,132 ----
  }
  
  void
! rxi_StartServerProc(void *(*proc) (void *), int stacksize)
  {
      PROCESS scratchPid;
      static int number = 0;
      char name[32];
  
      sprintf(name, "srv_%d", ++number);
!     LWP_CreateProcess(proc, stacksize, RX_PROCESS_PRIORITY, NULL,
  		      "rx_ServerProc", &scratchPid);
      if (registerProgram)
  	(*registerProgram) (scratchPid, name);
***************
*** 320,326 ****
  /* This is the listener process request loop. The listener process loop
   * becomes a server thread when rxi_ListenerProc returns, and stays
   * server thread until rxi_ServerProc returns. */
! static int
  rx_ListenerProc(void *dummy)
  {
      int threadID;
--- 320,326 ----
  /* This is the listener process request loop. The listener process loop
   * becomes a server thread when rxi_ListenerProc returns, and stays
   * server thread until rxi_ServerProc returns. */
! static void *
  rx_ListenerProc(void *dummy)
  {
      int threadID;
***************
*** 343,355 ****
  	/* assert(sock != OSI_NULLSOCKET); */
      }
      /* not reached */
  }
  
  /* This is the server process request loop. The server process loop
   * becomes a listener thread when rxi_ServerProc returns, and stays
   * listener thread until rxi_ListenerProc returns. */
! void
! rx_ServerProc(void)
  {
      int sock;
      int threadID;
--- 343,356 ----
  	/* assert(sock != OSI_NULLSOCKET); */
      }
      /* not reached */
+     return NULL;
  }
  
  /* This is the server process request loop. The server process loop
   * becomes a listener thread when rxi_ServerProc returns, and stays
   * listener thread until rxi_ListenerProc returns. */
! void *
! rx_ServerProc(void * unused)
  {
      int sock;
      int threadID;
***************
*** 376,381 ****
--- 377,383 ----
  	/* assert(newcall != NULL); */
      }
      /* not reached */
+     return NULL;
  }
  
  /*
Index: openafs/src/rx/rx_misc.c
diff -c openafs/src/rx/rx_misc.c:1.12.2.1 openafs/src/rx/rx_misc.c:1.12.2.3
*** openafs/src/rx/rx_misc.c:1.12.2.1	Wed Aug 25 03:09:41 2004
--- openafs/src/rx/rx_misc.c	Wed Jan 30 19:27:40 2008
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx_misc.c,v 1.12.2.1 2004/08/25 07:09:41 shadow Exp $");
  
  #ifdef	KERNEL
  #include <afs/sysincludes.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx_misc.c,v 1.12.2.3 2008/01/31 00:27:40 jaltman Exp $");
  
  #ifdef	KERNEL
  #include <afs/sysincludes.h>
***************
*** 30,42 ****
  #include "rx.h"
  #endif /* AFS_PTHREAD_ENV */
  #include <stdlib.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
--- 30,36 ----
***************
*** 59,65 ****
  
      if (code == ENOSPC)
  	err = VDISKFULL;
! #if !defined(AFS_SUN5_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_DJGPP_ENV)
      /* EDQUOT doesn't exist on solaris */
      else if (code == EDQUOT)
  	err = VOVERQUOTA;
--- 53,59 ----
  
      if (code == ENOSPC)
  	err = VDISKFULL;
! #ifdef EDQUOT
      /* EDQUOT doesn't exist on solaris */
      else if (code == EDQUOT)
  	err = VOVERQUOTA;
***************
*** 82,88 ****
      if (code == VDISKFULL)
  	err = ENOSPC;
      else if (code == VOVERQUOTA)
! #if defined(AFS_SUN5_ENV) || defined(AFS_NT40_ENV) || defined(AFS_DJGPP_ENV)
  	err = ENOSPC;
  #else
  	err = EDQUOT;
--- 76,82 ----
      if (code == VDISKFULL)
  	err = ENOSPC;
      else if (code == VOVERQUOTA)
! #ifndef EDQUOT
  	err = ENOSPC;
  #else
  	err = EDQUOT;
Index: openafs/src/rx/rx_multi.c
diff -c openafs/src/rx/rx_multi.c:1.8.2.1 openafs/src/rx/rx_multi.c:1.8.2.2
*** openafs/src/rx/rx_multi.c:1.8.2.1	Tue Dec  7 01:10:06 2004
--- openafs/src/rx/rx_multi.c	Fri Feb  8 16:25:14 2008
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx_multi.c,v 1.8.2.1 2004/12/07 06:10:06 shadow Exp $");
  
  #ifdef	KERNEL
  #include "afs/sysincludes.h"
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx_multi.c,v 1.8.2.2 2008/02/08 21:25:14 shadow Exp $");
  
  #ifdef	KERNEL
  #include "afs/sysincludes.h"
***************
*** 55,61 ****
      for (i = 0; i < nConns; i++) {
  	register struct rx_call *call;
  	call = mh->calls[i] = rx_NewCall(conns[i]);
! 	rx_SetArrivalProc(call, multi_Ready, (VOID *) mh, i);
      }
      return mh;
  }
--- 55,61 ----
      for (i = 0; i < nConns; i++) {
  	register struct rx_call *call;
  	call = mh->calls[i] = rx_NewCall(conns[i]);
! 	rx_SetArrivalProc(call, multi_Ready, (void *) mh, i);
      }
      return mh;
  }
***************
*** 95,101 ****
  
  /* Called by Rx when the first reply packet of a call is received, or the call is aborted. */
  void
! multi_Ready(register struct rx_call *call, register VOID *amh,
  	    register int index)
  {
      register struct multi_handle *mh = (struct multi_handle *)amh;
--- 95,101 ----
  
  /* Called by Rx when the first reply packet of a call is received, or the call is aborted. */
  void
! multi_Ready(register struct rx_call *call, register void *amh,
  	    register int index)
  {
      register struct multi_handle *mh = (struct multi_handle *)amh;
Index: openafs/src/rx/rx_packet.c
diff -c openafs/src/rx/rx_packet.c:1.35.2.33 openafs/src/rx/rx_packet.c:1.35.2.34
*** openafs/src/rx/rx_packet.c:1.35.2.33	Sat Jun 23 02:27:22 2007
--- openafs/src/rx/rx_packet.c	Tue Oct 30 11:24:04 2007
***************
*** 15,21 ****
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx_packet.c,v 1.35.2.33 2007/06/23 06:27:22 shadow Exp $");
  
  #ifdef KERNEL
  #if defined(UKERNEL)
--- 15,21 ----
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx_packet.c,v 1.35.2.34 2007/10/30 15:24:04 shadow Exp $");
  
  #ifdef KERNEL
  #if defined(UKERNEL)
***************
*** 88,100 ****
  #include "rx_globals.h"
  #include <lwp.h>
  #include <assert.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
--- 88,94 ----
Index: openafs/src/rx/rx_prototypes.h
diff -c openafs/src/rx/rx_prototypes.h:1.14.2.19 openafs/src/rx/rx_prototypes.h:1.14.2.22
*** openafs/src/rx/rx_prototypes.h:1.14.2.19	Fri Oct  5 18:23:50 2007
--- openafs/src/rx/rx_prototypes.h	Mon Mar 17 11:38:40 2008
***************
*** 60,68 ****
  extern void rx_SetArrivalProc(register struct rx_call *call,
  			      register void (*proc) (register struct rx_call *
  						    call,
! 						    register VOID * mh,
  						    register int index),
! 			      register VOID * handle, register int arg);
  extern afs_int32 rx_EndCall(register struct rx_call *call, afs_int32 rc);
  extern void rx_Finalize(void);
  extern void rxi_PacketsUnWait(void);
--- 60,68 ----
  extern void rx_SetArrivalProc(register struct rx_call *call,
  			      register void (*proc) (register struct rx_call *
  						    call,
! 						    register void * mh,
  						    register int index),
! 			      register void * handle, register int arg);
  extern afs_int32 rx_EndCall(register struct rx_call *call, afs_int32 rc);
  extern void rx_Finalize(void);
  extern void rxi_PacketsUnWait(void);
***************
*** 301,306 ****
--- 301,311 ----
  				    void *arg, void *arg1);
  extern struct rxevent *rxevent_Post2(struct clock *when, void (*func) (),
  				    void *arg, void *arg1, int arg2);
+ extern struct rxevent *rxevent_PostNow(struct clock *when, struct clock *now,
+ 				       void (*func) (), void *arg, void *arg1);
+ extern struct rxevent *rxevent_PostNow2(struct clock *when, struct clock *now,
+ 					void (*func) (), void *arg, 
+ 					void *arg1, int arg2);
  #endif
  extern void shutdown_rxevent(void);
  extern struct rxepoch *rxepoch_Allocate(struct clock *when);
***************
*** 362,368 ****
  extern int rxk_ReadPacket(osi_socket so, struct rx_packet *p, int *host,
  			  int *port);
  #ifdef UKERNEL
! extern void rx_ServerProc(void);
  #endif
  extern void osi_AssertFailK(const char *expr, const char *file, int line);
  extern void rxk_ListenerProc(void);
--- 367,373 ----
  extern int rxk_ReadPacket(osi_socket so, struct rx_packet *p, int *host,
  			  int *port);
  #ifdef UKERNEL
! extern void *rx_ServerProc(void *);
  #endif
  extern void osi_AssertFailK(const char *expr, const char *file, int line);
  extern void rxk_ListenerProc(void);
***************
*** 416,422 ****
  
  
  /* rx_lwp.c */
- extern void rx_ServerProc(void);
  extern void rxi_Sleep(void *addr);
  extern void rxi_Delay(int seconds);
  extern void rxi_InitializeThreadSupport(void);
--- 421,426 ----
***************
*** 426,434 ****
  extern void rxi_ReScheduleEvents(void);
  #endif
  extern void rxi_InitializeThreadSupport(void);
! extern void rxi_StartServerProc(void (*proc) (void), int stacksize);
  extern void rxi_StartListener(void);
! extern void rx_ServerProc(void);
  extern int rxi_Listen(osi_socket sock);
  extern int rxi_Recvmsg(osi_socket socket, struct msghdr *msg_p, int flags);
  extern int rxi_Sendmsg(osi_socket socket, struct msghdr *msg_p, int flags);
--- 430,438 ----
  extern void rxi_ReScheduleEvents(void);
  #endif
  extern void rxi_InitializeThreadSupport(void);
! extern void rxi_StartServerProc(void *(*proc) (void *), int stacksize);
  extern void rxi_StartListener(void);
! extern void *rx_ServerProc(void *);
  extern int rxi_Listen(osi_socket sock);
  extern int rxi_Recvmsg(osi_socket socket, struct msghdr *msg_p, int flags);
  extern int rxi_Sendmsg(osi_socket socket, struct msghdr *msg_p, int flags);
***************
*** 450,456 ****
  				       register int nConns);
  extern int multi_Select(register struct multi_handle *mh);
  extern void multi_Ready(register struct rx_call *call,
! 			register VOID *mh, register int index);
  extern void multi_Finalize(register struct multi_handle *mh);
  extern void multi_Finalize_Ignore(register struct multi_handle *mh);
  
--- 454,460 ----
  				       register int nConns);
  extern int multi_Select(register struct multi_handle *mh);
  extern void multi_Ready(register struct rx_call *call,
! 			register void *mh, register int index);
  extern void multi_Finalize(register struct multi_handle *mh);
  extern void multi_Finalize_Ignore(register struct multi_handle *mh);
  
***************
*** 528,538 ****
  /* rx_pthread.c */
  extern void rxi_Delay(int sec);
  extern void rxi_InitializeThreadSupport(void);
! extern void rxi_StartServerProc(void (*proc) (void), int stacksize);
  #ifndef rxi_ReScheduleEvents
  extern void rxi_ReScheduleEvents(void);
  #endif
! extern void rx_ServerProc(void);
  extern void rxi_StartListener(void);
  extern int rxi_Listen(osi_socket sock);
  extern int rxi_Recvmsg(osi_socket socket, struct msghdr *msg_p, int flags);
--- 532,542 ----
  /* rx_pthread.c */
  extern void rxi_Delay(int sec);
  extern void rxi_InitializeThreadSupport(void);
! extern void rxi_StartServerProc(void *(*proc) (void *), int stacksize);
  #ifndef rxi_ReScheduleEvents
  extern void rxi_ReScheduleEvents(void);
  #endif
! extern void *rx_ServerProc(void *);
  extern void rxi_StartListener(void);
  extern int rxi_Listen(osi_socket sock);
  extern int rxi_Recvmsg(osi_socket socket, struct msghdr *msg_p, int flags);
Index: openafs/src/rx/rx_pthread.c
diff -c openafs/src/rx/rx_pthread.c:1.17.2.7 openafs/src/rx/rx_pthread.c:1.17.2.9
*** openafs/src/rx/rx_pthread.c:1.17.2.7	Sun Jul  2 21:16:36 2006
--- openafs/src/rx/rx_pthread.c	Mon Mar 10 18:35:36 2008
***************
*** 19,29 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx_pthread.c,v 1.17.2.7 2006/07/03 01:16:36 jaltman Exp $");
  
  #include <sys/types.h>
  #include <errno.h>
  #include <signal.h>
  #ifndef AFS_NT40_ENV
  # include <sys/socket.h>
  # include <sys/file.h>
--- 19,30 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx_pthread.c,v 1.17.2.9 2008/03/10 22:35:36 shadow Exp $");
  
  #include <sys/types.h>
  #include <errno.h>
  #include <signal.h>
+ #include <string.h>
  #ifndef AFS_NT40_ENV
  # include <sys/socket.h>
  # include <sys/file.h>
***************
*** 107,113 ****
   * Start an Rx server process.
   */
  void
! rxi_StartServerProc(void (*proc) (void), int stacksize)
  {
      pthread_t thread;
      pthread_attr_t tattr;
--- 108,114 ----
   * Start an Rx server process.
   */
  void
! rxi_StartServerProc(void *(*proc) (void *), int stacksize)
  {
      pthread_t thread;
      pthread_attr_t tattr;
***************
*** 267,274 ****
  /* This is the server process request loop. The server process loop
   * becomes a listener thread when rxi_ServerProc returns, and stays
   * listener thread until rxi_ListenerProc returns. */
! void
! rx_ServerProc(void)
  {
      int sock;
      int threadID;
--- 268,275 ----
  /* This is the server process request loop. The server process loop
   * becomes a listener thread when rxi_ServerProc returns, and stays
   * listener thread until rxi_ListenerProc returns. */
! void *
! rx_ServerProc(void * dummy)
  {
      int sock;
      int threadID;
Index: openafs/src/rx/rx_rdwr.c
diff -c openafs/src/rx/rx_rdwr.c:1.21.2.7 openafs/src/rx/rx_rdwr.c:1.21.2.9
*** openafs/src/rx/rx_rdwr.c:1.21.2.7	Mon Feb 27 19:19:20 2006
--- openafs/src/rx/rx_rdwr.c	Mon Mar 17 11:38:40 2008
***************
*** 15,21 ****
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx_rdwr.c,v 1.21.2.7 2006/02/28 00:19:20 shadow Exp $");
  
  #ifdef KERNEL
  #ifndef UKERNEL
--- 15,21 ----
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx_rdwr.c,v 1.21.2.9 2008/03/17 15:38:40 shadow Exp $");
  
  #ifdef KERNEL
  #ifndef UKERNEL
***************
*** 79,91 ****
  # include <sys/stat.h>
  # include <sys/time.h>
  #endif
- #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
--- 79,85 ----
***************
*** 196,203 ****
  					       RX_CALL_REFCOUNT_DELAY);
  				rxi_SendAck(call, 0, 0, RX_ACK_DELAY, 0);
  			    } else {
! 				struct clock when;
! 				clock_GetTime(&when);
  				/* Delay to consolidate ack packets */
  				clock_Add(&when, &rx_hardAckDelay);
  				if (!call->delayedAckEvent
--- 190,198 ----
  					       RX_CALL_REFCOUNT_DELAY);
  				rxi_SendAck(call, 0, 0, RX_ACK_DELAY, 0);
  			    } else {
! 				struct clock when, now;
! 				clock_GetTime(&now);
! 				when = now;
  				/* Delay to consolidate ack packets */
  				clock_Add(&when, &rx_hardAckDelay);
  				if (!call->delayedAckEvent
***************
*** 208,214 ****
  						   RX_CALL_REFCOUNT_DELAY);
  				    CALL_HOLD(call, RX_CALL_REFCOUNT_DELAY);
  				    call->delayedAckEvent =
! 					rxevent_Post(&when,
  						     rxi_SendDelayedAck, call,
  						     0);
  				}
--- 203,209 ----
  						   RX_CALL_REFCOUNT_DELAY);
  				    CALL_HOLD(call, RX_CALL_REFCOUNT_DELAY);
  				    call->delayedAckEvent =
! 				      rxevent_PostNow(&when, &now,
  						     rxi_SendDelayedAck, call,
  						     0);
  				}
***************
*** 529,536 ****
  	    rxi_SendAck(call, 0, serial, RX_ACK_DELAY, 0);
  	    didHardAck = 1;
  	} else {
! 	    struct clock when;
! 	    clock_GetTime(&when);
  	    /* Delay to consolidate ack packets */
  	    clock_Add(&when, &rx_hardAckDelay);
  	    if (!call->delayedAckEvent
--- 524,532 ----
  	    rxi_SendAck(call, 0, serial, RX_ACK_DELAY, 0);
  	    didHardAck = 1;
  	} else {
! 	    struct clock when, now;
! 	    clock_GetTime(&now);
! 	    when = now;
  	    /* Delay to consolidate ack packets */
  	    clock_Add(&when, &rx_hardAckDelay);
  	    if (!call->delayedAckEvent
***************
*** 539,545 ****
  			       RX_CALL_REFCOUNT_DELAY);
  		CALL_HOLD(call, RX_CALL_REFCOUNT_DELAY);
  		call->delayedAckEvent =
! 		    rxevent_Post(&when, rxi_SendDelayedAck, call, 0);
  	    }
  	}
      }
--- 535,541 ----
  			       RX_CALL_REFCOUNT_DELAY);
  		CALL_HOLD(call, RX_CALL_REFCOUNT_DELAY);
  		call->delayedAckEvent =
! 		    rxevent_PostNow(&when, &now, rxi_SendDelayedAck, call, 0);
  	    }
  	}
      }
Index: openafs/src/rx/rx_trace.c
diff -c openafs/src/rx/rx_trace.c:1.11 openafs/src/rx/rx_trace.c:1.11.2.2
*** openafs/src/rx/rx_trace.c:1.11	Tue Jul 15 19:16:10 2003
--- openafs/src/rx/rx_trace.c	Mon Nov 26 16:21:55 2007
***************
*** 11,26 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx_trace.c,v 1.11 2003/07/15 23:16:10 shadow Exp $");
  
  #ifdef RXDEBUG
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #ifdef AFS_NT40_ENV
  #include <fcntl.h>
  #include <io.h>
--- 11,20 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx_trace.c,v 1.11.2.2 2007/11/26 21:21:55 shadow Exp $");
  
  #ifdef RXDEBUG
  #include <string.h>
  #ifdef AFS_NT40_ENV
  #include <fcntl.h>
  #include <io.h>
***************
*** 188,193 ****
--- 182,188 ----
  	printf(" %3u %7u %7u      %x.%x\n", ip.qlen, ip.servicetime,
  	       ip.waittime, ip.cid, ip.call);
      }
+     return 0;
  }
  
  #endif /* DUMPTRACE */
Index: openafs/src/rx/rx_user.c
diff -c openafs/src/rx/rx_user.c:1.18.2.4 openafs/src/rx/rx_user.c:1.18.2.5
*** openafs/src/rx/rx_user.c:1.18.2.4	Sun Apr  3 14:18:56 2005
--- openafs/src/rx/rx_user.c	Tue Oct 30 11:24:04 2007
***************
*** 13,23 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx_user.c,v 1.18.2.4 2005/04/03 18:18:56 shadow Exp $");
  
  # include <sys/types.h>
  # include <errno.h>
  # include <signal.h>
  #ifdef AFS_NT40_ENV
  # include <WINNT/syscfg.h>
  #else
--- 13,24 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx_user.c,v 1.18.2.5 2007/10/30 15:24:04 shadow Exp $");
  
  # include <sys/types.h>
  # include <errno.h>
  # include <signal.h>
+ # include <string.h>
  #ifdef AFS_NT40_ENV
  # include <WINNT/syscfg.h>
  #else
***************
*** 36,48 ****
  #endif
  #include <afs/afs_args.h>
  #include <afs/afsutil.h>
- #ifdef HAVE_STRING_H
- #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  
  #ifndef	IPPORT_USERRESERVED
  /* If in.h doesn't define this, define it anyway.  Unfortunately, defining
--- 37,42 ----
Index: openafs/src/rx/xdr.c
diff -c openafs/src/rx/xdr.c:1.9.2.2 openafs/src/rx/xdr.c:1.9.2.3
*** openafs/src/rx/xdr.c:1.9.2.2	Wed Oct  5 01:58:42 2005
--- openafs/src/rx/xdr.c	Tue Oct 30 11:24:04 2007
***************
*** 32,41 ****
  #include "afs/param.h"
  #else
  #include <afs/param.h>
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/xdr.c,v 1.9.2.2 2005/10/05 05:58:42 shadow Exp $");
  
  /*
   * xdr.c, Generic XDR routines implementation.
--- 32,42 ----
  #include "afs/param.h"
  #else
  #include <afs/param.h>
+ #include <string.h>
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/xdr.c,v 1.9.2.3 2007/10/30 15:24:04 shadow Exp $");
  
  /*
   * xdr.c, Generic XDR routines implementation.
Index: openafs/src/rx/xdr_array.c
diff -c openafs/src/rx/xdr_array.c:1.9.2.3 openafs/src/rx/xdr_array.c:1.9.2.4
*** openafs/src/rx/xdr_array.c:1.9.2.3	Sun Aug 13 16:19:57 2006
--- openafs/src/rx/xdr_array.c	Tue Oct 30 11:24:04 2007
***************
*** 31,37 ****
  #include "rx.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/xdr_array.c,v 1.9.2.3 2006/08/13 20:19:57 shadow Exp $");
  
  #ifndef	NeXT
  
--- 31,37 ----
  #include "rx.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/xdr_array.c,v 1.9.2.4 2007/10/30 15:24:04 shadow Exp $");
  
  #ifndef	NeXT
  
***************
*** 58,63 ****
--- 58,64 ----
  #endif /* AFS_LINUX20_ENV */
  #else
  #include <stdio.h>
+ #include <string.h>
  #endif
  #include "xdr.h"
  
Index: openafs/src/rx/xdr_rec.c
diff -c openafs/src/rx/xdr_rec.c:1.6 openafs/src/rx/xdr_rec.c:1.6.2.2
*** openafs/src/rx/xdr_rec.c:1.6	Tue Jul 15 19:16:13 2003
--- openafs/src/rx/xdr_rec.c	Sun Feb  3 23:07:18 2008
***************
*** 47,53 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/xdr_rec.c,v 1.6 2003/07/15 23:16:13 shadow Exp $");
  
  #include <stdio.h>
  #ifdef HAVE_STDLIB_H
--- 47,53 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/xdr_rec.c,v 1.6.2.2 2008/02/04 04:07:18 jaltman Exp $");
  
  #include <stdio.h>
  #ifdef HAVE_STDLIB_H
***************
*** 59,71 ****
  #include <netinet/in.h>
  #endif
  
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  
  
  /*  * A record is composed of one or more record fragments.
--- 59,65 ----
***************
*** 114,120 ****
  			      register u_int len);
  static u_int xdrrec_getpos(register XDR * xdrs);
  static bool_t xdrrec_setpos(register XDR * xdrs, u_int pos);
! static afs_int32 *xdrrec_inline(register XDR * xdrs, int len);
  static void xdrrec_destroy(register XDR * xdrs);
  static bool_t flush_out(register RECSTREAM * rstrm, bool_t eor);
  static bool_t fill_input_buf(register RECSTREAM * rstrm);
--- 108,114 ----
  			      register u_int len);
  static u_int xdrrec_getpos(register XDR * xdrs);
  static bool_t xdrrec_setpos(register XDR * xdrs, u_int pos);
! static afs_int32 *xdrrec_inline(register XDR * xdrs, u_int len);
  static void xdrrec_destroy(register XDR * xdrs);
  static bool_t flush_out(register RECSTREAM * rstrm, bool_t eor);
  static bool_t fill_input_buf(register RECSTREAM * rstrm);
***************
*** 341,347 ****
  }
  
  static afs_int32 *
! xdrrec_inline(register XDR * xdrs, int len)
  {
      register RECSTREAM *rstrm = (RECSTREAM *) xdrs->x_private;
      afs_int32 *buf = NULL;
--- 335,341 ----
  }
  
  static afs_int32 *
! xdrrec_inline(register XDR * xdrs, u_int len)
  {
      register RECSTREAM *rstrm = (RECSTREAM *) xdrs->x_private;
      afs_int32 *buf = NULL;
Index: openafs/src/rx/xdr_refernce.c
diff -c openafs/src/rx/xdr_refernce.c:1.6.2.1 openafs/src/rx/xdr_refernce.c:1.6.2.2
*** openafs/src/rx/xdr_refernce.c:1.6.2.1	Thu Dec 15 00:57:12 2005
--- openafs/src/rx/xdr_refernce.c	Tue Oct 30 11:24:04 2007
***************
*** 31,37 ****
  #include "rx.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/xdr_refernce.c,v 1.6.2.1 2005/12/15 05:57:12 jaltman Exp $");
  
  #ifndef	NeXT
  
--- 31,37 ----
  #include "rx.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/xdr_refernce.c,v 1.6.2.2 2007/10/30 15:24:04 shadow Exp $");
  
  #ifndef	NeXT
  
***************
*** 46,51 ****
--- 46,52 ----
  
  #include "xdr.h"
  #include <stdio.h>
+ #include <string.h>
  #define LASTUNSIGNED	((u_int)0-1)
  
  /*
Index: openafs/src/rx/LINUX/rx_knet.c
diff -c openafs/src/rx/LINUX/rx_knet.c:1.23.2.14 openafs/src/rx/LINUX/rx_knet.c:1.23.2.15
*** openafs/src/rx/LINUX/rx_knet.c:1.23.2.14	Tue Jun 12 01:47:48 2007
--- openafs/src/rx/LINUX/rx_knet.c	Wed Jan 30 12:26:24 2008
***************
*** 16,22 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/LINUX/rx_knet.c,v 1.23.2.14 2007/06/12 05:47:48 rra Exp $");
  
  #include <linux/version.h>
  #ifdef AFS_LINUX22_ENV
--- 16,22 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/LINUX/rx_knet.c,v 1.23.2.15 2008/01/30 17:26:24 shadow Exp $");
  
  #include <linux/version.h>
  #ifdef AFS_LINUX22_ENV
***************
*** 216,251 ****
  {
      struct task_struct *listener;
      extern int rxk_ListenerPid;
  
!     while (rxk_ListenerPid) {
! #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
! 	listener = find_task_by_pid(rxk_ListenerPid);
!         if (listener) {
! 	    flush_signals(listener);
! 	    force_sig(SIGKILL, listener);
  	}
! #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
! 	if (!listener)
  	    break;
! 	afs_osi_Sleep(&rxk_ListenerPid);
      }
      sock_release(rx_socket);
      rx_socket = NULL;
--- 216,231 ----
  {
      struct task_struct *listener;
      extern int rxk_ListenerPid;
+     extern struct task_struct *rxk_ListenerTask;
  
!     while (rxk_ListenerTask) {
!         if (rxk_ListenerTask) {
! 	    flush_signals(rxk_ListenerTask);
! 	    force_sig(SIGKILL, rxk_ListenerTask);
  	}
! 	if (!rxk_ListenerTask)
  	    break;
! 	afs_osi_Sleep(&rxk_ListenerTask);
      }
      sock_release(rx_socket);
      rx_socket = NULL;
Index: openafs/src/rx/SOLARIS/rx_knet.c
diff -c openafs/src/rx/SOLARIS/rx_knet.c:1.19.2.2 openafs/src/rx/SOLARIS/rx_knet.c:1.19.2.4
*** openafs/src/rx/SOLARIS/rx_knet.c:1.19.2.2	Thu Oct  4 22:54:10 2007
--- openafs/src/rx/SOLARIS/rx_knet.c	Mon Mar 17 11:28:56 2008
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/SOLARIS/rx_knet.c,v 1.19.2.2 2007/10/05 02:54:10 shadow Exp $");
  
  #ifdef AFS_SUN5_ENV
  #include "rx/rx_kcommon.h"
--- 11,17 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/SOLARIS/rx_knet.c,v 1.19.2.4 2008/03/17 15:28:56 shadow Exp $");
  
  #ifdef AFS_SUN5_ENV
  #include "rx/rx_kcommon.h"
***************
*** 444,450 ****
--- 444,454 ----
  
      /* Was sockfs_sounbind(so, 0); sockfs_sockfree(so); That's wrong */
      vp = SOTOV(so);
+  #ifdef AFS_SUN511_ENV
+     VOP_CLOSE(vp, FREAD|FWRITE, 1, (offset_t)0, CRED(), NULL);
+  #else
      VOP_CLOSE(vp, FREAD|FWRITE, 1, (offset_t)0, CRED());
+  #endif
      VN_RELE(vp);
  
      return 0;
***************
*** 592,597 ****
--- 596,609 ----
      uint_t mtu;
      uint64_t flags;
  
+     if (afs_termState == AFSOP_STOP_NETIF) {
+ 	afs_warn("NetIfPoller... ");
+ 	rw_destroy(&afsifinfo_lock);
+ 	ddi_taskq_destroy(afs_taskq);
+ 	afs_termState = AFSOP_STOP_COMPLETE;
+ 	osi_rxWakeup(&afs_termState);
+ 	return;
+     }
      /* Get our permissions */
      cr = CRED();
  
Index: openafs/src/rx/UKERNEL/rx_knet.c
diff -c openafs/src/rx/UKERNEL/rx_knet.c:1.10.2.3 openafs/src/rx/UKERNEL/rx_knet.c:1.10.2.4
*** openafs/src/rx/UKERNEL/rx_knet.c:1.10.2.3	Thu Jan 26 15:55:38 2006
--- openafs/src/rx/UKERNEL/rx_knet.c	Mon Mar 10 18:35:36 2008
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/UKERNEL/rx_knet.c,v 1.10.2.3 2006/01/26 20:55:38 shadow Exp $");
  
  #include "rx/rx_kcommon.h"
  
--- 11,17 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/UKERNEL/rx_knet.c,v 1.10.2.4 2008/03/10 22:35:36 shadow Exp $");
  
  #include "rx/rx_kcommon.h"
  
***************
*** 134,141 ****
  /* This is the server process request loop. The server process loop
   * becomes a listener thread when rxi_ServerProc returns, and stays
   * listener thread until rxi_ListenerProc returns. */
! void
! rx_ServerProc(void)
  {
      osi_socket sock;
      int threadID;
--- 134,141 ----
  /* This is the server process request loop. The server process loop
   * becomes a listener thread when rxi_ServerProc returns, and stays
   * listener thread until rxi_ListenerProc returns. */
! void *
! rx_ServerProc(void *unused)
  {
      osi_socket sock;
      int threadID;
Index: openafs/src/rx/test/generator.c
diff -c openafs/src/rx/test/generator.c:1.8 openafs/src/rx/test/generator.c:1.8.2.1
*** openafs/src/rx/test/generator.c:1.8	Tue Jul 15 19:16:37 2003
--- openafs/src/rx/test/generator.c	Wed Oct 31 00:13:44 2007
***************
*** 53,59 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/test/generator.c,v 1.8 2003/07/15 23:16:37 shadow Exp $");
  
  #include <stdio.h>
  #include <string.h>
--- 53,59 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/test/generator.c,v 1.8.2.1 2007/10/31 04:13:44 shadow Exp $");
  
  #include <stdio.h>
  #include <string.h>
***************
*** 731,737 ****
      fprintf(itl_h, "}\n");
  
      fprintf(itl_h,
! 	    "\n\nstatic void DoRun(struct cmd_syndesc *as, char *arock) {\n");
  
      if (threadModel == PTHREADS) {
  	fprintf(itl_h, "\tpthread_t *tid;\n");
--- 731,737 ----
      fprintf(itl_h, "}\n");
  
      fprintf(itl_h,
! 	    "\n\nstatic void DoRun(struct cmd_syndesc *as, void *arock) {\n");
  
      if (threadModel == PTHREADS) {
  	fprintf(itl_h, "\tpthread_t *tid;\n");
***************
*** 802,808 ****
  
      fprintf(itl_h,
  	    "static void SetupRunCmd(void) {\n" "\tstruct cmd_syndesc *ts;\n"
! 	    "\tts = cmd_CreateSyntax(NULL,DoRun, 0, \"run the test client program\");\n"
  	    "\tcmd_AddParm(ts, \"-threadCount\", CMD_SINGLE, CMD_REQUIRED, \"number of threads to spawn\");\n"
  	    "\tcmd_AddParm(ts, \"-iterationCount\", CMD_SINGLE, CMD_REQUIRED, \"number of iterations to make over entire interface for each thread\");\n"
  	    "\tcmd_AddParm(ts, \"-secType\", CMD_SINGLE, CMD_REQUIRED, \"security level to use (1 -> unauthenticated, 2 -> authenticated)\");\n"
--- 802,808 ----
  
      fprintf(itl_h,
  	    "static void SetupRunCmd(void) {\n" "\tstruct cmd_syndesc *ts;\n"
! 	    "\tts = cmd_CreateSyntax(NULL,DoRun, NULL, \"run the test client program\");\n"
  	    "\tcmd_AddParm(ts, \"-threadCount\", CMD_SINGLE, CMD_REQUIRED, \"number of threads to spawn\");\n"
  	    "\tcmd_AddParm(ts, \"-iterationCount\", CMD_SINGLE, CMD_REQUIRED, \"number of iterations to make over entire interface for each thread\");\n"
  	    "\tcmd_AddParm(ts, \"-secType\", CMD_SINGLE, CMD_REQUIRED, \"security level to use (1 -> unauthenticated, 2 -> authenticated)\");\n"
***************
*** 1187,1193 ****
  	    "\nstatic long GetKey (char *rock, long kvno, struct ktc_encryptionKey *key) {\n"
  	    "\tmemcpy ((void *) key, (void *) &serviceKey, sizeof(*key));\n"
  	    "\treturn 0;\n" "}\n\n"
! 	    "static void DoRun(struct cmd_syndesc *as, char *arock) {\n"
  	    "\tstruct rx_service *serv;\n"
  	    "\tstruct rx_securityClass *sc[3];\n\n"
  	    "\tint port=0, errflg=0;\n" "\tint lowThreads=4, highThreads=8;\n"
--- 1187,1193 ----
  	    "\nstatic long GetKey (char *rock, long kvno, struct ktc_encryptionKey *key) {\n"
  	    "\tmemcpy ((void *) key, (void *) &serviceKey, sizeof(*key));\n"
  	    "\treturn 0;\n" "}\n\n"
! 	    "static void DoRun(struct cmd_syndesc *as, void *arock) {\n"
  	    "\tstruct rx_service *serv;\n"
  	    "\tstruct rx_securityClass *sc[3];\n\n"
  	    "\tint port=0, errflg=0;\n" "\tint lowThreads=4, highThreads=8;\n"
***************
*** 1204,1210 ****
  	    "\t\trx_SetMaxProcs(serv,highThreads);\n"
  	    "\t\trx_StartServer(1);\n" "\t}\n" "\texit(0);\n" "}\n\n"
  	    "static void SetupRunCmd(void) {\n" "\tstruct cmd_syndesc *ts;\n"
! 	    "\tts = cmd_CreateSyntax(NULL,DoRun, 0, \"run the test server program\");\n"
  	    "\tcmd_AddParm(ts, \"-lowThreadCount\", CMD_SINGLE, CMD_REQUIRED, \"minimum number of threads to spawn\");\n"
  	    "\tcmd_AddParm(ts, \"-highThreadCount\", CMD_SINGLE, CMD_REQUIRED, \"maximum number of threads to spawn\");\n"
  	    "\tcmd_AddParm(ts, \"-serverPort\", CMD_SINGLE, CMD_REQUIRED, \"port that server is using\");\n"
--- 1204,1210 ----
  	    "\t\trx_SetMaxProcs(serv,highThreads);\n"
  	    "\t\trx_StartServer(1);\n" "\t}\n" "\texit(0);\n" "}\n\n"
  	    "static void SetupRunCmd(void) {\n" "\tstruct cmd_syndesc *ts;\n"
! 	    "\tts = cmd_CreateSyntax(NULL,DoRun, NULL, \"run the test server program\");\n"
  	    "\tcmd_AddParm(ts, \"-lowThreadCount\", CMD_SINGLE, CMD_REQUIRED, \"minimum number of threads to spawn\");\n"
  	    "\tcmd_AddParm(ts, \"-highThreadCount\", CMD_SINGLE, CMD_REQUIRED, \"maximum number of threads to spawn\");\n"
  	    "\tcmd_AddParm(ts, \"-serverPort\", CMD_SINGLE, CMD_REQUIRED, \"port that server is using\");\n"
Index: openafs/src/rxdebug/rxdebug.c
diff -c openafs/src/rxdebug/rxdebug.c:1.5.2.1 openafs/src/rxdebug/rxdebug.c:1.5.2.3
*** openafs/src/rxdebug/rxdebug.c:1.5.2.1	Tue Dec  7 01:17:15 2004
--- openafs/src/rxdebug/rxdebug.c	Wed Oct 31 00:13:44 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxdebug/rxdebug.c,v 1.5.2.1 2004/12/07 06:17:15 shadow Exp $");
  
  #include <sys/types.h>
  #include <errno.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxdebug/rxdebug.c,v 1.5.2.3 2007/10/31 04:13:44 shadow Exp $");
  
  #include <sys/types.h>
  #include <errno.h>
***************
*** 32,44 ****
  #ifdef HAVE_UNISTD_H
  #include <unistd.h>
  #endif
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <sys/stat.h>
  #include <afs/stds.h>
  #include <afs/cmd.h>
--- 32,38 ----
***************
*** 85,93 ****
  }
  
  int
! MainCommand(as, arock)
!      char *arock;
!      struct cmd_syndesc *as;
  {
      register int i;
      int s;
--- 79,85 ----
  }
  
  int
! MainCommand(struct cmd_syndesc *as, void *arock)
  {
      register int i;
      int s;
***************
*** 592,598 ****
      }
  #endif
  
!     ts = cmd_CreateSyntax(NULL, MainCommand, 0, "probe RX server");
      cmd_AddParm(ts, "-servers", CMD_SINGLE, CMD_REQUIRED, "server machine");
      cmd_AddParm(ts, "-port", CMD_SINGLE, CMD_OPTIONAL, "IP port");
      cmd_AddParm(ts, "-nodally", CMD_FLAG, CMD_OPTIONAL,
--- 584,590 ----
      }
  #endif
  
!     ts = cmd_CreateSyntax(NULL, MainCommand, NULL, "probe RX server");
      cmd_AddParm(ts, "-servers", CMD_SINGLE, CMD_REQUIRED, "server machine");
      cmd_AddParm(ts, "-port", CMD_SINGLE, CMD_OPTIONAL, "IP port");
      cmd_AddParm(ts, "-nodally", CMD_FLAG, CMD_OPTIONAL,
Index: openafs/src/rxgen/Makefile.in
diff -c openafs/src/rxgen/Makefile.in:1.8 openafs/src/rxgen/Makefile.in:1.8.2.1
*** openafs/src/rxgen/Makefile.in:1.8	Sat Jan 11 02:34:52 2003
--- openafs/src/rxgen/Makefile.in	Tue Jan  8 13:57:28 2008
***************
*** 18,23 ****
--- 18,26 ----
  rxgen: $(OBJS) AFS_component_version_number.c $(HDRS)
  	$(CC) $(CFLAGS) $(OBJS) $(XLIBS) -o $@
  
+ rpc_main.o: rpc_main.c
+ 	$(CCOBJ) $(CFLAGS) -c $< -D__PROG_CPP__="\"$(CPP)\""
+ 
  #
  # Install targets
  #
Index: openafs/src/rxgen/rpc_cout.c
diff -c openafs/src/rxgen/rpc_cout.c:1.9 openafs/src/rxgen/rpc_cout.c:1.9.2.1
*** openafs/src/rxgen/rpc_cout.c:1.9	Tue Jul 15 19:16:39 2003
--- openafs/src/rxgen/rpc_cout.c	Tue Oct 30 11:24:05 2007
***************
*** 36,52 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxgen/rpc_cout.c,v 1.9 2003/07/15 23:16:39 shadow Exp $");
  
  #include <stdio.h>
  #include <stdlib.h>
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include "rpc_scan.h"
  #include "rpc_parse.h"
  #include "rpc_util.h"
--- 36,46 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxgen/rpc_cout.c,v 1.9.2.1 2007/10/30 15:24:05 shadow Exp $");
  
  #include <stdio.h>
  #include <stdlib.h>
  #include <string.h>
  #include "rpc_scan.h"
  #include "rpc_parse.h"
  #include "rpc_util.h"
Index: openafs/src/rxgen/rpc_hout.c
diff -c openafs/src/rxgen/rpc_hout.c:1.7.2.3 openafs/src/rxgen/rpc_hout.c:1.7.2.4
*** openafs/src/rxgen/rpc_hout.c:1.7.2.3	Mon Jul 31 13:07:50 2006
--- openafs/src/rxgen/rpc_hout.c	Tue Feb  5 13:53:22 2008
***************
*** 36,42 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxgen/rpc_hout.c,v 1.7.2.3 2006/07/31 17:07:50 shadow Exp $");
  
  #include <stdio.h>
  #include <string.h>
--- 36,42 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxgen/rpc_hout.c,v 1.7.2.4 2008/02/05 18:53:22 shadow Exp $");
  
  #include <stdio.h>
  #include <string.h>
***************
*** 268,276 ****
  		(1 << DEF_INPARAM) | (1 << DEF_INOUTPARAM));
  	psproc1(defp, 1, "int", "End",
  		(1 << DEF_OUTPARAM) | (1 << DEF_INOUTPARAM));
!     } else {
! 	psproc1(defp, 0, "int", "", 0xFFFFFFFF);
!     }
  
      if (uflag && !kflag)
  	psproc1(defp, 2, "int", "ubik_", 0xFFFFFFFF);
--- 268,276 ----
  		(1 << DEF_INPARAM) | (1 << DEF_INOUTPARAM));
  	psproc1(defp, 1, "int", "End",
  		(1 << DEF_OUTPARAM) | (1 << DEF_INOUTPARAM));
!     } 
!     if (!(!multi_flag && split_flag))
!         psproc1(defp, 0, "int", "", 0xFFFFFFFF);
  
      if (uflag && !kflag)
  	psproc1(defp, 2, "int", "ubik_", 0xFFFFFFFF);
Index: openafs/src/rxgen/rpc_main.c
diff -c openafs/src/rxgen/rpc_main.c:1.21.2.3 openafs/src/rxgen/rpc_main.c:1.21.2.6
*** openafs/src/rxgen/rpc_main.c:1.21.2.3	Thu Aug 24 11:56:44 2006
--- openafs/src/rxgen/rpc_main.c	Tue Jan  8 13:57:28 2008
***************
*** 37,55 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxgen/rpc_main.c,v 1.21.2.3 2006/08/24 15:56:44 shadow Exp $");
  
  #include <limits.h>
  #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_SIGNAL_H
  #include <signal.h>
  #endif
--- 37,49 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxgen/rpc_main.c,v 1.21.2.6 2008/01/08 18:57:28 shadow Exp $");
  
  #include <limits.h>
  #include <stdio.h>
  #include <stdlib.h>
  #include <ctype.h>
  #include <string.h>
  #ifdef HAVE_SIGNAL_H
  #include <signal.h>
  #endif
***************
*** 66,71 ****
--- 60,66 ----
  #define EXTEND	1		/* alias for TRUE */
  
  struct commandline {
+     int ansic_flag;
      int cflag;
      int hflag;
      int lflag;
***************
*** 93,111 ****
  char *OutFileFlag = "";
  char OutFile[256];
  char Sflag = 0, Cflag = 0, hflag = 0, cflag = 0, kflag = 0, uflag = 0;
  char zflag = 0;			/* If set, abort server stub if rpc call returns non-zero */
  char xflag = 0;			/* if set, add stats code to stubs */
  char yflag = 0;			/* if set, only emit function name arrays to xdr file */
  int debug = 0;
  static char *cmdname;
! #ifdef	AFS_SUN5_ENV
! static char CPP[] = "/usr/ccs/lib/cpp";
! #elif defined(AFS_XBSD_ENV) || defined(AFS_DARWIN60_ENV)
! static char CPP[] = "/usr/bin/cpp";
! #elif defined(AFS_NT40_ENV)
! static char CPP[MAXCMDLINE];
! #elif defined(AFS_DARWIN_ENV)
! static char CPP[] = "cc -E";
  #else
  static char CPP[] = "/lib/cpp";
  #endif
--- 88,101 ----
  char *OutFileFlag = "";
  char OutFile[256];
  char Sflag = 0, Cflag = 0, hflag = 0, cflag = 0, kflag = 0, uflag = 0;
+ char ansic_flag = 0;		/* If set, build ANSI C style prototypes */
  char zflag = 0;			/* If set, abort server stub if rpc call returns non-zero */
  char xflag = 0;			/* if set, add stats code to stubs */
  char yflag = 0;			/* if set, only emit function name arrays to xdr file */
  int debug = 0;
  static char *cmdname;
! #ifdef	__PROG_CPP__
! static char CPP[] = __PROG_CPP__;
  #else
  static char CPP[] = "/lib/cpp";
  #endif
***************
*** 808,813 ****
--- 798,804 ----
  	    for (j = 1; argv[i][j] != 0; j++) {
  		c = argv[i][j];
  		switch (c) {
+ 		case 'A':
  		case 'c':
  		case 'h':
  		case 'l':
***************
*** 866,871 ****
--- 857,863 ----
  	    ;
  	}
      }
+     cmd->ansic_flag = ansic_flag = flag['A'];
      cmd->cflag = cflag = flag['c'];
      cmd->hflag = hflag = flag['h'];
      cmd->sflag = flag['s'];
Index: openafs/src/rxgen/rpc_parse.c
diff -c openafs/src/rxgen/rpc_parse.c:1.18.2.3 openafs/src/rxgen/rpc_parse.c:1.18.2.5
*** openafs/src/rxgen/rpc_parse.c:1.18.2.3	Mon Jul 31 17:51:21 2006
--- openafs/src/rxgen/rpc_parse.c	Thu Nov  1 12:06:00 2007
***************
*** 36,53 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxgen/rpc_parse.c,v 1.18.2.3 2006/07/31 21:51:21 shadow Exp $");
  
  #include <stdlib.h>
  #include <stdio.h>
  #include <ctype.h>
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include "rpc_scan.h"
  #include "rpc_parse.h"
  #include "rpc_util.h"
--- 36,47 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxgen/rpc_parse.c,v 1.18.2.5 2007/11/01 16:06:00 shadow Exp $");
  
  #include <stdlib.h>
  #include <stdio.h>
  #include <ctype.h>
  #include <string.h>
  #include "rpc_scan.h"
  #include "rpc_parse.h"
  #include "rpc_util.h"
***************
*** 1116,1136 ****
      }
  }
  
- 
  static void
  cs_ProcName_setup(definition * defp, char *procheader, int split_flag)
  {
      proc1_list *plist;
  
!     if (!cflag) {
  	if (split_flag) {
! 	    f_print(fout, "int %s%s%s%s(z_call", procheader, prefix,
! 		    PackagePrefix[PackageIndex], defp->pc.proc_name);
  	} else {
! 	    f_print(fout, "int %s%s%s%s(z_conn", procheader, prefix,
! 		    PackagePrefix[PackageIndex], defp->pc.proc_name);
  	}
      }
      if ((strlen(procheader) + strlen(prefix) +
  	 strlen(PackagePrefix[PackageIndex]) + strlen(defp->pc.proc_name)) >=
  	MAX_FUNCTION_NAME_LEN) {
--- 1110,1139 ----
      }
  }
  
  static void
  cs_ProcName_setup(definition * defp, char *procheader, int split_flag)
  {
      proc1_list *plist;
+     char *first_arg;
  
!     if (ansic_flag) {
! 	if (split_flag) {
! 	    first_arg = "register struct rx_call *z_call";
! 	} else {
! 	    first_arg = "register struct rx_connection *z_conn";
! 	}
!     } else {
  	if (split_flag) {
! 	    first_arg = "z_call";
  	} else {
! 	    first_arg = "z_conn";
  	}
      }
+ 
+     if (!cflag) {
+ 	f_print(fout, "int %s%s%s%s(%s", procheader, prefix,
+ 		PackagePrefix[PackageIndex], defp->pc.proc_name, first_arg);
+     }
      if ((strlen(procheader) + strlen(prefix) +
  	 strlen(PackagePrefix[PackageIndex]) + strlen(defp->pc.proc_name)) >=
  	MAX_FUNCTION_NAME_LEN) {
***************
*** 1139,1158 ****
      if (!cflag) {
  	for (plist = defp->pc.plists; plist; plist = plist->next) {
  	    if (plist->component_kind == DEF_PARAM) {
! 		plist->pl.param_flag &= ~PROCESSED_PARAM;
! 		f_print(fout, ", %s", plist->pl.param_name);
  	    }
  	}
  	f_print(fout, ")\n");
      }
  }
  
- 
  static void
  cs_ProcParams_setup(definition * defp, int split_flag)
  {
      proc1_list *plist, *plist1;
  
      if (!split_flag)
  	f_print(fout, "\tregister struct rx_connection *z_conn;\n");
      if (split_flag) {
--- 1142,1173 ----
      if (!cflag) {
  	for (plist = defp->pc.plists; plist; plist = plist->next) {
  	    if (plist->component_kind == DEF_PARAM) {
! 		if (ansic_flag) {
! 		    if (plist->pl.param_flag & OUT_STRING) {
! 			f_print(fout, ",%s *%s", plist->pl.param_type,
! 				plist->pl.param_name);
! 		    } else {
! 			f_print(fout, ",%s %s", plist->pl.param_type,
! 				plist->pl.param_name);
! 		    }
! 		} else {
! 		    f_print(fout, ", %s", plist->pl.param_name);    
! 		    plist->pl.param_flag &= ~PROCESSED_PARAM;
! 		}
  	    }
  	}
  	f_print(fout, ")\n");
      }
  }
  
  static void
  cs_ProcParams_setup(definition * defp, int split_flag)
  {
      proc1_list *plist, *plist1;
  
+     if (ansic_flag)
+ 	return;
+ 
      if (!split_flag)
  	f_print(fout, "\tregister struct rx_connection *z_conn;\n");
      if (split_flag) {
***************
*** 1748,1755 ****
      proc1_list *plist;
  
      if (!cflag) {
!       f_print(fout, "int %s%s%s%s(aclient, aflags", procheader, prefix,
! 	      PackagePrefix[PackageIndex], defp->pc.proc_name);
      }
      if ((strlen(procheader) + strlen(prefix) +
  	 strlen(PackagePrefix[PackageIndex]) + strlen(defp->pc.proc_name)) >=
--- 1763,1776 ----
      proc1_list *plist;
  
      if (!cflag) {
!      	if (ansic_flag) {
! 	    f_print(fout, "int %s%s%s%s(register struct ubik_client *aclient, afs_int32 aflags",
! 			  procheader, prefix, PackagePrefix[PackageIndex],
! 			  defp->pc.proc_name);
! 	} else {
! 	    f_print(fout, "int %s%s%s%s(aclient, aflags", procheader, prefix,
! 			  PackagePrefix[PackageIndex], defp->pc.proc_name);
! 	}
      }
      if ((strlen(procheader) + strlen(prefix) +
  	 strlen(PackagePrefix[PackageIndex]) + strlen(defp->pc.proc_name)) >=
***************
*** 1759,1766 ****
      if (!cflag) {
  	for (plist = defp->pc.plists; plist; plist = plist->next) {
  	    if (plist->component_kind == DEF_PARAM) {
! 		plist->pl.param_flag &= ~PROCESSED_PARAM;
! 		f_print(fout, ", %s", plist->pl.param_name);
  	    }
  	}
  	f_print(fout, ")\n");
--- 1780,1797 ----
      if (!cflag) {
  	for (plist = defp->pc.plists; plist; plist = plist->next) {
  	    if (plist->component_kind == DEF_PARAM) {
! 		if (ansic_flag) {
! 		    if (plist->pl.param_flag & OUT_STRING) {
! 			f_print(fout, ",%s *%s", plist->pl.param_type,
! 				plist->pl.param_name);
! 		    } else {
! 			f_print(fout, ",%s %s", plist->pl.param_type,
! 				plist->pl.param_name);
! 		    }
! 		} else {
! 		    plist->pl.param_flag &= ~PROCESSED_PARAM;
! 		    f_print(fout, ", %s", plist->pl.param_name);
! 		}
  	    }
  	}
  	f_print(fout, ")\n");
***************
*** 1773,1778 ****
--- 1804,1812 ----
  {
      proc1_list *plist, *plist1;
  
+     if (ansic_flag)
+ 	return;
+ 
      f_print(fout, "\tregister struct ubik_client *aclient;\n\tafs_int32 aflags;\n");
      for (plist = defp->pc.plists; plist; plist = plist->next) {
  	if (plist->component_kind == DEF_PARAM
Index: openafs/src/rxgen/rpc_scan.c
diff -c openafs/src/rxgen/rpc_scan.c:1.9 openafs/src/rxgen/rpc_scan.c:1.9.2.1
*** openafs/src/rxgen/rpc_scan.c:1.9	Fri Oct 24 02:26:14 2003
--- openafs/src/rxgen/rpc_scan.c	Tue Oct 30 11:24:05 2007
***************
*** 38,55 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxgen/rpc_scan.c,v 1.9 2003/10/24 06:26:14 shadow Exp $");
  
  #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
  #include "rpc_scan.h"
  #include "rpc_parse.h"
  #include "rpc_util.h"
--- 38,50 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxgen/rpc_scan.c,v 1.9.2.1 2007/10/30 15:24:05 shadow Exp $");
  
  #include <stdio.h>
  #include <stdlib.h>
  #include <ctype.h>
  #include <string.h>
! 
  #include "rpc_scan.h"
  #include "rpc_parse.h"
  #include "rpc_util.h"
Index: openafs/src/rxgen/rpc_svcout.c
diff -c openafs/src/rxgen/rpc_svcout.c:1.9 openafs/src/rxgen/rpc_svcout.c:1.9.2.1
*** openafs/src/rxgen/rpc_svcout.c:1.9	Tue Jul 15 19:16:41 2003
--- openafs/src/rxgen/rpc_svcout.c	Tue Oct 30 11:24:05 2007
***************
*** 36,51 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxgen/rpc_svcout.c,v 1.9 2003/07/15 23:16:41 shadow Exp $");
  
  #include <stdio.h>
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include "rpc_scan.h"
  #include "rpc_parse.h"
  #include "rpc_util.h"
--- 36,45 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxgen/rpc_svcout.c,v 1.9.2.1 2007/10/30 15:24:05 shadow Exp $");
  
  #include <stdio.h>
  #include <string.h>
  #include "rpc_scan.h"
  #include "rpc_parse.h"
  #include "rpc_util.h"
Index: openafs/src/rxgen/rpc_util.c
diff -c openafs/src/rxgen/rpc_util.c:1.9 openafs/src/rxgen/rpc_util.c:1.9.2.1
*** openafs/src/rxgen/rpc_util.c:1.9	Tue Jul 15 19:16:41 2003
--- openafs/src/rxgen/rpc_util.c	Tue Oct 30 11:24:05 2007
***************
*** 36,51 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxgen/rpc_util.c,v 1.9 2003/07/15 23:16:41 shadow Exp $");
  
  #include <stdio.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
--- 36,45 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxgen/rpc_util.c,v 1.9.2.1 2007/10/30 15:24:05 shadow Exp $");
  
  #include <stdio.h>
  #include <string.h>
  #ifdef HAVE_UNISTD_H
  #include <unistd.h>
  #endif
Index: openafs/src/rxgen/rpc_util.h
diff -c openafs/src/rxgen/rpc_util.h:1.4.2.1 openafs/src/rxgen/rpc_util.h:1.4.2.2
*** openafs/src/rxgen/rpc_util.h:1.4.2.1	Mon Jul 31 13:07:51 2006
--- openafs/src/rxgen/rpc_util.h	Thu Nov  1 12:06:00 2007
***************
*** 57,62 ****
--- 57,63 ----
  extern char *OutFileFlag;
  extern char OutFile[];
  extern char Sflag, Cflag, hflag, cflag, kflag, uflag;
+ extern char ansic_flag;
  extern char zflag;
  extern char xflag;
  extern char yflag;
Index: openafs/src/rxkad/crc.c
diff -c openafs/src/rxkad/crc.c:1.3 openafs/src/rxkad/crc.c:1.3.2.1
*** openafs/src/rxkad/crc.c:1.3	Tue Jul 15 19:16:42 2003
--- openafs/src/rxkad/crc.c	Tue Oct 30 11:24:05 2007
***************
*** 41,47 ****
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxkad/crc.c,v 1.3 2003/07/15 23:16:42 shadow Exp $");
  
  #if defined(UKERNEL)
  #include "../afs/sysincludes.h"
--- 41,47 ----
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxkad/crc.c,v 1.3.2.1 2007/10/30 15:24:05 shadow Exp $");
  
  #if defined(UKERNEL)
  #include "../afs/sysincludes.h"
***************
*** 60,72 ****
  #else
  #include <netinet/in.h>
  #endif
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <rx/xdr.h>
  #include <rx/rx.h>
  #include <des.h>
--- 60,66 ----
Index: openafs/src/rxkad/md4.c
diff -c openafs/src/rxkad/md4.c:1.1.2.2 openafs/src/rxkad/md4.c:1.1.2.3
*** openafs/src/rxkad/md4.c:1.1.2.2	Wed Aug  2 15:07:04 2006
--- openafs/src/rxkad/md4.c	Tue Oct 30 11:24:05 2007
***************
*** 55,67 ****
  #else
  #include <netinet/in.h>
  #endif
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <rx/xdr.h>
  #include <rx/rx.h>
  #include <des.h>
--- 55,61 ----
***************
*** 69,75 ****
  #include "rxkad.h"
  #endif /* defined(UKERNEL) */
  
! RCSID("$Id: md4.c,v 1.1.2.2 2006/08/02 19:07:04 shadow Exp $");
  
  
  
--- 63,69 ----
  #include "rxkad.h"
  #endif /* defined(UKERNEL) */
  
! RCSID("$Id: md4.c,v 1.1.2.3 2007/10/30 15:24:05 shadow Exp $");
  
  
  
Index: openafs/src/rxkad/md5.c
diff -c openafs/src/rxkad/md5.c:1.1.2.2 openafs/src/rxkad/md5.c:1.1.2.3
*** openafs/src/rxkad/md5.c:1.1.2.2	Wed Aug  2 15:07:04 2006
--- openafs/src/rxkad/md5.c	Tue Oct 30 11:24:05 2007
***************
*** 55,75 ****
  #else
  #include <netinet/in.h>
  #endif
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
- #include <rx/xdr.h>
  #include <rx/rx.h>
  #include <des.h>
  #include "lifetimes.h"
  #include "rxkad.h"
  #endif /* defined(UKERNEL) */
  
! RCSID("$Id: md5.c,v 1.1.2.2 2006/08/02 19:07:04 shadow Exp $");
  
  
  
--- 55,68 ----
  #else
  #include <netinet/in.h>
  #endif
  #include <string.h>
  #include <rx/rx.h>
  #include <des.h>
  #include "lifetimes.h"
  #include "rxkad.h"
  #endif /* defined(UKERNEL) */
  
! RCSID("$Id: md5.c,v 1.1.2.3 2007/10/30 15:24:05 shadow Exp $");
  
  
  
Index: openafs/src/rxkad/private_data.h
diff -c openafs/src/rxkad/private_data.h:1.4.2.3 openafs/src/rxkad/private_data.h:1.4.2.4
*** openafs/src/rxkad/private_data.h:1.4.2.3	Wed Nov 29 16:23:46 2006
--- openafs/src/rxkad/private_data.h	Tue Jan 22 23:22:51 2008
***************
*** 77,82 ****
--- 77,83 ----
      char *get_key_rock;		/* rock for get_key function */
      int (*get_key) ();		/* func. of kvno and server key ptr */
      int (*user_ok) ();		/* func called with new client name */
+     afs_uint32 flags;		/* configuration flags */
  };
  
  /* private data in server-side connection */
Index: openafs/src/rxkad/rxkad_client.c
diff -c openafs/src/rxkad/rxkad_client.c:1.18.2.5 openafs/src/rxkad/rxkad_client.c:1.18.2.7
*** openafs/src/rxkad/rxkad_client.c:1.18.2.5	Tue May 23 12:31:02 2006
--- openafs/src/rxkad/rxkad_client.c	Fri Jan  4 13:08:23 2008
***************
*** 19,32 ****
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxkad/rxkad_client.c,v 1.18.2.5 2006/05/23 16:31:02 jaltman Exp $");
  
  #ifdef KERNEL
  #include "afs/stds.h"
  #ifndef UKERNEL
  #include "h/types.h"
  #include "h/time.h"
! #if defined(AFS_AIX_ENV) || defined(AFS_AUX_ENV) || defined(AFS_SUN5_ENV) 
  #include "h/systm.h"
  #endif
  #ifdef AFS_LINUX20_ENV
--- 19,32 ----
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxkad/rxkad_client.c,v 1.18.2.7 2008/01/04 18:08:23 rees Exp $");
  
  #ifdef KERNEL
  #include "afs/stds.h"
  #ifndef UKERNEL
  #include "h/types.h"
  #include "h/time.h"
! #if defined(AFS_AIX_ENV) || defined(AFS_AUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_XBSD_ENV)
  #include "h/systm.h"
  #endif
  #ifdef AFS_LINUX20_ENV
***************
*** 47,59 ****
  #include <afs/stds.h>
  #include <sys/types.h>
  #include <time.h>
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #else
--- 47,53 ----
Index: openafs/src/rxkad/rxkad_common.c
diff -c openafs/src/rxkad/rxkad_common.c:1.20.2.10 openafs/src/rxkad/rxkad_common.c:1.20.2.11
*** openafs/src/rxkad/rxkad_common.c:1.20.2.10	Tue May 23 12:31:02 2006
--- openafs/src/rxkad/rxkad_common.c	Tue Oct 30 11:24:05 2007
***************
*** 23,29 ****
  #define INCLUDE_RXKAD_PRIVATE_DECLS
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxkad/rxkad_common.c,v 1.20.2.10 2006/05/23 16:31:02 jaltman Exp $");
  
  #ifdef KERNEL
  #ifndef UKERNEL
--- 23,29 ----
  #define INCLUDE_RXKAD_PRIVATE_DECLS
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxkad/rxkad_common.c,v 1.20.2.11 2007/10/30 15:24:05 shadow Exp $");
  
  #ifdef KERNEL
  #ifndef UKERNEL
***************
*** 50,55 ****
--- 50,56 ----
  #else /* KERNEL */
  #include <afs/stds.h>
  #include <sys/types.h>
+ #include <string.h>
  #include <time.h>
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
***************
*** 61,73 ****
  #endif
  #include <rx/rx.h>
  #include <rx/xdr.h>
- #ifdef HAVE_STRING_H
- #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <afs/afsutil.h>
  #endif /* KERNEL */
  
--- 62,67 ----
Index: openafs/src/rxkad/rxkad_prototypes.h
diff -c openafs/src/rxkad/rxkad_prototypes.h:1.9.2.4 openafs/src/rxkad/rxkad_prototypes.h:1.9.2.5
*** openafs/src/rxkad/rxkad_prototypes.h:1.9.2.4	Fri Apr 15 14:35:46 2005
--- openafs/src/rxkad/rxkad_prototypes.h	Tue Jan 22 23:22:51 2008
***************
*** 120,127 ****
  				     afs_uint32 * expiration, char *name,
  				     char *instance, char *cell,
  				     afs_int32 * kvno);
! 
! 
  
  /* ticket.c */
  extern int tkt_DecodeTicket(char *asecret, afs_int32 ticketLen,
--- 120,129 ----
  				     afs_uint32 * expiration, char *name,
  				     char *instance, char *cell,
  				     afs_int32 * kvno);
! extern afs_int32 rxkad_SetConfiguration(struct rx_securityClass *aobj,
!                                         struct rx_connection *aconn, 
!                                         rx_securityConfigVariables atype,
!                                         void * avalue, void **aresult);
  
  /* ticket.c */
  extern int tkt_DecodeTicket(char *asecret, afs_int32 ticketLen,
***************
*** 147,152 ****
  			     char *get_key_rock, int serv_kvno, char *name,
  			     char *inst, char *cell, char *session_key,
  			     afs_int32 * host, afs_int32 * start,
! 			     afs_int32 * end);
  
  #endif
--- 149,154 ----
  			     char *get_key_rock, int serv_kvno, char *name,
  			     char *inst, char *cell, char *session_key,
  			     afs_int32 * host, afs_int32 * start,
! 			     afs_int32 * end, afs_int32 disableDotCheck);
  
  #endif
Index: openafs/src/rxkad/rxkad_server.c
diff -c openafs/src/rxkad/rxkad_server.c:1.14.2.9 openafs/src/rxkad/rxkad_server.c:1.14.2.11
*** openafs/src/rxkad/rxkad_server.c:1.14.2.9	Sun Jun 10 10:22:49 2007
--- openafs/src/rxkad/rxkad_server.c	Tue Jan 22 23:22:51 2008
***************
*** 15,21 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxkad/rxkad_server.c,v 1.14.2.9 2007/06/10 14:22:49 jaltman Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 15,21 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxkad/rxkad_server.c,v 1.14.2.11 2008/01/23 04:22:51 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 28,40 ****
  #else
  #include <netinet/in.h>
  #endif
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <rx/rx.h>
  #include <rx/xdr.h>
  #include <des.h>
--- 28,34 ----
***************
*** 63,69 ****
      rxkad_CheckPacket,		/* check data packet */
      rxkad_DestroyConnection,
      rxkad_GetStats,
!     0,				/* spare 1 */
      0,				/* spare 2 */
      0,				/* spare 3 */
  };
--- 57,63 ----
      rxkad_CheckPacket,		/* check data packet */
      rxkad_DestroyConnection,
      rxkad_GetStats,
!     rxkad_SetConfiguration,
      0,				/* spare 2 */
      0,				/* spare 3 */
  };
***************
*** 333,339 ****
  	code =
  	    tkt_DecodeTicket5(tix, tlen, tsp->get_key, tsp->get_key_rock,
  			      kvno, client.name, client.instance, client.cell,
! 			      &sessionkey, &host, &start, &end);
  	if (code)
  	    return code;
      }
--- 327,334 ----
  	code =
  	    tkt_DecodeTicket5(tix, tlen, tsp->get_key, tsp->get_key_rock,
  			      kvno, client.name, client.instance, client.cell,
! 			      &sessionkey, &host, &start, &end, 
! 			      tsp->flags & RXS_CONFIG_FLAGS_DISABLE_DOTCHECK);
  	if (code)
  	    return code;
      }
***************
*** 458,460 ****
--- 453,478 ----
      } else
  	return RXKADNOAUTH;
  }
+ 
+ /* Set security object configuration variables */
+ afs_int32 rxkad_SetConfiguration(struct rx_securityClass *aobj,
+                                  struct rx_connection *aconn, 
+                                  rx_securityConfigVariables atype,
+ 		                         void * avalue, void **currentValue)
+ {
+     struct rxkad_sprivate *private = 
+     (struct rxkad_sprivate *) aobj->privateData;
+ 
+     switch (atype) {
+     case RXS_CONFIG_FLAGS:
+         if (currentValue) {
+             *((afs_uint32 *)currentValue) = private->flags;
+         } else { 
+             private->flags = (afs_uint32) avalue;
+         }
+         break;
+     default:
+         break;
+     }
+     return 0;
+ }
Index: openafs/src/rxkad/ticket.c
diff -c openafs/src/rxkad/ticket.c:1.13.2.1 openafs/src/rxkad/ticket.c:1.13.2.2
*** openafs/src/rxkad/ticket.c:1.13.2.1	Sat Nov  4 18:50:38 2006
--- openafs/src/rxkad/ticket.c	Tue Oct 30 11:24:05 2007
***************
*** 15,21 ****
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxkad/ticket.c,v 1.13.2.1 2006/11/04 23:50:38 jaltman Exp $");
  
  #if defined(UKERNEL)
  #include "afs/sysincludes.h"
--- 15,21 ----
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxkad/ticket.c,v 1.13.2.2 2007/10/30 15:24:05 shadow Exp $");
  
  #if defined(UKERNEL)
  #include "afs/sysincludes.h"
***************
*** 34,46 ****
  #else
  #include <netinet/in.h>
  #endif
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <rx/xdr.h>
  #include <rx/rx.h>
  #include <des.h>
--- 34,40 ----
Index: openafs/src/rxkad/ticket5.c
diff -c openafs/src/rxkad/ticket5.c:1.8.2.3 openafs/src/rxkad/ticket5.c:1.8.2.5
*** openafs/src/rxkad/ticket5.c:1.8.2.3	Thu Jun 29 19:25:49 2006
--- openafs/src/rxkad/ticket5.c	Tue Jan 22 23:22:51 2008
***************
*** 62,68 ****
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxkad/ticket5.c,v 1.8.2.3 2006/06/29 23:25:49 jaltman Exp $");
  
  #if defined(UKERNEL)
  #include "../afs/sysincludes.h"
--- 62,68 ----
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxkad/ticket5.c,v 1.8.2.5 2008/01/23 04:22:51 shadow Exp $");
  
  #if defined(UKERNEL)
  #include "../afs/sysincludes.h"
***************
*** 81,93 ****
  #else
  #include <netinet/in.h>
  #endif
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <rx/xdr.h>
  #include <rx/rx.h>
  #include <des.h>
--- 81,87 ----
***************
*** 201,207 ****
  		  int (*get_key) (char *, int, struct ktc_encryptionKey *),
  		  char *get_key_rock, int serv_kvno, char *name, char *inst,
  		  char *cell, char *session_key, afs_int32 * host,
! 		  afs_int32 * start, afs_int32 * end)
  {
      char plain[MAXKRB5TICKETLEN];
      struct ktc_encryptionKey serv_key;
--- 195,201 ----
  		  int (*get_key) (char *, int, struct ktc_encryptionKey *),
  		  char *get_key_rock, int serv_kvno, char *name, char *inst,
  		  char *cell, char *session_key, afs_int32 * host,
! 		  afs_int32 * start, afs_int32 * end, afs_int32 disableCheckdot)
  {
      char plain[MAXKRB5TICKETLEN];
      struct ktc_encryptionKey serv_key;
***************
*** 318,330 ****
  	goto bad_ticket;
      }
  
!     /* 
!      * If the first part of the name_string contains a dot, punt since
!      * then we can't see the diffrence between the kerberos 5
!      * principals foo.root and foo/root later in the fileserver.
!      */
!     if (strchr(decr_part.cname.name_string.val[0], '.') != NULL)
! 	goto bad_ticket;
  
      /* Verify that decr_part.key is of right type */
      switch (decr_part.key.keytype) {
--- 312,326 ----
  	goto bad_ticket;
      }
  
!     if (!disableCheckdot) {
!         /* 
!          * If the first part of the name_string contains a dot, punt since
!          * then we can't see the diffrence between the kerberos 5
!          * principals foo.root and foo/root later in the fileserver.
!          */
!         if (strchr(decr_part.cname.name_string.val[0], '.') != NULL)
! 	    goto bad_ticket;
!     }
  
      /* Verify that decr_part.key is of right type */
      switch (decr_part.key.keytype) {
Index: openafs/src/rxkad/domestic/crypt_conn.c
diff -c openafs/src/rxkad/domestic/crypt_conn.c:1.11.2.4 openafs/src/rxkad/domestic/crypt_conn.c:1.11.2.6
*** openafs/src/rxkad/domestic/crypt_conn.c:1.11.2.4	Mon Feb 27 19:19:21 2006
--- openafs/src/rxkad/domestic/crypt_conn.c	Fri Jan  4 13:08:24 2008
***************
*** 19,31 ****
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxkad/domestic/crypt_conn.c,v 1.11.2.4 2006/02/28 00:19:21 shadow Exp $");
  
  #ifdef KERNEL
  #include "afs/stds.h"
  #ifndef UKERNEL
  #include "h/types.h"
! #if defined(AFS_AIX_ENV) || defined(AFS_AUX_ENV) || defined(AFS_SUN5_ENV)
  #include "h/systm.h"
  #endif
  #include "rx/rx.h"
--- 19,31 ----
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxkad/domestic/crypt_conn.c,v 1.11.2.6 2008/01/04 18:08:24 rees Exp $");
  
  #ifdef KERNEL
  #include "afs/stds.h"
  #ifndef UKERNEL
  #include "h/types.h"
! #if defined(AFS_AIX_ENV) || defined(AFS_AUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_XBSD_ENV)
  #include "h/systm.h"
  #endif
  #include "rx/rx.h"
***************
*** 37,42 ****
--- 37,43 ----
  #else /* !KERNEL */
  #include <afs/stds.h>
  #include <sys/types.h>
+ #include <string.h>
  #include <rx/rx.h>
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
Index: openafs/src/rxkad/domestic/fcrypt.c
diff -c openafs/src/rxkad/domestic/fcrypt.c:1.11.2.7 openafs/src/rxkad/domestic/fcrypt.c:1.11.2.8
*** openafs/src/rxkad/domestic/fcrypt.c:1.11.2.7	Wed Aug  2 15:07:04 2006
--- openafs/src/rxkad/domestic/fcrypt.c	Tue Oct 30 11:24:05 2007
***************
*** 20,26 ****
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxkad/domestic/fcrypt.c,v 1.11.2.7 2006/08/02 19:07:04 shadow Exp $");
  
  #define DEBUG 0
  #ifdef KERNEL
--- 20,26 ----
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxkad/domestic/fcrypt.c,v 1.11.2.8 2007/10/30 15:24:05 shadow Exp $");
  
  #define DEBUG 0
  #ifdef KERNEL
***************
*** 47,52 ****
--- 47,53 ----
  
  #include <afs/stds.h>
  #include <sys/types.h>
+ #include <string.h>
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #else
Index: openafs/src/rxkad/test/stress.c
diff -c openafs/src/rxkad/test/stress.c:1.9.2.1 openafs/src/rxkad/test/stress.c:1.9.2.2
*** openafs/src/rxkad/test/stress.c:1.9.2.1	Tue Apr 10 14:43:45 2007
--- openafs/src/rxkad/test/stress.c	Wed Oct 31 00:13:47 2007
***************
*** 13,19 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxkad/test/stress.c,v 1.9.2.1 2007/04/10 18:43:45 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 13,19 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxkad/test/stress.c,v 1.9.2.2 2007/10/31 04:13:47 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 104,112 ****
  #define aKEYFILE 26
  
  static int
! CommandProc(as, arock)
!      char *arock;
!      struct cmd_syndesc *as;
  {
      long code;
      int startServer = (as->parms[aSERVER].items != 0);
--- 104,110 ----
  #define aKEYFILE 26
  
  static int
! CommandProc(struct cmd_syndesc *as, void *arock)
  {
      long code;
      int startServer = (as->parms[aSERVER].items != 0);
***************
*** 310,316 ****
  	exit(1);
      }
  #endif
!     ts = cmd_CreateSyntax(NULL, CommandProc, 0,
  			  "run Rx authentication stress test");
      cmd_AddParm(ts, "-server", CMD_FLAG, CMD_OPTIONAL, "start server");
      cmd_AddParm(ts, "-client", CMD_SINGLE, CMD_OPTIONAL, "start client");
--- 308,314 ----
  	exit(1);
      }
  #endif
!     ts = cmd_CreateSyntax(NULL, CommandProc, NULL,
  			  "run Rx authentication stress test");
      cmd_AddParm(ts, "-server", CMD_FLAG, CMD_OPTIONAL, "start server");
      cmd_AddParm(ts, "-client", CMD_SINGLE, CMD_OPTIONAL, "start client");
Index: openafs/src/rxstat/Makefile.in
diff -c openafs/src/rxstat/Makefile.in:1.9 openafs/src/rxstat/Makefile.in:1.9.2.1
*** openafs/src/rxstat/Makefile.in:1.9	Sat Jan 11 02:34:53 2003
--- openafs/src/rxstat/Makefile.in	Thu Nov  1 12:06:00 2007
***************
*** 19,34 ****
  # Build targets
  #
  rxstat.cs.c: rxstat.xg
! 	${RXGEN} -x -C -o $@ ${srcdir}/rxstat.xg
  
  rxstat.ss.c: rxstat.xg
! 	${RXGEN} -x -S -o $@ ${srcdir}/rxstat.xg
  
  rxstat.xdr.c: rxstat.xg
! 	${RXGEN} -x -c -o $@ ${srcdir}/rxstat.xg
  
  rxstat.h: rxstat.xg
! 	${RXGEN} -x -h -o $@ ${srcdir}/rxstat.xg
  
  rxstat.xdr.c: rxstat.h
  rxstat.cs.c: rxstat.h
--- 19,34 ----
  # Build targets
  #
  rxstat.cs.c: rxstat.xg
! 	${RXGEN} -A -x -C -o $@ ${srcdir}/rxstat.xg
  
  rxstat.ss.c: rxstat.xg
! 	${RXGEN} -A -x -S -o $@ ${srcdir}/rxstat.xg
  
  rxstat.xdr.c: rxstat.xg
! 	${RXGEN} -A -x -c -o $@ ${srcdir}/rxstat.xg
  
  rxstat.h: rxstat.xg
! 	${RXGEN} -A -x -h -o $@ ${srcdir}/rxstat.xg
  
  rxstat.xdr.c: rxstat.h
  rxstat.cs.c: rxstat.h
Index: openafs/src/scout/scout.c
diff -c openafs/src/scout/scout.c:1.9.2.1 openafs/src/scout/scout.c:1.9.2.4
*** openafs/src/scout/scout.c:1.9.2.1	Thu Mar  9 01:42:04 2006
--- openafs/src/scout/scout.c	Mon Nov 26 16:21:55 2007
***************
*** 15,33 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/scout/scout.c,v 1.9.2.1 2006/03/09 06:42:04 shadow Exp $");
  
  #undef	IN
  #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
  #undef IN
  #include <gtxwindows.h>		/*Generic window package */
  #include <gtxobjects.h>		/*Object definitions */
--- 15,27 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/scout/scout.c,v 1.9.2.4 2007/11/26 21:21:55 shadow Exp $");
  
  #undef	IN
  #ifdef	AFS_AIX32_ENV
  #include <signal.h>
  #endif
  #include <string.h>
  #undef IN
  #include <gtxwindows.h>		/*Generic window package */
  #include <gtxobjects.h>		/*Object definitions */
***************
*** 2216,2225 ****
   *	Initializes this program.
   *------------------------------------------------------------------------*/
  
! static int scoutInit(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
! 
  {				/*scoutInit */
  
      static char rn[] = "scoutInit";	/*Routine name */
--- 2210,2216 ----
   *	Initializes this program.
   *------------------------------------------------------------------------*/
  
! static int scoutInit(struct cmd_syndesc *as, void *arock)
  {				/*scoutInit */
  
      static char rn[] = "scoutInit";	/*Routine name */
***************
*** 2355,2361 ****
      /*
       * Set up the commands we understand.
       */
!     ts = cmd_CreateSyntax("initcmd", scoutInit, 0, "initialize the program");
      cmd_AddParm(ts, "-server", CMD_LIST, CMD_REQUIRED,
  		"FileServer name(s) to monitor");
      cmd_AddParm(ts, "-basename", CMD_SINGLE, CMD_OPTIONAL,
--- 2346,2352 ----
      /*
       * Set up the commands we understand.
       */
!     ts = cmd_CreateSyntax("initcmd", scoutInit, NULL, "initialize the program");
      cmd_AddParm(ts, "-server", CMD_LIST, CMD_REQUIRED,
  		"FileServer name(s) to monitor");
      cmd_AddParm(ts, "-basename", CMD_SINGLE, CMD_OPTIONAL,
***************
*** 2387,2390 ****
--- 2378,2382 ----
      } else
  	scout_CleanExit(0);
  
+     return 0; /* not reachable */
  }				/*main */
Index: openafs/src/shlibafsrpc/Makefile.in
diff -c openafs/src/shlibafsrpc/Makefile.in:1.15.2.10 openafs/src/shlibafsrpc/Makefile.in:1.15.2.11
*** openafs/src/shlibafsrpc/Makefile.in:1.15.2.10	Sun Aug 20 18:24:10 2006
--- openafs/src/shlibafsrpc/Makefile.in	Tue Jan  8 13:57:28 2008
***************
*** 284,290 ****
  #
  #   $ what /opt/langtools/bin/pxdb32
  #   /opt/langtools/bin/pxdb32:
! #           HP92453-02 A.10.0A HP-UX SYMBOLIC DEBUGGER (PXDB) $Revision: 1.15.2.10 $
  #
  # The problem occurs when -g and -O are both used when compiling des.c.
  # The simplest way to work around the problem is to leave out either -g or -O.
--- 284,290 ----
  #
  #   $ what /opt/langtools/bin/pxdb32
  #   /opt/langtools/bin/pxdb32:
! #           HP92453-02 A.10.0A HP-UX SYMBOLIC DEBUGGER (PXDB) $Revision: 1.15.2.11 $
  #
  # The problem occurs when -g and -O are both used when compiling des.c.
  # The simplest way to work around the problem is to leave out either -g or -O.
***************
*** 366,372 ****
  syscall.o: ${SYS}/syscall.s
  	case "$(SYS_NAME)" in \
  	     sun4x_5* | sunx86_5*) \
! 		/usr/ccs/lib/cpp  ${SFLAGS} ${SYS}/syscall.s syscall.ss; \
  		as -o syscall.o syscall.ss;		\
  		$(RM) syscall.ss;;				\
  	 sgi_* | *_darwin_* ) \
--- 366,372 ----
  syscall.o: ${SYS}/syscall.s
  	case "$(SYS_NAME)" in \
  	     sun4x_5* | sunx86_5*) \
! 		$(CPP)  ${SFLAGS} ${SYS}/syscall.s syscall.ss; \
  		as -o syscall.o syscall.ss;		\
  		$(RM) syscall.ss;;				\
  	 sgi_* | *_darwin_* ) \
***************
*** 378,384 ****
  	 *fbsd* ) \
  		touch syscall.o ;; \
  	 *) \
! 		/lib/cpp  ${SFLAGS} ${SYS}/syscall.s syscall.ss; \
  		as -o syscall.o syscall.ss;		\
  		$(RM) syscall.ss;;				\
  	esac
--- 378,384 ----
  	 *fbsd* ) \
  		touch syscall.o ;; \
  	 *) \
! 		$(CPP)  ${SFLAGS} ${SYS}/syscall.s syscall.ss; \
  		as -o syscall.o syscall.ss;		\
  		$(RM) syscall.ss;;				\
  	esac
Index: openafs/src/shlibafsrpc/mapfile
diff -c openafs/src/shlibafsrpc/mapfile:1.3.2.4 openafs/src/shlibafsrpc/mapfile:1.3.2.6
*** openafs/src/shlibafsrpc/mapfile:1.3.2.4	Tue Apr 10 14:43:45 2007
--- openafs/src/shlibafsrpc/mapfile	Mon Dec 17 16:13:10 2007
***************
*** 79,85 ****
  	multi_Select;
  	multi_Init;
  	multi_Finalize_Ignore;
! 	add_to_error_table;
  	xdr_afsUUID;
  	xdr_afs_int32;
  	xdr_afs_uint32;
--- 79,85 ----
  	multi_Select;
  	multi_Init;
  	multi_Finalize_Ignore;
! 	afs_add_to_error_table;
  	xdr_afsUUID;
  	xdr_afs_int32;
  	xdr_afs_uint32;
***************
*** 115,120 ****
--- 115,125 ----
  	RXSTATS_ClearProcessRPCStats;
  	RXSTATS_ClearPeerRPCStats;
  	TM_GetTimeOfDay;
+ 	strcompose;
+ 	stolower;
+ 	ucstring;
+ 	lcstring;
+ 	AssertionFailed;
  
      local:
  	*;
Index: openafs/src/shlibafsrpc/mapfile.afs_xdr
diff -c openafs/src/shlibafsrpc/mapfile.afs_xdr:1.1.4.3 openafs/src/shlibafsrpc/mapfile.afs_xdr:1.1.4.4
*** openafs/src/shlibafsrpc/mapfile.afs_xdr:1.1.4.3	Tue Apr 10 14:43:45 2007
--- openafs/src/shlibafsrpc/mapfile.afs_xdr	Sun Feb 10 01:03:24 2008
***************
*** 79,85 ****
  	multi_Select;
  	multi_Init;
  	multi_Finalize_Ignore;
! 	add_to_error_table;
          afs_xdr_opaque;
          afs_xdr_string;
          afs_xdr_short;
--- 79,85 ----
  	multi_Select;
  	multi_Init;
  	multi_Finalize_Ignore;
! 	afs_add_to_error_table;
          afs_xdr_opaque;
          afs_xdr_string;
          afs_xdr_short;
***************
*** 138,143 ****
--- 138,148 ----
  	RXSTATS_ClearProcessRPCStats;
  	RXSTATS_ClearPeerRPCStats;
  	TM_GetTimeOfDay;
+ 	strcompose;
+ 	stolower;
+ 	ucstring;
+ 	lcstring;
+ 	AssertionFailed;
  
      local:
  	*;
Index: openafs/src/sys/Makefile.in
diff -c openafs/src/sys/Makefile.in:1.27.2.11 openafs/src/sys/Makefile.in:1.27.2.14
*** openafs/src/sys/Makefile.in:1.27.2.11	Fri Mar 17 19:44:53 2006
--- openafs/src/sys/Makefile.in	Mon Jan  7 15:10:51 2008
***************
*** 1,3 ****
--- 1,8 ----
+ # API version. When something changes, increment as appropriate. 
+ # Ignore at your own risk.
+ LIBAFSSETPAGMAJOR=1
+ LIBAFSSETPAGMINOR=0
+ 
  # Copyright 2000, International Business Machines Corporation and others.
  # All Rights Reserved.
  # 
***************
*** 14,23 ****
  SFLAGS=-I${TOP_INCDIR}
  LIBS=libsys.a ${TOP_LIBDIR}/librx.a libsys.a ${TOP_LIBDIR}/liblwp.a ${TOP_LIBDIR}/util.a ${XLIBS}
  
! OBJECTS= afssyscalls.o setpag.o glue.o syscall.o
! SHLIBOBJS = picobj/setpag.o picobj/glue.o syscall.o
  RMTOBJS=rmtsysnet.o rmtsysc.o rmtsys.cs.o rmtsys.xdr.o rmtsys.ss.o rmtsyss.o 
  
  all: \
      rmtsysd \
      pagsh \
--- 19,31 ----
  SFLAGS=-I${TOP_INCDIR}
  LIBS=libsys.a ${TOP_LIBDIR}/librx.a libsys.a ${TOP_LIBDIR}/liblwp.a ${TOP_LIBDIR}/util.a ${XLIBS}
  
! OBJECTS= afssyscalls.o setpag.o glue.o
! SHLIBOBJS = picobj/setpag.o picobj/glue.o
  RMTOBJS=rmtsysnet.o rmtsysc.o rmtsys.cs.o rmtsys.xdr.o rmtsys.ss.o rmtsyss.o 
  
+ LIBAFSSETPAG = libafssetpag.${SHLIB_SUFFIX}.${LIBAFSSETPAGMAJOR}.${LIBAFSSETPAGMINOR}
+ LIBAFSSETPAG_DARWIN = libafssetpag.${LIBAFSSETPAGMAJOR}.${SHLIB_SUFFIX}
+ 
  all: \
      rmtsysd \
      pagsh \
***************
*** 31,53 ****
      ${KERNELDIR}/afs/xfsattrs.h \
      ${UKERNELDIR}/afs \
      ${UKERNELDIR}/afs/afsl.exp
  
! libsys.a: ${OBJECTS} ${RMTOBJS} afsl.exp AFS_component_version_number.o
  	-$(RM) -f $@
! 	$(AR) crv $@ ${OBJECTS} ${RMTOBJS} \
! 		AFS_component_version_number.o ${LIBSYS_AIX_EXP}
  	$(RANLIB) $@
  	@set -x; case "${SYS_NAME}" in                   	\
  		rs_aix*) 			        \
  			$(AR) crv $@ afsl.exp;;         \
  	esac
  
  tests:	pagsh pagsh.krb fixit iinc idec icreate iopen istat rmtsysd
  
  syscall.o: syscall.s
  	@set -x; case "$(SYS_NAME)" in \
  	 sun4c_51 | sun4c_52 | sun4m_51 | sun4m_52 | sun4c_53 | sun4m_53  | sun4_53 | sun4_52 | sun4_54 | sun4c_54 | sun4m_54 | sun4x_5? | sun4x_5?? | sunx86_5? | sunx86_5?? ) \
! 		/usr/ccs/lib/cpp -P ${SFLAGS} ${srcdir}/syscall.s syscall.ss; \
  		as -o syscall.o syscall.ss;		\
  		$(RM) syscall.ss;;				\
  	 sgi_* |*_darwin* ) \
--- 39,94 ----
      ${KERNELDIR}/afs/xfsattrs.h \
      ${UKERNELDIR}/afs \
      ${UKERNELDIR}/afs/afsl.exp
+ 	@set -x; case ${SYS_NAME} in \
+ 	*_darwin_*) \
+ 	    ${MAKE} '${TOP_LIBDIR}/${LIBAFSSETPAG_DARWIN}';; \
+ 	*) \
+ 	    ${MAKE} '${TOP_LIBDIR}/${LIBAFSSETPAG}';; \
+ 	esac
  
! libsys.a: ${OBJECTS} ${RMTOBJS} syscall.o afsl.exp AFS_component_version_number.o
  	-$(RM) -f $@
! 	@set -x; case "${SYS_NAME}" in                   	\
! 		hp_ux11*) \
! 			$(AR) crv $@ ${OBJECTS} ${RMTOBJS} \
! 				AFS_component_version_number.o ${LIBSYS_AIX_EXP} ;; \
! 		*) \
! 			$(AR) crv $@ ${OBJECTS} ${RMTOBJS} syscall.o \
! 				AFS_component_version_number.o ${LIBSYS_AIX_EXP} ;; \
! 	esac
  	$(RANLIB) $@
  	@set -x; case "${SYS_NAME}" in                   	\
  		rs_aix*) 			        \
  			$(AR) crv $@ afsl.exp;;         \
  	esac
  
+ ${LIBAFSSETPAG}: ${SHLIBOBJS} syscall.o
+ 	@set -x; case ${SYS_NAME} in \
+ 	*_linux*) \
+ 	    ${SHLIB_LINKER} -Wl,-h,libafssetpag.so.${LIBAFSSETPAGMAJOR} \
+ 	        -o ${LIBAFSSETPAG} -Wl,--version-script=${srcdir}/mapfile \
+ 	        ${SHLIBOBJS} syscall.o ;; \
+ 	rs_aix4*) \
+ 	    ${SHLIB_LINKER} -o ${LIBAFSSETPAG} ${SHLIBOBJS} syscall.o \
+ 	        -bE:afssetpag.exp;; \
+ 	sun*_5*) \
+ 	    ${SHLIB_LINKER} -h libafssetpag.so.${LIBAFSSETPAGMAJOR} \
+ 	        -o ${LIBAFSSETPAG} ${SHLIBOBJS} syscall.o;; \
+ 	hp_ux11*) \
+ 	    ${SHLIB_LINKER} -o ${LIBAFSSETPAG} ${SHLIBOBJS};; \
+ 	*) \
+ 	    ${SHLIB_LINKER} -o ${LIBAFSSETPAG} ${SHLIBOBJS} syscall.o ;; \
+ 	esac
+ 
+ ${LIBAFSSETPAG_DARWIN}: ${SHLIBOBJS}
+ 	${SHLIB_LINKER} -o ${LIBAFSSETPAG_DARWIN} ${ARCHFLAGS} -install_name ${libdir}/${LIBAFSSETPAG_DARWIN} -compatibility_version ${LIBAFSSETPAGMAJOR} -current_version ${LIBAFSSETPAGMAJOR}.${LIBAFSSETPAGMINOR} ${SHLIBOBJS}
+ 
  tests:	pagsh pagsh.krb fixit iinc idec icreate iopen istat rmtsysd
  
  syscall.o: syscall.s
  	@set -x; case "$(SYS_NAME)" in \
  	 sun4c_51 | sun4c_52 | sun4m_51 | sun4m_52 | sun4c_53 | sun4m_53  | sun4_53 | sun4_52 | sun4_54 | sun4c_54 | sun4m_54 | sun4x_5? | sun4x_5?? | sunx86_5? | sunx86_5?? ) \
! 		$(CPP) -P ${SFLAGS} ${srcdir}/syscall.s syscall.ss; \
  		as -o syscall.o syscall.ss;		\
  		$(RM) syscall.ss;;				\
  	 sgi_* |*_darwin* ) \
***************
*** 63,69 ****
  		${AS} syscall.S -o syscall.o ;  \
  		$(RM) -f syscall.S ;;\
  	 *) \
! 		/lib/cpp -P ${SFLAGS} ${srcdir}/syscall.s syscall.ss; \
  		as -o syscall.o syscall.ss;		\
  		$(RM) syscall.ss;;				\
  	esac
--- 104,110 ----
  		${AS} syscall.S -o syscall.o ;  \
  		$(RM) -f syscall.S ;;\
  	 *) \
! 		$(CPP) -P ${SFLAGS} ${srcdir}/syscall.s syscall.ss; \
  		as -o syscall.o syscall.ss;		\
  		$(RM) syscall.ss;;				\
  	esac
***************
*** 95,110 ****
  rmtsysd: AFS_component_version_number.o afs.exp afsl.exp
  
  rmtsys.cs.c: rmtsys.xg
! 	${RXGEN} -C -o $@ ${srcdir}/rmtsys.xg
  
  rmtsys.ss.c: rmtsys.xg
! 	${RXGEN} -S -o $@ ${srcdir}/rmtsys.xg
  
  rmtsys.xdr.c: rmtsys.xg
! 	${RXGEN} -c -o $@ ${srcdir}/rmtsys.xg
  
  rmtsys.h: rmtsys.xg
! 	${RXGEN} -h -o $@ ${srcdir}/rmtsys.xg
  
  rmtsysd: rmtsysd.o libsys.a
  	${CC} ${CFLAGS} -o rmtsysd rmtsysd.o ${LIBS}
--- 136,160 ----
  rmtsysd: AFS_component_version_number.o afs.exp afsl.exp
  
  rmtsys.cs.c: rmtsys.xg
! 	${RXGEN} -A -C -o $@ ${srcdir}/rmtsys.xg
  
  rmtsys.ss.c: rmtsys.xg
! 	${RXGEN} -A -S -o $@ ${srcdir}/rmtsys.xg
  
  rmtsys.xdr.c: rmtsys.xg
! 	${RXGEN} -A -c -o $@ ${srcdir}/rmtsys.xg
  
  rmtsys.h: rmtsys.xg
! 	${RXGEN} -A -h -o $@ ${srcdir}/rmtsys.xg
! 
! Krmtsys.cs.c: rmtsys.xg Krmtsys.h
! 	${RXGEN} -A -k -C -o Krmtsys.cs.c ${srcdir}/rmtsys.xg
! 
! Krmtsys.xdr.c: rmtsys.xg
! 	${RXGEN} -A -k -c -o Krmtsys.xdr.c ${srcdir}/rmtsys.xg
! 
! Krmtsys.h: rmtsys.xg
! 	${RXGEN} -A -k -h -o Krmtsys.h ${srcdir}/rmtsys.xg
  
  rmtsysd: rmtsysd.o libsys.a
  	${CC} ${CFLAGS} -o rmtsysd rmtsysd.o ${LIBS}
***************
*** 152,157 ****
--- 202,218 ----
  		$(CC) -o xfsinode ${CFLAGS} ${srcdir}/xfsinode.c ${LIBS}
  	esac
  
+ ${TOP_LIBDIR}/${LIBAFSSETPAG}: ${LIBAFSSETPAG}
+ 	${INSTALL} ${LIBAFSSETPAG} ${TOP_LIBDIR}/${LIBAFSSETPAG}
+ 	-ln -f -s ${LIBAFSSETPAG} ${TOP_LIBDIR}/libafssetpag.${SHLIB_SUFFIX}
+ 	-ln -f -s ${LIBAFSSETPAG} ${TOP_LIBDIR}/libafssetpag.${SHLIB_SUFFIX}.${LIBAFSSETPAGMAJOR}
+ 
+ ${TOP_LIBDIR}/${LIBAFSSETPAG_DARWIN}: ${LIBAFSSETPAG_DARWIN}
+ 	${INSTALL} ${LIBAFSSETPAG_DARWIN} ${TOP_LIBDIR}/${LIBAFSSETPAG_DARWIN}
+ 	-ln -f -s ${LIBAFSSETPAG_DARWIN} ${TOP_LIBDIR}/libafssetpag.${SHLIB_SUFFIX}
+ 	-ln -f -s ${LIBAFSSETPAG_DARWIN} ${TOP_LIBDIR}/libafssetpag.${LIBAFSSETPAGMAJOR}.${LIBAFSSETPAGMINOR}.${SHLIB_SUFFIX}
+  
+ 
  afs.exp: ${srcdir}/afs4.exp ${srcdir}/afs5.exp
  	@set -x; case ${SYS_NAME} in \
  		rs_aix5* ) \
***************
*** 179,184 ****
--- 240,248 ----
  ${TOP_INCDIR}/afs/afssyscalls.h: afssyscalls.h
  	${INSTALL} $? $@
  
+ ${TOP_INCDIR}/afs/rmtsys.h: rmtsys.h
+ 	${INSTALL} $? $@
+ 
  ${TOP_INCDIR}/afs/afs.exp: afs.exp
  	@set -x; case ${SYS_NAME} in \
  		rs_aix* ) \
***************
*** 214,223 ****
  
  depinstall: \
  	${TOP_INCDIR}/afs/afssyscalls.h \
  	${TOP_INCDIR}/afs/afs.exp \
  	${TOP_INCDIR}/afs/xfsattrs.h \
  	${KERNELDIR}/afs/xfsattrs.h \
! 	${UKERNELDIR}/afs/afsl.exp
  
  install: \
      ${DESTDIR}${libdir}/afs/libsys.a \
--- 278,289 ----
  
  depinstall: \
  	${TOP_INCDIR}/afs/afssyscalls.h \
+ 	${TOP_INCDIR}/afs/rmtsys.h \
  	${TOP_INCDIR}/afs/afs.exp \
  	${TOP_INCDIR}/afs/xfsattrs.h \
  	${KERNELDIR}/afs/xfsattrs.h \
! 	${UKERNELDIR}/afs/afsl.exp \
! 	Krmtsys.cs.c Krmtsys.h Krmtsys.xdr.c rmtsys.h 
  
  install: \
      ${DESTDIR}${libdir}/afs/libsys.a \
***************
*** 227,247 ****
      ${DESTDIR}${bindir}/pagsh.krb \
      ${DESTDIR}${includedir}/afs/afs.exp \
      ${DESTDIR}${includedir}/afs/xfsattrs.h
  
  ${DESTDIR}${libdir}/afs/libsys.a: libsys.a
  	${INSTALL} $? $@
  
  ${DESTDIR}${sbindir}/rmtsysd: rmtsysd
! 	${INSTALL} -s $? $@
  
  ${DESTDIR}${includedir}/afs/afssyscalls.h: afssyscalls.h
  	${INSTALL} $? $@
  
  ${DESTDIR}${bindir}/pagsh: pagsh
! 	${INSTALL} -s $? $@
  
  ${DESTDIR}${bindir}/pagsh.krb: pagsh.krb
! 	${INSTALL} -s $? $@
  
  ${DESTDIR}${includedir}/afs/afs.exp: afs.exp
  	@set -x; case ${SYS_NAME} in \
--- 293,333 ----
      ${DESTDIR}${bindir}/pagsh.krb \
      ${DESTDIR}${includedir}/afs/afs.exp \
      ${DESTDIR}${includedir}/afs/xfsattrs.h
+ 	@set -x; case ${SYS_NAME} in \
+ 	*_darwin_*) \
+ 	    ${MAKE} '${DESTDIR}${libdir}/${LIBAFSSETPAG_DARWIN}';; \
+ 	*) \
+ 	    ${MAKE} '${DESTDIR}${libdir}/${LIBAFSSETPAG}';; \
+ 	esac
  
  ${DESTDIR}${libdir}/afs/libsys.a: libsys.a
  	${INSTALL} $? $@
  
+ ${DESTDIR}${libdir}/${LIBAFSSETPAG}: ${LIBAFSSETPAG}
+ 	${INSTALL} ${LIBAFSSETPAG} ${DESTDIR}${libdir}/${LIBAFSSETPAG}
+ 	-ln -f -s ${LIBAFSSETPAG} \
+ 	    ${DESTDIR}${libdir}/libafssetpag.${SHLIB_SUFFIX}
+ 	-ln -f -s ${LIBAFSSETPAG} \
+ 	    ${DESTDIR}${libdir}/libafssetpag.${SHLIB_SUFFIX}.${LIBAFSSETPAGMAJOR}
+ 
+ ${DESTDIR}${libdir}/${LIBAFSSETPAG_DARWIN}: ${LIBAFSSETPAG_DARWIN}
+ 	${INSTALL} ${LIBAFSSETPAG_DARWIN} ${DESTDIR}${libdir}/${LIBAFSSETPAG_DARWIN}
+ 	-ln -f -s ${LIBAFSSETPAG_DARWIN} \
+ 		${DESTDIR}${libdir}/libafssetpag.${SHLIB_SUFFIX} ; \
+ 	-ln -f -s ${LIBAFSSETPAG_DARWIN} \
+ 		${DESTDIR}${libdir}/libafssetpag.${LIBAFSSETPAGMAJOR}.${LIBAFSSETPAGMINOR}.${SHLIB_SUFFIX} ;; \
+ 
  ${DESTDIR}${sbindir}/rmtsysd: rmtsysd
! 	${INSTALL} $? $@
  
  ${DESTDIR}${includedir}/afs/afssyscalls.h: afssyscalls.h
  	${INSTALL} $? $@
  
  ${DESTDIR}${bindir}/pagsh: pagsh
! 	${INSTALL} $? $@
  
  ${DESTDIR}${bindir}/pagsh.krb: pagsh.krb
! 	${INSTALL} ${NO_STRIP_KRB} $? $@
  
  ${DESTDIR}${includedir}/afs/afs.exp: afs.exp
  	@set -x; case ${SYS_NAME} in \
***************
*** 260,265 ****
--- 346,357 ----
      ${DEST}/include/afs/afssyscalls.h \
      ${DEST}/include/afs/afs.exp \
      ${DEST}/include/afs/xfsattrs.h
+ 	@set -x; case ${SYS_NAME} in \
+ 	*_darwin_*) \
+ 	    ${MAKE} '${TOP_LIBDIR}/${LIBAFSSETPAG_DARWIN}';; \
+ 	*) \
+ 	    ${MAKE} '${TOP_LIBDIR}/${LIBAFSSETPAG}';; \
+ 	esac
  
  ${DEST}/lib/afs/libsys.a: libsys.a
  	${INSTALL} $? $@
***************
*** 277,289 ****
  	${INSTALL} $? $@
  
  ${DEST}/etc/rmtsysd: rmtsysd
! 	${INSTALL} -s $? $@
  
  ${DEST}/bin/pagsh: pagsh
! 	${INSTALL} -s $? $@
  
  ${DEST}/bin/pagsh.krb: pagsh.krb
! 	${INSTALL} -s $? $@
  
  #
  # Misc targets
--- 369,381 ----
  	${INSTALL} $? $@
  
  ${DEST}/etc/rmtsysd: rmtsysd
! 	${INSTALL} $? $@
  
  ${DEST}/bin/pagsh: pagsh
! 	${INSTALL} $? $@
  
  ${DEST}/bin/pagsh.krb: pagsh.krb
! 	${INSTALL} ${NO_STRIP_KRB} $? $@
  
  #
  # Misc targets
***************
*** 294,298 ****
  	$(RM) -f *.o libsys.a xfsinode iinc idec icreate iopen istat core \
  	rmtsysc rmtsyss *.o rmtsys.ss.c rmtsys.cs.c rmtsys.xdr.c rmtsys.h \
  	rmtsysd AFS_component_version_number.c pagsh pagsh.krb \
! 	afs.exp afsl.exp 
  	$(RM) -rf picobj
--- 386,390 ----
  	$(RM) -f *.o libsys.a xfsinode iinc idec icreate iopen istat core \
  	rmtsysc rmtsyss *.o rmtsys.ss.c rmtsys.cs.c rmtsys.xdr.c rmtsys.h \
  	rmtsysd AFS_component_version_number.c pagsh pagsh.krb \
! 	afs.exp afsl.exp libafssetpag.* Krmtsys.cs.c Krmtsys.h Krmtsys.xdr.c
  	$(RM) -rf picobj
Index: openafs/src/sys/pagsh.c
diff -c openafs/src/sys/pagsh.c:1.9.2.4 openafs/src/sys/pagsh.c:1.9.2.8
*** openafs/src/sys/pagsh.c:1.9.2.4	Tue Jul 10 16:30:57 2007
--- openafs/src/sys/pagsh.c	Thu Dec 13 16:23:42 2007
***************
*** 11,20 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/sys/pagsh.c,v 1.9.2.4 2007/07/10 20:30:57 shadow Exp $");
  
  #ifdef	AFS_AIX32_ENV
  #include <signal.h>
  #endif
  #include <stdio.h>
  #include <stdlib.h>
--- 11,25 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/sys/pagsh.c,v 1.9.2.8 2007/12/13 21:23:42 shadow Exp $");
  
  #ifdef	AFS_AIX32_ENV
  #include <signal.h>
+ #ifdef AFS_AIX51_ENV
+ #include <sys/cred.h>
+ #include <sys/pag.h>
+ #include <errno.h>
+ #endif
  #endif
  #include <stdio.h>
  #include <stdlib.h>
***************
*** 22,30 ****
  #ifndef AFS_NT40_ENV
  #include <unistd.h>
  #endif
- #ifdef HAVE_STRING_H
  #include <string.h>
- #endif
  #include <pwd.h>
  #ifdef AFS_KERBEROS_ENV
  #include <sys/types.h>
--- 27,33 ----
***************
*** 86,91 ****
--- 89,100 ----
  static afs_uint32
  curpag(void)
  {
+ #if defined(AFS_AIX51_ENV)
+     int code = getpagvalue("afs");
+     if (code < 0 && errno == EINVAL)
+ 	code = 0;
+     return code;
+ #else
      afs_uint32 groups[NGROUPS_MAX];
      afs_uint32 g0, g1;
      afs_uint32 h, l, ret;
***************
*** 109,114 ****
--- 118,124 ----
  	    return -1;
      }
      return -1;
+ #endif
  }
  
  int
***************
*** 157,162 ****
--- 167,173 ----
      strcat(*denv, fname5);
      *++denv = 0;
      environ = newenv;
+     return 0;
  }
  
  #endif
Index: openafs/src/sys/rmtsysc.c
diff -c openafs/src/sys/rmtsysc.c:1.11.2.1 openafs/src/sys/rmtsysc.c:1.11.2.5
*** openafs/src/sys/rmtsysc.c:1.11.2.1	Mon Jul 31 11:33:46 2006
--- openafs/src/sys/rmtsysc.c	Wed Nov 28 00:08:11 2007
***************
*** 16,22 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/sys/rmtsysc.c,v 1.11.2.1 2006/07/31 15:33:46 shadow Exp $");
  
  #include <errno.h>
  #include <limits.h>
--- 16,22 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/sys/rmtsysc.c,v 1.11.2.5 2007/11/28 05:08:11 shadow Exp $");
  
  #include <errno.h>
  #include <limits.h>
***************
*** 31,39 ****
  #endif
  #include <sys/stat.h>
  #include <stdio.h>
- #ifdef HAVE_STRING_H
  #include <string.h>
- #endif
  #ifdef HAVE_UNISTD_H
  #include <unistd.h>
  #endif
--- 31,37 ----
***************
*** 46,51 ****
--- 44,51 ----
  static int hostAddrLookup = 0;
  char *afs_server = 0, server_name[128];
  static afs_int32 SetClientCreds();
+ int afs_get_pag_from_groups(afs_uint32 g0, afs_uint32 g1);
+ void afs_get_groups_from_pag(afs_uint32 pag, afs_uint32 * g0p, afs_uint32 * g1p);
  
  /* Picks up the name of the remote afs client host where the rmtsys 
   * daemon resides. Since the clients may be diskless and/or readonly
***************
*** 307,313 ****
      return NOPAG;
  }
  
! 
  afs_get_groups_from_pag(afs_uint32 pag, afs_uint32 * g0p, afs_uint32 * g1p)
  {
      unsigned short g0, g1;
--- 307,313 ----
      return NOPAG;
  }
  
! void
  afs_get_groups_from_pag(afs_uint32 pag, afs_uint32 * g0p, afs_uint32 * g1p)
  {
      unsigned short g0, g1;
Index: openafs/src/sys/rmtsysd.c
diff -c openafs/src/sys/rmtsysd.c:1.7 openafs/src/sys/rmtsysd.c:1.7.2.1
*** openafs/src/sys/rmtsysd.c:1.7	Tue Jul 15 19:16:54 2003
--- openafs/src/sys/rmtsysd.c	Mon Nov 26 16:21:55 2007
***************
*** 17,23 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/sys/rmtsysd.c,v 1.7 2003/07/15 23:16:54 shadow Exp $");
  
  #ifdef	AFS_AIX32_ENV
  #include <signal.h>
--- 17,23 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/sys/rmtsysd.c,v 1.7.2.1 2007/11/26 21:21:55 shadow Exp $");
  
  #ifdef	AFS_AIX32_ENV
  #include <signal.h>
***************
*** 78,81 ****
--- 78,82 ----
       * at some point... */
      rx_SetMaxProcs(service, 2);
      rx_StartServer(1);		/* Donate this process to the server process pool */
+     return 0;
  }
Index: openafs/src/sys/rmtsysnet.c
diff -c openafs/src/sys/rmtsysnet.c:1.8 openafs/src/sys/rmtsysnet.c:1.8.2.2
*** openafs/src/sys/rmtsysnet.c:1.8	Mon Nov 10 17:25:28 2003
--- openafs/src/sys/rmtsysnet.c	Mon Nov 26 16:21:55 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/sys/rmtsysnet.c,v 1.8 2003/11/10 22:25:28 rees Exp $");
  
  #include <errno.h>
  #include <sys/param.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/sys/rmtsysnet.c,v 1.8.2.2 2007/11/26 21:21:55 shadow Exp $");
  
  #include <errno.h>
  #include <sys/param.h>
***************
*** 26,38 ****
  #endif
  #include <sys/stat.h>
  #include <stdio.h>
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <afs/afsint.h>
  #include <afs/venus.h>
  #include <rx/xdr.h>
--- 26,32 ----
***************
*** 153,158 ****
--- 147,153 ----
  	sprintf(tstring, "%s %d\n", tp->name, tp->rights);
  	strcat(mydata, tstring);
      }
+     return 0;
  }
  
  
***************
*** 171,176 ****
--- 166,172 ----
  	free(te);
      }
      free(aa);
+     return 0;
  }
  
  
***************
*** 212,217 ****
--- 208,214 ----
  	status->PartBlocksAvail = htonl(status->PartBlocksAvail);
  	status->PartMaxBlocks = htonl(status->PartMaxBlocks);
      }
+     return 0;
  }
  
  int
***************
*** 230,235 ****
--- 227,233 ----
  	ticket->BeginTimestamp = htonl(ticket->BeginTimestamp);
  	ticket->EndTimestamp = htonl(ticket->EndTimestamp);
      }
+     return 0;
  }
  
  int
***************
*** 340,345 ****
--- 338,344 ----
  	/* Note that new pioctls are supposed to be in network order! */
  	break;
      }
+     return 0;
  }
  
  
***************
*** 450,453 ****
--- 449,453 ----
  	/* Note that new pioctls are supposed to be in network order! */
  	break;
      }
+     return 0;
  }
Index: openafs/src/sys/rmtsyss.c
diff -c openafs/src/sys/rmtsyss.c:1.10 openafs/src/sys/rmtsyss.c:1.10.2.2
*** openafs/src/sys/rmtsyss.c:1.10	Tue Jul 15 19:16:54 2003
--- openafs/src/sys/rmtsyss.c	Mon Nov 26 16:21:55 2007
***************
*** 16,22 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/sys/rmtsyss.c,v 1.10 2003/07/15 23:16:54 shadow Exp $");
  
  #include <sys/types.h>
  #include <sys/ioctl.h>
--- 16,22 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/sys/rmtsyss.c,v 1.10.2.2 2007/11/26 21:21:55 shadow Exp $");
  
  #include <sys/types.h>
  #include <sys/ioctl.h>
***************
*** 30,38 ****
  #include <rx/xdr.h>
  #include <errno.h>
  #include <signal.h>
- #ifdef HAVE_STRING_H
  #include <string.h>
- #endif
  /*#include <afs/cellconfig.h>*/
  #include "rmtsys.h"
  
--- 30,36 ----
***************
*** 85,90 ****
--- 83,89 ----
       * at some point... */
      rx_SetMaxProcs(service, 2);
      rx_StartServer(1);		/* Donate this process to the server process pool */
+     return 0; /* not reached */
  }
  
  
Index: openafs/src/tests/Makefile.in
diff -c openafs/src/tests/Makefile.in:1.12.2.1 openafs/src/tests/Makefile.in:1.12.2.2
*** openafs/src/tests/Makefile.in:1.12.2.1	Thu Mar  9 01:42:08 2006
--- openafs/src/tests/Makefile.in	Mon Jan 21 14:50:32 2008
***************
*** 164,172 ****
  
  EXTRA_OBJS = err.o errx.o warn.o warnx.o vwarn.o vwarnx.o verr.o verrx.o warnerr.o snprintf.o 
  
- OpenAFS/OS.pm: OpenAFS/OS-$(MKAFS_OSTYPE).pm
- 	$(CP) OpenAFS/OS-$(MKAFS_OSTYPE).pm OpenAFS/OS.pm
- 
  fsx: fsx.o $(EXTRA_OBJS)
  	$(CC) $(LDFLAGS) -o $@ fsx.o $(EXTRA_OBJS) $(LIBS)
  
--- 164,169 ----
***************
*** 362,374 ****
  
  uninstall:
  
! all: run-tests OpenAFS/OS.pm libxfiles.a libdumpscan.a $(TEST_PROGRAMS)\
  	afsdump_scan afsdump_dirlist afsdump_extract dumptool
  	@chmod +x run-tests
  
  clean:
  	-rm -f xf_errs.c xf_errs.h dumpscan_errs.c dumpscan_errs.h *.o \
! 	$(TARGETS) run-tests $(TEST_PROGRAMS) OS.pm
  
  include ../config/Makefile.version
  
--- 359,371 ----
  
  uninstall:
  
! all: run-tests dirpath.conf OpenAFS/Dirpath.pm libxfiles.a libdumpscan.a $(TEST_PROGRAMS)\
  	afsdump_scan afsdump_dirlist afsdump_extract dumptool
  	@chmod +x run-tests
  
  clean:
  	-rm -f xf_errs.c xf_errs.h dumpscan_errs.c dumpscan_errs.h *.o \
! 	$(TARGETS) run-tests $(TEST_PROGRAMS) OpenAFS/Dirpath.pm
  
  include ../config/Makefile.version
  
***************
*** 381,384 ****
--- 378,431 ----
  check-fast: run-tests $(TEST_PROGRAMS)
  	./run-tests -all -fast
  
+ dirpath.conf: Makefile
+ 	@echo "creating $@"
+ 	@echo "# auto-generated by src/tests/Makefile"      >$@
+ 	@echo "# DO NOT EDIT"                               >>$@
+ 	@echo "afsconfdir=@afsconfdir@"                     >>$@
+ 	@echo "viceetcdir=@viceetcdir@"                     >>$@
+ 	@echo "afssrvbindir=@afssrvbindir@"                 >>$@
+ 	@echo "afssrvsbindir=@afssrvsbindir@"               >>$@
+ 	@echo "afssrvlibexecdir=@afssrvlibexecdir@"         >>$@
+ 	@echo "afsdbdir=@afsdbdir@"                         >>$@
+ 	@echo "afslogsdir=@afslogsdir@"                     >>$@
+ 	@echo "afslocaldir=@afslocaldir@"                   >>$@
+ 	@echo "afsbackupdir=@afsbackupdir@"                 >>$@
+ 	@echo "afsbosconfigdir=@afsbosconfigdir@"           >>$@
+ 	@echo "afskerneldir=@afskerneldir@"                 >>$@
+ 	@echo "initdir=@sysconfdir@"                        >>$@
+ 	@echo "localstatedir=@localstatedir@"               >>$@
+ 	@echo "ostype=@MKAFS_OSTYPE@"                       >>$@
+ 
+ OpenAFS/Dirpath.pm: Makefile
+ 	@echo "Creating OpenAFS/Dirpath.pm"
+ 	@echo "# This is -*- perl -*-"                          >$@
+ 	@echo "# auto-generated by src/tests/Makefile"          >>$@
+ 	@echo "# DO NOT EDIT"                                   >>$@
+ 	@echo "package OpenAFS::Dirpath;"                       >>$@
+ 	@echo "use strict;"                                     >>$@
+ 	@echo "use vars qw( @ISA @EXPORT \$$openafsdirpath);"   >>$@
+ 	@echo "@ISA = qw(Exporter);"                            >>$@
+ 	@echo "require Exporter;"                               >>$@
+ 	@echo "@EXPORT = qw(\$$openafsdirpath);"                >>$@
+ 	@echo ""                                                >>$@
+ 	@echo "\$$openafsdirpath = {"                           >>$@
+ 	@echo "  'afsconfdir'       => '@afsconfdir@',"         >>$@
+ 	@echo "  'viceetcdir'       => '@viceetcdir@',"         >>$@
+ 	@echo "  'afssrvbindir'     => '@afssrvbindir@',"       >>$@
+ 	@echo "  'afssrvsbindir'    => '@afssrvsbindir@',"      >>$@
+ 	@echo "  'afssrvlibexecdir' => '@afssrvlibexecdir@',"   >>$@
+ 	@echo "  'afsdbdir'         => '@afsdbdir@',"           >>$@
+ 	@echo "  'afslogsdir'       => '@afslogsdir@',"         >>$@
+ 	@echo "  'afslocaldir'      => '@afslocaldir@',"        >>$@
+ 	@echo "  'afsbackupdir'     => '@afsbackupdir@',"       >>$@
+ 	@echo "  'afsbosconfigdir'  => '@afsbosconfigdir@',"    >>$@
+ 	@echo "  'afskerneldir'     => '@afskerneldir@',"       >>$@
+ 	@echo "  'initdir'          => '@sysconfdir@',"         >>$@
+ 	@echo "  'localstatedir'    => '@localstatedir@',"      >>$@
+ 	@echo "  'ostype'           => '@MKAFS_OSTYPE@',"       >>$@
+ 	@echo "};"                                              >>$@
+ 	@echo ""                                                >>$@
+ 	@echo "1;"                                              >>$@
+ 
  .PHONY:		all install clean realclean distclean mostlyclean install uninstall check
Index: openafs/src/tests/afs-newcell.pl
diff -c openafs/src/tests/afs-newcell.pl:1.1 openafs/src/tests/afs-newcell.pl:1.1.10.1
*** openafs/src/tests/afs-newcell.pl:1.1	Mon Jan 14 02:49:17 2002
--- openafs/src/tests/afs-newcell.pl	Mon Jan 21 14:50:32 2008
***************
*** 1,18 ****
! #!/usr/bin/env perl -w
  # Copyright (C) 2000 by Sam Hartman
  # This file may be copied either under the terms of the GNU GPL or the IBM Public License
  # either version 2 or later of the GPL or version 1.0 or later of the IPL.
  
! use Term::ReadLine;
  use strict;
  use OpenAFS::ConfigUtils;
  use OpenAFS::Dirpath;
  use OpenAFS::OS;
  use OpenAFS::Auth;
  use Getopt::Long;
! use vars qw($admin $server $cellname $cachesize $part
!           $requirements_met  $shutdown_needed $csdb);
! my $rl = new Term::ReadLine('afs-newcell');
  
  =head1  NAME
  
--- 1,17 ----
! #!/usr/bin/env perl
  # Copyright (C) 2000 by Sam Hartman
  # This file may be copied either under the terms of the GNU GPL or the IBM Public License
  # either version 2 or later of the GPL or version 1.0 or later of the IPL.
  
! use warnings;
  use strict;
+ use Term::ReadLine;
  use OpenAFS::ConfigUtils;
  use OpenAFS::Dirpath;
  use OpenAFS::OS;
  use OpenAFS::Auth;
  use Getopt::Long;
! use Pod::Usage;
  
  =head1  NAME
  
***************
*** 20,39 ****
  
  =head1 SYNOPSIS
  
! B<afs-newcell> [B<--requirements-met>] [B<--admin> admin_user] [B<--cellname> cellname] [B<--cachesize> size] [B<--partition> partition-letter]
  
  =head1 DESCRIPTION
  
- 
  This script sets up the initial AFS database and configures the first
! database/file server. It also sets up an AFS cell's root volumes.  It 
! assumes that you already have a fileserver and database servers.  The 
! fileserver should have an empty root.afs. This script creates root.cell, 
! user, service and populates root.afs.  
! 
! The B<requirements-met> option specifies that the initial requirements
! have been met and that the script can proceed without displaying the
! initial banner or asking for confirmation.
  
  The B<admin> option specifies the name of the administrative user.
  This user will be given system:administrators and susers permission in
--- 19,55 ----
  
  =head1 SYNOPSIS
  
! B<afs-newcell>
!        B<--batch>
!        B<--debug>
!        B<--dont-unwind>
!        B<--help>
!        B<--ostype>=os
!        B<--server>=hostname
!        B<--cellname>=cell
!        B<--partition>=partition
!        B<--admin>=administrator
!        B<--kerberos-type>=authentication_type
!        B<--kerberos-realm>=realm_name
!        B<--kerberos-keytab>=keytab_file
!        B<--skip-make-keyfile>
!        B<--with-dafs>
!        B<--options-fileserver>=options
!        B<--options-volserver>=options
!        B<--options-salvageserver>=options
! 	   B<--options-salvager>=options 
  
  =head1 DESCRIPTION
  
  This script sets up the initial AFS database and configures the first
! database/file server. It also sets up an AFS cell's root volumes.  It assumes
! that you already have a fileserver and database servers installed.  The
! fileserver should have an empty root.afs. This script creates root.cell, user,
! service and populates root.afs.  
! 
! The B<batch> option specifies that the initial requirements have been met and
! that the script can proceed without displaying the initial banner or asking for
! confirmation.
  
  The B<admin> option specifies the name of the administrative user.
  This user will be given system:administrators and susers permission in
***************
*** 41,47 ****
  
  The B<cellname> option specifies the name of the cell.
  
! The B<cachesize> option specifies the size of the AFS cache.
  
  =head1 AUTHOR
  
--- 57,102 ----
  
  The B<cellname> option specifies the name of the cell.
  
! The B<partition> option specifies the partition letter of the AFS partition. The
! default value is 'a', for /vicepa.
! 
! =head1 PREREQUISITES
! 
! The following requirements must be met before running
! this script.
! 
! This machine must have a working, empty filesystem mounted on /vicepa. A
! different partition letter may be specified by the partition command line
! option. For example, to use /vicepb, specify '--partition=b' on the command
! line.
! 
! The OpenAFS client and server binaries must be installed on this machine. 
! 
! A working Kerberos realm with Kerberos4 support must be available. Supported
! Kerberos implementations are Heimdal with Kth-kerberos compatibility, MIT
! Kerberos5, and Kaserver (deprecated).  
! 
! Create the single-DES AFS key and write it to a keytab file using the kerberos
! kadmin program.
!    
! Create a principal called afs/cellname in your realm.  The cell name should be
! all lower case, unlike Kerberos realms which are all upper case.  You can use
! the asetkey command or if you used AFS3 salt to create the key, the bos addkey
! command. The asetkey command is built when OpenAFS built with Kerberos support.
! The asetkey command requires a cell configuration.
! 
! You will need an administrative principal created in a Kerberos realm.  This
! principal will be added to system:administrators and thus will be able to run
! administrative commands.  Generally the user is a root instance of some
! administravie user.  For example if jruser is an administrator then it would be
! reasonable to create jruser/root and specify jruser/root as the user to be
! added in this script using the 'admin' command line option.  You will also need
! to create a keyfile for this adminstrative user which is used by the script to
! obtain a ticket. The keyfile must be located in
! $openafsdirpath->{'afsconfdir'}/krb5.conf.
! 
! The AFS client must not be running on this workstation.  It will be started
! during the execution of this script.
  
  =head1 AUTHOR
  
***************
*** 49,294 ****
  
  =cut
  
- # main script
  
! # mkvol(volume, mount)
! sub mkvol($$) {
!     my ($vol, $mnt) = @_;
!     run("$openafsdirpath->{'afssrvsbindir'}/vos create $server $part $vol -localauth");
!     unwind("$openafsdirpath->{'afssrvsbindir'}/vos remove $server $part $vol -localauth");
!     run("$openafsdirpath->{'afssrvbindir'}/fs mkm $mnt $vol ");
!     run("$openafsdirpath->{'afssrvbindir'}/fs sa $mnt system:anyuser rl");
  }
  
  GetOptions (
!            "requirements-met" => \$requirements_met, 
!            "cellname=s" => \$cellname, 
! 	   "cachesize=s" => \$cachesize,
!            "partition=s" => \$part,
!            "admin=s" => \$admin);
  
- unless ($requirements_met) {
    print <<eoreqs;
!                            Prerequisites
  
! In order to set up a new AFS cell, you must meet the following:
  
! 1) You need a working Kerberos realm with Kerberos4 support.  You
!    should install Heimdal with Kth-kerberos compatibility or MIT
!    Kerberos5.
! 
! 2) You need to create the single-DES AFS key and load it into
!    $openafsdirpath->{'afsconfdir'}/KeyFile.  If your cell's name is the same as
!    your Kerberos realm then create a principal called afs.  Otherwise,
!    create a principal called afs/cellname in your realm.  The cell
!    name should be all lower case, unlike Kerberos realms which are all
!    upper case.  You can use asetkey from the openafs-krb5 package, or
!    if you used AFS3 salt to create the key, the bos addkey command.
! 
! 3) This machine should have a filesystem mounted on /vicepa.  If you
!    do not have a free partition, on Linux you can create a large file by using
!    dd to extract bytes from /dev/zero.  Create a filesystem on this file
!    and mount it using -oloop.  
! 
! 4) You will need an administrative principal created in a Kerberos
!    realm.  This principal will be added to susers and
!    system:administrators and thus will be able to run administrative
!    commands.  Generally the user is a root instance of some administravie
!    user.  For example if jruser is an administrator then it would be
!    reasonable to create jruser/root and specify jruser/root as the user
!    to be added in this script.
  
! 5) The AFS client must not be running on this workstation.  It will be
!    at the end of this script.
  
  eoreqs
  
!   $_ = $rl->readline("Do you meet these requirements? [y/n] ");
!   unless (/^y/i ) {
!     print "Run this script again when you meet the requirements\n";
!     exit(1);
    }
!        
!   if ($> != 0) {
!     die "This script should almost always be run as root.  Use the --requirements-met option to run as non-root.\n";
    }
! }
! open(MOUNT, "mount |") or die "Failed to run mount: $!\n";
! while(<MOUNT>) {
!   if(m:^AFS:) {
!     print "The AFS client is currently running on this workstation.\n";
!     print "Please restart this script after running $openafsinitcmd->{'client-stop'}\n";
!     exit(1);
    }
!   if(m:^/afs on AFS:) {
!     print "The AFS client is currently running on this workstation.\n";
!     print "Please restart this script after running $openafsinitcmd->{'client-stop'}\n";
!     exit(1);
    }
  }
- close MOUNT;
  
! unless ( -f "$openafsdirpath->{'afsconfdir'}/KeyFile") {
!   print "You do not have an AFS keyfile.  Please create this using asetkey from openafs-krb5 or 
! the bos addkey command";
!   exit(1);
  }
  
! print "If the fileserver is not running, this may hang for 30 seconds.\n";
! run("$openafsinitcmd->{'filesrv-stop'}");
! $server = `hostname`;
! chomp $server;
! $admin = $rl->readline("What administrative principal should be used? ") unless $admin;
!  die "Please specify an administrative user\n" unless $admin;
! $admin =~ s:/:.:g;
! if($admin =~ /@/) {
! die "The administrative user must be in the same realm as the cell and no realm may be specified.\n";
! }
! 
! $cellname = $rl->readline("What cellname should be used? ") unless $cellname;
! die "Please specify a cellname\n" unless $cellname;
! 
! if (! -f "$openafsdirpath->{'afsconfdir'}/ThisCell") {
!     open(CELL, "> $openafsdirpath->{'afsconfdir'}/ThisCell");
!     print CELL "${cellname}";
!     close CELL;
! }
! 
! open(CELL, "$openafsdirpath->{'afsconfdir'}/ThisCell") or
!     die "Cannot open $openafsdirpath->{'afsconfdir'}/ThisCell: $!\n";
! 
! my $lcell = <CELL>;
! chomp $lcell;
! close CELL;
! 
! run( "echo \\>$lcell >$openafsdirpath->{'afsconfdir'}/CellServDB");
! $csdb = `host $server|awk '{print $4 " #" $1}'`;
! run( "echo $csdb >>$openafsdirpath->{'afsconfdir'}/CellServDB");
! run("$openafsinitcmd->{'filesrv-start'}");
! unwind("$openafsinitcmd->{'filesrv-stop'}");
! $shutdown_needed = 1;
! run ("$openafsdirpath->{'afssrvbindir'}/bos addhost $server $server -localauth ||true");
! run("$openafsdirpath->{'afssrvbindir'}/bos adduser $server $admin -localauth");
! unwind("$openafsdirpath->{'afssrvbindir'}/bos removeuser $server $admin -localauth");
! if ( -f "$openafsdirpath->{'afsdbdir'}/prdb.DB0" ) {
!   die "Protection database already exists; cell already partially created\n";
!  }
! open(PRDB, "|$openafsdirpath->{'afssrvsbindir'}/pt_util -p $openafsdirpath->{'afsdbdir'}/prdb.DB0 -w ")
! or die "Unable to start pt_util: $!\n";
! print PRDB "$admin 128/20 1 -204 -204\n";
! print PRDB "system:administrators 130/20 -204 -204 -204\n";
! print PRDB" $admin 1\n";
! close PRDB;
! unwind( "rm $openafsdirpath->{'afsdbdir'}/prdb* ");
! # Start up ptserver and vlserver
! run("$openafsdirpath->{'afssrvbindir'}/bos create $server ptserver simple $openafsdirpath->{'afssrvlibexecdir'}/ptserver -localauth");
! unwind("$openafsdirpath->{'afssrvbindir'}/bos delete $server ptserver -localauth");
! 
! run("$openafsdirpath->{'afssrvbindir'}/bos create $server vlserver simple $openafsdirpath->{'afssrvlibexecdir'}/vlserver -localauth");
! unwind("$openafsdirpath->{'afssrvbindir'}/bos delete $server vlserver -localauth");
! 
! run( "$openafsdirpath->{'afssrvbindir'}/bos create $server fs fs ".
!      "-cmd $openafsdirpath->{'afssrvlibexecdir'}/fileserver ".
!      "-cmd $openafsdirpath->{'afssrvlibexecdir'}/volserver ".
!      "-cmd $openafsdirpath->{'afssrvlibexecdir'}/salvager -localauth");
! unwind( "$openafsdirpath->{'afssrvbindir'}/bos delete $server fs -localauth ");
! 
! print "Waiting for database elections: ";
! sleep(30);
! print "done.\n";
! # Past this point we want to control when bos shutdown happens
! $shutdown_needed = 0;
! unwind( "$openafsdirpath->{'afssrvbindir'}/bos shutdown $server -localauth ");
! run("$openafsdirpath->{'afssrvsbindir'}/vos create $server a root.afs -localauth");
! # bring up client
! 
! $cachesize = $rl->readline("What size cache (in 1k blocks)? ") unless $cachesize;
! die "Please specify a cache size\n" unless $cachesize;
! 
! run("echo $lcell >$openafsdirpath->{'viceetcdir'}/ThisCell");
! run("cp $openafsdirpath->{'afsconfdir'}/CellServDB $openafsdirpath->{'viceetcdir'}/CellServDB");
! run("echo /afs:/usr/vice/cache:${cachesize} >$openafsdirpath->{'viceetcdir'}/cacheinfo");
! run("$openafsinitcmd->{'client-forcestart'}");
! my $afs_running = 0;
! open(MOUNT, "mount |") or die "Failed to run mount: $!\n";
! while(<MOUNT>) {
! if(m:^AFS:) {
!        $afs_running = 1;
! }
!        }
! unless ($afs_running) {
! print "*** The AFS client failed to start.\n";
! print  "Please fix whatever problem kept it from running.\n";
!        exit(1);
! }
! unwind("$openafsinitcmd->{'client-stop'}");
! 
! unless ($part) {
!     $part = $rl    ->readline("What partition? [a] ");
!     $part = "a" unless $part;
! }
! 
! &OpenAFS::Auth::authadmin();
! 
! run("$openafsdirpath->{'afssrvbindir'}/fs sa /afs system:anyuser rl");
! 
! run("$openafsdirpath->{'afssrvsbindir'}/vos create $server $part root.cell -localauth");
! unwind("$openafsdirpath->{'afssrvsbindir'}/vos remove $server $part root.cell -localauth");
! # We make root.cell s:anyuser readable after we mount in the next
! # loop.
! open(CELLSERVDB, "$openafsdirpath->{'viceetcdir'}/CellServDB")
!     or die "Unable to open $openafsdirpath->{'viceetcdir'}/CellServDB: $!\n";
! while(<CELLSERVDB>) {
!     chomp;
!     if (/^>\s*([a-z0-9_\-.]+)/ ) {
!        run("$openafsdirpath->{'afssrvbindir'}/fs mkm /afs/$1 root.cell -cell $1 -fast");
!        unwind ("$openafsdirpath->{'afssrvbindir'}/fs rmm /afs/$1");
!    }
! }
! 
! run("$openafsdirpath->{'afssrvbindir'}/fs sa /afs/$lcell system:anyuser rl");
! run ("$openafsdirpath->{'afssrvbindir'}/fs mkm /afs/.$lcell root.cell -cell $lcell -rw");
! unwind ("$openafsdirpath->{'afssrvbindir'}/fs rmm /afs/.$lcell");
! run("$openafsdirpath->{'afssrvbindir'}/fs mkm /afs/.root.afs root.afs -rw");
! unwind ("$openafsdirpath->{'afssrvbindir'}/fs rmm /afs/.root.afs");
! 
! mkvol( "user", "/afs/$lcell/user" );
! unwind( "$openafsdirpath->{'afssrvsbindir'}/vos remove $server $part user -localauth ");
! 
! mkvol( "service", "/afs/$lcell/service" );
! unwind( "$openafsdirpath->{'afssrvsbindir'}/vos remove $server $part service -localauth ");
! 
! mkvol( "rep", "/afs/$lcell/.replicated" );
! unwind( "$openafsdirpath->{'afssrvsbindir'}/vos remove $server $part rep -localauth ");
! run( "$openafsdirpath->{'afssrvbindir'}/fs mkm /afs/$lcell/replicated rep.readonly " );
! 
! run( "$openafsdirpath->{'afssrvsbindir'}/vos addsite $server $part rep -localauth" );
! run( "$openafsdirpath->{'afssrvsbindir'}/vos release rep -localauth" );
! unwind( "$openafsdirpath->{'afssrvsbindir'}/vos remove $server $part rep.readonly -localauth ");
! 
! mkvol( "unrep", "/afs/$lcell/unreplicated" );
! unwind( "$openafsdirpath->{'afssrvsbindir'}/vos remove $server $part unrep -localauth ");
! 
! $lcell =~ /^([^.]*)/;
! my $cellpart = $1;
! run("ln -s /afs/$lcell /afs/$cellpart");
! unwind ("rm /afs/$cellpart");
! run( "ln -s /afs/.$lcell /afs/.$cellpart" );
! unwind ("rm /afs/.$cellpart");
! 
! run( "$openafsdirpath->{'afssrvsbindir'}/vos addsite $server $part root.afs -localauth" );
! run( "$openafsdirpath->{'afssrvsbindir'}/vos addsite $server $part root.cell -localauth" );
! run( "$openafsdirpath->{'afssrvsbindir'}/vos release root.afs -localauth" );
! run( "$openafsdirpath->{'afssrvsbindir'}/vos release root.cell -localauth" );
! unwind( "$openafsdirpath->{'afssrvsbindir'}/vos remove $server $part root.cell.readonly -localauth ");
! unwind( "$openafsdirpath->{'afssrvsbindir'}/vos remove $server $part root.afs.readonly -localauth ");
  
  
  
- @unwinds = ();
  END {
! # If we fail before all the instances are created, we need to perform 
! # our own bos shutdown
!     system("$openafsdirpath->{'afssrvbindir'}/bos shutdown $server -localauth") if $shutdown_needed;
!   run(pop @unwinds) while @unwinds;
    }
--- 104,616 ----
  
  =cut
  
  
! my $term = new Term::ReadLine('afs-newcell');
! my $path = $OpenAFS::Dirpath::openafsdirpath;
! 
! #-----------------------------------------------------------------------------------
! # prompt(message, default_value)
! #
! sub prompt($$) {
!   my ($message,$default) = @_;
!   my $value = $term->readline("$message [$default] ");
!   unless ($value) {
!     $value = $default;
!   }
!   return $value;
! }
! 
! #-----------------------------------------------------------------------------------
! # mkvol(volume, mount, partition)
! #
! sub mkvol($$$$) {
!     my ($vol, $mnt, $srv, $part) = @_;
!     run("$path->{'afssrvsbindir'}/vos create $srv $part $vol -maxquota 0 -localauth");
!     unwind("$path->{'afssrvsbindir'}/vos remove $srv $part $vol -localauth");
!     run("$path->{'afssrvbindir'}/fs mkm $mnt $vol ");
!     run("$path->{'afssrvbindir'}/fs sa $mnt system:anyuser rl");
! }
! 
! #-----------------------------------------------------------------------------------
! # check_program($prog) - verify the program is installed.
! #
! sub check_program($) {
!     my ($program) = @_;
!   unless ( -f $program ) {
!      die "error: Missing program: $program\n";
!   }
!   unless ( -x $program ) {
!      die "error: Not executable: $program\n";
!   }
  }
  
+ #-----------------------------------------------------------------------------------
+ # main script
+ 
+ # options
+ my $batch = 0;
+ my $debug = 0;
+ my $dont_unwind = 0;
+ my $help = 0;
+ my $ostype = $path->{'ostype'};
+ my $server = 'localhost';
+ my $cellname = 'testcell';
+ my $partition = '/vicepa';
+ my $admin = 'admin';
+ my $kerberos_type = 'MIT';
+ my $kerberos_realm = 'TESTCELL';
+ my $kerberos_keytab = "$path->{'afsconfdir'}/krb5.keytab";
+ my $skip_make_keyfile = 0;
+ my $with_dafs = 0;
+ my $options_fileserver = '';
+ my $options_volserver = '';
+ my $options_salvageserver = '';
+ my $options_salvager = '';
+ 
+ $server = `hostname`;
+ chomp $server;
+ 
  GetOptions (
!        "batch" => \$batch, 
!        "debug!" => \$debug,
!        "dont-unwind!" => \$dont_unwind,
!        "help" => \$help,
!        "ostype=s" => \$ostype,
!        "server=s" => \$server,
!        "cellname=s" => \$cellname, 
!        "partition=s" => \$partition,
!        "admin=s" => \$admin,
!        "kerberos-type=s" => \$kerberos_type,
!        "kerberos-realm=s" => \$kerberos_realm,
!        "kerberos-keytab=s" => \$kerberos_keytab,
!        "skip-make-keyfile" => \$skip_make_keyfile,
!        "with-dafs" => \$with_dafs,
!        "options-fileserver=s" => \$options_fileserver,
!        "options-volserver=s" => \$options_volserver,
!        "options-salvageserver=s" => \$options_salvageserver,
!        "options-salvager=s" => \$options_salvager,
!        );
! 
! if ($help) {
!   pod2usage(1);
!   exit 0;
! }
! 
! # print debug messages when running commands.
! $OpenAFS::ConfigUtils::debug = $debug;
! 
! #
! # Verify we have a clean slate before starting.
! #
! my @problems = ();
! my $try_rm_cell = 0;
! 
! if ($> != 0) {
!   push(@problems, "This script should run as root.");
! }
! 
! my @afsconfigfiles = (
!   "$path->{'afsconfdir'}/ThisCell",
!   "$path->{'afsconfdir'}/CellServDB",
!   "$path->{'afsconfdir'}/UserList",
!   "$path->{'afsdbdir'}/prdb.DB0",
!   "$path->{'afsbosconfigdir'}/BosConfig",
! );
! foreach my $configfile (@afsconfigfiles) {
!   if ( -f $configfile ) {
!     push(@problems, "Configuration file already exists, $configfile.");
!     $try_rm_cell = 1;
!   }
! }
! 
! if (@problems) {
!   foreach my $problem (@problems) {
!     print "error: $problem\n";
!   }
!   print "info: Try running afs-rmcell.pl\n" if $try_rm_cell;
!   exit 1;
! }
! 
! #
! # Interactive mode
! #
! unless ($batch) {
  
    print <<eoreqs;
!                            REQUIREMENTS
  
! The following requirements must be meet before running
! this script. See 'pod2text $0' for more details.
  
! 1) A filesystem must be mounted on /vicepa. (See
!    the --partition option for alternative mount points.)
  
! 2) The OpenAFS client and server binaries must be installed.
!    The init scripts to start and stop the client and servers 
!    must be installed and configured. OpenAFS/OS.pm must be 
!    configured for your system. There should be no remants
!    from a previous cell. Run afs-rmcell to remove any.
! 
! 3) A Kerberos realm with Kerberos4 support must be available.
!    Supported Kerberos implementations are Heimdal with
!    Kth-kerberos compatibility, MIT Kerberos 5, and 
!    Kaserver (deprecated). OpenAFS/Auth.pm must be configured
!    for your system.
! 
! 4) A Kerberos keytab file containing the afs principal 
!    and the administrator principal must be be present at
!    $path->{'afsconfdir'}/krb5.keytab.
!    See the asetkey man page for information about creating the
!    keytab file.  The default name of the administrator 
!    principal is 'admin'. See the --admin option for
!    alternative names.
  
  eoreqs
  
!   my $answer = prompt("Does your system meet these requirements? (yes/no)", "no");
!   unless ($answer=~/^y/i ) {
!     print "OK: Aborted.\n";
!   exit 0;
    }
! 
!   print "\nServer options:\n"; 
!   $ostype = prompt("Which OS?", $ostype);
!   $server = prompt("What server name should be used?", $server);
!   $cellname = prompt("What cellname should be used?", $cellname);
!   $partition = prompt("What vice partition?", $partition);
!   $admin = prompt("What administrator username?", $admin);
!   if($admin =~ /@/) {
!     die "error: Please specify the username without the realm name.\n";
    }
! 
!   print "\nKerberos options:\n";
!   $kerberos_type = prompt("Which Kerberos is to be used?", $kerberos_type);
!   if ($kerberos_type!~/kaserver/i) {
!     $kerberos_realm  = prompt("What Kerberos realm?", $kerberos_realm);
!     $kerberos_keytab = prompt("What keytab file?", $kerberos_keytab);
!     $answer = prompt("Create OpenAFS KeyFile from a keytab? (yes/no)", "yes");
!     $skip_make_keyfile = ($answer=~/^y/i) ? 0 : 1;
!   }
! 
!   print "\nFileserver options:\n";
!   $answer = prompt("Use DAFS fileserver (requires DAFS build option)? (yes/no)", "no");
!   $with_dafs = ($answer=~/^y/i) ? 1 : 0;
!   $options_fileserver = prompt("fileserver options:", $options_fileserver);
!   $options_volserver = prompt("volserver options:",  $options_volserver);
!   $options_salvageserver = prompt("salvageserver options:",  $options_salvageserver);
!   $options_salvager = prompt("salvager options:", $options_salvager);
! 
!   print "\nConfirmation:\n";
!   print "OS Type                : $ostype\n";
!   print "Server name            : $server\n";
!   print "Cell name              : $cellname\n";
!   print "Partition              : $partition\n";
!   print "Administrator          : $admin\n";
!   print "Kerberos               : $kerberos_type\n";
!   if ($kerberos_type!~/kaserver/i) {
!     print "Realm                  : $kerberos_realm\n";
!     print "Keytab file            : $kerberos_keytab\n";
!     print "Make KeyFile           : ", $skip_make_keyfile ? "yes" : "no", "\n";
    }
!   print "DAFS fileserver        : ", $with_dafs ? "yes" : "no", "\n";
!   print "fileserver options     : $options_fileserver\n";
!   print "volserver options      : $options_volserver\n";
!   print "salvagerserver options : $options_salvageserver\n";
!   print "salvager options       : $options_salvager\n";
!   print "\n";
! 
!   $answer = prompt("Continue? (yes/no)", "yes");
!   unless ($answer=~/^y/i ) {
!     print "OK: Aborted.\n";
!   exit 0;
!   }
! 
!   # Save the options for the next time.
!   $answer = prompt("Save as command-line options? (yes/no)", "yes");
!   if ($answer=~/^y/i ) {
!     my $switches = "";
!     $switches .= "--batch";
!     $switches .= " --debug"                                          if $debug;
!     $switches .= " --dont_unwind"                                    if $dont_unwind;
!     $switches .= " --ostype='$ostype'"                               if $ostype;
!     $switches .= " --server='$server'"                               if $server;
!     $switches .= " --cellname='$cellname'"                           if $cellname;
!     $switches .= " --partition='$partition'"                         if $partition;
!     $switches .= " --admin='$admin'"                                 if $admin;
!     $switches .= " --kerberos-type='$kerberos_type'"                 if $kerberos_type;
!     $switches .= " --kerberos-realm='$kerberos_realm'"               if $kerberos_realm;
!     $switches .= " --kerberos-keytab='$kerberos_keytab'"             if $kerberos_keytab;
!     $switches .= " --skip-make-keyfile"                              if $skip_make_keyfile;
!     $switches .= " --with-dafs"                                      if $with_dafs;
!     $switches .= " --options-fileserver='$options_fileserver'"       if $options_fileserver;
!     $switches .= " --options-volserver='$options_volserver'"         if $options_volserver;;
!     $switches .= " --options-salvageserver='$options_salvageserver'" if $options_salvageserver;;
!     $switches .= " --options-salvager='$options_salvager'"           if $options_salvager;
!   
!     my $conf = prompt("Filename for save?", "afs-newcell.conf");
!     open(CONF, "> $conf") or die "error: Cannot open file $conf: $!\n";
!     print CONF "$switches\n";
!     close CONF;
    }
  }
  
! if ($debug) {
!   print "debug: afs-newcell options\n";
!   print "debug:  \$batch = '$batch'\n";
!   print "debug:  \$debug = '$debug'\n";
!   print "debug:  \$dont_unwind = '$dont_unwind'\n";
!   print "debug:  \$help = '$help'\n";
!   print "debug:  \$ostype = '$ostype'\n";
!   print "debug:  \$server = '$server'\n";
!   print "debug:  \$cellname = '$cellname'\n";
!   print "debug:  \$partition = '$partition'\n";
!   print "debug:  \$admin = '$admin'\n";
!   print "debug:  \$kerberos_type = '$kerberos_type'\n";
!   print "debug:  \$kerberos_realm = '$kerberos_realm'\n";
!   print "debug:  \$kerberos_keytab = '$kerberos_keytab'\n";
!   print "debug:  \$skip_make_keyfile = '$skip_make_keyfile'\n";
!   print "debug:  \$with_dafs = '$with_dafs'\n";
!   print "debug:  \$options_fileserver = '$options_fileserver'\n";
!   print "debug:  \$options_volserver = '$options_volserver'\n";
!   print "debug:  \$options_salvageserver = '$options_salvageserver'\n";
!   print "debug:  \$options_salvager = '$options_salvager'\n";
  }
  
! # 
! # Create an auth object for the type of kerberos
! # to be used for authentication in our cell.
! #
! my $auth = OpenAFS::Auth::create(
!       'debug'=>$debug,
!       'type'=>$kerberos_type, 
!       'cell'=>$cellname,
!       'realm'=>$kerberos_realm,
!       'keytab'=>$kerberos_keytab,
!       );
! 
! my $os = OpenAFS::OS::create(
!       'debug'=>$debug,
!       'ostype'=>$ostype,
!       );
! 
! #
! # Sanity checks before we begin. Make sure we have correct
! # binaries, directories, and permissions.
! #
! 
! my $bosserver = "$path->{'afssrvsbindir'}/bosserver";
! my $bos       = "$path->{'afssrvbindir'}/bos";
! my $fs        = "$path->{'afssrvbindir'}/fs";
! my $pts       = "$path->{'afssrvbindir'}/pts";
! my $vos       = "$path->{'afssrvsbindir'}/vos";
! 
! check_program($bosserver);
! check_program($bos);
! check_program($fs);
! check_program($pts);
! check_program($vos);
! 
! 
! #
! # Sanity check admin username and convert kerberos 5 notation to afs.
! #
! if ($admin =~ /@/) {
!    die "error: Please specify the username without the realm name.\n";
! }
! my $username = $admin;
! $username=~s:/:.:g;   # convert kerberos separators to afs separators.
  
+ # Shutdown the client and server, if running.
+ run($os->command('client-stop'));
+ run($os->command('fileserver-stop'));
+ 
+ #
+ # Attempt the client setup for this system before we try to create the cell.
+ #
+ $os->configure_client();
+ 
+ #
+ # Create the initial server configuration and the server administrator, temporarily running
+ # with -noauth.
+ #
+ 
+ # bosserver attempts to create the following directories with these limited 
+ # permissions. However, bosserver does not create parent directories as needed, so
+ # the directories are not successfully created when they are more than one level
+ # deep. 
+ run("mkdir -m 0775 -p $path->{'afsconfdir'}");
+ run("mkdir -m 0700 -p $path->{'afslocaldir'}");
+ run("mkdir -m 0700 -p $path->{'afsdbdir'}");
+ run("mkdir -m 0755 -p $path->{'afslogsdir'}"); 
+ run("mkdir -m 0777 -p $path->{'viceetcdir'}");
+ 
+ # In case the directories were created earlier with the wrong permissions.
+ run("chmod 0775 $path->{'afsconfdir'}");
+ run("chmod 0700 $path->{'afslocaldir'}");
+ run("chmod 0700 $path->{'afsdbdir'}");
+ run("chmod 0755 $path->{'afslogsdir'}"); 
+ run("chmod 0777 $path->{'viceetcdir'}");
+ 
+ print "debug: Starting bosserver...\n" if $debug;
+ run("$path->{'afssrvsbindir'}/bosserver -noauth");
+     unwind($os->command('remove', "$path->{'afsconfdir'}/ThisCell"));
+     unwind($os->command('remove', "$path->{'afsconfdir'}/CellServDB"));
+     unwind($os->command('remove', "$path->{'afsconfdir'}/UserList"));
+     unwind($os->command('remove', "$path->{'afsbosconfigdir'}/BosConfig"));
+     unwind($os->command('fileserver-stop'));
+ 
+ run("$bos setcellname $server $cellname -localauth");
+ run("$bos addhost $server $server -localauth");
+ run("$bos adduser $server $username -localauth");
+     unwind("$bos removeuser $server $username -localauth");
+ 
+ #
+ # Create the AFS KeyFile. (This must be done after bosserver creates the configuration files.)
+ #
+ unless ($skip_make_keyfile) {
+   print "debug: Making the keyfile...\n" if $debug;
+   $auth->make_keyfile();
+ }
+ unless ( -f "$path->{'afsconfdir'}/KeyFile") {
+   die "You do not have an AFS keyfile.  Please create this using asetkey or the bos addkey command.\n";
+ }
  
+ # make the krb.conf file if the realm name is different than the cell name.
+ $auth->make_krb_config();
+ 
+ #
+ # Start up the ptserver and vlserver.
+ #
+ print "debug: Starting the ptserver and vlserver...\n" if $debug;
+ run("$bos create $server ptserver simple $path->{'afssrvlibexecdir'}/ptserver -localauth");
+     unwind($os->command('remove', "$path->{'afsdbdir'}/prdb.DB0"));
+     unwind($os->command('remove', "$path->{'afsdbdir'}/prdb.DBSYS1"));
+     unwind("$bos delete $server ptserver -localauth");
+     unwind("$bos stop $server ptserver -localauth");
+ 
+ run("$path->{'afssrvbindir'}/bos create $server vlserver simple $path->{'afssrvlibexecdir'}/vlserver -localauth");
+     unwind($os->command('remove', "$path->{'afsdbdir'}/vldb.DB0"));
+     unwind($os->command('remove', "$path->{'afsdbdir'}/vldb.DBSYS1"));
+     unwind("$bos delete $server vlserver -localauth");
+     unwind("$bos stop $server vlserver -localauth");
+ 
+ #
+ # Start the file server.
+ #
+ print "debug: Starting the fileserver...\n" if $debug;
+ if ($with_dafs) {
+   run( "$bos create $server dafs dafs ".
+        "-cmd $path->{'afssrvlibexecdir'}/fileserver $options_fileserver ".
+        "-cmd $path->{'afssrvlibexecdir'}/volserver $options_volserver ".
+        "-cmd $path->{'afssrvlibexecdir'}/salvageserver $options_salvageserver".
+        "-cmd $path->{'afssrvlibexecdir'}/salvager $options_salvager".
+      "-localauth");
+ }
+ else {
+   run( "$bos create $server fs fs ".
+        "-cmd $path->{'afssrvlibexecdir'}/fileserver $options_fileserver ".
+        "-cmd $path->{'afssrvlibexecdir'}/volserver $options_volserver ".
+        "-cmd $path->{'afssrvlibexecdir'}/salvager $options_salvager ".
+      "-localauth");
+ }
+   unwind("$bos delete $server fs -localauth ");
+   unwind("$bos stop $server fs -localauth ");
+ 
+ #
+ # Create the AFS administrator (with the same name as the server administrator).
+ #
+ print "debug: Creating users...\n" if $debug;
+ sleep(10); # wait to avoid "no quorum elected" errors.
+ 
+ run("$pts createuser -name $username -cell $cellname -noauth");
+ run("$pts adduser $username system:administrators -cell $cellname -noauth");
+ run("$pts membership $username -cell $cellname -noauth");
+ 
+ #
+ # Create the root afs volume.
+ #
+ print "debug: Creating root.afs volume...\n" if $debug;
+ run("$vos create $server $partition root.afs -cell $cellname -noauth");
+     unwind($os->command('remove', "$partition/AFSIDat "));
+     unwind($os->command('remove', "$partition/V*.vol"));
+     unwind($os->command('remove', "$partition/Lock"));
+     unwind("$vos remove $server $partition root.afs -cell $cellname -noauth");
+ 
+ # The initial configuration is done, turn on authorization checking.
+ #run("$bos setauth $server -authrequired on -cell $cellname -localauth");
+ #    unwind("$bos setauth $server -authrequired off -cell $cellname -localauth");
+ 
+ 
+ #
+ # Bring up the AFS client.
+ #
+ print "debug: Starting the OpenAFS client...\n" if $debug;
+ run($os->command('client-start'));
+     unwind($os->command('client-stop'));
+ 
+ #
+ # Run as the administrator.
+ #
+ $auth->authorize($admin);
+ 
+ #
+ # Create the root cell volumes, read-only and read-write.
+ #
+ print "debug: Creating the root volumes...\n" if $debug;
+ run("$fs setacl /afs system:anyuser rl");
+ 
+ run("$vos create $server $partition root.cell -localauth");
+     unwind("$vos remove $server $partition root.cell -localauth");
+ 
+ run("$fs mkmount /afs/$cellname root.cell -cell $cellname -fast");
+     unwind("$fs rmmount /afs/$cellname");
+ 
+ run("$fs setacl /afs/$cellname system:anyuser rl");
+ run("$fs mkmount /afs/.$cellname root.cell -cell $cellname -rw");
+     unwind("$fs rmmount /afs/.$cellname");
+ 
+ #run("$fs mkmount /afs/.root.afs root.afs -rw");
+ #    unwind("$fs rmmmount /afs/.root.afs");
+ 
+ #
+ # Create some volumes in our new cell.
+ #
+ print "debug: Creating the test volumes...\n" if $debug;
+ mkvol("user", "/afs/$cellname/user", $server, $partition);
+ mkvol("service", "/afs/$cellname/service", $server, $partition);
+ mkvol("unrep", "/afs/$cellname/unreplicated", $server, $partition);
+ 
+ # make a read-only volume
+ mkvol("rep", "/afs/$cellname/.replicated", $server, $partition);
+ run("$fs mkmount /afs/$cellname/replicated rep.readonly");
+ run("$vos addsite $server $partition rep -localauth");
+ run("$vos release rep -localauth");
+     unwind("$vos remove $server $partition rep.readonly -localauth");
+ 
+ 
+ #
+ # Create readonly volumes of our roots.
+ #
+ run("$vos addsite $server $partition root.afs -localauth");
+ run("$vos addsite $server $partition root.cell -localauth");
+ run("$vos release root.afs -localauth");
+ run("$vos release root.cell -localauth");
+     unwind("$vos remove $server $partition root.cell.readonly -localauth");
+     unwind("$vos remove $server $partition root.afs.readonly -localauth");
+ 
+ # done.
+ @unwinds = (); # clear unwinds
  
  END {
!   if (!$dont_unwind && scalar @unwinds) {
!     print "\ninfo: Error encountered, unwinding...\n"; 
!     while (@unwinds) {
!       eval { 
!         run(pop(@unwinds));
!       };
!       if ($@) {
!         print "warn: Unwind command failed.\n$@\n"; 
!       }
!     }
    }
+ }
Index: openafs/src/tests/afs-rmcell.pl
diff -c /dev/null openafs/src/tests/afs-rmcell.pl:1.1.4.2
*** /dev/null	Sun Mar 23 21:55:10 2008
--- openafs/src/tests/afs-rmcell.pl	Thu Jan 24 18:52:17 2008
***************
*** 0 ****
--- 1,101 ----
+ #!/usr/bin/env perl
+ #
+ # Remove cell files from this machine. Use with caution!
+ #
+ 
+ use warnings;
+ use strict;
+ use OpenAFS::Dirpath;
+ use OpenAFS::OS;
+ use OpenAFS::ConfigUtils;
+ use Term::ReadLine;
+ use Getopt::Long;
+ use Pod::Usage;
+ 
+ =head1  NAME
+ 
+    afs-rmcell - Delete AFS cell files from this machine.
+ 
+ =head1 SYNOPSIS
+ 
+ B<afs-rmcell> [B<--batch>] [B<--partition-id>=letter] [B<--help>] [B<--debug>]
+ 
+ =head1 DESCRIPTION
+ 
+ This script destroys the AFS database and volume files on this machine.
+ Use with caution!
+ 
+ =cut
+ 
+ my $debug = 0;
+ my $help = 0;
+ my $batch = 0;
+ my $partition_id = 'a';
+ my $path = $OpenAFS::Dirpath::openafsdirpath;
+ my $ostype = $path->{'ostype'};
+ 
+ #-----------------------------------------------------------------------------------
+ # main script
+ 
+ GetOptions(
+   "debug" => \$debug,
+   "help" => \$help,
+   "batch" => \$batch,
+   "partition-id=s" => \$partition_id,
+   "ostype=s" => \$ostype,
+ );
+ 
+ $OpenAFS::ConfigUtils::debug = $debug;
+ 
+ if ($help) {
+   pod2usage(1);
+   exit 0;
+ }
+ 
+ if ($> != 0) {
+   die "error: This script should run as root.\n";
+ }
+ 
+ # To be on the safe side, we do no accept the full partition name, just the letter id.
+ # You'll have to manually delete volume files for unconventional partition names.
+ unless ($partition_id=~/^(([a-z])|([a-h][a-z])|([i][a-v]))$/) {
+   die "error: Invalid partition id specified.\n".
+       "info: Please specify a valid partition abbreviation, for example --partition-id='a' for /vicepa\n";
+ }
+ 
+ unless ($batch) {
+   my $rl = new Term::ReadLine('afs-rmcell');
+   print "\n*** WARNING!! WARNING!! WARNING!! *** \n";
+   print "You are about to permanently DESTROY the OpenAFS configuration, database, and volumes on this machine!\n\n";
+   my $answer = $rl->readline("Do you really want to destroy the AFS cell data? (y/n) [n] ");
+   unless ($answer=~/^y/i ) {
+     print "info: Aborted.\n";
+     exit 0;
+   }
+ }
+ 
+ my $os = OpenAFS::OS::create('ostype'=>$ostype, 'debug'=>$debug);
+ 
+ # make sure the client init script has the correct paths.
+ $os->configure_client(); 
+ 
+ run($os->command('client-stop'));
+ run($os->command('fileserver-stop'));
+ run($os->command('client-forcestop'));
+ 
+ $os->remove("$path->{'afsdbdir'}/prdb.DB0");
+ $os->remove("$path->{'afsdbdir'}/prdb.DBSYS1");
+ $os->remove("$path->{'afsdbdir'}/vldb.DB0");
+ $os->remove("$path->{'afsdbdir'}/vldb.DBSYS1");
+ $os->remove("$path->{'afsbosconfigdir'}/BosConfig");
+ $os->remove("$path->{'afslogsdir'}/*");
+ $os->remove("$path->{'afslocaldir'}/*");
+ $os->remove("$path->{'afsconfdir'}/UserList");
+ $os->remove("$path->{'afsconfdir'}/ThisCell");
+ $os->remove("$path->{'afsconfdir'}/CellServDB");
+ $os->remove("$path->{'afsconfdir'}/KeyFile");
+ $os->remove("$path->{'afsconfdir'}/krb.conf");
+ $os->remove("/vicep$partition_id/AFSIDat ");
+ $os->remove("/vicep$partition_id/V*.vol");
+ $os->remove("/vicep$partition_id/Lock");
+ 
Index: openafs/src/tests/baduniq.pl
diff -c openafs/src/tests/baduniq.pl:1.1 openafs/src/tests/baduniq.pl:1.1.10.1
*** openafs/src/tests/baduniq.pl:1.1	Thu Jan 17 05:47:45 2002
--- openafs/src/tests/baduniq.pl	Mon Jan 21 14:50:32 2008
***************
*** 11,17 ****
  $host = `hostname`;
  &AFS_Init();
  
! &AFS_vos_restore("badvol","localhost","a","/usr/tmp/t.uniq-bad","100","full",);
  &AFS_bos_salvage("localhost","a","badvol",,,,,,);
  &AFS_fs_mkmount("badvol", "badvol",,,);
  if ( -f "badvol/test" ) {
--- 11,17 ----
  $host = `hostname`;
  &AFS_Init();
  
! &AFS_vos_restore("badvol","localhost","a","/tmp/t.uniq-bad","100","full",);
  &AFS_bos_salvage("localhost","a","badvol",,,,,,);
  &AFS_fs_mkmount("badvol", "badvol",,,);
  if ( -f "badvol/test" ) {
Index: openafs/src/tests/bosexec.pl
diff -c openafs/src/tests/bosexec.pl:1.1 openafs/src/tests/bosexec.pl:1.1.10.1
*** openafs/src/tests/bosexec.pl:1.1	Mon Jan 14 02:49:17 2002
--- openafs/src/tests/bosexec.pl	Mon Jan 21 14:50:32 2008
***************
*** 15,25 ****
  &AFS_Init();
  
  &AFS_bos_exec(localhost,"$openafsdirpath->{'afssrvbindir'}/foo.sh",);
! if (-f "/usr/tmp/garbage") {
  } else {
      exit(1);
  }
! unlink "/usr/tmp/garbage";
  exit(0);
  
  
--- 15,25 ----
  &AFS_Init();
  
  &AFS_bos_exec(localhost,"$openafsdirpath->{'afssrvbindir'}/foo.sh",);
! if (-f "/tmp/garbage") {
  } else {
      exit(1);
  }
! unlink "/tmp/garbage";
  exit(0);
  
  
Index: openafs/src/tests/bosinstall.pl
diff -c openafs/src/tests/bosinstall.pl:1.1 openafs/src/tests/bosinstall.pl:1.1.10.1
*** openafs/src/tests/bosinstall.pl:1.1	Mon Jan 14 02:49:17 2002
--- openafs/src/tests/bosinstall.pl	Mon Jan 21 14:50:32 2008
***************
*** 13,19 ****
  
  open(FOO, ">foo.sh"); 
  print FOO "#!/bin/sh\n";
! print FOO "touch /usr/tmp/garbage\n";
  print FOO "exit 0\n";
  close FOO;
  chmod 0755, "foo.sh";
--- 13,19 ----
  
  open(FOO, ">foo.sh"); 
  print FOO "#!/bin/sh\n";
! print FOO "touch /tmp/garbage\n";
  print FOO "exit 0\n";
  close FOO;
  chmod 0755, "foo.sh";
Index: openafs/src/tests/extcopyin
diff -c openafs/src/tests/extcopyin:1.1 openafs/src/tests/extcopyin:1.1.10.1
*** openafs/src/tests/extcopyin:1.1	Mon Jan 14 02:49:17 2002
--- openafs/src/tests/extcopyin	Mon Jan 21 14:50:32 2008
***************
*** 1,11 ****
  #!/bin/sh
  FS=${FS:-${objdir}/../appl/fs/fs}
  ${FS} sa . system:anyuser all || exit 1
! ${objdir}/write-rand /usr/tmp/$$ 262144 || exit 1
! ${objdir}/afscp -i -b 56k /usr/tmp/$$ `pwd`/$$ || exit 1
! diff /usr/tmp/$$ `pwd`/$$ || exit 1
! ${objdir}/afscp -i -b 32k /usr/tmp/$$ `pwd`/$$ || exit 1
! diff /usr/tmp/$$ `pwd`/$$ || exit 1
  exit 0
  
  
--- 1,11 ----
  #!/bin/sh
  FS=${FS:-${objdir}/../appl/fs/fs}
  ${FS} sa . system:anyuser all || exit 1
! ${objdir}/write-rand /tmp/$$ 262144 || exit 1
! ${objdir}/afscp -i -b 56k /tmp/$$ `pwd`/$$ || exit 1
! diff /tmp/$$ `pwd`/$$ || exit 1
! ${objdir}/afscp -i -b 32k /tmp/$$ `pwd`/$$ || exit 1
! diff /tmp/$$ `pwd`/$$ || exit 1
  exit 0
  
  
Index: openafs/src/tests/extcopyout
diff -c openafs/src/tests/extcopyout:1.1 openafs/src/tests/extcopyout:1.1.10.1
*** openafs/src/tests/extcopyout:1.1	Mon Jan 14 02:49:17 2002
--- openafs/src/tests/extcopyout	Mon Jan 21 14:50:32 2008
***************
*** 2,11 ****
  FS=${FS:-${objdir}/../appl/fs/fs}
  ${FS} sa . system:anyuser all || exit 1
  ${objdir}/write-rand $$ 262144 || exit 1
! ${objdir}/afscp -o -b 56k `pwd`/$$ /usr/tmp/$$ || exit 1
! diff /usr/tmp/$$ `pwd`/$$ || exit 1
! ${objdir}/afscp -o -b 32k `pwd`/$$ /usr/tmp/$$ || exit 1
! diff /usr/tmp/$$ `pwd`/$$ || exit 1
  exit 0
  
  
--- 2,11 ----
  FS=${FS:-${objdir}/../appl/fs/fs}
  ${FS} sa . system:anyuser all || exit 1
  ${objdir}/write-rand $$ 262144 || exit 1
! ${objdir}/afscp -o -b 56k `pwd`/$$ /tmp/$$ || exit 1
! diff /tmp/$$ `pwd`/$$ || exit 1
! ${objdir}/afscp -o -b 32k `pwd`/$$ /tmp/$$ || exit 1
! diff /tmp/$$ `pwd`/$$ || exit 1
  exit 0
  
  
Index: openafs/src/tests/hardlink5
diff -c openafs/src/tests/hardlink5:1.1 openafs/src/tests/hardlink5:1.1.10.1
*** openafs/src/tests/hardlink5:1.1	Mon Jan 14 02:49:17 2002
--- openafs/src/tests/hardlink5	Mon Jan 21 14:50:32 2008
***************
*** 1,11 ****
  #!/bin/sh
! # $Id: hardlink5,v 1.1 2002/01/14 07:49:17 shadow Exp $
  
  if test "X$FAST" != "X" ; then echo "Not running $0" ;  exit 0 ; fi
  
  FS=${FS:-${objdir}/../appl/fs/fs}
  
  touch file
! ln file ../../service/file && exit 1
  rm file
  
--- 1,14 ----
  #!/bin/sh
! # $Id: hardlink5,v 1.1.10.1 2008/01/21 19:50:32 shadow Exp $
  
  if test "X$FAST" != "X" ; then echo "Not running $0" ;  exit 0 ; fi
  
  FS=${FS:-${objdir}/../appl/fs/fs}
  
+ # Should not be able to create a hardlink across volumes. In this test
+ # ../../service is mounted on the separate volume. Suppress the expected
+ # error message from the ln command which clutters the test output.
  touch file
! ln file ../../service/file 2>/dev/null && (echo "hardlink ../../service/file should not have been created"; exit 1)
  rm file
  
Index: openafs/src/tests/reauth.pl
diff -c openafs/src/tests/reauth.pl:1.2 openafs/src/tests/reauth.pl:1.2.10.1
*** openafs/src/tests/reauth.pl:1.2	Tue Jan 15 11:26:04 2002
--- openafs/src/tests/reauth.pl	Mon Jan 21 14:50:32 2008
***************
*** 1,12 ****
  #!/usr/bin/env perl
- use Term::ReadLine;
  use strict;
! use OpenAFS::ConfigUtils;
  use OpenAFS::Dirpath;
- use OpenAFS::OS;
  use OpenAFS::Auth;
  use Getopt::Long;
- use vars qw($admin $server $cellname $cachesize $part
-           $requirements_met  $shutdown_needed $csdb);
  
! &OpenAFS::Auth::authadmin();
--- 1,34 ----
  #!/usr/bin/env perl
  use strict;
! use warnings;
  use OpenAFS::Dirpath;
  use OpenAFS::Auth;
  use Getopt::Long;
  
! # options
! my $debug = 0;
! my $cellname = 'testcell';
! my $admin = 'admin';
! my $kerberos_type = 'MIT';
! my $kerberos_realm = 'TESTCELL';
! my $kerberos_keytab = "$openafsdirpath->{'afsconfdir'}/krb5.keytab";
! 
! GetOptions (
!        "debug!" => \$debug,
!        "cellname=s" => \$cellname, 
!        "admin=s" => \$admin,
!        "kerberos-type=s" => \$kerberos_type,
!        "kerberos-realm=s" => \$kerberos_realm,
!        "kerberos-keytab=s" => \$kerberos_keytab,
!        );
! 
! my $auth = OpenAFS::Auth::create(
!       'debug'=>$debug,
!       'type'=>$kerberos_type, 
!       'cell'=>$cellname,
!       'realm'=>$kerberos_realm,
!       'keytab'=>$kerberos_keytab,
!       );
! 
! # Run as the administrator.
! $auth->authorize($admin);
Index: openafs/src/tests/run-tests.in
diff -c openafs/src/tests/run-tests.in:1.5 openafs/src/tests/run-tests.in:1.5.8.1
*** openafs/src/tests/run-tests.in:1.5	Thu Feb 21 01:06:00 2002
--- openafs/src/tests/run-tests.in	Mon Jan 21 14:50:32 2008
***************
*** 1,7 ****
  #!/bin/sh
  #
! # $Id: run-tests.in,v 1.5 2002/02/21 06:06:00 shadow Exp $
  #
  srcdir=@srcdir@
  objdir=`pwd`
  SHELL=/bin/sh
--- 1,20 ----
  #!/bin/sh
  #
! # $Id: run-tests.in,v 1.5.8.1 2008/01/21 19:50:32 shadow Exp $
  #
+ 
+ # Directory paths configured during the build.
+ if test -f dirpath.conf; then
+   . dirpath.conf
+ else
+   echo "error: Missing dirpath.conf file, try make dirpath.conf"
+ fi
+ 
+ if test -f run-test.conf; then
+   . run-test.conf
+ fi  
+ 
+ 
  srcdir=@srcdir@
  objdir=`pwd`
  SHELL=/bin/sh
***************
*** 9,21 ****
  VERSION=@VERSION@
  PACKAGE=@PACKAGE@
  host=@host@
! RUNAS=nobody
! FS=@afssrvbindir@/fs
  export FS
  export SHELL
  
  AFSROOT=${AFSROOT-/afs}
  export AFSROOT
  
  BASIC_TESTS="creat1			\
  	    mkdir1			\
--- 22,43 ----
  VERSION=@VERSION@
  PACKAGE=@PACKAGE@
  host=@host@
! RUNAS=
! FS=${afssrvbindir}/fs
! CELLNAME=${CELLNAME-testcell}
  export FS
  export SHELL
  
+ 
+ PERL5LIB=${PERL5LIB-`pwd`}
  AFSROOT=${AFSROOT-/afs}
+ TESTDIR=${TESTDIR-unreplicated}
+ WORKDIR=$AFSROOT/$CELLNAME/$TESTDIR
  export AFSROOT
+ export TESTDIR
+ export WORKDIR
+ export PERL5LIB
+ 
  
  BASIC_TESTS="creat1			\
  	    mkdir1			\
***************
*** 55,62 ****
  	    aclcopy.pl"
  
  EXEC_TESTS="exec			\
! 	    hello-world			\
! 	    build-openafs"
  
  MMAP_TESTS="append-over-page		\
  	    mmap-shared-write		\
--- 77,83 ----
  	    aclcopy.pl"
  
  EXEC_TESTS="exec			\
! 	    hello-world"
  
  MMAP_TESTS="append-over-page		\
  	    mmap-shared-write		\
***************
*** 184,190 ****
  	    aclcopy.pl			\
  	    exec			\
  	    hello-world			\
- 	    build-openafs		\
  	    append-over-page		\
  	    mmap-shared-write		\
  	    mmap-vs-read2		\
--- 205,210 ----
***************
*** 285,291 ****
    -large) LARGE=yes;;
    -j) PARALLELL="&";;
    -verbose) VERBOSE=yes;;
!   -user) RUNAS=$1; shift;;
    -x) SHELLVERBOSE="-x";;
    -p) PRINT_CACHESIZE="yes";;
    -basic) TESTS="$BASIC_TESTS";TEST_MODE="basic";;
--- 305,311 ----
    -large) LARGE=yes;;
    -j) PARALLELL="&";;
    -verbose) VERBOSE=yes;;
!   -user) RUNAS=$2; shift;;
    -x) SHELLVERBOSE="-x";;
    -p) PRINT_CACHESIZE="yes";;
    -basic) TESTS="$BASIC_TESTS";TEST_MODE="basic";;
***************
*** 304,310 ****
    -help|--help) echo $usage; 
  	echo "tests available: $linebreak"; for a in "$ALL_TESTS"; do echo $a ; done;
  	exit 0;;
!   -version|--version) echo "$0 $Id: run-tests.in,v 1.5 2002/02/21 06:06:00 shadow Exp $"; exit 0;;
    -*) echo "$0: Bad option $1"; echo $usage; exit 1;;
    *) break;;
    esac
--- 324,330 ----
    -help|--help) echo $usage; 
  	echo "tests available: $linebreak"; for a in "$ALL_TESTS"; do echo $a ; done;
  	exit 0;;
!   -version|--version) echo "$0 $Id: run-tests.in,v 1.5.8.1 2008/01/21 19:50:32 shadow Exp $"; exit 0;;
    -*) echo "$0: Bad option $1"; echo $usage; exit 1;;
    *) break;;
    esac
***************
*** 386,392 ****
    if test "$a" = "setgroups" ; then
       b="${objdir}/asu root $b"
    else
!      b="${objdir}/asu $RUNAS $b"
    fi
    tmpdir="`hostname`-$a-`date +%Y-%m-%d-%H-%M-%S`-$$"
    cd $WORKDIR && mkdir $tmpdir && (cd $tmpdir && $b ${PARALLELL})
--- 406,414 ----
    if test "$a" = "setgroups" ; then
       b="${objdir}/asu root $b"
    else
!      if test "X$RUNAS" != "X" ; then
!         b="${objdir}/asu $RUNAS $b"
! 	 fi 
    fi
    tmpdir="`hostname`-$a-`date +%Y-%m-%d-%H-%M-%S`-$$"
    cd $WORKDIR && mkdir $tmpdir && (cd $tmpdir && $b ${PARALLELL})
***************
*** 412,419 ****
--- 434,443 ----
  if test "$FAILEDTESTS"; then
    echo "-----------------------------------------------------------"
    echo "Failed test(s) were: $FAILEDTESTS"
+   exitval=1
  else
    echo "All test(s) were succesful!"
+   exitval=0
  fi
  
  exit $exitval
Index: openafs/src/tests/vosdump.pl
diff -c openafs/src/tests/vosdump.pl:1.1 openafs/src/tests/vosdump.pl:1.1.10.1
*** openafs/src/tests/vosdump.pl:1.1	Mon Jan 14 02:49:18 2002
--- openafs/src/tests/vosdump.pl	Mon Jan 21 14:50:32 2008
***************
*** 11,17 ****
  $host = `hostname`;
  &AFS_Init();
  
! &AFS_vos_dump("service",0,"/usr/tmp/service.dump",);
  
  exit(0);
  
--- 11,17 ----
  $host = `hostname`;
  &AFS_Init();
  
! &AFS_vos_dump("service",0,"/tmp/service.dump",);
  
  exit(0);
  
Index: openafs/src/tests/vosrestore.pl
diff -c openafs/src/tests/vosrestore.pl:1.1 openafs/src/tests/vosrestore.pl:1.1.10.1
*** openafs/src/tests/vosrestore.pl:1.1	Mon Jan 14 02:49:18 2002
--- openafs/src/tests/vosrestore.pl	Mon Jan 21 14:50:32 2008
***************
*** 11,17 ****
  $host = `hostname`;
  &AFS_Init();
  
! &AFS_vos_restore("service2","localhost","a","/usr/tmp/service.dump",,"full",);
  
  exit(0);
  
--- 11,17 ----
  $host = `hostname`;
  &AFS_Init();
  
! &AFS_vos_restore("service2","localhost","a","/tmp/service.dump",,"full",);
  
  exit(0);
  
Index: openafs/src/tests/OpenAFS/Auth.pm
diff -c /dev/null openafs/src/tests/OpenAFS/Auth.pm:1.1.4.2
*** /dev/null	Sun Mar 23 21:55:10 2008
--- openafs/src/tests/OpenAFS/Auth.pm	Thu Jan 24 18:52:17 2008
***************
*** 0 ****
--- 1,343 ----
+ # This is -*- perl -*-
+ 
+ package OpenAFS::Auth;
+ use strict;
+ use warnings;
+ use OpenAFS::Dirpath;
+ use OpenAFS::ConfigUtils;
+ 
+ my $path = $OpenAFS::Dirpath::openafsdirpath;
+ 
+ #
+ # Create an auth type for the specified Kerberos implementation.
+ #
+ # parameters:
+ #   type   -- Kerberos implementation: mit, heimdal, kaserver
+ #   keytab -- path and name of the keytab file for mit and heimdal
+ #   cell   -- cell name. if not specified, attempts to find the 
+ #               cell name in the ThisCell configuration file.
+ #   realm  -- realm name. if not specified, assume the realm name
+ #               is the same as the cell name, in uppercase.
+ #
+ # example:
+ #  my $auth = OpenAFS::Auth::create(
+ #               'type'=>'mit', 
+ #               'keytab'=>'/path/to/file/krb5.keytab');
+ #
+ #  $auth->authorize('admin');
+ #
+ sub create {
+   my $self = {
+      # default values
+      'type' => 'MIT',
+      'keytab' =>  "$path->{'afsconfdir'}/krb5.keytab",
+      'cell' => '',
+      'realm' => '', 
+      'debug' => '0',
+      # user specified values
+      @_,
+   };
+ 
+   # check for supported kerberos type.
+   my $type = $self->{'type'};
+   $self->{'type'} = _check_kerberos_type($type) or 
+     die "Unsupported kerberos type: $type\n";
+ 
+   # create the sub-class for the kerberos type.
+   my $class = "OpenAFS::Auth::$self->{'type'}";
+   $self = bless($self, $class);
+ 
+   # attempt get default values.
+   unless ($self->{'cell'}) {
+     eval {
+       $self->{'cell'} = $self->_lookup_cell_name();
+     }
+   }
+   unless ($self->{'realm'}) {
+     if ($self->{'cell'}) {
+       my $cell = $self->{'cell'};
+       ($self->{'realm'} = $cell) =~ tr[a-z][A-Z];
+     }
+   }
+   unless ($self->{'keytab'}) {
+     $self->{'keytab'} = "$path->{'afsconfdir'}/krb5.keytab";
+   }
+ 
+   # kerberos type specific sanity checks.
+   $self->_sanity_check();
+ 
+   if ($self->debug) {
+     print "debug: Auth::create()\n";
+     foreach my $k (sort keys(%$self)) {
+       print "debug:  $k => $self->{$k}\n";
+     }
+   }
+   return $self;
+ }
+ 
+ #
+ # Check for supported kerberos type, and allow for case insensitivity.
+ #
+ sub _check_kerberos_type {
+   my $type = shift;
+   foreach my $supported ('MIT', 'Heimdal', 'Kaserver') {
+      if ($type =~ /^$supported$/i) {
+         return $supported;
+      }
+   }
+   return undef;
+ }
+ 
+ #
+ # Returns the cell name from the ThisCell configuration file.
+ #
+ sub _lookup_cell_name {
+   my $self = shift;
+   my $cell;
+   open(CELL, "$path->{'afsconfdir'}/ThisCell") 
+     or die "error: Cannot open $path->{'afsconfdir'}/ThisCell: $!\n";
+   $cell = <CELL>;
+   chomp $cell;
+   close CELL;
+   return $cell;
+ }
+ 
+ #
+ # Placeholder for make_keyfile. Sub-classes should override.
+ #
+ sub make_keyfile {
+   my $self = shift;
+   return;
+ }
+ 
+ # 
+ # Make the krb.conf file if the realm name is different
+ # than the cell name. The syntax is something like,
+ #
+ #   UMICH.EDU
+ #   UMICH.EDU fear.ifs.umich.edu admin server
+ #   UMICH.EDU surprise.ifs.umich.edu
+ #   UMICH.EDU ruthless.ifs.umich.edu
+ #
+ sub make_krb_config {
+   my $self = shift;
+   my $cell = $self->{'cell'};
+   my $realm = $self->{'realm'};
+ 
+   if ($realm && $realm ne $cell) {
+     unless ( -d $path->{'afsconfdir'} ) {
+       die "error: OpenAFS configuration directory '$path->{'afsconfdir'}' is missing.\n";
+     }
+     unless ( -w $path->{'afsconfdir'} ) {
+       die "error: Write access to the configuration directory '$path->{'afsconfdir'}' is required.\n";
+     }
+     print "debug: Making $path->{'afsconfdir'}/krb.conf file for realm $realm\n" if $self->{'debug'};
+     open(KRB, "> $path->{'afsconfdir'}/krb.conf") or die "error: Failed to open $path->{'afsconfdir'}/krb.conf, $!\n";
+     print KRB "$realm\n";
+     close KRB;
+   } 
+ }
+ 
+ #
+ # Enable/disable debug messages.
+ #
+ sub debug {
+   my $self = shift;
+   if (@_) {
+     $self->{'debug'} = shift;
+   }
+   return $self->{'debug'};
+ }
+ 
+ 
+ #------------------------------------------------------------------------------------
+ # MIT Kerberos authorization commands.
+ #
+ package OpenAFS::Auth::MIT;
+ use strict;
+ use OpenAFS::Dirpath;
+ use OpenAFS::ConfigUtils;
+ our @ISA = ("OpenAFS::Auth");
+ 
+ #
+ # Sanity checks before we get started.
+ #
+ sub _sanity_check {
+   my $self = shift;
+   unless (defined $path->{'afssrvbindir'}) {
+     die "error: \$path->{'afssrvbindir'} is not defined.\n";
+   }
+   unless (-f "$path->{'afssrvbindir'}/aklog") {
+     die "error: $path->{'afssrvbindir'}/aklog not found.\n";
+   }
+   unless (-x "$path->{'afssrvbindir'}/aklog") {
+     die "error: $path->{'afssrvbindir'}/aklog not executable.\n";
+   }
+   unless ($self->{'realm'}) {
+     die "error: Missing realm parameter Auth::create().\n";
+   }
+   unless ($self->{'keytab'}) {
+     die "error: Missing keytab parameter Auth::create().\n";
+   }
+   unless ( -f $self->{'keytab'} ) {
+     die "error: Kerberos keytab file not found: $self->{'keytab'}\n";
+   }
+   unless ( -f $self->{'keytab'} ) {
+     die "error: Keytab file not found: $self->{'keytab'}\n";
+   }
+ }
+ 
+ #
+ # Create the KeyFile from the Kerberos keytab file. The keytab file
+ # should be created using the Kerberos kadmin command (or with the kadmin.local command
+ # as root on the KDC). See the OpenAFS asetkey man page for details.
+ # 
+ sub make_keyfile {
+   my $self = shift;
+ 
+   # asetkey annoyance. The current asetkey implementation requires the ThisCell and CellServDB files
+   # to be present but they really are not needed to create the KeyFile. This check is done here
+   # rather than in the _sanity_checks() because the ThisCell/CellServerDB are created later in 
+   # the process of creating the new cell.
+   unless ( -f "$path->{'afsconfdir'}/ThisCell" ) {
+     die "error: OpenAFS configuration file is required, $path->{'afsconfdir'}/ThisCell\n";
+   }
+   unless ( -f "$path->{'afsconfdir'}/CellServDB" ) {
+     die "error: OpenAFS configuration file is required, $path->{'afsconfdir'}/CellServDB\n";
+   }
+ 
+   unless ( -f "$path->{'afssrvbindir'}/asetkey" ) {
+     die "error: $path->{'afssrvbindir'}/asetkey is missing.\nWas OpenAFS built with Kerberos support?\n";
+   }
+   unless ( -x "$path->{'afssrvbindir'}/asetkey" ) {
+     die "error: Do not have execute permissions on $path->{'afssrvbindir'}/asetkey\n";
+   }
+   unless ( -d $path->{'afsconfdir'} ) {
+     die "error: OpenAFS configuration directory '$path->{'afsconfdir'}' is missing.\n";
+   }
+   unless ( -w $path->{'afsconfdir'} ) {
+     die "error: Write access to the OpenAFS configuration directory '$path->{'afsconfdir'}' is required.\n";
+   }
+ 
+ 
+   # Run klist to get the kvno of the afs key. Search for afs/cellname@REALM
+   # then afs@REALM. klist must be in the path.
+   my %keys = ();
+   my $kvno;
+   my $principal;
+   my $afs_kvno;
+   my $afs_principal;
+   if ($self->debug) {
+     print "debug: reading $self->{'keytab'} to find afs kvno\n";
+   }
+   open(KLIST, "klist -k $self->{'keytab'} |") or die "make_keyfile: Failed to run klist.";
+   while (<KLIST>) {
+     chomp;
+     next if /^Keytab/;  # skip headers
+     next if /^KVNO/;
+     next if /^----/;
+     ($kvno, $principal) = split;
+     if ($self->debug) {
+       print "debug:  kvno=$kvno principal=$principal\n";
+     }
+     $keys{$principal} = $kvno;
+   }
+   close KLIST;
+   my $cell = $self->{'cell'};
+   my $realm = $self->{'realm'};
+   foreach my $principal ("afs/$cell\@$realm", "afs\@$realm") {
+     if ($self->debug) {
+       print "debug: searching for $principal\n";
+     }
+     if (defined $keys{$principal}) {
+       $afs_principal = $principal;
+       $afs_kvno = $keys{$afs_principal};
+       if ($self->debug) {
+          print "debug: found principal=$afs_principal kvno=$afs_kvno\n";
+       }
+       last;
+     }
+   }
+   unless ($afs_kvno) {
+     die "error: Could not find an afs key matching 'afs/$cell\@$realm' or ".
+       "'afs/$cell' in keytab $self->{'keytab'}\n";
+   }
+ 
+   # Run asetkey on the keytab to create the KeyFile. asetkey must be in the PATH.
+   run("$path->{'afssrvbindir'}/asetkey add $afs_kvno $self->{'keytab'} $afs_principal");
+ }
+ 
+ #
+ # Get kerberos ticket and AFS token for the user.
+ #
+ sub authorize {
+   my $self = shift;
+   my $principal = shift || 'admin';
+   my $opt_aklog = "";
+   $opt_aklog .= " -d" if $self->debug;
+ 
+   run("kinit -k -t $self->{'keytab'} $principal");
+   run("$path->{'afssrvbindir'}/aklog $opt_aklog");
+   run("$path->{'afssrvbindir'}/tokens");
+ }
+ 
+ 
+ #------------------------------------------------------------------------------------
+ package OpenAFS::Auth::Heimdal;
+ use strict;
+ use OpenAFS::Dirpath;
+ use OpenAFS::ConfigUtils;
+ our @ISA = ("OpenAFS::Auth");
+ 
+ #
+ # Various checks during initialization.
+ #
+ sub _sanity_check {
+   my $self = shift;
+   unless ($self->{'realm'}) {
+     die "Missing realm parameter Auth::create().\n";
+   }
+   unless ($self->{'keytab'}) {
+     die "Missing keytab parameter Auth::create().\n";
+   }
+   unless ( -f $self->{'keytab'} ) {
+     die "keytab file not found: $self->{'keytab'}\n";
+   }
+ }
+ 
+ #
+ # Get kerberos ticket and AFS token for the user.
+ #
+ sub authorize {
+   my $self = shift;
+   my $principal = shift || 'admin';  
+   run("kinit -k -t $self->{'keytab'} $principal\@$self->{'realm'} && afslog");
+ }
+ 
+ #------------------------------------------------------------------------------------
+ package OpenAFS::Auth::Kaserver;
+ use strict;
+ use OpenAFS::Dirpath;
+ use OpenAFS::ConfigUtils;
+ our @ISA = ("OpenAFS::Auth");
+ 
+ #
+ # Various checks during initialization.
+ #
+ sub _sanity_check {
+   my $self = shift;
+   unless ($self->{'realm'}) {
+     die "Missing realm parameter Auth::create().\n";
+   }
+ }
+ 
+ #
+ # Get kerberos ticket and AFS token for the user.
+ #
+ sub authorize {
+   my $self = shift;
+   my $principal = shift || 'admin';
+   run("echo \"Proceeding w/o authentication\"|klog -pipe ${principal}\@$self->{'realm'}");
+ }
+ 
+ 1;
Index: openafs/src/tests/OpenAFS/ConfigUtils.pm
diff -c openafs/src/tests/OpenAFS/ConfigUtils.pm:1.1 openafs/src/tests/OpenAFS/ConfigUtils.pm:1.1.10.1
*** openafs/src/tests/OpenAFS/ConfigUtils.pm:1.1	Tue Jan 15 14:22:11 2002
--- openafs/src/tests/OpenAFS/ConfigUtils.pm	Mon Jan 21 14:50:32 2008
***************
*** 3,26 ****
  package OpenAFS::ConfigUtils;
  
  use strict;
! use vars qw( @ISA @EXPORT @unwinds);
  @ISA = qw(Exporter);
  require Exporter;
  @EXPORT = qw(@unwinds run unwind);
  
! sub run ($) {
!   print join(' ', @_);
!   print "\n";
!   system (@_)  == 0
!     or die "Failed: $?\n";
  }
  
  # This subroutine takes a command to run in case of failure.  After
  # each succesful step, this routine should be run with a command to
  # undo the successful step.
! 
! 	 sub unwind($) {
! 	   push @unwinds, $_[0];
! 	 }
  
  1;
--- 3,42 ----
  package OpenAFS::ConfigUtils;
  
  use strict;
! use vars qw( @ISA @EXPORT @unwinds $debug);
  @ISA = qw(Exporter);
  require Exporter;
  @EXPORT = qw(@unwinds run unwind);
  
! $debug = 0;
! 
! #--------------------------------------------------------------------
! # run(cmd) - run a command. Takes a command to be executed or 
! #            a perl code reference to be eval'd.
! sub run($) {
!   my $cmd = shift;
!   if (ref($cmd) eq 'CODE') {
!     eval { &$cmd };
! 	if ($@) {
!       die "ERROR: $@\n";
! 	}
!   }
!   else {
!     if ($debug) {
!       print "debug: $cmd\n";
!     }
!     my $rc = system($cmd);
!     unless ($rc==0) {
!       die "ERROR: Command failed: $cmd\nerror code=$?\n";
!     }
!   }
  }
  
  # This subroutine takes a command to run in case of failure.  After
  # each succesful step, this routine should be run with a command to
  # undo the successful step.
! sub unwind($) {
!    push @unwinds, $_[0];
! }
  
  1;
Index: openafs/src/tests/OpenAFS/OS.pm
diff -c /dev/null openafs/src/tests/OpenAFS/OS.pm:1.1.4.2
*** /dev/null	Sun Mar 23 21:55:10 2008
--- openafs/src/tests/OpenAFS/OS.pm	Thu Jan 24 18:52:17 2008
***************
*** 0 ****
--- 1,312 ----
+ # This is -*- perl -*-
+ 
+ package OpenAFS::OS;
+ use warnings;
+ use strict;
+ use OpenAFS::Dirpath;
+ use OpenAFS::ConfigUtils;
+ 
+ my $path = $OpenAFS::Dirpath::openafsdirpath;
+ 
+ #
+ # Create the named system object for OS specific init scripts 
+ # and commands.
+ #
+ sub create {
+   my $self = {
+     'debug'=>0,
+     'ostype'=>$path->{'ostype'},
+     @_,
+   };
+ 
+   my $class = _get_class($self->{'ostype'});
+   $self = bless($self, $class);
+   $self->{'commands'} = $self->get_commands();
+ 
+   # Put the paths to the cache and afsd into the path
+   # table. Assume legacy paths if the the viceetcdir is set to
+   # the Transarc path.
+   if ($path->{'viceetcdir'} eq '/usr/vice/etc') {
+     # set in the makefile dest targets
+     $path->{'cachedir'} = "/usr/vice"     unless $path->{'cachedir'};  
+     $path->{'afsddir'}  = "/usr/vice/etc" unless $path->{'afsddir'};
+   }
+   else {
+     # set in the makefile install targets
+     $path->{'cachedir'} = "$path->{'localstatedir'}/openafs" unless $path->{'cachedir'};
+     $path->{'afsddir'}  = "$path->{'afssrvsbindir'}"         unless $path->{'afsddir'};
+   }  
+ 
+   return $self;
+ }
+ 
+ # 
+ # _get_class(name) - Return the package name for the ostype
+ #
+ sub _get_class {
+   my $type = shift;
+   if ($type=~/linux/i) {
+     return "OpenAFS::OS::Linux";
+   }
+   die "error: Unknow system type. Valid types are: linux\n";
+ }
+ 
+ #
+ # command(name [,params...]) - Return the command string or code reference.
+ #
+ sub command {
+   my $self = shift;
+   my $name = shift;
+   my $cmd = $self->{'commands'}->{$name};
+   unless (defined $cmd) {
+     die "error: Unsupported command name $name for OS type $self->{'ostype'}\n";
+   }
+   # add parameters if present.
+   if (scalar @_) {
+     if (ref($cmd) eq 'CODE') {
+       $cmd = sub { &$cmd(@_) };
+     }
+     else {
+       $cmd = join(' ', ($cmd, @_));
+     }
+   }
+   return $cmd;
+ }
+ 
+ #--------------------------------------------------------------
+ # Common unix style os commands.
+ package OpenAFS::OS::Unix;
+ use warnings;
+ use strict;
+ use OpenAFS::ConfigUtils;
+ use OpenAFS::Dirpath;
+ our @ISA = qw(OpenAFS::OS);
+ 
+ #
+ # remove(target) - recursive remove
+ #
+ sub remove {
+   my $self = shift;
+   my $target = shift;
+   run("rm -rf $target");
+ }
+ 
+ #
+ # Start the server.
+ #
+ sub fileserver_start {
+   my $self = shift;
+   run("$path->{'afssrvsbindir'}/bosserver");
+ }
+ 
+ #
+ # Stop the server.
+ #
+ sub fileserver_stop {
+   my $self = shift;
+   my @bosserver_pids = $self->find_pids("bosserver");
+   if (scalar @bosserver_pids) {
+     # bosserver is running, try to shutdown with bos.
+     eval {
+       run("$path->{'afssrvbindir'}/bos shutdown localhost -localauth");
+     };
+     if ($@) {
+       warn "WARNING: Shutdown command failed.\n";
+     }
+     # Now shutdown bosserver process itself. Kill all of them
+     # in case there are remants.
+     foreach my $pid (@bosserver_pids) {
+       eval { run("kill $pid") };
+     }
+   }
+ }
+ 
+ #
+ # Restart the server.
+ #
+ sub fileserver_restart {
+   my $self = shift;
+   fileserver_stop();
+   fileserver_start();
+ }
+ 
+ #
+ # Return a list of pids. 
+ # 
+ sub find_pids {
+   my $self = shift;
+   my $process = shift;
+   my @pids = ();
+   my $ps = "ps -e -o pid,cmd";
+   if ($self->{'debug'}) {
+     print("debug: searching for process $process\n");
+   }
+   open(PS, "$ps |") or die "Cannot run command: $ps: $!";
+   while (<PS>) {
+     chomp;
+     my ($pid,$cmd) = split;
+     if ($cmd=~/$process/) {
+       if ($self->{'debug'}) {
+         print("debug:  found $pid $cmd\n");
+       }
+       push(@pids, $pid);
+     }
+   }
+   close PS;
+   return @pids;
+ }
+ 
+ #--------------------------------------------------------------
+ package OpenAFS::OS::Linux;
+ use warnings;
+ use strict;
+ use OpenAFS::ConfigUtils;
+ use OpenAFS::Dirpath;
+ our @ISA = qw(OpenAFS::OS::Unix);
+ 
+ #
+ # OS-specific commands. Defer to init scripts where possible.
+ #
+ sub get_commands {
+   my $self = shift;
+   my $syscnf = "$path->{'initdir'}/testclient.conf";
+ 
+   my $commands = {
+     'client-start'         => "SYSCNF=$syscnf $path->{'initdir'}/afs.rc start",
+     'client-stop'          => "SYSCNF=$syscnf $path->{'initdir'}/afs.rc stop",
+     'client-restart'       => "SYSCNF=$syscnf $path->{'initdir'}/afs.rc restart",
+     'client-forcestop'     => sub { $self->client_forcestop() },
+     'fileserver-start'     => sub { $self->fileserver_start() },
+     'fileserver-stop'      => sub { $self->fileserver_stop() },
+     'fileserver-restart'   => sub { $self->fileserver_restart() },
+     'remove'               => 'rm -rf',
+   };
+   return $commands;
+ } 
+ 
+ #
+ # Setup the init script configuration, including the install paths.
+ # Create the required directories for the client, /afs and the 
+ # cache directory.
+ #
+ # N.B.The cacheinfo file is created by the init script.
+ #
+ sub configure_client {
+   my $self = shift;
+   my $config = {
+     # defaults
+     'cachesize' => '50000',
+     # custom
+     @_,
+   };
+   
+   my $debug = $self->{'debug'};
+   my $syscnf = "$path->{'initdir'}/testclient.conf";
+ 
+   open (SYSCNF, "> $syscnf") or
+     die "error: Cannot open afs.rc configuration file $syscnf, $!\n";
+ 
+   print "debug: creating afs.rc configuration file $syscnf\n" if $debug; 
+   print SYSCNF <<"_SYSCNF_";
+ AFS_CLIENT=on
+ AFS_SERVER=off
+ ENABLE_AFSDB=off
+ ENABLE_DYNROOT=off
+ CACHESIZE=$config->{'cachesize'}
+ OPTIONS="-confdir $path->{'viceetcdir'}"
+ WAIT_FOR_SALVAGE=no
+ AFSDIR=/afs
+ CACHEDIR=$path->{'cachedir'}/cache
+ CACHEINFO=$path->{'viceetcdir'}/cacheinfo
+ VERBOSE=
+ AFS_POST_INIT=
+ AFSD=$path->{'afsddir'}/afsd
+ BOSSERVER=$path->{'afssrvsbindir'}/bosserver
+ BOS=$path->{'afssrvbindir'}/bos
+ KILLAFS=$path->{'viceetcdir'}/killafs
+ MODLOADDIR=$path->{'afskerneldir'} 
+ _SYSCNF_
+   close SYSCNF;
+   if ($debug) {
+     if (open(SYSCNF, "< $syscnf")) {
+       while (<SYSCNF>) {
+         chomp; print "debug:  $_\n";
+       }
+       close SYSCNF;
+     }
+   }
+ 
+   # Create a cache directory if none.
+   unless ( -d "$path->{'cachedir'}/cache" ) {
+     print "debug: making cache directory: $path->{'cachedir'}/cache\n" if $debug;
+     system("mkdir -p $path->{'cachedir'}/cache");
+     system("chmod 0700 $path->{'cachedir'}/cache"); 
+   }
+ 
+   # Create the local /afs directory on which the afs filespace will be mounted. 
+   if ( ! -d "/afs" ) {
+     print "debug: making the local /afs directory.\n" if $debug;
+     system("mkdir /afs");
+     system("chmod 0777 /afs");
+   }
+ }
+ 
+ #
+ # Force the client to stop. The sequence is:
+ #    umount /afs
+ #    /usr/vice/etc/afsd -shutdown
+ #    rmmod openafs (or rmmod libafs)
+ #
+ sub client_forcestop {
+   my $self = shift;
+   print "debug: client forcestop\n" if $self->{'debug'};
+ 
+   eval { 
+     run("umount /afs");
+     sleep 1;
+   };
+   eval { 
+     run("$path->{'afsddir'}/afsd -shutdown");
+   sleep 1;
+   };
+ 
+   # Remove openafs modules still loaded.
+   my $mods = $self->list_modules();
+   if ($mods->{'openafs'}) {
+      eval { run("/sbin/rmmod openafs") };
+   }
+   if ($mods->{'libafs'}) {
+      eval { run("/sbin/rmmod libafs") };
+   }
+ 
+   # Check.
+   $mods = $self->list_modules();
+   if ($mods->{'openafs'}) {
+      print "warning: kernel module still loaded: openafs\n";
+   }
+   if ($mods->{'libafs'}) {
+      print "warning: kernel module still loaded: libafs\n";
+   }
+ 
+   # remove stale lock set by init script.
+   run("rm -f /var/lock/subsys/afs");  
+ }
+ 
+ #
+ # list_modules() - Returns a table of loaded module names.
+ #
+ sub list_modules {
+   my $self = shift;
+   my $mods = {};
+   if (open(LSMOD, "/sbin/lsmod |")) {
+     while(<LSMOD>) {
+     chomp;
+     my ($mod) = split;
+     $mods->{$mod} = 1;
+   }
+     close LSMOD;
+   }
+   return $mods;
+ }
+ 
+ 1;
Index: openafs/src/tests/OpenAFS/config.pm
diff -c openafs/src/tests/OpenAFS/config.pm:1.1 openafs/src/tests/OpenAFS/config.pm:1.1.10.1
*** openafs/src/tests/OpenAFS/config.pm:1.1	Tue Jan 15 14:22:11 2002
--- openafs/src/tests/OpenAFS/config.pm	Mon Jan 21 14:50:32 2008
***************
*** 66,72 ****
  
  =cut
  
! $def_ConfDir = "$openafsdirpath->{'viceetcdir'}";
  #$def_ConfDir = "/usr/vice/etc";
  
  
--- 66,72 ----
  
  =cut
  
! $def_ConfDir = $OpenAFS::Dirpath::openafsdirpath->{'viceetcdir'};
  #$def_ConfDir = "/usr/vice/etc";
  
  
***************
*** 95,101 ****
  =cut
  
  @CmdPath = (split(/:/, $ENV{PATH}),
!             "$openafsdirpath->{'afssrvbindir'}",        # For servers
  	    '/usr/local/bin',      # Many sites put AFS in /usr/local
  	    '/usr/local/etc',
  	    '/usr/afsws/bin',      # For people who use Transarc's
--- 95,101 ----
  =cut
  
  @CmdPath = (split(/:/, $ENV{PATH}),
!             $OpenAFS::Dirpath::openafsdirpath->{'afssrvbindir'},        # For servers
  	    '/usr/local/bin',      # Many sites put AFS in /usr/local
  	    '/usr/local/etc',
  	    '/usr/afsws/bin',      # For people who use Transarc's
Index: openafs/src/tsm41/aix_aklog.c
diff -c openafs/src/tsm41/aix_aklog.c:1.1.4.2 openafs/src/tsm41/aix_aklog.c:1.1.4.6
*** openafs/src/tsm41/aix_aklog.c:1.1.4.2	Fri Jul 13 15:55:35 2007
--- openafs/src/tsm41/aix_aklog.c	Thu Jan  3 13:05:26 2008
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/tsm41/aix_aklog.c,v 1.1.4.2 2007/07/13 19:55:35 shadow Exp $");
  
  #if defined(AFS_AIX51_ENV)
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/tsm41/aix_aklog.c,v 1.1.4.6 2008/01/03 18:05:26 shadow Exp $");
  
  #if defined(AFS_AIX51_ENV)
  #include <sys/types.h>
***************
*** 23,30 ****
--- 23,32 ----
  #include <netdb.h>
  #include <sys/socket.h>
  #include <sys/file.h>
+ #include <sys/pag.h>
  #include <errno.h>
  #include <usersec.h>
+ #include <syslog.h>
  
  #include <krb5.h>
  
***************
*** 32,37 ****
--- 34,40 ----
  #include <afs/dirpath.h>
  #include <rx/rxkad.h>
  #include <afs/auth.h>
+ #include <afs/ptserver.h>
  #include "aix_auth_prototypes.h"
  
  struct afsconf_cell ak_cellconfig; /* General information about the cell */
***************
*** 64,70 ****
   * Other prototypes
   */
  
! static krb5_error_code get_credv5(krb5_context context, char *, char *,
  				  char *, krb5_creds **);
  static int get_user_realm(krb5_context, char *);
  
--- 67,73 ----
   * Other prototypes
   */
  
! static krb5_error_code get_credv5(krb5_context context, char *, char *, char *,
  				  char *, krb5_creds **);
  static int get_user_realm(krb5_context, char *);
  
***************
*** 107,118 ****
  char *afs_realm_of_cell(krb5_context context, struct afsconf_cell *cellconfig, int fallback)
  {
      static char krbrlm[REALM_SZ+1];
!         char **hrealms = 0;
!         krb5_error_code retval;
! 
      if (!cellconfig)
          return 0;
! 
      if (fallback) {
          char * p;
          p = strchr(cellconfig->hostName[0], '.');
--- 110,121 ----
  char *afs_realm_of_cell(krb5_context context, struct afsconf_cell *cellconfig, int fallback)
  {
      static char krbrlm[REALM_SZ+1];
!     char **hrealms = 0;
!     krb5_error_code retval;
!     
      if (!cellconfig)
          return 0;
!     
      if (fallback) {
          char * p;
          p = strchr(cellconfig->hostName[0], '.');
***************
*** 130,136 ****
              return 0; 
          if(!hrealms[0]) return 0;
          strcpy(krbrlm, hrealms[0]);
! 
          if (hrealms) krb5_free_host_realm(context, hrealms);
      }
      return krbrlm;
--- 133,139 ----
              return 0; 
          if(!hrealms[0]) return 0;
          strcpy(krbrlm, hrealms[0]);
! 	
          if (hrealms) krb5_free_host_realm(context, hrealms);
      }
      return krbrlm;
***************
*** 144,163 ****
      int code, unixauthneeded, password_expires = -1;
      int status;
      krb5_context context;
! 
      krb5_init_context(&context);
      *reenter = 0;
      *message = (char *)0;
! 
! #if 0
!     if ((pwd = getpwnam(userName)) == NULL) {
! 	*message = (char *)malloc(256);
! 	sprintf(*message, "getpwnam for user failed\n");
! 	return AUTH_FAILURE;
!     }
! #endif
! 
!     status = auth_to_cell(context, NULL, NULL);
      if (status) {
  	*message = (char *)malloc(1024);
  	sprintf(*message, "Unable to obtain AFS tokens: %s.\n",
--- 147,159 ----
      int code, unixauthneeded, password_expires = -1;
      int status;
      krb5_context context;
!     
      krb5_init_context(&context);
      *reenter = 0;
      *message = (char *)0;
!     
!     status = auth_to_cell(context, userName, NULL, NULL);
!     
      if (status) {
  	*message = (char *)malloc(1024);
  	sprintf(*message, "Unable to obtain AFS tokens: %s.\n",
***************
*** 188,194 ****
  		
  		fcell[strlen(fcell) - 1] = '\0';
  		
! 		auth_status = auth_to_cell(context, fcell, NULL);
  		if (status == AKLOG_SUCCESS)
  		    status = auth_status;
  		else
--- 184,190 ----
  		
  		fcell[strlen(fcell) - 1] = '\0';
  		
! 		auth_status = auth_to_cell(context, userName, fcell, NULL);
  		if (status == AKLOG_SUCCESS)
  		    status = auth_status;
  		else
***************
*** 199,241 ****
  #endif
      return AUTH_SUCCESS;
  }
! 	
! static krb5_error_code get_credv5(krb5_context context, 
! 			char *name, char *inst, char *realm,
! 			krb5_creds **creds)
  {
      krb5_creds increds;
      krb5_error_code r;
      static krb5_principal client_principal = 0;
! 
      memset((char *)&increds, 0, sizeof(increds));
      /* instance may be ptr to a null string. Pass null then */
      if ((r = krb5_build_principal(context, &increds.server,
!                      strlen(realm), realm,
!                      name,
!            (inst && strlen(inst)) ? inst : (void *) NULL,
!                      (void *) NULL))) {
          return r;
      }
! 
!     if (!_krb425_ccache) {
!         r = krb5_cc_default(context, &_krb425_ccache);
! 	if (r)
! 	    return r;
!     }
!     if (!client_principal) {
!         r = krb5_cc_get_principal(context, _krb425_ccache, &client_principal);
! 	if (r)
! 	    return r;
      }
! 
      increds.client = client_principal;
      increds.times.endtime = 0;
! 	/* Ask for DES since that is what V4 understands */
      get_creds_enctype((&increds)) = ENCTYPE_DES_CBC_CRC;
! 
      r = krb5_get_credentials(context, 0, _krb425_ccache, &increds, creds);
! 
      return r;
  }
  
--- 195,236 ----
  #endif
      return AUTH_SUCCESS;
  }
! 
! static krb5_error_code get_credv5(krb5_context context, char *user,  
! 				  char *name, char *inst, char *realm,
! 				  krb5_creds **creds)
  {
      krb5_creds increds;
      krb5_error_code r;
      static krb5_principal client_principal = 0;
!     char *str;
!     
      memset((char *)&increds, 0, sizeof(increds));
      /* instance may be ptr to a null string. Pass null then */
      if ((r = krb5_build_principal(context, &increds.server,
! 				  strlen(realm), realm,
! 				  name,
! 				  (inst && strlen(inst)) ? inst : (void *) NULL,
! 				  (void *) NULL))) {
          return r;
      }
!     r = krb5_cc_default(context, &_krb425_ccache);
!     if (r) {
!         syslog(LOG_AUTH|LOG_ERR, "LAM aklog: krb5_cc_default returns %d", r);
!         return r;
      }
!     r = krb5_cc_get_principal(context, _krb425_ccache, &client_principal); 
!     if (r) {
! 	syslog(LOG_AUTH|LOG_ERR, "LAM aklog: krb5_cc_get_principal returns %d", r);
! 	return r;
!     } 
      increds.client = client_principal;
      increds.times.endtime = 0;
!     /* Ask for DES since that is what V4 understands */
      get_creds_enctype((&increds)) = ENCTYPE_DES_CBC_CRC;
!     
      r = krb5_get_credentials(context, 0, _krb425_ccache, &increds, creds);
!     
      return r;
  }
  
***************
*** 244,260 ****
  {
      static krb5_principal client_principal = 0;
      int i;
! 
      if (!_krb425_ccache)
          krb5_cc_default(context, &_krb425_ccache);
      if (!client_principal)
          krb5_cc_get_principal(context, _krb425_ccache, &client_principal);
! 
      i = realm_len(context, client_principal);
      if (i > REALM_SZ-1) i = REALM_SZ-1;
      strncpy(realm,realm_data(context, client_principal), i);
      realm[i] = 0;
! 
      return 0;
  }
  
--- 239,255 ----
  {
      static krb5_principal client_principal = 0;
      int i;
!     
      if (!_krb425_ccache)
          krb5_cc_default(context, &_krb425_ccache);
      if (!client_principal)
          krb5_cc_get_principal(context, _krb425_ccache, &client_principal);
!     
      i = realm_len(context, client_principal);
      if (i > REALM_SZ-1) i = REALM_SZ-1;
      strncpy(realm,realm_data(context, client_principal), i);
      realm[i] = 0;
!     
      return 0;
  }
  
***************
*** 272,278 ****
  
  int
  aklog_passwdrestrictions(char *userName, char *newPasswd, char *oldPasswd,
! 		       char **message)
  {
      return AUTH_SUCCESS;
  }
--- 267,273 ----
  
  int
  aklog_passwdrestrictions(char *userName, char *newPasswd, char *oldPasswd,
! 			 char **message)
  {
      return AUTH_SUCCESS;
  }
***************
*** 289,318 ****
  {
      int status = 0;
      struct afsconf_dir *configdir;
! 
      memset(local_cell, 0, sizeof(local_cell));
      memset((char *)cellconfig, 0, sizeof(*cellconfig));
! 
      if (!(configdir = afsconf_Open(AFSDIR_CLIENT_ETC_DIRPATH))) {
  	return AFSCONF_NODB;
      }
! 
      if (afsconf_GetLocalCell(configdir, local_cell, MAXCELLCHARS)) {
  	return AFSCONF_FAILURE;
      }
! 
      if ((cell == NULL) || (cell[0] == 0))
  	cell = local_cell;
! 
! 	linkedcell[0] = '\0';
      if (afsconf_GetCellInfo(configdir, cell, NULL, cellconfig)) {
  	status = AFSCONF_NOTFOUND;
      }
      if (cellconfig->linkedCell) 
  	strncpy(linkedcell,cellconfig->linkedCell,MAXCELLCHARS);
! 
      (void) afsconf_Close(configdir);
! 
      return(status);
  }
  
--- 284,313 ----
  {
      int status = 0;
      struct afsconf_dir *configdir;
!     
      memset(local_cell, 0, sizeof(local_cell));
      memset((char *)cellconfig, 0, sizeof(*cellconfig));
!     
      if (!(configdir = afsconf_Open(AFSDIR_CLIENT_ETC_DIRPATH))) {
  	return AFSCONF_NODB;
      }
!     
      if (afsconf_GetLocalCell(configdir, local_cell, MAXCELLCHARS)) {
  	return AFSCONF_FAILURE;
      }
!     
      if ((cell == NULL) || (cell[0] == 0))
  	cell = local_cell;
!     
!     linkedcell[0] = '\0';
      if (afsconf_GetCellInfo(configdir, cell, NULL, cellconfig)) {
  	status = AFSCONF_NOTFOUND;
      }
      if (cellconfig->linkedCell) 
  	strncpy(linkedcell,cellconfig->linkedCell,MAXCELLCHARS);
!     
      (void) afsconf_Close(configdir);
!     
      return(status);
  }
  
***************
*** 321,332 ****
   * doing anything.  Otherwise, log to it and mark that it has been logged
   * to.
   */
! static int auth_to_cell(krb5_context context, char *cell, char *realm)
  {
      int status = 0;
      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 */
--- 316,327 ----
   * doing anything.  Otherwise, log to it and mark that it has been logged
   * to.
   */
! static int auth_to_cell(krb5_context context, char *user, char *cell, char *realm)
  {
      int status = 0;
      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 */
***************
*** 341,367 ****
      struct ktc_principal aserver;
      struct ktc_principal aclient;
      struct ktc_token atoken, btoken;
!     int afssetpag = 1;
! 
      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));
! 
      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,
! 			 local_cell, linkedcell)))
  	return(status);
! 
      strncpy(cell_to_use, ak_cellconfig.name, MAXCELLCHARS);
      cell_to_use[MAXCELLCHARS] = 0;
! 
      /*
       * Find out which realm we're supposed to authenticate to.  If one
       * is not included, use the kerberos realm found in the credentials
--- 336,365 ----
      struct ktc_principal aserver;
      struct ktc_principal aclient;
      struct ktc_token atoken, btoken;
!     int afssetpag = 0, uid = -1;
!     struct passwd *pwd;
!     
      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));
!     syslog(LOG_AUTH|LOG_DEBUG, "LAM aklog starting: user %s uid %d", user, getuid());
      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,
! 				 local_cell, linkedcell))) {
!         syslog(LOG_AUTH|LOG_ERR, "LAM aklog: get_cellconfig returns %d", status);
  	return(status);
!     }
!     
      strncpy(cell_to_use, ak_cellconfig.name, MAXCELLCHARS);
      cell_to_use[MAXCELLCHARS] = 0;
!     
      /*
       * Find out which realm we're supposed to authenticate to.  If one
       * is not included, use the kerberos realm found in the credentials
***************
*** 375,380 ****
--- 373,379 ----
  	char *afs_realm = afs_realm_of_cell(context, &ak_cellconfig, FALSE);
  	
  	if (!afs_realm) {
+             syslog(LOG_AUTH|LOG_ERR, "LAM aklog: afs_realm_of_cell returns %d", status);
  	    return AFSCONF_FAILURE;
  	}
  	
***************
*** 430,436 ****
       * 	afs@<realm>
       */
      
!     status = get_credv5(context, name, primary_instance, realm_of_cell,
  			&v5cred);
      
      if ((status == KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN || 
--- 429,435 ----
       * 	afs@<realm>
       */
      
!     status = get_credv5(context, user, name, primary_instance, realm_of_cell,
  			&v5cred);
      
      if ((status == KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN || 
***************
*** 438,443 ****
--- 437,443 ----
  	char *afs_realm = afs_realm_of_cell(context, &ak_cellconfig, TRUE);
  	
  	if (!afs_realm) {
+             syslog(LOG_AUTH|LOG_ERR, "LAM aklog: afs_realm_of_cell returns %d", status);
  	    return AFSCONF_FAILURE;
  	}
  	
***************
*** 448,465 ****
  	    secondary_instance[0] = '\0';
  	}
  	
! 	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)
! 	    status = get_credv5(context, name, secondary_instance,
  				realm_of_cell, &v5cred);
      }
      
      if (status) {
  	return status;
      }
      
--- 448,465 ----
  	    secondary_instance[0] = '\0';
  	}
  	
! 	status = get_credv5(context, user, name, primary_instance, 
! 			    realm_of_cell, &v5cred);
      }
      if (status == KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN || 
  	status == KRB5KRB_ERR_GENERIC) {
  	if (try_secondary)
! 	    status = get_credv5(context, user, name, secondary_instance,
  				realm_of_cell, &v5cred);
      }
      
      if (status) {
+         syslog(LOG_AUTH|LOG_ERR, "LAM aklog: get_credv5 returns %d", status);
  	return status;
      }
      
***************
*** 501,508 ****
  	atoken.ticketLen = v5cred->ticket.length;
  	memcpy(atoken.ticket, v5cred->ticket.data, atoken.ticketLen);
      }
! 	
      if ((status = get_user_realm(context, realm_of_user))) {
  	return KRB5_REALM_UNKNOWN;
      }
      if (strcmp(realm_of_user, realm_of_cell)) {
--- 501,509 ----
  	atoken.ticketLen = v5cred->ticket.length;
  	memcpy(atoken.ticket, v5cred->ticket.data, atoken.ticketLen);
      }
!     
      if ((status = get_user_realm(context, realm_of_user))) {
+         syslog(LOG_AUTH|LOG_ERR, "LAM aklog: get_user_realm returns %d", status);
  	return KRB5_REALM_UNKNOWN;
      }
      if (strcmp(realm_of_user, realm_of_cell)) {
***************
*** 511,520 ****
      }
      
      strcpy(lastcell, aserver.cell);
!     
!     if (!pr_Initialize (0, confname, aserver.cell))
! 	status = pr_SNameToId (username, &viceId);
!     
      /*
       * This is a crock, but it is Transarc's crock, so
       * we have to play along in order to get the
--- 512,518 ----
      }
      
      strcpy(lastcell, aserver.cell);
! 
      /*
       * This is a crock, but it is Transarc's crock, so
       * we have to play along in order to get the
***************
*** 524,530 ****
--- 522,552 ----
       * the code for tokens, this hack (AFS ID %d) will
       * not work if you change %d to something else.
       */
+ 
+ #if 0
+     /* This actually crashes long-running daemons */
+     if (!pr_Initialize (0, confname, aserver.cell))
+ 	status = pr_SNameToId (username, &viceId);
+     if ((status == 0) && (viceId != ANONYMOUSID))
+ 	sprintf (username, "AFS ID %d", (int) viceId);
+ #else
+     /* 
+      * This actually only works assuming that your uid and pts space match 
+      * and probably this works only for the local cell anyway.
+      */
+     
+     if ((uid = getuid()) == 0) {
+ 	if ((pwd = getpwnam(user)) == NULL) {
+ 	    syslog(LOG_AUTH|LOG_ERR, "LAM aklog: getpwnam %s failed", user);
+ 	    return AUTH_FAILURE;
+ 	}
+     }
      
+     /* Don't do first-time registration. Handle only the simple case */
+     if ((status == 0) && (viceId != ANONYMOUSID)) 
+  	sprintf (username, "AFS ID %d", ((uid==0)?(int)pwd->pw_uid:(int)uid));
+ #endif
+ 
      /* Reset the "aclient" structure before we call ktc_SetToken.
       * This structure was first set by the ktc_GetToken call when
       * we were comparing whether identical tokens already existed.
***************
*** 533,545 ****
      strcpy(aclient.instance, "");
      strncpy(aclient.cell, realm_of_user, MAXKTCREALMLEN - 1);
      
      /* 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 */
!     status = ktc_SetToken(&aserver, &atoken, &aclient, afssetpag);
! 
      return(status);
  }
  
--- 555,609 ----
      strcpy(aclient.instance, "");
      strncpy(aclient.cell, realm_of_user, MAXKTCREALMLEN - 1);
      
+ #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 this kills our parent. So we won't.
       */
      write(2,"",0); /* dummy write */
! #endif
!     afssetpag = (getpagvalue("afs") > 0) ? 1 : 0;
!     if (uid == 0) {
! 	struct sigaction newAction, origAction;
! 	pid_t cid, pcid;
! 	int wstatus;
! 	
! 	sigemptyset(&newAction.sa_mask);
! 	newAction.sa_handler = SIG_DFL;
! 	newAction.sa_flags = 0;
! 	status = sigaction(SIGCHLD, &newAction, &origAction);
! 	if (status) {
! 	    syslog(LOG_AUTH|LOG_ERR, "LAM aklog: sigaction returned %d", status);
! 	    return AUTH_FAILURE;
! 	}
! 	syslog(LOG_AUTH|LOG_DEBUG, "LAM aklog: in daemon? forking to set tokens");
! 	cid = fork();
! 	if (cid <= 0) {
! 	    syslog(LOG_AUTH|LOG_DEBUG, "LAM aklog child: setting tokens");
! 	    setuid(pwd->pw_uid);
! 	    status = ktc_SetToken(&aserver, &atoken, &aclient, afssetpag);
! 	    if (status != 0)
! 		syslog(LOG_AUTH|LOG_ERR, "LAM aklog child: set tokens, returning %d", status);
! 	    exit((status == 0)?0:255);
! 	} else {
! 	    do {
! 		pcid = waitpid(cid, &wstatus, 0);
! 	    } while ((pcid == -1) && (errno == EINTR));
! 	    if ((pcid == cid) && WIFEXITED(wstatus))
! 		status = WEXITSTATUS(wstatus);
! 	    else 
! 		status = -1;
! 	} 
! 	syslog(LOG_AUTH|LOG_DEBUG, "LAM aklog: collected child status %d", status);
! 	sigaction(SIGCHLD, &origAction, NULL);
!     } else {
! 	status = ktc_SetToken(&aserver, &atoken, &aclient, afssetpag);
!     }
!     if (status != 0)
! 	syslog(LOG_AUTH|LOG_ERR, "LAM aklog: set tokens returned %d", status);
!     else
! 	syslog(LOG_AUTH|LOG_DEBUG, "LAM aklog: set tokens, pag %d", getpagvalue("afs"));
      return(status);
  }
  
***************
*** 547,553 ****
  aklog_initialize(struct secmethod_table *meths)
  {
      memset(meths, 0, sizeof(struct secmethod_table));
! 
      /*
       * Initialize the exported interface routines.
       * Aside from method_authenticate, these are just no-ops.
--- 611,617 ----
  aklog_initialize(struct secmethod_table *meths)
  {
      memset(meths, 0, sizeof(struct secmethod_table));
!     syslog(LOG_AUTH|LOG_DEBUG, "LAM aklog loaded: uid %d pag %d", getuid(), getpagvalue("afs"));    
      /*
       * Initialize the exported interface routines.
       * Aside from method_authenticate, these are just no-ops.
***************
*** 557,563 ****
      meths->method_passwdexpired = aklog_passwdexpired;
      meths->method_passwdrestrictions = aklog_passwdrestrictions;
      meths->method_getpasswd = aklog_getpasswd;
! 
      return (0);
  }
  #endif /* AFS_AIX51_ENV */
--- 621,627 ----
      meths->method_passwdexpired = aklog_passwdexpired;
      meths->method_passwdrestrictions = aklog_passwdrestrictions;
      meths->method_getpasswd = aklog_getpasswd;
!     
      return (0);
  }
  #endif /* AFS_AIX51_ENV */
Index: openafs/src/ubik/Makefile.in
diff -c openafs/src/ubik/Makefile.in:1.11.2.1 openafs/src/ubik/Makefile.in:1.11.2.2
*** openafs/src/ubik/Makefile.in:1.11.2.1	Mon Oct 18 03:12:16 2004
--- openafs/src/ubik/Makefile.in	Thu Nov  1 12:06:01 2007
***************
*** 37,81 ****
  	${CC} ${CFLAGS} -o udebug udebug.o libubik.a $(LIBS)
  
  ubik_int.cs.c: ubik_int.xg
! 	${RXGEN} -x -C -o $@ ${srcdir}/ubik_int.xg
  
  ubik_int.ss.c: ubik_int.xg
! 	${RXGEN} -x -S -o $@ ${srcdir}/ubik_int.xg
  
  ubik_int.xdr.c: ubik_int.xg
! 	${RXGEN} -x -c -o $@ ${srcdir}/ubik_int.xg
  
  ubik_int.h: ubik_int.xg
! 	${RXGEN} -x -h -o $@ ${srcdir}/ubik_int.xg
  
  ubik_int.cs.c: ubik_int.h
  ubik_int.ss.c: ubik_int.h
  ubik_int.xdr.c: ubik_int.h
  
  Kubik_int.cs.c: ubik_int.xg Kubik_int.h
! 	${RXGEN} -x -k -C -o Kubik_int.cs.c ${srcdir}/ubik_int.xg
   
  Kubik_int.xdr.c: ubik_int.xg
! 	${RXGEN} -x -k -c -o Kubik_int.xdr.c ${srcdir}/ubik_int.xg
   
  Kubik_int.h: ubik_int.xg
! 	${RXGEN} -x -k -h -o Kubik_int.h ${srcdir}/ubik_int.xg
  
  utst_int.ss.o: utst_int.ss.c utst_int.xdr.c
  utst_int.cs.o: utst_int.cs.c utst_int.xdr.c
  utst_int.xdr.o: utst_int.xdr.c utst_int.h
  
  utst_int.cs.c: utst_int.xg
! 	${RXGEN} -C -o $@ ${srcdir}/utst_int.xg
  
  utst_int.ss.c: utst_int.xg
! 	${RXGEN} -S -o $@ ${srcdir}/utst_int.xg
  
  utst_int.xdr.c: utst_int.xg
! 	${RXGEN} -c -o $@ ${srcdir}/utst_int.xg
  
  utst_int.h: utst_int.xg
! 	${RXGEN} -h -o $@ ${srcdir}/utst_int.xg
  
  utst_int.cs.c: utst_int.h
  utst_int.ss.c: utst_int.h
--- 37,81 ----
  	${CC} ${CFLAGS} -o udebug udebug.o libubik.a $(LIBS)
  
  ubik_int.cs.c: ubik_int.xg
! 	${RXGEN} -x -A -C -o $@ ${srcdir}/ubik_int.xg
  
  ubik_int.ss.c: ubik_int.xg
! 	${RXGEN} -x -A -S -o $@ ${srcdir}/ubik_int.xg
  
  ubik_int.xdr.c: ubik_int.xg
! 	${RXGEN} -x -A -c -o $@ ${srcdir}/ubik_int.xg
  
  ubik_int.h: ubik_int.xg
! 	${RXGEN} -x -A -h -o $@ ${srcdir}/ubik_int.xg
  
  ubik_int.cs.c: ubik_int.h
  ubik_int.ss.c: ubik_int.h
  ubik_int.xdr.c: ubik_int.h
  
  Kubik_int.cs.c: ubik_int.xg Kubik_int.h
! 	${RXGEN} -x -k -A -C -o Kubik_int.cs.c ${srcdir}/ubik_int.xg
   
  Kubik_int.xdr.c: ubik_int.xg
! 	${RXGEN} -x -k -A -c -o Kubik_int.xdr.c ${srcdir}/ubik_int.xg
   
  Kubik_int.h: ubik_int.xg
! 	${RXGEN} -x -k -A -h -o Kubik_int.h ${srcdir}/ubik_int.xg
  
  utst_int.ss.o: utst_int.ss.c utst_int.xdr.c
  utst_int.cs.o: utst_int.cs.c utst_int.xdr.c
  utst_int.xdr.o: utst_int.xdr.c utst_int.h
  
  utst_int.cs.c: utst_int.xg
! 	${RXGEN} -A -C -o $@ ${srcdir}/utst_int.xg
  
  utst_int.ss.c: utst_int.xg
! 	${RXGEN} -A -S -o $@ ${srcdir}/utst_int.xg
  
  utst_int.xdr.c: utst_int.xg
! 	${RXGEN} -A -c -o $@ ${srcdir}/utst_int.xg
  
  utst_int.h: utst_int.xg
! 	${RXGEN} -A -h -o $@ ${srcdir}/utst_int.xg
  
  utst_int.cs.c: utst_int.h
  utst_int.ss.c: utst_int.h
Index: openafs/src/ubik/beacon.c
diff -c openafs/src/ubik/beacon.c:1.19.2.3 openafs/src/ubik/beacon.c:1.19.2.6
*** openafs/src/ubik/beacon.c:1.19.2.3	Mon Oct 18 13:44:03 2004
--- openafs/src/ubik/beacon.c	Mon Mar 10 18:35:36 2008
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ubik/beacon.c,v 1.19.2.3 2004/10/18 17:44:03 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ubik/beacon.c,v 1.19.2.6 2008/03/10 22:35:36 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
***************
*** 26,38 ****
  #endif
  #include <errno.h>
  #include <lock.h>
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <rx/xdr.h>
  #include <rx/rx.h>
  #include <rx/rx_multi.h>
--- 26,32 ----
***************
*** 83,88 ****
--- 77,83 ----
   */
  
  /* procedure called from debug rpc call to get this module's state for debugging */
+ void
  ubeacon_Debug(aparm)
       register struct ubik_debug *aparm;
  {
***************
*** 310,316 ****
   * we're sync site or we want to be the sync site.  It runs in its very own light-weight
   * process.
   */
! ubeacon_Interact()
  {
      register afs_int32 code;
      struct timeval tt;
--- 305,312 ----
   * we're sync site or we want to be the sync site.  It runs in its very own light-weight
   * process.
   */
! void *
! ubeacon_Interact(void *dummy)
  {
      register afs_int32 code;
      struct timeval tt;
Index: openafs/src/ubik/disk.c
diff -c openafs/src/ubik/disk.c:1.14 openafs/src/ubik/disk.c:1.14.2.1
*** openafs/src/ubik/disk.c:1.14	Sun Dec  7 20:45:31 2003
--- openafs/src/ubik/disk.c	Tue Oct 30 11:24:06 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ubik/disk.c,v 1.14 2003/12/08 01:45:31 jaltman Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ubik/disk.c,v 1.14.2.1 2007/10/30 15:24:06 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
***************
*** 21,33 ****
  #include <netinet/in.h>
  #endif
  #include <errno.h>
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <lock.h>
  #include <rx/xdr.h>
  
--- 21,27 ----
Index: openafs/src/ubik/phys.c
diff -c openafs/src/ubik/phys.c:1.8.2.1 openafs/src/ubik/phys.c:1.8.2.3
*** openafs/src/ubik/phys.c:1.8.2.1	Thu Mar  9 01:42:12 2006
--- openafs/src/ubik/phys.c	Mon Dec 10 17:46:07 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ubik/phys.c,v 1.8.2.1 2006/03/09 06:42:12 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ubik/phys.c,v 1.8.2.3 2007/12/10 22:46:07 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
***************
*** 26,38 ****
  #include <lwp.h>
  #include <lock.h>
  #include <errno.h>
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  
  #define	UBIK_INTERNALS 1
  #include "ubik.h"
--- 26,32 ----
***************
*** 84,98 ****
      }
  
      /* not found, open it and try to enter in cache */
!     strcpy(pbuffer, adbase->pathName);
!     strcat(pbuffer, ".DB");
!     if (afid < 0) {
! 	i = -afid;
! 	strcat(pbuffer, "SYS");
!     } else
! 	i = afid;
!     sprintf(temp, "%d", i);
!     strcat(pbuffer, temp);
      fd = open(pbuffer, O_CREAT | O_RDWR, 0600);
      if (fd < 0) {
  	/* try opening read-only */
--- 78,85 ----
      }
  
      /* not found, open it and try to enter in cache */
!     afs_snprintf(pbuffer, sizeof(pbuffer), "%s.DB%s%d", adbase->pathName, 
! 		 (afid<0)?"SYS":"", (afid<0)?-afid:afid);
      fd = open(pbuffer, O_CREAT | O_RDWR, 0600);
      if (fd < 0) {
  	/* try opening read-only */
Index: openafs/src/ubik/recovery.c
diff -c openafs/src/ubik/recovery.c:1.13 openafs/src/ubik/recovery.c:1.13.2.4
*** openafs/src/ubik/recovery.c:1.13	Sun Dec  7 21:41:22 2003
--- openafs/src/ubik/recovery.c	Mon Mar 10 18:35:36 2008
***************
*** 11,22 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ubik/recovery.c,v 1.13 2003/12/08 02:41:22 jaltman Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #include <time.h>
  #else
  #include <sys/file.h>
  #include <netinet/in.h>
--- 11,23 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ubik/recovery.c,v 1.13.2.4 2008/03/10 22:35:36 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #include <time.h>
+ #include <fcntl.h>
  #else
  #include <sys/file.h>
  #include <netinet/in.h>
***************
*** 24,36 ****
  #endif
  #include <assert.h>
  #include <lock.h>
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <rx/xdr.h>
  #include <rx/rx.h>
  #include <errno.h>
--- 25,31 ----
***************
*** 417,424 ****
   * requests.  However, the recovery module still has one more task:
   * propagating the dbase out to everyone who is up in the network.
   */
! int
! urecovery_Interact(void)
  {
      afs_int32 code, tcode;
      struct ubik_server *bestServer = NULL;
--- 412,419 ----
   * requests.  However, the recovery module still has one more task:
   * propagating the dbase out to everyone who is up in the network.
   */
! void *
! urecovery_Interact(void *dummy)
  {
      afs_int32 code, tcode;
      struct ubik_server *bestServer = NULL;
***************
*** 431,439 ****
      struct timeval tv;
      int length, tlen, offset, file, nbytes;
      struct rx_call *rxcall;
!     char tbuffer[256];
      struct ubik_stat ubikstat;
      struct in_addr inAddr;
  
      /* otherwise, begin interaction */
      urecovery_state = 0;
--- 426,439 ----
      struct timeval tv;
      int length, tlen, offset, file, nbytes;
      struct rx_call *rxcall;
!     char tbuffer[1024];
      struct ubik_stat ubikstat;
      struct in_addr inAddr;
+ #ifndef OLD_URECOVERY
+     char pbuffer[1028];
+     int flen, fd = -1;
+     afs_int32 epoch, pass;
+ #endif
  
      /* otherwise, begin interaction */
      urecovery_state = 0;
***************
*** 536,546 ****
  	    urecovery_state |= UBIK_RECHAVEDB;
  	} else {
  	    /* we don't have the best version; we should fetch it. */
- #if defined(UBIK_PAUSE)
  	    DBHOLD(ubik_dbase);
- #else
- 	    ObtainWriteLock(&ubik_dbase->versionLock);
- #endif /* UBIK_PAUSE */
  	    urecovery_AbortAll(ubik_dbase);
  
  	    /* Rx code to do the Bulk fetch */
--- 536,542 ----
***************
*** 564,603 ****
  		goto FetchEndCall;
  	    }
  
! 	    /* Truncate the file firest */
  	    code = (*ubik_dbase->truncate) (ubik_dbase, file, 0);
  	    if (code) {
  		ubik_dprint("truncate io error=%d\n", code);
  		goto FetchEndCall;
  	    }
! 
  	    /* give invalid label during file transit */
  	    tversion.epoch = 0;
- 	    tversion.counter = 0;
  	    code = (*ubik_dbase->setlabel) (ubik_dbase, file, &tversion);
  	    if (code) {
  		ubik_dprint("setlabel io error=%d\n", code);
  		goto FetchEndCall;
  	    }
  
  	    while (length > 0) {
  		tlen = (length > sizeof(tbuffer) ? sizeof(tbuffer) : length);
  		nbytes = rx_Read(rxcall, tbuffer, tlen);
  		if (nbytes != tlen) {
  		    ubik_dprint("Rx-read bulk error=%d\n", code = BULK_ERROR);
  		    code = EIO;
  		    goto FetchEndCall;
  		}
  		nbytes =
  		    (*ubik_dbase->write) (ubik_dbase, file, tbuffer, offset,
  					  tlen);
  		if (nbytes != tlen) {
  		    code = UIOERROR;
  		    goto FetchEndCall;
  		}
  		offset += tlen;
  		length -= tlen;
  	    }
  	    code = EndDISK_GetFile(rxcall, &tversion);
  	  FetchEndCall:
  	    tcode = rx_EndCall(rxcall, code);
--- 560,630 ----
  		goto FetchEndCall;
  	    }
  
! #ifdef OLD_URECOVERY
! 	    /* Truncate the file first */
  	    code = (*ubik_dbase->truncate) (ubik_dbase, file, 0);
  	    if (code) {
  		ubik_dprint("truncate io error=%d\n", code);
  		goto FetchEndCall;
  	    }
! 	    tversion.counter = 0;
! #endif
  	    /* give invalid label during file transit */
  	    tversion.epoch = 0;
  	    code = (*ubik_dbase->setlabel) (ubik_dbase, file, &tversion);
  	    if (code) {
  		ubik_dprint("setlabel io error=%d\n", code);
  		goto FetchEndCall;
  	    }
+ #ifndef OLD_URECOVERY
+ 	    flen = length;
+ 	    afs_snprintf(pbuffer, sizeof(pbuffer), "%s.DB0.TMP", ubik_dbase->pathName);
+ 	    fd = open(pbuffer, O_CREAT | O_RDWR | O_TRUNC, 0600);
+ 	    if (fd < 0) {
+ 		code = errno;
+ 		goto FetchEndCall;
+ 	    }
+ 	    code = lseek(fd, HDRSIZE, 0);
+ 	    if (code != HDRSIZE) {
+ 		close(fd);
+ 		goto FetchEndCall;
+ 	    }
+ #endif
  
  	    while (length > 0) {
  		tlen = (length > sizeof(tbuffer) ? sizeof(tbuffer) : length);
+ #ifndef AFS_PTHREAD_ENV
+ 		if (pass % 4 == 0)
+ 		    IOMGR_Poll();
+ #endif
  		nbytes = rx_Read(rxcall, tbuffer, tlen);
  		if (nbytes != tlen) {
  		    ubik_dprint("Rx-read bulk error=%d\n", code = BULK_ERROR);
  		    code = EIO;
+ 		    close(fd);
  		    goto FetchEndCall;
  		}
+ #ifdef OLD_URECOVERY
  		nbytes =
  		    (*ubik_dbase->write) (ubik_dbase, file, tbuffer, offset,
  					  tlen);
+ #else
+ 		nbytes = write(fd, tbuffer, tlen);
+ 		pass++;
+ #endif
  		if (nbytes != tlen) {
  		    code = UIOERROR;
+ 		    close(fd);
  		    goto FetchEndCall;
  		}
  		offset += tlen;
  		length -= tlen;
  	    }
+ #ifndef OLD_URECOVERY
+ 	    code = close(fd);
+ 	    if (code)
+ 		goto FetchEndCall;
+ #endif	    
  	    code = EndDISK_GetFile(rxcall, &tversion);
  	  FetchEndCall:
  	    tcode = rx_EndCall(rxcall, code);
***************
*** 608,634 ****
  		urecovery_state |= UBIK_RECHAVEDB;
  		memcpy(&ubik_dbase->version, &tversion,
  		       sizeof(struct ubik_version));
  		(*ubik_dbase->sync) (ubik_dbase, 0);	/* get data out first */
  		/* after data is good, sync disk with correct label */
  		code =
  		    (*ubik_dbase->setlabel) (ubik_dbase, 0,
  					     &ubik_dbase->version);
  	    }
  	    if (code) {
  		ubik_dbase->version.epoch = 0;
  		ubik_dbase->version.counter = 0;
  		ubik_print("Ubik: Synchronize database failed (error = %d)\n",
  			   code);
  	    } else {
  		ubik_print("Ubik: Synchronize database completed\n");
  	    }
  	    udisk_Invalidate(ubik_dbase, 0);	/* data has changed */
  	    LWP_NoYieldSignal(&ubik_dbase->version);
- #if defined(UBIK_PAUSE)
  	    DBRELE(ubik_dbase);
- #else
- 	    ReleaseWriteLock(&ubik_dbase->versionLock);
- #endif /* UBIK_PAUSE */
  	}
  #if defined(UBIK_PAUSE)
  	if (!(urecovery_state & UBIK_RECSYNCSITE))
--- 635,685 ----
  		urecovery_state |= UBIK_RECHAVEDB;
  		memcpy(&ubik_dbase->version, &tversion,
  		       sizeof(struct ubik_version));
+ #ifdef OLD_URECOVERY
  		(*ubik_dbase->sync) (ubik_dbase, 0);	/* get data out first */
+ #else
+ 		afs_snprintf(tbuffer, sizeof(tbuffer), "%s.DB0", ubik_dbase->pathName);
+ #ifdef AFS_NT40_ENV
+ 		afs_snprintf(pbuffer, sizeof(pbuffer), "%s.DB0.OLD", ubik_dbase->pathName);
+ 		code = unlink(pbuffer);
+ 		if (!code)
+ 		    code = rename(tbuffer, pbuffer);
+ 		afs_snprintf(pbuffer, sizeof(pbuffer), "%s.DB0.TMP", ubik_dbase->pathName);
+ #endif
+ 		if (!code) 
+ 		    code = rename(pbuffer, tbuffer);
+ 		if (!code)
+ #endif
  		/* after data is good, sync disk with correct label */
  		code =
  		    (*ubik_dbase->setlabel) (ubik_dbase, 0,
  					     &ubik_dbase->version);
+ #ifndef OLD_URECOVERY
+ #ifdef AFS_NT40_ENV
+ 		afs_snprintf(pbuffer, sizeof(pbuffer), "%s.DB0.OLD", ubik_dbase->pathName);
+ 		unlink(pbuffer);
+ #endif
+ #endif
  	    }
  	    if (code) {
+ #ifndef OLD_URECOVERY
+ 		unlink(pbuffer);
+ 		/* 
+ 		 * We will effectively invalidate the old data forever now.
+ 		 * Unclear if we *should* but we do.
+ 		 */
+ #endif
  		ubik_dbase->version.epoch = 0;
  		ubik_dbase->version.counter = 0;
  		ubik_print("Ubik: Synchronize database failed (error = %d)\n",
  			   code);
  	    } else {
  		ubik_print("Ubik: Synchronize database completed\n");
+ 		urecovery_state |= UBIK_RECHAVEDB;
  	    }
  	    udisk_Invalidate(ubik_dbase, 0);	/* data has changed */
  	    LWP_NoYieldSignal(&ubik_dbase->version);
  	    DBRELE(ubik_dbase);
  	}
  #if defined(UBIK_PAUSE)
  	if (!(urecovery_state & UBIK_RECSYNCSITE))
***************
*** 643,653 ****
  	 * database and overwrite this one.
  	 */
  	if (ubik_dbase->version.epoch == 1) {
- #if defined(UBIK_PAUSE)
  	    DBHOLD(ubik_dbase);
- #else
- 	    ObtainWriteLock(&ubik_dbase->versionLock);
- #endif /* UBIK_PAUSE */
  	    urecovery_AbortAll(ubik_dbase);
  	    ubik_epochTime = 2;
  	    ubik_dbase->version.epoch = ubik_epochTime;
--- 694,700 ----
***************
*** 656,666 ****
  		(*ubik_dbase->setlabel) (ubik_dbase, 0, &ubik_dbase->version);
  	    udisk_Invalidate(ubik_dbase, 0);	/* data may have changed */
  	    LWP_NoYieldSignal(&ubik_dbase->version);
- #if defined(UBIK_PAUSE)
  	    DBRELE(ubik_dbase);
- #else
- 	    ReleaseWriteLock(&ubik_dbase->versionLock);
- #endif /* UBIK_PAUSE */
  	}
  
  	/* Check the other sites and send the database to them if they
--- 703,709 ----
***************
*** 670,680 ****
  	    /* now propagate out new version to everyone else */
  	    dbok = 1;		/* start off assuming they all worked */
  
- #if defined(UBIK_PAUSE)
  	    DBHOLD(ubik_dbase);
- #else
- 	    ObtainWriteLock(&ubik_dbase->versionLock);
- #endif /* UBIK_PAUSE */
  	    /*
  	     * Check if a write transaction is in progress. We can't send the
  	     * db when a write is in progress here because the db would be
--- 713,719 ----
***************
*** 690,709 ****
  		tv.tv_sec = 0;
  		tv.tv_usec = 50000;
  		while ((ubik_dbase->flags & DBWRITING) && (safety < 500)) {
- #if defined(UBIK_PAUSE)
  		    DBRELE(ubik_dbase);
- #else
- 		    ReleaseWriteLock(&ubik_dbase->versionLock);
- #endif /* UBIK_PAUSE */
  		    /* sleep for a little while */
  		    IOMGR_Select(0, 0, 0, 0, &tv);
  		    tv.tv_usec += 10000;
  		    safety++;
- #if defined(UBIK_PAUSE)
  		    DBHOLD(ubik_dbase);
- #else
- 		    ObtainWriteLock(&ubik_dbase->versionLock);
- #endif /* UBIK_PAUSE */
  		}
  	    }
  
--- 729,740 ----
***************
*** 770,780 ****
  		    ts->currentDB = 1;
  		}
  	    }
- #if defined(UBIK_PAUSE)
  	    DBRELE(ubik_dbase);
- #else
- 	    ReleaseWriteLock(&ubik_dbase->versionLock);
- #endif /* UBIK_PAUSE */
  	    if (dbok)
  		urecovery_state |= UBIK_RECSENTDB;
  	}
--- 801,807 ----
Index: openafs/src/ubik/remote.c
diff -c openafs/src/ubik/remote.c:1.12.2.3 openafs/src/ubik/remote.c:1.12.2.6
*** openafs/src/ubik/remote.c:1.12.2.3	Fri Dec 15 11:38:22 2006
--- openafs/src/ubik/remote.c	Wed Feb 20 15:10:39 2008
***************
*** 11,35 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ubik/remote.c,v 1.12.2.3 2006/12/15 16:38:22 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #else
  #include <sys/file.h>
  #include <netinet/in.h>
  #endif
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <lock.h>
  #include <rx/xdr.h>
  #include <rx/rx.h>
  #include <afs/afsutil.h>
  
  #define UBIK_INTERNALS
--- 11,31 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ubik/remote.c,v 1.12.2.6 2008/02/20 20:10:39 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
+ #include <fcntl.h>
  #else
  #include <sys/file.h>
  #include <netinet/in.h>
  #endif
  #include <string.h>
  #include <lock.h>
  #include <rx/xdr.h>
  #include <rx/rx.h>
+ #include <errno.h>
  #include <afs/afsutil.h>
  
  #define UBIK_INTERNALS
***************
*** 494,506 ****
  {
      register afs_int32 code;
      register struct ubik_dbase *dbase;
!     char tbuffer[256];
      afs_int32 offset;
      struct ubik_version tversion;
      register int tlen;
      struct rx_peer *tpeer;
      struct rx_connection *tconn;
      afs_uint32 otherHost;
  
      /* send the file back to the requester */
  
--- 490,507 ----
  {
      register afs_int32 code;
      register struct ubik_dbase *dbase;
!     char tbuffer[1024];
      afs_int32 offset;
      struct ubik_version tversion;
      register int tlen;
      struct rx_peer *tpeer;
      struct rx_connection *tconn;
      afs_uint32 otherHost;
+ #ifndef OLD_URECOVERY
+     char pbuffer[1028];
+     int flen, fd = -1;
+     afs_int32 epoch, pass;
+ #endif
  
      /* send the file back to the requester */
  
***************
*** 538,578 ****
  	       afs_inet_ntoa(otherHost));
  
      offset = 0;
      (*dbase->truncate) (dbase, file, 0);	/* truncate first */
-     tversion.epoch = 0;		/* start off by labelling in-transit db as invalid */
      tversion.counter = 0;
      (*dbase->setlabel) (dbase, file, &tversion);	/* setlabel does sync */
      memcpy(&ubik_dbase->version, &tversion, sizeof(struct ubik_version));
      while (length > 0) {
  	tlen = (length > sizeof(tbuffer) ? sizeof(tbuffer) : length);
  	code = rx_Read(rxcall, tbuffer, tlen);
  	if (code != tlen) {
  	    DBRELE(dbase);
  	    ubik_dprint("Rx-read length error=%d\n", code);
  	    code = BULK_ERROR;
  	    goto failed;
  	}
  	code = (*dbase->write) (dbase, file, tbuffer, offset, tlen);
  	if (code != tlen) {
  	    DBRELE(dbase);
  	    ubik_dprint("write failed error=%d\n", code);
  	    code = UIOERROR;
  	    goto failed;
  	}
  	offset += tlen;
  	length -= tlen;
      }
  
      /* sync data first, then write label and resync (resync done by setlabel call).
       * This way, good label is only on good database. */
      (*ubik_dbase->sync) (dbase, file);
      code = (*ubik_dbase->setlabel) (dbase, file, avers);
      memcpy(&ubik_dbase->version, avers, sizeof(struct ubik_version));
      udisk_Invalidate(dbase, file);	/* new dbase, flush disk buffers */
      LWP_NoYieldSignal(&dbase->version);
      DBRELE(dbase);
    failed:
      if (code) {
  	ubik_print
  	    ("Ubik: Synchronize database with server %s failed (error = %d)\n",
  	     afs_inet_ntoa(otherHost), code);
--- 539,641 ----
  	       afs_inet_ntoa(otherHost));
  
      offset = 0;
+ #ifdef OLD_URECOVERY
      (*dbase->truncate) (dbase, file, 0);	/* truncate first */
      tversion.counter = 0;
+ #else
+     epoch =
+ #endif
+     tversion.epoch = 0;		/* start off by labelling in-transit db as invalid */
      (*dbase->setlabel) (dbase, file, &tversion);	/* setlabel does sync */
+ #ifndef OLD_URECOVERY
+     flen = length;
+     afs_snprintf(pbuffer, sizeof(pbuffer), "%s.DB0.TMP", ubik_dbase->pathName);
+     fd = open(pbuffer, O_CREAT | O_RDWR | O_TRUNC, 0600);
+     if (fd < 0) {
+ 	code = errno;
+ 	goto failed;
+     }
+     code = lseek(fd, HDRSIZE, 0);
+     if (code != HDRSIZE) {
+ 	close(fd);
+ 	goto failed;
+     }
+ #else
+     pass = 0;
+ #endif
      memcpy(&ubik_dbase->version, &tversion, sizeof(struct ubik_version));
      while (length > 0) {
  	tlen = (length > sizeof(tbuffer) ? sizeof(tbuffer) : length);
+ #if !defined(OLD_URECOVERY) && defined(AFS_PTHREAD_ENV)
+ 	if (pass % 4 == 0)
+ 	    IOMGR_Poll();
+ #endif
  	code = rx_Read(rxcall, tbuffer, tlen);
  	if (code != tlen) {
  	    DBRELE(dbase);
  	    ubik_dprint("Rx-read length error=%d\n", code);
  	    code = BULK_ERROR;
+ 	    close(fd);
  	    goto failed;
  	}
+ #ifdef OLD_URECOVERY
  	code = (*dbase->write) (dbase, file, tbuffer, offset, tlen);
+ #else
+ 	code = write(fd, tbuffer, tlen);
+ 	pass++;
+ #endif
  	if (code != tlen) {
  	    DBRELE(dbase);
  	    ubik_dprint("write failed error=%d\n", code);
  	    code = UIOERROR;
+ 	    close(fd);
  	    goto failed;
  	}
  	offset += tlen;
  	length -= tlen;
      }
+ #ifndef OLD_URECOVERY
+     code = close(fd);
+     if (code)
+ 	goto failed;
+ #endif     
  
      /* sync data first, then write label and resync (resync done by setlabel call).
       * This way, good label is only on good database. */
+ #ifdef OLD_URECOVERY
      (*ubik_dbase->sync) (dbase, file);
+ #else
+     afs_snprintf(tbuffer, sizeof(tbuffer), "%s.DB0", ubik_dbase->pathName);
+ #ifdef AFS_NT40_ENV
+     afs_snprintf(pbuffer, sizeof(pbuffer), "%s.DB0.OLD", ubik_dbase->pathName);
+     code = unlink(pbuffer);
+     if (!code)
+ 	code = rename(tbuffer, pbuffer);
+     afs_snprintf(pbuffer, sizeof(pbuffer), "%s.DB0.TMP", ubik_dbase->pathName);
+ #endif
+     if (!code) 
+ 	code = rename(pbuffer, tbuffer);
+     if (!code)
+ #endif
      code = (*ubik_dbase->setlabel) (dbase, file, avers);
+ #ifndef OLD_URECOVERY
+ #ifdef AFS_NT40_ENV
+     afs_snprintf(pbuffer, sizeof(pbuffer), "%s.DB0.OLD", ubik_dbase->pathName);
+     unlink(pbuffer);
+ #endif
+ #endif
      memcpy(&ubik_dbase->version, avers, sizeof(struct ubik_version));
      udisk_Invalidate(dbase, file);	/* new dbase, flush disk buffers */
      LWP_NoYieldSignal(&dbase->version);
      DBRELE(dbase);
    failed:
      if (code) {
+ #ifndef OLD_URECOVERY
+ 	unlink(pbuffer);
+ 	/* Failed to sync. Allow reads again for now. */
+ 	tversion.epoch = epoch;
+ 	(*dbase->setlabel) (dbase, file, &tversion);
+ #endif
  	ubik_print
  	    ("Ubik: Synchronize database with server %s failed (error = %d)\n",
  	     afs_inet_ntoa(otherHost), code);
Index: openafs/src/ubik/ubik.c
diff -c openafs/src/ubik/ubik.c:1.15.2.1 openafs/src/ubik/ubik.c:1.15.2.3
*** openafs/src/ubik/ubik.c:1.15.2.1	Mon Jun 12 17:53:44 2006
--- openafs/src/ubik/ubik.c	Mon Mar 10 18:35:36 2008
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ubik/ubik.c,v 1.15.2.1 2006/06/12 21:53:44 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ubik/ubik.c,v 1.15.2.3 2008/03/10 22:35:36 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
***************
*** 23,35 ****
  #endif
  #include <time.h>
  #include <lock.h>
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <rx/xdr.h>
  #include <rx/rx.h>
  #include <afs/cellconfig.h>
--- 23,29 ----
***************
*** 199,205 ****
  
      struct rx_service *tservice;
      extern int VOTE_ExecuteRequest(), DISK_ExecuteRequest();
-     extern void rx_ServerProc();
      extern int rx_stackSize;
  
      initialize_U_error_table();
--- 193,198 ----
Index: openafs/src/ubik/ubik.p.h
diff -c openafs/src/ubik/ubik.p.h:1.11.2.5 openafs/src/ubik/ubik.p.h:1.11.2.6
*** openafs/src/ubik/ubik.p.h:1.11.2.5	Mon Jul 31 13:07:51 2006
--- openafs/src/ubik/ubik.p.h	Mon Mar 10 18:35:36 2008
***************
*** 313,323 ****
  extern int urecovery_AbortAll(struct ubik_dbase *adbase);
  extern int urecovery_CheckTid(register struct ubik_tid *atid);
  extern int urecovery_Initialize(register struct ubik_dbase *adbase);
! extern int urecovery_Interact(void);
  extern int DoProbe(struct ubik_server *server);
  
  
! extern int ubeacon_Interact();
  extern int sdisk_Interact();
  extern int uvote_Interact();
  extern int DISK_Abort();
--- 313,323 ----
  extern int urecovery_AbortAll(struct ubik_dbase *adbase);
  extern int urecovery_CheckTid(register struct ubik_tid *atid);
  extern int urecovery_Initialize(register struct ubik_dbase *adbase);
! extern void *urecovery_Interact(void *);
  extern int DoProbe(struct ubik_server *server);
  
  
! extern void *ubeacon_Interact(void *);
  extern int sdisk_Interact();
  extern int uvote_Interact();
  extern int DISK_Abort();
Index: openafs/src/ubik/ubikcmd.c
diff -c openafs/src/ubik/ubikcmd.c:1.7 openafs/src/ubik/ubikcmd.c:1.7.2.1
*** openafs/src/ubik/ubikcmd.c:1.7	Tue Jul 15 19:17:05 2003
--- openafs/src/ubik/ubikcmd.c	Tue Oct 30 11:24:06 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ubik/ubikcmd.c,v 1.7 2003/07/15 23:17:05 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ubik/ubikcmd.c,v 1.7.2.1 2007/10/30 15:24:06 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
***************
*** 24,36 ****
  #endif
  #include <time.h>
  #include <lock.h>
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <rx/xdr.h>
  #include <rx/rx.h>
  
--- 24,30 ----
Index: openafs/src/ubik/udebug.c
diff -c openafs/src/ubik/udebug.c:1.16.2.2 openafs/src/ubik/udebug.c:1.16.2.4
*** openafs/src/ubik/udebug.c:1.16.2.2	Tue Jun 21 18:20:52 2005
--- openafs/src/ubik/udebug.c	Wed Oct 31 00:13:49 2007
***************
*** 11,27 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ubik/udebug.c,v 1.16.2.2 2005/06/21 22:20:52 shadow Exp $");
  
  #include <sys/types.h>
  #include <stdlib.h>
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #else
--- 11,21 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ubik/udebug.c,v 1.16.2.4 2007/10/31 04:13:49 shadow Exp $");
  
  #include <sys/types.h>
  #include <stdlib.h>
  #include <string.h>
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #else
***************
*** 90,96 ****
  }
  
  static int
! CommandProc(struct cmd_syndesc *as, char *arock)
  {
      char *hostName, *portName, *times;
      afs_int32 hostAddr;
--- 84,90 ----
  }
  
  static int
! CommandProc(struct cmd_syndesc *as, void *arock)
  {
      char *hostName, *portName, *times;
      afs_int32 hostAddr;
***************
*** 355,361 ****
      nsa.sa_flags = SA_FULLDUMP;
      sigaction(SIGSEGV, &nsa, NULL);
  #endif
!     ts = cmd_CreateSyntax(NULL, CommandProc, 0, "probe ubik server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server machine");
      cmd_AddParm(ts, "-port", CMD_SINGLE, CMD_OPTIONAL, "IP port");
      cmd_AddParm(ts, "-long", CMD_FLAG, CMD_OPTIONAL, "print all info");
--- 349,355 ----
      nsa.sa_flags = SA_FULLDUMP;
      sigaction(SIGSEGV, &nsa, NULL);
  #endif
!     ts = cmd_CreateSyntax(NULL, CommandProc, NULL, "probe ubik server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server machine");
      cmd_AddParm(ts, "-port", CMD_SINGLE, CMD_OPTIONAL, "IP port");
      cmd_AddParm(ts, "-long", CMD_FLAG, CMD_OPTIONAL, "print all info");
Index: openafs/src/ubik/uinit.c
diff -c openafs/src/ubik/uinit.c:1.6.2.3 openafs/src/ubik/uinit.c:1.6.2.4
*** openafs/src/ubik/uinit.c:1.6.2.3	Fri Sep 15 19:19:28 2006
--- openafs/src/ubik/uinit.c	Tue Oct 30 11:24:06 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ubik/uinit.c,v 1.6.2.3 2006/09/15 23:19:28 jaltman Exp $");
  
  #include <afs/stds.h>
  #ifdef AFS_NT40_ENV
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ubik/uinit.c,v 1.6.2.4 2007/10/30 15:24:06 shadow Exp $");
  
  #include <afs/stds.h>
  #ifdef AFS_NT40_ENV
***************
*** 28,40 ****
  #include <sys/statfs.h>
  #endif
  
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  
  #include <afs/dirpath.h>
  #include <errno.h>
--- 28,34 ----
Index: openafs/src/ubik/utst_client.c
diff -c openafs/src/ubik/utst_client.c:1.7 openafs/src/ubik/utst_client.c:1.7.2.1
*** openafs/src/ubik/utst_client.c:1.7	Tue Jul 15 19:17:06 2003
--- openafs/src/ubik/utst_client.c	Tue Oct 30 11:24:06 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ubik/utst_client.c,v 1.7 2003/07/15 23:17:06 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ubik/utst_client.c,v 1.7.2.1 2007/10/30 15:24:06 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
***************
*** 24,36 ****
  #endif
  #include <time.h>
  #include <stdio.h>
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <rx/xdr.h>
  #include <rx/rx.h>
  #include <lock.h>
--- 24,30 ----
Index: openafs/src/ubik/utst_server.c
diff -c openafs/src/ubik/utst_server.c:1.8 openafs/src/ubik/utst_server.c:1.8.2.1
*** openafs/src/ubik/utst_server.c:1.8	Tue Jul 15 19:17:06 2003
--- openafs/src/ubik/utst_server.c	Tue Oct 30 11:24:06 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ubik/utst_server.c,v 1.8 2003/07/15 23:17:06 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ubik/utst_server.c,v 1.8.2.1 2007/10/30 15:24:06 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 25,37 ****
  #endif
  #include <time.h>
  #include <stdio.h>
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <rx/xdr.h>
  #include <rx/rx.h>
  #include <lock.h>
--- 25,31 ----
Index: openafs/src/ubik/vote.c
diff -c openafs/src/ubik/vote.c:1.14 openafs/src/ubik/vote.c:1.14.2.1
*** openafs/src/ubik/vote.c:1.14	Sun Dec  7 20:45:31 2003
--- openafs/src/ubik/vote.c	Tue Oct 30 11:24:06 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ubik/vote.c,v 1.14 2003/12/08 01:45:31 jaltman Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ubik/vote.c,v 1.14.2.1 2007/10/30 15:24:06 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
***************
*** 22,34 ****
  #endif
  #include <afs/afsutil.h>
  #include <lock.h>
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <rx/xdr.h>
  #include <rx/rx.h>
  #include <afs/afsutil.h>
--- 22,28 ----
Index: openafs/src/update/Makefile.in
diff -c openafs/src/update/Makefile.in:1.8.2.1 openafs/src/update/Makefile.in:1.8.2.2
*** openafs/src/update/Makefile.in:1.8.2.1	Mon Jul 31 13:07:51 2006
--- openafs/src/update/Makefile.in	Thu Nov  1 12:06:01 2007
***************
*** 33,48 ****
  client.o server.o: update.h global.h AFS_component_version_number.c
  
  update.cs.c: update.xg
! 	${RXGEN} -u -C -o $@ ${srcdir}/update.xg
  
  update.ss.c: update.xg
! 	${RXGEN} -S -o $@ ${srcdir}/update.xg
  
  update.xdr.c: update.xg
! 	${RXGEN} -c -o $@ ${srcdir}/update.xg
  
  update.h: update.xg
! 	${RXGEN} -u -h -o $@ ${srcdir}/update.xg
  
  update.cs.c: update.h
  upcate.ss.c: update.h
--- 33,48 ----
  client.o server.o: update.h global.h AFS_component_version_number.c
  
  update.cs.c: update.xg
! 	${RXGEN} -A -u -C -o $@ ${srcdir}/update.xg
  
  update.ss.c: update.xg
! 	${RXGEN} -A -S -o $@ ${srcdir}/update.xg
  
  update.xdr.c: update.xg
! 	${RXGEN} -A -c -o $@ ${srcdir}/update.xg
  
  update.h: update.xg
! 	${RXGEN} -A -u -h -o $@ ${srcdir}/update.xg
  
  update.cs.c: update.h
  upcate.ss.c: update.h
Index: openafs/src/update/client.c
diff -c openafs/src/update/client.c:1.12.2.1 openafs/src/update/client.c:1.12.2.2
*** openafs/src/update/client.c:1.12.2.1	Tue Apr 10 14:43:46 2007
--- openafs/src/update/client.c	Tue Oct 30 11:24:08 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/update/client.c,v 1.12.2.1 2007/04/10 18:43:46 shadow Exp $");
  
  #include <afs/stds.h>
  #ifdef	AFS_AIX32_ENV
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/update/client.c,v 1.12.2.2 2007/10/30 15:24:08 shadow Exp $");
  
  #include <afs/stds.h>
  #ifdef	AFS_AIX32_ENV
***************
*** 36,48 ****
  #include <sys/time.h>
  #include <dirent.h>
  #endif
- #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
--- 36,42 ----
Index: openafs/src/update/server.c
diff -c openafs/src/update/server.c:1.13.2.3 openafs/src/update/server.c:1.13.2.4
*** openafs/src/update/server.c:1.13.2.3	Tue Apr 10 14:43:46 2007
--- openafs/src/update/server.c	Tue Oct 30 11:24:08 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/update/server.c,v 1.13.2.3 2007/04/10 18:43:46 shadow Exp $");
  
  #include <afs/stds.h>
  #ifdef	AFS_AIX32_ENV
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/update/server.c,v 1.13.2.4 2007/10/30 15:24:08 shadow Exp $");
  
  #include <afs/stds.h>
  #ifdef	AFS_AIX32_ENV
***************
*** 31,43 ****
  #include <sys/file.h>
  #include <dirent.h>
  #endif
- #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
--- 31,37 ----
Index: openafs/src/update/utils.c
diff -c openafs/src/update/utils.c:1.10 openafs/src/update/utils.c:1.10.2.1
*** openafs/src/update/utils.c:1.10	Wed Jun 23 10:27:46 2004
--- openafs/src/update/utils.c	Tue Oct 30 11:24:08 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/update/utils.c,v 1.10 2004/06/23 14:27:46 shadow Exp $");
  
  #include <afs/stds.h>
  #include <rx/rxkad.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/update/utils.c,v 1.10.2.1 2007/10/30 15:24:08 shadow Exp $");
  
  #include <afs/stds.h>
  #include <rx/rxkad.h>
***************
*** 22,34 ****
  #include <WINNT/afssw.h>
  #endif
  #include <stdio.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
--- 22,28 ----
Index: openafs/src/usd/usd_file.c
diff -c openafs/src/usd/usd_file.c:1.14 openafs/src/usd/usd_file.c:1.14.2.1
*** openafs/src/usd/usd_file.c:1.14	Wed Mar  3 17:41:05 2004
--- openafs/src/usd/usd_file.c	Tue Oct 30 11:24:08 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/usd/usd_file.c,v 1.14 2004/03/03 22:41:05 rees Exp $");
  
  #include <errno.h>
  #include <fcntl.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/usd/usd_file.c,v 1.14.2.1 2007/10/30 15:24:08 shadow Exp $");
  
  #include <errno.h>
  #include <fcntl.h>
***************
*** 31,43 ****
  #include <sys/mtio.h>
  #endif /* AFS_AIX_ENV */
  
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <stdlib.h>
  
  #include <afs/debug.h>
--- 31,37 ----
Index: openafs/src/uss/grammar.y
diff -c openafs/src/uss/grammar.y:1.4 openafs/src/uss/grammar.y:1.4.2.2
*** openafs/src/uss/grammar.y:1.4	Sat Oct 26 11:40:07 2002
--- openafs/src/uss/grammar.y	Mon Nov 26 16:21:56 2007
***************
*** 11,24 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  #include <stdio.h>
- 
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  
  extern int line;
  extern int uss_perr;
--- 11,17 ----
***************
*** 134,137 ****
--- 127,131 ----
  char *s;
  {
  fprintf(stderr,"%s. ",s);
+ return 0;
  }
Index: openafs/src/uss/lex.l
diff -c openafs/src/uss/lex.l:1.1 openafs/src/uss/lex.l:1.1.2.3
*** openafs/src/uss/lex.l:1.1	Thu Jun 19 12:55:10 2003
--- openafs/src/uss/lex.l	Mon Dec 10 13:24:15 2007
***************
*** 11,26 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /cvs/openafs/src/uss/lex.l,v 1.1 2003/06/19 16:55:10 shadow Exp $");
  
  
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  
  #include "y.tab.h"
  #include "uss_common.h"
--- 11,20 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /cvs/openafs/src/uss/lex.l,v 1.1.2.3 2007/12/10 18:24:15 shadow Exp $");
  
  
  #include <string.h>
  
  #include "y.tab.h"
  #include "uss_common.h"
***************
*** 30,35 ****
--- 24,30 ----
  #else
  #define dprint(x)
  #endif
+ void Replace(char *in, char *out);
  %}
  
  /* definitions */
***************
*** 76,81 ****
--- 71,77 ----
   * and replaces the second with a null.
   */
  
+ void
  Replace(in, out)
      char *in, *out;
  
Index: openafs/src/uss/uss.c
diff -c openafs/src/uss/uss.c:1.8 openafs/src/uss/uss.c:1.8.2.3
*** openafs/src/uss/uss.c:1.8	Mon Mar 15 13:51:03 2004
--- openafs/src/uss/uss.c	Mon Nov 26 16:21:56 2007
***************
*** 19,37 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/uss/uss.c,v 1.8 2004/03/15 18:51:03 shadow Exp $");
  
  #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 "uss_common.h"		/*Common uss definitions, globals */
  #include "uss_procs.h"		/*Main uss operations */
--- 19,31 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/uss/uss.c,v 1.8.2.3 2007/11/26 21:21:56 shadow Exp $");
  
  #ifdef	AFS_AIX32_ENV
  #include <signal.h>
  #endif
  
  #include <string.h>
  
  #include "uss_common.h"		/*Common uss definitions, globals */
  #include "uss_procs.h"		/*Main uss operations */
***************
*** 129,138 ****
   *	As advertised.
   *------------------------------------------------------------------------*/
  
! static afs_int32
! GetCommon(a_as)
!      register struct cmd_syndesc *a_as;
! 
  {				/*GetCommon */
  
      int code;			/*Result of ka_LocalCell */
--- 123,130 ----
   *	As advertised.
   *------------------------------------------------------------------------*/
  
! static int
! GetCommon(register struct cmd_syndesc *a_as, void *arock)
  {				/*GetCommon */
  
      int code;			/*Result of ka_LocalCell */
***************
*** 376,385 ****
   *------------------------------------------------------------------------*/
  
  static int
! DelUser(a_as, a_rock)
!      struct cmd_syndesc *a_as;
!      char *a_rock;
! 
  {				/*DelUser */
  
      int code;
--- 368,374 ----
   *------------------------------------------------------------------------*/
  
  static int
! DelUser(struct cmd_syndesc *a_as, void *a_rock)
  {				/*DelUser */
  
      int code;
***************
*** 473,482 ****
   *------------------------------------------------------------------------*/
  
  static int
! PurgeVolumes(a_as, a_rock)
!      struct cmd_syndesc *a_as;
!      char *a_rock;
! 
  {				/*PurgeVolumes */
  
      fprintf(stderr, "Sorry, purgevolumes has not yet been implemented.\n");
--- 462,468 ----
   *------------------------------------------------------------------------*/
  
  static int
! PurgeVolumes(struct cmd_syndesc *a_as, void *a_rock)
  {				/*PurgeVolumes */
  
      fprintf(stderr, "Sorry, purgevolumes has not yet been implemented.\n");
***************
*** 508,517 ****
   *------------------------------------------------------------------------*/
  
  static int
! RestoreUser(a_as, a_rock)
!      struct cmd_syndesc *a_as;
!      char *a_rock;
! 
  {				/*RestoreUser */
  
      fprintf(stderr, "Sorry, restoreuser has not yet been implemented.\n");
--- 494,500 ----
   *------------------------------------------------------------------------*/
  
  static int
! RestoreUser(struct cmd_syndesc *a_as, void *a_rock)
  {				/*RestoreUser */
  
      fprintf(stderr, "Sorry, restoreuser has not yet been implemented.\n");
***************
*** 1323,1332 ****
   *------------------------------------------------------------------------*/
  extern int Pipe;
  static int
! HandleBulk(a_as, a_rock)
!      register struct cmd_syndesc *a_as;
!      char *a_rock;
! 
  {				/*HandleBulk */
  
  #define USS_BULK_CMD_CHARS	 128
--- 1306,1312 ----
   *------------------------------------------------------------------------*/
  extern int Pipe;
  static int
! HandleBulk(register struct cmd_syndesc *a_as, void *a_rock)
  {				/*HandleBulk */
  
  #define USS_BULK_CMD_CHARS	 128
***************
*** 1535,1544 ****
   *------------------------------------------------------------------------*/
  
  static int
! AddUser(a_as, a_rock)
!      register struct cmd_syndesc *a_as;
!      char *a_rock;
! 
  {				/*AddUser */
  
      int i;
--- 1515,1521 ----
   *------------------------------------------------------------------------*/
  
  static int
! AddUser(register struct cmd_syndesc *a_as, void *a_rock)
  {				/*AddUser */
  
      int i;
***************
*** 1849,1855 ****
  
      /* ----------------------------- add ----------------------------- */
  
!     cs = cmd_CreateSyntax("add", AddUser, 0, "create a new user account");
      cmd_AddParm(cs, "-user", CMD_SINGLE, 0, "login name");
      cmd_AddParm(cs, "-realname", CMD_SINGLE, CMD_OPTIONAL,
  		"full name in quotes");
--- 1826,1832 ----
  
      /* ----------------------------- add ----------------------------- */
  
!     cs = cmd_CreateSyntax("add", AddUser, NULL, "create a new user account");
      cmd_AddParm(cs, "-user", CMD_SINGLE, 0, "login name");
      cmd_AddParm(cs, "-realname", CMD_SINGLE, CMD_OPTIONAL,
  		"full name in quotes");
***************
*** 1884,1890 ****
  
      /* ---------------------------- bulk ----------------------------- */
  
!     cs = cmd_CreateSyntax("bulk", HandleBulk, 0, "bulk input mode");
      cmd_AddParm(cs, "-file", CMD_SINGLE, 0, "bulk input file");
      cmd_Seek(cs, AUSS_TEMPLATE);
      cmd_AddParm(cs, "-template", CMD_SINGLE, CMD_OPTIONAL,
--- 1861,1867 ----
  
      /* ---------------------------- bulk ----------------------------- */
  
!     cs = cmd_CreateSyntax("bulk", HandleBulk, NULL, "bulk input mode");
      cmd_AddParm(cs, "-file", CMD_SINGLE, 0, "bulk input file");
      cmd_Seek(cs, AUSS_TEMPLATE);
      cmd_AddParm(cs, "-template", CMD_SINGLE, CMD_OPTIONAL,
***************
*** 1909,1915 ****
  
      /* ---------------------------- delete --------------------------- */
  
!     cs = cmd_CreateSyntax("delete", DelUser, 0, "delete a user account");
      cmd_AddParm(cs, "-user", CMD_SINGLE, 0, "login name");
      cmd_AddParm(cs, "-mountpoint", CMD_SINGLE, CMD_OPTIONAL,
  		"mountpoint for user's volume");
--- 1886,1892 ----
  
      /* ---------------------------- delete --------------------------- */
  
!     cs = cmd_CreateSyntax("delete", DelUser, NULL, "delete a user account");
      cmd_AddParm(cs, "-user", CMD_SINGLE, 0, "login name");
      cmd_AddParm(cs, "-mountpoint", CMD_SINGLE, CMD_OPTIONAL,
  		"mountpoint for user's volume");
***************
*** 1943,1949 ****
  #if USS_DONT_HIDE_SOME_FEATURES
      /* ------------------------- purgevolumes ------------------------ */
  
!     cs = cmd_CreateSyntax("purgevolumes", PurgeVolumes, 0,
  			  "destroy a deleted user's volume");
      cmd_AddParm(cs, "-volname", CMD_LIST, CMD_OPTIONAL | CMD_EXPANDS,
  		"Name(s) of volume(s) to destroy");
--- 1920,1926 ----
  #if USS_DONT_HIDE_SOME_FEATURES
      /* ------------------------- purgevolumes ------------------------ */
  
!     cs = cmd_CreateSyntax("purgevolumes", PurgeVolumes, NULL,
  			  "destroy a deleted user's volume");
      cmd_AddParm(cs, "-volname", CMD_LIST, CMD_OPTIONAL | CMD_EXPANDS,
  		"Name(s) of volume(s) to destroy");
***************
*** 1966,1972 ****
  #if USS_DONT_HIDE_SOME_FEATURES
      /* ---------------------------- restore -------------------------- */
  
!     cs = cmd_CreateSyntax("restore", RestoreUser, 0,
  			  "restore a deleted user account");
      cmd_AddParm(cs, "-user", CMD_SINGLE, 0, "login name to restore");
      cmd_AddParm(cs, "-uid", CMD_SINGLE, 0, "user id number");
--- 1943,1949 ----
  #if USS_DONT_HIDE_SOME_FEATURES
      /* ---------------------------- restore -------------------------- */
  
!     cs = cmd_CreateSyntax("restore", RestoreUser, NULL,
  			  "restore a deleted user account");
      cmd_AddParm(cs, "-user", CMD_SINGLE, 0, "login name to restore");
      cmd_AddParm(cs, "-uid", CMD_SINGLE, 0, "user id number");
***************
*** 2018,2021 ****
--- 1995,1999 ----
      if (doUnlog) {
  	code = uss_fs_UnlogToken(uss_Cell);
      }
+     return 0;
  }				/*Main routine */
Index: openafs/src/uss/uss_acl.c
diff -c openafs/src/uss/uss_acl.c:1.6.2.1 openafs/src/uss/uss_acl.c:1.6.2.2
*** openafs/src/uss/uss_acl.c:1.6.2.1	Tue Apr 10 14:43:46 2007
--- openafs/src/uss/uss_acl.c	Tue Oct 30 11:24:09 2007
***************
*** 19,25 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/uss/uss_acl.c,v 1.6.2.1 2007/04/10 18:43:46 shadow Exp $");
  
  #include "uss_acl.h"
  #include "uss_common.h"
--- 19,25 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/uss/uss_acl.c,v 1.6.2.2 2007/10/30 15:24:09 shadow Exp $");
  
  #include "uss_acl.h"
  #include "uss_common.h"
***************
*** 30,42 ****
  #include <netdb.h>
  #include <errno.h>
  
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  
  #undef VIRTUE
  #undef VICE
--- 30,36 ----
Index: openafs/src/uss/uss_common.c
diff -c openafs/src/uss/uss_common.c:1.6 openafs/src/uss/uss_common.c:1.6.2.1
*** openafs/src/uss/uss_common.c:1.6	Tue Jul 15 19:17:12 2003
--- openafs/src/uss/uss_common.c	Tue Oct 30 11:24:09 2007
***************
*** 19,37 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/uss/uss_common.c,v 1.6 2003/07/15 23:17:12 shadow Exp $");
  
  #include "uss_common.h"		/*Interface definitions */
  #include <afs/kautils.h>	/*MAXKTCREALMLEN & MAXKTCNAMELEN */
  
- 
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  
  
  /*
--- 19,30 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/uss/uss_common.c,v 1.6.2.1 2007/10/30 15:24:09 shadow Exp $");
  
  #include "uss_common.h"		/*Interface definitions */
  #include <afs/kautils.h>	/*MAXKTCREALMLEN & MAXKTCNAMELEN */
  
  #include <string.h>
  
  
  /*
Index: openafs/src/uss/uss_common.h
diff -c openafs/src/uss/uss_common.h:1.8 openafs/src/uss/uss_common.h:1.8.2.1
*** openafs/src/uss/uss_common.h:1.8	Tue Jul 15 19:17:12 2003
--- openafs/src/uss/uss_common.h	Tue Oct 30 11:24:09 2007
***************
*** 23,35 ****
  #include <stdio.h>		/*I/O stuff */
  #include <afs/afsutil.h>
  #include <errno.h>
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  
  /*
   * --------------------- Exported definitions ---------------------
--- 23,29 ----
Index: openafs/src/uss/uss_fs.c
diff -c openafs/src/uss/uss_fs.c:1.8 openafs/src/uss/uss_fs.c:1.8.2.2
*** openafs/src/uss/uss_fs.c:1.8	Tue Jul 15 19:17:12 2003
--- openafs/src/uss/uss_fs.c	Mon Nov 26 16:21:56 2007
***************
*** 19,25 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/uss/uss_fs.c,v 1.8 2003/07/15 23:17:12 shadow Exp $");
  
  #include "uss_fs.h"		/*Interface to this module */
  #include <sys/types.h>
--- 19,25 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/uss/uss_fs.c,v 1.8.2.2 2007/11/26 21:21:56 shadow Exp $");
  
  #include "uss_fs.h"		/*Interface to this module */
  #include <sys/types.h>
***************
*** 30,42 ****
  #endif
  #include <netinet/in.h>
  
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  
  #include <afs/venus.h>
  #include "uss_common.h"
--- 30,36 ----
***************
*** 495,501 ****
  #endif /* USS_FS_DB */
  	return (-1);
      }
! 
  }				/*uss_fs_MkMountPoint */
  
  
--- 489,495 ----
  #endif /* USS_FS_DB */
  	return (-1);
      }
!     return 0;
  }				/*uss_fs_MkMountPoint */
  
  
Index: openafs/src/uss/uss_kauth.c
diff -c openafs/src/uss/uss_kauth.c:1.10.2.1 openafs/src/uss/uss_kauth.c:1.10.2.2
*** openafs/src/uss/uss_kauth.c:1.10.2.1	Tue Apr 10 14:43:46 2007
--- openafs/src/uss/uss_kauth.c	Tue Oct 30 11:24:09 2007
***************
*** 19,38 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/uss/uss_kauth.c,v 1.10.2.1 2007/04/10 18:43:46 shadow Exp $");
  
  #include "uss_kauth.h"		/*Module interface */
  #include "uss_common.h"		/*Common defs & operations */
  #include <errno.h>
  #include <pwd.h>
  
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  
  #include <afs/com_err.h>
  #include <afs/kautils.h> /*MAXKTCREALMLEN*/
--- 19,32 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/uss/uss_kauth.c,v 1.10.2.2 2007/10/30 15:24:09 shadow Exp $");
  
  #include "uss_kauth.h"		/*Module interface */
  #include "uss_common.h"		/*Common defs & operations */
  #include <errno.h>
  #include <pwd.h>
  
  #include <string.h>
  
  #include <afs/com_err.h>
  #include <afs/kautils.h> /*MAXKTCREALMLEN*/
Index: openafs/src/uss/uss_procs.c
diff -c openafs/src/uss/uss_procs.c:1.9 openafs/src/uss/uss_procs.c:1.9.2.1
*** openafs/src/uss/uss_procs.c:1.9	Tue Jul 15 19:17:12 2003
--- openafs/src/uss/uss_procs.c	Tue Oct 30 11:24:09 2007
***************
*** 19,25 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/uss/uss_procs.c,v 1.9 2003/07/15 23:17:12 shadow Exp $");
  
  #include "uss_procs.h"		/*Module interface */
  #include "uss_common.h"		/*Common defs & operations */
--- 19,25 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/uss/uss_procs.c,v 1.9.2.1 2007/10/30 15:24:09 shadow Exp $");
  
  #include "uss_procs.h"		/*Module interface */
  #include "uss_common.h"		/*Common defs & operations */
***************
*** 33,45 ****
  #include <fcntl.h>
  #endif
  
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  
  #include <afs/kautils.h> /*MAXKTCREALMLEN*/
  #undef USS_PROCS_DB
--- 33,39 ----
Index: openafs/src/uss/uss_vol.c
diff -c openafs/src/uss/uss_vol.c:1.10.2.1 openafs/src/uss/uss_vol.c:1.10.2.2
*** openafs/src/uss/uss_vol.c:1.10.2.1	Tue Apr 10 14:43:46 2007
--- openafs/src/uss/uss_vol.c	Tue Oct 30 11:24:09 2007
***************
*** 19,25 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/uss/uss_vol.c,v 1.10.2.1 2007/04/10 18:43:46 shadow Exp $");
  
  #include "uss_vol.h"		/*Interface to this module */
  #include "uss_common.h"		/*Common definitions */
--- 19,25 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/uss/uss_vol.c,v 1.10.2.2 2007/10/30 15:24:09 shadow Exp $");
  
  #include "uss_vol.h"		/*Interface to this module */
  #include "uss_common.h"		/*Common definitions */
***************
*** 30,42 ****
  #include <netdb.h>
  #include <errno.h>
  
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  
  #include <afs/vlserver.h>
  #include <afs/auth.h>
--- 30,36 ----
Index: openafs/src/util/afsutil.h
diff -c openafs/src/util/afsutil.h:1.17.2.5 openafs/src/util/afsutil.h:1.17.2.6
*** openafs/src/util/afsutil.h:1.17.2.5	Wed Jul 12 09:42:25 2006
--- openafs/src/util/afsutil.h	Wed Oct 31 00:26:29 2007
***************
*** 40,46 ****
  extern char *serverLogSyslogTag;
  #endif
  extern void vFSLog(const char *format, va_list args);
! extern void SetLogThreadNumProgram(int (*func) () );
  
  /*@printflike@*/ extern void FSLog(const char *format, ...);
  #define ViceLog(level, str)  if ((level) <= LogLevel) (FSLog str)
--- 40,46 ----
  extern char *serverLogSyslogTag;
  #endif
  extern void vFSLog(const char *format, va_list args);
! extern void SetLogThreadNumProgram(int (*func) (void) );
  
  /*@printflike@*/ extern void FSLog(const char *format, ...);
  #define ViceLog(level, str)  if ((level) <= LogLevel) (FSLog str)
Index: openafs/src/util/afsutil_prototypes.h
diff -c openafs/src/util/afsutil_prototypes.h:1.7.2.4 openafs/src/util/afsutil_prototypes.h:1.7.2.5
*** openafs/src/util/afsutil_prototypes.h:1.7.2.4	Mon Jul 11 15:27:28 2005
--- openafs/src/util/afsutil_prototypes.h	Wed Oct 31 00:26:29 2007
***************
*** 159,165 ****
  extern void SetupLogSignals(void);
  extern int OpenLog(const char *fileName);
  extern int ReOpenLog(const char *fileName);
! extern int LogThreadNum();
  
  /* snprintf.c */
  
--- 159,165 ----
  extern void SetupLogSignals(void);
  extern int OpenLog(const char *fileName);
  extern int ReOpenLog(const char *fileName);
! extern int LogThreadNum(void);
  
  /* snprintf.c */
  
Index: openafs/src/util/assert.c
diff -c openafs/src/util/assert.c:1.11 openafs/src/util/assert.c:1.11.2.2
*** openafs/src/util/assert.c:1.11	Wed Aug 20 18:41:06 2003
--- openafs/src/util/assert.c	Wed Oct 31 00:26:29 2007
***************
*** 14,29 ****
  #ifdef HAVE_SYS_TIME_H
  #include <sys/time.h>
  #endif
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/util/assert.c,v 1.11 2003/08/20 22:41:06 zacheiss Exp $");
  
  #include <stdio.h>
  #include "afsutil.h"
--- 14,23 ----
  #ifdef HAVE_SYS_TIME_H
  #include <sys/time.h>
  #endif
  #include <string.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/util/assert.c,v 1.11.2.2 2007/10/31 04:26:29 shadow Exp $");
  
  #include <stdio.h>
  #include "afsutil.h"
***************
*** 44,50 ****
      time_t when;
  
      time(&when);
!     afs_ctime(&when, tdate, 25);
      fprintf(stderr, "%s: Assertion failed! file %s, line %d.\n", tdate, file,
  	    line);
      fflush(stderr);
--- 38,44 ----
      time_t when;
  
      time(&when);
!     (void)afs_ctime(&when, tdate, 25);
      fprintf(stderr, "%s: Assertion failed! file %s, line %d.\n", tdate, file,
  	    line);
      fflush(stderr);
Index: openafs/src/util/casestrcpy.c
diff -c openafs/src/util/casestrcpy.c:1.6.2.1 openafs/src/util/casestrcpy.c:1.6.2.2
*** openafs/src/util/casestrcpy.c:1.6.2.1	Mon Jul 31 13:15:48 2006
--- openafs/src/util/casestrcpy.c	Tue Oct 30 11:24:09 2007
***************
*** 11,25 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/util/casestrcpy.c,v 1.6.2.1 2006/07/31 17:15:48 shadow Exp $");
  
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <ctype.h>
  #include <stddef.h>
  #include <stdarg.h>
--- 11,19 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/util/casestrcpy.c,v 1.6.2.2 2007/10/30 15:24:09 shadow Exp $");
  
  #include <string.h>
  #include <ctype.h>
  #include <stddef.h>
  #include <stdarg.h>
Index: openafs/src/util/fileutil.c
diff -c openafs/src/util/fileutil.c:1.7 openafs/src/util/fileutil.c:1.7.2.1
*** openafs/src/util/fileutil.c:1.7	Tue Jul 15 19:17:16 2003
--- openafs/src/util/fileutil.c	Tue Oct 30 11:24:09 2007
***************
*** 13,25 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/util/fileutil.c,v 1.7 2003/07/15 23:17:16 shadow Exp $");
  
  #include <afs/stds.h>
  #include <stddef.h>
  #include <stdlib.h>
  #include <stdio.h>
  #include <errno.h>
  
  #ifdef AFS_NT40_ENV
  #include <windows.h>
--- 13,26 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/util/fileutil.c,v 1.7.2.1 2007/10/30 15:24:09 shadow Exp $");
  
  #include <afs/stds.h>
  #include <stddef.h>
  #include <stdlib.h>
  #include <stdio.h>
  #include <errno.h>
+ #include <string.h>
  
  #ifdef AFS_NT40_ENV
  #include <windows.h>
***************
*** 30,42 ****
  #ifdef HAVE_UNISTD_H
  #include <unistd.h>
  #endif
- #ifdef HAVE_STRING_H
- #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <sys/types.h>
  #include <dirent.h>
  #include <sys/stat.h>
--- 31,36 ----
Index: openafs/src/util/get_krbrlm.c
diff -c openafs/src/util/get_krbrlm.c:1.6 openafs/src/util/get_krbrlm.c:1.6.2.1
*** openafs/src/util/get_krbrlm.c:1.6	Sat Nov 29 17:08:19 2003
--- openafs/src/util/get_krbrlm.c	Tue Oct 30 11:24:09 2007
***************
*** 7,15 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/util/get_krbrlm.c,v 1.6 2003/11/29 22:08:19 jaltman Exp $");
  
  #include <stdio.h>
  #include "afsutil.h"
  
  /*
--- 7,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/util/get_krbrlm.c,v 1.6.2.1 2007/10/30 15:24:09 shadow Exp $");
  
  #include <stdio.h>
+ #include <string.h>
+ #include <ctype.h>
  #include "afsutil.h"
  
  /*
Index: openafs/src/util/hostparse.c
diff -c openafs/src/util/hostparse.c:1.13 openafs/src/util/hostparse.c:1.13.2.1
*** openafs/src/util/hostparse.c:1.13	Tue Jul 15 19:17:16 2003
--- openafs/src/util/hostparse.c	Tue Oct 30 11:24:09 2007
***************
*** 15,21 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/util/hostparse.c,v 1.13 2003/07/15 23:17:16 shadow Exp $");
  
  #ifdef UKERNEL
  #include "afs/sysincludes.h"
--- 15,21 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/util/hostparse.c,v 1.13.2.1 2007/10/30 15:24:09 shadow Exp $");
  
  #ifdef UKERNEL
  #include "afs/sysincludes.h"
***************
*** 34,46 ****
  #include <netdb.h>
  #include <ctype.h>
  #endif
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <errno.h>
  #include "afsutil.h"
  #endif /* UKERNEL */
--- 34,40 ----
Index: openafs/src/util/kreltime.c
diff -c openafs/src/util/kreltime.c:1.8.2.4 openafs/src/util/kreltime.c:1.8.2.5
*** openafs/src/util/kreltime.c:1.8.2.4	Sat Oct 21 21:51:57 2006
--- openafs/src/util/kreltime.c	Tue Oct 30 11:24:09 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/util/kreltime.c,v 1.8.2.4 2006/10/22 01:51:57 jaltman Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/util/kreltime.c,v 1.8.2.5 2007/10/30 15:24:09 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 19,31 ****
  #include "ktime.h"
  #include <time.h>
  #include <ctype.h>
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include "afsutil.h"
  
  
--- 19,25 ----
Index: openafs/src/util/ktime.c
diff -c openafs/src/util/ktime.c:1.10.2.1 openafs/src/util/ktime.c:1.10.2.2
*** openafs/src/util/ktime.c:1.10.2.1	Mon Oct 18 03:12:17 2004
--- openafs/src/util/ktime.c	Tue Oct 30 11:24:09 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/util/ktime.c,v 1.10.2.1 2004/10/18 07:12:17 shadow Exp $");
  
  #include <sys/types.h>
  #include <stdio.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/util/ktime.c,v 1.10.2.2 2007/10/30 15:24:09 shadow Exp $");
  
  #include <sys/types.h>
  #include <stdio.h>
***************
*** 20,32 ****
  #ifdef AFS_NT40_ENV
  #include <malloc.h>
  #endif
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <stdlib.h>
  #include "afsutil.h"
  
--- 20,26 ----
Index: openafs/src/util/netutils.c
diff -c openafs/src/util/netutils.c:1.13.2.2 openafs/src/util/netutils.c:1.13.2.5
*** openafs/src/util/netutils.c:1.13.2.2	Fri Jan 12 00:23:43 2007
--- openafs/src/util/netutils.c	Wed Oct 31 08:36:03 2007
***************
*** 20,36 ****
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/util/netutils.c,v 1.13.2.2 2007/01/12 05:23:43 shadow Exp $");
  
  #include <stdlib.h>
  #include <stdio.h>
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <ctype.h>
  #ifdef KERNEL
  #include "afs/sysincludes.h"
--- 20,30 ----
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/util/netutils.c,v 1.13.2.5 2007/10/31 12:36:03 shadow Exp $");
  
  #include <stdlib.h>
  #include <stdio.h>
  #include <string.h>
  #include <ctype.h>
  #ifdef KERNEL
  #include "afs/sysincludes.h"
***************
*** 57,62 ****
--- 51,59 ----
  #define INADDR_LOOPBACK (afs_uint32)0x7f000001
  #endif
  
+ int ParseNetInfoFile_int(afs_uint32 *, afs_uint32 *, afs_uint32 *,
+                          int, char reason[], const char *,
+                          int);
  /* 
   * The line parameter is a pointer to a buffer containing a string of 
   * bytes of the form 
Index: openafs/src/util/serverLog.c
diff -c openafs/src/util/serverLog.c:1.22.2.11 openafs/src/util/serverLog.c:1.22.2.14
*** openafs/src/util/serverLog.c:1.22.2.11	Wed Jun  7 00:27:20 2006
--- openafs/src/util/serverLog.c	Mon Mar 10 18:35:36 2008
***************
*** 20,26 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/util/serverLog.c,v 1.22.2.11 2006/06/07 04:27:20 shadow Exp $");
  
  #include <stdio.h>
  #ifdef AFS_NT40_ENV
--- 20,26 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/util/serverLog.c,v 1.22.2.14 2008/03/10 22:35:36 shadow Exp $");
  
  #include <stdio.h>
  #ifdef AFS_NT40_ENV
***************
*** 37,52 ****
  #include <afs/procmgmt.h>	/* signal(), kill(), wait(), etc. */
  #include <fcntl.h>
  #include <afs/stds.h>
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <sys/stat.h>
  #include "afsutil.h"
  #include "fileutil.h"
  #if defined(AFS_PTHREAD_ENV)
  #include <assert.h>
  #include <pthread.h>
--- 37,47 ----
  #include <afs/procmgmt.h>	/* signal(), kill(), wait(), etc. */
  #include <fcntl.h>
  #include <afs/stds.h>
  #include <string.h>
  #include <sys/stat.h>
  #include "afsutil.h"
  #include "fileutil.h"
+ #include <lwp.h>
  #if defined(AFS_PTHREAD_ENV)
  #include <assert.h>
  #include <pthread.h>
***************
*** 75,81 ****
  {
      return -1;
  }
! static int (*threadNumProgram) () = dummyThreadNum;
  
  static int serverLogFD = -1;
  
--- 70,76 ----
  {
      return -1;
  }
! static int (*threadNumProgram) (void) = dummyThreadNum;
  
  static int serverLogFD = -1;
  
***************
*** 93,99 ****
  static char ourName[MAXPATHLEN];
  
  void
! SetLogThreadNumProgram(int (*func) () )
  {
      threadNumProgram = func;
  }
--- 88,94 ----
  static char ourName[MAXPATHLEN];
  
  void
! SetLogThreadNumProgram(int (*func) (void) )
  {
      threadNumProgram = func;
  }
***************
*** 171,179 ****
      va_end(args);
  }				/*FSLog */
  
! static int
! DebugOn(int loglevel)
  {
      if (loglevel == 0) {
  	ViceLog(0, ("Reset Debug levels to 0\n"));
      } else {
--- 166,175 ----
      va_end(args);
  }				/*FSLog */
  
! static void*
! DebugOn(void *param)
  {
+     int loglevel = (int)param;
      if (loglevel == 0) {
  	ViceLog(0, ("Reset Debug levels to 0\n"));
      } else {
***************
*** 187,194 ****
  void
  SetDebug_Signal(int signo)
  {
- /*    extern int IOMGR_SoftSig();*/
- 
      if (LogLevel > 0) {
  	LogLevel *= 5;
  
--- 183,188 ----
***************
*** 208,216 ****
      }
      printLocks = 2;
  #if defined(AFS_PTHREAD_ENV)
!     DebugOn(LogLevel);
  #else /* AFS_PTHREAD_ENV */
!     IOMGR_SoftSig(DebugOn, LogLevel);
  #endif /* AFS_PTHREAD_ENV */
  
      (void)signal(signo, SetDebug_Signal);	/* on some platforms, this
--- 202,210 ----
      }
      printLocks = 2;
  #if defined(AFS_PTHREAD_ENV)
!     DebugOn((void *) LogLevel);
  #else /* AFS_PTHREAD_ENV */
!     IOMGR_SoftSig(DebugOn, (void *) LogLevel);
  #endif /* AFS_PTHREAD_ENV */
  
      (void)signal(signo, SetDebug_Signal);	/* on some platforms, this
***************
*** 226,234 ****
      if (printLocks > 0)
  	--printLocks;
  #if defined(AFS_PTHREAD_ENV)
!     DebugOn(LogLevel);
  #else /* AFS_PTHREAD_ENV */
!     IOMGR_SoftSig(DebugOn, LogLevel);
  #endif /* AFS_PTHREAD_ENV */
  
      (void)signal(signo, ResetDebug_Signal);	/* on some platforms,
--- 220,228 ----
      if (printLocks > 0)
  	--printLocks;
  #if defined(AFS_PTHREAD_ENV)
!     DebugOn((void *) LogLevel);
  #else /* AFS_PTHREAD_ENV */
!     IOMGR_SoftSig(DebugOn, (void *) LogLevel);
  #endif /* AFS_PTHREAD_ENV */
  
      (void)signal(signo, ResetDebug_Signal);	/* on some platforms,
***************
*** 339,347 ****
  ReOpenLog(const char *fileName)
  {
      int isfifo = 0;
- #if !defined(AFS_PTHREAD_ENV)
-     int tempfd;
- #endif
  #if !defined(AFS_NT40_ENV)
      struct stat statbuf;
  #endif
--- 333,338 ----
Index: openafs/src/util/snprintf.c
diff -c openafs/src/util/snprintf.c:1.21.2.2 openafs/src/util/snprintf.c:1.21.2.5
*** openafs/src/util/snprintf.c:1.21.2.2	Mon Oct 18 13:44:05 2004
--- openafs/src/util/snprintf.c	Fri Dec 14 08:09:26 2007
***************
*** 4,31 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/util/snprintf.c,v 1.21.2.2 2004/10/18 17:44:05 shadow Exp $");
  
  #include <sys/types.h>
  #include <stdarg.h>
  #include <stdio.h>
  #include <ctype.h>
  #ifndef AFS_NT40_ENV
  #include <netinet/in.h>
  #include <netdb.h>
  #else
  #include <winsock2.h>
  #endif
  #if defined(AFS_AIX32_ENV) || defined(AFS_SUN_ENV) || defined(AFS_XBSD_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SGI65_ENV)
  #include <sys/socket.h>
  #endif
- #ifdef HAVE_STRING_H
- #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  
  #define MAXPREC 100
  
--- 4,28 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/util/snprintf.c,v 1.21.2.5 2007/12/14 13:09:26 jaltman Exp $");
  
  #include <sys/types.h>
  #include <stdarg.h>
  #include <stdio.h>
  #include <ctype.h>
+ #include <string.h>
  #ifndef AFS_NT40_ENV
  #include <netinet/in.h>
  #include <netdb.h>
+ #ifndef HAVE_VSYSLOG
+ #include <syslog.h>
+ #endif
  #else
  #include <winsock2.h>
  #endif
  #if defined(AFS_AIX32_ENV) || defined(AFS_SUN_ENV) || defined(AFS_XBSD_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SGI65_ENV)
  #include <sys/socket.h>
  #endif
  
  #define MAXPREC 100
  
***************
*** 527,532 ****
--- 524,539 ----
  #endif /* AFS_OSF20_ENV || AFS_AIX32_ENV */
  
  #ifndef AFS_NT40_ENV
+ #ifndef HAVE_VSYSLOG
+ void
+ vsyslog(int priority, const char *format, va_list args)
+ {
+   char buf[1024];
+   vsnprintf(buf, sizeof(buf), format, args);
+   syslog(priority, "%s", buf);
+ }
+ #endif
+ 
  #if defined(AFS_OSF20_ENV) && !defined(AFS_DUX50_ENV) || defined(AFS_AIX32_ENV) || (defined(AFS_SUN55_ENV) && !defined(AFS_SUN56_ENV)) || !defined(HAVE_SNPRINTF)
  
  #ifdef AFS_AIX51_ENV
Index: openafs/src/util/softsig.c
diff -c openafs/src/util/softsig.c:1.8.2.2 openafs/src/util/softsig.c:1.8.2.3
*** openafs/src/util/softsig.c:1.8.2.2	Thu Feb 23 07:33:39 2006
--- openafs/src/util/softsig.c	Wed Oct 31 00:26:29 2007
***************
*** 15,20 ****
--- 15,21 ----
  #define _POSIX_PTHREAD_SEMANTICS
  #include <afs/param.h>
  #include <assert.h>
+ #include <stdlib.h>
  #include <stdio.h>
  #ifndef  AFS_NT40_ENV
  #include <signal.h>
Index: openafs/src/util/strlcat.c
diff -c openafs/src/util/strlcat.c:1.2 openafs/src/util/strlcat.c:1.2.2.1
*** openafs/src/util/strlcat.c:1.2	Tue Jul 15 19:17:16 2003
--- openafs/src/util/strlcat.c	Wed Oct 31 00:26:29 2007
***************
*** 18,28 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/util/strlcat.c,v 1.2 2003/07/15 23:17:16 shadow Exp $");
  
  #ifndef HAVE_STRLCAT
  
  #include <sys/types.h>
  
  /*
   * Appends src to string dst of size siz (unlike strncat, siz is the
--- 18,29 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/util/strlcat.c,v 1.2.2.1 2007/10/31 04:26:29 shadow Exp $");
  
  #ifndef HAVE_STRLCAT
  
  #include <sys/types.h>
+ #include <string.h>
  
  /*
   * Appends src to string dst of size siz (unlike strncat, siz is the
Index: openafs/src/util/sys.c
diff -c openafs/src/util/sys.c:1.6 openafs/src/util/sys.c:1.6.2.1
*** openafs/src/util/sys.c:1.6	Tue Jul 15 19:17:16 2003
--- openafs/src/util/sys.c	Wed Oct 31 00:26:29 2007
***************
*** 11,24 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/util/sys.c,v 1.6 2003/07/15 23:17:16 shadow Exp $");
  
  #include <stdio.h>
  
  #include "AFS_component_version_number.c"
  
  int
! main()
  {
      printf("%s\n", SYS_NAME);
      return 0;
--- 11,24 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/util/sys.c,v 1.6.2.1 2007/10/31 04:26:29 shadow Exp $");
  
  #include <stdio.h>
  
  #include "AFS_component_version_number.c"
  
  int
! main(int argc, char **argv)
  {
      printf("%s\n", SYS_NAME);
      return 0;
Index: openafs/src/util/uuid.c
diff -c openafs/src/util/uuid.c:1.16.2.1 openafs/src/util/uuid.c:1.16.2.2
*** openafs/src/util/uuid.c:1.16.2.1	Fri Dec 23 20:09:55 2005
--- openafs/src/util/uuid.c	Tue Oct 30 11:24:09 2007
***************
*** 50,56 ****
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/util/uuid.c,v 1.16.2.1 2005/12/24 01:09:55 shadow Exp $");
  
  #ifdef KERNEL
  #include "afs/sysincludes.h"
--- 50,56 ----
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/util/uuid.c,v 1.16.2.2 2007/10/30 15:24:09 shadow Exp $");
  
  #ifdef KERNEL
  #include "afs/sysincludes.h"
***************
*** 60,65 ****
--- 60,66 ----
  #else /* KERNEL */
  #include <stdio.h>
  #include <errno.h>
+ #include <string.h>
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #include <process.h>
***************
*** 73,85 ****
  #include <sys/time.h>
  #endif /* ITIMER_REAL */
  #include <net/if.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
--- 74,79 ----
Index: openafs/src/util/volparse.c
diff -c openafs/src/util/volparse.c:1.11 openafs/src/util/volparse.c:1.11.2.1
*** openafs/src/util/volparse.c:1.11	Tue Jul 15 19:17:17 2003
--- openafs/src/util/volparse.c	Tue Oct 30 11:24:09 2007
***************
*** 11,25 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/util/volparse.c,v 1.11 2003/07/15 23:17:17 shadow Exp $");
  
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #ifdef HAVE_STDLIB_H
  #include <stdlib.h>
  #endif
--- 11,19 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/util/volparse.c,v 1.11.2.1 2007/10/30 15:24:09 shadow Exp $");
  
  #include <string.h>
  #ifdef HAVE_STDLIB_H
  #include <stdlib.h>
  #endif
Index: openafs/src/venus/Makefile.in
diff -c openafs/src/venus/Makefile.in:1.30.2.3 openafs/src/venus/Makefile.in:1.30.2.5
*** openafs/src/venus/Makefile.in:1.30.2.3	Thu Mar  9 01:42:21 2006
--- openafs/src/venus/Makefile.in	Mon Dec 31 19:19:00 2007
***************
*** 52,70 ****
  cacheout.o: cacheout.c
  
  ${DEST}/bin/fs ${DEST}/root.server/usr/afs/bin/fs: fs
! 	${INSTALL} -s $? $@
  
  ${DEST}/bin/livesys: livesys
! 	${INSTALL} -s $? $@
  
  ${DEST}/bin/up: up
! 	${INSTALL} -s $? $@
  
  ${DEST}/etc/fstrace: fstrace
! 	${INSTALL} -s $? $@
  
  ${DEST}/bin/cmdebug: cmdebug
! 	${INSTALL} -s $? $@
  
  
  
--- 52,70 ----
  cacheout.o: cacheout.c
  
  ${DEST}/bin/fs ${DEST}/root.server/usr/afs/bin/fs: fs
! 	${INSTALL} $? $@
  
  ${DEST}/bin/livesys: livesys
! 	${INSTALL} $? $@
  
  ${DEST}/bin/up: up
! 	${INSTALL} $? $@
  
  ${DEST}/etc/fstrace: fstrace
! 	${INSTALL} $? $@
  
  ${DEST}/bin/cmdebug: cmdebug
! 	${INSTALL} $? $@
  
  
  
***************
*** 173,179 ****
  	alpha_osf1 | alpha_osf20 |  alpha_osf30 | alpha_osf32 | alpha_osf32c | alpha_dux??) \
  		${CC} -o kdump kdump.o ${TOP_LIBDIR}/libcmd.a  ${TOP_LIBDIR}/util.a ${XLIBS} -ll -lmld;; \
  	ncrx86_* ) ${CC} -o kdump kdump.o ${TOP_LIBDIR}/libcmd.a  ${TOP_LIBDIR}/util.a -lelf ${XLIBS} ;; \
! 	*nbsd*) touch kdump ;; \
  	* )     ${CC} -o kdump kdump.o ${TOP_LIBDIR}/libcmd.a  ${TOP_LIBDIR}/util.a ${XLIBS} ;; \
  	esac
  
--- 173,179 ----
  	alpha_osf1 | alpha_osf20 |  alpha_osf30 | alpha_osf32 | alpha_osf32c | alpha_dux??) \
  		${CC} -o kdump kdump.o ${TOP_LIBDIR}/libcmd.a  ${TOP_LIBDIR}/util.a ${XLIBS} -ll -lmld;; \
  	ncrx86_* ) ${CC} -o kdump kdump.o ${TOP_LIBDIR}/libcmd.a  ${TOP_LIBDIR}/util.a -lelf ${XLIBS} ;; \
! 	*bsd*) touch kdump ;; \
  	* )     ${CC} -o kdump kdump.o ${TOP_LIBDIR}/libcmd.a  ${TOP_LIBDIR}/util.a ${XLIBS} ;; \
  	esac
  
***************
*** 219,225 ****
  				esac || exit $$?; \
  			done \
  			;; \
! 		*nbsd*) \
  			touch kdump.o ;; \
  		*) \
  			${CC} ${KERN_DBG} ${KERN_OPTMZ} -I${TOP_SRCDIR} -I${TOP_INCDIR}/afs \
--- 219,225 ----
  				esac || exit $$?; \
  			done \
  			;; \
! 		*bsd*) \
  			touch kdump.o ;; \
  		*) \
  			${CC} ${KERN_DBG} ${KERN_OPTMZ} -I${TOP_SRCDIR} -I${TOP_INCDIR}/afs \
***************
*** 276,304 ****
  		ln -fs kdump.IP20 ${DEST}/etc/kdump.IP22; \
  		ln -fs kdump.IP20 ${DEST}/etc/kdump.IP32; \
  		for f in kdump.IP??; \
! 			do ${INSTALL} -s $$f ${DEST}/etc/$$f || exit $$? ; \
  		done ;; \
  	sun*_5[789] | sun*_510 ) \
  		${INSTALLex} -f ${srcdir}/kdump.sh.solaris7 ${DEST}/etc/kdump; \
! 		${INSTALL} -s -f ${srcdir}/kdump ${DEST}/etc/kdump32;; \
  	*alpha_linux* ) \
  		${INSTALLex} -f ${srcdir}/kdump.sh.linux ${DEST}/etc/kdump; \
! 		${INSTALL} -s kdump-alpha_linux-${LINUX_VERSION} $@ ;; \
  	*linux* ) \
  		${INSTALLex} -f ${srcdir}/kdump.sh.linux ${DEST}/etc/kdump; \
! 		${INSTALL} -s kdump-linux-${LINUX_VERSION} $@-${LINUX_VERSION} ;; \
  	hp_ux11* ) \
  		${INSTALLex} -f ${srcdir}/kdump.sh.hp_ux11 ${DEST}/etc/kdump; \
! 		${INSTALL} -s -f $? $@;; \
! 	*nbsd*) \
  		;; \
  	*) \
! 		${INSTALL} -s $? $@ ;; \
  	esac
  
  ${DEST}/etc/kdump64: kdump-build
  	if [ -f kdump64 ]; then \
! 		${INSTALL} -s kdump64 $@; \
  	fi
  
  
--- 276,304 ----
  		ln -fs kdump.IP20 ${DEST}/etc/kdump.IP22; \
  		ln -fs kdump.IP20 ${DEST}/etc/kdump.IP32; \
  		for f in kdump.IP??; \
! 			do ${INSTALL} $$f ${DEST}/etc/$$f || exit $$? ; \
  		done ;; \
  	sun*_5[789] | sun*_510 ) \
  		${INSTALLex} -f ${srcdir}/kdump.sh.solaris7 ${DEST}/etc/kdump; \
! 		${INSTALL} -f ${srcdir}/kdump ${DEST}/etc/kdump32;; \
  	*alpha_linux* ) \
  		${INSTALLex} -f ${srcdir}/kdump.sh.linux ${DEST}/etc/kdump; \
! 		${INSTALL} kdump-alpha_linux-${LINUX_VERSION} $@ ;; \
  	*linux* ) \
  		${INSTALLex} -f ${srcdir}/kdump.sh.linux ${DEST}/etc/kdump; \
! 		${INSTALL} kdump-linux-${LINUX_VERSION} $@-${LINUX_VERSION} ;; \
  	hp_ux11* ) \
  		${INSTALLex} -f ${srcdir}/kdump.sh.hp_ux11 ${DEST}/etc/kdump; \
! 		${INSTALL} -f $? $@;; \
! 	*bsd*) \
  		;; \
  	*) \
! 		${INSTALL} $? $@ ;; \
  	esac
  
  ${DEST}/etc/kdump64: kdump-build
  	if [ -f kdump64 ]; then \
! 		${INSTALL} kdump64 $@; \
  	fi
  
  
***************
*** 328,349 ****
  include ../config/Makefile.version
  
  ${DESTDIR}${bindir}/fs: fs
! 	${INSTALL} -s $? $@
  
  ${DESTDIR}${bindir}/livesys: livesys
! 	${INSTALL} -s $? $@
  
  ${DESTDIR}${afssrvbindir}/fs: fs
! 	${INSTALL} -s $? $@
  
  ${DESTDIR}${bindir}/up: up
! 	${INSTALL} -s $? $@
  
  ${DESTDIR}${sbindir}/fstrace: fstrace
! 	${INSTALL} -s $? $@
  
  ${DESTDIR}${bindir}/cmdebug: cmdebug
! 	${INSTALL} -s $? $@
  
  ${DESTDIR}${sbindir}/kdump: kdump-build
  	-set -x; \
--- 328,349 ----
  include ../config/Makefile.version
  
  ${DESTDIR}${bindir}/fs: fs
! 	${INSTALL} $? $@
  
  ${DESTDIR}${bindir}/livesys: livesys
! 	${INSTALL} $? $@
  
  ${DESTDIR}${afssrvbindir}/fs: fs
! 	${INSTALL} $? $@
  
  ${DESTDIR}${bindir}/up: up
! 	${INSTALL} $? $@
  
  ${DESTDIR}${sbindir}/fstrace: fstrace
! 	${INSTALL} $? $@
  
  ${DESTDIR}${bindir}/cmdebug: cmdebug
! 	${INSTALL} $? $@
  
  ${DESTDIR}${sbindir}/kdump: kdump-build
  	-set -x; \
***************
*** 354,377 ****
  		ln -fs kdump.IP20 ${DESTDIR}${sbindir}/kdump.IP22; \
  		ln -fs kdump.IP20 ${DESTDIR}${sbindir}/kdump.IP32; \
  		for f in kdump.IP??; \
! 			do ${INSTALL} -s $$f ${DESTDIR}${sbindir}/$$f || exit $$? ; \
  		done ;; \
  	sun*_5[789] | sun*_510 ) \
  		${INSTALLex} -f kdump.sh.solaris7 ${DESTDIR}${sbindir}/kdump32; \
! 		${INSTALL} -s -f $? $@;; \
  	*linux* ) \
  		${INSTALLex} -f kdump.sh.linux ${DESTDIR}${sbindir}/kdump; \
! 		${INSTALL} -s $? $@ ;; \
  	hp_ux11* ) \
  		${INSTALLex} -f kdump.sh.hp_ux11 ${DESTDIR}${sbindir}/kdump; \
! 		${INSTALL} -s -f $? $@;; \
  	*) \
! 		${INSTALL} -s $? $@ ;; \
  	esac
  
  ${DESTDIR}${sbindir}/kdump64: kdump-build
  	if [ -f kdump64 ]; then \
! 		${INSTALL} -s kdump64 $@; \
  	fi
  
  dest: \
--- 354,377 ----
  		ln -fs kdump.IP20 ${DESTDIR}${sbindir}/kdump.IP22; \
  		ln -fs kdump.IP20 ${DESTDIR}${sbindir}/kdump.IP32; \
  		for f in kdump.IP??; \
! 			do ${INSTALL} $$f ${DESTDIR}${sbindir}/$$f || exit $$? ; \
  		done ;; \
  	sun*_5[789] | sun*_510 ) \
  		${INSTALLex} -f kdump.sh.solaris7 ${DESTDIR}${sbindir}/kdump32; \
! 		${INSTALL} -f $? $@;; \
  	*linux* ) \
  		${INSTALLex} -f kdump.sh.linux ${DESTDIR}${sbindir}/kdump; \
! 		${INSTALL} $? $@ ;; \
  	hp_ux11* ) \
  		${INSTALLex} -f kdump.sh.hp_ux11 ${DESTDIR}${sbindir}/kdump; \
! 		${INSTALL} -f $? $@;; \
  	*) \
! 		${INSTALL} $? $@ ;; \
  	esac
  
  ${DESTDIR}${sbindir}/kdump64: kdump-build
  	if [ -f kdump64 ]; then \
! 		${INSTALL} kdump64 $@; \
  	fi
  
  dest: \
Index: openafs/src/venus/cacheout.c
diff -c openafs/src/venus/cacheout.c:1.8 openafs/src/venus/cacheout.c:1.8.2.1
*** openafs/src/venus/cacheout.c:1.8	Tue Jul 15 19:17:19 2003
--- openafs/src/venus/cacheout.c	Wed Oct 31 00:13:49 2007
***************
*** 13,19 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/venus/cacheout.c,v 1.8 2003/07/15 23:17:19 shadow Exp $");
  
  #include <stdio.h>
  #include <string.h>
--- 13,19 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/venus/cacheout.c,v 1.8.2.1 2007/10/31 04:13:49 shadow Exp $");
  
  #include <stdio.h>
  #include <string.h>
***************
*** 63,71 ****
  
  extern int VL_GetAddrs();
  
! afs_int32
! InvalidateCache(as)
!      struct cmd_syndesc *as;
  {
      afs_int32 code = 0;
      struct cmd_item *u;
--- 63,70 ----
  
  extern int VL_GetAddrs();
  
! static int
! InvalidateCache(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code = 0;
      struct cmd_item *u;
***************
*** 212,221 ****
      return code;
  }
  
! afs_int32
! GetServerList()
  {
!     afs_int32 code;
      int i;
  
      code = ListServers();
--- 211,220 ----
      return code;
  }
  
! static int
! GetServerList(struct cmd_syndesc *as, void *arock)
  {
!     int code;
      int i;
  
      code = ListServers();
***************
*** 240,249 ****
  Command is executed in user's cell.
  */
  
! static
! MyBeforeProc(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
  {
      register char *tcell = NULL;
      char confdir[200];
--- 239,246 ----
  Command is executed in user's cell.
  */
  
! static int
! MyBeforeProc(struct cmd_syndesc *as, void *arock)
  {
      register char *tcell = NULL;
      char confdir[200];
***************
*** 308,320 ****
      cmd_SetBeforeProc(MyBeforeProc, NULL);
  
      ts = cmd_CreateSyntax("initcmd" /*"invalidatecache" */ , InvalidateCache,
! 			  0, "invalidate server ACL cache");
      cmd_AddParm(ts, "-id", CMD_LIST, CMD_OPTIONAL, "user identifier");
      cmd_AddParm(ts, "-ip", CMD_LIST, CMD_OPTIONAL, "IP address");
      cmd_CreateAlias(ts, "ic");
      cmd_AddParm(ts, "-cell", CMD_SINGLE, CMD_OPTIONAL, "cell name");
  
!     ts = cmd_CreateSyntax("listservers", GetServerList, 0,
  			  "list servers in the cell");
      cmd_CreateAlias(ts, "ls");
  
--- 305,317 ----
      cmd_SetBeforeProc(MyBeforeProc, NULL);
  
      ts = cmd_CreateSyntax("initcmd" /*"invalidatecache" */ , InvalidateCache,
! 			  NULL, "invalidate server ACL cache");
      cmd_AddParm(ts, "-id", CMD_LIST, CMD_OPTIONAL, "user identifier");
      cmd_AddParm(ts, "-ip", CMD_LIST, CMD_OPTIONAL, "IP address");
      cmd_CreateAlias(ts, "ic");
      cmd_AddParm(ts, "-cell", CMD_SINGLE, CMD_OPTIONAL, "cell name");
  
!     ts = cmd_CreateSyntax("listservers", GetServerList, NULL,
  			  "list servers in the cell");
      cmd_CreateAlias(ts, "ls");
  
Index: openafs/src/venus/cmdebug.c
diff -c openafs/src/venus/cmdebug.c:1.15.2.6 openafs/src/venus/cmdebug.c:1.15.2.11
*** openafs/src/venus/cmdebug.c:1.15.2.6	Tue Apr 10 14:43:46 2007
--- openafs/src/venus/cmdebug.c	Fri Mar  7 20:15:36 2008
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/venus/cmdebug.c,v 1.15.2.6 2007/04/10 18:43:46 shadow Exp $");
  
  
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/venus/cmdebug.c,v 1.15.2.11 2008/03/08 01:15:36 shadow Exp $");
  
  
  #include <sys/types.h>
***************
*** 26,38 ****
  #include <netdb.h>
  #endif
  #include <stdio.h>
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #ifdef	AFS_AIX32_ENV
  #include <signal.h>
  #endif
--- 26,32 ----
***************
*** 42,50 ****
--- 36,47 ----
  #include <lock.h>
  #include <afs/afs_args.h>
  #include <afs/afsutil.h>
+ #include <afs/com_err.h>
  
  extern struct hostent *hostutil_GetHostByName();
  
+ static int print_ctime = 0;
+ 
  static int
  PrintCacheConfig(struct rx_connection *aconn)
  {
***************
*** 85,90 ****
--- 82,88 ----
      } else {
  	printf("cmdebug: unsupported server version %d\n", srv_ver);
      }
+     return 0;
  }
  
  #ifndef CAPABILITY_BITS
***************
*** 309,316 ****
  	}
  	printf("    %12d bytes  DV %12d  refcnt %5d\n", centry.Length,
  	       centry.DataVersion, centry.refCount);
! 	printf("    callback %08x\texpires %u\n", centry.callback,
! 	       centry.cbExpires);
  	printf("    %d opens\t%d writers\n", centry.opens, centry.writers);
  
  	/* now display states */
--- 307,319 ----
  	}
  	printf("    %12d bytes  DV %12d  refcnt %5d\n", centry.Length,
  	       centry.DataVersion, centry.refCount);
!         if (print_ctime) {
!             time_t t = centry.cbExpires;
!             printf("    callback %08x\texpires %s\n", centry.callback,
!                     ctime(&t));
!         } else
!             printf("    callback %08x\texpires %u\n", centry.callback,
!                    centry.cbExpires);
  	printf("    %d opens\t%d writers\n", centry.opens, centry.writers);
  
  	/* now display states */
***************
*** 411,418 ****
  	printf("    %12d bytes  DV %12d  refcnt %5d\n", centry.Length,
  	       centry.DataVersion, centry.refCount);
  #endif
! 	printf("    callback %08x\texpires %u\n", centry.callback,
! 	       centry.cbExpires);
  	printf("    %d opens\t%d writers\n", centry.opens, centry.writers);
  
  	/* now display states */
--- 414,426 ----
  	printf("    %12d bytes  DV %12d  refcnt %5d\n", centry.Length,
  	       centry.DataVersion, centry.refCount);
  #endif
!         if (print_ctime) {
!             time_t t = centry.cbExpires;
!             printf("    callback %08x\texpires %s\n", centry.callback,
!                     ctime(&t));
!         } else
!             printf("    callback %08x\texpires %u\n", centry.callback,
!                    centry.cbExpires);
  	printf("    %d opens\t%d writers\n", centry.opens, centry.writers);
  
  	/* now display states */
***************
*** 466,473 ****
  	return PrintCacheEntries32(aconn, aint32);
  }
  
  int
! CommandProc(struct cmd_syndesc *as, char *arock)
  {
      struct rx_connection *conn;
      register char *hostName;
--- 474,533 ----
  	return PrintCacheEntries32(aconn, aint32);
  }
  
+ static int
+ PrintCellServDBEntry(struct rx_connection *aconn, afs_int32 cellnum)
+ {
+     static struct cell_cache *cache;
+     int code;
+     char *cellname;
+     serverList sl;
+     unsigned int n;
+     int rc = 0;
+ 
+     cellname = NULL;
+     sl.serverList_len = 0;
+     sl.serverList_val = NULL;
+     code = RXAFSCB_GetCellServDB(aconn, cellnum, &cellname, &sl);
+     if (code)
+ 	return 0;
+ 
+     if ( !cellname || !cellname[0] )
+         goto done;
+ 
+     rc = 1;
+     printf(">%-23s#%s\n", cellname, cellname);
+ 
+     if (sl.serverList_val) {
+         for ( n=0; n<sl.serverList_len; n++) {
+             struct hostent *host;
+             afs_uint32      addr = ntohl(sl.serverList_val[n]);
+ 
+             host = gethostbyaddr((const char *)&addr, sizeof(afs_uint32), AF_INET);
+             printf("%-28s#%s\n", afs_inet_ntoa(addr), 
+                     host ? host->h_name : "");
+         }
+     }
+ 
+   done:
+     if (cellname)
+         free(cellname);
+ 
+     if (sl.serverList_val)
+ 	free(sl.serverList_val);
+ 
+     return rc;
+ }
+ 
+ static void
+ PrintCellServDB(struct rx_connection *aconn) 
+ {
+     afs_int32 index;
+ 
+     for ( index = 0 ; PrintCellServDBEntry(aconn, index); index++ );
+ }
+ 
  int
! CommandProc(struct cmd_syndesc *as, void *arock)
  {
      struct rx_connection *conn;
      register char *hostName;
***************
*** 495,510 ****
  	       hostName);
  	exit(1);
      }
!     if (as->parms[5].items) {
  	/* -addrs */
  	PrintInterfaces(conn);
  	return 0;
      }
!     if (as->parms[6].items) {
  	/* -cache */
  	PrintCacheConfig(conn);
  	return 0;
      }
      if (as->parms[2].items)
          /* -long */
  	int32p = 1;
--- 555,581 ----
  	       hostName);
  	exit(1);
      }
! 
!     if (as->parms[6].items) {
  	/* -addrs */
  	PrintInterfaces(conn);
  	return 0;
      }
!     if (as->parms[7].items) {
  	/* -cache */
  	PrintCacheConfig(conn);
  	return 0;
      }
+ 
+     if (as->parms[8].items) {
+ 	/* -cellservdb */
+ 	PrintCellServDB(conn);
+ 	return 0;
+     }
+ 
+     if (as->parms[5].items)
+         print_ctime = 1;
+ 
      if (as->parms[2].items)
          /* -long */
  	int32p = 1;
***************
*** 557,563 ****
  
      rx_Init(0);
  
!     ts = cmd_CreateSyntax(NULL, CommandProc, 0, "probe unik server");
      cmd_AddParm(ts, "-servers", CMD_SINGLE, CMD_REQUIRED, "server machine");
      cmd_AddParm(ts, "-port", CMD_SINGLE, CMD_OPTIONAL, "IP port");
      cmd_AddParm(ts, "-long", CMD_FLAG, CMD_OPTIONAL, "print all info");
--- 628,634 ----
  
      rx_Init(0);
  
!     ts = cmd_CreateSyntax(NULL, CommandProc, NULL, "query afs cache manager");
      cmd_AddParm(ts, "-servers", CMD_SINGLE, CMD_REQUIRED, "server machine");
      cmd_AddParm(ts, "-port", CMD_SINGLE, CMD_OPTIONAL, "IP port");
      cmd_AddParm(ts, "-long", CMD_FLAG, CMD_OPTIONAL, "print all info");
***************
*** 565,574 ****
--- 636,651 ----
                   "print only cache entries with positive reference counts");
      cmd_AddParm(ts, "-callbacks", CMD_FLAG, CMD_OPTIONAL, 
                   "print only cache entries with callbacks");
+     cmd_AddParm(ts, "-ctime", CMD_FLAG, CMD_OPTIONAL, 
+                 "print human readable expiration time");
+ 
+     
      cmd_AddParm(ts, "-addrs", CMD_FLAG, CMD_OPTIONAL,
  		"print only host interfaces");
      cmd_AddParm(ts, "-cache", CMD_FLAG, CMD_OPTIONAL,
  		"print only cache configuration");
+     cmd_AddParm(ts, "-cellservdb", CMD_FLAG, CMD_OPTIONAL, 
+                 "print only cellservdb info");
  
      cmd_Dispatch(argc, argv);
      exit(0);
Index: openafs/src/venus/fs.c
diff -c openafs/src/venus/fs.c:1.24.2.8 openafs/src/venus/fs.c:1.24.2.12
*** openafs/src/venus/fs.c:1.24.2.8	Tue Oct 16 13:20:09 2007
--- openafs/src/venus/fs.c	Fri Mar  7 20:15:36 2008
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/venus/fs.c,v 1.24.2.8 2007/10/16 17:20:09 jaltman Exp $");
  
  #include <afs/afs_args.h>
  #include <rx/xdr.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/venus/fs.c,v 1.24.2.12 2008/03/08 01:15:36 shadow Exp $");
  
  #include <afs/afs_args.h>
  #include <rx/xdr.h>
***************
*** 25,41 ****
  #include <afs/stds.h>
  #include <afs/vice.h>
  #include <afs/venus.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
  
  #undef VIRTUE
  #undef VICE
--- 25,36 ----
  #include <afs/stds.h>
  #include <afs/vice.h>
  #include <afs/venus.h>
+ #include <afs/com_err.h>
  #ifdef	AFS_AIX32_ENV
  #include <signal.h>
  #endif
  
  #include <string.h>
  
  #undef VIRTUE
  #undef VICE
***************
*** 75,88 ****
  extern struct hostent *hostutil_GetHostByName();
  
  
- extern struct cmd_syndesc *cmd_CreateSyntax();
  static char pn[] = "fs";
  static int rxInitDone = 0;
  
  static void ZapList();
  static int PruneList();
  static CleanAcl();
! static SetVolCmd();
  static GetCellName();
  static VLDBInit();
  static void Die();
--- 70,82 ----
  extern struct hostent *hostutil_GetHostByName();
  
  
  static char pn[] = "fs";
  static int rxInitDone = 0;
  
  static void ZapList();
  static int PruneList();
  static CleanAcl();
! static int SetVolCmd(struct cmd_syndesc *as, void *arock);
  static GetCellName();
  static VLDBInit();
  static void Die();
***************
*** 286,291 ****
--- 280,286 ----
  	if (arights & DFS_USR7)
  	    printf("H");
      }
+     return 0;
  }
  
  /* this function returns TRUE (1) if the file is in AFS, otherwise false (0) */
***************
*** 731,737 ****
  }
  
  static int
! SetACLCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 726,732 ----
  }
  
  static int
! SetACLCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 865,871 ****
  
  
  static int
! CopyACLCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 860,866 ----
  
  
  static int
! CopyACLCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 1045,1051 ****
  
  /* 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;
--- 1040,1046 ----
  
  /* 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;
***************
*** 1132,1138 ****
  }
  
  static int
! ListACLCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct Acl *ta;
--- 1127,1133 ----
  }
  
  static int
! ListACLCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct Acl *ta;
***************
*** 1196,1202 ****
  }
  
  static int
! GetCallerAccess(struct cmd_syndesc *as, char *arock)
  {
      struct cmd_item *ti;
      int error = 0;
--- 1191,1197 ----
  }
  
  static int
! GetCallerAccess(struct cmd_syndesc *as, void *arock)
  {
      struct cmd_item *ti;
      int error = 0;
***************
*** 1223,1229 ****
  }
  
  static int
! FlushVolumeCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 1218,1224 ----
  }
  
  static int
! FlushVolumeCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 1251,1257 ****
   * CMD_OPTIONAL in the cmd_AddParam(-generate) call 
   */
  static int
! UuidCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 1246,1252 ----
   * CMD_OPTIONAL in the cmd_AddParam(-generate) call 
   */
  static int
! UuidCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 1282,1288 ****
  }
  
  static int
! FlushCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 1277,1283 ----
  }
  
  static int
! FlushCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 1309,1325 ****
  
  /* 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 */
      memcpy(&ts, as, sizeof(ts));	/* copy whole thing */
!     return SetVolCmd(&ts);
  }
  
  static int
! SetVolCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 1304,1320 ----
  
  /* 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 */
      memcpy(&ts, as, sizeof(ts));	/* copy whole thing */
!     return SetVolCmd(&ts, arock);
  }
  
  static int
! SetVolCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 1383,1389 ****
  };
  
  static int
! ExamineCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 1378,1384 ----
  };
  
  static int
! ExamineCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 1424,1430 ****
  }
  
  static int
! ListQuotaCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 1419,1425 ----
  }
  
  static int
! ListQuotaCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 1455,1461 ****
  }
  
  static int
! WhereIsCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 1450,1456 ----
  }
  
  static int
! WhereIsCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 1494,1500 ****
  
  
  static int
! DiskFreeCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 1489,1495 ----
  
  
  static int
! DiskFreeCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 1525,1531 ****
  }
  
  static int
! QuotaCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 1520,1526 ----
  }
  
  static int
! QuotaCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 1558,1564 ****
  }
  
  static int
! ListMountCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 1553,1559 ----
  }
  
  static int
! ListMountCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 1678,1685 ****
      return error;
  }
  
! static
! MakeMountCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      char *cellName, *volName, *tmpName;
--- 1673,1680 ----
      return error;
  }
  
! static int
! MakeMountCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      char *cellName, *volName, *tmpName;
***************
*** 1787,1793 ****
   *      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;
--- 1782,1788 ----
   *      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;
***************
*** 1839,1845 ****
  */
  
  static int
! CheckServersCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 1834,1840 ----
  */
  
  static int
! CheckServersCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 1938,1944 ****
  }
  
  static int
! MessagesCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code = 0;
      struct ViceIoctl blob;
--- 1933,1939 ----
  }
  
  static int
! MessagesCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code = 0;
      struct ViceIoctl blob;
***************
*** 1984,1990 ****
  }
  
  static int
! CheckVolumesCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 1979,1985 ----
  }
  
  static int
! CheckVolumesCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 2002,2008 ****
  }
  
  static int
! SetCacheSizeCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 1997,2003 ----
  }
  
  static int
! SetCacheSizeCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 2041,2047 ****
  
  #define MAXGCSIZE	16
  static int
! GetCacheParmsCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 2036,2042 ----
  
  #define MAXGCSIZE	16
  static int
! GetCacheParmsCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 2066,2072 ****
  }
  
  static int
! ListCellsCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      afs_int32 i, j;
--- 2061,2067 ----
  }
  
  static int
! ListCellsCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      afs_int32 i, j;
***************
*** 2117,2123 ****
  }
  
  static int
! ListAliasesCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code, i;
      char *tp, *aliasName, *realName;
--- 2112,2118 ----
  }
  
  static int
! ListAliasesCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code, i;
      char *tp, *aliasName, *realName;
***************
*** 2147,2153 ****
  }
  
  static int
! CallBackRxConnCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 2142,2148 ----
  }
  
  static int
! CallBackRxConnCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 2186,2192 ****
  }
  
  static int
! NewCellCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code, linkedstate = 0, size = 0, *lp;
      struct ViceIoctl blob;
--- 2181,2187 ----
  }
  
  static int
! NewCellCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code, linkedstate = 0, size = 0, *lp;
      struct ViceIoctl blob;
***************
*** 2298,2304 ****
  }
  
  static int
! NewAliasCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 2293,2299 ----
  }
  
  static int
! NewAliasCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 2333,2339 ****
  }
  
  static int
! WhichCellCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct cmd_item *ti;
--- 2328,2334 ----
  }
  
  static int
! WhichCellCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct cmd_item *ti;
***************
*** 2358,2364 ****
  }
  
  static int
! WSCellCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 2353,2359 ----
  }
  
  static int
! WSCellCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 2388,2394 ****
  */
  
  static int
! MonitorCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 2383,2389 ----
  */
  
  static int
! MonitorCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 2449,2455 ****
  }
  
  static int
! SysNameCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 2444,2450 ----
  }
  
  static int
! SysNameCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 2503,2509 ****
  
  static char *exported_types[] = { "null", "nfs", "" };
  static int
! ExportAfsCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 2498,2504 ----
  
  static char *exported_types[] = { "null", "nfs", "" };
  static int
! ExportAfsCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 2602,2608 ****
  
  
  static int
! GetCellCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 2597,2603 ----
  
  
  static int
! GetCellCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 2653,2659 ****
  }
  
  static int
! SetCellCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 2648,2654 ----
  }
  
  static int
! SetCellCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 2837,2843 ****
  
  
  static int
! SetPrefCmd(struct cmd_syndesc *as, char *arock)
  {
      FILE *infd;
      afs_int32 code;
--- 2832,2838 ----
  
  
  static int
! SetPrefCmd(struct cmd_syndesc *as, void *arock)
  {
      FILE *infd;
      afs_int32 code;
***************
*** 2943,2949 ****
  
  
  static int
! GetPrefCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct cmd_item *ti;
--- 2938,2944 ----
  
  
  static int
! GetPrefCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct cmd_item *ti;
***************
*** 3013,3019 ****
  }
  
  static int
! StoreBehindCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code = 0;
      struct ViceIoctl blob;
--- 3008,3014 ----
  }
  
  static int
! StoreBehindCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code = 0;
      struct ViceIoctl blob;
***************
*** 3113,3120 ****
  }
  
  
! static afs_int32
! SetCryptCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code = 0, flag;
      struct ViceIoctl blob;
--- 3108,3115 ----
  }
  
  
! static int
! SetCryptCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code = 0, flag;
      struct ViceIoctl blob;
***************
*** 3140,3147 ****
  }
  
  
! static afs_int32
! GetCryptCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code = 0, flag;
      struct ViceIoctl blob;
--- 3135,3142 ----
  }
  
  
! static int
! GetCryptCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code = 0, flag;
      struct ViceIoctl blob;
***************
*** 3192,3208 ****
  #endif
  
      /* try to find volume location information */
!     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");
  
!     ts = cmd_CreateSyntax("setserverprefs", SetPrefCmd, 0,
  			  "set server ranks");
      cmd_AddParm(ts, "-servers", CMD_LIST, CMD_OPTIONAL | CMD_EXPANDS,
  		"fileserver names and ranks");
--- 3187,3203 ----
  #endif
  
      /* try to find volume location information */
!     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");
  
!     ts = cmd_CreateSyntax("setserverprefs", SetPrefCmd, NULL,
  			  "set server ranks");
      cmd_AddParm(ts, "-servers", CMD_LIST, CMD_OPTIONAL | CMD_EXPANDS,
  		"fileserver names and ranks");
***************
*** 3213,3219 ****
      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");
--- 3208,3214 ----
      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");
***************
*** 3222,3228 ****
  /*    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");
--- 3217,3223 ----
  /*    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");
***************
*** 3235,3241 ****
  		"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;
--- 3230,3236 ----
  		"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;
***************
*** 3243,3258 ****
      cmd_AddParm(ts, "-if", CMD_FLAG, CMD_OPTIONAL, "initial file acl");
      cmd_CreateAlias(ts, "la");
  
!     ts = cmd_CreateSyntax("getcalleraccess", GetCallerAccess, 0,
              "list callers access");
      cmd_AddParm(ts, "-path", CMD_LIST, CMD_OPTIONAL, "dir/file path");
      cmd_CreateAlias(ts, "gca");
  
!     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)");
--- 3238,3253 ----
      cmd_AddParm(ts, "-if", CMD_FLAG, CMD_OPTIONAL, "initial file acl");
      cmd_CreateAlias(ts, "la");
  
!     ts = cmd_CreateSyntax("getcalleraccess", GetCallerAccess, NULL,
              "list callers access");
      cmd_AddParm(ts, "-path", CMD_LIST, CMD_OPTIONAL, "dir/file path");
      cmd_CreateAlias(ts, "gca");
  
!     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)");
***************
*** 3266,3278 ****
  
      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");
!     ts = cmd_CreateSyntax("flushmount", FlushMountCmd, 0,
  			  "flush mount symlink from cache");
      cmd_AddParm(ts, "-path", CMD_LIST, CMD_OPTIONAL, "dir/file path");
  
!     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");
--- 3261,3273 ----
  
      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");
!     ts = cmd_CreateSyntax("flushmount", FlushMountCmd, NULL,
  			  "flush mount symlink from cache");
      cmd_AddParm(ts, "-path", CMD_LIST, CMD_OPTIONAL, "dir/file path");
  
!     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");
***************
*** 3285,3316 ****
  		"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");
--- 3280,3311 ----
  		"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");
***************
*** 3326,3335 ****
  */
  
  
!     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");
--- 3321,3330 ----
  */
  
  
!     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");
***************
*** 3338,3349 ****
      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)");
--- 3333,3344 ----
      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)");
***************
*** 3370,3382 ****
  #endif
      cmd_CreateAlias(ts, "sq");
  
!     ts = cmd_CreateSyntax("newcell", NewCellCmd, 0, "configure new cell");
      cmd_AddParm(ts, "-name", CMD_SINGLE, 0, "cell name");
      cmd_AddParm(ts, "-servers", CMD_LIST, CMD_REQUIRED, "primary servers");
      cmd_AddParm(ts, "-linkedcell", CMD_SINGLE, CMD_OPTIONAL,
  		"linked cell name");
  
!     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");
--- 3365,3377 ----
  #endif
      cmd_CreateAlias(ts, "sq");
  
!     ts = cmd_CreateSyntax("newcell", NewCellCmd, NULL, "configure new cell");
      cmd_AddParm(ts, "-name", CMD_SINGLE, 0, "cell name");
      cmd_AddParm(ts, "-servers", CMD_LIST, CMD_REQUIRED, "primary servers");
      cmd_AddParm(ts, "-linkedcell", CMD_SINGLE, CMD_OPTIONAL,
  		"linked cell name");
  
!     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");
***************
*** 3394,3435 ****
  		"cell's vldb server port");
  #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)");
  */
  
      /* set cache monitor host address */
!     ts = cmd_CreateSyntax("monitor", MonitorCmd, 0, (char *)CMD_HIDDEN);
      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("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,
--- 3389,3430 ----
  		"cell's vldb server port");
  #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, NULL, "obsolete (listed primary cell)");
  */
  
      /* set cache monitor host address */
!     ts = cmd_CreateSyntax("monitor", MonitorCmd, NULL, (char *)CMD_HIDDEN);
      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("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,
***************
*** 3442,3448 ****
  		"allow nfs mounts to subdirs of /afs/.. (on  | off)");
  
  
!     ts = cmd_CreateSyntax("storebehind", StoreBehindCmd, 0,
  			  "store to server after file close");
      cmd_AddParm(ts, "-kbytes", CMD_SINGLE, CMD_OPTIONAL,
  		"asynchrony for specified names");
--- 3437,3443 ----
  		"allow nfs mounts to subdirs of /afs/.. (on  | off)");
  
  
!     ts = cmd_CreateSyntax("storebehind", StoreBehindCmd, NULL,
  			  "store to server after file close");
      cmd_AddParm(ts, "-kbytes", CMD_SINGLE, CMD_OPTIONAL,
  		"asynchrony for specified names");
***************
*** 3534,3540 ****
  
  /* get clients interface addresses */
  static int
! GetClientAddrsCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct cmd_item *ti;
--- 3529,3535 ----
  
  /* get clients interface addresses */
  static int
! GetClientAddrsCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct cmd_item *ti;
***************
*** 3580,3586 ****
  }
  
  static int
! SetClientAddrsCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code, addr;
      struct cmd_item *ti;
--- 3575,3581 ----
  }
  
  static int
! SetClientAddrsCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code, addr;
      struct cmd_item *ti;
***************
*** 3654,3660 ****
  }
  
  static int
! FlushMountCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 3649,3655 ----
  }
  
  static int
! FlushMountCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 3770,3776 ****
  }
  
  static int
! RxStatProcCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      afs_int32 flags = 0;
--- 3765,3771 ----
  }
  
  static int
! RxStatProcCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      afs_int32 flags = 0;
***************
*** 3805,3811 ****
  }
  
  static int
! RxStatPeerCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      afs_int32 flags = 0;
--- 3800,3806 ----
  }
  
  static int
! RxStatPeerCmd(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      afs_int32 flags = 0;
***************
*** 3840,3846 ****
  }
  
  static int
! GetFidCmd(struct cmd_syndesc *as, char *arock)
  {
      struct ViceIoctl blob;
      struct cmd_item *ti;
--- 3835,3841 ----
  }
  
  static int
! GetFidCmd(struct cmd_syndesc *as, void *arock)
  {
      struct ViceIoctl blob;
      struct cmd_item *ti;
Index: openafs/src/venus/fstrace.c
diff -c openafs/src/venus/fstrace.c:1.16.2.5 openafs/src/venus/fstrace.c:1.16.2.8
*** openafs/src/venus/fstrace.c:1.16.2.5	Wed Oct  5 01:58:48 2005
--- openafs/src/venus/fstrace.c	Mon Nov 26 16:21:56 2007
***************
*** 14,20 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/venus/fstrace.c,v 1.16.2.5 2005/10/05 05:58:48 shadow Exp $");
  
  #include <stdio.h>
  #include <sys/types.h>
--- 14,20 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/venus/fstrace.c,v 1.16.2.8 2007/11/26 21:21:56 shadow Exp $");
  
  #include <stdio.h>
  #include <sys/types.h>
***************
*** 27,39 ****
  #undef abs
  #include <stdlib.h>
  
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  
  #include <afs/stds.h>
  #include <afs/cmd.h>
--- 27,33 ----
***************
*** 87,92 ****
--- 81,87 ----
  } *allInfo = 0;
  
  char dumpFileName[256] = "";
+ void
  RegisterIclDumpFileName(name)
       char *name;
  {
***************
*** 258,264 ****
  #if defined(AFS_SGI61_ENV) && !defined(AFS_SGI62_ENV)
  #define uint64_t long long
  #endif
! static
  DisplayRecord(outFilep, alp, rsize)
       FILE *outFilep;
       register afs_int32 *alp;
--- 253,259 ----
  #if defined(AFS_SGI61_ENV) && !defined(AFS_SGI62_ENV)
  #define uint64_t long long
  #endif
! static void
  DisplayRecord(outFilep, alp, rsize)
       FILE *outFilep;
       register afs_int32 *alp;
***************
*** 2709,2718 ****
  }
  
  
! static
! DoDump(as, arock)
!      register struct cmd_syndesc *as;
!      char *arock;
  {
      afs_int32 code = 0;
      afs_int32 tcode;
--- 2704,2711 ----
  }
  
  
! static int
! DoDump(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code = 0;
      afs_int32 tcode;
***************
*** 2788,2794 ****
      struct cmd_syndesc *dumpSyntax;
  
      dumpSyntax =
! 	cmd_CreateSyntax("dump", DoDump, (char *)NULL, "dump AFS trace logs");
      (void)cmd_AddParm(dumpSyntax, "-set", CMD_LIST, CMD_OPTIONAL, "set_name");
      (void)cmd_AddParm(dumpSyntax, "-follow", CMD_SINGLE, CMD_OPTIONAL,
  		      "log_name");
--- 2781,2787 ----
      struct cmd_syndesc *dumpSyntax;
  
      dumpSyntax =
! 	cmd_CreateSyntax("dump", DoDump, NULL, "dump AFS trace logs");
      (void)cmd_AddParm(dumpSyntax, "-set", CMD_LIST, CMD_OPTIONAL, "set_name");
      (void)cmd_AddParm(dumpSyntax, "-follow", CMD_SINGLE, CMD_OPTIONAL,
  		      "log_name");
***************
*** 2798,2807 ****
  		      "seconds_between_reads");
  }
  
! static
! DoShowLog(as, arock)
!      register struct cmd_syndesc *as;
!      char *arock;
  {
      afs_int32 retVal = 0;
      afs_int32 code = 0;
--- 2791,2798 ----
  		      "seconds_between_reads");
  }
  
! static int
! DoShowLog(register struct cmd_syndesc *as, void *arock)
  {
      afs_int32 retVal = 0;
      afs_int32 code = 0;
***************
*** 2864,2880 ****
      struct cmd_syndesc *showSyntax;
  
      showSyntax =
! 	cmd_CreateSyntax("lslog", DoShowLog, (char *)NULL,
  			 "list available logs");
      (void)cmd_AddParm(showSyntax, "-set", CMD_LIST, CMD_OPTIONAL, "set_name");
      (void)cmd_AddParm(showSyntax, "-log", CMD_LIST, CMD_OPTIONAL, "log_name");
      (void)cmd_AddParm(showSyntax, "-long", CMD_FLAG, CMD_OPTIONAL, "");
  }
  
! static
! DoShowSet(as, arock)
!      register struct cmd_syndesc *as;
!      char *arock;
  {
      afs_int32 retVal = 0;
      afs_int32 code = 0;
--- 2855,2869 ----
      struct cmd_syndesc *showSyntax;
  
      showSyntax =
! 	cmd_CreateSyntax("lslog", DoShowLog, NULL,
  			 "list available logs");
      (void)cmd_AddParm(showSyntax, "-set", CMD_LIST, CMD_OPTIONAL, "set_name");
      (void)cmd_AddParm(showSyntax, "-log", CMD_LIST, CMD_OPTIONAL, "log_name");
      (void)cmd_AddParm(showSyntax, "-long", CMD_FLAG, CMD_OPTIONAL, "");
  }
  
! static int
! DoShowSet(register struct cmd_syndesc *as, void *arock)
  {
      afs_int32 retVal = 0;
      afs_int32 code = 0;
***************
*** 2922,2936 ****
      struct cmd_syndesc *showSyntax;
  
      showSyntax =
! 	cmd_CreateSyntax("lsset", DoShowSet, (char *)NULL,
  			 "list available event sets");
      (void)cmd_AddParm(showSyntax, "-set", CMD_LIST, CMD_OPTIONAL, "set_name");
  }
  
! static
! DoClear(as, arock)
!      register struct cmd_syndesc *as;
!      char *arock;
  {
      afs_int32 retVal = 0;
      afs_int32 code = 0;
--- 2911,2923 ----
      struct cmd_syndesc *showSyntax;
  
      showSyntax =
! 	cmd_CreateSyntax("lsset", DoShowSet, NULL,
  			 "list available event sets");
      (void)cmd_AddParm(showSyntax, "-set", CMD_LIST, CMD_OPTIONAL, "set_name");
  }
  
! static int
! DoClear(register struct cmd_syndesc *as, void *arock)
  {
      afs_int32 retVal = 0;
      afs_int32 code = 0;
***************
*** 2981,2987 ****
      struct cmd_syndesc *clearSyntax;
  
      clearSyntax =
! 	cmd_CreateSyntax("clear", DoClear, (char *)NULL,
  			 "clear logs by logname or by event set");
      (void)cmd_AddParm(clearSyntax, "-set", CMD_LIST, CMD_OPTIONAL,
  		      "set_name");
--- 2968,2974 ----
      struct cmd_syndesc *clearSyntax;
  
      clearSyntax =
! 	cmd_CreateSyntax("clear", DoClear, NULL,
  			 "clear logs by logname or by event set");
      (void)cmd_AddParm(clearSyntax, "-set", CMD_LIST, CMD_OPTIONAL,
  		      "set_name");
***************
*** 2989,2998 ****
  		      "log_name");
  }
  
! static
! DoSet(as, arock)
!      register struct cmd_syndesc *as;
!      char *arock;
  {
      afs_int32 retVal = 0;
      afs_int32 code = 0;
--- 2976,2983 ----
  		      "log_name");
  }
  
! static int
! DoSet(register struct cmd_syndesc *as, void *arock)
  {
      afs_int32 retVal = 0;
      afs_int32 code = 0;
***************
*** 3070,3076 ****
      struct cmd_syndesc *setSyntax;
  
      setSyntax =
! 	cmd_CreateSyntax("setset", DoSet, (char *)NULL,
  			 "set state of event sets");
      (void)cmd_AddParm(setSyntax, "-set", CMD_LIST, CMD_OPTIONAL, "set_name");
      (void)cmd_AddParm(setSyntax, "-active", CMD_FLAG, CMD_OPTIONAL, "");
--- 3055,3061 ----
      struct cmd_syndesc *setSyntax;
  
      setSyntax =
! 	cmd_CreateSyntax("setset", DoSet, NULL,
  			 "set state of event sets");
      (void)cmd_AddParm(setSyntax, "-set", CMD_LIST, CMD_OPTIONAL, "set_name");
      (void)cmd_AddParm(setSyntax, "-active", CMD_FLAG, CMD_OPTIONAL, "");
***************
*** 3078,3087 ****
      (void)cmd_AddParm(setSyntax, "-dormant", CMD_FLAG, CMD_OPTIONAL, "");
  }
  
! static
! DoResize(as, arock)
!      register struct cmd_syndesc *as;
!      char *arock;
  {
      afs_int32 retVal = 0;
      afs_int32 code = 0;
--- 3063,3070 ----
      (void)cmd_AddParm(setSyntax, "-dormant", CMD_FLAG, CMD_OPTIONAL, "");
  }
  
! static int
! DoResize(register struct cmd_syndesc *as, void *arock)
  {
      afs_int32 retVal = 0;
      afs_int32 code = 0;
***************
*** 3129,3135 ****
      struct cmd_syndesc *setsizeSyntax;
  
      setsizeSyntax =
! 	cmd_CreateSyntax("setlog", DoResize, (char *)NULL,
  			 "set the size of a log");
      (void)cmd_AddParm(setsizeSyntax, "-log", CMD_LIST, CMD_OPTIONAL,
  		      "log_name");
--- 3112,3118 ----
      struct cmd_syndesc *setsizeSyntax;
  
      setsizeSyntax =
! 	cmd_CreateSyntax("setlog", DoResize, NULL,
  			 "set the size of a log");
      (void)cmd_AddParm(setsizeSyntax, "-log", CMD_LIST, CMD_OPTIONAL,
  		      "log_name");
Index: openafs/src/venus/kdump.c
diff -c openafs/src/venus/kdump.c:1.33.2.7 openafs/src/venus/kdump.c:1.33.2.8
*** openafs/src/venus/kdump.c:1.33.2.7	Tue Mar 20 15:24:12 2007
--- openafs/src/venus/kdump.c	Wed Oct 31 00:13:50 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/venus/kdump.c,v 1.33.2.7 2007/03/20 19:24:12 shadow Exp $");
  
  #include <stdio.h>
  #include <errno.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/venus/kdump.c,v 1.33.2.8 2007/10/31 04:13:50 shadow Exp $");
  
  #include <stdio.h>
  #include <errno.h>
***************
*** 556,564 ****
  
  
  
- #ifndef AFS_KDUMP_LIB
- extern struct cmd_syndesc *cmd_CreateSyntax();
- #endif
  int opencore();
  
  #if	defined(AFS_HPUX_ENV) && defined(__LP64__)
--- 556,561 ----
***************
*** 828,837 ****
  
  
  #ifndef AFS_KDUMP_LIB
! static
! cmdproc(as, arock)
!      register struct cmd_syndesc *as;
!      afs_int32 arock;
  {
      register afs_int32 code = 0;
  
--- 825,832 ----
  
  
  #ifndef AFS_KDUMP_LIB
! static int
! cmdproc(register struct cmd_syndesc *as, void *arock)
  {
      register afs_int32 code = 0;
  
***************
*** 957,963 ****
      sigaction(SIGSEGV, &nsa, NULL);
  #endif
  
!     ts = cmd_CreateSyntax(NULL, cmdproc, 0,
  			  "Read internal cache manager structs");
      cmd_AddParm(ts, "-kobj", CMD_SINGLE, CMD_OPTIONAL,
  		"kernel object (default /vmunix)");
--- 952,958 ----
      sigaction(SIGSEGV, &nsa, NULL);
  #endif
  
!     ts = cmd_CreateSyntax(NULL, cmdproc, NULL,
  			  "Read internal cache manager structs");
      cmd_AddParm(ts, "-kobj", CMD_SINGLE, CMD_OPTIONAL,
  		"kernel object (default /vmunix)");
Index: openafs/src/venus/livesys.c
diff -c openafs/src/venus/livesys.c:1.4.2.1 openafs/src/venus/livesys.c:1.4.2.3
*** openafs/src/venus/livesys.c:1.4.2.1	Tue Apr 10 14:43:46 2007
--- openafs/src/venus/livesys.c	Fri Mar  7 20:15:37 2008
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/venus/livesys.c,v 1.4.2.1 2007/04/10 18:43:46 shadow Exp $");
  
  #include <afs/afs_args.h>
  #include <rx/xdr.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/venus/livesys.c,v 1.4.2.3 2008/03/08 01:15:37 shadow Exp $");
  
  #include <afs/afs_args.h>
  #include <rx/xdr.h>
***************
*** 22,37 ****
  #include <stdio.h>
  #include <netinet/in.h>
  #include <sys/stat.h>
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <afs/stds.h>
  #include <afs/vice.h>
  #include <afs/venus.h>
  #ifdef	AFS_AIX32_ENV
  #include <signal.h>
  #endif
--- 22,32 ----
  #include <stdio.h>
  #include <netinet/in.h>
  #include <sys/stat.h>
  #include <string.h>
  #include <afs/stds.h>
  #include <afs/vice.h>
  #include <afs/venus.h>
+ #include <afs/com_err.h>
  #ifdef	AFS_AIX32_ENV
  #include <signal.h>
  #endif
Index: openafs/src/venus/twiddle.c
diff -c openafs/src/venus/twiddle.c:1.7.2.1 openafs/src/venus/twiddle.c:1.7.2.3
*** openafs/src/venus/twiddle.c:1.7.2.1	Tue Apr 10 14:43:46 2007
--- openafs/src/venus/twiddle.c	Fri Mar  7 20:15:37 2008
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/venus/twiddle.c,v 1.7.2.1 2007/04/10 18:43:46 shadow Exp $");
  
  #include <rx/xdr.h>
  #include <sys/ioctl.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/venus/twiddle.c,v 1.7.2.3 2008/03/08 01:15:37 shadow Exp $");
  
  #include <rx/xdr.h>
  #include <sys/ioctl.h>
***************
*** 32,42 ****
  #include "afs/prs_fs.h"
  #include <afs/afsint.h>
  #include <afs/auth.h>>
! #include <errno.h
  #include <afs/cellconfig.h>
  #include <afs/cmd.h>
  #include <strings.h>
! 
  
  #define	MAXSIZE	2048
  #define MAXINSIZE 1300		/* pioctl complains if data is larger than this */
--- 32,42 ----
  #include "afs/prs_fs.h"
  #include <afs/afsint.h>
  #include <afs/auth.h>>
! #include <errno.h>
  #include <afs/cellconfig.h>
  #include <afs/cmd.h>
  #include <strings.h>
! #include <afs/com_err.h>
  
  #define	MAXSIZE	2048
  #define MAXINSIZE 1300		/* pioctl complains if data is larger than this */
***************
*** 47,59 ****
  static struct ubik_client *uclient;
  
  
- extern struct cmd_syndesc *cmd_CreateSyntax();
  static char pn[] = "fs";
  static int rxInitDone = 0;
  
! static
! Twiddle(as)
!      struct cmd_syndesc *as;
  {
      afs_int32 code;
      struct ViceIoctl blob;
--- 47,57 ----
  static struct ubik_client *uclient;
  
  
  static char pn[] = "fs";
  static int rxInitDone = 0;
  
! static int
! Twiddle(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
***************
*** 154,160 ****
      /* try to find volume location information */
  
  
!     ts = cmd_CreateSyntax(NULL, Twiddle, 0, "adjust rx parms");
      cmd_AddParm(ts, "-initReceiveWindow ", CMD_SINGLE, CMD_OPTIONAL, "16");
      cmd_AddParm(ts, "-maxReceiveWindow ", CMD_SINGLE, CMD_OPTIONAL, "16");
      cmd_AddParm(ts, "-initSendWindow ", CMD_SINGLE, CMD_OPTIONAL, "8");
--- 152,158 ----
      /* try to find volume location information */
  
  
!     ts = cmd_CreateSyntax(NULL, Twiddle, NULL, "adjust rx parms");
      cmd_AddParm(ts, "-initReceiveWindow ", CMD_SINGLE, CMD_OPTIONAL, "16");
      cmd_AddParm(ts, "-maxReceiveWindow ", CMD_SINGLE, CMD_OPTIONAL, "16");
      cmd_AddParm(ts, "-initSendWindow ", CMD_SINGLE, CMD_OPTIONAL, "8");
Index: openafs/src/venus/up.c
diff -c openafs/src/venus/up.c:1.13.2.1 openafs/src/venus/up.c:1.13.2.4
*** openafs/src/venus/up.c:1.13.2.1	Mon May  7 13:23:11 2007
--- openafs/src/venus/up.c	Tue Dec 11 11:36:54 2007
***************
*** 11,22 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/venus/up.c,v 1.13.2.1 2007/05/07 17:23:11 rra Exp $");
  
  /* missing type from C language */
- #define Boolean short
- #define true 1
- #define false 0
  
  #include <errno.h>
  #ifdef	AFS_AIX32_ENV
--- 11,19 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/venus/up.c,v 1.13.2.4 2007/12/11 16:36:54 shadow Exp $");
  
  /* missing type from C language */
  
  #include <errno.h>
  #ifdef	AFS_AIX32_ENV
***************
*** 24,29 ****
--- 21,27 ----
  #undef	_NONSTD_TYPES
  #endif
  #include <stdio.h>
+ #include <unistd.h>
  #include <afs/afs_args.h>
  #include <sys/param.h>
  #ifdef	AFS_SUN5_ENV
***************
*** 45,57 ****
  #include <netinet/in.h>
  #endif
  
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  
  #include <afs/venus.h>
  
--- 43,49 ----
***************
*** 64,79 ****
  extern char *sys_errlist[];
  #endif
  
! Boolean verbose = false;
! Boolean renameTargets = false;
! Boolean oneLevel = false;
! Boolean preserveDate = true;
! Boolean preserveMountPoints = false;
! Boolean forceOverwrite = false;
  
  int pageSize;
! Boolean setacl = true;
! Boolean oldAcl = false;
  char file1[MAXPATHLEN], file2[MAXPATHLEN];
  
  #define	MAXSIZE	2048
--- 56,71 ----
  extern char *sys_errlist[];
  #endif
  
! short verbose = 0;
! short renameTargets = 0;
! short oneLevel = 0;
! short preserveDate = 1;
! short preserveMountPoints = 0;
! short forceOverwrite = 0;
  
  int pageSize;
! short setacl = 1;
! short oldAcl = 0;
  char file1[MAXPATHLEN], file2[MAXPATHLEN];
  
  #define	MAXSIZE	2048
***************
*** 86,91 ****
--- 78,89 ----
      char data[1];
  };
  
+ static void ScanArgs(int argc, char *argv[]);
+ static short MakeParent(char *file, afs_int32 owner);
+ static int Copy(char *file1, char *file2, short recursive, int level);
+ static int isMountPoint(char *name, struct ViceIoctl *blob);
+ 
+ 
  /* ************************************************************ */
  /* 								 */
  /* main program							 */
***************
*** 94,103 ****
  
  #include "AFS_component_version_number.c"
  
! main(argc, argv)
!      int argc;
!      char *argv[];
! 
  {
  #ifdef	AFS_AIX32_ENV
      /*
--- 92,99 ----
  
  #include "AFS_component_version_number.c"
  
! int
! main(int argc, char *argv[])
  {
  #ifdef	AFS_AIX32_ENV
      /*
***************
*** 120,135 ****
  
      /* now read each line of the CopyList */
      if (Copy(file1, file2, !oneLevel, 0))
! 	exit(1);		/* some type of failure */
  
!     exit(0);
  }
  
  
! ScanArgs(argc, argv)
!      int argc;
!      char *argv[];
! 
  {
      /* skip program name */
      argc--, argv++;
--- 116,130 ----
  
      /* now read each line of the CopyList */
      if (Copy(file1, file2, !oneLevel, 0))
! 	return(1);		/* some type of failure */
  
!     return(0);
  }
  
  
! #define USAGE "usage: up [-v1frxm] from to\n"
! static void
! ScanArgs(int argc, char *argv[])
  {
      /* skip program name */
      argc--, argv++;
***************
*** 140,178 ****
  
  	switch (*++cp) {
  	case 'v':
! 	    verbose = true;
  	    break;
  
  	case '1':
! 	    oneLevel = true;
  	    break;
  
  	case 'r':
! 	    renameTargets = true;
  	    break;
  
  	case 'f':
! 	    forceOverwrite = true;
  	    break;
  
  	case 'x':
! 	    preserveDate = false;
  	    break;
  
  	case 'm':
! 	    preserveMountPoints = true;
  	    break;
  
  	default:
  	    fprintf(stderr, "Unknown option: '%c'\n", *cp);
! 	    fprintf(stderr, "usage: up [-v1frxm] from to\n");
  	    exit(1);
  	}
  	argc--, argv++;
      }
  
      if (argc != 2) {
! 	fprintf(stderr, "usage: up [-v1frx] from to\n");
  	exit(1);
      }
  
--- 135,173 ----
  
  	switch (*++cp) {
  	case 'v':
! 	    verbose = 1;
  	    break;
  
  	case '1':
! 	    oneLevel = 1;
  	    break;
  
  	case 'r':
! 	    renameTargets = 1;
  	    break;
  
  	case 'f':
! 	    forceOverwrite = 1;
  	    break;
  
  	case 'x':
! 	    preserveDate = 0;
  	    break;
  
  	case 'm':
! 	    preserveMountPoints = 1;
  	    break;
  
  	default:
  	    fprintf(stderr, "Unknown option: '%c'\n", *cp);
! 	    fprintf(stderr, USAGE);
  	    exit(1);
  	}
  	argc--, argv++;
      }
  
      if (argc != 2) {
! 	fprintf(stderr, USAGE);
  	exit(1);
      }
  
***************
*** 186,198 ****
  /*
   * MakeParent
   *	Make sure the parent directory of this file exists.  Returns
!  * 	true if it exists, false otherwise.  Note: the owner argument
   * 	is a hack.  All directories made will have this owner.
   */
! Boolean
! MakeParent(file, owner)
!      char *file;
!      afs_int32 owner;
  {
      char parent[MAXPATHLEN];
      char *p;
--- 181,191 ----
  /*
   * MakeParent
   *	Make sure the parent directory of this file exists.  Returns
!  * 	1 if it exists, 0 otherwise.  Note: the owner argument
   * 	is a hack.  All directories made will have this owner.
   */
! static short
! MakeParent(char *file, afs_int32 owner)
  {
      char parent[MAXPATHLEN];
      char *p;
***************
*** 211,217 ****
  
      if (stat(parent, &s) < 0) {
  	if (!MakeParent(parent, owner))
! 	    return (false);
  
  	if (verbose) {
  	    printf("Creating directory %s\n", parent);
--- 204,210 ----
  
      if (stat(parent, &s) < 0) {
  	if (!MakeParent(parent, owner))
! 	    return (0);
  
  	if (verbose) {
  	    printf("Creating directory %s\n", parent);
***************
*** 221,227 ****
  	mkdir(parent, 0777);
  	chown(parent, owner, -1);
      }
!     return (true);
  }				/*MakeParent */
  
  
--- 214,220 ----
  	mkdir(parent, 0777);
  	chown(parent, owner, -1);
      }
!     return (1);
  }				/*MakeParent */
  
  
***************
*** 230,241 ****
   * 	This does the bulk of the work of the program.  Handle one file,
   *	possibly copying subfiles if this is a directory
   */
! Copy(file1, file2, recursive, level)
!      char *file1;		/* input file name */
!      char *file2;		/* output file name */
!      Boolean recursive;		/* true if directory should be copied */
!      int level;			/* level of recursion: 0, 1, ... */
! 
  {
      struct stat s1, s2;		/*Stat blocks */
      struct ViceIoctl blob;
--- 223,230 ----
   * 	This does the bulk of the work of the program.  Handle one file,
   *	possibly copying subfiles if this is a directory
   */
! static int
! Copy(char *file1, char *file2, short recursive, int level)
  {
      struct stat s1, s2;		/*Stat blocks */
      struct ViceIoctl blob;
***************
*** 615,621 ****
  	    rcode = 1;
  	}
  
! 	if (setacl == true) {
  	    if (verbose) {
  		printf("  Set acls for %s\n", file2);
  		fflush(stdout);
--- 604,610 ----
  	    rcode = 1;
  	}
  
! 	if (setacl == 1) {
  	    if (verbose) {
  		printf("  Set acls for %s\n", file2);
  		fflush(stdout);
***************
*** 628,633 ****
--- 617,627 ----
  
  	    if (oldAcl) {
  		/* Get an old-style ACL and convert it */
+                 if (verbose) {
+                     printf("  Getting old style acl\n");
+                     fflush(stdout);
+                 }
+ 
  		for (i = 1; i < strlen(file1); i++)
  		    if (file1[i] == '/')
  			break;
***************
*** 643,649 ****
  		close(tfd);
  		if (code < 0) {
  		    if (errno == EINVAL) {
! 			setacl = false;
  		    } else {
  			return 1;
  		    }
--- 637,647 ----
  		close(tfd);
  		if (code < 0) {
  		    if (errno == EINVAL) {
! 			setacl = 0;
!                         if (verbose) {
!                             printf("  _VICEIOCTL(4) returns EINVAL\n");
!                             fflush(stdout);
!                         }
  		    } else {
  			return 1;
  		    }
***************
*** 656,665 ****
  	    } /*Grab and convert old-style ACL */
  	    else {
  		/* Get a new-style ACL */
  		code = pioctl(file1, _VICEIOCTL(2), &blob, 1);
  		if (code < 0) {
  		    if (errno == EINVAL) {
! 			setacl = false;
  		    } else {
  			perror("getacl ");
  			return 1;
--- 654,672 ----
  	    } /*Grab and convert old-style ACL */
  	    else {
  		/* Get a new-style ACL */
+                 if (verbose) {
+                     printf("  Getting new style acl\n");
+                     fflush(stdout);
+                 }
+ 
  		code = pioctl(file1, _VICEIOCTL(2), &blob, 1);
  		if (code < 0) {
  		    if (errno == EINVAL) {
! 			setacl = 0;
!                         if (verbose) {
!                             printf("  _VICEIOCTL(2) returns EINVAL\n");
!                             fflush(stdout);
!                         }
  		    } else {
  			perror("getacl ");
  			return 1;
***************
*** 670,676 ****
  	    /*
  	     * Now, set the new-style ACL.
  	     */
! 	    if (setacl == true) {
  		blob.out = aclspace;
  		blob.in = aclspace;
  		blob.out_size = 0;
--- 677,687 ----
  	    /*
  	     * Now, set the new-style ACL.
  	     */
! 	    if (setacl == 1) {
!                 if (verbose) {
!                     printf("  Setting new style acl\n");
!                     fflush(stdout);
!                 }
  		blob.out = aclspace;
  		blob.in = aclspace;
  		blob.out_size = 0;
***************
*** 678,684 ****
  		code = pioctl(file2, _VICEIOCTL(1), &blob, 1);
  		if (code) {
  		    if (errno == EINVAL) {
! 			setacl = false;
  		    } else {
  			fprintf(stderr, "Couldn't set acls for %s\n", file2);
  			return 1;
--- 689,699 ----
  		code = pioctl(file2, _VICEIOCTL(1), &blob, 1);
  		if (code) {
  		    if (errno == EINVAL) {
! 			setacl = 0;
!                         if (verbose) {
!                             printf("  _VICEIOCTL(1) returns EINVAL\n");
!                             fflush(stdout);
!                         }
  		    } else {
  			fprintf(stderr, "Couldn't set acls for %s\n", file2);
  			return 1;
***************
*** 686,692 ****
  		}
  	    }
  
! 	    if (setacl == false) {
  		printf("Not setting acls\n");
  	    }
  	}
--- 701,707 ----
  		}
  	    }
  
! 	    if (setacl == 0) {
  		printf("Not setting acls\n");
  	    }
  	}
***************
*** 705,714 ****
  }				/*Copy */
  
  
! int
! isMountPoint(name, blob)
!      char *name;
!      struct ViceIoctl *blob;
  {
      afs_int32 code;
      char true_name[1024];	/*dirname */
--- 720,727 ----
  }				/*Copy */
  
  
! static int
! isMountPoint(char *name, struct ViceIoctl *blob)
  {
      afs_int32 code;
      char true_name[1024];	/*dirname */
Index: openafs/src/venus/whatfid.c
diff -c openafs/src/venus/whatfid.c:1.5.2.1 openafs/src/venus/whatfid.c:1.5.2.2
*** openafs/src/venus/whatfid.c:1.5.2.1	Tue Apr 10 14:43:46 2007
--- openafs/src/venus/whatfid.c	Wed Oct 31 00:13:50 2007
***************
*** 14,20 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/venus/whatfid.c,v 1.5.2.1 2007/04/10 18:43:46 shadow Exp $");
  
  #include <stdio.h>
  #include <errno.h>
--- 14,20 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/venus/whatfid.c,v 1.5.2.2 2007/10/31 04:13:50 shadow Exp $");
  
  #include <stdio.h>
  #include <errno.h>
***************
*** 50,57 ****
  int WhatFidCmd_FileParm;
  int WhatFidCmd_FollowLinkParm;
  int
! WhatFidCmd(as)
!      register struct cmd_syndesc *as;
  {
      register afs_int32 code;
      struct ViceIoctl blob;
--- 50,56 ----
  int WhatFidCmd_FileParm;
  int WhatFidCmd_FollowLinkParm;
  int
! WhatFidCmd(register struct cmd_syndesc *as, void *arock)
  {
      register afs_int32 code;
      struct ViceIoctl blob;
***************
*** 105,111 ****
  
      pn = argv[0];
  
!     ts = cmd_CreateSyntax("initcmd", WhatFidCmd, 0, "list fid for file(s)");
      WhatFidCmd_FileParm = cmd_AddParm(ts, "-path", CMD_LIST, 0, "pathnames");
      WhatFidCmd_FollowLinkParm =
  	cmd_AddParm(ts, "-link", CMD_FLAG, CMD_OPTIONAL,
--- 104,110 ----
  
      pn = argv[0];
  
!     ts = cmd_CreateSyntax("initcmd", WhatFidCmd, NULL, "list fid for file(s)");
      WhatFidCmd_FileParm = cmd_AddParm(ts, "-path", CMD_LIST, 0, "pathnames");
      WhatFidCmd_FollowLinkParm =
  	cmd_AddParm(ts, "-link", CMD_FLAG, CMD_OPTIONAL,
Index: openafs/src/venus/test/fulltest.c
diff -c openafs/src/venus/test/fulltest.c:1.6 openafs/src/venus/test/fulltest.c:1.6.2.1
*** openafs/src/venus/test/fulltest.c:1.6	Tue Jul 15 19:17:24 2003
--- openafs/src/venus/test/fulltest.c	Mon Nov 26 16:21:56 2007
***************
*** 11,22 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/venus/test/fulltest.c,v 1.6 2003/07/15 23:17:24 shadow Exp $");
  
  #include <sys/types.h>
  #include <sys/time.h>
  #include <sys/stat.h>
  #include <fcntl.h>
  #include <unistd.h>
  
  main(argc, argv)
--- 11,23 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/venus/test/fulltest.c,v 1.6.2.1 2007/11/26 21:21:56 shadow Exp $");
  
  #include <sys/types.h>
  #include <sys/time.h>
  #include <sys/stat.h>
  #include <fcntl.h>
+ #include <stdio.h>
  #include <unistd.h>
  
  main(argc, argv)
***************
*** 40,80 ****
      dirName = argv[1];
      mkdir(dirName, 0777);
      if (chdir(dirName) < 0)
! 	return perror("chdir");
      if (getcwd(tempName, 1024) == 0) {
  	return printf("Could not get working dir.\n");
      }
      /* now create some files */
      fd1 = open("hi", O_CREAT | O_TRUNC | O_RDWR, 0666);
      if (fd1 < 0)
! 	return perror("open1");
      if (close(fd1) < 0)
! 	return perror("close1");
      if (access("hi", 2) < 0)
  	return printf("New file can not be written (access)\n");
      if (chmod("hi", 0741) < 0)
! 	return perror("chmod1");
      if (stat("hi", &tstat) < 0)
! 	return perror("stat1");
      if ((tstat.st_mode & 0777) != 0741)
  	return printf("chmod failed to set mode properly\n");
  
      fd1 = open("hi", O_RDWR);
      if (fd1 < 0)
! 	return perror("open2");
      if (fchmod(fd1, 0654) < 0)
! 	return perror("fchmod");
      if (fstat(fd1, &tstat) < 0)
! 	return perror("fstat1");
      if ((tstat.st_mode & 0777) != 0654)
  	return printf("fchmod failed to set mode properly\n");
  #if 0
      /* These appear to be defunct routines;
       * I don't know what, if anything, replaced them */
      if (osi_ExclusiveLockNoBlock(fd1) < 0)
! 	return perror("flock1");
      if (osi_UnLock(fd1) < 0)
! 	return perror("flock/unlock");
  #endif
  
  /* How about shared lock portability? */
--- 41,81 ----
      dirName = argv[1];
      mkdir(dirName, 0777);
      if (chdir(dirName) < 0)
! 	{perror("chdir");return;}
      if (getcwd(tempName, 1024) == 0) {
  	return printf("Could not get working dir.\n");
      }
      /* now create some files */
      fd1 = open("hi", O_CREAT | O_TRUNC | O_RDWR, 0666);
      if (fd1 < 0)
! 	{perror("open1");return;}
      if (close(fd1) < 0)
! 	{perror("close1");return;}
      if (access("hi", 2) < 0)
  	return printf("New file can not be written (access)\n");
      if (chmod("hi", 0741) < 0)
! 	{perror("chmod1");return;}
      if (stat("hi", &tstat) < 0)
! 	{perror("stat1");return;}
      if ((tstat.st_mode & 0777) != 0741)
  	return printf("chmod failed to set mode properly\n");
  
      fd1 = open("hi", O_RDWR);
      if (fd1 < 0)
! 	{perror("open2");return;}
      if (fchmod(fd1, 0654) < 0)
! 	{perror("fchmod");return;}
      if (fstat(fd1, &tstat) < 0)
! 	{perror("fstat1");return;}
      if ((tstat.st_mode & 0777) != 0654)
  	return printf("fchmod failed to set mode properly\n");
  #if 0
      /* These appear to be defunct routines;
       * I don't know what, if anything, replaced them */
      if (osi_ExclusiveLockNoBlock(fd1) < 0)
! 	{perror("flock1");return;}
      if (osi_UnLock(fd1) < 0)
! 	{perror("flock/unlock");return;}
  #endif
  
  /* How about shared lock portability? */
***************
*** 87,93 ****
  	fl.l_len = 0;
  
  	if (fcntl(fd1, F_SETLK, &fl) == -1)
! 	    return perror("fcntl1: RDLCK");
  
  	fl.l_type = F_UNLCK;
  	fl.l_whence = SEEK_SET;
--- 88,94 ----
  	fl.l_len = 0;
  
  	if (fcntl(fd1, F_SETLK, &fl) == -1)
! 	    {perror("fcntl1: RDLCK");return;}
  
  	fl.l_type = F_UNLCK;
  	fl.l_whence = SEEK_SET;
***************
*** 95,101 ****
  	fl.l_len = 0;
  
  	if (fcntl(fd1, F_SETLK, &fl) == -1)
! 	    return perror("fcntl2: UNLCK");
  
  	fl.l_type = F_WRLCK;
  	fl.l_whence = SEEK_SET;
--- 96,102 ----
  	fl.l_len = 0;
  
  	if (fcntl(fd1, F_SETLK, &fl) == -1)
! 	    {perror("fcntl2: UNLCK");return;}
  
  	fl.l_type = F_WRLCK;
  	fl.l_whence = SEEK_SET;
***************
*** 103,109 ****
  	fl.l_len = 0;
  
  	if (fcntl(fd1, F_SETLK, &fl) == -1)
! 	    return perror("fcntl3: WRLCK");
  
  	fl.l_type = F_UNLCK;
  	fl.l_whence = SEEK_SET;
--- 104,110 ----
  	fl.l_len = 0;
  
  	if (fcntl(fd1, F_SETLK, &fl) == -1)
! 	    {perror("fcntl3: WRLCK");return;}
  
  	fl.l_type = F_UNLCK;
  	fl.l_whence = SEEK_SET;
***************
*** 111,171 ****
  	fl.l_len = 0;
  
  	if (fcntl(fd1, F_SETLK, &fl) == -1)
! 	    return perror("fcntl4: UNLCK");
      }
  
      if (fsync(fd1) < 0)
! 	return perror("fsync");
      if (write(fd1, "hi\n", 3) != 3)
! 	return perror("write");
      if (ftruncate(fd1, 2) < 0)
! 	return perror("ftruncate");
      if (close(fd1) < 0)
! 	return perror("close2");
  
      fd1 = open("hi", O_RDONLY);
      if (fd1 < 0)
! 	return perror("open3");
      if (read(fd1, tempName, 100) != 2)
! 	return perror("read2");
      if (close(fd1) < 0)
! 	return perror("close3");
  
      if (link("hi", "bye") < 0)
! 	return perror("link");
      if (stat("bye", &tstat) < 0)
! 	return perror("link/stat");
  
      if (unlink("bye") < 0)
! 	return perror("unlink");
  
      if (symlink("hi", "bye") < 0)
! 	return perror("symlink");
      if (readlink("bye", tempName, 100) != 2)
! 	return perror("readlink");
      if (strncmp(tempName, "hi", 2) != 0)
  	return printf("readlink contents");
      if (mkdir("tdir", 0777) < 0)
! 	return perror("mkdir");
      fd1 = open("tdir/fdsa", O_CREAT | O_TRUNC, 0777);
      close(fd1);
      if (rmdir("tdir") == 0)
  	return printf("removed non-empty dir\n");
      if (unlink("tdir/fdsa") < 0)
! 	return perror("unlink tdir contents");
      if (rmdir("tdir") < 0)
! 	return perror("rmdir");
  
      fd1 = open(".", O_RDONLY);
      if (fd1 < 0)
! 	return perror("open dot");
      if (read(fd1, tempName, 20) < 20)
  	perror("read dir");
      close(fd1);
  
      fd1 = open("rotest", O_RDWR | O_CREAT, 0444);
      if (fd1 < 0)
! 	return perror("open ronly");
      fchown(fd1, 1, -1);		/* don't check error code, may fail on Ultrix */
      code = write(fd1, "test", 4);
      if (code != 4) {
--- 112,172 ----
  	fl.l_len = 0;
  
  	if (fcntl(fd1, F_SETLK, &fl) == -1)
! 	    {perror("fcntl4: UNLCK");return;}
      }
  
      if (fsync(fd1) < 0)
! 	{perror("fsync");return;}
      if (write(fd1, "hi\n", 3) != 3)
! 	{perror("write");return;}
      if (ftruncate(fd1, 2) < 0)
! 	{perror("ftruncate");return;}
      if (close(fd1) < 0)
! 	{perror("close2");return;}
  
      fd1 = open("hi", O_RDONLY);
      if (fd1 < 0)
! 	{perror("open3");return;}
      if (read(fd1, tempName, 100) != 2)
! 	{perror("read2");return;}
      if (close(fd1) < 0)
! 	{perror("close3");return;}
  
      if (link("hi", "bye") < 0)
! 	{perror("link");return;}
      if (stat("bye", &tstat) < 0)
! 	{perror("link/stat");return;}
  
      if (unlink("bye") < 0)
! 	{perror("unlink");return;}
  
      if (symlink("hi", "bye") < 0)
! 	{perror("symlink");return;}
      if (readlink("bye", tempName, 100) != 2)
! 	{perror("readlink");return;}
      if (strncmp(tempName, "hi", 2) != 0)
  	return printf("readlink contents");
      if (mkdir("tdir", 0777) < 0)
! 	{perror("mkdir");return;}
      fd1 = open("tdir/fdsa", O_CREAT | O_TRUNC, 0777);
      close(fd1);
      if (rmdir("tdir") == 0)
  	return printf("removed non-empty dir\n");
      if (unlink("tdir/fdsa") < 0)
! 	{perror("unlink tdir contents");return;}
      if (rmdir("tdir") < 0)
! 	{perror("rmdir");return;}
  
      fd1 = open(".", O_RDONLY);
      if (fd1 < 0)
! 	{perror("open dot");return;}
      if (read(fd1, tempName, 20) < 20)
  	perror("read dir");
      close(fd1);
  
      fd1 = open("rotest", O_RDWR | O_CREAT, 0444);
      if (fd1 < 0)
! 	{perror("open ronly");return;}
      fchown(fd1, 1, -1);		/* don't check error code, may fail on Ultrix */
      code = write(fd1, "test", 4);
      if (code != 4) {
***************
*** 174,213 ****
      }
      code = close(fd1);
      if (code)
! 	return perror("close ronly");
      code = stat("rotest", &tstat);
      if (code < 0)
! 	return perror("stat ronly");
      if (tstat.st_size != 4) {
  	printf("rotest short close\n");
  	exit(1);
      }
      if (unlink("rotest") < 0)
! 	return perror("rotest unlink");
  
      if (rename("hi", "bye") < 0)
! 	return perror("rename1");
      if (stat("bye", &tstat) < 0)
! 	return perror("rename target invisible\n");
      if (stat("hi", &tstat) == 0)
  	return printf("rename source still there\n");
  
  #ifndef	AFS_AIX_ENV
  /* No truncate(2) on aix so the following are excluded */
      if (truncate("bye", 1) < 0)
! 	return perror("truncate");
      if (stat("bye", &tstat) < 0)
! 	return perror("truncate zapped");
      if (tstat.st_size != 1)
  	return printf("truncate failed\n");
  #endif
      if (utimes("bye", tvp) < 0)
! 	return perror("utimes");
      if (unlink("bye") < 0)
! 	return perror("unlink bye");
  
      /* now finish up */
      chdir("..");
      rmdir(dirName);
      printf("Test completed successfully.\n");
  }
--- 175,215 ----
      }
      code = close(fd1);
      if (code)
! 	{perror("close ronly");return;}
      code = stat("rotest", &tstat);
      if (code < 0)
! 	{perror("stat ronly");return;}
      if (tstat.st_size != 4) {
  	printf("rotest short close\n");
  	exit(1);
      }
      if (unlink("rotest") < 0)
! 	{perror("rotest unlink");return;}
  
      if (rename("hi", "bye") < 0)
! 	{perror("rename1");return;}
      if (stat("bye", &tstat) < 0)
! 	{perror("rename target invisible\n");return;}
      if (stat("hi", &tstat) == 0)
  	return printf("rename source still there\n");
  
  #ifndef	AFS_AIX_ENV
  /* No truncate(2) on aix so the following are excluded */
      if (truncate("bye", 1) < 0)
! 	{perror("truncate");return;}
      if (stat("bye", &tstat) < 0)
! 	{perror("truncate zapped");return;}
      if (tstat.st_size != 1)
  	return printf("truncate failed\n");
  #endif
      if (utimes("bye", tvp) < 0)
! 	{perror("utimes");return;}
      if (unlink("bye") < 0)
! 	{perror("unlink bye");return;}
  
      /* now finish up */
      chdir("..");
      rmdir(dirName);
      printf("Test completed successfully.\n");
+     return 0;
  }
Index: openafs/src/venus/test/getinitparams.c
diff -c openafs/src/venus/test/getinitparams.c:1.5 openafs/src/venus/test/getinitparams.c:1.5.2.1
*** openafs/src/venus/test/getinitparams.c:1.5	Tue Jul 15 19:17:24 2003
--- openafs/src/venus/test/getinitparams.c	Wed Oct 31 00:13:50 2007
***************
*** 11,17 ****
  #include <afsconfig.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/venus/test/getinitparams.c,v 1.5 2003/07/15 23:17:24 shadow Exp $");
  
  #include <afs/param.h>
  #include <stdio.h>
--- 11,17 ----
  #include <afsconfig.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/venus/test/getinitparams.c,v 1.5.2.1 2007/10/31 04:13:50 shadow Exp $");
  
  #include <afs/param.h>
  #include <stdio.h>
***************
*** 34,40 ****
  
  
  int
! GetInitParamsCmd(struct cmd_syndesc *as)
  {
      struct cm_initparams cm_initParams;
      struct ViceIoctl blob;
--- 34,40 ----
  
  
  int
! GetInitParamsCmd(struct cmd_syndesc *as, void *arock)
  {
      struct cm_initparams cm_initParams;
      struct ViceIoctl blob;
Index: openafs/src/venus/test/idtest.c
diff -c openafs/src/venus/test/idtest.c:1.5 openafs/src/venus/test/idtest.c:1.5.2.1
*** openafs/src/venus/test/idtest.c:1.5	Tue Jul 15 19:17:24 2003
--- openafs/src/venus/test/idtest.c	Mon Nov 26 16:21:56 2007
***************
*** 9,17 ****
  
  #include <afsconfig.h>
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/venus/test/idtest.c,v 1.5 2003/07/15 23:17:24 shadow Exp $");
  
  main(argc, argv)
  {
--- 9,18 ----
  
  #include <afsconfig.h>
  #include <afs/param.h>
+ #include <stdio.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/venus/test/idtest.c,v 1.5.2.1 2007/11/26 21:21:56 shadow Exp $");
  
  main(argc, argv)
  {
Index: openafs/src/venus/test/owntest.c
diff -c openafs/src/venus/test/owntest.c:1.8 openafs/src/venus/test/owntest.c:1.8.2.1
*** openafs/src/venus/test/owntest.c:1.8	Tue Jul 15 19:17:24 2003
--- openafs/src/venus/test/owntest.c	Mon Nov 26 16:21:56 2007
***************
*** 12,20 ****
  #ifdef HAVE_STDLIB_H
  #include <stdlib.h>
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/venus/test/owntest.c,v 1.8 2003/07/15 23:17:24 shadow Exp $");
  
  #include <sys/types.h>
  #include <sys/file.h>
--- 12,21 ----
  #ifdef HAVE_STDLIB_H
  #include <stdlib.h>
  #endif
+ #include <stdio.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/venus/test/owntest.c,v 1.8.2.1 2007/11/26 21:21:56 shadow Exp $");
  
  #include <sys/types.h>
  #include <sys/file.h>
Index: openafs/src/vfsck/dirutils.c
diff -c openafs/src/vfsck/dirutils.c:1.5 openafs/src/vfsck/dirutils.c:1.5.2.1
*** openafs/src/vfsck/dirutils.c:1.5	Tue Jul 15 19:17:27 2003
--- openafs/src/vfsck/dirutils.c	Tue Oct 30 11:24:10 2007
***************
*** 11,20 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vfsck/dirutils.c,v 1.5 2003/07/15 23:17:27 shadow Exp $");
  
  #include <sys/types.h>
  #include <sys/stat.h>
  #include <dirent.h>
  #include <afs/partition.h>
  
--- 11,21 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vfsck/dirutils.c,v 1.5.2.1 2007/10/30 15:24:10 shadow Exp $");
  
  #include <sys/types.h>
  #include <sys/stat.h>
+ #include <string.h>
  #include <dirent.h>
  #include <afs/partition.h>
  
Index: openafs/src/vfsck/setup.c
diff -c openafs/src/vfsck/setup.c:1.10.2.3 openafs/src/vfsck/setup.c:1.10.2.4
*** openafs/src/vfsck/setup.c:1.10.2.3	Sun Apr  3 14:15:54 2005
--- openafs/src/vfsck/setup.c	Tue Oct 30 11:24:10 2007
***************
*** 19,27 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vfsck/setup.c,v 1.10.2.3 2005/04/03 18:15:54 shadow Exp $");
  
  #include <stdio.h>
  #define VICE
  
  #if	defined(AFS_SUN_ENV) || defined(AFS_OSF_ENV)
--- 19,28 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vfsck/setup.c,v 1.10.2.4 2007/10/30 15:24:10 shadow Exp $");
  
  #include <stdio.h>
+ #include <string.h>
  #define VICE
  
  #if	defined(AFS_SUN_ENV) || defined(AFS_OSF_ENV)
Index: openafs/src/vfsck/utilities.c
diff -c openafs/src/vfsck/utilities.c:1.5.2.3 openafs/src/vfsck/utilities.c:1.5.2.4
*** openafs/src/vfsck/utilities.c:1.5.2.3	Sun Oct  2 22:46:33 2005
--- openafs/src/vfsck/utilities.c	Tue Oct 30 11:24:10 2007
***************
*** 19,25 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vfsck/utilities.c,v 1.5.2.3 2005/10/03 02:46:33 shadow Exp $");
  
  #include <sys/param.h>
  #define VICE			/* allow us to put our changes in at will */
--- 19,25 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vfsck/utilities.c,v 1.5.2.4 2007/10/30 15:24:10 shadow Exp $");
  
  #include <sys/param.h>
  #define VICE			/* allow us to put our changes in at will */
***************
*** 75,80 ****
--- 75,81 ----
  #endif /* AFS_OSF_ENV */
  
  #include <stdio.h>
+ #include <string.h>
  #include <ctype.h>
  #include "fsck.h"
  
Index: openafs/src/viced/afsfileprocs.c
diff -c openafs/src/viced/afsfileprocs.c:1.81.2.43.2.1 openafs/src/viced/afsfileprocs.c:1.81.2.47
*** openafs/src/viced/afsfileprocs.c:1.81.2.43.2.1	Thu Dec 13 15:59:29 2007
--- openafs/src/viced/afsfileprocs.c	Tue Feb 19 09:33:44 2008
***************
*** 29,35 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/viced/afsfileprocs.c,v 1.81.2.43.2.1 2007/12/13 20:59:29 shadow Exp $");
  
  #include <stdio.h>
  #include <stdlib.h>
--- 29,35 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/viced/afsfileprocs.c,v 1.81.2.47 2008/02/19 14:33:44 shadow Exp $");
  
  #include <stdio.h>
  #include <stdlib.h>
***************
*** 46,59 ****
  #include <netdb.h>
  #include <sys/ioctl.h>
  #include <sys/socket.h>
- 
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  
  #ifndef AFS_LINUX20_ENV
  #include <net/if.h>
--- 46,52 ----
***************
*** 347,353 ****
  	    hpr_End(uclient);
  	code = hpr_Initialize(&uclient);
  
! 	assert(pthread_setspecific(viced_uclient_key, (void *)uclient) == 0);
  	H_LOCK;
  #else
  	code = pr_Initialize(2, AFSDIR_SERVER_ETC_DIRPATH, 0);
--- 340,347 ----
  	    hpr_End(uclient);
  	code = hpr_Initialize(&uclient);
  
! 	if (!code)
! 	    assert(pthread_setspecific(viced_uclient_key, (void *)uclient) == 0);
  	H_LOCK;
  #else
  	code = pr_Initialize(2, AFSDIR_SERVER_ETC_DIRPATH, 0);
***************
*** 1326,1331 ****
--- 1320,1326 ----
  	if (IsEmpty(&childdir) != 0)
  	    return (EEXIST);
  	DZap(&childdir);
+ 	FidZap(&childdir);
  	(*targetptr)->delete = 1;
      } else if ((--(*targetptr)->disk.linkCount) == 0)
  	(*targetptr)->delete = 1;
Index: openafs/src/viced/callback.c
diff -c openafs/src/viced/callback.c:1.55.2.18.2.2 openafs/src/viced/callback.c:1.55.2.27
*** openafs/src/viced/callback.c:1.55.2.18.2.2	Thu Dec 13 15:57:11 2007
--- openafs/src/viced/callback.c	Tue Mar 11 13:40:55 2008
***************
*** 83,93 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/viced/callback.c,v 1.55.2.18.2.2 2007/12/13 20:57:11 shadow Exp $");
  
  #include <stdio.h>
  #include <stdlib.h>		/* for malloc() */
  #include <time.h>		/* ANSI standard location for time stuff */
  #ifdef AFS_NT40_ENV
  #include <fcntl.h>
  #include <io.h>
--- 83,94 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/viced/callback.c,v 1.55.2.27 2008/03/11 17:40:55 shadow Exp $");
  
  #include <stdio.h>
  #include <stdlib.h>		/* for malloc() */
  #include <time.h>		/* ANSI standard location for time stuff */
+ #include <string.h>
  #ifdef AFS_NT40_ENV
  #include <fcntl.h>
  #include <io.h>
***************
*** 95,107 ****
  #include <sys/time.h>
  #include <sys/file.h>
  #endif
- #ifdef HAVE_STRING_H
- #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <afs/assert.h>
  
  #include <afs/stds.h>
--- 96,101 ----
***************
*** 310,318 ****
  #define FreeCB(cb) iFreeCB((struct CallBack *)cb, &cbstuff.nCBs)
  #define FreeFE(fe) iFreeFE((struct FileEntry *)fe, &cbstuff.nFEs)
  
- /* Other protos - move out sometime */
- extern void ShutDown();
- 
  #define VHASH 512		/* Power of 2 */
  static afs_uint32 HashTable[VHASH];	/* File entry hash table */
  #define VHash(volume, unique) (((volume)+(unique))&(VHASH-1))
--- 304,309 ----
***************
*** 646,651 ****
--- 637,644 ----
      struct CallBack *newcb = 0;
      int safety;
  
+     cbstuff.AddCallBacks++;
+ 
      host->Console |= 2;
  
      /* allocate these guys first, since we can't call the allocator with
***************
*** 753,758 ****
--- 746,759 ----
      return 0;
  }
  
+ static int
+ CompareCBA(const void *e1, const void *e2)
+ {
+     const struct cbstruct *cba1 = (const struct cbstruct *)e1;
+     const struct cbstruct *cba2 = (const struct cbstruct *)e2;
+     return ((cba1->hp)->index - (cba2->hp)->index);
+ }
+ 
  /* Take an array full of hosts, all held.  Break callbacks to them, and 
   * release the holds once you're done, except don't release xhost.  xhost 
   * may be NULL.  Currently only works for a single Fid in afidp array.
***************
*** 782,787 ****
--- 783,791 ----
  
      assert(ncbas <= MAX_CB_HOSTS);
  
+     /* sort cba list to avoid makecall issues */
+     qsort(cba, ncbas, sizeof(struct cbstruct), CompareCBA);
+ 
      /* set up conns for multi-call */
      for (i = 0, j = 0; i < ncbas; i++) {
  	struct host *thishost = cba[i].hp;
***************
*** 969,977 ****
      register afs_uint32 *pcb;
      char hoststr[16];
  
      cbstuff.DeleteCallBacks++;
  
-     H_LOCK;
      h_Lock_r(host);
      fe = FindFE(fid);
      if (!fe) {
--- 973,981 ----
      register afs_uint32 *pcb;
      char hoststr[16];
  
+     H_LOCK;
      cbstuff.DeleteCallBacks++;
  
      h_Lock_r(host);
      fe = FindFE(fid);
      if (!fe) {
***************
*** 1438,1443 ****
--- 1442,1448 ----
  			 fe->volid));
  		fid.Volume = fe->volid;
  		*feip = fe->fnext;
+ 		fe->status &= ~FE_LATER;
  		/* Works since volid is deeper than the largest pointer */
  		tmpfe = (struct object *)fe;
  		tmpfe->next = (struct object *)myfe;
***************
*** 1798,1808 ****
  int
  DumpCallBackState(void)
  {
!     int fd;
      afs_uint32 magic = MAGIC, now = FT_ApproxTime(), freelisthead;
  
!     fd = open(AFSDIR_SERVER_CBKDUMP_FILEPATH, O_WRONLY | O_CREAT | O_TRUNC,
! 	      0666);
      if (fd < 0) {
  	ViceLog(0,
  		("Couldn't create callback dump file %s\n",
--- 1803,1816 ----
  int
  DumpCallBackState(void)
  {
!     int fd, oflag;
      afs_uint32 magic = MAGIC, now = FT_ApproxTime(), freelisthead;
  
!     oflag = O_WRONLY | O_CREAT | O_TRUNC;
! #ifdef AFS_NT40_ENV
!     oflag |= O_BINARY;
! #endif
!     fd = open(AFSDIR_SERVER_CBKDUMP_FILEPATH, oflag, 0666);
      if (fd < 0) {
  	ViceLog(0,
  		("Couldn't create callback dump file %s\n",
***************
*** 1836,1846 ****
  time_t
  ReadDump(char *file)
  {
!     int fd;
      afs_uint32 magic, freelisthead;
!     time_t now;
  
!     fd = open(file, O_RDONLY);
      if (fd < 0) {
  	fprintf(stderr, "Couldn't read dump file %s\n", file);
  	exit(1);
--- 1844,1858 ----
  time_t
  ReadDump(char *file)
  {
!     int fd, oflag;
      afs_uint32 magic, freelisthead;
!     afs_uint32 now;
  
!     oflag = O_RDONLY;
! #ifdef AFS_NT40_ENV
!     oflag |= O_BINARY;
! #endif
!     fd = open(file, oflag);
      if (fd < 0) {
  	fprintf(stderr, "Couldn't read dump file %s\n", file);
  	exit(1);
***************
*** 1994,1999 ****
--- 2006,2012 ----
  	    printf("%d:%12x%12x%12x%12x\n", i, p[0], p[1], p[2], p[3]);
  	}
      }
+     return 0;
  }
  
  int
***************
*** 2005,2010 ****
--- 2018,2024 ----
      printf("vol=%u vn=%u cbs=%d hi=%d st=%d fest=%d, exp in %d secs at %s",
  	   fe->volid, fe->vnode, fe->ncbs, cb->hhead, cb->status, fe->status,
  	   expires - now, ctime(&expires));
+     return 0;
  }
  
  #endif
Index: openafs/src/viced/check_sysid.c
diff -c openafs/src/viced/check_sysid.c:1.6 openafs/src/viced/check_sysid.c:1.6.2.1
*** openafs/src/viced/check_sysid.c:1.6	Tue Jul 15 19:17:30 2003
--- openafs/src/viced/check_sysid.c	Mon Nov 26 16:21:57 2007
***************
*** 16,22 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/viced/check_sysid.c,v 1.6 2003/07/15 23:17:30 shadow Exp $");
  
  #include <fcntl.h>
  #include <errno.h>
--- 16,22 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/viced/check_sysid.c,v 1.6.2.1 2007/11/26 21:21:57 shadow Exp $");
  
  #include <fcntl.h>
  #include <errno.h>
***************
*** 109,112 ****
--- 109,113 ----
      }
  
      close(fd);
+     return 0;
  }
Index: openafs/src/viced/fsprobe.c
diff -c openafs/src/viced/fsprobe.c:1.11 openafs/src/viced/fsprobe.c:1.11.2.2
*** openafs/src/viced/fsprobe.c:1.11	Tue Jul 15 19:17:30 2003
--- openafs/src/viced/fsprobe.c	Mon Nov 26 16:21:57 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/viced/fsprobe.c,v 1.11 2003/07/15 23:17:30 shadow Exp $");
  
  #include <afs/stds.h>
  #include <afs/afsint.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/viced/fsprobe.c,v 1.11.2.2 2007/11/26 21:21:57 shadow Exp $");
  
  #include <afs/stds.h>
  #include <afs/afsint.h>
***************
*** 20,34 ****
  #include <sys/socket.h>
  #include <netinet/in.h>
  #include <ubik.h>
- 
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
- 
  
  struct ubik_client *cstruct;
  struct rx_connection *serverconns[MAXSERVERS];
--- 20,26 ----
***************
*** 260,265 ****
--- 252,258 ----
  	}
      }
  #endif
+     return 0;
  }
  
  
Index: openafs/src/viced/host.c
diff -c openafs/src/viced/host.c:1.57.2.49.2.1 openafs/src/viced/host.c:1.57.2.58
*** openafs/src/viced/host.c:1.57.2.49.2.1	Thu Dec 13 15:55:42 2007
--- openafs/src/viced/host.c	Mon Feb 25 15:39:04 2008
***************
*** 11,20 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/viced/host.c,v 1.57.2.49.2.1 2007/12/13 20:55:42 shadow Exp $");
  
  #include <stdio.h>
  #include <errno.h>
  #ifdef AFS_NT40_ENV
  #include <fcntl.h>
  #include <winsock2.h>
--- 11,21 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/viced/host.c,v 1.57.2.58 2008/02/25 20:39:04 shadow Exp $");
  
  #include <stdio.h>
  #include <errno.h>
+ #include <string.h>
  #ifdef AFS_NT40_ENV
  #include <fcntl.h>
  #include <winsock2.h>
***************
*** 24,37 ****
  #include <netinet/in.h>
  #endif
  
- #ifdef HAVE_STRING_H
- #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
- 
  #include <afs/stds.h>
  #include <rx/xdr.h>
  #include <afs/assert.h>
--- 25,30 ----
***************
*** 382,388 ****
  
      if (!uclient) {
          code = hpr_Initialize(&uclient);
!         assert(pthread_setspecific(viced_uclient_key, (void *)uclient) == 0);
      }
  
      over = 0;
--- 375,384 ----
  
      if (!uclient) {
          code = hpr_Initialize(&uclient);
! 	if (!code) 
! 	    assert(pthread_setspecific(viced_uclient_key, (void *)uclient) == 0);
! 	else
! 	    return code;
      }
  
      over = 0;
***************
*** 413,419 ****
  
      if (!uclient) {
          code = hpr_Initialize(&uclient);
!         assert(pthread_setspecific(viced_uclient_key, (void *)uclient) == 0);
      }
  
      for (i = 0; i < names->namelist_len; i++)
--- 409,418 ----
  
      if (!uclient) {
          code = hpr_Initialize(&uclient);
! 	if (!code)
! 	    assert(pthread_setspecific(viced_uclient_key, (void *)uclient) == 0);
! 	else
! 	    return code;
      }
  
      for (i = 0; i < names->namelist_len; i++)
***************
*** 435,441 ****
      
      if (!uclient) {
          code = hpr_Initialize(&uclient);
!         assert(pthread_setspecific(viced_uclient_key, (void *)uclient) == 0);
      }
  
      code = ubik_PR_IDToName(uclient, 0, ids, names);
--- 434,443 ----
      
      if (!uclient) {
          code = hpr_Initialize(&uclient);
! 	if (!code)
! 	    assert(pthread_setspecific(viced_uclient_key, (void *)uclient) == 0);
! 	else
! 	    return code;
      }
  
      code = ubik_PR_IDToName(uclient, 0, ids, names);
***************
*** 456,462 ****
  
      if (!uclient) {
          code = hpr_Initialize(&uclient);
!         assert(pthread_setspecific(viced_uclient_key, (void *)uclient) == 0);
      }
  
      over = 0;
--- 458,467 ----
  
      if (!uclient) {
          code = hpr_Initialize(&uclient);
! 	if (!code)
! 	    assert(pthread_setspecific(viced_uclient_key, (void *)uclient) == 0);
! 	else
! 	    return code;
      }
  
      over = 0;
***************
*** 727,737 ****
  void
  h_flushhostcps(register afs_uint32 hostaddr, register afs_uint16 hport)
  {
!     register struct host *host;
      int held = 0;
  
      H_LOCK;
!     host = h_Lookup_r(hostaddr, hport, &held);
      if (host) {
  	host->hcpsfailed = 1;
  	if (!held)
--- 732,742 ----
  void
  h_flushhostcps(register afs_uint32 hostaddr, register afs_uint16 hport)
  {
!     struct host *host;
      int held = 0;
  
      H_LOCK;
!     h_Lookup_r(hostaddr, hport, &held, &host);
      if (host) {
  	host->hcpsfailed = 1;
  	if (!held)
***************
*** 819,826 ****
  /* hostaddr and hport are in network order */
  /* Note: host should be released by caller if 0 == *heldp and non-null */
  /* hostaddr and hport are in network order */
! struct host *
! h_Lookup_r(afs_uint32 haddr, afs_uint16 hport, int *heldp)
  {
      register afs_int32 now;
      register struct host *host = NULL;
--- 824,831 ----
  /* hostaddr and hport are in network order */
  /* Note: host should be released by caller if 0 == *heldp and non-null */
  /* hostaddr and hport are in network order */
! int
! h_Lookup_r(afs_uint32 haddr, afs_uint16 hport, int *heldp, struct host **hostp)
  {
      register afs_int32 now;
      register struct host *host = NULL;
***************
*** 834,839 ****
--- 839,849 ----
  	assert(host);
  	if (!(host->hostFlags & HOSTDELETED) && chain->addr == haddr
  	    && chain->port == hport) {
+ 	    if ((host->hostFlags & HWHO_INPROGRESS) && 
+ 		h_threadquota(host->lock.num_waiting)) {
+ 		*hostp = 0;
+ 		return VBUSY;
+ 	    }
  	    *heldp = h_Held_r(host);
  	    if (!*heldp)
  		h_Hold_r(host);
***************
*** 861,868 ****
  	}
  	host = NULL;
      }
!     return host;
! 
  }				/*h_Lookup */
  
  /* Lookup a host given its UUID. */
--- 871,878 ----
  	}
  	host = NULL;
      }
!     *hostp = host;
!     return 0;
  }				/*h_Lookup */
  
  /* Lookup a host given its UUID. */
***************
*** 1066,1072 ****
  	if (!(held[count] = h_Held_r(host)))
  	    h_Hold_r(host);
      }
!     assert(count == hostCount);
      H_UNLOCK;
      for (i = 0; i < count; i++) {
  	held[i] = (*proc) (list[i], held[i], param);
--- 1076,1085 ----
  	if (!(held[count] = h_Held_r(host)))
  	    h_Hold_r(host);
      }
!     if (count != hostCount) {
! 	ViceLog(0, ("h_Enumerate found %d of %d hosts\n", count, hostCount));
!     }
!     assert(count <= hostCount);
      H_UNLOCK;
      for (i = 0; i < count; i++) {
  	held[i] = (*proc) (list[i], held[i], param);
***************
*** 1417,1423 ****
      caps.Capabilities_len = 0;
  
      code = 0;
!     host = h_Lookup_r(haddr, hport, &held);
      identP = (struct Identity *)rx_GetSpecific(tcon, rxcon_ident_key);
      if (host && !identP && !(host->Console & 1)) {
  	/* This is a new connection, and we already have a host
--- 1430,1437 ----
      caps.Capabilities_len = 0;
  
      code = 0;
!     if (h_Lookup_r(haddr, hport, &held, &host))
! 	return 0;
      identP = (struct Identity *)rx_GetSpecific(tcon, rxcon_ident_key);
      if (host && !identP && !(host->Console & 1)) {
  	/* This is a new connection, and we already have a host
***************
*** 1425,1435 ****
  	 * of the caller matches the identity in the host structure.
  	 */
  	if ((host->hostFlags & HWHO_INPROGRESS) && 
! 	    h_threadquota(host->lock.num_waiting))
  	    return 0;
  	h_Lock_r(host);
  	if (!(host->hostFlags & ALTADDR)) {
- 	    host->hostFlags &= ~HWHO_INPROGRESS;
  	    /* Another thread is doing initialization */
  	    h_Unlock_r(host);
  	    if (!held)
--- 1439,1451 ----
  	 * of the caller matches the identity in the host structure.
  	 */
  	if ((host->hostFlags & HWHO_INPROGRESS) && 
! 	    h_threadquota(host->lock.num_waiting)) {
! 	    if (!held)
! 		h_Release_r(host);
  	    return 0;
+ 	}
  	h_Lock_r(host);
  	if (!(host->hostFlags & ALTADDR)) {
  	    /* Another thread is doing initialization */
  	    h_Unlock_r(host);
  	    if (!held)
***************
*** 1440,1445 ****
--- 1456,1462 ----
  		     ntohs(host->port)));
  	    goto retry;
  	}
+ 	host->hostFlags |= HWHO_INPROGRESS;
  	host->hostFlags &= ~ALTADDR;
  	cb_conn = host->callback_rxcon;
  	rx_GetConnection(cb_conn);
***************
*** 1452,1458 ****
  	cb_conn=NULL;
  	H_LOCK;
  	if ((code == RXGEN_OPCODE) || 
! 	    (afs_uuid_equal(&interf.uuid, &nulluuid))) {
  	    identP = (struct Identity *)malloc(sizeof(struct Identity));
  	    if (!identP) {
  		ViceLog(0, ("Failed malloc in h_GetHost_r\n"));
--- 1469,1475 ----
  	cb_conn=NULL;
  	H_LOCK;
  	if ((code == RXGEN_OPCODE) || 
! 	    ((code == 0) && (afs_uuid_equal(&interf.uuid, &nulluuid)))) {
  	    identP = (struct Identity *)malloc(sizeof(struct Identity));
  	    if (!identP) {
  		ViceLog(0, ("Failed malloc in h_GetHost_r\n"));
***************
*** 1526,1532 ****
  		     afs_inet_ntoa_r(host->host, hoststr),
  		     ntohs(host->port)));
  	    h_Lock_r(host);
- 	    host->hostFlags &= ~HWHO_INPROGRESS;
  	    h_Unlock_r(host);
  	    if (!held)
  		h_Release_r(host);
--- 1543,1548 ----
***************
*** 1560,1566 ****
  	    /* The host in the cache is not the host for this connection */
              h_Lock_r(host);
  	    host->hostFlags |= HOSTDELETED;
- 	    host->hostFlags &= ~HWHO_INPROGRESS;
  	    h_Unlock_r(host);
  	    if (!held)
  		h_Release_r(host);
--- 1576,1581 ----
***************
*** 1573,1578 ****
--- 1588,1594 ----
  	    int pident = 0;
  	    cb_conn = host->callback_rxcon;
  	    rx_GetConnection(cb_conn);
+ 	    host->hostFlags |= HWHO_INPROGRESS;
  	    H_UNLOCK;
  	    code =
  		RXAFSCB_TellMeAboutYourself(cb_conn, &interf, &caps);
***************
*** 1582,1588 ****
  	    cb_conn=NULL;
  	    H_LOCK;
  	    if ((code == RXGEN_OPCODE) || 
! 		afs_uuid_equal(&interf.uuid, &nulluuid)) {
  		if (!identP)
  		    identP =
  			(struct Identity *)malloc(sizeof(struct Identity));
--- 1598,1604 ----
  	    cb_conn=NULL;
  	    H_LOCK;
  	    if ((code == RXGEN_OPCODE) || 
! 		((code == 0) && (afs_uuid_equal(&interf.uuid, &nulluuid)))) {
  		if (!identP)
  		    identP =
  			(struct Identity *)malloc(sizeof(struct Identity));
Index: openafs/src/viced/host.h
diff -c openafs/src/viced/host.h:1.9.2.12 openafs/src/viced/host.h:1.9.2.14
*** openafs/src/viced/host.h:1.9.2.12	Wed Aug  8 16:36:18 2007
--- openafs/src/viced/host.h	Mon Mar 10 18:35:37 2008
***************
*** 205,212 ****
  extern int DeleteAllCallBacks_r(struct host *host, int deletefe);
  extern struct host *h_Alloc(register struct rx_connection *r_con);
  extern struct host *h_Alloc_r(register struct rx_connection *r_con);
! extern struct host *h_Lookup_r(afs_uint32 hostaddr, afs_uint16 hport,
! 			       int *heldp);
  extern void   hashInsert_r(afs_uint32 addr, afs_uint16 port, 
  			   struct host* host);
  extern struct host *h_LookupUuid_r(afsUUID * uuidp);
--- 205,212 ----
  extern int DeleteAllCallBacks_r(struct host *host, int deletefe);
  extern struct host *h_Alloc(register struct rx_connection *r_con);
  extern struct host *h_Alloc_r(register struct rx_connection *r_con);
! extern int h_Lookup_r(afs_uint32 hostaddr, afs_uint16 hport,
! 			       int *heldp, struct host **hostp);
  extern void   hashInsert_r(afs_uint32 addr, afs_uint16 port, 
  			   struct host* host);
  extern struct host *h_LookupUuid_r(afsUUID * uuidp);
***************
*** 230,235 ****
--- 230,237 ----
  extern int removeInterfaceAddr_r(struct host *host, afs_uint32 addr, afs_uint16 port);
  extern int removeAddress_r(struct host *host, afs_uint32 addr, afs_uint16 port);
  
+ extern void *ShutDown(void *);
+ 
  struct Interface *MultiVerifyInterface_r();
  
  struct host *(hosttableptrs[h_MAXHOSTTABLES]);	/* Used by h_itoh */
Index: openafs/src/viced/physio.c
diff -c openafs/src/viced/physio.c:1.14 openafs/src/viced/physio.c:1.14.2.1
*** openafs/src/viced/physio.c:1.14	Sun Dec  7 20:45:34 2003
--- openafs/src/viced/physio.c	Tue Oct 30 11:24:11 2007
***************
*** 17,26 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/viced/physio.c,v 1.14 2003/12/08 01:45:34 jaltman Exp $");
  
  #include <stdio.h>
  #include <errno.h>
  #ifdef AFS_NT40_ENV
  #include <fcntl.h>
  #else
--- 17,27 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/viced/physio.c,v 1.14.2.1 2007/10/30 15:24:11 shadow Exp $");
  
  #include <stdio.h>
  #include <errno.h>
+ #include <string.h>
  #ifdef AFS_NT40_ENV
  #include <fcntl.h>
  #else
***************
*** 28,40 ****
  #include <sys/time.h>
  #include <unistd.h>
  #endif
- #ifdef HAVE_STRING_H
- #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <afs/nfs.h>
  #include <afs/assert.h>
  #include <lwp.h>
--- 29,34 ----
Index: openafs/src/viced/viced.c
diff -c openafs/src/viced/viced.c:1.58.2.19.2.1 openafs/src/viced/viced.c:1.58.2.27
*** openafs/src/viced/viced.c:1.58.2.19.2.1	Thu Dec 13 16:00:43 2007
--- openafs/src/viced/viced.c	Tue Mar 11 13:40:55 2008
***************
*** 20,30 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/viced/viced.c,v 1.58.2.19.2.1 2007/12/13 21:00:43 shadow Exp $");
  
  #include <stdio.h>
  #include <stdlib.h>
  #include <errno.h>
  #include <sys/types.h>
  #include <afs/procmgmt.h>	/* signal(), kill(), wait(), etc. */
  #include <sys/stat.h>
--- 20,31 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/viced/viced.c,v 1.58.2.27 2008/03/11 17:40:55 shadow Exp $");
  
  #include <stdio.h>
  #include <stdlib.h>
  #include <errno.h>
+ #include <string.h>
  #include <sys/types.h>
  #include <afs/procmgmt.h>	/* signal(), kill(), wait(), etc. */
  #include <sys/stat.h>
***************
*** 39,52 ****
  #include <netdb.h>
  #include <unistd.h>		/* sysconf() */
  
- #ifdef HAVE_STRING_H
- #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
- 
  #ifndef ITIMER_REAL
  #include <sys/time.h>
  #endif /* ITIMER_REAL */
--- 40,45 ----
***************
*** 113,122 ****
  extern int LogLevel, etext;
  extern afs_int32 BlocksSpare, PctSpare;
  
! void ShutDown(void);
  static void ClearXStatValues(), NewParms(), PrintCounters();
  static void ResetCheckDescriptors(void), ResetCheckSignal(void);
! static void CheckSignal(void);
  extern int GetKeysFromToken();
  extern int RXAFS_ExecuteRequest();
  extern int RXSTATS_ExecuteRequest();
--- 106,115 ----
  extern int LogLevel, etext;
  extern afs_int32 BlocksSpare, PctSpare;
  
! void *ShutDown(void *);
  static void ClearXStatValues(), NewParms(), PrintCounters();
  static void ResetCheckDescriptors(void), ResetCheckSignal(void);
! static void *CheckSignal(void *);
  extern int GetKeysFromToken();
  extern int RXAFS_ExecuteRequest();
  extern int RXSTATS_ExecuteRequest();
***************
*** 166,171 ****
--- 159,165 ----
  int printBanner = 0;
  int rxJumbograms = 1;		/* default is to send and receive jumbograms. */
  int rxBind = 0;		/* don't bind */
+ int rxkadDisableDotCheck = 0;      /* disable check for dot in principal name */ 
  int rxMaxMTU = -1;
  afs_int32 implicitAdminRights = PRSFS_LOOKUP;	/* The ADMINISTER right is 
  						 * already implied */
***************
*** 220,227 ****
   */
  
  /* DEBUG HACK */
! static void
! CheckDescriptors()
  {
  #ifndef AFS_NT40_ENV
      struct afs_stat status;
--- 214,221 ----
   */
  
  /* DEBUG HACK */
! static void *
! CheckDescriptors(void *unused)
  {
  #ifndef AFS_NT40_ENV
      struct afs_stat status;
***************
*** 237,242 ****
--- 231,237 ----
      fflush(stdout);
      ResetCheckDescriptors();
  #endif
+     return 0;
  }				/*CheckDescriptors */
  
  
***************
*** 244,262 ****
  void
  CheckSignal_Signal(x)
  {
!     CheckSignal();
  }
  
  void
  ShutDown_Signal(x)
  {
!     ShutDown();
  }
  
  void
  CheckDescriptors_Signal(x)
  {
!     CheckDescriptors();
  }
  #else /* AFS_PTHREAD_ENV */
  void
--- 239,257 ----
  void
  CheckSignal_Signal(x)
  {
!     CheckSignal(NULL);
  }
  
  void
  ShutDown_Signal(x)
  {
!     ShutDown(NULL);
  }
  
  void
  CheckDescriptors_Signal(x)
  {
!     CheckDescriptors(NULL);
  }
  #else /* AFS_PTHREAD_ENV */
  void
***************
*** 410,417 ****
  }
  
  /* This LWP does things roughly every 5 minutes */
! static void
! FiveMinuteCheckLWP()
  {
      static int msg = 0;
      char tbuffer[32];
--- 405,412 ----
  }
  
  /* This LWP does things roughly every 5 minutes */
! static void *
! FiveMinuteCheckLWP(void *unused)
  {
      static int msg = 0;
      char tbuffer[32];
***************
*** 451,456 ****
--- 446,452 ----
  	    }
  	}
      }
+     return NULL;
  }				/*FiveMinuteCheckLWP */
  
  
***************
*** 458,465 ****
   * other 5 minute activities because it may be delayed by timeouts when
   * it probes the workstations
   */
! static void
! HostCheckLWP()
  {
      ViceLog(1, ("Starting Host check process\n"));
      setThreadId("HostCheckLWP");
--- 454,461 ----
   * other 5 minute activities because it may be delayed by timeouts when
   * it probes the workstations
   */
! static void *
! HostCheckLWP(void *unused)
  {
      ViceLog(1, ("Starting Host check process\n"));
      setThreadId("HostCheckLWP");
***************
*** 472,485 ****
  	ViceLog(2, ("Checking for dead venii & clients\n"));
  	h_CheckHosts();
      }
  }				/*HostCheckLWP */
  
  /* This LWP does fsync checks every 5 minutes:  it should not be used for
   * other 5 minute activities because it may be delayed by timeouts when
   * it probes the workstations
   */
! static
! FsyncCheckLWP()
  {
      afs_int32 code;
  #ifdef AFS_PTHREAD_ENV
--- 468,482 ----
  	ViceLog(2, ("Checking for dead venii & clients\n"));
  	h_CheckHosts();
      }
+     return NULL;
  }				/*HostCheckLWP */
  
  /* This LWP does fsync checks every 5 minutes:  it should not be used for
   * other 5 minute activities because it may be delayed by timeouts when
   * it probes the workstations
   */
! static void *
! FsyncCheckLWP(void *unused)
  {
      afs_int32 code;
  #ifdef AFS_PTHREAD_ENV
***************
*** 489,499 ****
  
      setThreadId("FsyncCheckLWP");
  
- #ifdef AFS_PTHREAD_ENV
-     assert(pthread_cond_init(&fsync_cond, NULL) == 0);
-     assert(pthread_mutex_init(&fsync_glock_mutex, NULL) == 0);
- #endif
- 
      while (1) {
  	FSYNC_LOCK;
  #ifdef AFS_PTHREAD_ENV
--- 486,491 ----
***************
*** 516,521 ****
--- 508,514 ----
  	    code = BreakLaterCallBacks();
  	} while (code != 0);
      }
+     return NULL;
  }
  
  /*------------------------------------------------------------------------
***************
*** 630,637 ****
  
  
  
! static void
! CheckSignal()
  {
      if (FS_registered > 0) {
  	/*
--- 623,630 ----
  
  
  
! static void *
! CheckSignal(void *unused)
  {
      if (FS_registered > 0) {
  	/*
***************
*** 645,651 ****
      DumpCallBackState();
      PrintCounters();
      ResetCheckSignal();
! 
  }				/*CheckSignal */
  
  void
--- 638,644 ----
      DumpCallBackState();
      PrintCounters();
      ResetCheckSignal();
!     return NULL;
  }				/*CheckSignal */
  
  void
***************
*** 706,715 ****
  
  }				/*ShutDown */
  
! void
! ShutDown(void)
  {				/* backward compatibility */
      ShutDownAndCore(DONTPANIC);
  }
  
  
--- 699,709 ----
  
  }				/*ShutDown */
  
! void *
! ShutDown(void *unused)
  {				/* backward compatibility */
      ShutDownAndCore(DONTPANIC);
+     return NULL;
  }
  
  
***************
*** 745,750 ****
--- 739,745 ----
      strcat(buffer, "[-rxdbge (enable rxevent debugging)] ");
      strcat(buffer, "[-rxmaxmtu <bytes>] ");
      strcat(buffer, "[-rxbind (bind the Rx socket to one address)] ");
+     strcat(buffer, "[-allow-dotted-principals (disable the rxkad principal name dot check)] ");
  #if AFS_PTHREAD_ENV
      strcat(buffer, "[-vattachpar <number of volume attach threads>] ");
  #endif
***************
*** 1063,1068 ****
--- 1058,1065 ----
  	    rxJumbograms = 0;
  	} else if (!strcmp(argv[i], "-rxbind")) {
  	    rxBind = 1;
+ 	} else if (!strcmp(argv[i], "-allow-dotted-principals")) {
+ 	    rxkadDisableDotCheck = 1;
  	} else if (!strcmp(argv[i], "-rxmaxmtu")) {
  	    if ((i + 1) >= argc) {
  		fprintf(stderr, "missing argument for -rxmaxmtu\n"); 
***************
*** 1826,1837 ****
      rx_SetBusyThreshold(busy_threshold, VBUSY);
      rx_SetCallAbortThreshold(abort_threshold);
      rx_SetConnAbortThreshold(abort_threshold);
      stackSize = lwps * 4000;
      if (stackSize < 32000)
  	stackSize = 32000;
      else if (stackSize > 44000)
  	stackSize = 44000;
! #if    defined(AFS_HPUX_ENV) || defined(AFS_SUN_ENV) || defined(AFS_SGI51_ENV)
      rx_SetStackSize(1, stackSize);
  #endif
      if (udpBufSize)
--- 1823,1838 ----
      rx_SetBusyThreshold(busy_threshold, VBUSY);
      rx_SetCallAbortThreshold(abort_threshold);
      rx_SetConnAbortThreshold(abort_threshold);
+ #ifdef AFS_XBSD_ENV
+     stackSize = 128 * 1024;
+ #else
      stackSize = lwps * 4000;
      if (stackSize < 32000)
  	stackSize = 32000;
      else if (stackSize > 44000)
  	stackSize = 44000;
! #endif
! #if defined(AFS_HPUX_ENV) || defined(AFS_SUN_ENV) || defined(AFS_SGI51_ENV) || defined(AFS_XBSD_ENV)
      rx_SetStackSize(1, stackSize);
  #endif
      if (udpBufSize)
***************
*** 1866,1871 ****
--- 1867,1877 ----
  		("Failed to initialize RX, probably two servers running.\n"));
  	exit(-1);
      }
+     if (rxkadDisableDotCheck) {
+         rx_SetSecurityConfiguration(tservice, RXS_CONFIG_FLAGS,
+                                     (void *)RXS_CONFIG_FLAGS_DISABLE_DOTCHECK,
+                                     NULL);
+     }
      rx_SetMinProcs(tservice, 3);
      rx_SetMaxProcs(tservice, lwps);
      rx_SetCheckReach(tservice, 1);
***************
*** 1916,1921 ****
--- 1922,1932 ----
      /* allow super users to manage RX statistics */
      rx_SetRxStatUserOk(fs_rxstat_userok);
  
+ #ifdef AFS_PTHREAD_ENV
+     assert(pthread_cond_init(&fsync_cond, NULL) == 0);
+     assert(pthread_mutex_init(&fsync_glock_mutex, NULL) == 0);
+ #endif
+ 
      rx_StartServer(0);		/* now start handling requests */
  
      /* we ensure that there is enough space in the vnode buffer to satisfy
***************
*** 1961,1985 ****
      assert(pthread_attr_setdetachstate(&tattr, PTHREAD_CREATE_DETACHED) == 0);
  
      assert(pthread_create
! 	   (&serverPid, &tattr, (void *)FiveMinuteCheckLWP,
  	    &fiveminutes) == 0);
      assert(pthread_create
! 	   (&serverPid, &tattr, (void *)HostCheckLWP, &fiveminutes) == 0);
      assert(pthread_create
! 	   (&serverPid, &tattr, (void *)FsyncCheckLWP, &fiveminutes) == 0);
  #else /* AFS_PTHREAD_ENV */
      ViceLog(5, ("Starting LWP\n"));
      assert(LWP_CreateProcess
  	   (FiveMinuteCheckLWP, stack * 1024, LWP_MAX_PRIORITY - 2,
! 	    (void *)&fiveminutes, "FiveMinuteChecks",
  	    &serverPid) == LWP_SUCCESS);
  
      assert(LWP_CreateProcess
  	   (HostCheckLWP, stack * 1024, LWP_MAX_PRIORITY - 2,
! 	    (void *)&fiveminutes, "HostCheck", &serverPid) == LWP_SUCCESS);
      assert(LWP_CreateProcess
  	   (FsyncCheckLWP, stack * 1024, LWP_MAX_PRIORITY - 2,
! 	    (void *)&fiveminutes, "FsyncCheck", &serverPid) == LWP_SUCCESS);
  #endif /* AFS_PTHREAD_ENV */
  
      TM_GetTimeOfDay(&tp, 0);
--- 1972,1996 ----
      assert(pthread_attr_setdetachstate(&tattr, PTHREAD_CREATE_DETACHED) == 0);
  
      assert(pthread_create
! 	   (&serverPid, &tattr, FiveMinuteCheckLWP,
  	    &fiveminutes) == 0);
      assert(pthread_create
! 	   (&serverPid, &tattr, HostCheckLWP, &fiveminutes) == 0);
      assert(pthread_create
! 	   (&serverPid, &tattr, FsyncCheckLWP, &fiveminutes) == 0);
  #else /* AFS_PTHREAD_ENV */
      ViceLog(5, ("Starting LWP\n"));
      assert(LWP_CreateProcess
  	   (FiveMinuteCheckLWP, stack * 1024, LWP_MAX_PRIORITY - 2,
! 	    &fiveminutes, "FiveMinuteChecks",
  	    &serverPid) == LWP_SUCCESS);
  
      assert(LWP_CreateProcess
  	   (HostCheckLWP, stack * 1024, LWP_MAX_PRIORITY - 2,
! 	    &fiveminutes, "HostCheck", &serverPid) == LWP_SUCCESS);
      assert(LWP_CreateProcess
  	   (FsyncCheckLWP, stack * 1024, LWP_MAX_PRIORITY - 2,
! 	    &fiveminutes, "FsyncCheck", &serverPid) == LWP_SUCCESS);
  #endif /* AFS_PTHREAD_ENV */
  
      TM_GetTimeOfDay(&tp, 0);
***************
*** 2039,2042 ****
--- 2050,2054 ----
  #else /* AFS_PTHREAD_ENV */
      assert(LWP_WaitProcess(&parentPid) == LWP_SUCCESS);
  #endif /* AFS_PTHREAD_ENV */
+     return 0;
  }
Index: openafs/src/vlserver/Makefile.in
diff -c openafs/src/vlserver/Makefile.in:1.12.2.1 openafs/src/vlserver/Makefile.in:1.12.2.2
*** openafs/src/vlserver/Makefile.in:1.12.2.1	Mon Jul 31 13:07:52 2006
--- openafs/src/vlserver/Makefile.in	Thu Nov  1 12:06:01 2007
***************
*** 72,97 ****
  vldbint.xdr.o: vldbint.xdr.c vldbint.h
  
  vldbint.cs.c: vldbint.xg
! 	${RXGEN} -u -x -C -o $@ ${srcdir}/vldbint.xg
  
  vldbint.ss.c: vldbint.xg
! 	${RXGEN} -x -S -o $@ ${srcdir}/vldbint.xg
  
  vldbint.xdr.c: vldbint.xg
! 	${RXGEN} -x -c -o $@ ${srcdir}/vldbint.xg
  
  vldbint.h: vldbint.xg
! 	${RXGEN} -u -x -h -o $@ ${srcdir}/vldbint.xg
  
  vldbint.cs.c: vldbint.h
  vldbint.ss.c: vldbint.h
  vldbint.xdr.c: vldbint.h
  
  Kvldbint.cs.c: vldbint.xg
! 	${RXGEN} -x -k -C -o $@ ${srcdir}/vldbint.xg
  
  Kvldbint.xdr.c: vldbint.xg
! 	${RXGEN} -x -k -c -o $@ ${srcdir}/vldbint.xg
  
  libvldb.a: $(OBJS) AFS_component_version_number.o
  	$(RM) -f $@
--- 72,97 ----
  vldbint.xdr.o: vldbint.xdr.c vldbint.h
  
  vldbint.cs.c: vldbint.xg
! 	${RXGEN} -A -u -x -C -o $@ ${srcdir}/vldbint.xg
  
  vldbint.ss.c: vldbint.xg
! 	${RXGEN} -A -x -S -o $@ ${srcdir}/vldbint.xg
  
  vldbint.xdr.c: vldbint.xg
! 	${RXGEN} -A -x -c -o $@ ${srcdir}/vldbint.xg
  
  vldbint.h: vldbint.xg
! 	${RXGEN} -A -u -x -h -o $@ ${srcdir}/vldbint.xg
  
  vldbint.cs.c: vldbint.h
  vldbint.ss.c: vldbint.h
  vldbint.xdr.c: vldbint.h
  
  Kvldbint.cs.c: vldbint.xg
! 	${RXGEN} -A -x -k -C -o $@ ${srcdir}/vldbint.xg
  
  Kvldbint.xdr.c: vldbint.xg
! 	${RXGEN} -A -x -k -c -o $@ ${srcdir}/vldbint.xg
  
  libvldb.a: $(OBJS) AFS_component_version_number.o
  	$(RM) -f $@
Index: openafs/src/vlserver/cnvldb.c
diff -c openafs/src/vlserver/cnvldb.c:1.9 openafs/src/vlserver/cnvldb.c:1.9.2.4
*** openafs/src/vlserver/cnvldb.c:1.9	Tue Jul 15 19:17:33 2003
--- openafs/src/vlserver/cnvldb.c	Sun Dec  9 18:37:17 2007
***************
*** 11,31 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vlserver/cnvldb.c,v 1.9 2003/07/15 23:17:33 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
  #include <errno.h>
  #include <stdio.h>
  #include <sys/file.h>
- 
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  
  #include "cnvldb.h"		/* CHANGEME! */
  #include <netinet/in.h>
--- 11,24 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vlserver/cnvldb.c,v 1.9.2.4 2007/12/09 23:37:17 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
  #include <errno.h>
  #include <stdio.h>
  #include <sys/file.h>
  #include <string.h>
  
  #include "cnvldb.h"		/* CHANGEME! */
  #include <netinet/in.h>
***************
*** 40,46 ****
  #define	BADSERVERID	255	/* XXX */
  
  
- extern struct cmd_syndesc *cmd_CreateSyntax();
  static char pn[] = "cnvldb";
  static char tempname[] = "XXnewvldb";
  static char space[MAXSIZE];
--- 33,38 ----
***************
*** 52,57 ****
--- 44,53 ----
  static int rewrite_header();
  
  static char tspace[1024];	/* chdir can't handle anything bigger, anyway */
+ 
+ void read_mhentries(afs_uint32 mh_addr, int oldfd);
+ void convert_mhentries(int oldfd, int newfd, struct vlheader_2 *header, int fromver, int tover);
+ 
  /* return a static pointer to a buffer */
  static char *
  Parent(apath)
***************
*** 74,82 ****
  char *pathname = NULL;
  const char *dbPath;
  
! static
! handleit(as)
!      struct cmd_syndesc *as;
  {
      register struct cmd_item *ti;
      register afs_int32 code;
--- 70,77 ----
  char *pathname = NULL;
  const char *dbPath;
  
! static int
! handleit(struct cmd_syndesc *as, void *arock)
  {
      register struct cmd_item *ti;
      register afs_int32 code;
***************
*** 366,371 ****
--- 361,367 ----
   * verifying their address is not pass the EOF and the flags are good.
   * If it's not good, then don't read the block in.
   */
+ void
  read_mhentries(mh_addr, oldfd)
       int oldfd;
       afs_uint32 mh_addr;
***************
*** 472,477 ****
--- 468,474 ----
   * 
   * Before this can be called, the routine read_mhentries must be called.
   */
+ void
  convert_mhentries(oldfd, newfd, header, fromver, tover)
       int oldfd, newfd;
       struct vlheader_2 *header;
***************
*** 997,1003 ****
      register struct cmd_syndesc *ts;
      afs_int32 code;
  
!     ts = cmd_CreateSyntax("initcmd", handleit, 0, "optional");
      cmd_AddParm(ts, "-to", CMD_SINGLE, CMD_OPTIONAL, "goal version");
      cmd_AddParm(ts, "-from", CMD_SINGLE, CMD_OPTIONAL, "current version");
      cmd_AddParm(ts, "-path", CMD_SINGLE, CMD_OPTIONAL, "pathname");
--- 994,1000 ----
      register struct cmd_syndesc *ts;
      afs_int32 code;
  
!     ts = cmd_CreateSyntax("initcmd", handleit, NULL, "optional");
      cmd_AddParm(ts, "-to", CMD_SINGLE, CMD_OPTIONAL, "goal version");
      cmd_AddParm(ts, "-from", CMD_SINGLE, CMD_OPTIONAL, "current version");
      cmd_AddParm(ts, "-path", CMD_SINGLE, CMD_OPTIONAL, "pathname");
Index: openafs/src/vlserver/sascnvldb.c
diff -c openafs/src/vlserver/sascnvldb.c:1.7 openafs/src/vlserver/sascnvldb.c:1.7.2.1
*** openafs/src/vlserver/sascnvldb.c:1.7	Tue Jul 15 19:17:34 2003
--- openafs/src/vlserver/sascnvldb.c	Wed Oct 31 00:13:51 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vlserver/sascnvldb.c,v 1.7 2003/07/15 23:17:34 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vlserver/sascnvldb.c,v 1.7.2.1 2007/10/31 04:13:51 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 21,26 ****
--- 21,27 ----
  #include "cnvldb.h"		/* CHANGEME! */
  #include <netinet/in.h>
  #include <afs/venus.h>
+ #include <afs/cmd.h>
  
  #ifdef notdef
  #include <afs/vice.h>
***************
*** 37,43 ****
  #define MAXSIZE 2048		/* most I'll get back from PIOCTL */
  
  
- extern struct cmd_syndesc *cmd_CreateSyntax();
  static char pn[] = "cnvldb";
  static char tempname[] = "XXnewvldb";
  static char space[MAXSIZE];
--- 38,43 ----
***************
*** 149,157 ****
  }
  
  
! static
! ListQuotaCmd(as)
!      register struct cmd_syndesc *as;
  {
      register afs_int32 code;
      struct ViceIoctl blob;
--- 149,156 ----
  }
  
  
! static int
! ListQuotaCmd(register struct cmd_syndesc *as, void *arock)
  {
      register afs_int32 code;
      struct ViceIoctl blob;
Index: openafs/src/vlserver/vlclient.c
diff -c openafs/src/vlserver/vlclient.c:1.12.2.1 openafs/src/vlserver/vlclient.c:1.12.2.3
*** openafs/src/vlserver/vlclient.c:1.12.2.1	Mon Oct 18 03:12:25 2004
--- openafs/src/vlserver/vlclient.c	Wed Oct 31 00:13:51 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vlserver/vlclient.c,v 1.12.2.1 2004/10/18 07:12:25 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vlserver/vlclient.c,v 1.12.2.3 2007/10/31 04:13:51 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 38,51 ****
  #include <netinet/in.h>
  #endif
  #include <stdio.h>
- 
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  
  #include <afs/afsutil.h>
  #include <rx/xdr.h>
--- 38,44 ----
***************
*** 192,200 ****
  }
  
  
! static
! handleit(as)
!      struct cmd_syndesc *as;
  {
      register struct cmd_item *ti;
      register afs_int32 code, server = 0, sawserver = 0;
--- 185,192 ----
  }
  
  
! static int
! handleit(struct cmd_syndesc *as, void *arock)
  {
      register struct cmd_item *ti;
      register afs_int32 code, server = 0, sawserver = 0;
***************
*** 1038,1044 ****
      afs_int32 code;
  
      strcpy(confdir, AFSDIR_CLIENT_ETC_DIRPATH);
!     ts = cmd_CreateSyntax("initcmd", handleit, 0, "initialize the program");
      cmd_AddParm(ts, "-cellpath", CMD_LIST, CMD_OPTIONAL,
  		"Cell configuration directory");
      cmd_AddParm(ts, "-server", CMD_LIST, CMD_OPTIONAL,
--- 1030,1036 ----
      afs_int32 code;
  
      strcpy(confdir, AFSDIR_CLIENT_ETC_DIRPATH);
!     ts = cmd_CreateSyntax("initcmd", handleit, NULL, "initialize the program");
      cmd_AddParm(ts, "-cellpath", CMD_LIST, CMD_OPTIONAL,
  		"Cell configuration directory");
      cmd_AddParm(ts, "-server", CMD_LIST, CMD_OPTIONAL,
Index: openafs/src/vlserver/vldb_check.c
diff -c openafs/src/vlserver/vldb_check.c:1.11.2.1 openafs/src/vlserver/vldb_check.c:1.11.2.5
*** openafs/src/vlserver/vldb_check.c:1.11.2.1	Sat Dec 16 01:26:42 2006
--- openafs/src/vlserver/vldb_check.c	Tue Dec 11 15:45:29 2007
***************
*** 33,44 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vlserver/vldb_check.c,v 1.11.2.1 2006/12/16 06:26:42 shadow Exp $");
  
  #include <sys/types.h>
  #include <sys/stat.h>
  #include <fcntl.h>
  #include <errno.h>
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #include <WINNT/afsevent.h>
--- 33,45 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vlserver/vldb_check.c,v 1.11.2.5 2007/12/11 20:45:29 shadow Exp $");
  
  #include <sys/types.h>
  #include <sys/stat.h>
  #include <fcntl.h>
  #include <errno.h>
+ #include <string.h>
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #include <WINNT/afsevent.h>
***************
*** 49,62 ****
  #include <netinet/in.h>
  #endif
  
- #ifdef HAVE_STRING_H
- #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
- 
  #include "vlserver.h"
  #include "vldbint.h"
  #include <ubik.h>
--- 50,55 ----
***************
*** 265,270 ****
--- 258,264 ----
      if (headerp->vital_header.headersize != sizeof(*headerp))
  	printf("Header reports its size as %d (should be %d)\n",
  	       headerp->vital_header.headersize, sizeof(*headerp));
+     return;
  }
  
  void
***************
*** 321,326 ****
--- 315,321 ----
  	for (j = 0; j < VL_MAXIPADDRS_PERMH; j++)
  	    e->ex_addrs[j] = ntohl(e->ex_addrs[j]);
      }
+     return;
  }
  
  void
***************
*** 399,404 ****
--- 394,400 ----
  	    }
  	}
      }
+     return;
  }
  
  void
***************
*** 693,698 ****
--- 689,695 ----
  	    ("%d entries in name hash, longest is %d, shortest is %d, average length is %f\n",
  	     count, longest, shortest, ((float)count / (float)HASHSIZE));
      }
+     return;
  }
  
  /*
***************
*** 768,773 ****
--- 765,771 ----
  		 ((float)count / (float)HASHSIZE));
  	}
      }
+     return;
  }
  
  /*
***************
*** 812,817 ****
--- 810,816 ----
      }
      if (verbose)
  	printf("%d entries on free chain\n", count);
+     return;
  }
  
  /*
***************
*** 1022,1028 ****
  	printf("%d simple entries, %d multihomed entries, Total = %d\n",
  	       regentries, mhentries, mhentries + regentries);
      }
! 
  }
  
  void 
--- 1021,1027 ----
  	printf("%d simple entries, %d multihomed entries, Total = %d\n",
  	       regentries, mhentries, mhentries + regentries);
      }
!     return;
  }
  
  void 
***************
*** 1034,1040 ****
  }
  
  int
! WorkerBee(struct cmd_syndesc *as, char *arock)
  {
      char *dbfile;
      afs_int32 maxentries, type, tmp;
--- 1033,1039 ----
  }
  
  int
! WorkerBee(struct cmd_syndesc *as, void *arock)
  {
      char *dbfile;
      afs_int32 maxentries, type, tmp;
Index: openafs/src/vlserver/vldbint.xg
diff -c openafs/src/vlserver/vldbint.xg:1.5 openafs/src/vlserver/vldbint.xg:1.5.6.1
*** openafs/src/vlserver/vldbint.xg:1.5	Sat Jun  8 07:01:59 2002
--- openafs/src/vlserver/vldbint.xg	Tue Feb  5 13:56:29 2008
***************
*** 225,231 ****
   */
  
  ProbeServer(
! ) = VLPROBE;
  
  /*
   * VL_GetEntryByName was renamed to VL_GetEntryByNameO to avoid
--- 225,231 ----
   */
  
  ProbeServer(
! ) multi = VLPROBE;
  
  /*
   * VL_GetEntryByName was renamed to VL_GetEntryByNameO to avoid
Index: openafs/src/vlserver/vlprocs.c
diff -c openafs/src/vlserver/vlprocs.c:1.13.2.2 openafs/src/vlserver/vlprocs.c:1.13.2.4
*** openafs/src/vlserver/vlprocs.c:1.13.2.2	Tue Jun 21 16:19:29 2005
--- openafs/src/vlserver/vlprocs.c	Mon Nov 26 16:21:57 2007
***************
*** 11,20 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vlserver/vlprocs.c,v 1.13.2.2 2005/06/21 20:19:29 shadow Exp $");
  
  #include <sys/types.h>
  #include <stdio.h>
  #include <lock.h>
  #include <afs/afsutil.h>
  #include <ubik.h>
--- 11,21 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vlserver/vlprocs.c,v 1.13.2.4 2007/11/26 21:21:57 shadow Exp $");
  
  #include <sys/types.h>
  #include <stdio.h>
+ #include <string.h>
  #include <lock.h>
  #include <afs/afsutil.h>
  #include <ubik.h>
***************
*** 25,37 ****
  #else
  #include <netinet/in.h>
  #endif
- #ifdef HAVE_STRING_H
- #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <afs/keys.h>
  #include "vlserver.h"
  #include "afs/audit.h"
--- 26,31 ----
***************
*** 61,77 ****
  static int put_attributeentry();
  static int put_nattributeentry();
  static int RemoveEntry();
! static ReleaseEntry();
  static int check_vldbentry();
  static int check_nvldbentry();
  static int vldbentry_to_vlentry();
  static int nvldbentry_to_vlentry();
  static get_vldbupdateentry();
  static int repsite_exists();
! static repsite_compress();
! static vlentry_to_vldbentry();
! static vlentry_to_nvldbentry();
! static vlentry_to_uvldbentry();
  static int InvalidVolname();
  static int InvalidVoltype();
  static int InvalidOperation();
--- 55,71 ----
  static int put_attributeentry();
  static int put_nattributeentry();
  static int RemoveEntry();
! static void ReleaseEntry();
  static int check_vldbentry();
  static int check_nvldbentry();
  static int vldbentry_to_vlentry();
  static int nvldbentry_to_vlentry();
  static get_vldbupdateentry();
  static int repsite_exists();
! static void repsite_compress();
! static void vlentry_to_vldbentry();
! static void vlentry_to_nvldbentry();
! static void vlentry_to_uvldbentry();
  static int InvalidVolname();
  static int InvalidVoltype();
  static int InvalidOperation();
***************
*** 2562,2568 ****
      return 0;
  }
  
! static
  ReleaseEntry(tentry, releasetype)
       struct nvlentry *tentry;
       afs_int32 releasetype;
--- 2556,2562 ----
      return 0;
  }
  
! static void
  ReleaseEntry(tentry, releasetype)
       struct nvlentry *tentry;
       afs_int32 releasetype;
***************
*** 2867,2873 ****
  
  
  /* Repsite table compression: used when deleting a repsite entry so that all active repsite entries are on the top of the table. */
! static
  repsite_compress(VlEntry, offset)
       struct nvlentry *VlEntry;
       int offset;
--- 2861,2867 ----
  
  
  /* Repsite table compression: used when deleting a repsite entry so that all active repsite entries are on the top of the table. */
! static void
  repsite_compress(VlEntry, offset)
       struct nvlentry *VlEntry;
       int offset;
***************
*** 2888,2894 ****
  
  
  /* Convert from the internal (compacted) vldb entry to the external representation used by the interface. */
! static
  vlentry_to_vldbentry(VlEntry, VldbEntry)
       struct nvlentry *VlEntry;
       struct vldbentry *VldbEntry;
--- 2882,2888 ----
  
  
  /* Convert from the internal (compacted) vldb entry to the external representation used by the interface. */
! static void
  vlentry_to_vldbentry(VlEntry, VldbEntry)
       struct nvlentry *VlEntry;
       struct vldbentry *VldbEntry;
***************
*** 2930,2936 ****
  
  
  /* Convert from the internal (compacted) vldb entry to the external representation used by the interface. */
! static
  vlentry_to_nvldbentry(VlEntry, VldbEntry)
       struct nvlentry *VlEntry;
       struct nvldbentry *VldbEntry;
--- 2924,2930 ----
  
  
  /* Convert from the internal (compacted) vldb entry to the external representation used by the interface. */
! static void
  vlentry_to_nvldbentry(VlEntry, VldbEntry)
       struct nvlentry *VlEntry;
       struct nvldbentry *VldbEntry;
***************
*** 2970,2976 ****
      VldbEntry->flags = VlEntry->flags;
  }
  
! static
  vlentry_to_uvldbentry(VlEntry, VldbEntry)
       struct nvlentry *VlEntry;
       struct uvldbentry *VldbEntry;
--- 2964,2970 ----
      VldbEntry->flags = VlEntry->flags;
  }
  
! static void
  vlentry_to_uvldbentry(VlEntry, VldbEntry)
       struct nvlentry *VlEntry;
       struct uvldbentry *VldbEntry;
Index: openafs/src/vlserver/vlserver.c
diff -c openafs/src/vlserver/vlserver.c:1.18.2.6 openafs/src/vlserver/vlserver.c:1.18.2.11
*** openafs/src/vlserver/vlserver.c:1.18.2.6	Tue Jun 20 16:35:01 2006
--- openafs/src/vlserver/vlserver.c	Mon Mar 10 18:35:37 2008
***************
*** 11,22 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vlserver/vlserver.c,v 1.18.2.6 2006/06/20 20:35:01 jaltman Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
  #include <signal.h>
  #include <sys/stat.h>
  #ifdef HAVE_FCNTL_H
  #include <fcntl.h>
  #endif
--- 11,23 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vlserver/vlserver.c,v 1.18.2.11 2008/03/10 22:35:37 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
  #include <signal.h>
  #include <sys/stat.h>
+ #include <string.h>
  #ifdef HAVE_FCNTL_H
  #include <fcntl.h>
  #endif
***************
*** 36,49 ****
  #endif
  #include <stdio.h>
  
- #ifdef HAVE_STRING_H
- #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
- 
  #include <rx/xdr.h>
  #include <rx/rx.h>
  #include <rx/rx_globals.h>
--- 37,42 ----
***************
*** 67,78 ****
  extern int afsconf_CheckAuth();
  extern int afsconf_ServerAuth();
  
! static CheckSignal();
  int LogLevel = 0;
  int smallMem = 0;
  int rxJumbograms = 1;		/* default is to send and receive jumbo grams */
  int rxMaxMTU = -1;
  afs_int32 rxBind = 0;
  
  #define ADDRSPERSITE 16         /* Same global is in rx/rx_user.c */
  afs_uint32 SHostAddrs[ADDRSPERSITE];
--- 60,72 ----
  extern int afsconf_CheckAuth();
  extern int afsconf_ServerAuth();
  
! static void *CheckSignal(void*);
  int LogLevel = 0;
  int smallMem = 0;
  int rxJumbograms = 1;		/* default is to send and receive jumbo grams */
  int rxMaxMTU = -1;
  afs_int32 rxBind = 0;
+ int rxkadDisableDotCheck = 0;
  
  #define ADDRSPERSITE 16         /* Same global is in rx/rx_user.c */
  afs_uint32 SHostAddrs[ADDRSPERSITE];
***************
*** 83,90 ****
      IOMGR_SoftSig(CheckSignal, 0);
  }
  
! static
! CheckSignal()
  {
      register int i, errorcode;
      struct ubik_trans *trans;
--- 77,84 ----
      IOMGR_SoftSig(CheckSignal, 0);
  }
  
! static void *
! CheckSignal(void *unused)
  {
      register int i, errorcode;
      struct ubik_trans *trans;
***************
*** 100,106 ****
      for (i = 0; i < HASHSIZE; i++) {
  	HashIdDump(trans, i);
      }
!     return (ubik_EndTrans(trans));
  }				/*CheckSignal */
  
  
--- 94,100 ----
      for (i = 0; i < HASHSIZE; i++) {
  	HashIdDump(trans, i);
      }
!     return ((void *)ubik_EndTrans(trans));
  }				/*CheckSignal */
  
  
***************
*** 186,192 ****
  
  	} else if (strcmp(argv[index], "-rxbind") == 0) {
  	    rxBind = 1;
! 
  	} else if (!strcmp(argv[index], "-rxmaxmtu")) {
  	    if ((index + 1) >= argc) {
  		fprintf(stderr, "missing argument for -rxmaxmtu\n"); 
--- 180,187 ----
  
  	} else if (strcmp(argv[index], "-rxbind") == 0) {
  	    rxBind = 1;
! 	} else if (strcmp(argv[index], "-allow-dotted-principals") == 0) {
! 	    rxkadDisableDotCheck = 1;
  	} else if (!strcmp(argv[index], "-rxmaxmtu")) {
  	    if ((index + 1) >= argc) {
  		fprintf(stderr, "missing argument for -rxmaxmtu\n"); 
***************
*** 195,201 ****
  	    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);
  		return -1;
--- 190,196 ----
  	    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);
  		return -1;
***************
*** 253,266 ****
  	    /* support help flag */
  #ifndef AFS_NT40_ENV
  	    printf("Usage: vlserver [-p <number of processes>] [-nojumbo] "
! 		   "[-rxmaxmtu <bytes>] [-rxbind] "
  		   "[-auditlog <log path>] "
  		   "[-syslog[=FACILITY]] "
  		   "[-enable_peer_stats] [-enable_process_stats] "
  		   "[-help]\n");
  #else
  	    printf("Usage: vlserver [-p <number of processes>] [-nojumbo] "
! 		   "[-rxmaxmtu <bytes>] [-rxbind] "
  		   "[-auditlog <log path>] "
  		   "[-enable_peer_stats] [-enable_process_stats] "
  		   "[-help]\n");
--- 248,261 ----
  	    /* support help flag */
  #ifndef AFS_NT40_ENV
  	    printf("Usage: vlserver [-p <number of processes>] [-nojumbo] "
! 		   "[-rxmaxmtu <bytes>] [-rxbind] [-allow-dotted-principals] "
  		   "[-auditlog <log path>] "
  		   "[-syslog[=FACILITY]] "
  		   "[-enable_peer_stats] [-enable_process_stats] "
  		   "[-help]\n");
  #else
  	    printf("Usage: vlserver [-p <number of processes>] [-nojumbo] "
! 		   "[-rxmaxmtu <bytes>] [-rxbind] [-allow-dotted-principals] "
  		   "[-auditlog <log path>] "
  		   "[-enable_peer_stats] [-enable_process_stats] "
  		   "[-help]\n");
***************
*** 393,398 ****
--- 388,399 ----
  	lwps = 4;
      rx_SetMaxProcs(tservice, lwps);
  
+     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", sc, 3,
  		      RXSTATS_ExecuteRequest);
***************
*** 416,419 ****
--- 417,422 ----
      rx_SetRxStatUserOk(vldb_rxstat_userok);
  
      rx_StartServer(1);		/* Why waste this idle process?? */
+ 
+     return 0; /* not reachable */
  }
Index: openafs/src/vlserver/vlutils.c
diff -c openafs/src/vlserver/vlutils.c:1.9 openafs/src/vlserver/vlutils.c:1.9.2.1
*** openafs/src/vlserver/vlutils.c:1.9	Sun Dec  7 17:49:42 2003
--- openafs/src/vlserver/vlutils.c	Tue Oct 30 11:24:11 2007
***************
*** 11,33 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vlserver/vlutils.c,v 1.9 2003/12/07 22:49:42 jaltman Exp $");
  
  #include <sys/types.h>
  #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 <lock.h>
  #include <rx/xdr.h>
  #include <ubik.h>
--- 11,26 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vlserver/vlutils.c,v 1.9.2.1 2007/10/30 15:24:11 shadow Exp $");
  
  #include <sys/types.h>
+ #include <string.h>
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #else
  #include <netinet/in.h>
  #endif
  
  #include <lock.h>
  #include <rx/xdr.h>
  #include <ubik.h>
Index: openafs/src/vol/Makefile.in
diff -c openafs/src/vol/Makefile.in:1.18.2.4 openafs/src/vol/Makefile.in:1.18.2.5
*** openafs/src/vol/Makefile.in:1.18.2.4	Mon Jul 31 12:50:52 2006
--- openafs/src/vol/Makefile.in	Mon Nov 12 13:31:35 2007
***************
*** 67,76 ****
  	${DESTDIR}${includedir}/afs/namei_ops.h
  
  ${DEST}/root.server/usr/afs/bin/salvager: salvager 
! 	${INSTALL} -s $? $@
  
  ${DEST}/root.server/usr/afs/bin/volinfo: volinfo
! 	${INSTALL} -s $? $@
  
  ${DEST}/lib/afs/vlib.a: vlib.a
  	${INSTALL} $? $@
--- 67,76 ----
  	${DESTDIR}${includedir}/afs/namei_ops.h
  
  ${DEST}/root.server/usr/afs/bin/salvager: salvager 
! 	${INSTALL} $? $@
  
  ${DEST}/root.server/usr/afs/bin/volinfo: volinfo
! 	${INSTALL} $? $@
  
  ${DEST}/lib/afs/vlib.a: vlib.a
  	${INSTALL} $? $@
***************
*** 79,100 ****
  	${INSTALL} $? $@
  
  ${DESTDIR}${afssrvsbindir}/fs_conv_dux40D:  fs_conv_dux40D
! 	${INSTALL} -s $? $@
  
  ${DESTDIR}${afssrvsbindir}/xfs_size_check:  xfs_size_check
! 	${INSTALL} -s $? $@
  
  ${DESTDIR}${afssrvsbindir}/fs_conv_sol26:  fs_conv_sol26
! 	${INSTALL} -s $? $@
  
  $(DEST)/root.server/usr/afs/bin/fs_conv_dux40D:  fs_conv_dux40D
! 	${INSTALL} -s $? $@
  
  $(DEST)/root.server/usr/afs/bin/xfs_size_check:  xfs_size_check
! 	${INSTALL} -s $? $@
  
  $(DEST)/root.server/usr/afs/bin/fs_conv_sol26:  fs_conv_sol26
! 	${INSTALL} -s $? $@
  
  ${DEST}/include/afs/nfs.h: nfs.h
  	${INSTALL} $? $@
--- 79,100 ----
  	${INSTALL} $? $@
  
  ${DESTDIR}${afssrvsbindir}/fs_conv_dux40D:  fs_conv_dux40D
! 	${INSTALL} $? $@
  
  ${DESTDIR}${afssrvsbindir}/xfs_size_check:  xfs_size_check
! 	${INSTALL} $? $@
  
  ${DESTDIR}${afssrvsbindir}/fs_conv_sol26:  fs_conv_sol26
! 	${INSTALL} $? $@
  
  $(DEST)/root.server/usr/afs/bin/fs_conv_dux40D:  fs_conv_dux40D
! 	${INSTALL} $? $@
  
  $(DEST)/root.server/usr/afs/bin/xfs_size_check:  xfs_size_check
! 	${INSTALL} $? $@
  
  $(DEST)/root.server/usr/afs/bin/fs_conv_sol26:  fs_conv_sol26
! 	${INSTALL} $? $@
  
  ${DEST}/include/afs/nfs.h: nfs.h
  	${INSTALL} $? $@
***************
*** 209,218 ****
  	${INSTALL} $? $@
  
  ${DESTDIR}${afssrvlibexecdir}/salvager: salvager
! 	${INSTALL} -s $? $@
  
  ${DESTDIR}${afssrvsbindir}/volinfo: volinfo
! 	${INSTALL} -s $? $@
  
  ${DESTDIR}${includedir}/afs/nfs.h: nfs.h
  	${INSTALL} $? $@
--- 209,218 ----
  	${INSTALL} $? $@
  
  ${DESTDIR}${afssrvlibexecdir}/salvager: salvager
! 	${INSTALL} $? $@
  
  ${DESTDIR}${afssrvsbindir}/volinfo: volinfo
! 	${INSTALL} $? $@
  
  ${DESTDIR}${includedir}/afs/nfs.h: nfs.h
  	${INSTALL} $? $@
Index: openafs/src/vol/clone.c
diff -c openafs/src/vol/clone.c:1.17.2.5 openafs/src/vol/clone.c:1.17.2.6
*** openafs/src/vol/clone.c:1.17.2.5	Fri May 18 01:55:13 2007
--- openafs/src/vol/clone.c	Tue Oct 30 11:24:11 2007
***************
*** 19,25 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vol/clone.c,v 1.17.2.5 2007/05/18 05:55:13 shadow Exp $");
  
  #include <sys/types.h>
  #include <stdio.h>
--- 19,25 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vol/clone.c,v 1.17.2.6 2007/10/30 15:24:11 shadow Exp $");
  
  #include <sys/types.h>
  #include <stdio.h>
***************
*** 38,50 ****
  #include <sys/file.h>
  #include <sys/time.h>
  #endif
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <errno.h>
  #include <sys/stat.h>
  
--- 38,44 ----
Index: openafs/src/vol/devname.c
diff -c openafs/src/vol/devname.c:1.13 openafs/src/vol/devname.c:1.13.2.1
*** openafs/src/vol/devname.c:1.13	Mon Dec  8 02:31:57 2003
--- openafs/src/vol/devname.c	Tue Oct 30 11:24:11 2007
***************
*** 11,21 ****
  #include <afsconfig.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vol/devname.c,v 1.13 2003/12/08 07:31:57 shadow Exp $");
  
  #include <afs/param.h>
  #include <rx/xdr.h>
  #include <afs/afsint.h>
  #include <ctype.h>
  #if !defined(AFS_SGI_ENV)
  #ifdef	AFS_OSF_ENV
--- 11,22 ----
  #include <afsconfig.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vol/devname.c,v 1.13.2.1 2007/10/30 15:24:11 shadow Exp $");
  
  #include <afs/param.h>
  #include <rx/xdr.h>
  #include <afs/afsint.h>
+ #include <string.h>
  #include <ctype.h>
  #if !defined(AFS_SGI_ENV)
  #ifdef	AFS_OSF_ENV
***************
*** 87,102 ****
  #endif /* ITIMER_REAL */
  #include "partition.h"
  
- 
- #ifdef HAVE_STRING_H
- #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
- 
- 
  /* ensure that we don't have a "/" instead of a "/dev/rxd0a" type of device.
   * returns pointer to static storage; copy it out quickly!
   */
--- 88,93 ----
Index: openafs/src/vol/fssync.c
diff -c openafs/src/vol/fssync.c:1.26.2.7 openafs/src/vol/fssync.c:1.26.2.9
*** openafs/src/vol/fssync.c:1.26.2.7	Sat Jun 23 09:46:53 2007
--- openafs/src/vol/fssync.c	Fri Mar 21 12:59:26 2008
***************
*** 51,60 ****
  #include <afs/afsutil.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vol/Attic/fssync.c,v 1.26.2.7 2007/06/23 13:46:53 shadow Exp $");
  
  #include <sys/types.h>
  #include <stdio.h>
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #include <time.h>
--- 51,61 ----
  #include <afs/afsutil.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vol/Attic/fssync.c,v 1.26.2.9 2008/03/21 16:59:26 shadow Exp $");
  
  #include <sys/types.h>
  #include <stdio.h>
+ #include <unistd.h>
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #include <time.h>
***************
*** 161,166 ****
--- 162,178 ----
   */
  struct Lock FSYNC_handler_lock;
  
+ 
+ /*
+  * On AIX, connect() and bind() require use of SUN_LEN() macro;
+  * sizeof(struct sockaddr_un) will not suffice.
+  */
+ #if defined(AFS_AIX_ENV) && defined(USE_UNIX_SOCKETS)
+ #define AFS_SOCKADDR_LEN(sa)  SUN_LEN(sa)
+ #else
+ #define AFS_SOCKADDR_LEN(sa)  sizeof(*sa)
+ #endif
+ 
  int
  FSYNC_clientInit(int f)
  {
***************
*** 176,182 ****
  
      for (;;) {
  	FS_sd = getport(&addr);
! 	if (connect(FS_sd, (struct sockaddr *)&addr, sizeof(addr)) >= 0)
  	    return 1;
  	if (!f) {
  	    FSYNC_clientFinis();
--- 188,194 ----
  
      for (;;) {
  	FS_sd = getport(&addr);
! 	if (connect(FS_sd, (struct sockaddr *)&addr, AFS_SOCKADDR_LEN(&addr)) >= 0)
  	    return 1;
  	if (!f) {
  	    FSYNC_clientFinis();
***************
*** 366,372 ****
  
      for (numTries = 0; numTries < MAX_BIND_TRIES; numTries++) {
  	if ((code =
! 	     bind(AcceptSd, (struct sockaddr *)&addr, sizeof(addr))) == 0)
  	    break;
  #ifdef USE_UNIX_SOCKETS
  	code = errno;
--- 378,384 ----
  
      for (numTries = 0; numTries < MAX_BIND_TRIES; numTries++) {
  	if ((code =
! 	     bind(AcceptSd, (struct sockaddr *)&addr, AFS_SOCKADDR_LEN(&addr))) == 0)
  	    break;
  #ifdef USE_UNIX_SOCKETS
  	code = errno;
Index: openafs/src/vol/ihandle.c
diff -c openafs/src/vol/ihandle.c:1.18.2.3 openafs/src/vol/ihandle.c:1.18.2.5
*** openafs/src/vol/ihandle.c:1.18.2.3	Mon Sep 10 17:55:58 2007
--- openafs/src/vol/ihandle.c	Mon Nov 26 16:47:38 2007
***************
*** 15,25 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vol/ihandle.c,v 1.18.2.3 2007/09/10 21:55:58 jaltman Exp $");
  
  #include <stdio.h>
  #include <sys/types.h>
  #include <errno.h>
  #ifdef AFS_NT40_ENV
  #include <fcntl.h>
  #else
--- 15,26 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vol/ihandle.c,v 1.18.2.5 2007/11/26 21:47:38 shadow Exp $");
  
  #include <stdio.h>
  #include <sys/types.h>
  #include <errno.h>
+ #include <string.h>
  #ifdef AFS_NT40_ENV
  #include <fcntl.h>
  #else
***************
*** 31,43 ****
  #include <sys/resource.h>
  #endif
  #endif
! #ifdef HAVE_STRING_H
! #include <string.h>
! #else
! #ifdef HAVE_STRINGS_H
! #include <strings.h>
! #endif
! #endif
  #include <rx/xdr.h>
  #include <afs/afsint.h>
  #include <errno.h>
--- 32,38 ----
  #include <sys/resource.h>
  #endif
  #endif
! 
  #include <rx/xdr.h>
  #include <afs/afsint.h>
  #include <errno.h>
***************
*** 325,333 ****
       */
      fdInUseCount += 1;
      IH_UNLOCK;
      fd = OS_IOPEN(ihP);
      IH_LOCK;
!     if (fd == INVALID_FD) {
  	fdInUseCount -= 1;
  	IH_UNLOCK;
  	return NULL;
--- 320,329 ----
       */
      fdInUseCount += 1;
      IH_UNLOCK;
+ ih_open_retry:
      fd = OS_IOPEN(ihP);
      IH_LOCK;
!     if (fd == INVALID_FD && (errno != EMFILE || fdLruHead == NULL) ) {
  	fdInUseCount -= 1;
  	IH_UNLOCK;
  	return NULL;
***************
*** 337,349 ****
       * we permit the number of open files to exceed fdCacheSize.
       * We only recycle open file descriptors when the number
       * of open files reaches the size of the cache */
!     if (fdInUseCount > fdCacheSize && fdLruHead != NULL) {
  	fdP = fdLruHead;
  	assert(fdP->fd_status == FD_HANDLE_OPEN);
  	DLL_DELETE(fdP, fdLruHead, fdLruTail, fd_next, fd_prev);
  	DLL_DELETE(fdP, fdP->fd_ih->ih_fdhead, fdP->fd_ih->ih_fdtail,
  		   fd_ihnext, fd_ihprev);
  	closeFd = fdP->fd_fd;
      } else {
  	if (fdAvailHead == NULL) {
  	    fdHandleAllocateChunk();
--- 333,355 ----
       * we permit the number of open files to exceed fdCacheSize.
       * We only recycle open file descriptors when the number
       * of open files reaches the size of the cache */
!     if ((fdInUseCount > fdCacheSize || fd == INVALID_FD)  && fdLruHead != NULL) {
  	fdP = fdLruHead;
  	assert(fdP->fd_status == FD_HANDLE_OPEN);
  	DLL_DELETE(fdP, fdLruHead, fdLruTail, fd_next, fd_prev);
  	DLL_DELETE(fdP, fdP->fd_ih->ih_fdhead, fdP->fd_ih->ih_fdtail,
  		   fd_ihnext, fd_ihprev);
  	closeFd = fdP->fd_fd;
+ 	if (fd == INVALID_FD) {
+ 	    fdCacheSize--;          /* reduce in order to not run into here too often */
+ 	    DLL_INSERT_TAIL(fdP, fdAvailHead, fdAvailTail, fd_next, fd_prev);
+ 	    fdP->fd_status = FD_HANDLE_AVAIL;
+ 	    fdP->fd_ih = NULL;
+ 	    fdP->fd_fd = INVALID_FD;
+ 	    IH_UNLOCK;
+ 	    OS_CLOSE(closeFd);
+ 	    goto ih_open_retry;
+ 	}
      } else {
  	if (fdAvailHead == NULL) {
  	    fdHandleAllocateChunk();
Index: openafs/src/vol/listinodes.c
diff -c openafs/src/vol/listinodes.c:1.13.2.4 openafs/src/vol/listinodes.c:1.13.2.6
*** openafs/src/vol/listinodes.c:1.13.2.4	Sun Sep  3 01:51:42 2006
--- openafs/src/vol/listinodes.c	Tue Nov 13 17:15:34 2007
***************
*** 20,27 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vol/listinodes.c,v 1.13.2.4 2006/09/03 05:51:42 shadow Exp $");
  
  #ifndef AFS_NAMEI_ENV
  #if defined(AFS_LINUX20_ENV) || defined(AFS_SUN4_ENV)
--- 20,29 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
+ #include <string.h>
+ 
  RCSID
!     ("$Header: /cvs/openafs/src/vol/listinodes.c,v 1.13.2.6 2007/11/13 22:15:34 shadow Exp $");
  
  #ifndef AFS_NAMEI_ENV
  #if defined(AFS_LINUX20_ENV) || defined(AFS_SUN4_ENV)
***************
*** 107,113 ****
--- 109,121 ----
  #if defined(AFS_HPUX101_ENV)
  #include <unistd.h>
  #endif
+ #include "lock.h"
+ #include "ihandle.h"
+ #include "vnode.h"
+ #include "volume.h"
+ #include "volinodes.h"
  #include "partition.h"
+ #include "fssync.h"
  
  /*@+fcnmacros +macrofcndecl@*/
  #ifdef O_LARGEFILE
***************
*** 276,285 ****
  	return -1;
      }
  
!     inodeFile = fopen(resultFile, "w");
!     if (inodeFile == NULL) {
! 	Log("Unable to create inode description file %s\n", resultFile);
! 	goto out;
      }
  
      /*
--- 284,295 ----
  	return -1;
      }
  
!     if (resultFile) {
! 	inodeFile = fopen(resultFile, "w");
! 	if (inodeFile == NULL) {
! 	    Log("Unable to create inode description file %s\n", resultFile);
! 	    goto out;
! 	}
      }
  
      /*
***************
*** 323,365 ****
  	if (judgeInode && (*judgeInode) (&info, judgeParam, rock) == 0)
  	    continue;
  
! 	if (fwrite(&info, sizeof info, 1, inodeFile) != 1) {
! 	    Log("Error writing inode file for partition %s\n", partition);
! 	    goto out;
  	}
  	++ninodes;
      }
  
!     if (fflush(inodeFile) == EOF) {
! 	Log("Unable to successfully flush inode file for %s\n", partition);
! 	err = -2;
! 	goto out1;
!     }
!     if (fsync(fileno(inodeFile)) == -1) {
! 	Log("Unable to successfully fsync inode file for %s\n", partition);
! 	err = -2;
! 	goto out1;
!     }
!     if (fclose(inodeFile) == EOF) {
! 	Log("Unable to successfully close inode file for %s\n", partition);
! 	err = -2;
! 	goto out1;
!     }
  
!     /*
!      * Paranoia:  check that the file is really the right size
!      */
!     if (stat(resultFile, &status) == -1) {
! 	Log("Unable to successfully stat inode file for %s\n", partition);
! 	err = -2;
! 	goto out1;
!     }
!     if (status.st_size != ninodes * sizeof(struct ViceInodeInfo)) {
! 	Log("Wrong size (%d instead of %d) in inode file for %s\n",
! 	    status.st_size, ninodes * sizeof(struct ViceInodeInfo),
! 	    partition);
! 	err = -2;
! 	goto out1;
      }
      close(pfd);
      return 0;
--- 333,379 ----
  	if (judgeInode && (*judgeInode) (&info, judgeParam, rock) == 0)
  	    continue;
  
! 	if (inodeFile) {
! 	    if (fwrite(&info, sizeof info, 1, inodeFile) != 1) {
! 		Log("Error writing inode file for partition %s\n", partition);
! 		goto out;
! 	    }
  	}
  	++ninodes;
      }
  
!     if (inodeFile) {
! 	if (fflush(inodeFile) == EOF) {
! 	    Log("Unable to successfully flush inode file for %s\n", partition);
! 	    err = -2;
! 	    goto out1;
! 	}
! 	if (fsync(fileno(inodeFile)) == -1) {
! 	    Log("Unable to successfully fsync inode file for %s\n", partition);
! 	    err = -2;
! 	    goto out1;
! 	}
! 	if (fclose(inodeFile) == EOF) {
! 	    Log("Unable to successfully close inode file for %s\n", partition);
! 	    err = -2;
! 	    goto out1;
! 	}
  
! 	/*
! 	 * Paranoia:  check that the file is really the right size
! 	 */
! 	if (stat(resultFile, &status) == -1) {
! 	    Log("Unable to successfully stat inode file for %s\n", partition);
! 	    err = -2;
! 	    goto out1;
! 	}
! 	if (status.st_size != ninodes * sizeof(struct ViceInodeInfo)) {
! 	    Log("Wrong size (%d instead of %d) in inode file for %s\n",
! 		status.st_size, ninodes * sizeof(struct ViceInodeInfo),
! 		partition);
! 	    err = -2;
! 	    goto out1;
! 	}
      }
      close(pfd);
      return 0;
***************
*** 522,531 ****
  	return -1;
      }
  
!     inodeFile = fopen(resultFile, "w");
!     if (inodeFile == NULL) {
! 	Log("Unable to create inode description file %s\n", resultFile);
! 	goto out;
      }
  
      /* Allocate space for one cylinder group's worth of inodes. */
--- 536,547 ----
  	return -1;
      }
  
!     if (resultFile) {
! 	inodeFile = fopen(resultFile, "w");
! 	if (inodeFile == NULL) {
! 	    Log("Unable to create inode description file %s\n", resultFile);
! 	    goto out;
! 	}
      }
  
      /* Allocate space for one cylinder group's worth of inodes. */
***************
*** 592,634 ****
  	if (judgeInode && (*judgeInode) (&info, judgeParam, rock) == 0)
  	    continue;
  
! 	if (fwrite(&info, sizeof info, 1, inodeFile) != 1) {
! 	    Log("Error writing inode file for partition %s\n", partition);
! 	    goto out;
  	}
  	++ninodes;
      }
  
!     if (fflush(inodeFile) == EOF) {
! 	Log("Unable to successfully flush inode file for %s\n", partition);
! 	err = -2;
! 	goto out1;
!     }
!     if (fsync(fileno(inodeFile)) == -1) {
! 	Log("Unable to successfully fsync inode file for %s\n", partition);
! 	err = -2;
! 	goto out1;
!     }
!     if (fclose(inodeFile) == EOF) {
! 	Log("Unable to successfully close inode file for %s\n", partition);
! 	err = -2;
! 	goto out1;
!     }
  
!     /*
!      * Paranoia:  check that the file is really the right size
!      */
!     if (stat(resultFile, &status) == -1) {
! 	Log("Unable to successfully stat inode file for %s\n", partition);
! 	err = -2;
! 	goto out1;
!     }
!     if (status.st_size != ninodes * sizeof(struct ViceInodeInfo)) {
! 	Log("Wrong size (%d instead of %d) in inode file for %s\n",
! 	    status.st_size, ninodes * sizeof(struct ViceInodeInfo),
! 	    partition);
! 	err = -2;
! 	goto out1;
      }
      efs_umount(mp);
      if (dinodeBuf) {
--- 608,654 ----
  	if (judgeInode && (*judgeInode) (&info, judgeParam, rock) == 0)
  	    continue;
  
! 	if (inodeFile) {
! 	    if (fwrite(&info, sizeof info, 1, inodeFile) != 1) {
! 		Log("Error writing inode file for partition %s\n", partition);
! 		goto out;
! 	    }
  	}
  	++ninodes;
      }
  
!     if (inodeFile) {
! 	if (fflush(inodeFile) == EOF) {
! 	    Log("Unable to successfully flush inode file for %s\n", partition);
! 	    err = -2;
! 	    goto out1;
! 	}
! 	if (fsync(fileno(inodeFile)) == -1) {
! 	    Log("Unable to successfully fsync inode file for %s\n", partition);
! 	    err = -2;
! 	    goto out1;
! 	}
! 	if (fclose(inodeFile) == EOF) {
! 	    Log("Unable to successfully close inode file for %s\n", partition);
! 	    err = -2;
! 	    goto out1;
! 	}
  
! 	/*
! 	 * Paranoia:  check that the file is really the right size
! 	 */
! 	if (stat(resultFile, &status) == -1) {
! 	    Log("Unable to successfully stat inode file for %s\n", partition);
! 	    err = -2;
! 	    goto out1;
! 	}
! 	if (status.st_size != ninodes * sizeof(struct ViceInodeInfo)) {
! 	    Log("Wrong size (%d instead of %d) in inode file for %s\n",
! 		status.st_size, ninodes * sizeof(struct ViceInodeInfo),
! 		partition);
! 	    err = -2;
! 	    goto out1;
! 	}
      }
      efs_umount(mp);
      if (dinodeBuf) {
***************
*** 876,885 ****
  	return -1;
      }
  
!     inodeFile = fopen(resultFile, "w");
!     if (inodeFile == NULL) {
! 	Log("Unable to create inode description file %s\n", resultFile);
! 	return -1;
      }
  
      if ((top_dirp = opendir(mountedOn)) == NULL) {
--- 896,907 ----
  	return -1;
      }
  
!     if (resultFile) {
! 	inodeFile = fopen(resultFile, "w");
! 	if (inodeFile == NULL) {
! 	    Log("Unable to create inode description file %s\n", resultFile);
! 	    return -1;
! 	}
      }
  
      if ((top_dirp = opendir(mountedOn)) == NULL) {
***************
*** 983,993 ****
  		n_renames++;
  	    }
  
! 	    if (fwrite
! 		(&info.ili_info, sizeof(vice_inode_info_t), 1, inodeFile)
! 		!= 1) {
! 		Log("Error writing inode file for partition %s\n", mountedOn);
! 		goto err1_exit;
  	    }
  	    ninodes++;
  
--- 1005,1015 ----
  		n_renames++;
  	    }
  
! 	    if (inodeFile) {
! 		if (fwrite(&info.ili_info, sizeof(vice_inode_info_t), 1, inodeFile) != 1) {
! 		    Log("Error writing inode file for partition %s\n", mountedOn);
! 		    goto err1_exit;
! 		}
  	    }
  	    ninodes++;
  
***************
*** 1006,1037 ****
      closedir(top_dirp);
      if (renames)
  	free((char *)renames);
!     if (fflush(inodeFile) == EOF) {
! 	("Unable to successfully flush inode file for %s\n", mountedOn);
! 	fclose(inodeFile);
! 	return errors ? -1 : -2;
!     }
!     if (fsync(fileno(inodeFile)) == -1) {
! 	Log("Unable to successfully fsync inode file for %s\n", mountedOn);
! 	fclose(inodeFile);
! 	return errors ? -1 : -2;
!     }
!     if (fclose(inodeFile) == EOF) {
! 	Log("Unable to successfully close inode file for %s\n", mountedOn);
! 	return errors ? -1 : -2;
!     }
!     /*
!      * Paranoia:  check that the file is really the right size
!      */
!     if (stat(resultFile, &status) == -1) {
! 	Log("Unable to successfully stat inode file for %s\n", partition);
! 	return errors ? -1 : -2;
!     }
!     if (status.st_size != ninodes * sizeof(struct ViceInodeInfo)) {
! 	Log("Wrong size (%d instead of %d) in inode file for %s\n",
! 	    status.st_size, ninodes * sizeof(struct ViceInodeInfo),
! 	    partition);
! 	return errors ? -1 : -2;
      }
  
      if (errors) {
--- 1028,1062 ----
      closedir(top_dirp);
      if (renames)
  	free((char *)renames);
! 
!     if (inodeFile) {
! 	if (fflush(inodeFile) == EOF) {
! 	    ("Unable to successfully flush inode file for %s\n", mountedOn);
! 	    fclose(inodeFile);
! 	    return errors ? -1 : -2;
! 	}
! 	if (fsync(fileno(inodeFile)) == -1) {
! 	    Log("Unable to successfully fsync inode file for %s\n", mountedOn);
! 	    fclose(inodeFile);
! 	    return errors ? -1 : -2;
! 	}
! 	if (fclose(inodeFile) == EOF) {
! 	    Log("Unable to successfully close inode file for %s\n", mountedOn);
! 	    return errors ? -1 : -2;
! 	}
! 	/*
! 	 * Paranoia:  check that the file is really the right size
! 	 */
! 	if (stat(resultFile, &status) == -1) {
! 	    Log("Unable to successfully stat inode file for %s\n", partition);
! 	    return errors ? -1 : -2;
! 	}
! 	if (status.st_size != ninodes * sizeof(struct ViceInodeInfo)) {
! 	    Log("Wrong size (%d instead of %d) in inode file for %s\n",
! 		status.st_size, ninodes * sizeof(struct ViceInodeInfo),
! 		partition);
! 	    return errors ? -1 : -2;
! 	}
      }
  
      if (errors) {
***************
*** 1186,1195 ****
  	goto out;
      }
  
!     inodeFile = fopen(resultFile, "w");
!     if (inodeFile == NULL) {
! 	Log("Unable to create inode description file %s\n", resultFile);
! 	goto out;
      }
  #ifdef	AFS_AIX_ENV
      /*
--- 1211,1222 ----
  	goto out;
      }
  
!     if (resultFile) {
! 	inodeFile = fopen(resultFile, "w");
! 	if (inodeFile == NULL) {
! 	    Log("Unable to create inode description file %s\n", resultFile);
! 	    goto out;
! 	}
      }
  #ifdef	AFS_AIX_ENV
      /*
***************
*** 1233,1241 ****
  	info.u.param[3] = auxp->aux_param4;
  	if (judgeInode && (*judgeInode) (&info, judgeParam, rock) == 0)
  	    continue;
! 	if (fwrite(&info, sizeof info, 1, inodeFile) != 1) {
! 	    Log("Error writing inode file for partition %s\n", partition);
! 	    goto out;
  	}
  	ninodes++;
      }
--- 1260,1270 ----
  	info.u.param[3] = auxp->aux_param4;
  	if (judgeInode && (*judgeInode) (&info, judgeParam, rock) == 0)
  	    continue;
! 	if (inodeFile) {
! 	    if (fwrite(&info, sizeof info, 1, inodeFile) != 1) {
! 		Log("Error writing inode file for partition %s\n", partition);
! 		goto out;
! 	    }
  	}
  	ninodes++;
      }
***************
*** 1442,1451 ****
  		    info.linkCount = p->di_nlink;
  		    if (judgeInode && (*judgeInode) (&info, judgeParam, rock) == 0)
  			continue;
! 		    if (fwrite(&info, sizeof info, 1, inodeFile) != 1) {
! 			Log("Error writing inode file for partition %s\n",
! 			    partition);
! 			goto out;
  		    }
  		    ninodes++;
  		}
--- 1471,1482 ----
  		    info.linkCount = p->di_nlink;
  		    if (judgeInode && (*judgeInode) (&info, judgeParam, rock) == 0)
  			continue;
! 		    if (inodeFile) {
! 			if (fwrite(&info, sizeof info, 1, inodeFile) != 1) {
! 			    Log("Error writing inode file for partition %s\n",
! 				partition);
! 			    goto out;
! 			}
  		    }
  		    ninodes++;
  		}
***************
*** 1455,1490 ****
      if (inodes)
  	free(inodes);
  #endif
!     if (fflush(inodeFile) == EOF) {
! 	Log("Unable to successfully flush inode file for %s\n", partition);
! 	err = -2;
! 	goto out1;
!     }
!     if (fsync(fileno(inodeFile)) == -1) {
! 	Log("Unable to successfully fsync inode file for %s\n", partition);
! 	err = -2;
! 	goto out1;
!     }
!     if (fclose(inodeFile) == EOF) {
! 	Log("Unable to successfully close inode file for %s\n", partition);
! 	err = -2;
! 	goto out1;
!     }
! 
!     /*
!      * Paranoia:  check that the file is really the right size
!      */
!     if (stat(resultFile, &status) == -1) {
! 	Log("Unable to successfully stat inode file for %s\n", partition);
! 	err = -2;
! 	goto out1;
!     }
!     if (status.st_size != ninodes * sizeof(struct ViceInodeInfo)) {
! 	Log("Wrong size (%d instead of %d) in inode file for %s\n",
! 	    status.st_size, ninodes * sizeof(struct ViceInodeInfo),
! 	    partition);
! 	err = -2;
! 	goto out1;
      }
      close(pfd);
      return 0;
--- 1486,1523 ----
      if (inodes)
  	free(inodes);
  #endif
!     if (inodeFile) {
! 	if (fflush(inodeFile) == EOF) {
! 	    Log("Unable to successfully flush inode file for %s\n", partition);
! 	    err = -2;
! 	    goto out1;
! 	}
! 	if (fsync(fileno(inodeFile)) == -1) {
! 	    Log("Unable to successfully fsync inode file for %s\n", partition);
! 	    err = -2;
! 	    goto out1;
! 	}
! 	if (fclose(inodeFile) == EOF) {
! 	    Log("Unable to successfully close inode file for %s\n", partition);
! 	    err = -2;
! 	    goto out1;
! 	}
! 	
! 	/*
! 	 * Paranoia:  check that the file is really the right size
! 	 */
! 	if (stat(resultFile, &status) == -1) {
! 	    Log("Unable to successfully stat inode file for %s\n", partition);
! 	    err = -2;
! 	    goto out1;
! 	}
! 	if (status.st_size != ninodes * sizeof(struct ViceInodeInfo)) {
! 	    Log("Wrong size (%d instead of %d) in inode file for %s\n",
! 		status.st_size, ninodes * sizeof(struct ViceInodeInfo),
! 		partition);
! 	    err = -2;
! 	    goto out1;
! 	}
      }
      close(pfd);
      return 0;
***************
*** 1535,1538 ****
--- 1568,1790 ----
  }
  
  #endif /* AFS_LINUX20_ENV */
+ static afs_int32
+ convertVolumeInfo(int fdr, int fdw, afs_uint32 vid)
+ {
+     struct VolumeDiskData vd;
+     char *p;
+ 
+     if (read(fdr, &vd, sizeof(struct VolumeDiskData)) !=
+         sizeof(struct VolumeDiskData)) {
+         Log("1 convertiVolumeInfo: read failed for %lu with code %d\n", vid,
+             errno);
+         return -1;
+     }
+     vd.restoredFromId = vd.id;  /* remember the RO volume here */
+     vd.cloneId = vd.id;
+     vd.id = vd.parentId;
+     vd.type = RWVOL;
+     vd.dontSalvage = 0;
+     vd.inUse = 0;
+     vd.uniquifier += 5000;      /* just in case there are still file copies 
+ 				   from the old RW volume around */
+ 
+     p = strrchr(vd.name, '.');
+     if (p && !strcmp(p, ".readonly")) {
+         memset(p, 0, 9);
+     }
+ 
+     if (write(fdw, &vd, sizeof(struct VolumeDiskData)) !=
+         sizeof(struct VolumeDiskData)) {
+         Log("1 convertiVolumeInfo: write failed for %lu with code %d\n", vid,
+             errno);
+         return -1;
+     }
+     return 0;
+ }
+ 
+ struct specino {
+     afs_int32 inodeType;
+     Inode inodeNumber;
+     Inode ninodeNumber;
+ };
+ 
+ 
+ int
+ UpdateThisVolume(struct ViceInodeInfo *inodeinfo, VolumeId singleVolumeNumber, 
+ 		 struct specino *specinos)
+ {
+     struct dinode *p;
+     if ((inodeinfo->u.vnode.vnodeNumber == INODESPECIAL) &&
+ 	(inodeinfo->u.vnode.volumeId == singleVolumeNumber)) {
+ 	specinos[inodeinfo->u.special.type].inodeNumber = 
+ 	    inodeinfo->inodeNumber;
+     }
+     return 0; /* We aren't using a result file, we're caching */
+ }
+ 
+ static char *
+ getDevName(char *pbuffer, char *wpath)
+ {
+     char pbuf[128], *ptr;
+     strcpy(pbuf, pbuffer);
+     ptr = (char *)strrchr(pbuf, '/');
+     if (ptr) {
+         *ptr = '\0';
+         strcpy(wpath, pbuf);
+     } else
+         return NULL;
+     ptr = (char *)strrchr(pbuffer, '/');
+     if (ptr) {
+         strcpy(pbuffer, ptr + 1);
+         return pbuffer;
+     } else
+         return NULL;
+ }
+ 
+ int
+ inode_ConvertROtoRWvolume(char *pname, afs_int32 volumeId)
+ {
+     char dir_name[512], oldpath[512], newpath[512];
+     char volname[20];
+     char headername[16];
+     char *name;
+     int fd, err, forcep, len, j, code;
+     struct dirent *dp;
+     struct DiskPartition *partP;
+     struct ViceInodeInfo info;
+     struct VolumeDiskHeader h;
+     IHandle_t *ih, *ih2;
+     FdHandle_t *fdP, *fdP2;
+     char wpath[100];
+     char tmpDevName[100];
+     char buffer[128];
+     struct specino specinos[VI_LINKTABLE+1];
+     Inode nearInode = 0;
+ 
+     memset(&specinos, 0, sizeof(specinos));
+ 	   
+     (void)afs_snprintf(headername, sizeof headername, VFORMAT, volumeId);
+     (void)afs_snprintf(oldpath, sizeof oldpath, "%s/%s", pname, headername);
+     fd = open(oldpath, O_RDONLY);
+     if (fd < 0) {
+         Log("1 inode_ConvertROtoRWvolume: Couldn't open header for RO-volume %lu.\n", volumeId);
+         return ENOENT;
+     }
+     if (read(fd, &h, sizeof(h)) != sizeof(h)) {
+         Log("1 inode_ConvertROtoRWvolume: Couldn't read header for RO-volume %lu.\n", volumeId);
+         close(fd);
+         return EIO;
+     }
+     close(fd);
+     FSYNC_askfs(volumeId, pname, FSYNC_RESTOREVOLUME, 0);
+ 
+     /* now do the work */
+ 	   
+     for (partP = DiskPartitionList; partP && strcmp(partP->name, pname);
+          partP = partP->next);
+     if (!partP) {
+         Log("1 inode_ConvertROtoRWvolume: Couldn't find DiskPartition for %s\n", pname);
+         return EIO;
+     }
+ 
+     strcpy(tmpDevName, partP->devName);
+     name = getDevName(tmpDevName, wpath);
+ 
+     if ((err = ListViceInodes(name, VPartitionPath(partP), 
+ 			      NULL, UpdateThisVolume, volumeId, 
+ 			      &forcep, 0, wpath, &specinos)) < 0)
+     {
+ 	Log("1 inode_ConvertROtoRWvolume: Couldn't get special inodes\n");
+ 	return EIO;
+     }
+ 	   
+ #if defined(NEARINODE_HINT)
+     nearInodeHash(volumeId, nearInode);
+     nearInode %= partP->f_files;
+ #endif
+ 
+     for (j = VI_VOLINFO; j < VI_LINKTABLE+1; j++) {
+ 	if (specinos[j].inodeNumber > 0) {
+ 	    specinos[j].ninodeNumber = 
+ 		IH_CREATE(NULL, partP->device, VPartitionPath(partP),
+ 			  nearInode, h.parent, INODESPECIAL, j, h.parent);
+ 	    IH_INIT(ih, partP->device, volumeId, 
+ 		    specinos[j].inodeNumber);
+ 	    fdP = IH_OPEN(ih);
+ 	    if (!fdP) {
+ 		Log("1 inode_ConvertROtoRWvolume: Couldn't find special inode %d for %d\n", j, volumeId); 
+ 		return -1;
+ 	    }
+ 	    
+ 	    IH_INIT(ih2, partP->device, h.parent, specinos[j].ninodeNumber);
+ 	    fdP2 = IH_OPEN(ih2); 
+ 	    if (!fdP2) { 
+ 		Log("1 inode_ConvertROtoRWvolume: Couldn't find special inode %d for %d\n", j, h.parent);  
+ 		return -1; 
+ 	    } 
+ 	    
+ 	    if (j == VI_VOLINFO)
+ 		convertVolumeInfo(fdP->fd_fd, fdP2->fd_fd, ih2->ih_vid);
+ 	    else {
+ 		while (1) {
+ 		    len = read(fdP->fd_fd, buffer, sizeof(buffer));
+ 		    if (len < 0)
+ 			return errno;
+ 		    if (len == 0)
+ 			break;
+ 		    code = write(fdP2->fd_fd, buffer, len);
+ 		    if (code != len)
+ 			return -1;
+ 		}
+ 	    }
+ 		
+ 	    FDH_CLOSE(fdP);
+ 	    FDH_CLOSE(fdP2);
+ 	    IH_RELEASE(ih);
+ 	    IH_RELEASE(ih2);
+ 	}
+     }
+    
+     h.id = h.parent;
+ #ifdef AFS_64BIT_IOPS_ENV
+     h.volumeInfo_lo = (afs_int32)specinos[VI_VOLINFO].ninodeNumber & 0xffffffff;
+     h.volumeInfo_hi = (afs_int32)(specinos[VI_VOLINFO].ninodeNumber >> 32) && 0xffffffff;
+     h.smallVnodeIndex_lo = (afs_int32)specinos[VI_SMALLINDEX].ninodeNumber & 0xffffffff;
+     h.smallVnodeIndex_hi = (afs_int32)(specinos[VI_SMALLINDEX].ninodeNumber >> 32) & 0xffffffff;
+     h.largeVnodeIndex_lo = (afs_int32)specinos[VI_LARGEINDEX].ninodeNumber & 0xffffffff;
+     h.largeVnodeIndex_hi = (afs_int32)(specinos[VI_LARGEINDEX].ninodeNumber >> 32) & 0xffffffff;
+     if (specinos[VI_LINKTABLE].ninodeNumber) {
+ 	h.linkTable_lo = (afs_int32)specinos[VI_LINKTABLE].ninodeNumber & 0xffffffff;
+ 	h.linkTable_hi = (afs_int32)specinos[VI_LINKTABLE].ninodeNumber & 0xffffffff;
+     }
+ #else
+     h.volumeInfo_lo = specinos[VI_VOLINFO].ninodeNumber;
+     h.smallVnodeIndex_lo = specinos[VI_SMALLINDEX].ninodeNumber;
+     h.largeVnodeIndex_lo = specinos[VI_LARGEINDEX].ninodeNumber;
+     if (specinos[VI_LINKTABLE].ninodeNumber) {
+ 	h.linkTable_lo = specinos[VI_LINKTABLE].ninodeNumber;
+     }
+ #endif
+ 
+     (void)afs_snprintf(headername, sizeof headername, VFORMAT, h.id);
+     (void)afs_snprintf(newpath, sizeof newpath, "%s/%s", pname, headername);
+     fd = open(newpath, O_CREAT | O_EXCL | O_RDWR, 0644);
+     if (fd < 0) {
+         Log("1 inode_ConvertROtoRWvolume: Couldn't create header for RW-volume %lu.\n", h.id);
+         return EIO;
+     }
+     if (write(fd, &h, sizeof(h)) != sizeof(h)) {
+         Log("1 inode_ConvertROtoRWvolume: Couldn't write header for RW-volume %lu.\n", h.id);
+         close(fd);
+         return EIO;
+     }
+     close(fd);
+     if (unlink(oldpath) < 0) {
+         Log("1 inode_ConvertROtoRWvolume: Couldn't unlink RO header, error = %d\n", errno);
+     }
+     FSYNC_askfs(volumeId, pname, FSYNC_DONE, 0);
+     FSYNC_askfs(h.id, pname, FSYNC_ON, 0);
+     return 0;
+ }
  #endif /* AFS_NAMEI_ENV */
Index: openafs/src/vol/namei_ops.c
diff -c openafs/src/vol/namei_ops.c:1.21.2.13 openafs/src/vol/namei_ops.c:1.21.2.16
*** openafs/src/vol/namei_ops.c:1.21.2.13	Tue Sep 11 11:40:26 2007
--- openafs/src/vol/namei_ops.c	Mon Nov 26 16:21:57 2007
***************
*** 13,23 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vol/namei_ops.c,v 1.21.2.13 2007/09/11 15:40:26 shadow Exp $");
  
  #ifdef AFS_NAMEI_ENV
  #include <stdio.h>
  #include <stdlib.h>
  #include <errno.h>
  #include <fcntl.h>
  #include <sys/stat.h>
--- 13,24 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vol/namei_ops.c,v 1.21.2.16 2007/11/26 21:21:57 shadow Exp $");
  
  #ifdef AFS_NAMEI_ENV
  #include <stdio.h>
  #include <stdlib.h>
+ #include <unistd.h>
  #include <errno.h>
  #include <fcntl.h>
  #include <sys/stat.h>
***************
*** 41,46 ****
--- 42,48 ----
  #include "voldefs.h"
  #include "partition.h"
  #include <afs/errors.h>
+ #include "fssync.h"
  
  /*@+fcnmacros +macrofcndecl@*/
  #ifdef O_LARGEFILE
***************
*** 1543,1549 ****
   */
  
  int
! namei_ConvertROtoRWvolume(IHandle_t * h, afs_uint32 vid)
  {
      namei_t n;
      char dir_name[512], oldpath[512], newpath[512];
--- 1545,1551 ----
   */
  
  int
! namei_ConvertROtoRWvolume(char *pname, afs_int32 volumeId)
  {
      namei_t n;
      char dir_name[512], oldpath[512], newpath[512];
***************
*** 1551,1567 ****
      char largeName[64];
      char infoName[64];
      IHandle_t t_ih;
      char infoSeen = 0;
      char smallSeen = 0;
      char largeSeen = 0;
      char linkSeen = 0;
!     int code, fd, fd2;
      char *p;
      DIR *dirp;
      struct dirent *dp;
      struct ViceInodeInfo info;
  
!     namei_HandleToName(&n, h);
      strcpy(dir_name, n.n_path);
      p = strrchr(dir_name, '/');
      *p = 0;
--- 1553,1600 ----
      char largeName[64];
      char infoName[64];
      IHandle_t t_ih;
+     IHandle_t *ih;
      char infoSeen = 0;
      char smallSeen = 0;
      char largeSeen = 0;
      char linkSeen = 0;
!     int code, fd, fd2, found;
      char *p;
      DIR *dirp;
+     Inode ino;
      struct dirent *dp;
+     struct DiskPartition *partP;
      struct ViceInodeInfo info;
+     struct VolumeDiskHeader h;
+     char volname[20];
+     char headername[16];
+     afs_int32 error = 0;
+ 
+     (void)afs_snprintf(headername, sizeof headername, VFORMAT, volumeId);
+     (void)afs_snprintf(oldpath, sizeof oldpath, "%s/%s", pname, headername);
+     fd = open(oldpath, O_RDONLY);
+     if (fd < 0) {
+         Log("1 namei_ConvertROtoRWvolume: Couldn't open header for RO-volume %lu.\n", volumeId);
+         return ENOENT;
+     }
+     if (read(fd, &h, sizeof(h)) != sizeof(h)) {
+         Log("1 namei_ConvertROtoRWvolume: Couldn't read header for RO-volume %lu.\n", volumeId);
+         close(fd);
+         return EIO;
+     }
+     close(fd);
+     FSYNC_askfs(volumeId, pname, FSYNC_RESTOREVOLUME, 0);
+ 
+     for (partP = DiskPartitionList; partP && strcmp(partP->name, pname);
+          partP = partP->next);
+     if (!partP) {
+         Log("1 namei_ConvertROtoRWvolume: Couldn't find DiskPartition for %s\n", pname);
+         return EIO;
+     }
+     ino = namei_MakeSpecIno(h.parent, VI_LINKTABLE);
+     IH_INIT(ih, partP->device, h.parent, ino);
  
!     namei_HandleToName(&n, ih);
      strcpy(dir_name, n.n_path);
      p = strrchr(dir_name, '/');
      *p = 0;
***************
*** 1576,1582 ****
  
  	if (*dp->d_name == '.')
  	    continue;
! 	if (DecodeInode(dir_name, dp->d_name, &info, h->ih_vid) < 0) {
  	    Log("1 namei_ConvertROtoRWvolume: DecodeInode failed for %s/%s\n",
  		dir_name, dp->d_name);
  	    closedir(dirp);
--- 1609,1615 ----
  
  	if (*dp->d_name == '.')
  	    continue;
! 	if (DecodeInode(dir_name, dp->d_name, &info, ih->ih_vid) < 0) {
  	    Log("1 namei_ConvertROtoRWvolume: DecodeInode failed for %s/%s\n",
  		dir_name, dp->d_name);
  	    closedir(dirp);
***************
*** 1587,1594 ****
  	    closedir(dirp);
  	    return -1;
  	}
! 	if (info.u.param[0] != vid) {
! 	    if (info.u.param[0] == h->ih_vid) {
  		if (info.u.param[2] == VI_LINKTABLE) {	/* link table */
  		    linkSeen = 1;
  		    continue;
--- 1620,1627 ----
  	    closedir(dirp);
  	    return -1;
  	}
! 	if (info.u.param[0] != volumeId) {
! 	    if (info.u.param[0] == ih->ih_vid) {
  		if (info.u.param[2] == VI_LINKTABLE) {	/* link table */
  		    linkSeen = 1;
  		    continue;
***************
*** 1626,1633 ****
       */
  
      memset(&t_ih, 0, sizeof(t_ih));
!     t_ih.ih_dev = h->ih_dev;
!     t_ih.ih_vid = h->ih_vid;
  
      (void)afs_snprintf(oldpath, sizeof oldpath, "%s/%s", dir_name, infoName);
      fd = afs_open(oldpath, O_RDWR, 0);
--- 1659,1666 ----
       */
  
      memset(&t_ih, 0, sizeof(t_ih));
!     t_ih.ih_dev = ih->ih_dev;
!     t_ih.ih_vid = ih->ih_vid;
  
      (void)afs_snprintf(oldpath, sizeof oldpath, "%s/%s", dir_name, infoName);
      fd = afs_open(oldpath, O_RDWR, 0);
***************
*** 1636,1642 ****
  	    oldpath);
  	return -1;
      }
!     t_ih.ih_ino = namei_MakeSpecIno(h->ih_vid, VI_VOLINFO);
      namei_HandleToName(&n, &t_ih);
      fd2 = afs_open(n.n_path, O_CREAT | O_EXCL | O_TRUNC | O_RDWR, 0);
      if (fd2 < 0) {
--- 1669,1675 ----
  	    oldpath);
  	return -1;
      }
!     t_ih.ih_ino = namei_MakeSpecIno(ih->ih_vid, VI_VOLINFO);
      namei_HandleToName(&n, &t_ih);
      fd2 = afs_open(n.n_path, O_CREAT | O_EXCL | O_TRUNC | O_RDWR, 0);
      if (fd2 < 0) {
***************
*** 1644,1660 ****
  	close(fd);
  	return -1;
      }
!     code = convertVolumeInfo(fd, fd2, h->ih_vid);
      close(fd);
      if (code) {
  	close(fd2);
  	unlink(n.n_path);
  	return -1;
      }
!     SetOGM(fd2, h->ih_vid, 1);
      close(fd2);
  
!     t_ih.ih_ino = namei_MakeSpecIno(h->ih_vid, VI_SMALLINDEX);
      namei_HandleToName(&n, &t_ih);
      (void)afs_snprintf(newpath, sizeof newpath, "%s/%s", dir_name, smallName);
      fd = afs_open(newpath, O_RDWR, 0);
--- 1677,1693 ----
  	close(fd);
  	return -1;
      }
!     code = convertVolumeInfo(fd, fd2, ih->ih_vid);
      close(fd);
      if (code) {
  	close(fd2);
  	unlink(n.n_path);
  	return -1;
      }
!     SetOGM(fd2, ih->ih_vid, 1);
      close(fd2);
  
!     t_ih.ih_ino = namei_MakeSpecIno(ih->ih_vid, VI_SMALLINDEX);
      namei_HandleToName(&n, &t_ih);
      (void)afs_snprintf(newpath, sizeof newpath, "%s/%s", dir_name, smallName);
      fd = afs_open(newpath, O_RDWR, 0);
***************
*** 1662,1673 ****
  	Log("1 namei_ConvertROtoRWvolume: could not open SmallIndex file: %s\n", newpath);
  	return -1;
      }
!     SetOGM(fd, h->ih_vid, 2);
      close(fd);
      link(newpath, n.n_path);
      unlink(newpath);
  
!     t_ih.ih_ino = namei_MakeSpecIno(h->ih_vid, VI_LARGEINDEX);
      namei_HandleToName(&n, &t_ih);
      (void)afs_snprintf(newpath, sizeof newpath, "%s/%s", dir_name, largeName);
      fd = afs_open(newpath, O_RDWR, 0);
--- 1695,1706 ----
  	Log("1 namei_ConvertROtoRWvolume: could not open SmallIndex file: %s\n", newpath);
  	return -1;
      }
!     SetOGM(fd, ih->ih_vid, 2);
      close(fd);
      link(newpath, n.n_path);
      unlink(newpath);
  
!     t_ih.ih_ino = namei_MakeSpecIno(ih->ih_vid, VI_LARGEINDEX);
      namei_HandleToName(&n, &t_ih);
      (void)afs_snprintf(newpath, sizeof newpath, "%s/%s", dir_name, largeName);
      fd = afs_open(newpath, O_RDWR, 0);
***************
*** 1675,1686 ****
  	Log("1 namei_ConvertROtoRWvolume: could not open LargeIndex file: %s\n", newpath);
  	return -1;
      }
!     SetOGM(fd, h->ih_vid, 3);
      close(fd);
      link(newpath, n.n_path);
      unlink(newpath);
  
      unlink(oldpath);
      return 0;
  }
  
--- 1708,1744 ----
  	Log("1 namei_ConvertROtoRWvolume: could not open LargeIndex file: %s\n", newpath);
  	return -1;
      }
!     SetOGM(fd, ih->ih_vid, 3);
      close(fd);
      link(newpath, n.n_path);
      unlink(newpath);
  
      unlink(oldpath);
+ 
+     h.id = h.parent;
+     h.volumeInfo_hi = h.id;
+     h.smallVnodeIndex_hi = h.id;
+     h.largeVnodeIndex_hi = h.id;
+     h.linkTable_hi = h.id;
+     (void)afs_snprintf(headername, sizeof headername, VFORMAT, h.id);
+     (void)afs_snprintf(newpath, sizeof newpath, "%s/%s", pname, headername);
+     fd = open(newpath, O_CREAT | O_EXCL | O_RDWR, 0644);
+     if (fd < 0) {
+         Log("1 namei_ConvertROtoRWvolume: Couldn't create header for RW-volume %lu.\n", h.id);
+         return EIO;
+     }
+     if (write(fd, &h, sizeof(h)) != sizeof(h)) {
+         Log("1 namei_ConvertROtoRWvolume: Couldn't write header for RW-volume\
+  %lu.\n", h.id);
+         close(fd);
+         return EIO;
+     }
+     close(fd);
+     if (unlink(oldpath) < 0) {
+         Log("1 namei_ConvertROtoRWvolume: Couldn't unlink RO header, error = %d\n", error);
+     }
+     FSYNC_askfs(volumeId, pname, FSYNC_DONE, 0);
+     FSYNC_askfs(h.id, pname, FSYNC_ON, 0);
      return 0;
  }
  
Index: openafs/src/vol/partition.c
diff -c openafs/src/vol/partition.c:1.30.2.4.2.1 openafs/src/vol/partition.c:1.30.2.6
*** openafs/src/vol/partition.c:1.30.2.4.2.1	Thu Dec 13 16:01:58 2007
--- openafs/src/vol/partition.c	Thu Nov 29 16:40:09 2007
***************
*** 21,29 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vol/partition.c,v 1.30.2.4.2.1 2007/12/13 21:01:58 shadow Exp $");
  
  #include <ctype.h>
  #ifdef AFS_NT40_ENV
  #include <windows.h>
  #include <winbase.h>
--- 21,30 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vol/partition.c,v 1.30.2.6 2007/11/29 21:40:09 shadow Exp $");
  
  #include <ctype.h>
+ #include <string.h>
  #ifdef AFS_NT40_ENV
  #include <windows.h>
  #include <winbase.h>
***************
*** 106,119 ****
  #include <mntent.h>
  #endif
  
- #ifdef HAVE_STRING_H
- #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
- 
  #include <rx/xdr.h>
  #include <afs/afsint.h>
  #include "nfs.h"
--- 107,112 ----
Index: openafs/src/vol/physio.c
diff -c openafs/src/vol/physio.c:1.12 openafs/src/vol/physio.c:1.12.2.1
*** openafs/src/vol/physio.c:1.12	Fri Aug  8 16:40:45 2003
--- openafs/src/vol/physio.c	Tue Oct 30 11:24:11 2007
***************
*** 18,24 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vol/physio.c,v 1.12 2003/08/08 20:40:45 shadow Exp $");
  
  #include <stdio.h>
  #include <sys/types.h>
--- 18,24 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vol/physio.c,v 1.12.2.1 2007/10/30 15:24:11 shadow Exp $");
  
  #include <stdio.h>
  #include <sys/types.h>
***************
*** 28,40 ****
  #else
  #include <sys/file.h>
  #include <unistd.h>
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #ifdef	AFS_SUN5_ENV
  #include <sys/fcntl.h>
  #endif
--- 28,34 ----
Index: openafs/src/vol/purge.c
diff -c openafs/src/vol/purge.c:1.9.2.2 openafs/src/vol/purge.c:1.9.2.3
*** openafs/src/vol/purge.c:1.9.2.2	Thu Jul 13 14:20:32 2006
--- openafs/src/vol/purge.c	Tue Oct 30 11:24:11 2007
***************
*** 17,23 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vol/purge.c,v 1.9.2.2 2006/07/13 18:20:32 shadow Exp $");
  
  #include <stdio.h>
  #ifdef AFS_NT40_ENV
--- 17,23 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vol/purge.c,v 1.9.2.3 2007/10/30 15:24:11 shadow Exp $");
  
  #include <stdio.h>
  #ifdef AFS_NT40_ENV
***************
*** 28,40 ****
  #include <sys/file.h>
  #include <sys/time.h>
  #endif
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <sys/stat.h>
  #include <afs/assert.h>
  
--- 28,34 ----
Index: openafs/src/vol/vnode.c
diff -c openafs/src/vol/vnode.c:1.19.2.4 openafs/src/vol/vnode.c:1.19.2.6
*** openafs/src/vol/vnode.c:1.19.2.4	Thu Jul 28 17:11:19 2005
--- openafs/src/vol/vnode.c	Fri Dec 28 17:16:51 2007
***************
*** 17,33 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vol/vnode.c,v 1.19.2.4 2005/07/28 21:11:19 shadow Exp $");
  
  #include <errno.h>
  #include <stdio.h>
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #ifdef AFS_PTHREAD_ENV
  #include <assert.h>
  #else /* AFS_PTHREAD_ENV */
--- 17,27 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vol/vnode.c,v 1.19.2.6 2007/12/28 22:16:51 shadow Exp $");
  
  #include <errno.h>
  #include <stdio.h>
  #include <string.h>
  #ifdef AFS_PTHREAD_ENV
  #include <assert.h>
  #else /* AFS_PTHREAD_ENV */
***************
*** 75,80 ****
--- 69,76 ----
  void StickOnLruChain_r(register Vnode * vnp,
  		       register struct VnodeClassInfo *vcp);
  
+ extern int LogLevel;
+ 
  #define BAD_IGET	-1000
  
  /* There are two separate vnode queue types defined here:
Index: openafs/src/vol/vol-bless.c
diff -c openafs/src/vol/vol-bless.c:1.1.2.1 openafs/src/vol/vol-bless.c:1.1.2.2
*** openafs/src/vol/vol-bless.c:1.1.2.1	Tue Dec  7 01:06:17 2004
--- openafs/src/vol/vol-bless.c	Wed Oct 31 00:13:51 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vol/vol-bless.c,v 1.1.2.1 2004/12/07 06:06:17 shadow Exp $");
  
  #include <stdio.h>
  
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vol/vol-bless.c,v 1.1.2.2 2007/10/31 04:13:51 shadow Exp $");
  
  #include <stdio.h>
  
***************
*** 28,34 ****
  int VolumeChanged; /* to keep physio happy */
  
  static int
! handleit(struct cmd_syndesc *as, char *arock)
  {
      Volume *vp;
      Error ec;
--- 28,34 ----
  int VolumeChanged; /* to keep physio happy */
  
  static int
! handleit(struct cmd_syndesc *as, void *arock)
  {
      Volume *vp;
      Error ec;
***************
*** 73,79 ****
      register struct cmd_syndesc *ts;
      afs_int32 code;
  
!     ts = cmd_CreateSyntax(NULL, handleit, 0, "Manipulate volume blessed bit");
      cmd_AddParm(ts, "-id", CMD_SINGLE, CMD_REQUIRED, "Volume id");
      cmd_AddParm(ts, "-bless", CMD_FLAG, CMD_OPTIONAL, "Set blessed bit");
      cmd_AddParm(ts, "-unbless", CMD_FLAG, CMD_OPTIONAL, "Clear blessed bit");
--- 73,79 ----
      register struct cmd_syndesc *ts;
      afs_int32 code;
  
!     ts = cmd_CreateSyntax(NULL, handleit, NULL, "Manipulate volume blessed bit");
      cmd_AddParm(ts, "-id", CMD_SINGLE, CMD_REQUIRED, "Volume id");
      cmd_AddParm(ts, "-bless", CMD_FLAG, CMD_OPTIONAL, "Set blessed bit");
      cmd_AddParm(ts, "-unbless", CMD_FLAG, CMD_OPTIONAL, "Clear blessed bit");
Index: openafs/src/vol/vol-info.c
diff -c openafs/src/vol/vol-info.c:1.18.2.3 openafs/src/vol/vol-info.c:1.18.2.4
*** openafs/src/vol/vol-info.c:1.18.2.3	Sun May  8 02:10:27 2005
--- openafs/src/vol/vol-info.c	Wed Oct 31 00:13:51 2007
***************
*** 18,24 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vol/vol-info.c,v 1.18.2.3 2005/05/08 06:10:27 shadow Exp $");
  
  #include <ctype.h>
  #include <errno.h>
--- 18,24 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vol/vol-info.c,v 1.18.2.4 2007/10/31 04:13:51 shadow Exp $");
  
  #include <ctype.h>
  #include <errno.h>
***************
*** 217,223 ****
  
  
  static int
! handleit(struct cmd_syndesc *as)
  {
      register struct cmd_item *ti;
      int err = 0;
--- 217,223 ----
  
  
  static int
! handleit(struct cmd_syndesc *as, void *arock)
  {
      register struct cmd_item *ti;
      int err = 0;
***************
*** 622,628 ****
      register struct cmd_syndesc *ts;
      afs_int32 code;
  
!     ts = cmd_CreateSyntax(NULL, handleit, 0, "Dump volume's internal state");
      cmd_AddParm(ts, "-online", CMD_FLAG, CMD_OPTIONAL,
  		"Get info from running fileserver");
      cmd_AddParm(ts, "-vnode", CMD_FLAG, CMD_OPTIONAL, "Dump vnode info");
--- 622,628 ----
      register struct cmd_syndesc *ts;
      afs_int32 code;
  
!     ts = cmd_CreateSyntax(NULL, handleit, NULL, "Dump volume's internal state");
      cmd_AddParm(ts, "-online", CMD_FLAG, CMD_OPTIONAL,
  		"Get info from running fileserver");
      cmd_AddParm(ts, "-vnode", CMD_FLAG, CMD_OPTIONAL, "Dump vnode info");
Index: openafs/src/vol/vol-salvage.c
diff -c openafs/src/vol/vol-salvage.c:1.41.2.13 openafs/src/vol/vol-salvage.c:1.41.2.14
*** openafs/src/vol/vol-salvage.c:1.41.2.13	Fri Sep  7 00:05:49 2007
--- openafs/src/vol/vol-salvage.c	Mon Nov 26 16:21:57 2007
***************
*** 92,98 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vol/vol-salvage.c,v 1.41.2.13 2007/09/07 04:05:49 shadow Exp $");
  
  #include <stdlib.h>
  #include <stdio.h>
--- 92,98 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vol/vol-salvage.c,v 1.41.2.14 2007/11/26 21:21:57 shadow Exp $");
  
  #include <stdlib.h>
  #include <stdio.h>
***************
*** 844,849 ****
--- 844,850 ----
  #endif /* FAST_RESTART */
      err = cmd_Dispatch(argc, argv);
      Exit(err);
+     return 0; /* not reached */
  }
  
  /* Get the salvage lock if not already held. Hold until process exits. */
Index: openafs/src/volser/Makefile.in
diff -c openafs/src/volser/Makefile.in:1.15 openafs/src/volser/Makefile.in:1.15.2.1
*** openafs/src/volser/Makefile.in:1.15	Mon Aug  9 00:35:54 2004
--- openafs/src/volser/Makefile.in	Thu Nov  1 12:06:01 2007
***************
*** 83,98 ****
  	${COMPILE_ET} -p ${srcdir} volerr -h volser
  
  volint.cs.c: volint.xg
! 	${RXGEN} -x -C -o $@ ${srcdir}/volint.xg
  
  volint.ss.c: volint.xg
! 	${RXGEN} -x -S -o $@ ${srcdir}/volint.xg
  
  volint.xdr.c: volint.xg
! 	${RXGEN} -x -c -o $@ ${srcdir}/volint.xg
  
  volint.h: volint.xg
! 	${RXGEN} -x -h -o $@ ${srcdir}/volint.xg
  
  volint.cs.c: volint.h
  volint.ss.c: volint.h
--- 83,98 ----
  	${COMPILE_ET} -p ${srcdir} volerr -h volser
  
  volint.cs.c: volint.xg
! 	${RXGEN} -A -x -C -o $@ ${srcdir}/volint.xg
  
  volint.ss.c: volint.xg
! 	${RXGEN} -A -x -S -o $@ ${srcdir}/volint.xg
  
  volint.xdr.c: volint.xg
! 	${RXGEN} -A -x -c -o $@ ${srcdir}/volint.xg
  
  volint.h: volint.xg
! 	${RXGEN} -A -x -h -o $@ ${srcdir}/volint.xg
  
  volint.cs.c: volint.h
  volint.ss.c: volint.h
Index: openafs/src/volser/dumpstuff.c
diff -c openafs/src/volser/dumpstuff.c:1.25.2.8 openafs/src/volser/dumpstuff.c:1.25.2.10
*** openafs/src/volser/dumpstuff.c:1.25.2.8	Mon Dec 18 23:51:08 2006
--- openafs/src/volser/dumpstuff.c	Mon Jan 21 09:11:20 2008
***************
*** 11,22 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/dumpstuff.c,v 1.25.2.8 2006/12/19 04:51:08 shadow Exp $");
  
  #include <sys/types.h>
  #include <ctype.h>
  #include <stdio.h>
  #include <errno.h>
  #ifdef AFS_NT40_ENV
  #include <fcntl.h>
  #else
--- 11,23 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/dumpstuff.c,v 1.25.2.10 2008/01/21 14:11:20 shadow Exp $");
  
  #include <sys/types.h>
  #include <ctype.h>
  #include <stdio.h>
  #include <errno.h>
+ #include <string.h>
  #ifdef AFS_NT40_ENV
  #include <fcntl.h>
  #else
***************
*** 26,38 ****
  #include <netinet/in.h>
  #include <unistd.h>
  #endif
- #ifdef HAVE_STRING_H
- #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <sys/stat.h>
  #ifdef AFS_PTHREAD_ENV
  #include <assert.h>
--- 27,32 ----
***************
*** 1033,1040 ****
      iod_Init(iodp, call);
  
      vp = avp;
-     if (V_parentId(vp) == V_id(vp))
-       delo = incremental;
  
      if (!ReadDumpHeader(iodp, &header)) {
  	Log("1 Volser: RestoreVolume: Error reading header file for dump; aborted\n");
--- 1027,1032 ----
Index: openafs/src/volser/lockprocs.c
diff -c openafs/src/volser/lockprocs.c:1.8 openafs/src/volser/lockprocs.c:1.8.2.2
*** openafs/src/volser/lockprocs.c:1.8	Tue Jul 15 19:17:48 2003
--- openafs/src/volser/lockprocs.c	Mon Nov 26 16:21:57 2007
***************
*** 18,24 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/lockprocs.c,v 1.8 2003/07/15 23:17:48 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
--- 18,24 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/lockprocs.c,v 1.8.2.2 2007/11/26 21:21:57 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
***************
*** 26,38 ****
  #else
  #include <netinet/in.h>
  #endif
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <afs/voldefs.h>
  #include <rx/xdr.h>
  #include <rx/rx.h>
--- 26,32 ----
***************
*** 108,113 ****
--- 102,108 ----
  }
  
  /* Changes the RW site only */
+ void
  Lp_SetRWValue(entry, oserver, opart, nserver, npart)
       struct nvldbentry *entry;
       afs_int32 oserver, opart, nserver, npart;
***************
*** 116,121 ****
--- 111,117 ----
  }
  
  /* Changes the RO site only */
+ void
  Lp_SetROValue(entry, oserver, opart, nserver, npart)
       struct nvldbentry *entry;
       afs_int32 oserver, opart, nserver, npart;
***************
*** 149,154 ****
--- 145,151 ----
  }
  
  /*initialize queue pointed by <ahead>*/
+ void
  Lp_QInit(ahead)
       struct qHead *ahead;
  {
***************
*** 157,162 ****
--- 154,160 ----
  }
  
  /*add <elem> in front of queue <ahead> */
+ void
  Lp_QAdd(ahead, elem)
       struct qHead *ahead;
       struct aqueue *elem;
***************
*** 198,203 ****
--- 196,202 ----
  
  /*return the element in the beginning of the queue <ahead>, free
  *the space used by that element . <success> indicates if enumeration was ok*/
+ void
  Lp_QEnumerate(ahead, success, elem)
       struct qHead *ahead;
       struct aqueue *elem;
***************
*** 223,228 ****
--- 222,228 ----
  	*success = 0;
  }
  
+ void
  Lp_QTraverse(ahead)
       struct qHead *ahead;
  {
Index: openafs/src/volser/physio.c
diff -c openafs/src/volser/physio.c:1.11 openafs/src/volser/physio.c:1.11.2.1
*** openafs/src/volser/physio.c:1.11	Tue Dec  9 18:07:57 2003
--- openafs/src/volser/physio.c	Tue Oct 30 11:24:12 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/physio.c,v 1.11 2003/12/09 23:07:57 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/physio.c,v 1.11.2.1 2007/10/30 15:24:12 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
***************
*** 21,33 ****
  #include <netinet/in.h>
  #include <unistd.h>
  #endif
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #ifdef	AFS_SUN5_ENV
  #include <sys/fcntl.h>
  #endif
--- 21,27 ----
Index: openafs/src/volser/restorevol.c
diff -c openafs/src/volser/restorevol.c:1.13 openafs/src/volser/restorevol.c:1.13.2.3
*** openafs/src/volser/restorevol.c:1.13	Fri Dec  5 03:36:06 2003
--- openafs/src/volser/restorevol.c	Mon Nov 26 16:21:57 2007
***************
*** 43,49 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/restorevol.c,v 1.13 2003/12/05 08:36:06 shadow Exp $");
  
  #include <afs/afsint.h>
  #include <afs/nfs.h>
--- 43,49 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/restorevol.c,v 1.13.2.3 2007/11/26 21:21:57 shadow Exp $");
  
  #include <afs/afsint.h>
  #include <afs/nfs.h>
***************
*** 64,77 ****
  #include <sys/stat.h>
  #include <fcntl.h>
  #include <dirent.h>
- 
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  
  
  char rootdir[MAXPATHLEN];
--- 64,70 ----
***************
*** 125,131 ****
  #define BUFSIZE 16384
  char buf[BUFSIZE];
  
! char
  readdata(buffer, size)
       char *buffer;
       afs_sfsize_t size;
--- 118,124 ----
  #define BUFSIZE 16384
  char buf[BUFSIZE];
  
! void
  readdata(buffer, size)
       char *buffer;
       afs_sfsize_t size;
***************
*** 795,803 ****
      return ((afs_int32) tag);
  }
  
! WorkerBee(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
  {
      int code = 0, c, len;
      afs_int32 type, count, vcount;
--- 788,795 ----
      return ((afs_int32) tag);
  }
  
! static int
! WorkerBee(struct cmd_syndesc *as, void *arock)
  {
      int code = 0, c, len;
      afs_int32 type, count, vcount;
Index: openafs/src/volser/vol-dump.c
diff -c openafs/src/volser/vol-dump.c:1.1 openafs/src/volser/vol-dump.c:1.1.2.1
*** openafs/src/volser/vol-dump.c:1.1	Wed Aug 27 23:16:34 2003
--- openafs/src/volser/vol-dump.c	Wed Oct 31 00:13:54 2007
***************
*** 18,24 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/vol-dump.c,v 1.1 2003/08/28 03:16:34 shadow Exp $");
  
  #include <ctype.h>
  #include <errno.h>
--- 18,24 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/vol-dump.c,v 1.1.2.1 2007/10/31 04:13:54 shadow Exp $");
  
  #include <ctype.h>
  #include <errno.h>
***************
*** 166,172 ****
  
  
  static int
! handleit(struct cmd_syndesc *as, char *arock)
  {
      register struct cmd_item *ti;
      int err = 0;
--- 166,172 ----
  
  
  static int
! handleit(struct cmd_syndesc *as, void *arock)
  {
      register struct cmd_item *ti;
      int err = 0;
***************
*** 291,297 ****
  
      VInitVolumePackage(volumeUtility, 5, 5, DONT_CONNECT_FS, 0);
  
!     ts = cmd_CreateSyntax(NULL, handleit, 0,
  			  "Dump a volume to a 'vos dump' format file without using volserver");
      cmd_AddParm(ts, "-part", CMD_LIST, CMD_OPTIONAL, "AFS partition name");
      cmd_AddParm(ts, "-volumeid", CMD_LIST, CMD_OPTIONAL, "Volume id");
--- 291,297 ----
  
      VInitVolumePackage(volumeUtility, 5, 5, DONT_CONNECT_FS, 0);
  
!     ts = cmd_CreateSyntax(NULL, handleit, NULL,
  			  "Dump a volume to a 'vos dump' format file without using volserver");
      cmd_AddParm(ts, "-part", CMD_LIST, CMD_OPTIONAL, "AFS partition name");
      cmd_AddParm(ts, "-volumeid", CMD_LIST, CMD_OPTIONAL, "Volume id");
Index: openafs/src/volser/volmain.c
diff -c openafs/src/volser/volmain.c:1.18.2.9 openafs/src/volser/volmain.c:1.18.2.14
*** openafs/src/volser/volmain.c:1.18.2.9	Wed Jun 27 22:13:44 2007
--- openafs/src/volser/volmain.c	Mon Mar 10 18:35:37 2008
***************
*** 11,19 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/volmain.c,v 1.18.2.9 2007/06/28 02:13:44 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
  #include <time.h>
  #include <fcntl.h>
--- 11,20 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/volmain.c,v 1.18.2.14 2008/03/10 22:35:37 shadow Exp $");
  
  #include <sys/types.h>
+ #include <string.h>
  #ifdef AFS_NT40_ENV
  #include <time.h>
  #include <fcntl.h>
***************
*** 24,36 ****
  #include <sys/file.h>
  #include <netinet/in.h>
  #endif
- #ifdef HAVE_STRING_H
- #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  #include <rx/xdr.h>
  #include <afs/afsint.h>
  #include <stdio.h>
--- 25,30 ----
***************
*** 96,101 ****
--- 90,96 ----
  int udpBufSize = 0;		/* UDP buffer size for receive */
  
  int rxBind = 0;
+ int rxkadDisableDotCheck = 0;
  
  #define ADDRSPERSITE 16         /* Same global is in rx/rx_user.c */
  afs_uint32 SHostAddrs[ADDRSPERSITE];
***************
*** 148,155 ****
  }
  
  /* background daemon for timing out transactions */
! static void
! BKGLoop()
  {
      struct timeval tv;
      int loop = 0;
--- 143,150 ----
  }
  
  /* background daemon for timing out transactions */
! static void*
! BKGLoop(void *unused)
  {
      struct timeval tv;
      int loop = 0;
***************
*** 170,181 ****
  	    ReOpenLog(AFSDIR_SERVER_VOLSERLOG_FILEPATH);
  	}
      }
  }
  
  /* Background daemon for sleeping so the volserver does not become I/O bound */
  afs_int32 TTsleep, TTrun;
! static void
! BKGSleep()
  {
      struct volser_trans *tt;
  
--- 165,178 ----
  	    ReOpenLog(AFSDIR_SERVER_VOLSERLOG_FILEPATH);
  	}
      }
+ 
+     return NULL;
  }
  
  /* Background daemon for sleeping so the volserver does not become I/O bound */
  afs_int32 TTsleep, TTrun;
! static void *
! BKGSleep(void *unused)
  {
      struct volser_trans *tt;
  
***************
*** 203,208 ****
--- 200,206 ----
  	        VTRANS_UNLOCK;
  	}
      }
+     return NULL;
  }
  
  #ifndef AFS_NT40_ENV
***************
*** 295,300 ****
--- 293,300 ----
  	    goto usage;
  	} else if (strcmp(argv[code], "-rxbind") == 0) {
  	    rxBind = 1;
+ 	} else if (strcmp(argv[code], "-allow-dotted-principals") == 0) {
+ 	    rxkadDisableDotCheck = 1;
  	} else if (strcmp(argv[code], "-p") == 0) {
  	    lwps = atoi(argv[++code]);
  	    if (lwps > MAXLWP) {
***************
*** 386,392 ****
  #ifndef AFS_NT40_ENV
  	    printf("Usage: volserver [-log] [-p <number of processes>] "
  		   "[-auditlog <log path>] "
! 		   "[-nojumbo] [-rxmaxmtu <bytes>] [-rxbind] "
  		   "[-udpsize <size of socket buffer in bytes>] "
  		   "[-syslog[=FACILITY]] "
  		   "[-enable_peer_stats] [-enable_process_stats] "
--- 386,392 ----
  #ifndef AFS_NT40_ENV
  	    printf("Usage: volserver [-log] [-p <number of processes>] "
  		   "[-auditlog <log path>] "
! 		   "[-nojumbo] [-rxmaxmtu <bytes>] [-rxbind] [-allow-dotted-principals] "
  		   "[-udpsize <size of socket buffer in bytes>] "
  		   "[-syslog[=FACILITY]] "
  		   "[-enable_peer_stats] [-enable_process_stats] "
***************
*** 394,400 ****
  #else
  	    printf("Usage: volserver [-log] [-p <number of processes>] "
  		   "[-auditlog <log path>] "
! 		   "[-nojumbo] [-rxmaxmtu <bytes>] [-rxbind] "
  		   "[-udpsize <size of socket buffer in bytes>] "
  		   "[-enable_peer_stats] [-enable_process_stats] "
  		   "[-help]\n");
--- 394,400 ----
  #else
  	    printf("Usage: volserver [-log] [-p <number of processes>] "
  		   "[-auditlog <log path>] "
! 		   "[-nojumbo] [-rxmaxmtu <bytes>] [-rxbind] [-allow-dotted-principals] "
  		   "[-udpsize <size of socket buffer in bytes>] "
  		   "[-enable_peer_stats] [-enable_process_stats] "
  		   "[-help]\n");
***************
*** 518,529 ****
      if (lwps < 4)
  	lwps = 4;
      rx_SetMaxProcs(service, lwps);
! #ifdef AFS_SGI_ENV
!     rx_SetStackSize(service, 49152);
  #else
!     rx_SetStackSize(service, 32768);
  #endif
  
      service =
  	rx_NewService(0, RX_STATS_SERVICE_ID, "rpcstats", securityObjects, 3,
  		      RXSTATS_ExecuteRequest);
--- 518,537 ----
      if (lwps < 4)
  	lwps = 4;
      rx_SetMaxProcs(service, lwps);
! #if defined(AFS_XBSD_ENV)
!     rx_SetStackSize(service, (128 * 1024));
! #elif defined(AFS_SGI_ENV)
!     rx_SetStackSize(service, (48 * 1024));
  #else
!     rx_SetStackSize(service, (32 * 1024));
  #endif
  
+     if (rxkadDisableDotCheck) {
+         rx_SetSecurityConfiguration(service, RXS_CONFIG_FLAGS,
+                                     (void *)RXS_CONFIG_FLAGS_DISABLE_DOTCHECK,
+                                     NULL);
+     }
+ 
      service =
  	rx_NewService(0, RX_STATS_SERVICE_ID, "rpcstats", securityObjects, 3,
  		      RXSTATS_ExecuteRequest);
***************
*** 546,549 ****
--- 554,558 ----
  
      osi_audit(VS_FinishEvent, (-1), AUD_END);
      Abort("StartServer returned?");
+     return 0; /* not reached */
  }
Index: openafs/src/volser/volprocs.c
diff -c openafs/src/volser/volprocs.c:1.34.2.9 openafs/src/volser/volprocs.c:1.34.2.13
*** openafs/src/volser/volprocs.c:1.34.2.9	Mon Oct 15 10:18:57 2007
--- openafs/src/volser/volprocs.c	Mon Mar 17 13:14:21 2008
***************
*** 11,20 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/volprocs.c,v 1.34.2.9 2007/10/15 14:18:57 shadow Exp $");
  
  #include <stdio.h>
  #include <sys/types.h>
  #include <errno.h>
  #ifdef AFS_NT40_ENV
  #include <fcntl.h>
--- 11,21 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/volprocs.c,v 1.34.2.13 2008/03/17 17:14:21 shadow Exp $");
  
  #include <stdio.h>
  #include <sys/types.h>
+ #include <string.h>
  #include <errno.h>
  #ifdef AFS_NT40_ENV
  #include <fcntl.h>
***************
*** 25,38 ****
  #include <unistd.h>
  #endif
  
- #ifdef HAVE_STRING_H
- #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
- 
  #include <dirent.h>
  #include <sys/stat.h>
  #include <rx/xdr.h>
--- 26,31 ----
***************
*** 198,204 ****
  	*error = EINVAL;
  	return NULL;
      }
!     tv = VAttachVolumeByName(error, pbuf, vbuf, amode);
      return tv;
  }
  
--- 191,197 ----
  	*error = EINVAL;
  	return NULL;
      }
!     tv = VAttachVolumeByName((Error *)error, pbuf, vbuf, amode);
      return tv;
  }
  
***************
*** 210,223 ****
      struct acl_accessList *ACL;
      ViceFid did;
      Inode inodeNumber, nearInode;
!     char buf[SIZEOF_LARGEDISKVNODE];
!     struct VnodeDiskObject *vnode = (struct VnodeDiskObject *)buf;
      struct VnodeClassInfo *vcp = &VnodeClassInfo[vLarge];
      IHandle_t *h;
      FdHandle_t *fdP;
      int code;
      afs_fsize_t length;
  
      memset(vnode, 0, SIZEOF_LARGEDISKVNODE);
  
      V_pref(vp, nearInode);
--- 203,218 ----
      struct acl_accessList *ACL;
      ViceFid did;
      Inode inodeNumber, nearInode;
!     struct VnodeDiskObject *vnode;
      struct VnodeClassInfo *vcp = &VnodeClassInfo[vLarge];
      IHandle_t *h;
      FdHandle_t *fdP;
      int code;
      afs_fsize_t length;
  
+     vnode = (struct VnodeDiskObject *)malloc(SIZEOF_LARGEDISKVNODE);
+     if (!vnode)
+ 	return ENOMEM;
      memset(vnode, 0, SIZEOF_LARGEDISKVNODE);
  
      V_pref(vp, nearInode);
***************
*** 282,287 ****
--- 277,283 ----
      VNDISK_GET_LEN(length, vnode);
      V_diskused(vp) = nBlocks(length);
  
+     free(vnode);
      return 1;
  }
  
***************
*** 1180,1187 ****
      struct Volume *vp;
      int i, is_incremental;
  
!     if (results)
  	memset(results, 0, sizeof(manyResults));
  
      if (!afsconf_SuperUser(tdir, acid, caller))
  	return VOLSERBAD_ACCESS;	/*not a super user */
--- 1176,1189 ----
      struct Volume *vp;
      int i, is_incremental;
  
!     if (results) {
  	memset(results, 0, sizeof(manyResults));
+ 	i = results->manyResults_len = destinations->manyDests_len;
+ 	results->manyResults_val = codes =
+ 	  (afs_int32 *) malloc(i * sizeof(afs_int32));
+     }	
+     if (!results || !results->manyResults_val)
+ 	return ENOMEM;
  
      if (!afsconf_SuperUser(tdir, acid, caller))
  	return VOLSERBAD_ACCESS;	/*not a super user */
***************
*** 1199,1210 ****
      /* (fromDate == 0) ==> full dump */
      is_incremental = (fromDate ? 1 : 0);
  
-     i = results->manyResults_len = destinations->manyDests_len;
-     results->manyResults_val = codes =
- 	(afs_int32 *) malloc(i * sizeof(afs_int32));
      tcons =
  	(struct rx_connection **)malloc(i * sizeof(struct rx_connection *));
      tcalls = (struct rx_call **)malloc(i * sizeof(struct rx_call *));
  
      /* get auth info for this connection (uses afs from ticket file) */
      code = afsconf_ClientAuth(tdir, &securityObject, &securityIndex);
--- 1201,1216 ----
      /* (fromDate == 0) ==> full dump */
      is_incremental = (fromDate ? 1 : 0);
  
      tcons =
  	(struct rx_connection **)malloc(i * sizeof(struct rx_connection *));
+     if (!tcons) {
+ 	return ENOMEM;
+     }
      tcalls = (struct rx_call **)malloc(i * sizeof(struct rx_call *));
+     if (!tcalls) {
+ 	free(tcons);
+ 	return ENOMEM;
+     }
  
      /* get auth info for this connection (uses afs from ticket file) */
      code = afsconf_ClientAuth(tdir, &securityObject, &securityIndex);
***************
*** 1581,1587 ****
      struct volser_trans *tt;
      register int len;
  
!     *aname = NULL;
      tt = FindTrans(atrans);
      if (!tt)
  	return ENOENT;
--- 1587,1596 ----
      struct volser_trans *tt;
      register int len;
  
!     /* We need to at least fill it in */
!     *aname = (char *)malloc(1);
!     if (!*aname)
! 	return ENOMEM;
      tt = FindTrans(atrans);
      if (!tt)
  	return ENOENT;
***************
*** 1606,1612 ****
  	TRELE(tt);
  	return E2BIG;
      }
!     *aname = (char *)malloc(len);
      strcpy(*aname, td->name);
      tt->rxCallPtr = (struct rx_call *)0;
      if (TRELE(tt))
--- 1615,1621 ----
  	TRELE(tt);
  	return E2BIG;
      }
!     *aname = (char *)realloc(*aname, len);
      strcpy(*aname, td->name);
      tt->rxCallPtr = (struct rx_call *)0;
      if (TRELE(tt))
***************
*** 1695,1700 ****
--- 1704,1711 ----
  	    partList.partId[j++] = i;
      }
      pEntries->partEntries_val = (afs_int32 *) malloc(j * sizeof(int));
+     if (!pEntries->partEntries_val)
+ 	return ENOMEM;
      memcpy((char *)pEntries->partEntries_val, (char *)&partList,
  	   j * sizeof(int));
      pEntries->partEntries_len = j;
***************
*** 1770,1775 ****
--- 1781,1788 ----
      unsigned int now;
  
      volumeInfo->volEntries_val = (volintInfo *) malloc(sizeof(volintInfo));
+     if (!volumeInfo->volEntries_val)
+ 	return ENOMEM;
      pntr = volumeInfo->volEntries_val;
      volumeInfo->volEntries_len = 1;
      if (GetPartName(partid, pname))
***************
*** 1949,1954 ****
--- 1962,1969 ----
       */
      a_volumeXInfoP->volXEntries_val =
  	(volintXInfo *) malloc(sizeof(volintXInfo));
+     if (!a_volumeXInfoP->volXEntries_val)
+ 	return ENOMEM;
      xInfoP = a_volumeXInfoP->volXEntries_val;
      a_volumeXInfoP->volXEntries_len = 1;
      code = ENODEV;
***************
*** 2155,2160 ****
--- 2170,2177 ----
  
      volumeInfo->volEntries_val =
  	(volintInfo *) malloc(allocSize * sizeof(volintInfo));
+     if (!volumeInfo->volEntries_val)
+ 	return ENOMEM;
      pntr = volumeInfo->volEntries_val;
      volumeInfo->volEntries_len = 0;
      if (GetPartName(partid, pname))
***************
*** 2364,2369 ****
--- 2381,2388 ----
       */
      a_volumeXInfoP->volXEntries_val =
  	(volintXInfo *) malloc(allocSize * sizeof(volintXInfo));
+     if (!a_volumeXInfoP->volXEntries_val)
+ 	return ENOMEM;
      xInfoP = a_volumeXInfoP->volXEntries_val;
      a_volumeXInfoP->volXEntries_len = 0;
  
***************
*** 2601,2606 ****
--- 2620,2627 ----
  
      transInfo->transDebugEntries_val =
  	(transDebugInfo *) malloc(allocSize * sizeof(transDebugInfo));
+     if (!transInfo->transDebugEntries_val)
+ 	return ENOMEM;
      pntr = transInfo->transDebugEntries_val;
      transInfo->transDebugEntries_len = 0;
      allTrans = TransList();
***************
*** 2759,2874 ****
      return error;
  }
  
- #ifdef AFS_NAMEI_ENV
- /* 
-  * Inode number format  (from namei_ops.c): 
-  * low 26 bits - vnode number - all 1's if volume special file.
-  * next 3 bits - tag
-  * next 3 bits spare (0's)
-  * high 32 bits - uniquifier (regular) or type if spare
-  */
- #define NAMEI_VNODEMASK    0x003ffffff
- #define NAMEI_TAGMASK      0x7
- #define NAMEI_TAGSHIFT     26
- #define NAMEI_UNIQMASK     0xffffffff
- #define NAMEI_UNIQSHIFT    32
- #define NAMEI_INODESPECIAL ((Inode)NAMEI_VNODEMASK)
- #define NAMEI_VNODESPECIAL NAMEI_VNODEMASK
- #endif /* AFS_NAMEI_ENV */
- 
  afs_int32
  SAFSVolConvertROtoRWvolume(struct rx_call *acid, afs_int32 partId,
  			   afs_int32 volumeId)
  {
! #if defined(AFS_NAMEI_ENV) && !defined(AFS_NT40_ENV)
      DIR *dirp;
!     char pname[16];
!     char volname[20];
!     afs_int32 error = 0;
      afs_int32 volid;
-     int found = 0;
-     char caller[MAXKTCNAMELEN];
-     char headername[16];
-     char opath[256];
-     char npath[256];
-     struct VolumeDiskHeader h;
-     int fd;
-     IHandle_t *ih;
-     Inode ino;
-     struct DiskPartition *dp;
  
      if (!afsconf_SuperUser(tdir, acid, caller))
  	return VOLSERBAD_ACCESS;	/*not a super user */
      if (GetPartName(partId, pname))
! 	return VOLSERILLEGAL_PARTITION;
!     dirp = opendir(pname);
      if (dirp == NULL)
! 	return VOLSERILLEGAL_PARTITION;
      strcpy(volname, "");
  
!     while (strcmp(volname, "EOD") && !found) {	/*while there are more volumes in the partition */
! 	GetNextVol(dirp, volname, &volid);
! 	if (strcmp(volname, "")) {	/* its a volume */
! 	    if (volid == volumeId)
! 		found = 1;
  	}
      }
-     if (!found)
- 	return ENOENT;
-     (void)afs_snprintf(headername, sizeof headername, VFORMAT, volumeId);
-     (void)afs_snprintf(opath, sizeof opath, "%s/%s", pname, headername);
-     fd = open(opath, O_RDONLY);
-     if (fd < 0) {
- 	Log("1 SAFS_VolConvertROtoRWvolume: Couldn't open header for RO-volume %lu.\n", volumeId);
- 	return ENOENT;
-     }
-     if (read(fd, &h, sizeof(h)) != sizeof(h)) {
- 	Log("1 SAFS_VolConvertROtoRWvolume: Couldn't read header for RO-volume %lu.\n", volumeId);
- 	close(fd);
- 	return EIO;
-     }
-     close(fd);
-     FSYNC_askfs(volumeId, pname, FSYNC_RESTOREVOLUME, 0);
  
!     for (dp = DiskPartitionList; dp && strcmp(dp->name, pname);
! 	 dp = dp->next);
!     if (!dp) {
! 	Log("1 SAFS_VolConvertROtoRWvolume: Couldn't find DiskPartition for %s\n", pname);
! 	return EIO;
      }
-     ino = namei_MakeSpecIno(h.parent, VI_LINKTABLE);
-     IH_INIT(ih, dp->device, h.parent, ino);
  
!     error = namei_ConvertROtoRWvolume(ih, volumeId);
!     if (error)
! 	return error;
!     h.id = h.parent;
!     h.volumeInfo_hi = h.id;
!     h.smallVnodeIndex_hi = h.id;
!     h.largeVnodeIndex_hi = h.id;
!     h.linkTable_hi = h.id;
!     (void)afs_snprintf(headername, sizeof headername, VFORMAT, h.id);
!     (void)afs_snprintf(npath, sizeof npath, "%s/%s", pname, headername);
!     fd = open(npath, O_CREAT | O_EXCL | O_RDWR, 0644);
!     if (fd < 0) {
! 	Log("1 SAFS_VolConvertROtoRWvolume: Couldn't create header for RW-volume %lu.\n", h.id);
! 	return EIO;
!     }
!     if (write(fd, &h, sizeof(h)) != sizeof(h)) {
! 	Log("1 SAFS_VolConvertROtoRWvolume: Couldn't write header for RW-volume %lu.\n", h.id);
! 	close(fd);
! 	return EIO;
!     }
!     close(fd);
!     if (unlink(opath) < 0) {
! 	Log("1 SAFS_VolConvertROtoRWvolume: Couldn't unlink RO header, error = %d\n", error);
!     }
!     FSYNC_askfs(volumeId, pname, FSYNC_DONE, 0);
!     FSYNC_askfs(h.id, pname, FSYNC_ON, 0);
!     return 0;
! #else /* AFS_NAMEI_ENV */
!     return EINVAL;
! #endif /* AFS_NAMEI_ENV */
  }
  
  afs_int32
--- 2780,2844 ----
      return error;
  }
  
  afs_int32
  SAFSVolConvertROtoRWvolume(struct rx_call *acid, afs_int32 partId,
  			   afs_int32 volumeId)
  {
! #ifdef AFS_NT40_ENV
!     return EXDEV;
! #else
!     char caller[MAXKTCNAMELEN];
      DIR *dirp;
!     register struct volser_trans *ttc;
!     char pname[16], volname[20];
!     struct DiskPartition *partP;
!     afs_int32 ret = ENODEV;
      afs_int32 volid;
  
      if (!afsconf_SuperUser(tdir, acid, caller))
  	return VOLSERBAD_ACCESS;	/*not a super user */
      if (GetPartName(partId, pname))
!         return VOLSERILLEGAL_PARTITION;
!     if (!(partP = VGetPartition(pname, 0)))
!         return VOLSERILLEGAL_PARTITION;
!     dirp = opendir(VPartitionPath(partP));
      if (dirp == NULL)
!         return VOLSERILLEGAL_PARTITION;
      strcpy(volname, "");
+     ttc = (struct volser_trans *)0;
  
!     while (strcmp(volname, "EOD")) {
! 	if (!strcmp(volname, "")) {     /* its not a volume, fetch next file */
!             GetNextVol(dirp, volname, &volid);
!             continue;           /*back to while loop */
!         }
! 
!         if (volid == volumeId) {        /*copy other things too */
! #ifndef AFS_PTHREAD_ENV
!             IOMGR_Poll();       /*make sure that the client doesnot time out */
! #endif
!             ttc = NewTrans(volumeId, partId);
!             if (!ttc) {
! 		return VBUSY;
!             }
! #ifdef AFS_NAMEI_ENV
! 	    ret = namei_ConvertROtoRWvolume(pname, volumeId);
! #else
! 	    ret = inode_ConvertROtoRWvolume(pname, volumeId);
! #endif
! 	    break;
  	}
+ 	GetNextVol(dirp, volname, &volid);
      }
  
!     if (ttc) {
!         DeleteTrans(ttc, 1);
!         ttc = (struct volser_trans *)0;
      }
  
!     closedir(dirp);
!     return ret;
! #endif
  }
  
  afs_int32
Index: openafs/src/volser/volser.p.h
diff -c openafs/src/volser/volser.p.h:1.8.2.1 openafs/src/volser/volser.p.h:1.8.2.2
*** openafs/src/volser/volser.p.h:1.8.2.1	Mon Jul 11 15:27:29 2005
--- openafs/src/volser/volser.p.h	Mon Jan 21 09:35:10 2008
***************
*** 157,174 ****
  
  /* Values for the UV_RestoreVolume flags parameter */
  /* Also used for UV_CopyVolume and UV_CloneVolume */
! #define RV_FULLRST	0x00001
! #define RV_OFFLINE	0x00002
! #define RV_CRDUMP	0x00010
! #define RV_CRKEEP	0x00020
! #define RV_CRNEW	0x00040
! #define RV_LUDUMP	0x00100
! #define RV_LUKEEP	0x00200
! #define RV_LUNEW	0x00400
! #define RV_RDONLY	0x10000
! #define RV_CPINCR	0x20000
! #define RV_NOVLDB	0x40000
! #define RV_NOCLONE	0x80000
  
  struct ubik_client;
  extern afs_uint32 vsu_GetVolumeID(char *astring, struct ubik_client *acstruct, afs_int32 *errp);
--- 157,175 ----
  
  /* Values for the UV_RestoreVolume flags parameter */
  /* Also used for UV_CopyVolume and UV_CloneVolume */
! #define RV_FULLRST	0x000001
! #define RV_OFFLINE	0x000002
! #define RV_CRDUMP	0x000010
! #define RV_CRKEEP	0x000020
! #define RV_CRNEW	0x000040
! #define RV_LUDUMP	0x000100
! #define RV_LUKEEP	0x000200
! #define RV_LUNEW	0x000400
! #define RV_RDONLY	0x010000
! #define RV_CPINCR	0x020000
! #define RV_NOVLDB	0x040000
! #define RV_NOCLONE	0x080000
! #define RV_NODEL        0x100000
  
  struct ubik_client;
  extern afs_uint32 vsu_GetVolumeID(char *astring, struct ubik_client *acstruct, afs_int32 *errp);
Index: openafs/src/volser/volser_prototypes.h
diff -c openafs/src/volser/volser_prototypes.h:1.4.2.2 openafs/src/volser/volser_prototypes.h:1.4.2.3
*** openafs/src/volser/volser_prototypes.h:1.4.2.2	Thu Jul 19 14:52:40 2007
--- openafs/src/volser/volser_prototypes.h	Mon Jan 21 09:35:10 2008
***************
*** 52,58 ****
  			    afs_int32 tovolid, char tovolname[], int flags,
  			    afs_int32(*WriteData) (), char *rock);
  extern int UV_LockRelease(afs_int32 volid);
! extern int UV_AddSite(afs_int32 server, afs_int32 part, afs_int32 volid);
  extern int UV_RemoveSite(afs_int32 server, afs_int32 part, afs_int32 volid);
  extern int UV_ChangeLocation(afs_int32 server, afs_int32 part,
  			     afs_int32 volid);
--- 52,58 ----
  			    afs_int32 tovolid, char tovolname[], int flags,
  			    afs_int32(*WriteData) (), char *rock);
  extern int UV_LockRelease(afs_int32 volid);
! extern int UV_AddSite(afs_int32 server, afs_int32 part, afs_int32 volid, afs_int32 valid);
  extern int UV_RemoveSite(afs_int32 server, afs_int32 part, afs_int32 volid);
  extern int UV_ChangeLocation(afs_int32 server, afs_int32 part,
  			     afs_int32 volid);
Index: openafs/src/volser/voltrans.c
diff -c openafs/src/volser/voltrans.c:1.10.2.2 openafs/src/volser/voltrans.c:1.10.2.3
*** openafs/src/volser/voltrans.c:1.10.2.2	Thu Mar 22 12:01:16 2007
--- openafs/src/volser/voltrans.c	Tue Oct 30 11:24:12 2007
***************
*** 18,24 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/voltrans.c,v 1.10.2.2 2007/03/22 16:01:16 shadow Exp $");
  
  #ifdef AFS_NT40_ENV
  #include <afs/afsutil.h>
--- 18,24 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/voltrans.c,v 1.10.2.3 2007/10/30 15:24:12 shadow Exp $");
  
  #ifdef AFS_NT40_ENV
  #include <afs/afsutil.h>
***************
*** 29,34 ****
--- 29,35 ----
  #include <stdio.h>
  #include <sys/types.h>
  #include <errno.h>
+ #include <string.h>
  #ifdef AFS_NT40_ENV
  #include <fcntl.h>
  #include <winsock2.h>
***************
*** 62,75 ****
  #include <afs/vnode.h>
  #include <afs/volume.h>
  
- #ifdef HAVE_STRING_H
- #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
- 
  #include "volser.h"
  
  /*@printflike@*/ extern void Log(const char *format, ...);
--- 63,68 ----
Index: openafs/src/volser/vos.c
diff -c openafs/src/volser/vos.c:1.40.2.20 openafs/src/volser/vos.c:1.40.2.25
*** openafs/src/volser/vos.c:1.40.2.20	Tue Oct 23 10:22:27 2007
--- openafs/src/volser/vos.c	Sun Feb 10 22:46:33 2008
***************
*** 11,19 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/vos.c,v 1.40.2.20 2007/10/23 14:22:27 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
  #include <fcntl.h>
  #include <io.h>
--- 11,20 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/vos.c,v 1.40.2.25 2008/02/11 03:46:33 shadow Exp $");
  
  #include <sys/types.h>
+ #include <string.h>
  #ifdef AFS_NT40_ENV
  #include <fcntl.h>
  #include <io.h>
***************
*** 31,44 ****
  #endif
  #include <errno.h>
  
- #ifdef HAVE_STRING_H
- #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
- 
  #include <lock.h>
  #include <afs/stds.h>
  #include <rx/xdr.h>
--- 32,37 ----
***************
*** 1464,1472 ****
  }
  
  /* command to forcibly remove a volume */
! static
! NukeVolume(as)
!      register struct cmd_syndesc *as;
  {
      register afs_int32 code;
      afs_int32 volID, err;
--- 1457,1464 ----
  }
  
  /* command to forcibly remove a volume */
! static int
! NukeVolume(register struct cmd_syndesc *as)
  {
      register afs_int32 code;
      afs_int32 volID, err;
***************
*** 1530,1538 ****
   *	As advertised.
   *------------------------------------------------------------------------
   */
! static
! ExamineVolume(as)
!      register struct cmd_syndesc *as;
  {
      struct nvldbentry entry;
      afs_int32 vcode = 0;
--- 1522,1529 ----
   *	As advertised.
   *------------------------------------------------------------------------
   */
! static int
! ExamineVolume(register struct cmd_syndesc *as, void *arock)
  {
      struct nvldbentry entry;
      afs_int32 vcode = 0;
***************
*** 1683,1691 ****
   *	As advertised.
   *------------------------------------------------------------------------
   */
! static
! SetFields(as)
!      register struct cmd_syndesc *as;
  {
      struct nvldbentry entry;
      afs_int32 vcode = 0;
--- 1674,1681 ----
   *	As advertised.
   *------------------------------------------------------------------------
   */
! static int
! SetFields(register struct cmd_syndesc *as, void *arock)
  {
      struct nvldbentry entry;
      afs_int32 vcode = 0;
***************
*** 1764,1772 ****
   *	As advertised.
   *------------------------------------------------------------------------
   */
! static
! volOnline(as)
!      register struct cmd_syndesc *as;
  {
      afs_int32 server, partition, volid;
      afs_int32 code, err = 0;
--- 1754,1761 ----
   *	As advertised.
   *------------------------------------------------------------------------
   */
! static int
! volOnline(register struct cmd_syndesc *as, void *arock)
  {
      afs_int32 server, partition, volid;
      afs_int32 code, err = 0;
***************
*** 1825,1831 ****
   *------------------------------------------------------------------------
   */
  static int
! volOffline(register struct cmd_syndesc *as)
  {
      afs_int32 server, partition, volid;
      afs_int32 code, err = 0;
--- 1814,1820 ----
   *------------------------------------------------------------------------
   */
  static int
! volOffline(register struct cmd_syndesc *as, void *arock)
  {
      afs_int32 server, partition, volid;
      afs_int32 code, err = 0;
***************
*** 1875,1881 ****
  }
  
  static int
! CreateVolume(register struct cmd_syndesc *as)
  {
      afs_int32 pnum;
      char part[10];
--- 1864,1870 ----
  }
  
  static int
! CreateVolume(register struct cmd_syndesc *as, void *arock)
  {
      afs_int32 pnum;
      char part[10];
***************
*** 1983,1991 ****
      return error;
  }
  
! static
! DeleteVolume(as)
!      struct cmd_syndesc *as;
  {
      afs_int32 err, code = 0;
      afs_int32 server = 0, partition = -1, volid;
--- 1972,1979 ----
      return error;
  }
  
! static int
! DeleteVolume(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 err, code = 0;
      afs_int32 server = 0, partition = -1, volid;
***************
*** 2105,2112 ****
  
  #define TESTM	0		/* set for move space tests, clear for production */
  static
! MoveVolume(as)
!      register struct cmd_syndesc *as;
  {
  
      afs_int32 volid, fromserver, toserver, frompart, topart;
--- 2093,2099 ----
  
  #define TESTM	0		/* set for move space tests, clear for production */
  static
! MoveVolume(register struct cmd_syndesc *as, void *arock)
  {
  
      afs_int32 volid, fromserver, toserver, frompart, topart;
***************
*** 2232,2240 ****
      return 0;
  }
  
! static
! CopyVolume(as)
!      register struct cmd_syndesc *as;
  {
      afs_int32 volid, fromserver, toserver, frompart, topart, code, err, flags;
      char fromPartName[10], toPartName[10], *tovolume;
--- 2219,2226 ----
      return 0;
  }
  
! static int
! CopyVolume(register struct cmd_syndesc *as, void *arock)
  {
      afs_int32 volid, fromserver, toserver, frompart, topart, code, err, flags;
      char fromPartName[10], toPartName[10], *tovolume;
***************
*** 2379,2387 ****
  }
  
  
! static
! ShadowVolume(as)
!      register struct cmd_syndesc *as;
  {
      afs_int32 volid, fromserver, toserver, frompart, topart, tovolid;
      afs_int32 code, err, flags;
--- 2365,2372 ----
  }
  
  
! static int
! ShadowVolume(register struct cmd_syndesc *as, void *arock)
  {
      afs_int32 volid, fromserver, toserver, frompart, topart, tovolid;
      afs_int32 code, err, flags;
***************
*** 2576,2584 ****
  }
  
  
! static
! CloneVolume(as)
!      register struct cmd_syndesc *as;
  {
      afs_int32 server, part, volid, cloneid, voltype;
      char partName[10], *volname;
--- 2561,2568 ----
  }
  
  
! static int
! CloneVolume(register struct cmd_syndesc *as, void *arock)
  {
      afs_int32 server, part, volid, cloneid, voltype;
      char partName[10], *volname;
***************
*** 2637,2648 ****
--- 2621,2638 ----
  		volname, VOLSER_OLDMAXVOLNAME - 1);
  	    return E2BIG;
  	}
+ #if 0
+ 	/* 
+ 	 * In order that you be able to make clones of RO or BK, this
+ 	 * check must be omitted.
+ 	 */
  	if (!VolNameOK(volname)) {
  	    fprintf(STDERR,
  		"Illegal volume name %s, should not end in .readonly or .backup\n",
  		volname);
  	    return EINVAL;
  	}
+ #endif
  	if (IsNumeric(volname)) {
  	    fprintf(STDERR,
  		"Illegal volume name %s, should not be a number\n",
***************
*** 2677,2692 ****
  	return code;
      }
      MapPartIdIntoName(part, partName);
!     fprintf(STDOUT, "Created clone for volume %lu\n",
  	    as->parms[0].items->data);
  
      return 0;
  }
  
  
! static
! BackupVolume(as)
!      register struct cmd_syndesc *as;
  {
      afs_int32 avolid, aserver, apart, vtype, code, err;
      struct nvldbentry entry;
--- 2667,2681 ----
  	return code;
      }
      MapPartIdIntoName(part, partName);
!     fprintf(STDOUT, "Created clone for volume %s\n",
  	    as->parms[0].items->data);
  
      return 0;
  }
  
  
! static int
! BackupVolume(register struct cmd_syndesc *as, void *arock)
  {
      afs_int32 avolid, aserver, apart, vtype, code, err;
      struct nvldbentry entry;
***************
*** 2753,2761 ****
      return 0;
  }
  
! static
! ReleaseVolume(as)
!      register struct cmd_syndesc *as;
  {
  
      struct nvldbentry entry;
--- 2742,2749 ----
      return 0;
  }
  
! static int
! ReleaseVolume(register struct cmd_syndesc *as, void *arock)
  {
  
      struct nvldbentry entry;
***************
*** 2800,2808 ****
  }
  
  static
! DumpVolume(as)
!      register struct cmd_syndesc *as;
! 
  {
      afs_int32 avolid, aserver, apart, voltype, fromdate = 0, code, err, i, flags;
      char filename[MAXPATHLEN];
--- 2788,2794 ----
  }
  
  static
! DumpVolume(register struct cmd_syndesc *as, void *arock)
  {
      afs_int32 avolid, aserver, apart, voltype, fromdate = 0, code, err, i, flags;
      char filename[MAXPATHLEN];
***************
*** 2901,2910 ****
  #define TS_KEEP	2
  #define TS_NEW	3
  
! static
! RestoreVolume(as)
!      register struct cmd_syndesc *as;
! 
  {
      afs_int32 avolid, aparentid, aserver, apart, code, vcode, err;
      afs_int32 aoverwrite = ASK;
--- 2887,2894 ----
  #define TS_KEEP	2
  #define TS_NEW	3
  
! static int
! RestoreVolume(register struct cmd_syndesc *as, void *arock)
  {
      afs_int32 avolid, aparentid, aserver, apart, code, vcode, err;
      afs_int32 aoverwrite = ASK;
***************
*** 3174,3179 ****
--- 3158,3167 ----
  	default:
  	    restoreflags |= RV_LUDUMP;
      }
+     if (as->parms[10].items) {
+ 	restoreflags |= RV_NODEL;
+     }
+     
  
      code =
  	UV_RestoreVolume2(aserver, apart, avolid, aparentid,
***************
*** 3193,3202 ****
      return 0;
  }
  
! static
! LockReleaseCmd(as)
!      register struct cmd_syndesc *as;
! 
  {
      afs_int32 avolid, code, err;
  
--- 3181,3188 ----
      return 0;
  }
  
! static int
! LockReleaseCmd(register struct cmd_syndesc *as, void *arock)
  {
      afs_int32 avolid, code, err;
  
***************
*** 3220,3230 ****
      return 0;
  }
  
! static
! AddSite(as)
!      register struct cmd_syndesc *as;
  {
!     afs_int32 avolid, aserver, apart, code, err;
      char apartName[10], avolname[VOLSER_MAXVOLNAME + 1];
  
      vsu_ExtractName(avolname, as->parms[2].items->data);;
--- 3206,3215 ----
      return 0;
  }
  
! static int
! AddSite(register struct cmd_syndesc *as, void *arock)
  {
!     afs_int32 avolid, aserver, apart, code, err, valid = 0;
      char apartName[10], avolname[VOLSER_MAXVOLNAME + 1];
  
      vsu_ExtractName(avolname, as->parms[2].items->data);;
***************
*** 3258,3264 ****
  		    as->parms[1].items->data);
  	exit(1);
      }
!     code = UV_AddSite(aserver, apart, avolid);
      if (code) {
  	PrintDiagnostics("addsite", code);
  	exit(1);
--- 3243,3252 ----
  		    as->parms[1].items->data);
  	exit(1);
      }
!     if (as->parms[3].items) {
! 	valid = 1;
!     }
!     code = UV_AddSite(aserver, apart, avolid, valid);
      if (code) {
  	PrintDiagnostics("addsite", code);
  	exit(1);
***************
*** 3269,3277 ****
      return 0;
  }
  
! static
! RemoveSite(as)
!      register struct cmd_syndesc *as;
  {
  
      afs_int32 avolid, aserver, apart, code, err;
--- 3257,3264 ----
      return 0;
  }
  
! static int
! RemoveSite(register struct cmd_syndesc *as, void *arock)
  {
  
      afs_int32 avolid, aserver, apart, code, err;
***************
*** 3321,3329 ****
      return 0;
  }
  
! static
! ChangeLocation(as)
!      register struct cmd_syndesc *as;
  {
      afs_int32 avolid, aserver, apart, code, err;
      char apartName[10];
--- 3308,3315 ----
      return 0;
  }
  
! static int
! ChangeLocation(register struct cmd_syndesc *as, void *arock)
  {
      afs_int32 avolid, aserver, apart, code, err;
      char apartName[10];
***************
*** 3369,3377 ****
      return 0;
  }
  
! static
! ListPartitions(as)
!      register struct cmd_syndesc *as;
  {
      afs_int32 aserver, code;
      struct partList dummyPartList;
--- 3355,3362 ----
      return 0;
  }
  
! static int
! ListPartitions(register struct cmd_syndesc *as, void *arock)
  {
      afs_int32 aserver, code;
      struct partList dummyPartList;
***************
*** 3535,3542 ****
   *------------------------------------------------------------------------*/
  
  static
! ListVolumes(as)
!      register struct cmd_syndesc *as;
  {
      afs_int32 apart, int32list, fast;
      afs_int32 aserver, code;
--- 3520,3526 ----
   *------------------------------------------------------------------------*/
  
  static
! ListVolumes(register struct cmd_syndesc *as, void *arock)
  {
      afs_int32 apart, int32list, fast;
      afs_int32 aserver, code;
***************
*** 3691,3699 ****
      return 0;
  }
  
! static
! SyncVldb(as)
!      register struct cmd_syndesc *as;
  {
      afs_int32 pnum = 0, code;	/* part name */
      char part[10];
--- 3675,3682 ----
      return 0;
  }
  
! static int
! SyncVldb(register struct cmd_syndesc *as, void *arock)
  {
      afs_int32 pnum = 0, code;	/* part name */
      char part[10];
***************
*** 3735,3740 ****
--- 3718,3727 ----
  	}
      }
  
+     if (as->parms[3].items) {
+ 	flags |= 2; /* don't update */
+     }
+ 
      if (as->parms[2].items) {
  	/* Synchronize an individual volume */
  	volname = as->parms[2].items->data;
***************
*** 3761,3767 ****
      if (tserver) {
  	fprintf(STDOUT, " with state of server %s", as->parms[0].items->data);
      }
!     if (flags) {
  	MapPartIdIntoName(pnum, part);
  	fprintf(STDOUT, " partition %s\n", part);
      }
--- 3748,3754 ----
      if (tserver) {
  	fprintf(STDOUT, " with state of server %s", as->parms[0].items->data);
      }
!     if (flags & 1) {
  	MapPartIdIntoName(pnum, part);
  	fprintf(STDOUT, " partition %s\n", part);
      }
***************
*** 3770,3779 ****
      return 0;
  }
  
! static
! SyncServer(as)
!      register struct cmd_syndesc *as;
! 
  {
      afs_int32 pnum, code;	/* part name */
      char part[10];
--- 3757,3764 ----
      return 0;
  }
  
! static int
! SyncServer(register struct cmd_syndesc *as, void *arock)
  {
      afs_int32 pnum, code;	/* part name */
      char part[10];
***************
*** 3807,3818 ****
          pnum = -1;
      }
  
      code = UV_SyncServer(tserver, pnum, flags, 0 /*unused */ );
      if (code) {
  	PrintDiagnostics("syncserv", code);
  	exit(1);
      }
!     if (flags) {
  	MapPartIdIntoName(pnum, part);
  	fprintf(STDOUT, "Server %s partition %s synchronized with VLDB\n",
  		as->parms[0].items->data, part);
--- 3792,3806 ----
          pnum = -1;
      }
  
+     if (as->parms[2].items) {
+ 	flags |= 2; /* don't update */
+     }
      code = UV_SyncServer(tserver, pnum, flags, 0 /*unused */ );
      if (code) {
  	PrintDiagnostics("syncserv", code);
  	exit(1);
      }
!     if (flags & 1) {
  	MapPartIdIntoName(pnum, part);
  	fprintf(STDOUT, "Server %s partition %s synchronized with VLDB\n",
  		as->parms[0].items->data, part);
***************
*** 3851,3860 ****
      return 0;
  }
  
! static
! VolumeZap(as)
!      register struct cmd_syndesc *as;
! 
  {
      struct nvldbentry entry;
      afs_int32 volid, code, server, part, zapbackupid = 0, backupid = 0, err;
--- 3839,3846 ----
      return 0;
  }
  
! static int
! VolumeZap(register struct cmd_syndesc *as, void *arock)
  {
      struct nvldbentry entry;
      afs_int32 volid, code, server, part, zapbackupid = 0, backupid = 0, err;
***************
*** 3938,3947 ****
      return 0;
  }
  
! static
! VolserStatus(as)
!      register struct cmd_syndesc *as;
! 
  {
      afs_int32 server, code;
      transDebugInfo *pntr, *oldpntr;
--- 3924,3931 ----
      return 0;
  }
  
! static int
! VolserStatus(register struct cmd_syndesc *as, void *arock)
  {
      afs_int32 server, code;
      transDebugInfo *pntr, *oldpntr;
***************
*** 4031,4039 ****
      return 0;
  }
  
! static
! RenameVolume(as)
!      register struct cmd_syndesc *as;
  {
      afs_int32 code1, code2, code;
      struct nvldbentry entry;
--- 4015,4022 ----
      return 0;
  }
  
! static int
! RenameVolume(register struct cmd_syndesc *as, void *arock)
  {
      afs_int32 code1, code2, code;
      struct nvldbentry entry;
***************
*** 4152,4161 ****
      return -1;
  }
  
! static
! DeleteEntry(as)
!      register struct cmd_syndesc *as;
! 
  {
      afs_int32 apart;
      afs_int32 avolid;
--- 4135,4142 ----
      return -1;
  }
  
! static int
! DeleteEntry(register struct cmd_syndesc *as, void *arock)
  {
      afs_int32 apart;
      afs_int32 avolid;
***************
*** 4377,4385 ****
  }
  
  */
! static
! ListVLDB(as)
!      struct cmd_syndesc *as;
  {
      afs_int32 apart;
      afs_int32 aserver, code;
--- 4358,4365 ----
  }
  
  */
! static int
! ListVLDB(struct cmd_syndesc *as, void *arock)
  {
      afs_int32 apart;
      afs_int32 aserver, code;
***************
*** 4548,4556 ****
      return 0;
  }
  
! static
! BackSys(as)
!      register struct cmd_syndesc *as;
  {
      afs_int32 apart = 0, avolid;
      afs_int32 aserver = 0, code, aserver1, apart1;
--- 4528,4535 ----
      return 0;
  }
  
! static int
! BackSys(register struct cmd_syndesc *as, void *arock)
  {
      afs_int32 apart = 0, avolid;
      afs_int32 aserver = 0, code, aserver1, apart1;
***************
*** 4878,4886 ****
      return 0;
  }
  
! static
! UnlockVLDB(as)
!      register struct cmd_syndesc *as;
  {
      afs_int32 apart;
      afs_int32 aserver, code;
--- 4857,4864 ----
      return 0;
  }
  
! static int
! UnlockVLDB(register struct cmd_syndesc *as, void *arock)
  {
      afs_int32 apart;
      afs_int32 aserver, code;
***************
*** 5008,5016 ****
      return output;
  }
  
! static
! PartitionInfo(as)
!      register struct cmd_syndesc *as;
  {
      afs_int32 apart;
      afs_int32 aserver, code;
--- 4986,4993 ----
      return output;
  }
  
! static int
! PartitionInfo(register struct cmd_syndesc *as, void *arock)
  {
      afs_int32 apart;
      afs_int32 aserver, code;
***************
*** 5093,5102 ****
      return 0;
  }
  
! static
! ChangeAddr(as)
!      register struct cmd_syndesc *as;
! 
  {
      afs_int32 ip1, ip2, vcode;
      int remove = 0;
--- 5070,5077 ----
      return 0;
  }
  
! static int
! ChangeAddr(register struct cmd_syndesc *as, void *arock)
  {
      afs_int32 ip1, ip2, vcode;
      int remove = 0;
***************
*** 5243,5251 ****
      return;
  }
  
! static
! ListAddrs(as)
!      register struct cmd_syndesc *as;
  {
      afs_int32 vcode;
      afs_int32 i, noresolve = 0, printuuid = 0;
--- 5218,5225 ----
      return;
  }
  
! static int
! ListAddrs(register struct cmd_syndesc *as, void *arock)
  {
      afs_int32 vcode;
      afs_int32 i, noresolve = 0, printuuid = 0;
***************
*** 5351,5360 ****
      return 0;
  }
  
! static
! LockEntry(as)
!      register struct cmd_syndesc *as;
! 
  {
      afs_int32 avolid, vcode, err;
  
--- 5325,5332 ----
      return 0;
  }
  
! static int
! LockEntry(register struct cmd_syndesc *as, void *arock)
  {
      afs_int32 avolid, vcode, err;
  
***************
*** 5379,5388 ****
      return 0;
  }
  
! static
! ConvertRO(as)
!      register struct cmd_syndesc *as;
! 
  {
      afs_int32 partition = -1;
      afs_int32 server, volid, code, i, same;
--- 5351,5358 ----
      return 0;
  }
  
! static int
! ConvertRO(register struct cmd_syndesc *as, void *arock)
  {
      afs_int32 partition = -1;
      afs_int32 server, volid, code, i, same;
***************
*** 5545,5553 ****
      return code;
  }
  
! static
! Sizes(as)
!      register struct cmd_syndesc *as;
  {
      afs_int32 avolid, aserver, apart, voltype, fromdate = 0, code, err, i;
      struct nvldbentry entry;
--- 5515,5522 ----
      return code;
  }
  
! static int
! Sizes(register struct cmd_syndesc *as, void *arock)
  {
      afs_int32 avolid, aserver, apart, voltype, fromdate = 0, code, err, i;
      struct nvldbentry entry;
***************
*** 5646,5655 ****
  }
  
  
! static
! MyBeforeProc(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
  {
      register char *tcell;
      register afs_int32 code;
--- 5615,5622 ----
  }
  
  
! static int
! MyBeforeProc(struct cmd_syndesc *as, void *arock)
  {
      register char *tcell;
      register afs_int32 code;
***************
*** 5719,5725 ****
  
      cmd_SetBeforeProc(MyBeforeProc, NULL);
  
!     ts = cmd_CreateSyntax("create", CreateVolume, 0, "create a new volume");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, 0, "partition name");
      cmd_AddParm(ts, "-name", CMD_SINGLE, 0, "volume name");
--- 5686,5692 ----
  
      cmd_SetBeforeProc(MyBeforeProc, NULL);
  
!     ts = cmd_CreateSyntax("create", CreateVolume, NULL, "create a new volume");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, 0, "partition name");
      cmd_AddParm(ts, "-name", CMD_SINGLE, 0, "volume name");
***************
*** 5730,5743 ****
  #endif
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("remove", DeleteVolume, 0, "delete a volume");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_OPTIONAL, "machine name");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_OPTIONAL, "partition name");
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
  
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("move", MoveVolume, 0, "move a volume");
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
      cmd_AddParm(ts, "-fromserver", CMD_SINGLE, 0, "machine name on source");
      cmd_AddParm(ts, "-frompartition", CMD_SINGLE, 0,
--- 5697,5710 ----
  #endif
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("remove", DeleteVolume, NULL, "delete a volume");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_OPTIONAL, "machine name");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_OPTIONAL, "partition name");
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
  
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("move", MoveVolume, NULL, "move a volume");
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
      cmd_AddParm(ts, "-fromserver", CMD_SINGLE, 0, "machine name on source");
      cmd_AddParm(ts, "-frompartition", CMD_SINGLE, 0,
***************
*** 5750,5756 ****
  		"copy live volume without cloning");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("copy", CopyVolume, 0, "copy a volume");
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID on source");
      cmd_AddParm(ts, "-fromserver", CMD_SINGLE, 0, "machine name on source");
      cmd_AddParm(ts, "-frompartition", CMD_SINGLE, 0,
--- 5717,5723 ----
  		"copy live volume without cloning");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("copy", CopyVolume, NULL, "copy a volume");
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID on source");
      cmd_AddParm(ts, "-fromserver", CMD_SINGLE, 0, "machine name on source");
      cmd_AddParm(ts, "-frompartition", CMD_SINGLE, 0,
***************
*** 5768,5774 ****
  		"copy live volume without cloning");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("shadow", ShadowVolume, 0,
  			  "make or update a shadow volume");
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID on source");
      cmd_AddParm(ts, "-fromserver", CMD_SINGLE, 0, "machine name on source");
--- 5735,5741 ----
  		"copy live volume without cloning");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("shadow", ShadowVolume, NULL,
  			  "make or update a shadow volume");
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID on source");
      cmd_AddParm(ts, "-fromserver", CMD_SINGLE, 0, "machine name on source");
***************
*** 5792,5803 ****
  		"do incremental update if target exists");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("backup", BackupVolume, 0,
  			  "make backup of a volume");
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("clone", CloneVolume, 0,
  			  "make clone of a volume");
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_OPTIONAL, "server");
--- 5759,5770 ----
  		"do incremental update if target exists");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("backup", BackupVolume, NULL,
  			  "make backup of a volume");
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("clone", CloneVolume, NULL,
  			  "make clone of a volume");
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_OPTIONAL, "server");
***************
*** 5812,5824 ****
  		"make clone volume read-only, not readwrite");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("release", ReleaseVolume, 0, "release a volume");
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
      cmd_AddParm(ts, "-force", CMD_FLAG, CMD_OPTIONAL,
  		"force a complete release");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("dump", DumpVolume, 0, "dump a volume");
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
      cmd_AddParm(ts, "-time", CMD_SINGLE, CMD_OPTIONAL, "dump from time");
      cmd_AddParm(ts, "-file", CMD_SINGLE, CMD_OPTIONAL, "dump file");
--- 5779,5791 ----
  		"make clone volume read-only, not readwrite");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("release", ReleaseVolume, NULL, "release a volume");
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
      cmd_AddParm(ts, "-force", CMD_FLAG, CMD_OPTIONAL,
  		"force a complete release");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("dump", DumpVolume, NULL, "dump a volume");
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
      cmd_AddParm(ts, "-time", CMD_SINGLE, CMD_OPTIONAL, "dump from time");
      cmd_AddParm(ts, "-file", CMD_SINGLE, CMD_OPTIONAL, "dump file");
***************
*** 5830,5836 ****
  		"omit unchanged directories from an incremental dump");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("restore", RestoreVolume, 0, "restore a volume");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, 0, "partition name");
      cmd_AddParm(ts, "-name", CMD_SINGLE, 0, "name of volume to be restored");
--- 5797,5803 ----
  		"omit unchanged directories from an incremental dump");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("restore", RestoreVolume, NULL, "restore a volume");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, 0, "partition name");
      cmd_AddParm(ts, "-name", CMD_SINGLE, 0, "name of volume to be restored");
***************
*** 5846,5859 ****
  		"dump | keep | new");
      cmd_AddParm(ts, "-lastupdate", CMD_SINGLE, CMD_OPTIONAL,
  		"dump | keep | new");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("unlock", LockReleaseCmd, 0,
  			  "release lock on VLDB entry for a volume");
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("changeloc", ChangeLocation, 0,
  			  "change an RW volume's location in the VLDB");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0,
  		"machine name for new location");
--- 5813,5828 ----
  		"dump | keep | new");
      cmd_AddParm(ts, "-lastupdate", CMD_SINGLE, CMD_OPTIONAL,
  		"dump | keep | new");
+     cmd_AddParm(ts, "-nodelete", CMD_FLAG, CMD_OPTIONAL,
+ 		"do not delete old site when restoring to a new site");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("unlock", LockReleaseCmd, NULL,
  			  "release lock on VLDB entry for a volume");
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("changeloc", ChangeLocation, NULL,
  			  "change an RW volume's location in the VLDB");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0,
  		"machine name for new location");
***************
*** 5862,5886 ****
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("addsite", AddSite, 0, "add a replication site");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name for new site");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, 0,
  		"partition name for new site");
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("remsite", RemoveSite, 0,
  			  "remove a replication site");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, 0, "partition name");
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("listpart", ListPartitions, 0, "list partitions");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("listvol", ListVolumes, 0,
  			  "list volumes on server (bypass VLDB)");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_OPTIONAL, "partition name");
--- 5831,5856 ----
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("addsite", AddSite, NULL, "add a replication site");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name for new site");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, 0,
  		"partition name for new site");
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
+     cmd_AddParm(ts, "-valid", CMD_FLAG, CMD_OPTIONAL | CMD_HIDE, "publish as an up-to-date site in VLDB");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("remsite", RemoveSite, NULL,
  			  "remove a replication site");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, 0, "partition name");
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("listpart", ListPartitions, NULL, "list partitions");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("listvol", ListVolumes, NULL,
  			  "list volumes on server (bypass VLDB)");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_OPTIONAL, "partition name");
***************
*** 5897,5916 ****
  #endif /* FULL_LISTVOL_SWITCH */
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("syncvldb", SyncVldb, 0,
  			  "synchronize VLDB with server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_OPTIONAL, "machine name");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_OPTIONAL, "partition name");
      cmd_AddParm(ts, "-volume", CMD_SINGLE, CMD_OPTIONAL, "volume name or ID");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("syncserv", SyncServer, 0,
  			  "synchronize server with VLDB");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_OPTIONAL, "partition name");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("examine", ExamineVolume, 0,
  			  "everything about the volume");
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
      cmd_AddParm(ts, "-extended", CMD_FLAG, CMD_OPTIONAL,
--- 5867,5888 ----
  #endif /* FULL_LISTVOL_SWITCH */
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("syncvldb", SyncVldb, NULL,
  			  "synchronize VLDB with server");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_OPTIONAL, "machine name");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_OPTIONAL, "partition name");
      cmd_AddParm(ts, "-volume", CMD_SINGLE, CMD_OPTIONAL, "volume name or ID");
+     cmd_AddParm(ts, "-dryrun", CMD_FLAG, CMD_OPTIONAL, "report without updating");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("syncserv", SyncServer, NULL,
  			  "synchronize server with VLDB");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_OPTIONAL, "partition name");
+     cmd_AddParm(ts, "-dryrun", CMD_FLAG, CMD_OPTIONAL, "report without updating");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("examine", ExamineVolume, NULL,
  			  "everything about the volume");
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
      cmd_AddParm(ts, "-extended", CMD_FLAG, CMD_OPTIONAL,
***************
*** 5922,5935 ****
      COMMONPARMS;
      cmd_CreateAlias(ts, "volinfo");
  
!     ts = cmd_CreateSyntax("setfields", SetFields, 0,
  			  "change volume info fields");
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
      cmd_AddParm(ts, "-maxquota", CMD_SINGLE, CMD_OPTIONAL, "quota (KB)");
      cmd_AddParm(ts, "-clearuse", CMD_FLAG, CMD_OPTIONAL, "clear dayUse");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("offline", volOffline, 0, (char *)CMD_HIDDEN);
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "server name");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, 0, "partition name");
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
--- 5894,5907 ----
      COMMONPARMS;
      cmd_CreateAlias(ts, "volinfo");
  
!     ts = cmd_CreateSyntax("setfields", SetFields, NULL,
  			  "change volume info fields");
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
      cmd_AddParm(ts, "-maxquota", CMD_SINGLE, CMD_OPTIONAL, "quota (KB)");
      cmd_AddParm(ts, "-clearuse", CMD_FLAG, CMD_OPTIONAL, "clear dayUse");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("offline", volOffline, NULL, (char *)CMD_HIDDEN);
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "server name");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, 0, "partition name");
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
***************
*** 5937,5949 ****
      cmd_AddParm(ts, "-busy", CMD_FLAG, CMD_OPTIONAL, "busy volume");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("online", volOnline, 0, (char *)CMD_HIDDEN);
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "server name");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, 0, "partition name");
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("zap", VolumeZap, 0,
  			  "delete the volume, don't bother with VLDB");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, 0, "partition name");
--- 5909,5921 ----
      cmd_AddParm(ts, "-busy", CMD_FLAG, CMD_OPTIONAL, "busy volume");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("online", volOnline, NULL, (char *)CMD_HIDDEN);
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "server name");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, 0, "partition name");
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("zap", VolumeZap, NULL,
  			  "delete the volume, don't bother with VLDB");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, 0, "partition name");
***************
*** 5954,5970 ****
  		"also delete backup volume if one is found");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("status", VolserStatus, 0,
  			  "report on volser status");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("rename", RenameVolume, 0, "rename a volume");
      cmd_AddParm(ts, "-oldname", CMD_SINGLE, 0, "old volume name ");
      cmd_AddParm(ts, "-newname", CMD_SINGLE, 0, "new volume name ");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("listvldb", ListVLDB, 0,
  			  "list volumes in the VLDB");
      cmd_AddParm(ts, "-name", CMD_SINGLE, CMD_OPTIONAL, "volume name or ID");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_OPTIONAL, "machine name");
--- 5926,5942 ----
  		"also delete backup volume if one is found");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("status", VolserStatus, NULL,
  			  "report on volser status");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("rename", RenameVolume, NULL, "rename a volume");
      cmd_AddParm(ts, "-oldname", CMD_SINGLE, 0, "old volume name ");
      cmd_AddParm(ts, "-newname", CMD_SINGLE, 0, "new volume name ");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("listvldb", ListVLDB, NULL,
  			  "list volumes in the VLDB");
      cmd_AddParm(ts, "-name", CMD_SINGLE, CMD_OPTIONAL, "volume name or ID");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_OPTIONAL, "machine name");
***************
*** 5976,5982 ****
  		"do not alphabetically sort the volume names");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("backupsys", BackSys, 0, "en masse backups");
      cmd_AddParm(ts, "-prefix", CMD_LIST, CMD_OPTIONAL,
  		"common prefix on volume(s)");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_OPTIONAL, "machine name");
--- 5948,5954 ----
  		"do not alphabetically sort the volume names");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("backupsys", BackSys, NULL, "en masse backups");
      cmd_AddParm(ts, "-prefix", CMD_LIST, CMD_OPTIONAL,
  		"common prefix on volume(s)");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_OPTIONAL, "machine name");
***************
*** 5988,5994 ****
      cmd_AddParm(ts, "-dryrun", CMD_FLAG, CMD_OPTIONAL, "no action");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("delentry", DeleteEntry, 0,
  			  "delete VLDB entry for a volume");
      cmd_AddParm(ts, "-id", CMD_LIST, CMD_OPTIONAL, "volume name or ID");
      cmd_AddParm(ts, "-prefix", CMD_SINGLE, CMD_OPTIONAL,
--- 5960,5966 ----
      cmd_AddParm(ts, "-dryrun", CMD_FLAG, CMD_OPTIONAL, "no action");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("delentry", DeleteEntry, NULL,
  			  "delete VLDB entry for a volume");
      cmd_AddParm(ts, "-id", CMD_LIST, CMD_OPTIONAL, "volume name or ID");
      cmd_AddParm(ts, "-prefix", CMD_SINGLE, CMD_OPTIONAL,
***************
*** 5999,6005 ****
  		"no execute");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("partinfo", PartitionInfo, 0,
  			  "list partition information");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_OPTIONAL, "partition name");
--- 5971,5977 ----
  		"no execute");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("partinfo", PartitionInfo, NULL,
  			  "list partition information");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_OPTIONAL, "partition name");
***************
*** 6007,6024 ****
  		"print storage summary");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("unlockvldb", UnlockVLDB, 0,
  			  "unlock all the locked entries in the VLDB");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_OPTIONAL, "machine name");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_OPTIONAL, "partition name");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("lock", LockEntry, 0,
  			  "lock VLDB entry for a volume");
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("changeaddr", ChangeAddr, 0,
  			  "change the IP address of a file server");
      cmd_AddParm(ts, "-oldaddr", CMD_SINGLE, 0, "original IP address");
      cmd_AddParm(ts, "-newaddr", CMD_SINGLE, CMD_OPTIONAL, "new IP address");
--- 5979,5996 ----
  		"print storage summary");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("unlockvldb", UnlockVLDB, NULL,
  			  "unlock all the locked entries in the VLDB");
      cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_OPTIONAL, "machine name");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_OPTIONAL, "partition name");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("lock", LockEntry, NULL,
  			  "lock VLDB entry for a volume");
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("changeaddr", ChangeAddr, NULL,
  			  "change the IP address of a file server");
      cmd_AddParm(ts, "-oldaddr", CMD_SINGLE, 0, "original IP address");
      cmd_AddParm(ts, "-newaddr", CMD_SINGLE, CMD_OPTIONAL, "new IP address");
***************
*** 6026,6032 ****
  		"remove the IP address from the VLDB");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("listaddrs", ListAddrs, 0,
  			  "list the IP address of all file servers registered in the VLDB");
      cmd_AddParm(ts, "-uuid", CMD_SINGLE, CMD_OPTIONAL, "uuid of server");
      cmd_AddParm(ts, "-host", CMD_SINGLE, CMD_OPTIONAL, "address of host");
--- 5998,6004 ----
  		"remove the IP address from the VLDB");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("listaddrs", ListAddrs, NULL,
  			  "list the IP address of all file servers registered in the VLDB");
      cmd_AddParm(ts, "-uuid", CMD_SINGLE, CMD_OPTIONAL, "uuid of server");
      cmd_AddParm(ts, "-host", CMD_SINGLE, CMD_OPTIONAL, "address of host");
***************
*** 6036,6042 ****
  		"print uuid of hosts");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("convertROtoRW", ConvertRO, 0,
  			  "convert a RO volume into a RW volume (after loss of old RW volume)");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, 0, "partition name");
--- 6008,6014 ----
  		"print uuid of hosts");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("convertROtoRW", ConvertRO, NULL,
  			  "convert a RO volume into a RW volume (after loss of old RW volume)");
      cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, 0, "partition name");
***************
*** 6044,6050 ****
      cmd_AddParm(ts, "-force", CMD_FLAG, CMD_OPTIONAL, "don't ask");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("size", Sizes, 0,
  			  "obtain various sizes of the volume.");
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_OPTIONAL, "partition name");
--- 6016,6022 ----
      cmd_AddParm(ts, "-force", CMD_FLAG, CMD_OPTIONAL, "don't ask");
      COMMONPARMS;
  
!     ts = cmd_CreateSyntax("size", Sizes, NULL,
  			  "obtain various sizes of the volume.");
      cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
      cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_OPTIONAL, "partition name");
Index: openafs/src/volser/vsprocs.c
diff -c openafs/src/volser/vsprocs.c:1.33.2.11 openafs/src/volser/vsprocs.c:1.33.2.18
*** openafs/src/volser/vsprocs.c:1.33.2.11	Thu Jul 19 14:52:41 2007
--- openafs/src/volser/vsprocs.c	Sun Feb 10 22:46:34 2008
***************
*** 11,21 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/vsprocs.c,v 1.33.2.11 2007/07/19 18:52:41 shadow Exp $");
  
  #include <stdio.h>
  #include <sys/types.h>
  #include <sys/stat.h>
  #ifdef	AFS_AIX_ENV
  #include <sys/statfs.h>
  #endif
--- 11,22 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/vsprocs.c,v 1.33.2.18 2008/02/11 03:46:34 shadow Exp $");
  
  #include <stdio.h>
  #include <sys/types.h>
  #include <sys/stat.h>
+ #include <string.h>
  #ifdef	AFS_AIX_ENV
  #include <sys/statfs.h>
  #endif
***************
*** 27,40 ****
  #include <netinet/in.h>
  #endif
  
- #ifdef HAVE_STRING_H
- #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
- 
  #include <lock.h>
  #include <afs/voldefs.h>
  #include <rx/xdr.h>
--- 28,33 ----
***************
*** 149,154 ****
--- 142,157 ----
  	{ if (verbose) { fprintf(STDOUT, (es), (p1), (p2), (p3)); fflush(STDOUT); } }
  #define VDONE \
  	{ if (verbose) { fprintf(STDOUT, " done\n"); fflush(STDOUT); } }
+ #define VEPRINT(es) \
+ 	{ if (verbose) { fprintf(STDERR, (es)); fflush(STDERR); } }
+ #define VEPRINT1(es, p) \
+ 	{ if (verbose) { fprintf(STDERR, (es), (p)); fflush(STDERR); } }
+ #define VEPRINT2(es, p1, p2) \
+ 	{ if (verbose) { fprintf(STDERR, (es), (p1), (p2)); fflush(STDERR); } }
+ #define VEPRINT3(es, p1, p2, p3) \
+ 	{ if (verbose) { fprintf(STDERR, (es), (p1), (p2), (p3)); fflush(STDERR); } }
+ #define VEDONE \
+ 	{ if (verbose) { fprintf(STDERR, " done\n"); fflush(STDERR); } }
  
  
  
***************
*** 654,660 ****
  
      code = AFSVolSetInfo(aconn, tid, &tstatus);
      if (code)
! 	EPRINT(code, "Could not change quota (error %d), continuing...\n");
  
      code = AFSVolSetFlags(aconn, tid, 0);	/* bring it online (mark it InService */
      EGOTO2(cfail, vcode, "Could not bring the volume %s %u online \n", aname,
--- 657,663 ----
  
      code = AFSVolSetInfo(aconn, tid, &tstatus);
      if (code)
! 	EPRINT(code, "Could not change quota, continuing...\n");
  
      code = AFSVolSetFlags(aconn, tid, 0);	/* bring it online (mark it InService */
      EGOTO2(cfail, vcode, "Could not bring the volume %s %u online \n", aname,
***************
*** 3849,3887 ****
      (void)signal(SIGINT, dump_sig_handler);
  
      if (!fromdate) {
! 	VPRINT("Full Dump ...\n");
      } else {
! 	VPRINT1("Incremental Dump (as of %.24s)...\n",
  		ctime((time_t *) & fromdate));
      }
  
      /* get connections to the servers */
      fromconn = UV_Bind(afromserver, AFSCONF_VOLUMEPORT);
  
!     VPRINT1("Starting transaction on volume %u...", afromvol);
      code = AFSVolTransCreate(fromconn, afromvol, afrompart, ITBusy, &fromtid);
      EGOTO1(error_exit, code,
  	   "Could not start transaction on the volume %u to be dumped\n",
  	   afromvol);
!     VDONE;
  
      fromcall = rx_NewCall(fromconn);
  
!     VPRINT1("Starting volume dump on volume %u...", afromvol);
      if (flags & VOLDUMPV2_OMITDIRS) 
  	code = StartAFSVolDumpV2(fromcall, fromtid, fromdate, flags);
      else
        retryold:
  	code = StartAFSVolDump(fromcall, fromtid, fromdate);
      EGOTO(error_exit, code, "Could not start the dump process \n");
!     VDONE;
  
!     VPRINT1("Dumping volume %u...", afromvol);
      code = DumpFunction(fromcall, rock);
      if (code == RXGEN_OPCODE) 
  	goto error_exit;
      EGOTO(error_exit, code, "Error while dumping volume \n");
!     VDONE;
  
    error_exit:
      if (fromcall) {
--- 3852,3890 ----
      (void)signal(SIGINT, dump_sig_handler);
  
      if (!fromdate) {
! 	VEPRINT("Full Dump ...\n");
      } else {
! 	VEPRINT1("Incremental Dump (as of %.24s)...\n",
  		ctime((time_t *) & fromdate));
      }
  
      /* get connections to the servers */
      fromconn = UV_Bind(afromserver, AFSCONF_VOLUMEPORT);
  
!     VEPRINT1("Starting transaction on volume %u...", afromvol);
      code = AFSVolTransCreate(fromconn, afromvol, afrompart, ITBusy, &fromtid);
      EGOTO1(error_exit, code,
  	   "Could not start transaction on the volume %u to be dumped\n",
  	   afromvol);
!     VEDONE;
  
      fromcall = rx_NewCall(fromconn);
  
!     VEPRINT1("Starting volume dump on volume %u...", afromvol);
      if (flags & VOLDUMPV2_OMITDIRS) 
  	code = StartAFSVolDumpV2(fromcall, fromtid, fromdate, flags);
      else
        retryold:
  	code = StartAFSVolDump(fromcall, fromtid, fromdate);
      EGOTO(error_exit, code, "Could not start the dump process \n");
!     VEDONE;
  
!     VEPRINT1("Dumping volume %u...", afromvol);
      code = DumpFunction(fromcall, rock);
      if (code == RXGEN_OPCODE) 
  	goto error_exit;
      EGOTO(error_exit, code, "Error while dumping volume \n");
!     VEDONE;
  
    error_exit:
      if (fromcall) {
***************
*** 3892,3898 ****
  	    error = code;
      }
      if (fromtid) {
! 	VPRINT1("Ending transaction on volume %u...", afromvol);
  	code = AFSVolEndTrans(fromconn, fromtid, &rcode);
  	if (code || rcode) {
  	    fprintf(STDERR, "Could not end transaction on the volume %lu\n",
--- 3895,3901 ----
  	    error = code;
      }
      if (fromtid) {
! 	VEPRINT1("Ending transaction on volume %u...", afromvol);
  	code = AFSVolEndTrans(fromconn, fromtid, &rcode);
  	if (code || rcode) {
  	    fprintf(STDERR, "Could not end transaction on the volume %lu\n",
***************
*** 3900,3906 ****
  	    if (!error)
  		error = (code ? code : rcode);
  	}
! 	VDONE;
      }
      if (fromconn)
  	rx_DestroyConnection(fromconn);
--- 3903,3909 ----
  	    if (!error)
  		error = (code ? code : rcode);
  	}
! 	VEDONE;
      }
      if (fromconn)
  	rx_DestroyConnection(fromconn);
***************
*** 3939,3979 ****
      (void)signal(SIGINT, dump_sig_handler);
  
      if (!fromdate) {
! 	VPRINT("Full Dump ...\n");
      } else {
! 	VPRINT1("Incremental Dump (as of %.24s)...\n",
  		ctime((time_t *) & fromdate));
      }
  
      /* get connections to the servers */
      fromconn = UV_Bind(afromserver, AFSCONF_VOLUMEPORT);
  
!     VPRINT1("Starting transaction on volume %u...", afromvol);
      code = AFSVolTransCreate(fromconn, afromvol, afrompart, ITBusy, &fromtid);
      EGOTO1(error_exit, code,
  	   "Could not start transaction on the volume %u to be dumped\n",
  	   afromvol);
!     VDONE;
  
      /* Get a clone id */
!     VPRINT1("Allocating new volume id for clone of volume %u ...", afromvol);
      code = ubik_VL_GetNewVolumeId(cstruct, 0, 1, &clonevol);
      EGOTO1(error_exit, code,
  	   "Could not get an ID for the clone of volume %u from the VLDB\n",
  	   afromvol);
!     VDONE;
  
      /* Do the clone. Default flags on clone are set to delete on salvage and out of service */
!     VPRINT2("Cloning source volume %u to clone volume %u...", afromvol,
  	    clonevol);
      strcpy(vname, "dump-clone-temp");
      code =
  	AFSVolClone(fromconn, fromtid, 0, readonlyVolume, vname, &clonevol);
      EGOTO1(error_exit, code, "Failed to clone the source volume %u\n",
  	   afromvol);
!     VDONE;
  
!     VPRINT1("Ending the transaction on the volume %u ...", afromvol);
      rcode = 0;
      code = AFSVolEndTrans(fromconn, fromtid, &rcode);
      fromtid = 0;
--- 3942,3982 ----
      (void)signal(SIGINT, dump_sig_handler);
  
      if (!fromdate) {
! 	VEPRINT("Full Dump ...\n");
      } else {
! 	VEPRINT1("Incremental Dump (as of %.24s)...\n",
  		ctime((time_t *) & fromdate));
      }
  
      /* get connections to the servers */
      fromconn = UV_Bind(afromserver, AFSCONF_VOLUMEPORT);
  
!     VEPRINT1("Starting transaction on volume %u...", afromvol);
      code = AFSVolTransCreate(fromconn, afromvol, afrompart, ITBusy, &fromtid);
      EGOTO1(error_exit, code,
  	   "Could not start transaction on the volume %u to be dumped\n",
  	   afromvol);
!     VEDONE;
  
      /* Get a clone id */
!     VEPRINT1("Allocating new volume id for clone of volume %u ...", afromvol);
      code = ubik_VL_GetNewVolumeId(cstruct, 0, 1, &clonevol);
      EGOTO1(error_exit, code,
  	   "Could not get an ID for the clone of volume %u from the VLDB\n",
  	   afromvol);
!     VEDONE;
  
      /* Do the clone. Default flags on clone are set to delete on salvage and out of service */
!     VEPRINT2("Cloning source volume %u to clone volume %u...", afromvol,
  	    clonevol);
      strcpy(vname, "dump-clone-temp");
      code =
  	AFSVolClone(fromconn, fromtid, 0, readonlyVolume, vname, &clonevol);
      EGOTO1(error_exit, code, "Failed to clone the source volume %u\n",
  	   afromvol);
!     VEDONE;
  
!     VEPRINT1("Ending the transaction on the volume %u ...", afromvol);
      rcode = 0;
      code = AFSVolEndTrans(fromconn, fromtid, &rcode);
      fromtid = 0;
***************
*** 3981,4029 ****
  	code = rcode;
      EGOTO1(error_exit, code,
  	   "Failed to end the transaction on the volume %u\n", afromvol);
!     VDONE;
  
  
!     VPRINT1("Starting transaction on the cloned volume %u ...", clonevol);
      code =
  	AFSVolTransCreate(fromconn, clonevol, afrompart, ITOffline,
  			  &clonetid);
      EGOTO1(error_exit, code,
  	   "Failed to start a transaction on the cloned volume%u\n",
  	   clonevol);
!     VDONE;
  
!     VPRINT1("Setting flags on cloned volume %u ...", clonevol);
      code = AFSVolSetFlags(fromconn, clonetid, VTDeleteOnSalvage | VTOutOfService);	/*redundant */
      EGOTO1(error_exit, code, "Could not set falgs on the cloned volume %u\n",
  	   clonevol);
!     VDONE;
  
  
      fromcall = rx_NewCall(fromconn);
  
!     VPRINT1("Starting volume dump from cloned volume %u...", clonevol);
      if (flags & VOLDUMPV2_OMITDIRS) 
  	code = StartAFSVolDumpV2(fromcall, clonetid, fromdate, flags);
      else
  	code = StartAFSVolDump(fromcall, clonetid, fromdate);
      EGOTO(error_exit, code, "Could not start the dump process \n");
!     VDONE;
  
!     VPRINT1("Dumping volume %u...", afromvol);
      code = DumpFunction(fromcall, rock);
      EGOTO(error_exit, code, "Error while dumping volume \n");
!     VDONE;
  
    error_exit:
      /* now delete the clone */
!     VPRINT1("Deleting the cloned volume %u ...", clonevol);
      code = AFSVolDeleteVolume(fromconn, clonetid);
      if (code) {
  	fprintf(STDERR, "Failed to delete the cloned volume %lu\n",
  		(unsigned long)clonevol);
      } else {
! 	VDONE;
      }
  
      if (fromcall) {
--- 3984,4032 ----
  	code = rcode;
      EGOTO1(error_exit, code,
  	   "Failed to end the transaction on the volume %u\n", afromvol);
!     VEDONE;
  
  
!     VEPRINT1("Starting transaction on the cloned volume %u ...", clonevol);
      code =
  	AFSVolTransCreate(fromconn, clonevol, afrompart, ITOffline,
  			  &clonetid);
      EGOTO1(error_exit, code,
  	   "Failed to start a transaction on the cloned volume%u\n",
  	   clonevol);
!     VEDONE;
  
!     VEPRINT1("Setting flags on cloned volume %u ...", clonevol);
      code = AFSVolSetFlags(fromconn, clonetid, VTDeleteOnSalvage | VTOutOfService);	/*redundant */
      EGOTO1(error_exit, code, "Could not set falgs on the cloned volume %u\n",
  	   clonevol);
!     VEDONE;
  
  
      fromcall = rx_NewCall(fromconn);
  
!     VEPRINT1("Starting volume dump from cloned volume %u...", clonevol);
      if (flags & VOLDUMPV2_OMITDIRS) 
  	code = StartAFSVolDumpV2(fromcall, clonetid, fromdate, flags);
      else
  	code = StartAFSVolDump(fromcall, clonetid, fromdate);
      EGOTO(error_exit, code, "Could not start the dump process \n");
!     VEDONE;
  
!     VEPRINT1("Dumping volume %u...", afromvol);
      code = DumpFunction(fromcall, rock);
      EGOTO(error_exit, code, "Error while dumping volume \n");
!     VEDONE;
  
    error_exit:
      /* now delete the clone */
!     VEPRINT1("Deleting the cloned volume %u ...", clonevol);
      code = AFSVolDeleteVolume(fromconn, clonetid);
      if (code) {
  	fprintf(STDERR, "Failed to delete the cloned volume %lu\n",
  		(unsigned long)clonevol);
      } else {
! 	VEDONE;
      }
  
      if (fromcall) {
***************
*** 4035,4041 ****
  	}
      }
      if (clonetid) {
! 	VPRINT1("Ending transaction on cloned volume %u...", clonevol);
  	code = AFSVolEndTrans(fromconn, clonetid, &rcode);
  	if (code || rcode) {
  	    fprintf(STDERR,
--- 4038,4044 ----
  	}
      }
      if (clonetid) {
! 	VEPRINT1("Ending transaction on cloned volume %u...", clonevol);
  	code = AFSVolEndTrans(fromconn, clonetid, &rcode);
  	if (code || rcode) {
  	    fprintf(STDERR,
***************
*** 4044,4050 ****
  	    if (!error)
  		error = (code ? code : rcode);
  	}
! 	VDONE;
      }
      if (fromconn)
  	rx_DestroyConnection(fromconn);
--- 4047,4053 ----
  	    if (!error)
  		error = (code ? code : rcode);
  	}
! 	VEDONE;
      }
      if (fromconn)
  	rx_DestroyConnection(fromconn);
***************
*** 4072,4077 ****
--- 4075,4081 ----
      struct volser_status tstatus;
      struct volintInfo vinfo;
      char partName[10];
+     char tovolreal[VOLSER_OLDMAXVOLNAME];
      afs_int32 pvolid, pparentid;
      afs_int32 temptid;
      int success;
***************
*** 4143,4160 ****
      }
      if (!pparentid) pparentid = pvolid;
      /* at this point we have a volume id to use/reuse for the volume to be restored */
      if (strlen(tovolname) > (VOLSER_OLDMAXVOLNAME - 1)) {
  	EGOTO1(refail, VOLSERBADOP,
  	       "The volume name %s exceeds the maximum limit of (VOLSER_OLDMAXVOLNAME -1 ) bytes\n",
  	       tovolname);
      }
      MapPartIdIntoName(topart, partName);
      fprintf(STDOUT, "Restoring volume %s Id %lu on server %s partition %s ..",
! 	    tovolname, (unsigned long)pvolid,
  	    hostutil_GetNameByINet(toserver), partName);
      fflush(STDOUT);
      code =
! 	AFSVolCreateVolume(toconn, topart, tovolname, volsertype, pparentid, &pvolid,
  			   &totid);
      if (code) {
  	if (flags & RV_FULLRST) {	/* full restore: delete then create anew */
--- 4147,4174 ----
      }
      if (!pparentid) pparentid = pvolid;
      /* at this point we have a volume id to use/reuse for the volume to be restored */
+     strncpy(tovolreal, tovolname, VOLSER_OLDMAXVOLNAME);
+ 	    
      if (strlen(tovolname) > (VOLSER_OLDMAXVOLNAME - 1)) {
  	EGOTO1(refail, VOLSERBADOP,
  	       "The volume name %s exceeds the maximum limit of (VOLSER_OLDMAXVOLNAME -1 ) bytes\n",
  	       tovolname);
+     } else {
+ 	if ((pparentid != pvolid) && (flags & RV_RDONLY)) {
+ 	    if (strlen(tovolname) > (VOLSER_OLDMAXVOLNAME - 10)) {
+ 		EGOTO1(refail, VOLSERBADOP,
+ 		       "The volume name %s exceeds the maximum limit of (VOLSER_OLDMAXVOLNAME -1 ) bytes\n", tovolname);
+ 	    }
+ 	    snprintf(tovolreal, VOLSER_OLDMAXVOLNAME, "%s.readonly", tovolname);
+ 	}
      }
      MapPartIdIntoName(topart, partName);
      fprintf(STDOUT, "Restoring volume %s Id %lu on server %s partition %s ..",
! 	    tovolreal, (unsigned long)pvolid,
  	    hostutil_GetNameByINet(toserver), partName);
      fflush(STDOUT);
      code =
! 	AFSVolCreateVolume(toconn, topart, tovolreal, volsertype, pparentid, &pvolid,
  			   &totid);
      if (code) {
  	if (flags & RV_FULLRST) {	/* full restore: delete then create anew */
***************
*** 4190,4196 ****
  	    VDONE;
  
  	    code =
! 		AFSVolCreateVolume(toconn, topart, tovolname, volsertype, pparentid,
  				   &pvolid, &totid);
  	    EGOTO1(refail, code, "Could not create new volume %u\n", pvolid);
  	} else {
--- 4204,4210 ----
  	    VDONE;
  
  	    code =
! 		AFSVolCreateVolume(toconn, topart, tovolreal, volsertype, pparentid,
  				   &pvolid, &totid);
  	    EGOTO1(refail, code, "Could not create new volume %u\n", pvolid);
  	} else {
***************
*** 4214,4220 ****
      cookie.parent = pparentid;
      cookie.type = voltype;
      cookie.clone = 0;
!     strncpy(cookie.name, tovolname, VOLSER_OLDMAXVOLNAME);
  
      tocall = rx_NewCall(toconn);
      terror = StartAFSVolRestore(tocall, totid, 1, &cookie);
--- 4228,4234 ----
      cookie.parent = pparentid;
      cookie.type = voltype;
      cookie.clone = 0;
!     strncpy(cookie.name, tovolreal, VOLSER_OLDMAXVOLNAME);
  
      tocall = rx_NewCall(toconn);
      terror = StartAFSVolRestore(tocall, totid, 1, &cookie);
***************
*** 4244,4250 ****
  	error = code;
  	goto refail;
      }
!     code = AFSVolSetIdsTypes(toconn, totid, tovolname, voltype, pparentid, 0, 0);
      if (code) {
  	fprintf(STDERR, "Could not set the right type and ID on %lu\n",
  		(unsigned long)pvolid);
--- 4258,4264 ----
  	error = code;
  	goto refail;
      }
!     code = AFSVolSetIdsTypes(toconn, totid, tovolreal, voltype, pparentid, 0, 0);
      if (code) {
  	fprintf(STDERR, "Could not set the right type and ID on %lu\n",
  		(unsigned long)pvolid);
***************
*** 4398,4452 ****
  			    toserver, errcode);
  		if ((!errcode && !same)
  		    || (entry.serverPartition[index] != topart)) {
! 		    tempconn =
! 			UV_Bind(entry.serverNumber[index],
! 				AFSCONF_VOLUMEPORT);
! 
! 		    MapPartIdIntoName(entry.serverPartition[index],
! 				      apartName);
! 		    VPRINT3
! 			("Deleting the previous volume %u on server %s, partition %s ...",
! 			 pvolid,
! 			 hostutil_GetNameByINet(entry.serverNumber[index]),
! 			 apartName);
! 		    code =
! 			AFSVolTransCreate(tempconn, pvolid,
! 					  entry.serverPartition[index],
! 					  ITOffline, &temptid);
! 		    if (!code) {
  			code =
! 			    AFSVolSetFlags(tempconn, temptid,
! 					   VTDeleteOnSalvage |
! 					   VTOutOfService);
! 			if (code) {
! 			    fprintf(STDERR,
! 				    "Could not set flags on volume %lu on the older site\n",
! 				    (unsigned long)pvolid);
! 			    error = code;
! 			    goto refail;
! 			}
! 			code = AFSVolDeleteVolume(tempconn, temptid);
! 			if (code) {
! 			    fprintf(STDERR,
! 				    "Could not delete volume %lu on the older site\n",
! 				    (unsigned long)pvolid);
! 			    error = code;
! 			    goto refail;
! 			}
! 			code = AFSVolEndTrans(tempconn, temptid, &rcode);
! 			temptid = 0;
! 			if (!code)
! 			    code = rcode;
! 			if (code) {
! 			    fprintf(STDERR,
! 				    "Could not end transaction on volume %lu on the older site\n",
! 				    (unsigned long)pvolid);
! 			    error = code;
! 			    goto refail;
  			}
- 			VDONE;
- 			MapPartIdIntoName(entry.serverPartition[index],
- 					  partName);
  		    }
  		}
  		entry.serverNumber[index] = toserver;
--- 4412,4473 ----
  			    toserver, errcode);
  		if ((!errcode && !same)
  		    || (entry.serverPartition[index] != topart)) {
! 		    if (flags & RV_NODEL) {
! 			VPRINT2
! 			    ("Not deleting the previous volume %u on server %s, ...",
! 			     pvolid,
! 			     hostutil_GetNameByINet(entry.serverNumber[index]));
! 		    } else {
! 			tempconn =
! 			    UV_Bind(entry.serverNumber[index],
! 				    AFSCONF_VOLUMEPORT);
! 			
! 			MapPartIdIntoName(entry.serverPartition[index],
! 					  apartName);
! 			VPRINT3
! 			    ("Deleting the previous volume %u on server %s, partition %s ...",
! 			     pvolid,
! 			     hostutil_GetNameByINet(entry.serverNumber[index]),
! 			     apartName);
  			code =
! 			    AFSVolTransCreate(tempconn, pvolid,
! 					      entry.serverPartition[index],
! 					      ITOffline, &temptid);
! 			if (!code) {
! 			    code =
! 				AFSVolSetFlags(tempconn, temptid,
! 					       VTDeleteOnSalvage |
! 					       VTOutOfService);
! 			    if (code) {
! 				fprintf(STDERR,
! 					"Could not set flags on volume %lu on the older site\n",
! 					(unsigned long)pvolid);
! 				error = code;
! 				goto refail;
! 			    }
! 			    code = AFSVolDeleteVolume(tempconn, temptid);
! 			    if (code) {
! 				fprintf(STDERR,
! 					"Could not delete volume %lu on the older site\n",
! 					(unsigned long)pvolid);
! 				error = code;
! 				goto refail;
! 			    }
! 			    code = AFSVolEndTrans(tempconn, temptid, &rcode);
! 			    temptid = 0;
! 			    if (!code)
! 				code = rcode;
! 			    if (code) {
! 				fprintf(STDERR,
! 					"Could not end transaction on volume %lu on the older site\n",
! 					(unsigned long)pvolid);
! 				error = code;
! 				goto refail;
! 			    }
! 			    VDONE;
! 			    MapPartIdIntoName(entry.serverPartition[index],
! 					      partName);
  			}
  		    }
  		}
  		entry.serverNumber[index] = toserver;
***************
*** 4558,4564 ****
  /*adds <server> and <part> as a readonly replication site for <volid>
  *in vldb */
  int
! UV_AddSite(afs_int32 server, afs_int32 part, afs_int32 volid)
  {
      int j, nro = 0, islocked = 0;
      struct nvldbentry entry, storeEntry;
--- 4579,4585 ----
  /*adds <server> and <part> as a readonly replication site for <volid>
  *in vldb */
  int
! UV_AddSite(afs_int32 server, afs_int32 part, afs_int32 volid, afs_int32 valid)
  {
      int j, nro = 0, islocked = 0;
      struct nvldbentry entry, storeEntry;
***************
*** 4631,4637 ****
      VPRINT("Adding a new site ...");
      entry.serverNumber[entry.nServers] = server;
      entry.serverPartition[entry.nServers] = part;
!     entry.serverFlags[entry.nServers] = (ITSROVOL | RO_DONTUSE);
      entry.nServers++;
  
      MapNetworkToHost(&entry, &storeEntry);
--- 4652,4662 ----
      VPRINT("Adding a new site ...");
      entry.serverNumber[entry.nServers] = server;
      entry.serverPartition[entry.nServers] = part;
!     if (!valid) {
! 	entry.serverFlags[entry.nServers] = (ITSROVOL | RO_DONTUSE);
!     } else {
! 	entry.serverFlags[entry.nServers] = (ITSROVOL);
!     }
      entry.nServers++;
  
      MapNetworkToHost(&entry, &storeEntry);
***************
*** 5243,5253 ****
      afs_int32 code, error = 0;
      struct nvldbentry entry, storeEntry;
      char pname[10];
!     int pass = 0, islocked = 0, createentry, addvolume, modified, mod;
      afs_int32 rwvolid;
  
!     if (modentry)
  	*modentry = 0;
      rwvolid =
  	((volumeinfo->type ==
  	  RWVOL) ? volumeinfo->volid : volumeinfo->parentID);
--- 5268,5281 ----
      afs_int32 code, error = 0;
      struct nvldbentry entry, storeEntry;
      char pname[10];
!     int pass = 0, islocked = 0, createentry, addvolume, modified, mod, doit = 1;
      afs_int32 rwvolid;
  
!     if (modentry) {
! 	if (*modentry == 1)
! 	    doit = 0;
  	*modentry = 0;
+     }
      rwvolid =
  	((volumeinfo->type ==
  	  RWVOL) ? volumeinfo->volid : volumeinfo->parentID);
***************
*** 5543,5549 ****
  				    (unsigned long)volumeinfo->volid);
  			}
  
! 			Lp_SetRWValue(entry, entry.serverNumber[idx],
  				      entry.serverPartition[idx], 0L, 0L);
  			entry.nServers--;
  			modified++;
--- 5571,5577 ----
  				    (unsigned long)volumeinfo->volid);
  			}
  
! 			Lp_SetRWValue(&entry, entry.serverNumber[idx],
  				      entry.serverPartition[idx], 0L, 0L);
  			entry.nServers--;
  			modified++;
***************
*** 5603,5609 ****
      if (entry.volumeId[RWVOL] > *maxvolid)
  	*maxvolid = entry.volumeId[RWVOL];
  
!     if (modified) {
  	MapNetworkToHost(&entry, &storeEntry);
  
  	if (createentry) {
--- 5631,5637 ----
      if (entry.volumeId[RWVOL] > *maxvolid)
  	*maxvolid = entry.volumeId[RWVOL];
  
!     if (modified && doit) {
  	MapNetworkToHost(&entry, &storeEntry);
  
  	if (createentry) {
***************
*** 5638,5644 ****
  	}
      }
  
!     if (verbose) {
  	fprintf(STDOUT, "-- status after --\n");
  	if (modified)
  	    EnumerateEntry(&entry);
--- 5666,5672 ----
  	}
      }
  
!     if (verbose && doit) {
  	fprintf(STDOUT, "-- status after --\n");
  	if (modified)
  	    EnumerateEntry(&entry);
***************
*** 5705,5717 ****
      volumeInfo.volEntries_val = (volintInfo *) 0;
      volumeInfo.volEntries_len = 0;
  
!     if (!aserver && flags) {
  	/* fprintf(STDERR,"Partition option requires a server option\n"); */
  	ERROR_EXIT(EINVAL);
      }
  
      /* Turn verbose logging off and do our own verbose logging */
      tverbose = verbose;
      verbose = 0;
  
      /* Read the VLDB entry */
--- 5733,5747 ----
      volumeInfo.volEntries_val = (volintInfo *) 0;
      volumeInfo.volEntries_len = 0;
  
!     if (!aserver && (flags & 1)) {
  	/* fprintf(STDERR,"Partition option requires a server option\n"); */
  	ERROR_EXIT(EINVAL);
      }
  
      /* Turn verbose logging off and do our own verbose logging */
      tverbose = verbose;
+     if (flags & 2) 
+ 	tverbose = 1;
      verbose = 0;
  
      /* Read the VLDB entry */
***************
*** 5743,5748 ****
--- 5773,5783 ----
       * Equivalent to a syncserv.
       */
      if (!vcode) {
+ 	/* Tell CheckVldb not to update if appropriate */
+ 	if (flags & 2)
+ 	    mod = 1;
+ 	else
+ 	    mod = 0;
  	code = CheckVldb(&vldbentry, &mod);
  	if (code) {
  	    fprintf(STDERR, "Could not process VLDB entry for volume %s\n",
***************
*** 5756,5762 ****
      /* If aserver is given, we will search for the desired volume on it */
      if (aserver) {
  	/* Generate array of partitions on the server that we will check */
! 	if (!flags) {
  	    code = UV_ListPartitions(aserver, &PartList, &pcnt);
  	    if (code) {
  		fprintf(STDERR,
--- 5791,5797 ----
      /* If aserver is given, we will search for the desired volume on it */
      if (aserver) {
  	/* Generate array of partitions on the server that we will check */
! 	if (!(flags & 1)) {
  	    code = UV_ListPartitions(aserver, &PartList, &pcnt);
  	    if (code) {
  		fprintf(STDERR,
***************
*** 5782,5787 ****
--- 5817,5826 ----
  			ERROR_EXIT(code);
  		    }
  		} else {
+ 		    if (flags & 2)
+ 			mod = 1;
+ 		    else
+ 			mod = 0;
  		    /* Found one, sync it with VLDB entry */
  		    code =
  			CheckVolume(volumeInfo.volEntries_val, aserver,
***************
*** 5832,5837 ****
--- 5871,5880 ----
  			ERROR_EXIT(code);
  		    }
  		} else {
+ 		    if (flags & 2)
+ 			mod = 1;
+ 		    else
+ 			mod = 0;
  		    /* Found one, sync it with VLDB entry */
  		    code =
  			CheckVolume(volumeInfo.volEntries_val, aserver,
***************
*** 5852,5858 ****
  
      /* if (aserver) */
      /* If verbose output, print a summary of what changed */
!     if (tverbose) {
  	fprintf(STDOUT, "-- status after --\n");
  	code = VLDB_GetEntryByName(avolname, &vldbentry);
  	if (code && (code != VL_NOENT)) {
--- 5895,5901 ----
  
      /* if (aserver) */
      /* If verbose output, print a summary of what changed */
!     if (tverbose && !(flags & 2)) {
  	fprintf(STDOUT, "-- status after --\n");
  	code = VLDB_GetEntryByName(avolname, &vldbentry);
  	if (code && (code != VL_NOENT)) {
***************
*** 5934,5940 ****
      aconn = UV_Bind(aserver, AFSCONF_VOLUMEPORT);
  
      /* Generate array of partitions to check */
!     if (!flags) {
  	code = UV_ListPartitions(aserver, &PartList, &pcnt);
  	if (code) {
  	    fprintf(STDERR,
--- 5977,5983 ----
      aconn = UV_Bind(aserver, AFSCONF_VOLUMEPORT);
  
      /* Generate array of partitions to check */
!     if (!(flags & 1)) {
  	code = UV_ListPartitions(aserver, &PartList, &pcnt);
  	if (code) {
  	    fprintf(STDERR,
***************
*** 5982,5987 ****
--- 6025,6034 ----
  		fflush(STDOUT);
  	    }
  
+ 	    if (flags & 2)
+ 		modified = 1;
+ 	    else
+ 		modified = 0;
  	    code = CheckVolume(vi, aserver, apart, &modified, &maxvolid);
  	    if (code) {
  		PrintError("", code);
***************
*** 6012,6019 ****
  
      }				/* thru all partitions */
  
!     VPRINT3("Total entries: %u, Failed to process %d, Changed %d\n", tentries,
! 	    failures, modifications);
  
    error_exit:
      /* Now check if the maxvolid is larger than that stored in the VLDB */
--- 6059,6071 ----
  
      }				/* thru all partitions */
  
!     if (flags & 2) {
! 	VPRINT3("Total entries: %u, Failed to process %d, Would change %d\n", 
! 		tentries, failures, modifications);
!     } else {
! 	VPRINT3("Total entries: %u, Failed to process %d, Changed %d\n", 
! 		tentries, failures, modifications);
!     }
  
    error_exit:
      /* Now check if the maxvolid is larger than that stored in the VLDB */
***************
*** 6246,6255 ****
      afs_int32 code, error = 0;
      struct nvldbentry storeEntry;
      int islocked = 0, mod, modentry, delentry = 0;
!     int pass = 0;
  
!     if (modified)
  	*modified = 0;
      if (verbose) {
  	fprintf(STDOUT, "_______________________________\n");
  	fprintf(STDOUT, "\n-- status before -- \n");
--- 6298,6310 ----
      afs_int32 code, error = 0;
      struct nvldbentry storeEntry;
      int islocked = 0, mod, modentry, delentry = 0;
!     int pass = 0, doit=1;
  
!     if (modified) {
! 	if (*modified == 1) 
! 	    doit = 0;
  	*modified = 0;
+     }
      if (verbose) {
  	fprintf(STDOUT, "_______________________________\n");
  	fprintf(STDOUT, "\n-- status before -- \n");
***************
*** 6296,6302 ****
      code = CheckVldbRWBK(entry, &mod);
      if (code)
  	ERROR_EXIT(code);
!     if (mod && (pass == 1))
  	goto retry;
      if (mod)
  	modentry++;
--- 6351,6357 ----
      code = CheckVldbRWBK(entry, &mod);
      if (code)
  	ERROR_EXIT(code);
!     if (mod && (pass == 1) && doit)
  	goto retry;
      if (mod)
  	modentry++;
***************
*** 6305,6311 ****
      code = CheckVldbRO(entry, &mod);
      if (code)
  	ERROR_EXIT(code);
!     if (mod && (pass == 1))
  	goto retry;
      if (mod)
  	modentry++;
--- 6360,6366 ----
      code = CheckVldbRO(entry, &mod);
      if (code)
  	ERROR_EXIT(code);
!     if (mod && (pass == 1) && doit)
  	goto retry;
      if (mod)
  	modentry++;
***************
*** 6313,6324 ****
      /* The VLDB entry has been updated. If it as been modified, then 
       * write the entry back out the the VLDB.
       */
!     if (modentry) {
  	if (pass == 1)
  	    goto retry;
  
  	if (!(entry->flags & RW_EXISTS) && !(entry->flags & BACK_EXISTS)
! 	    && !(entry->flags & RO_EXISTS)) {
  	    /* The RW, BK, nor RO volumes do not exist. Delete the VLDB entry */
  	    code =
  		ubik_VL_DeleteEntry(cstruct, 0, entry->volumeId[RWVOL],
--- 6368,6379 ----
      /* The VLDB entry has been updated. If it as been modified, then 
       * write the entry back out the the VLDB.
       */
!     if (modentry && doit) {
  	if (pass == 1)
  	    goto retry;
  
  	if (!(entry->flags & RW_EXISTS) && !(entry->flags & BACK_EXISTS)
! 	    && !(entry->flags & RO_EXISTS) && doit) {
  	    /* The RW, BK, nor RO volumes do not exist. Delete the VLDB entry */
  	    code =
  		ubik_VL_DeleteEntry(cstruct, 0, entry->volumeId[RWVOL],
***************
*** 6348,6354 ****
  	islocked = 0;
      }
  
!     if (verbose) {
  	fprintf(STDOUT, "-- status after --\n");
  	if (delentry)
  	    fprintf(STDOUT, "\n**entry deleted**\n");
--- 6403,6409 ----
  	islocked = 0;
      }
  
!     if (verbose && doit) {
  	fprintf(STDOUT, "-- status after --\n");
  	if (delentry)
  	    fprintf(STDOUT, "\n**entry deleted**\n");
***************
*** 6392,6403 ****
      struct nvldbentry *vlentry;
      afs_int32 si, nsi, j;
  
      aconn = UV_Bind(aserver, AFSCONF_VOLUMEPORT);
  
      /* Set up attributes to search VLDB  */
      attributes.server = ntohl(aserver);
      attributes.Mask = VLLIST_SERVER;
!     if (flags) {
  	attributes.partition = apart;
  	attributes.Mask |= VLLIST_PARTITION;
      }
--- 6447,6461 ----
      struct nvldbentry *vlentry;
      afs_int32 si, nsi, j;
  
+     if (flags & 2) 
+ 	verbose = 1;
+ 
      aconn = UV_Bind(aserver, AFSCONF_VOLUMEPORT);
  
      /* Set up attributes to search VLDB  */
      attributes.server = ntohl(aserver);
      attributes.Mask = VLLIST_SERVER;
!     if ((flags & 1)) {
  	attributes.partition = apart;
  	attributes.Mask |= VLLIST_PARTITION;
      }
***************
*** 6428,6433 ****
--- 6486,6496 ----
  
  	    VPRINT1("Processing VLDB entry %d ...\n", j + 1);
  
+ 	    /* Tell CheckVldb not to update if appropriate */
+ 	    if (flags & 2)
+ 		modified = 1;
+ 	    else
+ 		modified = 0;
  	    code = CheckVldb(vlentry, &modified);
  	    if (code) {
  		PrintError("", code);
***************
*** 6454,6461 ****
  	}
      }
  
!     VPRINT3("Total entries: %u, Failed to process %d, Changed %d\n", tentries,
! 	    failures, modifications);
  
    error_exit:
      if (aconn)
--- 6517,6529 ----
  	}
      }
  
!     if (flags & 2) {
! 	VPRINT3("Total entries: %u, Failed to process %d, Would change %d\n",
! 		tentries, failures, modifications);
!     } else {
! 	VPRINT3("Total entries: %u, Failed to process %d, Changed %d\n", 
! 		tentries, failures, modifications);
!     }
  
    error_exit:
      if (aconn)
Index: openafs/src/volser/vsutils.c
diff -c openafs/src/volser/vsutils.c:1.16.2.3 openafs/src/volser/vsutils.c:1.16.2.4
*** openafs/src/volser/vsutils.c:1.16.2.3	Mon Jul 31 13:07:52 2006
--- openafs/src/volser/vsutils.c	Tue Oct 30 11:24:13 2007
***************
*** 11,19 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/vsutils.c,v 1.16.2.3 2006/07/31 17:07:52 shadow Exp $");
  
  #include <afs/stds.h>
  #ifdef AFS_NT40_ENV
  #include <fcntl.h>
  #include <winsock2.h>
--- 11,20 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/vsutils.c,v 1.16.2.4 2007/10/30 15:24:13 shadow Exp $");
  
  #include <afs/stds.h>
+ #include <string.h>
  #ifdef AFS_NT40_ENV
  #include <fcntl.h>
  #include <winsock2.h>
***************
*** 28,41 ****
  #include <sys/statfs.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 <rx/xdr.h>
--- 29,34 ----
Index: openafs/src/xstat/xstat_cm.c
diff -c openafs/src/xstat/xstat_cm.c:1.9.2.2 openafs/src/xstat/xstat_cm.c:1.9.2.4
*** openafs/src/xstat/xstat_cm.c:1.9.2.2	Mon Jun 26 12:19:06 2006
--- openafs/src/xstat/xstat_cm.c	Mon Mar 10 18:35:37 2008
***************
*** 18,37 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/xstat/xstat_cm.c,v 1.9.2.2 2006/06/26 16:19:06 rra Exp $");
  
  #include "xstat_cm.h"		/*Interface for this module */
  #include <lwp.h>		/*Lightweight process package */
  
  #include <afs/afsutil.h>
- 
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  
  #define LWP_STACK_SIZE	(16 * 1024)
  
--- 18,30 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/xstat/xstat_cm.c,v 1.9.2.4 2008/03/10 22:35:37 shadow Exp $");
  
  #include "xstat_cm.h"		/*Interface for this module */
  #include <lwp.h>		/*Lightweight process package */
  
  #include <afs/afsutil.h>
  #include <string.h>
  
  #define LWP_STACK_SIZE	(16 * 1024)
  
***************
*** 205,212 ****
   * Side Effects:
   *	As advertised.
   *------------------------------------------------------------------------*/
! static void
! xstat_cm_LWP()
  {
      static char rn[] = "xstat_cm_LWP";	/*Routine name */
      register afs_int32 code;	/*Results of calls */
--- 198,205 ----
   * Side Effects:
   *	As advertised.
   *------------------------------------------------------------------------*/
! static void *
! xstat_cm_LWP(void *unused)
  {
      static char rn[] = "xstat_cm_LWP";	/*Routine name */
      register afs_int32 code;	/*Results of calls */
***************
*** 356,361 ****
--- 349,355 ----
  			code);
  	}			/*Continuous execution */
      }				/*Service loop */
+     return NULL;
  }
  
  
Index: openafs/src/xstat/xstat_cm_test.c
diff -c openafs/src/xstat/xstat_cm_test.c:1.8.2.3 openafs/src/xstat/xstat_cm_test.c:1.8.2.6
*** openafs/src/xstat/xstat_cm_test.c:1.8.2.3	Thu Mar  9 01:42:30 2006
--- openafs/src/xstat/xstat_cm_test.c	Mon Nov 26 16:22:00 2007
***************
*** 17,34 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/xstat/xstat_cm_test.c,v 1.8.2.3 2006/03/09 06:42:30 shadow Exp $");
  
  #include "xstat_cm.h"		/*Interface for xstat_cm module */
  #include <cmd.h>		/*Command line interpreter */
  #include <time.h>
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  
  /*
   * External routines that don't have explicit include file definitions.
--- 17,28 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/xstat/xstat_cm_test.c,v 1.8.2.6 2007/11/26 21:22:00 shadow Exp $");
  
  #include "xstat_cm.h"		/*Interface for xstat_cm module */
  #include <cmd.h>		/*Command line interpreter */
  #include <time.h>
  #include <string.h>
  
  /*
   * External routines that don't have explicit include file definitions.
***************
*** 158,163 ****
--- 152,158 ----
  
  /* Print detailed functional call statistics */
  
+ void
  print_cmCallStats()
  {
      static char rn[] = "print_cmCallStats";	/*Routine name */
***************
*** 1231,1239 ****
   *------------------------------------------------------------------------*/
  
  int
! RunTheTest(a_s)
!      struct cmd_syndesc *a_s;
! 
  {				/*RunTheTest */
  
      static char rn[] = "RunTheTest";	/*Routine name */
--- 1226,1232 ----
   *------------------------------------------------------------------------*/
  
  int
! RunTheTest(struct cmd_syndesc *a_s, void *arock)
  {				/*RunTheTest */
  
      static char rn[] = "RunTheTest";	/*Routine name */
***************
*** 1441,1447 ****
      /*
       * Set up the commands we understand.
       */
!     ts = cmd_CreateSyntax("initcmd", RunTheTest, 0, "initialize the program");
      cmd_AddParm(ts, "-cmname", CMD_LIST, CMD_REQUIRED,
  		"Cache Manager name(s) to monitor");
      cmd_AddParm(ts, "-collID", CMD_LIST, CMD_REQUIRED,
--- 1434,1440 ----
      /*
       * Set up the commands we understand.
       */
!     ts = cmd_CreateSyntax("initcmd", RunTheTest, NULL, "initialize the program");
      cmd_AddParm(ts, "-cmname", CMD_LIST, CMD_REQUIRED,
  		"Cache Manager name(s) to monitor");
      cmd_AddParm(ts, "-collID", CMD_LIST, CMD_REQUIRED,
Index: openafs/src/xstat/xstat_fs.c
diff -c openafs/src/xstat/xstat_fs.c:1.9.2.2 openafs/src/xstat/xstat_fs.c:1.9.2.4
*** openafs/src/xstat/xstat_fs.c:1.9.2.2	Mon Jun 26 12:19:06 2006
--- openafs/src/xstat/xstat_fs.c	Mon Mar 10 18:35:37 2008
***************
*** 18,37 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/xstat/xstat_fs.c,v 1.9.2.2 2006/06/26 16:19:06 rra Exp $");
  
  #include "xstat_fs.h"		/*Interface for this module */
  #include <lwp.h>		/*Lightweight process package */
  
  #include <afs/afsutil.h>
- 
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  
  #define LWP_STACK_SIZE	(16 * 1024)
  
--- 18,30 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/xstat/xstat_fs.c,v 1.9.2.4 2008/03/10 22:35:37 shadow Exp $");
  
  #include "xstat_fs.h"		/*Interface for this module */
  #include <lwp.h>		/*Lightweight process package */
  
  #include <afs/afsutil.h>
  #include <string.h>
  
  #define LWP_STACK_SIZE	(16 * 1024)
  
***************
*** 245,252 ****
   *	Nothing interesting.
   *------------------------------------------------------------------------*/
  
! static void
! xstat_fs_LWP()
  {
      static char rn[] = "xstat_fs_LWP";	/*Routine name */
      register afs_int32 code;	/*Results of calls */
--- 238,245 ----
   *	Nothing interesting.
   *------------------------------------------------------------------------*/
  
! static void *
! xstat_fs_LWP(void *unused)
  {
      static char rn[] = "xstat_fs_LWP";	/*Routine name */
      register afs_int32 code;	/*Results of calls */
***************
*** 395,400 ****
--- 388,394 ----
  			code);
  	}			/*Continuous execution */
      }				/*Service loop */
+     return NULL;
  }
  
  /*------------------------------------------------------------------------
Index: openafs/src/xstat/xstat_fs_callback.c
diff -c openafs/src/xstat/xstat_fs_callback.c:1.13.2.1 openafs/src/xstat/xstat_fs_callback.c:1.13.2.2
*** openafs/src/xstat/xstat_fs_callback.c:1.13.2.1	Sun Mar  5 22:16:41 2006
--- openafs/src/xstat/xstat_fs_callback.c	Tue Oct 30 11:24:16 2007
***************
*** 30,47 ****
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/xstat/xstat_fs_callback.c,v 1.13.2.1 2006/03/06 03:16:41 jaltman Exp $");
  
  #include <errno.h>
  #include <stdio.h>		/*Standard I/O stuff */
- 
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  
  #include <afs/afscbint.h>	/*Callback interface defs */
  
--- 30,40 ----
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/xstat/xstat_fs_callback.c,v 1.13.2.2 2007/10/30 15:24:16 shadow Exp $");
  
  #include <errno.h>
  #include <stdio.h>		/*Standard I/O stuff */
  #include <string.h>
  
  #include <afs/afscbint.h>	/*Callback interface defs */
  
Index: openafs/src/xstat/xstat_fs_test.c
diff -c openafs/src/xstat/xstat_fs_test.c:1.8.2.6 openafs/src/xstat/xstat_fs_test.c:1.8.2.7
*** openafs/src/xstat/xstat_fs_test.c:1.8.2.6	Mon Apr 10 11:46:46 2006
--- openafs/src/xstat/xstat_fs_test.c	Tue Oct 30 11:24:16 2007
***************
*** 17,34 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/xstat/xstat_fs_test.c,v 1.8.2.6 2006/04/10 15:46:46 shadow Exp $");
  
  #include "xstat_fs.h"		/*Interface for xstat_fs module */
  #include <cmd.h>		/*Command line interpreter */
  #include <time.h>
- #ifdef HAVE_STRING_H
  #include <string.h>
- #else
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
- #endif
  
  /*
   * External routines that don't have explicit include file definitions.
--- 17,28 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/xstat/xstat_fs_test.c,v 1.8.2.7 2007/10/30 15:24:16 shadow Exp $");
  
  #include "xstat_fs.h"		/*Interface for xstat_fs module */
  #include <cmd.h>		/*Command line interpreter */
  #include <time.h>
  #include <string.h>
  
  /*
   * External routines that don't have explicit include file definitions.
