Index: openafs/src/NTMakefile
diff -c openafs/src/NTMakefile:1.27.2.3 openafs/src/NTMakefile:1.27.2.4
*** openafs/src/NTMakefile:1.27.2.3	Thu Feb 15 13:14:07 2007
--- openafs/src/NTMakefile	Sun Aug 12 22:13:28 2007
***************
*** 605,612 ****
  
  install: finale
  
- # InstallShield dependencies
- 
  # Clean target for obj tree
  clean:
  	nmake /nologo /f ntmakefile "NTMAKE = nmake /nologo /f ntmakefile clean" "NTMAKE_HEADERS = nmake /nologo /f ntmakefile clean" "NTMAKE_OBJS = nmake /nologo /f ntmakefile clean" install
--- 605,610 ----
***************
*** 653,675 ****
     $(NTMAKE)
     $(CD) ..\..\..\..
  
! InstallShield5:
! 	echo ***** afs_setup_utils
! 	$(DOCD) $(SRC)\WINNT\afs_setup_utils
! 	$(CD) $(SRC)\WINNT\afs_setup_utils
! 	$(NTMAKE)
! 	$(CD) ..\..\..
! 
! 	$(DOCD) $(SRC)\WINNT\install\$@
! 	$(CD) $(SRC)\WINNT\install\$@
! 	$(NTMAKE)
! 	$(CD) ..\..\..\..
! 
! media: install InstallShield5 NSIS wix
  
  install-nsis: install NSIS
  
  install-wix: install wix
  
! install-is5: install InstallShield5
  
--- 651,661 ----
     $(NTMAKE)
     $(CD) ..\..\..\..
  
! media: install NSIS wix
  
  install-nsis: install NSIS
  
  install-wix: install wix
  
! 
  
Index: openafs/src/WINNT/afsd/afsd_init.c
diff -c openafs/src/WINNT/afsd/afsd_init.c:1.79.2.14 openafs/src/WINNT/afsd/afsd_init.c:1.79.2.15
*** openafs/src/WINNT/afsd/afsd_init.c:1.79.2.14	Fri Jun 22 10:12:39 2007
--- openafs/src/WINNT/afsd/afsd_init.c	Fri Aug 10 16:39:26 2007
***************
*** 541,546 ****
--- 541,547 ----
      osi_uid_t debugID;
      afs_uint64 cacheBlocks;
      DWORD cacheSize;
+     DWORD blockSize;
      long logChunkSize;
      DWORD stats;
      DWORD dwValue;
***************
*** 696,708 ****
                        logChunkSize);
              logChunkSize = CM_CONFIGDEFAULT_CHUNKSIZE;
          }
-         afsi_log("Chunk size %d", logChunkSize);
      } else {
          logChunkSize = CM_CONFIGDEFAULT_CHUNKSIZE;
-         afsi_log("Default chunk size %d", logChunkSize);
      }
      cm_logChunkSize = logChunkSize;
      cm_chunkSize = 1 << logChunkSize;
  
      dummyLen = sizeof(numBkgD);
      code = RegQueryValueEx(parmKey, "Daemons", NULL, NULL,
--- 697,734 ----
                        logChunkSize);
              logChunkSize = CM_CONFIGDEFAULT_CHUNKSIZE;
          }
      } else {
          logChunkSize = CM_CONFIGDEFAULT_CHUNKSIZE;
      }
      cm_logChunkSize = logChunkSize;
      cm_chunkSize = 1 << logChunkSize;
+     afsi_log("Chunk size %u (%d)", cm_chunkSize, cm_logChunkSize);
+ 
+     dummyLen = sizeof(blockSize);
+     code = RegQueryValueEx(parmKey, "blockSize", NULL, NULL,
+                             (BYTE *) &blockSize, &dummyLen);
+     if (code == ERROR_SUCCESS) {
+         if (blockSize < 1 || 
+             (blockSize > 1024 && (blockSize % CM_CONFIGDEFAULT_BLOCKSIZE != 0))) 
+         {
+             afsi_log("Invalid block size %u specified, using default", blockSize);
+             blockSize = CM_CONFIGDEFAULT_BLOCKSIZE;
+         } else {
+             /* 
+              * if the blockSize is less than 1024 we permit the blockSize to be
+              * specified in multiples of the default blocksize
+              */
+             if (blockSize <= 1024)
+                 blockSize *= CM_CONFIGDEFAULT_BLOCKSIZE;
+         }
+     } else {
+         blockSize = CM_CONFIGDEFAULT_BLOCKSIZE;
+     }
+     if (blockSize > cm_chunkSize) {
+         afsi_log("Block size cannot be larger than Chunk size.");
+         blockSize = cm_chunkSize;
+     }
+     afsi_log("Block size %u", blockSize);
  
      dummyLen = sizeof(numBkgD);
      code = RegQueryValueEx(parmKey, "Daemons", NULL, NULL,
***************
*** 1033,1039 ****
      
      RegCloseKey (parmKey);
  
!     cacheBlocks = ((afs_uint64)cacheSize * 1024) / CM_CONFIGDEFAULT_BLOCKSIZE;
          
      /* get network related info */
      cm_noIPAddr = CM_MAXINTERFACE_ADDR;
--- 1059,1065 ----
      
      RegCloseKey (parmKey);
  
!     cacheBlocks = ((afs_uint64)cacheSize * 1024) / blockSize;
          
      /* get network related info */
      cm_noIPAddr = CM_MAXINTERFACE_ADDR;
***************
*** 1076,1082 ****
          
      cm_InitCallback();
          
!     code = cm_InitMappedMemory(virtualCache, cm_CachePath, stats, cm_chunkSize, cacheBlocks);
      afsi_log("cm_InitMappedMemory code %x", code);
      if (code != 0) {
          *reasonP = "error initializing cache file";
--- 1102,1108 ----
          
      cm_InitCallback();
          
!     code = cm_InitMappedMemory(virtualCache, cm_CachePath, stats, cm_chunkSize, cacheBlocks, blockSize);
      afsi_log("cm_InitMappedMemory code %x", code);
      if (code != 0) {
          *reasonP = "error initializing cache file";
Index: openafs/src/WINNT/afsd/afsd_service.c
diff -c openafs/src/WINNT/afsd/afsd_service.c:1.52.4.13 openafs/src/WINNT/afsd/afsd_service.c:1.52.4.15
*** openafs/src/WINNT/afsd/afsd_service.c:1.52.4.13	Fri Jul  6 19:22:03 2007
--- openafs/src/WINNT/afsd/afsd_service.c	Sun Aug 12 22:53:30 2007
***************
*** 1150,1156 ****
      ServiceStatus.dwCurrentState = SERVICE_START_PENDING;
      ServiceStatus.dwWin32ExitCode = NO_ERROR;
      ServiceStatus.dwCheckPoint = 1;
!     ServiceStatus.dwWaitHint = 30000;
      /* accept Power Events */
      ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN | SERVICE_ACCEPT_POWEREVENT | SERVICE_ACCEPT_PARAMCHANGE;
      SetServiceStatus(StatusHandle, &ServiceStatus);
--- 1150,1156 ----
      ServiceStatus.dwCurrentState = SERVICE_START_PENDING;
      ServiceStatus.dwWin32ExitCode = NO_ERROR;
      ServiceStatus.dwCheckPoint = 1;
!     ServiceStatus.dwWaitHint = 120000;
      /* accept Power Events */
      ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN | SERVICE_ACCEPT_POWEREVENT | SERVICE_ACCEPT_PARAMCHANGE;
      SetServiceStatus(StatusHandle, &ServiceStatus);
***************
*** 1228,1240 ****
          }
          else
          {
!             /* allow another 15 seconds to start */
              ServiceStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
              ServiceStatus.dwServiceSpecificExitCode = 0;
              ServiceStatus.dwCurrentState = SERVICE_START_PENDING;
              ServiceStatus.dwWin32ExitCode = NO_ERROR;
              ServiceStatus.dwCheckPoint = 2;
!             ServiceStatus.dwWaitHint = 20000;
              /* accept Power Events */
              ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN | SERVICE_ACCEPT_POWEREVENT | SERVICE_ACCEPT_PARAMCHANGE;
              SetServiceStatus(StatusHandle, &ServiceStatus);
--- 1228,1240 ----
          }
          else
          {
!             /* allow another 120 seconds to start */
              ServiceStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
              ServiceStatus.dwServiceSpecificExitCode = 0;
              ServiceStatus.dwCurrentState = SERVICE_START_PENDING;
              ServiceStatus.dwWin32ExitCode = NO_ERROR;
              ServiceStatus.dwCheckPoint = 2;
!             ServiceStatus.dwWaitHint = 120000;
              /* accept Power Events */
              ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN | SERVICE_ACCEPT_POWEREVENT | SERVICE_ACCEPT_PARAMCHANGE;
              SetServiceStatus(StatusHandle, &ServiceStatus);
***************
*** 1258,1265 ****
          }
  
  #ifndef NOTSERVICE
!         ServiceStatus.dwCheckPoint++;
!         ServiceStatus.dwWaitHint -= 5000;
          SetServiceStatus(StatusHandle, &ServiceStatus);
  #endif
          code = afsd_InitDaemons(&reason);
--- 1258,1265 ----
          }
  
  #ifndef NOTSERVICE
!         ServiceStatus.dwCheckPoint = 3;
!         ServiceStatus.dwWaitHint = 30000;
          SetServiceStatus(StatusHandle, &ServiceStatus);
  #endif
          code = afsd_InitDaemons(&reason);
***************
*** 1296,1303 ****
          }
  
  #ifndef NOTSERVICE
!         ServiceStatus.dwCheckPoint++;
!         ServiceStatus.dwWaitHint -= 5000;
          SetServiceStatus(StatusHandle, &ServiceStatus);
  #endif
  
--- 1296,1303 ----
          }
  
  #ifndef NOTSERVICE
!         ServiceStatus.dwCheckPoint = 4;
!         ServiceStatus.dwWaitHint = 15000;
          SetServiceStatus(StatusHandle, &ServiceStatus);
  #endif
  
***************
*** 1352,1358 ****
  #ifndef NOTSERVICE
          ServiceStatus.dwCurrentState = SERVICE_RUNNING;
          ServiceStatus.dwWin32ExitCode = NO_ERROR;
!         ServiceStatus.dwCheckPoint = 0;
          ServiceStatus.dwWaitHint = 0;
  
          /* accept Power events */
--- 1352,1358 ----
  #ifndef NOTSERVICE
          ServiceStatus.dwCurrentState = SERVICE_RUNNING;
          ServiceStatus.dwWin32ExitCode = NO_ERROR;
!         ServiceStatus.dwCheckPoint = 5;
          ServiceStatus.dwWaitHint = 0;
  
          /* accept Power events */
***************
*** 1401,1406 ****
--- 1401,1413 ----
          CloseHandle(hAFSDWorkerThread[cnt]);
  #endif
  
+     ServiceStatus.dwCurrentState = SERVICE_STOP_PENDING;
+     ServiceStatus.dwWin32ExitCode = NO_ERROR;
+     ServiceStatus.dwCheckPoint = 6;
+     ServiceStatus.dwWaitHint = 120000;
+     ServiceStatus.dwControlsAccepted = 0;
+     SetServiceStatus(StatusHandle, &ServiceStatus);
+ 
      afsi_log("Received Termination Signal, Stopping Service");
  
      if ( GlobalStatus )
***************
*** 1420,1438 ****
          }
          FreeLibrary(hHookDll);
          hHookDll = NULL;
- 
-         if (hookRc == FALSE)
-         {
-             ServiceStatus.dwCurrentState = SERVICE_STOPPED;
-             ServiceStatus.dwWin32ExitCode = NO_ERROR;
-             ServiceStatus.dwCheckPoint = 0;
-             ServiceStatus.dwWaitHint = 0;
-             ServiceStatus.dwControlsAccepted = 0;
-             SetServiceStatus(StatusHandle, &ServiceStatus);
-                        
-             /* exit if initialization failed */
-             return;
-         }
      }
  
  
--- 1427,1432 ----
***************
*** 1500,1506 ****
  
      ServiceStatus.dwCurrentState = SERVICE_STOPPED;
      ServiceStatus.dwWin32ExitCode = GlobalStatus ? ERROR_EXCEPTION_IN_SERVICE : NO_ERROR;
!     ServiceStatus.dwCheckPoint = 0;
      ServiceStatus.dwWaitHint = 0;
      ServiceStatus.dwControlsAccepted = 0;
      SetServiceStatus(StatusHandle, &ServiceStatus);
--- 1494,1500 ----
  
      ServiceStatus.dwCurrentState = SERVICE_STOPPED;
      ServiceStatus.dwWin32ExitCode = GlobalStatus ? ERROR_EXCEPTION_IN_SERVICE : NO_ERROR;
!     ServiceStatus.dwCheckPoint = 7;
      ServiceStatus.dwWaitHint = 0;
      ServiceStatus.dwControlsAccepted = 0;
      SetServiceStatus(StatusHandle, &ServiceStatus);
Index: openafs/src/WINNT/afsd/afskfw.c
diff -c openafs/src/WINNT/afsd/afskfw.c:1.28.4.8 openafs/src/WINNT/afsd/afskfw.c:1.28.4.9
*** openafs/src/WINNT/afsd/afskfw.c:1.28.4.8	Wed Apr 18 11:59:35 2007
--- openafs/src/WINNT/afsd/afskfw.c	Tue Aug 21 04:44:06 2007
***************
*** 1,5 ****
  /*
!  * Copyright (c) 2004, 2005, 2006 Secure Endpoints Inc.
   * Copyright (c) 2003 SkyRope, LLC
   * All rights reserved.
   * 
--- 1,5 ----
  /*
!  * Copyright (c) 2004, 2005, 2006, 2007 Secure Endpoints Inc.
   * Copyright (c) 2003 SkyRope, LLC
   * All rights reserved.
   * 
***************
*** 3609,3615 ****
      DWORD dwLen  = 0;
   
      if (!hUserToken || !newfilename || size <= 0)
!  	return;
   
       *newfilename = '\0';
   
--- 3609,3615 ----
      DWORD dwLen  = 0;
   
      if (!hUserToken || !newfilename || size <= 0)
!  	return 1;
   
       *newfilename = '\0';
   
Index: openafs/src/WINNT/afsd/cm_btree.c
diff -c /dev/null openafs/src/WINNT/afsd/cm_btree.c:1.1.2.2
*** /dev/null	Thu Aug 23 22:27:14 2007
--- openafs/src/WINNT/afsd/cm_btree.c	Wed Aug 22 12:00:45 2007
***************
*** 0 ****
--- 1 ----
+ /* Place holder for B+ tree source code */
Index: openafs/src/WINNT/afsd/cm_btree.h
diff -c /dev/null openafs/src/WINNT/afsd/cm_btree.h:1.1.2.2
*** /dev/null	Thu Aug 23 22:27:14 2007
--- openafs/src/WINNT/afsd/cm_btree.h	Wed Aug 22 12:00:45 2007
***************
*** 0 ****
--- 1 ----
+ /* place holder for B+ tree header */
Index: openafs/src/WINNT/afsd/cm_memmap.c
diff -c openafs/src/WINNT/afsd/cm_memmap.c:1.7.2.6 openafs/src/WINNT/afsd/cm_memmap.c:1.7.2.7
*** openafs/src/WINNT/afsd/cm_memmap.c:1.7.2.6	Fri Jun 22 18:16:39 2007
--- openafs/src/WINNT/afsd/cm_memmap.c	Fri Aug 10 16:39:26 2007
***************
*** 622,628 ****
  }
  
  int
! cm_InitMappedMemory(DWORD virtualCache, char * cachePath, DWORD stats, DWORD chunkSize, afs_uint64 cacheBlocks)
  {
      HANDLE hf = INVALID_HANDLE_VALUE, hm;
      PSECURITY_ATTRIBUTES psa;
--- 622,629 ----
  }
  
  int
! cm_InitMappedMemory(DWORD virtualCache, char * cachePath, DWORD stats, DWORD chunkSize, 
!                     afs_uint64 cacheBlocks, afs_uint32 blockSize)
  {
      HANDLE hf = INVALID_HANDLE_VALUE, hm;
      PSECURITY_ATTRIBUTES psa;
***************
*** 641,647 ****
      volumeSerialNumber = GetVolSerialNumber(cachePath);
      GetMachineSid(machineSid, sizeof(machineSid));
  
!     mappingSize = ComputeSizeOfMappingFile(stats, maxVols, maxCells, chunkSize, cacheBlocks, CM_CONFIGDEFAULT_BLOCKSIZE);
  
      if ( !virtualCache ) {
          psa = CreateCacheFileSA();
--- 642,648 ----
      volumeSerialNumber = GetVolSerialNumber(cachePath);
      GetMachineSid(machineSid, sizeof(machineSid));
  
!     mappingSize = ComputeSizeOfMappingFile(stats, maxVols, maxCells, chunkSize, cacheBlocks, blockSize);
  
      if ( !virtualCache ) {
          psa = CreateCacheFileSA();
***************
*** 756,762 ****
                   config_data_p->maxCells == maxCells &&
                   config_data_p->chunkSize == chunkSize &&
                   config_data_p->buf_nbuffers == cacheBlocks &&
!                  config_data_p->blockSize == CM_CONFIGDEFAULT_BLOCKSIZE &&
                   config_data_p->bufferSize == mappingSize)
              {
                  if ( config_data_p->dirty ) {
--- 757,763 ----
                   config_data_p->maxCells == maxCells &&
                   config_data_p->chunkSize == chunkSize &&
                   config_data_p->buf_nbuffers == cacheBlocks &&
!                  config_data_p->blockSize == blockSize &&
                   config_data_p->bufferSize == mappingSize)
              {
                  if ( config_data_p->dirty ) {
***************
*** 849,855 ****
          cm_data.baseAddress = baseAddress;
          cm_data.stats = stats;
          cm_data.chunkSize = chunkSize;
!         cm_data.blockSize = CM_CONFIGDEFAULT_BLOCKSIZE;
          cm_data.bufferSize = mappingSize;
          cm_data.scacheHashTableSize = osi_PrimeLessThan(stats / 2 + 1);
          cm_data.volumeHashTableSize = osi_PrimeLessThan((afs_uint32)(maxVols/7 + 1));
--- 850,856 ----
          cm_data.baseAddress = baseAddress;
          cm_data.stats = stats;
          cm_data.chunkSize = chunkSize;
!         cm_data.blockSize = blockSize;
          cm_data.bufferSize = mappingSize;
          cm_data.scacheHashTableSize = osi_PrimeLessThan(stats / 2 + 1);
          cm_data.volumeHashTableSize = osi_PrimeLessThan((afs_uint32)(maxVols/7 + 1));
***************
*** 862,868 ****
  
          cm_data.buf_nbuffers = cacheBlocks;
          cm_data.buf_nOrigBuffers = 0;
!         cm_data.buf_blockSize = CM_BUF_BLOCKSIZE;
          cm_data.buf_hashSize = osi_PrimeLessThan((afs_uint32)(cacheBlocks/7 + 1));
  
          cm_data.mountRootGen = time(NULL);
--- 863,869 ----
  
          cm_data.buf_nbuffers = cacheBlocks;
          cm_data.buf_nOrigBuffers = 0;
!         cm_data.buf_blockSize = blockSize;
          cm_data.buf_hashSize = osi_PrimeLessThan((afs_uint32)(cacheBlocks/7 + 1));
  
          cm_data.mountRootGen = time(NULL);
***************
*** 899,905 ****
          cm_data.bufHeaderBaseAddress = (cm_buf_t *) baseAddress;
          baseAddress += ComputeSizeOfDataHeaders(cacheBlocks);
          cm_data.bufDataBaseAddress = (char *) baseAddress;
!         baseAddress += ComputeSizeOfDataBuffers(cacheBlocks, CM_CONFIGDEFAULT_BLOCKSIZE);
          cm_data.bufEndOfData = (char *) baseAddress;
  	cm_data.buf_dirtyListp = NULL;
  	cm_data.buf_dirtyListEndp = NULL;
--- 900,906 ----
          cm_data.bufHeaderBaseAddress = (cm_buf_t *) baseAddress;
          baseAddress += ComputeSizeOfDataHeaders(cacheBlocks);
          cm_data.bufDataBaseAddress = (char *) baseAddress;
!         baseAddress += ComputeSizeOfDataBuffers(cacheBlocks, blockSize);
          cm_data.bufEndOfData = (char *) baseAddress;
  	cm_data.buf_dirtyListp = NULL;
  	cm_data.buf_dirtyListEndp = NULL;
Index: openafs/src/WINNT/afsd/cm_memmap.h
diff -c openafs/src/WINNT/afsd/cm_memmap.h:1.3.4.4 openafs/src/WINNT/afsd/cm_memmap.h:1.3.4.5
*** openafs/src/WINNT/afsd/cm_memmap.h:1.3.4.4	Fri Jun 22 18:16:39 2007
--- openafs/src/WINNT/afsd/cm_memmap.h	Fri Aug 10 16:39:26 2007
***************
*** 115,119 ****
  VOID  FreeCacheFileSA(PSECURITY_ATTRIBUTES psa);
  int   cm_ShutdownMappedMemory(void);
  int   cm_ValidateMappedMemory(char * cachePath);
! int   cm_InitMappedMemory(DWORD virtualCache, char * cachePath, DWORD stats, DWORD chunkSize, afs_uint64 cacheBlocks );
  #endif /* CM_MEMMAP_H */
\ No newline at end of file
--- 115,119 ----
  VOID  FreeCacheFileSA(PSECURITY_ATTRIBUTES psa);
  int   cm_ShutdownMappedMemory(void);
  int   cm_ValidateMappedMemory(char * cachePath);
! int   cm_InitMappedMemory(DWORD virtualCache, char * cachePath, DWORD stats, DWORD chunkSize, afs_uint64 cacheBlocks, afs_uint32 blockSize);
  #endif /* CM_MEMMAP_H */
\ No newline at end of file
Index: openafs/src/WINNT/afsd/cm_vnodeops.c
diff -c openafs/src/WINNT/afsd/cm_vnodeops.c:1.69.2.34 openafs/src/WINNT/afsd/cm_vnodeops.c:1.69.2.38
*** openafs/src/WINNT/afsd/cm_vnodeops.c:1.69.2.34	Thu Aug  2 16:58:42 2007
--- openafs/src/WINNT/afsd/cm_vnodeops.c	Thu Aug 23 16:43:08 2007
***************
*** 1857,1876 ****
  				  userp, reqp, &nscp);
  
                  if (code == 0) {
!                     for ( i=0; i<fid_count; i++) {
!                         if ( !cm_FidCmp(&nscp->fid, &fids[i]) ) {
!                             code = CM_ERROR_TOO_MANY_SYMLINKS;
!                             cm_ReleaseSCache(nscp);
!                             nscp = NULL;
!                             break;
                          }
                      }
!                     if (i == fid_count && fid_count < MAX_FID_COUNT) {
!                         fids[fid_count++] = nscp->fid;
!                     }
!                 }
!                 
!                 if (code) {
  		    cm_ReleaseSCache(tscp);
  		    if (dirScp)
  			cm_ReleaseSCache(dirScp);
--- 1857,1888 ----
  				  userp, reqp, &nscp);
  
                  if (code == 0) {
!                     if (!strcmp(component,"..") || !strcmp(component,".")) {
!                         /* 
!                          * roll back the fid list until we find the fid 
!                          * that matches where we are now.  Its not necessarily
!                          * one or two fids because they might have been 
!                          * symlinks or mount points or both that were crossed.  
!                          */
!                         for ( i=fid_count-1; i>=0; i--) {
!                             if (!cm_FidCmp(&nscp->fid, &fids[i]))
!                                 break;
!                         }
!                     } else {
!                         /* add the new fid to the list */
!                         for ( i=0; i<fid_count; i++) {
!                             if ( !cm_FidCmp(&nscp->fid, &fids[i]) ) {
!                                 code = CM_ERROR_TOO_MANY_SYMLINKS;
!                                 cm_ReleaseSCache(nscp);
!                                 nscp = NULL;
!                                 break;
!                             }
!                         }
!                         if (i == fid_count && fid_count < MAX_FID_COUNT) {
!                             fids[fid_count++] = nscp->fid;
                          }
                      }
!                 } else {
  		    cm_ReleaseSCache(tscp);
  		    if (dirScp)
  			cm_ReleaseSCache(dirScp);
***************
*** 1940,1951 ****
                      code = cm_AssembleLink(tscp, restp, &linkScp, &tempsp, userp, reqp);
  
                      if (code == 0 && linkScp != NULL) {
!                         for ( i=0; i<fid_count; i++) {
!                             if ( !cm_FidCmp(&linkScp->fid, &fids[i]) ) {
!                                 code = CM_ERROR_TOO_MANY_SYMLINKS;
!                                 cm_ReleaseSCache(linkScp);
!                                 nscp = NULL;
!                                 break;
                              }
                          }
                          if (i == fid_count && fid_count < MAX_FID_COUNT) {
--- 1952,1967 ----
                      code = cm_AssembleLink(tscp, restp, &linkScp, &tempsp, userp, reqp);
  
                      if (code == 0 && linkScp != NULL) {
!                         if (linkScp == cm_data.rootSCachep) 
!                             fid_count = 0;
!                         else {
!                             for ( i=0; i<fid_count; i++) {
!                                 if ( !cm_FidCmp(&linkScp->fid, &fids[i]) ) {
!                                     code = CM_ERROR_TOO_MANY_SYMLINKS;
!                                     cm_ReleaseSCache(linkScp);
!                                     nscp = NULL;
!                                     break;
!                                 }
                              }
                          }
                          if (i == fid_count && fid_count < MAX_FID_COUNT) {
***************
*** 2710,2716 ****
      cm_callbackRequest_t cbReq;
      AFSFid newAFSFid;
      cm_fid_t newFid;
!     cm_scache_t *scp;
      int didEnd;
      AFSStoreStatus inStatus;
      AFSFetchStatus updatedDirStatus;
--- 2726,2732 ----
      cm_callbackRequest_t cbReq;
      AFSFid newAFSFid;
      cm_fid_t newFid;
!     cm_scache_t *scp = NULL;
      int didEnd;
      AFSStoreStatus inStatus;
      AFSFetchStatus updatedDirStatus;
Index: openafs/src/WINNT/afsd/cm_volume.c
diff -c openafs/src/WINNT/afsd/cm_volume.c:1.14.4.13 openafs/src/WINNT/afsd/cm_volume.c:1.14.4.15
*** openafs/src/WINNT/afsd/cm_volume.c:1.14.4.13	Thu Jul  5 15:22:16 2007
--- openafs/src/WINNT/afsd/cm_volume.c	Thu Aug 23 12:49:03 2007
***************
*** 1457,1463 ****
  
  void cm_VolumeStatusNotification(cm_volume_t * volp, afs_uint32 volID, enum volstatus old, enum volstatus new)
  {
!     char volstr[CELL_MAXNAMELEN + VL_MAXNAMELEN];
      char *ext = "";
  
      if (volID == volp->rw.ID)
--- 1457,1463 ----
  
  void cm_VolumeStatusNotification(cm_volume_t * volp, afs_uint32 volID, enum volstatus old, enum volstatus new)
  {
!     char volstr[CELL_MAXNAMELEN + VL_MAXNAMELEN]="";
      char *ext = "";
  
      if (volID == volp->rw.ID)
***************
*** 1471,1477 ****
      snprintf(volstr, sizeof(volstr), "%s:%s%s", volp->cellp->name, volp->namep, ext);
  
      osi_Log4(afsd_logp, "VolumeStatusNotification: %-48s [%10u] (%s -> %s)",
!              volstr, volID, volstatus_str(old), volstatus_str(new));
  
      cm_VolStatus_Change_Notification(volp->cellp->cellID, volID, new);
  }       
--- 1471,1477 ----
      snprintf(volstr, sizeof(volstr), "%s:%s%s", volp->cellp->name, volp->namep, ext);
  
      osi_Log4(afsd_logp, "VolumeStatusNotification: %-48s [%10u] (%s -> %s)",
!              osi_LogSaveString(afsd_logp, volstr), volID, volstatus_str(old), volstatus_str(new));
  
      cm_VolStatus_Change_Notification(volp->cellp->cellID, volID, new);
  }       
Index: openafs/src/WINNT/afsd/fs_utils.c
diff -c openafs/src/WINNT/afsd/fs_utils.c:1.10 openafs/src/WINNT/afsd/fs_utils.c:1.10.2.2
*** openafs/src/WINNT/afsd/fs_utils.c:1.10	Sat Mar  4 16:39:25 2006
--- openafs/src/WINNT/afsd/fs_utils.c	Sun Aug 19 20:07:59 2007
***************
*** 122,130 ****
  }
  
  /* is this a digit or a digit-like thing? */
! static int ismeta(ac, abase)
! register int abase;
! register int ac; {
  /*    if (ac == '-' || ac == 'x' || ac == 'X') return 1; */
      if (ac >= '0' && ac <= '7') return 1;
      if (abase <= 8) return 0;
--- 122,128 ----
  }
  
  /* is this a digit or a digit-like thing? */
! static int ismeta(int abase, int ac) {
  /*    if (ac == '-' || ac == 'x' || ac == 'X') return 1; */
      if (ac >= '0' && ac <= '7') return 1;
      if (abase <= 8) return 0;
***************
*** 136,152 ****
  }
  
  /* given that this is a digit or a digit-like thing, compute its value */
! static int getmeta(ac)
! register int ac; {
      if (ac >= '0' && ac <= '9') return ac - '0';
      if (ac >= 'a' && ac <= 'f') return ac - 'a' + 10;
      if (ac >= 'A' && ac <= 'F') return ac - 'A' + 10;
      return 0;
  }
  
! long util_GetInt32 (as, aval)
! register char *as;
! long *aval;
  {
      register long total;
      register int tc;
--- 134,147 ----
  }
  
  /* given that this is a digit or a digit-like thing, compute its value */
! static int getmeta(int ac) {
      if (ac >= '0' && ac <= '9') return ac - '0';
      if (ac >= 'a' && ac <= 'f') return ac - 'a' + 10;
      if (ac >= 'A' && ac <= 'F') return ac - 'A' + 10;
      return 0;
  }
  
! afs_int32 util_GetInt32 (char *as, afs_int32 *aval)
  {
      register long total;
      register int tc;
Index: openafs/src/WINNT/afsd/fs_utils.h
diff -c openafs/src/WINNT/afsd/fs_utils.h:1.7 openafs/src/WINNT/afsd/fs_utils.h:1.7.14.2
*** openafs/src/WINNT/afsd/fs_utils.h:1.7	Thu Feb 26 14:22:44 2004
--- openafs/src/WINNT/afsd/fs_utils.h	Sun Aug 19 20:07:59 2007
***************
*** 33,39 ****
  extern struct hostent *hostutil_GetHostByName(char *namep);
  #endif
  
! // extern long util_GetInt32(char *stringp, long *valuep);
  
  extern long fs_StripDriveLetter(char *inPathp, char *outPathp, long outSize);
  
--- 33,39 ----
  extern struct hostent *hostutil_GetHostByName(char *namep);
  #endif
  
! extern afs_int32 util_GetInt32(char *stringp, afs_int32 *valuep);
  
  extern long fs_StripDriveLetter(char *inPathp, char *outPathp, long outSize);
  
Index: openafs/src/WINNT/afsd/smb.h
diff -c openafs/src/WINNT/afsd/smb.h:1.41.2.16 openafs/src/WINNT/afsd/smb.h:1.41.2.17
*** openafs/src/WINNT/afsd/smb.h:1.41.2.16	Thu Jul  5 15:22:16 2007
--- openafs/src/WINNT/afsd/smb.h	Thu Aug 23 12:46:07 2007
***************
*** 523,529 ****
  						 * the response was already
  						 * sent.
                                                   */
! #define SMB_MAX_PATH                    256     /* max path length */
  
  /* prototypes */
  
--- 523,529 ----
  						 * the response was already
  						 * sent.
                                                   */
! #define SMB_MAX_PATH                    260     /* max path length */
  
  /* prototypes */
  
Index: openafs/src/WINNT/doc/install/Documentation/en_US/html/index.htm
diff -c openafs/src/WINNT/doc/install/Documentation/en_US/html/index.htm:1.5.4.17 openafs/src/WINNT/doc/install/Documentation/en_US/html/index.htm:1.5.4.18
*** openafs/src/WINNT/doc/install/Documentation/en_US/html/index.htm:1.5.4.17	Thu Aug  9 11:46:17 2007
--- openafs/src/WINNT/doc/install/Documentation/en_US/html/index.htm	Thu Aug 23 13:13:15 2007
***************
*** 57,63 ****
  
  <h1>OpenAFS for Windows</h1>
  
! <h2>Version 1.5.22</h2>
  
  <p class=MsoNormal>&nbsp; </p>
  
--- 57,63 ----
  
  <h1>OpenAFS for Windows</h1>
  
! <h2>Version 1.5.23</h2>
  
  <p class=MsoNormal>&nbsp; </p>
  
***************
*** 80,86 ****
  <span
  style='font-family:Symbol'>·<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span></span><a
! href="ReleaseNotes/relnotes-frames.htm">OpenAFS for Windows 1.5.22
  Release Notes</a></p>
  
  <p style='margin-left:36.0pt;text-indent:-18.0pt;'>
--- 80,86 ----
  <span
  style='font-family:Symbol'>·<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span></span><a
! href="ReleaseNotes/relnotes-frames.htm">OpenAFS for Windows 1.5.23
  Release Notes</a></p>
  
  <p style='margin-left:36.0pt;text-indent:-18.0pt;'>
Index: openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/logo.htm
diff -c openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/logo.htm:1.1.6.17 openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/logo.htm:1.1.6.18
*** openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/logo.htm:1.1.6.17	Thu Aug  9 11:46:21 2007
--- openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/logo.htm	Thu Aug 23 13:13:20 2007
***************
*** 18,24 ****
  .shape {behavior:url(#default#VML);}
  </style>
  <![endif]-->
! <title>OpenAFS for Windows 1.5.22 Release Notes</title>
  <!--[if gte mso 9]><xml>
   <o:DocumentProperties>
    <o:Revision>1</o:Revision>
--- 18,24 ----
  .shape {behavior:url(#default#VML);}
  </style>
  <![endif]-->
! <title>OpenAFS for Windows 1.5.23 Release Notes</title>
  <!--[if gte mso 9]><xml>
   <o:DocumentProperties>
    <o:Revision>1</o:Revision>
Index: openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes-frames.htm
diff -c openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes-frames.htm:1.1.4.19 openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes-frames.htm:1.1.4.20
*** openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes-frames.htm:1.1.4.19	Thu Aug  9 11:46:21 2007
--- openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes-frames.htm	Thu Aug 23 13:13:20 2007
***************
*** 8,14 ****
  <meta name=Generator content="Microsoft Word 11">
  <meta name=Originator content="Microsoft Word 11">
  <link rel=File-List href="relnotes-frames_files/filelist.xml">
! <title>OpenAFS for Windows 1.5.22 Release Notes</title>
  <!--[if gte mso 9]><xml>
   <w:WordDocument>
    <w:Zoom>0</w:Zoom>
--- 8,14 ----
  <meta name=Generator content="Microsoft Word 11">
  <meta name=Originator content="Microsoft Word 11">
  <link rel=File-List href="relnotes-frames_files/filelist.xml">
! <title>OpenAFS for Windows 1.5.23 Release Notes</title>
  <!--[if gte mso 9]><xml>
   <w:WordDocument>
    <w:Zoom>0</w:Zoom>
Index: openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes.htm
diff -c openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes.htm:1.6.4.21 openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes.htm:1.6.4.22
*** openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes.htm:1.6.4.21	Thu Aug  9 11:46:21 2007
--- openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes.htm	Thu Aug 23 13:13:20 2007
***************
*** 19,25 ****
  .shape {behavior:url(#default#VML);}
  </style>
  <![endif]-->
! <title>OpenAFS for Windows 1.5.22 Release Notes</title>
  <o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
   name="PostalCode"/>
  <o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
--- 19,25 ----
  .shape {behavior:url(#default#VML);}
  </style>
  <![endif]-->
! <title>OpenAFS for Windows 1.5.23 Release Notes</title>
  <o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
   name="PostalCode"/>
  <o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
***************
*** 586,592 ****
  
  <div class=Section1>
  
! <p class=MsoTitle>OpenAFS for Windows 1.5.22<br>
  Release Notes</p>
  
  <p class=MsoBodyText>The Andrew File System (AFS) is a location-independent
--- 586,592 ----
  
  <div class=Section1>
  
! <p class=MsoTitle>OpenAFS for Windows 1.5.23<br>
  Release Notes</p>
  
  <p class=MsoBodyText>The Andrew File System (AFS) is a location-independent
Index: openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/toc.htm
diff -c openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/toc.htm:1.2.6.16 openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/toc.htm:1.2.6.17
*** openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/toc.htm:1.2.6.16	Thu Aug  9 11:46:24 2007
--- openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/toc.htm	Thu Aug 23 13:13:21 2007
***************
*** 10,16 ****
  <meta name=Originator content="Microsoft Word 11">
  <base target=body>
  <link rel=File-List href="toc_files/filelist.xml">
! <title>OpenAFS for Windows 1.5.22 Table of Contents</title>
  <!--[if gte mso 9]><xml>
   <o:DocumentProperties>
    <o:Author>Jeffrey Altman</o:Author>
--- 10,16 ----
  <meta name=Originator content="Microsoft Word 11">
  <base target=body>
  <link rel=File-List href="toc_files/filelist.xml">
! <title>OpenAFS for Windows 1.5.23 Table of Contents</title>
  <!--[if gte mso 9]><xml>
   <o:DocumentProperties>
    <o:Author>Jeffrey Altman</o:Author>
Index: openafs/src/WINNT/install/wix/registry.wxi
diff -c openafs/src/WINNT/install/wix/registry.wxi:1.10.2.3 openafs/src/WINNT/install/wix/registry.wxi:1.10.2.4
*** openafs/src/WINNT/install/wix/registry.wxi:1.10.2.3	Thu May  3 22:49:57 2007
--- openafs/src/WINNT/install/wix/registry.wxi	Fri Aug 10 08:37:59 2007
***************
*** 234,240 ****
          <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\$(var.NumericVersion)" Name="Description" Type="string" Value="$(loc.StrAFSCCDesc)" Id="reg_Client_Bins27" />
          <Registry Root="HKLM" Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved" Id="reg_Client_Bins28" />
          <Registry Root="HKLM" Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved" Action="createKey" Id="reg_Client_Bins29" />
!         <Registry Root="HKLM" Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved" Name="{$(var.clsid_afs_shl_ext)}" Type="string" Value="$(loc.StrShlExtDesc)" Id="reg_Client_Bins30" />
          <Registry Root="HKCR" Key="*\shellex\ContextMenuHandlers\AFS Client Shell Extension (32-bit)" Action="createKeyAndRemoveKeyOnUninstall" Id="reg_Client_Bins31" />
          <Registry Root="HKCR" Key="*\shellex\ContextMenuHandlers\AFS Client Shell Extension (32-bit)" Type="string" Value="{$(var.clsid_afs_shl_ext)}" Id="reg_Client_Bins32" />
          <Registry Root="HKCR" Key="FOLDER\shellex\ContextMenuHandlers\AFS Client Shell Extension (32-bit)" Action="createKeyAndRemoveKeyOnUninstall" Id="reg_Client_Bins33" />
--- 234,240 ----
          <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\$(var.NumericVersion)" Name="Description" Type="string" Value="$(loc.StrAFSCCDesc)" Id="reg_Client_Bins27" />
          <Registry Root="HKLM" Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved" Id="reg_Client_Bins28" />
          <Registry Root="HKLM" Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved" Action="createKey" Id="reg_Client_Bins29" />
!         <Registry Root="HKLM" Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved" Name="{$(var.clsid_afs_shl_ext)}" Type="string" Value="$(loc.StrShlExt32Desc)" Id="reg_Client_Bins30" />
          <Registry Root="HKCR" Key="*\shellex\ContextMenuHandlers\AFS Client Shell Extension (32-bit)" Action="createKeyAndRemoveKeyOnUninstall" Id="reg_Client_Bins31" />
          <Registry Root="HKCR" Key="*\shellex\ContextMenuHandlers\AFS Client Shell Extension (32-bit)" Type="string" Value="{$(var.clsid_afs_shl_ext)}" Id="reg_Client_Bins32" />
          <Registry Root="HKCR" Key="FOLDER\shellex\ContextMenuHandlers\AFS Client Shell Extension (32-bit)" Action="createKeyAndRemoveKeyOnUninstall" Id="reg_Client_Bins33" />
Index: openafs/src/WINNT/install/wix/lang/en_US/strings.wxl
diff -c openafs/src/WINNT/install/wix/lang/en_US/strings.wxl:1.6.2.1 openafs/src/WINNT/install/wix/lang/en_US/strings.wxl:1.6.2.2
*** openafs/src/WINNT/install/wix/lang/en_US/strings.wxl:1.6.2.1	Thu Oct 12 17:19:42 2006
--- openafs/src/WINNT/install/wix/lang/en_US/strings.wxl	Fri Aug 10 08:37:59 2007
***************
*** 33,38 ****
--- 33,39 ----
      <String Id="StrNIDMDebugLongDesc">Debugging symbols for the OpenAFS NetIDMgr plug-in.</String>
  
      <String Id="StrShlExtDesc">AFS Context Menu Shell Extension</String>
+     <String Id="StrShlExt32Desc">AFS Context Menu Shell Extension  (32-bit)</String>
      <String Id="StrAfsCredsDesc">Authentication for AFS</String>
      <String Id="StrHlpFileDesc">AFS Client Help</String>
      <String Id="StrSvrMgrDesc">Server Manager</String>
Index: openafs/src/afs/afs_dcache.c
diff -c openafs/src/afs/afs_dcache.c:1.64.4.5 openafs/src/afs/afs_dcache.c:1.64.4.6
*** openafs/src/afs/afs_dcache.c:1.64.4.5	Mon May 14 17:33:54 2007
--- openafs/src/afs/afs_dcache.c	Tue Aug 21 17:28:44 2007
***************
*** 14,20 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_dcache.c,v 1.64.4.5 2007/05/14 21:33:54 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.64.4.6 2007/08/21 21:28:44 shadow Exp $");
  
  #include "afs/sysincludes.h"	/*Standard vendor system headers */
  #include "afsincludes.h"	/*AFS-based standard headers */
***************
*** 1345,1358 ****
  	}
  	index = afs_dcnextTbl[index];
      }
-     MReleaseWriteLock(&afs_xdcache);
      if (index != NULLIDX) {
  	hset(afs_indexTimes[tdc->index], afs_indexCounter);
  	hadd32(afs_indexCounter, 1);
  	return tdc;
!     } else
! 	return NULL;
! 
  }				/*afs_FindDCache */
  
  
--- 1345,1358 ----
  	}
  	index = afs_dcnextTbl[index];
      }
      if (index != NULLIDX) {
  	hset(afs_indexTimes[tdc->index], afs_indexCounter);
  	hadd32(afs_indexCounter, 1);
+ 	MReleaseWriteLock(&afs_xdcache);
  	return tdc;
!     } 
!     MReleaseWriteLock(&afs_xdcache);
!     return NULL;
  }				/*afs_FindDCache */
  
  
Index: openafs/src/afs/afs_nfsclnt.c
diff -c openafs/src/afs/afs_nfsclnt.c:1.13.6.5 openafs/src/afs/afs_nfsclnt.c:1.13.6.6
*** openafs/src/afs/afs_nfsclnt.c:1.13.6.5	Tue Mar 20 15:21:52 2007
--- openafs/src/afs/afs_nfsclnt.c	Wed Aug 22 15:39:03 2007
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_nfsclnt.c,v 1.13.6.5 2007/03/20 19:21:52 shadow Exp $");
  
  #if !defined(AFS_NONFSTRANS) || defined(AFS_AIX_IAUTH_ENV)
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
--- 11,17 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_nfsclnt.c,v 1.13.6.6 2007/08/22 19:39:03 shadow Exp $");
  
  #if !defined(AFS_NONFSTRANS) || defined(AFS_AIX_IAUTH_ENV)
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
***************
*** 203,208 ****
--- 203,214 ----
  #else
      uid = (*cred)->cr_uid;
  #endif
+     /* Do this early, so pag management knows */
+ #ifdef	AFS_OSF_ENV
+     (*cred)->cr_ruid = NFSXLATOR_CRED;	/* Identify it as nfs xlator call */
+ #else
+     (*cred)->cr_rgid = NFSXLATOR_CRED;	/* Identify it as nfs xlator call */
+ #endif
      if ((afs_nfsexporter->exp_states & EXP_CLIPAGS) && pag != NOPAG) {
  	uid = pag;
      } else if (pag != NOPAG) {
***************
*** 300,310 ****
      *pagparam = pag;
      *outexporter = (struct afs_exporter *)np;
      afs_PutUser(au, WRITE_LOCK);
- #ifdef	AFS_OSF_ENV
-     (*cred)->cr_ruid = NFSXLATOR_CRED;	/* Identify it as nfs xlator call */
- #else
-     (*cred)->cr_rgid = NFSXLATOR_CRED;	/* Identify it as nfs xlator call */
- #endif
  /*    ReleaseWriteLock(&afs_xnfsreq);	*/
      return 0;
  }
--- 306,311 ----
Index: openafs/src/afs/afs_osi_pag.c
diff -c openafs/src/afs/afs_osi_pag.c:1.29.4.9 openafs/src/afs/afs_osi_pag.c:1.29.4.10
*** openafs/src/afs/afs_osi_pag.c:1.29.4.9	Thu Feb  8 19:27:00 2007
--- openafs/src/afs/afs_osi_pag.c	Wed Aug 22 15:39:03 2007
***************
*** 23,29 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_osi_pag.c,v 1.29.4.9 2007/02/09 00:27:00 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.29.4.10 2007/08/22 19:39:03 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 599,605 ****
  #endif
  out:
  #if defined(AFS_LINUX26_ENV) && defined(LINUX_KEYRING_SUPPORT)
!     if (pag == NOPAG) {
  	struct key *key;
  	afs_uint32 upag, newpag;
  
--- 599,605 ----
  #endif
  out:
  #if defined(AFS_LINUX26_ENV) && defined(LINUX_KEYRING_SUPPORT)
!     if (pag == NOPAG && cred->cr_rgid != NFSXLATOR_CRED) {
  	struct key *key;
  	afs_uint32 upag, newpag;
  
Index: openafs/src/afs/afs_pioctl.c
diff -c openafs/src/afs/afs_pioctl.c:1.110.2.7 openafs/src/afs/afs_pioctl.c:1.110.2.10
*** openafs/src/afs/afs_pioctl.c:1.110.2.7	Sat Jun 23 02:23:12 2007
--- openafs/src/afs/afs_pioctl.c	Wed Aug 22 15:39:03 2007
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_pioctl.c,v 1.110.2.7 2007/06/23 06:23:12 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.110.2.10 2007/08/22 19:39:03 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #ifdef AFS_OBSD_ENV
***************
*** 3338,3343 ****
--- 3338,3345 ----
      struct afs_exporter *exporter, *outexporter;
      struct AFS_UCRED *newcred;
      struct unixuser *au;
+     afs_uint32 comp = *com & 0xff00;
+     afs_uint32 h, l;
  
  #if defined(AFS_SGIMP_ENV)
      osi_Assert(ISAFS_GLOCK());
***************
*** 3379,3385 ****
  	u.u_error = 0;
  #endif
  	/* check for acceptable opcodes for normal folks, which are, so far,
! 	 * set tokens and unlog.
  	 */
  	if (i != 9 && i != 3 && i != 38 && i != 8) {
  	    osi_FreeLargeSpace(inData);
--- 3381,3387 ----
  	u.u_error = 0;
  #endif
  	/* check for acceptable opcodes for normal folks, which are, so far,
! 	 * get/set tokens, sysname, and unlog.
  	 */
  	if (i != 9 && i != 3 && i != 38 && i != 8) {
  	    osi_FreeLargeSpace(inData);
***************
*** 3408,3416 ****
--- 3410,3426 ----
      newcred->cr_groupset.gs_union.un_groups[0] = g0;
      newcred->cr_groupset.gs_union.un_groups[1] = g1;
  #elif defined(AFS_LINUX26_ENV)
+ #ifdef AFS_LINUX26_ONEGROUP_ENV
+     newcred->cr_group_info = groups_alloc(1); /* not that anything sets this */
+     l = (((g0-0x3f00) & 0x3fff) << 14) | ((g1-0x3f00) & 0x3fff);
+     h = ((g0-0x3f00) >> 14);
+     h = ((g1-0x3f00) >> 14) + h + h + h;
+     GROUP_AT(newcred->cr_group_info, 0) = ((h << 28) | l);
+ #else
      newcred->cr_group_info = groups_alloc(2);
      GROUP_AT(newcred->cr_group_info, 0) = g0;
      GROUP_AT(newcred->cr_group_info, 1) = g1;
+ #endif
  #else
      newcred->cr_groups[0] = g0;
      newcred->cr_groups[1] = g1;
***************
*** 3465,3470 ****
--- 3475,3482 ----
      } else if (!code) {
  	EXP_RELE(outexporter);
      }
+     if (!code) 
+ 	*com = (*com) | comp;
      return code;
  }
  #endif /* AFS_NEED_CLIENTCONTEXT */
Index: openafs/src/afs/AIX/osi_file.c
diff -c openafs/src/afs/AIX/osi_file.c:1.9.14.1 openafs/src/afs/AIX/osi_file.c:1.9.14.2
*** openafs/src/afs/AIX/osi_file.c:1.9.14.1	Thu Nov  9 18:30:52 2006
--- openafs/src/afs/AIX/osi_file.c	Wed Aug 15 23:52:33 2007
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/AIX/osi_file.c,v 1.9.14.1 2006/11/09 23:30:52 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.14.2 2007/08/16 03:52:33 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 30,36 ****
  {
      struct inode *ip;
      register struct osi_file *afile = NULL;
-     extern struct vfs *rootvfs;
      struct vnode *vp = NULL;
      extern int cacheDiskType;
      afs_int32 code = 0;
--- 30,35 ----
***************
*** 48,54 ****
      afile = (struct osi_file *)osi_AllocSmallSpace(sizeof(struct osi_file));
      setuerror(0);
      AFS_GUNLOCK();
!     ip = (struct inode *)igetinode((dev_t) cacheDev.dev, rootvfs,
  				   (ino_t) ainode, &vp, &dummy);
      AFS_GLOCK();
      if (getuerror()) {
--- 47,53 ----
      afile = (struct osi_file *)osi_AllocSmallSpace(sizeof(struct osi_file));
      setuerror(0);
      AFS_GUNLOCK();
!     ip = (struct inode *)igetinode((dev_t) cacheDev.dev, afs_cacheVfsp,
  				   (ino_t) ainode, &vp, &dummy);
      AFS_GLOCK();
      if (getuerror()) {
Index: openafs/src/afs/AIX/osi_inode.c
diff -c openafs/src/afs/AIX/osi_inode.c:1.10 openafs/src/afs/AIX/osi_inode.c:1.10.4.1
*** openafs/src/afs/AIX/osi_inode.c:1.10	Sat Oct 15 10:23:20 2005
--- openafs/src/afs/AIX/osi_inode.c	Wed Aug 15 23:52:33 2007
***************
*** 17,23 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/AIX/osi_inode.c,v 1.10 2005/10/15 14:23:20 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/AIX/osi_inode.c,v 1.10.4.1 2007/08/16 03:52:33 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 262,268 ****
      struct inode *ip, *newip, *pip;
      register int err, rval1, rc = 0;
      struct vnode *vp = NULL;
-     extern struct vfs *rootvfs;
      register struct vfs *vfsp;
      struct vfs *nvfsp = NULL;
      char error;
--- 262,267 ----
Index: openafs/src/afs/LINUX/osi_groups.c
diff -c openafs/src/afs/LINUX/osi_groups.c:1.28.4.7 openafs/src/afs/LINUX/osi_groups.c:1.28.4.8
*** openafs/src/afs/LINUX/osi_groups.c:1.28.4.7	Tue Mar 20 14:47:22 2007
--- openafs/src/afs/LINUX/osi_groups.c	Wed Aug 22 15:39:03 2007
***************
*** 20,30 ****
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_groups.c,v 1.28.4.7 2007/03/20 18:47:22 shadow Exp $");
  
  #include "afs/sysincludes.h"
  #include "afsincludes.h"
  #include "afs/afs_stats.h"	/* statistics */
  #ifdef AFS_LINUX22_ENV
  #include "h/smp_lock.h"
  #endif
--- 20,31 ----
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_groups.c,v 1.28.4.8 2007/08/22 19:39:03 shadow Exp $");
  
  #include "afs/sysincludes.h"
  #include "afsincludes.h"
  #include "afs/afs_stats.h"	/* statistics */
+ #include "afs/nfsclient.h"
  #ifdef AFS_LINUX22_ENV
  #include "h/smp_lock.h"
  #endif
***************
*** 330,337 ****
      code = __setpag(cr, pagvalue, newpag, change_parent);
  
  #ifdef LINUX_KEYRING_SUPPORT
!     if (code == 0) {
! 
  	(void) install_session_keyring(current, NULL);
  
  	if (current->signal->session_keyring) {
--- 331,337 ----
      code = __setpag(cr, pagvalue, newpag, change_parent);
  
  #ifdef LINUX_KEYRING_SUPPORT
!     if (code == 0 && (*cr)->cr_rgid != NFSXLATOR_CRED) {
  	(void) install_session_keyring(current, NULL);
  
  	if (current->signal->session_keyring) {
Index: openafs/src/afs/LINUX/osi_module.c
diff -c openafs/src/afs/LINUX/osi_module.c:1.74.2.7 openafs/src/afs/LINUX/osi_module.c:1.74.2.8
*** openafs/src/afs/LINUX/osi_module.c:1.74.2.7	Mon Jul  9 16:00:35 2007
--- openafs/src/afs/LINUX/osi_module.c	Tue Aug 21 22:17:52 2007
***************
*** 15,21 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_module.c,v 1.74.2.7 2007/07/09 20:00:35 shadow Exp $");
  
  #include <linux/module.h> /* early to avoid printf->printk mapping */
  #include "afs/sysincludes.h"
--- 15,21 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_module.c,v 1.74.2.8 2007/08/22 02:17:52 shadow Exp $");
  
  #include <linux/module.h> /* early to avoid printf->printk mapping */
  #include "afs/sysincludes.h"
***************
*** 94,104 ****
  	return err;
  #endif
      err = afs_init_inodecache();
!     if (err)
  	return err;
      err = register_filesystem(&afs_fs_type);
!     if (err)
!       return err;
  
      osi_sysctl_init();
  #ifdef LINUX_KEYRING_SUPPORT
--- 94,113 ----
  	return err;
  #endif
      err = afs_init_inodecache();
!     if (err) {
! #ifndef LINUX_KEYRING_SUPPORT
! 	osi_syscall_clean();
! #endif
  	return err;
+     }
      err = register_filesystem(&afs_fs_type);
!     if (err) {
! 	afs_destroy_inodecache();
! #ifndef LINUX_KEYRING_SUPPORT
! 	osi_syscall_clean();
! #endif
! 	return err;
!     }
  
      osi_sysctl_init();
  #ifdef LINUX_KEYRING_SUPPORT
***************
*** 120,128 ****
--- 129,141 ----
  cleanup_module(void)
  #endif
  {
+ #ifdef LINUX_KEYRING_SUPPORT
      osi_keyring_shutdown();
+ #endif
      osi_sysctl_clean();
+ #ifndef LINUX_KEYRING_SUPPORT
      osi_syscall_clean();
+ #endif
      unregister_filesystem(&afs_fs_type);
  
      afs_destroy_inodecache();
Index: openafs/src/afs/LINUX/osi_nfssrv.c
diff -c openafs/src/afs/LINUX/osi_nfssrv.c:1.1.2.4 openafs/src/afs/LINUX/osi_nfssrv.c:1.1.2.5
*** openafs/src/afs/LINUX/osi_nfssrv.c:1.1.2.4	Tue Jan  2 10:41:41 2007
--- openafs/src/afs/LINUX/osi_nfssrv.c	Tue Aug 21 17:28:45 2007
***************
*** 15,21 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_nfssrv.c,v 1.1.2.4 2007/01/02 15:41:41 shadow Exp $");
  
  #if !defined(AFS_NONFSTRANS) || defined(AFS_AIX_IAUTH_ENV)
  #include <linux/module.h> /* early to avoid printf->printk mapping */
--- 15,21 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_nfssrv.c,v 1.1.2.5 2007/08/21 21:28:45 shadow Exp $");
  
  #if !defined(AFS_NONFSTRANS) || defined(AFS_AIX_IAUTH_ENV)
  #include <linux/module.h> /* early to avoid printf->printk mapping */
***************
*** 27,33 ****
  #include <linux/sunrpc/svcauth.h>
  
  static unsigned long authtab_addr = 0;
! #if defined(module_param)
  module_param(authtab_addr, long, 0);
  #else
  MODULE_PARM(authtab_addr, "l");
--- 27,33 ----
  #include <linux/sunrpc/svcauth.h>
  
  static unsigned long authtab_addr = 0;
! #if defined(module_param) && LINUX_VERSION_CODE > KERNEL_VERSION(2,6,9)
  module_param(authtab_addr, long, 0);
  #else
  MODULE_PARM(authtab_addr, "l");
Index: openafs/src/afs/LINUX/osi_pag_module.c
diff -c openafs/src/afs/LINUX/osi_pag_module.c:1.1.2.6 openafs/src/afs/LINUX/osi_pag_module.c:1.1.2.7
*** openafs/src/afs/LINUX/osi_pag_module.c:1.1.2.6	Tue Jan  2 10:41:41 2007
--- openafs/src/afs/LINUX/osi_pag_module.c	Tue Aug 21 17:28:45 2007
***************
*** 15,21 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_pag_module.c,v 1.1.2.6 2007/01/02 15:41:41 shadow Exp $");
  
  #if !defined(AFS_NONFSTRANS) || defined(AFS_AIX_IAUTH_ENV)
  #include <linux/module.h> /* early to avoid printf->printk mapping */
--- 15,21 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_pag_module.c,v 1.1.2.7 2007/08/21 21:28:45 shadow Exp $");
  
  #if !defined(AFS_NONFSTRANS) || defined(AFS_AIX_IAUTH_ENV)
  #include <linux/module.h> /* early to avoid printf->printk mapping */
***************
*** 40,46 ****
  #endif
  
  static unsigned long nfs_server_addr = 0;
! #if defined(module_param)
  module_param(nfs_server_addr, long, 0);
  #else
  MODULE_PARM(nfs_server_addr,  "l");
--- 40,46 ----
  #endif
  
  static unsigned long nfs_server_addr = 0;
! #if defined(module_param) && LINUX_VERSION_CODE > KERNEL_VERSION(2,6,9)
  module_param(nfs_server_addr, long, 0);
  #else
  MODULE_PARM(nfs_server_addr,  "l");
Index: openafs/src/afs/LINUX/osi_probe.c
diff -c openafs/src/afs/LINUX/osi_probe.c:1.11.2.12 openafs/src/afs/LINUX/osi_probe.c:1.11.2.13
*** openafs/src/afs/LINUX/osi_probe.c:1.11.2.12	Tue Jul 17 08:16:45 2007
--- openafs/src/afs/LINUX/osi_probe.c	Tue Aug 21 17:28:45 2007
***************
*** 129,135 ****
  
  /* If this is set, we are more careful about avoiding duplicate matches */
  static int probe_carefully = 1;
! #ifdef module_param
  module_param(probe_carefully, int, 0);
  #else
  MODULE_PARM(probe_carefully, "i");
--- 129,135 ----
  
  /* If this is set, we are more careful about avoiding duplicate matches */
  static int probe_carefully = 1;
! #if defined(module_param) && LINUX_VERSION_CODE > KERNEL_VERSION(2,6,9)
  module_param(probe_carefully, int, 0);
  #else
  MODULE_PARM(probe_carefully, "i");
***************
*** 157,163 ****
   * 0x0080 - detail - check_table_readable
   */
  static int probe_debug = 0x41;
! #ifdef module_param
  module_param(probe_debug, int, 0);
  #else
  MODULE_PARM(probe_debug, "i");
--- 157,163 ----
   * 0x0080 - detail - check_table_readable
   */
  static int probe_debug = 0x41;
! #if defined(module_param) && LINUX_VERSION_CODE > KERNEL_VERSION(2,6,9)
  module_param(probe_debug, int, 0);
  #else
  MODULE_PARM(probe_debug, "i");
***************
*** 173,179 ****
  MODULE_PARM_DESC(probe_debug_addr, "Debug range starting locations");
  
  static unsigned long probe_debug_range = 0;
! #ifdef module_param
  module_param(probe_debug_range, long, 0);
  #else
  MODULE_PARM(probe_debug_range, "l");
--- 173,179 ----
  MODULE_PARM_DESC(probe_debug_addr, "Debug range starting locations");
  
  static unsigned long probe_debug_range = 0;
! #if defined(module_param) && LINUX_VERSION_CODE > KERNEL_VERSION(2,6,9)
  module_param(probe_debug_range, long, 0);
  #else
  MODULE_PARM(probe_debug_range, "l");
***************
*** 181,187 ****
  MODULE_PARM_DESC(probe_debug_range, "Debug range length");
  
  static unsigned long probe_debug_tag = 0;
! #ifdef module_param
  module_param(probe_debug_tag, long, 0);
  #else
  MODULE_PARM(probe_debug_tag, "l");
--- 181,187 ----
  MODULE_PARM_DESC(probe_debug_range, "Debug range length");
  
  static unsigned long probe_debug_tag = 0;
! #if defined(module_param) && LINUX_VERSION_CODE > KERNEL_VERSION(2,6,9)
  module_param(probe_debug_tag, long, 0);
  #else
  MODULE_PARM(probe_debug_tag, "l");
Index: openafs/src/config/NTMakefile.amd64_w2k
diff -c openafs/src/config/NTMakefile.amd64_w2k:1.24.2.26 openafs/src/config/NTMakefile.amd64_w2k:1.24.2.27
*** openafs/src/config/NTMakefile.amd64_w2k:1.24.2.26	Thu Aug  9 18:34:21 2007
--- openafs/src/config/NTMakefile.amd64_w2k	Thu Aug 23 13:15:19 2007
***************
*** 84,90 ****
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=5
! AFSPRODUCT_VER_PATCH=2200
  AFSPRODUCT_VER_BUILD=0
  
  AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
--- 84,90 ----
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=5
! AFSPRODUCT_VER_PATCH=2300
  AFSPRODUCT_VER_BUILD=0
  
  AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
Index: openafs/src/config/NTMakefile.i386_nt40
diff -c openafs/src/config/NTMakefile.i386_nt40:1.84.2.25 openafs/src/config/NTMakefile.i386_nt40:1.84.2.26
*** openafs/src/config/NTMakefile.i386_nt40:1.84.2.25	Thu Aug  9 18:34:21 2007
--- openafs/src/config/NTMakefile.i386_nt40	Thu Aug 23 13:15:19 2007
***************
*** 84,90 ****
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=5
! AFSPRODUCT_VER_PATCH=2200
  AFSPRODUCT_VER_BUILD=0
  
  AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
--- 84,90 ----
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=5
! AFSPRODUCT_VER_PATCH=2300
  AFSPRODUCT_VER_BUILD=0
  
  AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
Index: openafs/src/config/NTMakefile.i386_w2k
diff -c openafs/src/config/NTMakefile.i386_w2k:1.23.2.25 openafs/src/config/NTMakefile.i386_w2k:1.23.2.26
*** openafs/src/config/NTMakefile.i386_w2k:1.23.2.25	Thu Aug  9 18:34:21 2007
--- openafs/src/config/NTMakefile.i386_w2k	Thu Aug 23 13:15:19 2007
***************
*** 84,90 ****
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=5
! AFSPRODUCT_VER_PATCH=2200
  AFSPRODUCT_VER_BUILD=0
  
  AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
--- 84,90 ----
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=5
! AFSPRODUCT_VER_PATCH=2300
  AFSPRODUCT_VER_BUILD=0
  
  AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
Index: openafs/src/kauth/Makefile.in
diff -c openafs/src/kauth/Makefile.in:1.12.8.1 openafs/src/kauth/Makefile.in:1.12.8.2
*** openafs/src/kauth/Makefile.in:1.12.8.1	Mon Jul  3 15:07:15 2006
--- openafs/src/kauth/Makefile.in	Sun Aug 19 18:15:29 2007
***************
*** 52,58 ****
  KOBJS=kauth.xdr.o kauth.cs.o kaaux.o client.o authclient.o token.o kautils.o kalocalcell.o kaerrors.o user.krb.o krb_tf.o
  
  
! all: kaserver kas kpwvalid klog klog.krb knfs kpasswd rebuild kdb \
  	${TOP_LIBDIR}/libkauth.a \
  	${TOP_LIBDIR}/libkauth.krb.a \
  	depinstall
--- 52,58 ----
  KOBJS=kauth.xdr.o kauth.cs.o kaaux.o client.o authclient.o token.o kautils.o kalocalcell.o kaerrors.o user.krb.o krb_tf.o
  
  
! all: kaserver kas kpwvalid klog klog.krb knfs kpasswd rebuild kdb ka-forwarder \
  	${TOP_LIBDIR}/libkauth.a \
  	${TOP_LIBDIR}/libkauth.krb.a \
  	depinstall
***************
*** 200,205 ****
--- 200,208 ----
  krb_udp: krb_udp.o libkauth.a $(KLIBS)
  	${CC} ${LDFLAGS} -o krb_udp krb_udp.o libkauth.a $(KLIBS)
  
+ ka-forwarder: ka-forwarder.o
+ 	${CC} -o $@ ${CFLAGS} ka-forwarder.o ${LIBS} ${XLIBS}
+ 
  rebuild.o: rebuild.c $(INCLS) AFS_component_version_number.o
  
  rebuild: rebuild.o kautils.o $(LIBS)
***************
*** 240,245 ****
--- 243,249 ----
  	${DESTDIR}${libdir}/afs/libkauth.krb.a \
  	${DESTDIR}${afssrvsbindir}/kadb_check \
  	${DESTDIR}${afssrvsbindir}/kdb \
+ 	${DESTDIR}${afssrvsbindir}/ka-forwarder \
  	${DESTDIR}${includedir}/afs/kautils.h \
  	${DESTDIR}${includedir}/afs/kauth.h \
  	${DESTDIR}${includedir}/afs/kaport.h
***************
*** 292,297 ****
--- 296,304 ----
  ${DESTDIR}${afssrvsbindir}/kdb: kdb
  	${INSTALL} -s $? $@
  
+ ${DESTDIR}${afssrvsbindir}/ka-forwarder: ka-forwarder
+ 	${INSTALL} $? $@
+ 
  ${DESTDIR}${includedir}/afs/kautils.h: kautils.h
  	${INSTALL} $? $@
  
***************
*** 318,323 ****
--- 325,331 ----
  	${DEST}/lib/afs/libkauth.krb.a \
  	${DEST}/etc/kdb \
  	${DEST}/etc/kadb_check \
+ 	${DEST}/root.server/usr/afs/bin/ka-forwarder \
  	${DEST}/include/afs/kautils.h \
  	${DEST}/include/afs/kauth.h \
  	${DEST}/include/afs/kaport.h
***************
*** 355,360 ****
--- 363,371 ----
  ${DEST}/etc/kdb: kdb 
  	${INSTALL} -s $? $@
  
+ ${DEST}/root.server/usr/afs/bin/ka-forwarder: ka-forwarder
+ 	${INSTALL} $? $@
+ 
  ${DEST}/include/afs/kautils.h: kautils.h
  	${INSTALL} $? $@
  
Index: openafs/src/kauth/ka-forwarder.c
diff -c /dev/null openafs/src/kauth/ka-forwarder.c:1.2.2.2
*** /dev/null	Thu Aug 23 22:27:23 2007
--- openafs/src/kauth/ka-forwarder.c	Sun Aug 19 18:15:29 2007
***************
*** 0 ****
--- 1,294 ----
+ /*
+  * COPYRIGHT NOTICE
+  * Copyright (c) 1994 Carnegie Mellon University
+  * All Rights Reserved.
+  * 
+  * See <cmu_copyright.h> for use and distribution information.
+  */
+ 
+ /*
+  * HISTORY
+  * $Log: ka-forwarder.c,v $
+  * Revision 1.2.2.2  2007/08/19 22:15:29  rra
+  * DELTA DEVEL15-ka-forwarder-20060731
+  * AUTHOR rra@stanford.edu
+  *
+  * Add ka-forwarder.
+  *
+  * Revision 1.1  2006/07/31 17:34:26  rra
+  * DELTA ka-forwarder-20060731
+  * AUTHOR rra@stanford.edu
+  *
+  * Add ka-forwarder.
+  *
+  * Revision 1.1  1997/06/03 18:23:54  kenh
+  * .
+  *
+  * Revision 1.4  1996/08/09  01:00:21  jhutz
+  * 	When initializing the array of fakeka servers, remember to set
+  * 	the address family of each server; otherwise SunOS complains.
+  * 	[1996/08/09  00:58:46  jhutz]
+  *
+  * Revision 1.3  1996/08/09  00:17:19  jhutz
+  * 	Merged in changes from Chuck Silvers:
+  * 	- Support for more than one fakeka server
+  * 	- Support for specifying ports for each fakeka server separately from the
+  * 	  others, and from the port we listen on.
+  * 
+  * 	Plus a minor bug fix to Chuck's code.
+  * 	Basically, this version is designed to provide both reliability and
+  * 	load-balancing cheaply.  Basically, we forward packets to all of the
+  * 	fakeka servers in round-robin fashion.  So, if a client is losing on
+  * 	one server, its retry should go to a different one, if more than one
+  * 	is specified.
+  * 	[1996/08/03  02:13:36  jhutz]
+  * 
+  * Revision 1.2  1995/02/23  18:26:36  chs
+  * 	Created.
+  * 	[1995/02/23  18:26:03  chs]
+  * 
+  * $EndLog$
+  */
+ 
+ /*
+  * This program is intended to run on afs DB servers.
+  * Its function is to forward KA requests to a fakeka server
+  * running on an MIT kerberos server.
+  */
+ 
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <sys/ioctl.h>
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
+ #include <stdio.h>
+ #include <netdb.h>
+ #include <ctype.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <syslog.h>
+ #include <unistd.h>
+ 
+ #if	HAVE_GETOPT_H
+ #include <getopt.h>
+ #else
+ int getopt (int, char * const *, const char *);
+ int optind, opterr;
+ char *optarg;
+ #endif
+ 
+ #define BUFFER_SIZE 2048
+ 
+ 
+ char *prog;
+ 
+ int num_servers, cur_server;
+ struct sockaddr_in *servers;
+ 
+ 
+ void
+ perrorexit(str)
+ char *str;
+ {
+     perror(str);
+     exit(1);
+ }
+ 
+ 
+ void
+ setup_servers(argc, argv)
+ int argc;
+ char **argv;
+ {
+     int i;
+     u_int fwdaddr;
+     u_short fwdport;
+ 
+     num_servers = argc;
+ 
+     servers = malloc(sizeof(*servers) * num_servers);
+     if (servers == NULL)
+ 	perrorexit("malloc failed");
+ 
+     for (i = 0; i < num_servers; i++) {
+ 	char *host, *port;
+ 
+ 	fwdport = htons(7004);
+ 
+ 	host = argv[i];
+ 	port = strchr(host, '/');
+ 	if (port != NULL) {
+ 	    *port++ = 0;
+ 
+ 	    if (isdigit(port[0])) {
+ 		fwdport = htons(atoi(port));
+ 	    }
+ 	    else {
+ 		struct servent *srv = getservbyname(port, "udp");
+ 		if (!srv) {
+ 		    fprintf(stderr, "%s: unknown service %s\n", prog, port);
+ 		    exit(1);
+ 		}
+ 		fwdport = srv->s_port;
+ 	    }
+ 	}
+ 
+ 	if (isdigit(host[0])) {
+ 	    fwdaddr = inet_addr(host);
+ 	}
+ 	else {
+ 	    struct hostent *h = gethostbyname(host);
+ 	    if (!h) {
+ 		fprintf(stderr, "%s: unknown host %s\n", prog, host);
+ 		exit(1);
+ 	    }
+ 	    bcopy(h->h_addr, &fwdaddr, 4);
+ 	}
+ 
+ 	servers[i].sin_family = AF_INET;
+ 	servers[i].sin_addr.s_addr = fwdaddr;
+ 	servers[i].sin_port = fwdport;
+     }
+ }
+ 
+ 
+ int
+ setup_socket(port)
+ u_short port;
+ {
+     int s, rv;
+     struct sockaddr_in sin;
+ 
+     s = socket(AF_INET, SOCK_DGRAM, 0);
+     if (s < 0)
+ 	perrorexit("Couldn't create socket");
+ 
+     sin.sin_family = AF_INET;
+     sin.sin_addr.s_addr = 0;
+     sin.sin_port = htons(port);
+ 
+     rv = bind(s, (struct sockaddr *)&sin, sizeof(sin));
+     if (rv < 0)
+ 	perrorexit("Couldn't bind socket");
+ 
+     return s;
+ }
+ 
+ 
+ int
+ packet_is_reply(from)
+ struct sockaddr_in *from;
+ {
+     int i;
+ 
+     for (i = 0; i < num_servers; i++) {
+ 	struct sockaddr_in *sin = &servers[i];
+ 
+ 	if (from->sin_addr.s_addr == sin->sin_addr.s_addr &&
+ 	    from->sin_port == sin->sin_port)
+ 	{
+ 	    return 1;
+ 	}
+     }
+ 
+     return 0;
+ }
+ 
+ 
+ int
+ main(argc, argv)
+ int argc;
+ char **argv;
+ {
+     int c, s, rv;
+     u_short port;
+ 
+     if (argc < 2) {
+ 	fprintf(stderr,
+ 		"usage: %s [-p port] <host>[/port] [host/port ...]\n",
+ 		argv[0]);
+ 	exit(1);
+     }
+ 
+     prog = argv[0];
+     port = 7004;
+ 
+     while ((c = getopt(argc, argv, "p:")) != -1) {
+ 	switch (c) {
+ 	case 'p':
+ 	    port = atoi(optarg);
+ 	    break;
+ 	default:
+ 	    fprintf(stderr, "%s: invalid option '%c'\n", prog, c);
+ 	    exit(1);
+ 	}
+     }
+ 
+     /*
+      * hmm, different implementations of getopt seem to do different things
+      * when there aren't any options.  linux sets optind = 1, which I would
+      * call correct, but sunos sets optind = 0.  try to do the right thing.
+      */
+     if (optind == 0)
+ 	optind = 1;
+ 
+     setup_servers(argc - optind, argv + optind);
+     s = setup_socket(port);
+ 
+     openlog("ka-forwarder", LOG_PID, LOG_DAEMON);
+ 
+     for (;;) {
+ 	char buf[BUFFER_SIZE], *bufp, *sendptr;
+ 	struct sockaddr_in from, reply, *to;
+ 	int fromlen, sendlen;
+ 
+ 	bufp = buf + 8;
+ 	fromlen = sizeof(from);
+ 
+ 	rv = recvfrom(s, bufp, sizeof(buf) - 8,
+ 		      0, (struct sockaddr *)&from, &fromlen);
+ 	if (rv < 0) {
+ 	    syslog(LOG_ERR, "recvfrom: %m");
+ 	    sleep(1);
+ 	    continue;
+ 	}
+ 
+ 	if (packet_is_reply(&from)) {
+ 	    /* this is a reply, forward back to user */
+ 
+ 	    to = &reply;
+ 	    reply.sin_family = AF_INET;
+ 	    bcopy(bufp, &reply.sin_addr.s_addr, 4);
+ 	    bcopy(bufp + 4, &reply.sin_port, 2);
+ 	    sendptr = bufp + 8;
+ 	    sendlen = rv - 8;
+ 	}
+ 	else {
+ 	    /* this is a request, forward to server */
+ 
+ 	    cur_server = (cur_server + 1) % num_servers;
+ 	    to = &servers[cur_server];
+ 
+ 	    bcopy(&from.sin_addr.s_addr, bufp - 8, 4);
+ 	    bcopy(&from.sin_port, bufp - 4, 2);
+ 
+ 	    sendptr = bufp - 8;
+ 	    sendlen = rv + 8;
+ 	}
+ 
+ 	{
+ 	    char a1[16], a2[16];
+ 	    strcpy(a1, inet_ntoa(from.sin_addr));
+ 	    strcpy(a2, inet_ntoa(to->sin_addr));
+ 
+ 	    syslog(LOG_INFO, "forwarding %d bytes from %s/%d to %s/%d\n",
+ 		   sendlen, a1, htons(from.sin_port), a2, htons(to->sin_port));
+ 	}
+ 
+ 	rv = sendto(s, sendptr, sendlen,
+ 		    0, (struct sockaddr *)to, sizeof(*to));
+ 	if (rv < 0) {
+ 	    syslog(LOG_ERR, "sendto: %m");
+ 	}
+     }
+ }
Index: openafs/src/kauth/krb_tf.c
diff -c openafs/src/kauth/krb_tf.c:1.6.14.1 openafs/src/kauth/krb_tf.c:1.6.14.2
*** openafs/src/kauth/krb_tf.c:1.6.14.1	Thu Aug  9 10:58:23 2007
--- openafs/src/kauth/krb_tf.c	Mon Aug 20 13:27:51 2007
***************
*** 48,54 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/krb_tf.c,v 1.6.14.1 2007/08/09 14:58:23 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.14.2 2007/08/20 17:27:51 shadow Exp $");
  
  #ifdef HAVE_FCNTL_H
  #include <fcntl.h>
***************
*** 72,77 ****
--- 72,232 ----
  #include "kauth.h"
  #include "kautils.h"
  
+ #ifndef WORDS_BIGENDIAN
+ /* This was taken from jhutz's patch for heimdal krb4. It only
+  * applies to little endian systems. Big endian systems have a
+  * less elegant solution documented below.
+  *
+  * This record is written after every real ticket, to ensure that
+  * both 32- and 64-bit readers will perceive the next real ticket
+  * as starting in the same place.  This record looks like a ticket
+  * with the following properties:
+  *   Field         32-bit             64-bit
+  *   ============  =================  =================
+  *   sname         "."                "."
+  *   sinst         ""                 ""
+  *   srealm        ".."               ".."
+  *   session key   002E2E00 xxxxxxxx  xxxxxxxx 00000000
+  *   lifetime      0                  0
+  *   kvno          0                  12
+  *   ticket        12 nulls           4 nulls
+  *   issue         0                  0
+  */
+ static unsigned char align_rec[] = {
+     0x2e, 0x00, 0x00, 0x2e, 0x2e, 0x00, 0x00, 0x2e,
+     0x2e, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
+     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00,
+     0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
+     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+     0x00, 0x00
+ };
+ 
+ #else /* AFSLITTLE_ENDIAN */
+ 
+ /* This was taken from asedeno's patch for MIT Kerberos. These
+  * alignment records are for big endian systems. We need more of them
+  * because the portion of the 64-bit issue_date that overlaps with the
+  * start of a ticket on 32-bit systems contains an unpredictable
+  * number of NULL bytes. Preceeding these records is a second copy of
+  * the 32-bit issue_date. The srealm for the alignment records is
+  * always one of ".." or "?.."
+  */
+ 
+ /* No NULL bytes
+  * This is actually two alignment records since both 32- and 64-bit
+  * readers will agree on everything in the first record up through the
+  * issue_date size, except where sname starts.
+  *   Field (1)     32-bit             64-bit
+  *   ============  =================  =================
+  *   sname         "????."            "."
+  *   sinst         ""                 ""
+  *   srealm        ".."               ".."
+  *   session key   00000000 xxxxxxxx  00000000 xxxxxxxx
+  *   lifetime      0                  0
+  *   kvno          0                  0
+  *   ticket        4 nulls           4 nulls
+  *   issue         0                  0
+  *
+  *   Field (2)     32-bit             64-bit
+  *   ============  =================  =================
+  *   sname         "."                "."
+  *   sinst         ""                 ""
+  *   srealm        ".."               ".."
+  *   session key   002E2E00 xxxxxxxx  xxxxxxxx 00000000
+  *   lifetime      0                  0
+  *   kvno          0                  12
+  *   ticket        12 nulls           4 nulls
+  *   issue         0                  0
+  *
+  */
+ static unsigned char align_rec_0[] = {
+     0x2e, 0x00, 0x00, 0x2e, 0x2e, 0x00, 0x00, 0x00,
+     0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
+     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+     0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+     0x00, 0x00, 0x2e, 0x00, 0x00, 0x2e, 0x2e, 0x00,
+     0x00, 0x2e, 0x2e, 0x00, 0xff, 0xff, 0xff, 0xff,
+     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+     0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x04,
+     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+     0x00, 0x00, 0x00, 0x00
+ };
+ 
+ /* One NULL byte
+  *   Field         32-bit             64-bit
+  *   ============  =================  =================
+  *   sname         "x"  |"xx"|"xxx"   "."
+  *   sinst         "xx."|"x."|"."     ".."
+  *   srealm        ".."               "..."
+  *   session key   2E2E2E00 xxxxxxxx  xxxxxxxx 00000000
+  *   lifetime      0                  0
+  *   kvno          0                  12
+  *   ticket        12 nulls           4 nulls
+  *   issue         0                  0
+  */
+ static unsigned char align_rec_1[] = {
+     0x2e, 0x00, 0x2e, 0x2e, 0x00, 0x2e, 0x2e, 0x2e,
+     0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
+     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+     0x0c, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
+     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+     0x00
+ };
+ 
+ /* Two NULL bytes
+  *   Field         32-bit             64-bit
+  *   ============  =================  =================
+  *   sname         "x"  |"x" |"xx"    ".."
+  *   sinst         ""   |"x" |""      ""
+  *   srealm        "x.."|".."|".."    ".."
+  *   session key   002E2E00 xxxxxxxx  xxxxxxxx 00000000
+  *   lifetime      0                  0
+  *   kvno          0                  12
+  *   ticket        12 nulls           4 nulls
+  *   issue         0                  0
+  */
+  static unsigned char align_rec_2[] = {
+     0x2e, 0x2e, 0x00, 0x00, 0x2e, 0x2e, 0x00, 0xff,
+     0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
+     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00,
+     0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
+     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+ };
+ 
+ /* Three NULL bytes
+  * Things break here for 32-bit krb4 libraries that don't
+  * understand this alignment record. We can't really do
+  * anything about the fact that the three strings ended
+  * in the duplicate timestamp. The good news is that this
+  * only happens once every 0x1000000 seconds, once roughly
+  * every six and a half months. We'll live.
+  *
+  * Discussion on the krbdev list has suggested the
+  * issue_date be incremented by one in this case to avoid
+  * the problem. I'm leaving this here just in case.
+  *
+  *   Field         32-bit             64-bit
+  *   ============  =================  =================
+  *   sname         ""                 "."
+  *   sinst         ""                 ""
+  *   srealm        ""                 ".."
+  *   session key   2E00002E 2E00FFFF  xxxx0000 0000xxxx
+  *   lifetime      0                  0
+  *   kvno          4294901760         917504
+  *   ticket        14 nulls           4 nulls
+  *   issue         0                  0
+  */
+ /*
+ static unsigned char align_rec_3[] = {
+     0x2e, 0x00, 0x00, 0x2e, 0x2e, 0x00, 0xff, 0xff,
+     0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
+     0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00,
+     0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+     0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+ };
+ */
+ #endif /* AFSLITTLE_ENDIAN */
+ 
  afs_int32
  krb_write_ticket_file(realm)
       char *realm;
***************
*** 84,90 ****
      char *tf_name;
      struct ktc_principal client, server;
      struct ktc_token token;
-     long mit_compat;	/* MIT Kerberos 5 with Krb4 uses a "long" for issue_date */
  
      if ((strlen(realm) >= sizeof(client.cell)))
  	return KABADNAME;
--- 239,244 ----
***************
*** 150,162 ****
      if (write(fd, (char *)(token.ticket), count) != count)
  	goto bad;
      /* Issue date */
!     mit_compat = token.startTime;
!     if (write(fd, (char *)&mit_compat, sizeof(mit_compat))
! 	!= sizeof(mit_compat))
  	goto bad;
      close(fd);
      return 0;
  
    bad:
      close(fd);
      return -1;
--- 304,376 ----
      if (write(fd, (char *)(token.ticket), count) != count)
  	goto bad;
      /* Issue date */
!     if (write(fd, (char *)&(token.startTime), sizeof(afs_int32))
! 	!= sizeof(afs_int32))
  	goto bad;
      close(fd);
      return 0;
  
+     /* Alignment Record, from MIT Kerberos */
+ #ifndef WORDS_BIGENDIAN
+     if (write(fd, align_rec, sizeof(align_rec)) != sizeof(align_rec))
+ 	goto bad;
+ #else /* AFSLITTLE_ENDIAN */
+     {
+ 	int null_bytes = 0;
+ 	if (0 == (token.startTime & 0xff000000))
+ 	    ++null_bytes;
+ 	if (0 == (token.startTime & 0x00ff0000))
+ 	    ++null_bytes;
+ 	if (0 == (token.startTime & 0x0000ff00))
+ 	    ++null_bytes;
+ 	if (0 == (token.startTime & 0x000000ff))
+ 	    ++null_bytes;
+ 
+ 	switch(null_bytes) {
+ 	case 0:
+ 	     /* Issue date */
+ 	    if (write(fd, (char *) token.startTime, sizeof(afs_int32))
+ 		!= sizeof(afs_int32))
+ 		goto bad;
+ 	    if (write(fd, align_rec_0, sizeof(align_rec_0))
+ 		!= sizeof(align_rec_0))
+ 		goto bad;
+ 	    break;
+ 
+ 	case 1:
+ 	    /* Issue date */
+ 	    if (write(fd, (char *) &token.startTime, sizeof(afs_int32))
+ 		!= sizeof(afs_int32))
+ 		goto bad;
+ 	    if (write(fd, align_rec_1, sizeof(align_rec_1))
+ 		!= sizeof(align_rec_1))
+ 		goto bad;
+ 	    break;
+ 
+ 	case 3:
+ 	    /* Three NULLS are troublesome but rare. We'll just pretend
+ 	     * they don't exist by decrementing the token.startTime.
+ 	     */
+ 	    --token.startTime;
+ 	case 2:
+ 	    /* Issue date */
+ 	    if (write(fd, (char *) &token.startTime, sizeof(afs_int32))
+ 		!= sizeof(afs_int32))
+ 		goto bad;
+ 	    if (write(fd, align_rec_2, sizeof(align_rec_2))
+ 		!= sizeof(align_rec_2))
+ 		goto bad;
+ 	    break;
+ 
+ 	default:
+ 	     goto bad;
+ 	}
+     }
+ #endif  /* AFSLITTLE_ENDIAN */
+     close(fd);
+     return 0;
+       
+     
    bad:
      close(fd);
      return -1;
Index: openafs/src/libafs/afs.ppc_darwin_70.plist.in
diff -c openafs/src/libafs/afs.ppc_darwin_70.plist.in:1.2.10.18 openafs/src/libafs/afs.ppc_darwin_70.plist.in:1.2.10.19
*** openafs/src/libafs/afs.ppc_darwin_70.plist.in:1.2.10.18	Thu Aug  9 23:26:55 2007
--- openafs/src/libafs/afs.ppc_darwin_70.plist.in	Thu Aug 23 14:56:24 2007
***************
*** 15,25 ****
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.5.22</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.5.22</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kernel.bsd</key>
--- 15,25 ----
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.5.23</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.5.23</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kernel.bsd</key>
Index: openafs/src/libafs/afs.ppc_darwin_80.plist.in
diff -c openafs/src/libafs/afs.ppc_darwin_80.plist.in:1.2.4.18 openafs/src/libafs/afs.ppc_darwin_80.plist.in:1.2.4.19
*** openafs/src/libafs/afs.ppc_darwin_80.plist.in:1.2.4.18	Thu Aug  9 23:26:55 2007
--- openafs/src/libafs/afs.ppc_darwin_80.plist.in	Thu Aug 23 14:56:24 2007
***************
*** 15,25 ****
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.5.22</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.5.22</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kpi.bsd</key>
--- 15,25 ----
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.5.23</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.5.23</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kpi.bsd</key>
Index: openafs/src/libafs/afs.ppc_darwin_90.plist.in
diff -c openafs/src/libafs/afs.ppc_darwin_90.plist.in:1.1.6.18 openafs/src/libafs/afs.ppc_darwin_90.plist.in:1.1.6.19
*** openafs/src/libafs/afs.ppc_darwin_90.plist.in:1.1.6.18	Thu Aug  9 23:26:55 2007
--- openafs/src/libafs/afs.ppc_darwin_90.plist.in	Thu Aug 23 14:56:24 2007
***************
*** 15,25 ****
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.5.22</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.5.22</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kpi.bsd</key>
--- 15,25 ----
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.5.23</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.5.23</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kpi.bsd</key>
Index: openafs/src/libafs/afs.x86_darwin_80.plist.in
diff -c openafs/src/libafs/afs.x86_darwin_80.plist.in:1.1.6.18 openafs/src/libafs/afs.x86_darwin_80.plist.in:1.1.6.19
*** openafs/src/libafs/afs.x86_darwin_80.plist.in:1.1.6.18	Thu Aug  9 23:26:55 2007
--- openafs/src/libafs/afs.x86_darwin_80.plist.in	Thu Aug 23 14:56:24 2007
***************
*** 15,25 ****
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.5.22</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.5.22</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kpi.bsd</key>
--- 15,25 ----
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.5.23</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.5.23</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kpi.bsd</key>
Index: openafs/src/libafs/afs.x86_darwin_90.plist.in
diff -c openafs/src/libafs/afs.x86_darwin_90.plist.in:1.1.6.18 openafs/src/libafs/afs.x86_darwin_90.plist.in:1.1.6.19
*** openafs/src/libafs/afs.x86_darwin_90.plist.in:1.1.6.18	Thu Aug  9 23:26:55 2007
--- openafs/src/libafs/afs.x86_darwin_90.plist.in	Thu Aug 23 14:56:24 2007
***************
*** 15,25 ****
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.5.22</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.5.22</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kpi.bsd</key>
--- 15,25 ----
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.5.23</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.5.23</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kpi.bsd</key>
Index: openafs/src/log/Makefile.in
diff -c openafs/src/log/Makefile.in:1.7 openafs/src/log/Makefile.in:1.7.14.1
*** openafs/src/log/Makefile.in:1.7	Sat Jan 11 02:34:43 2003
--- openafs/src/log/Makefile.in	Sun Aug 19 18:30:38 2007
***************
*** 8,14 ****
  srcdir=@srcdir@
  include @TOP_OBJDIR@/src/config/Makefile.config
  
! PROGRAMS=	unlog tokens tokens.krb kseal
  
  INCLS=${TOP_INCDIR}/afs/auth.h ${TOP_INCDIR}/rx/rx.h \
  ${TOP_INCDIR}/rx/xdr.h ${TOP_INCDIR}/des.h ${TOP_INCDIR}/rx/rxkad.h \
--- 8,14 ----
  srcdir=@srcdir@
  include @TOP_OBJDIR@/src/config/Makefile.config
  
! PROGRAMS=	unlog tokens tokens.krb
  
  INCLS=${TOP_INCDIR}/afs/auth.h ${TOP_INCDIR}/rx/rx.h \
  ${TOP_INCDIR}/rx/xdr.h ${TOP_INCDIR}/des.h ${TOP_INCDIR}/rx/rxkad.h \
***************
*** 32,38 ****
  #
  # Main targets
  #
! all: unlog tokens tokens.krb kseal
  
  #
  # Build targets
--- 32,38 ----
  #
  # Main targets
  #
! all: unlog tokens tokens.krb
  
  #
  # Build targets
***************
*** 67,74 ****
  	${DESTDIR}${bindir}/tokens \
  	${DESTDIR}${bindir}/tokens.krb \
  	${DESTDIR}${afssrvbindir}/tokens \
! 	${DESTDIR}${afssrvbindir}/tokens.krb \
! 	${DESTDIR}${sbindir}/kseal
  
  ${DEST}/bin/unlog: unlog
  	${INSTALL} $? $@
--- 67,73 ----
  	${DESTDIR}${bindir}/tokens \
  	${DESTDIR}${bindir}/tokens.krb \
  	${DESTDIR}${afssrvbindir}/tokens \
! 	${DESTDIR}${afssrvbindir}/tokens.krb
  
  ${DEST}/bin/unlog: unlog
  	${INSTALL} $? $@
***************
*** 122,127 ****
  	${DEST}/bin/tokens \
  	${DEST}/bin/tokens.krb \
  	${DEST}/root.server/usr/afs/bin/tokens \
! 	${DEST}/root.server/usr/afs/bin/tokens.krb \
! 	${DEST}/etc/kseal
  
--- 121,125 ----
  	${DEST}/bin/tokens \
  	${DEST}/bin/tokens.krb \
  	${DEST}/root.server/usr/afs/bin/tokens \
! 	${DEST}/root.server/usr/afs/bin/tokens.krb
  
Index: openafs/src/packaging/MacOS/OpenAFS.Info.plist
diff -c openafs/src/packaging/MacOS/OpenAFS.Info.plist:1.2.10.19 openafs/src/packaging/MacOS/OpenAFS.Info.plist:1.2.10.20
*** openafs/src/packaging/MacOS/OpenAFS.Info.plist:1.2.10.19	Thu Aug  9 23:26:56 2007
--- openafs/src/packaging/MacOS/OpenAFS.Info.plist	Thu Aug 23 14:56:25 2007
***************
*** 3,15 ****
  <plist version="1.0">
  <dict>
  	<key>CFBundleGetInfoString</key>
! 	<string>OpenAFS 1.5.22</string>
  	<key>CFBundleIdentifier</key>
  	<string>org.openafs.OpenAFS.pkg</string>
  	<key>CFBundleName</key>
  	<string>OpenAFS</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.5.22</string>
  	<key>IFMajorVersion</key>
  	<integer>1</integer>
  	<key>IFMinorVersion</key>
--- 3,15 ----
  <plist version="1.0">
  <dict>
  	<key>CFBundleGetInfoString</key>
! 	<string>OpenAFS 1.5.23</string>
  	<key>CFBundleIdentifier</key>
  	<string>org.openafs.OpenAFS.pkg</string>
  	<key>CFBundleName</key>
  	<string>OpenAFS</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.5.23</string>
  	<key>IFMajorVersion</key>
  	<integer>1</integer>
  	<key>IFMinorVersion</key>
Index: openafs/src/packaging/MacOS/OpenAFS.info
diff -c openafs/src/packaging/MacOS/OpenAFS.info:1.1.12.18 openafs/src/packaging/MacOS/OpenAFS.info:1.1.12.19
*** openafs/src/packaging/MacOS/OpenAFS.info:1.1.12.18	Thu Aug  9 23:26:56 2007
--- openafs/src/packaging/MacOS/OpenAFS.info	Thu Aug 23 14:56:25 2007
***************
*** 1,5 ****
  Title OpenAFS
! Version 1.5.22
  Description The OpenAFS distributed filesystem. This package installs an almost-ready-to-run client for OpenAFS. see http://www.openafs.org for more information.
  DefaultLocation /
  Diskname (null)
--- 1,5 ----
  Title OpenAFS
! Version 1.5.23
  Description The OpenAFS distributed filesystem. This package installs an almost-ready-to-run client for OpenAFS. see http://www.openafs.org for more information.
  DefaultLocation /
  Diskname (null)
Index: openafs/src/ptserver/NTMakefile
diff -c openafs/src/ptserver/NTMakefile:1.14.4.1 openafs/src/ptserver/NTMakefile:1.14.4.2
*** openafs/src/ptserver/NTMakefile:1.14.4.1	Tue Jul  4 02:28:25 2006
--- openafs/src/ptserver/NTMakefile	Sat Aug 11 19:41:37 2007
***************
*** 10,16 ****
  RELDIR=ptserver
  !INCLUDE ..\config\NTMakefile.$(SYS_NAME)
  !include ..\config\NTMakefile.version
! AFSDEV_AUXCDEFINES = -DAFS_USE_GETTIMEOFDAY
  
  ############################################################################
  # Definitions for installing header files
--- 10,16 ----
  RELDIR=ptserver
  !INCLUDE ..\config\NTMakefile.$(SYS_NAME)
  !include ..\config\NTMakefile.version
! AFSDEV_AUXCDEFINES = -DAFS_USE_GETTIMEOFDAY -DSUPERGROUPS
  
  ############################################################################
  # Definitions for installing header files
***************
*** 52,57 ****
--- 52,58 ----
  	$(OUT)\ptutils.obj \
  	$(OUT)\ptprocs.obj \
  	$(OUT)\utils.obj \
+         $(OUT)\map.obj \
  	$(OUT)\ptserver.res
  
  
Index: openafs/src/ptserver/db_verify.c
diff -c openafs/src/ptserver/db_verify.c:1.16.14.2 openafs/src/ptserver/db_verify.c:1.16.14.3
*** openafs/src/ptserver/db_verify.c:1.16.14.2	Wed May 16 15:44:12 2007
--- openafs/src/ptserver/db_verify.c	Sat Aug 11 19:41:37 2007
***************
*** 12,18 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/db_verify.c,v 1.16.14.2 2007/05/16 19:44:12 shadow 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.14.3 2007/08/11 23:41:37 jaltman Exp $");
  
  /*
   *                      (3) Define a structure, idused, instead of an
***************
*** 1516,1522 ****
  zeromap(struct idused *idmap)
  {
      while (idmap) {
! 	bzero((char *)idmap->idcount, sizeof idmap->idcount);
  	idmap = idmap->idnext;
      }
  }
--- 1516,1522 ----
  zeromap(struct idused *idmap)
  {
      while (idmap) {
! 	memset((char *)idmap->idcount, 0, sizeof idmap->idcount);
  	idmap = idmap->idnext;
      }
  }
***************
*** 1541,1547 ****
  	    perror("idmap");
  	    exit(1);
  	}
! 	bzero((char *)idmap, sizeof idmap);
  	idmap->idstart = id & ~(IDCOUNT - 1);
  	idmap->idnext = *idmapp;
  	*idmapp = idmap;
--- 1541,1547 ----
  	    perror("idmap");
  	    exit(1);
  	}
! 	memset((char *)idmap, 0, sizeof idmap);
  	idmap->idstart = id & ~(IDCOUNT - 1);
  	idmap->idnext = *idmapp;
  	*idmapp = idmap;
Index: openafs/src/ptserver/map.c
diff -c openafs/src/ptserver/map.c:1.3.14.1 openafs/src/ptserver/map.c:1.3.14.2
*** openafs/src/ptserver/map.c:1.3.14.1	Wed May 16 15:44:12 2007
--- openafs/src/ptserver/map.c	Sat Aug 11 19:41:37 2007
***************
*** 32,43 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/map.c,v 1.3.14.1 2007/05/16 19:44:12 shadow Exp $");
  
  #ifdef SUPERGROUPS
  #include <errno.h>
  #include "map.h"
! char *malloc();
  
  #undef PRINT_MAP_ERROR
  /* #define MAP_DEBUG /**/
--- 32,43 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/map.c,v 1.3.14.2 2007/08/11 23:41:37 jaltman Exp $");
  
  #ifdef SUPERGROUPS
  #include <errno.h>
  #include "map.h"
! #include "malloc.h"
  
  #undef PRINT_MAP_ERROR
  /* #define MAP_DEBUG /**/
Index: openafs/src/ptserver/ptclient.c
diff -c openafs/src/ptserver/ptclient.c:1.12.14.3 openafs/src/ptserver/ptclient.c:1.12.14.4
*** openafs/src/ptserver/ptclient.c:1.12.14.3	Tue Apr 10 14:39:54 2007
--- openafs/src/ptserver/ptclient.c	Sat Aug 11 19:41:37 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/ptclient.c,v 1.12.14.3 2007/04/10 18:39:54 shadow Exp $");
  
  #ifdef	AFS_AIX32_ENV
  #include <signal.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/ptclient.c,v 1.12.14.4 2007/08/11 23:41:37 jaltman Exp $");
  
  #ifdef	AFS_AIX32_ENV
  #include <signal.h>
***************
*** 648,654 ****
  	else if (!strcmp(op, "fih")) {
  	    char tname[128];
  	    struct PrUpdateEntry uentry;
! 	    bzero(&uentry, sizeof(uentry));
  	    /* scanf("%s",name); */
  	    if (GetString(name, sizeof(name))) {
  		code = PRBADARG;
--- 648,654 ----
  	else if (!strcmp(op, "fih")) {
  	    char tname[128];
  	    struct PrUpdateEntry uentry;
! 	    memset(&uentry, 0, sizeof(uentry));
  	    /* scanf("%s",name); */
  	    if (GetString(name, sizeof(name))) {
  		code = PRBADARG;
***************
*** 675,681 ****
  	} else if (!strcmp(op, "fnh")) {
  	    int tid;
  	    struct PrUpdateEntry uentry;
! 	    bzero(&uentry, sizeof(uentry));
  	    /* scanf("%d", &id); */
  	    if (GetInt32(&id)) {
  		code = PRBADARG;
--- 675,681 ----
  	} else if (!strcmp(op, "fnh")) {
  	    int tid;
  	    struct PrUpdateEntry uentry;
! 	    memset(&uentry, 0, sizeof(uentry));
  	    /* scanf("%d", &id); */
  	    if (GetInt32(&id)) {
  		code = PRBADARG;
Index: openafs/src/ptserver/pts.c
diff -c openafs/src/ptserver/pts.c:1.15.2.1 openafs/src/ptserver/pts.c:1.15.2.2
*** openafs/src/ptserver/pts.c:1.15.2.1	Tue Apr 10 14:39:54 2007
--- openafs/src/ptserver/pts.c	Sat Aug 11 19:41:37 2007
***************
*** 7,29 ****
   * directory or online at http://www.openafs.org/dl/license10.html
   */
  
- /*
-  *                      (3) add new pts commands:
-  *
-  *                          Interactive - allow the pts command
-  *                                        to be run interactively.
-  *                          Quit        - quit interactive mode.
-  *                          Source      - allow input to come from a file(s).
-  *                          Sleep       - pause for a specified number
-  *                                        of seconds.
-  *
-  */
- 
  #include <afsconfig.h>
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/pts.c,v 1.15.2.1 2007/04/10 18:39:54 shadow Exp $");
  
  #include <stdio.h>
  #include <string.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/ptserver/pts.c,v 1.15.2.2 2007/08/11 23:41:37 jaltman Exp $");
  
  #include <stdio.h>
  #include <string.h>
***************
*** 53,69 ****
  char *whoami;
  int force = 0;
  
- #if defined(SUPERGROUPS)
- 
- /*
-  *  Add new pts commands:
-  *
-  *      Interactive - allow the pts command to be run interactively.
-  *      Quit        - quit interactive mode.
-  *      Source      - allow input to come from a file(s).
-  *      Sleep       - pause for a specified number of seconds.
-  */
- 
  static int finished;
  static FILE *source;
  extern struct ubik_client *pruclient;
--- 41,46 ----
***************
*** 74,94 ****
  } *shead;
  
  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
! Source(struct cmd_syndesc *as, char *arock)
  {
      FILE *fd;
      struct sourcestack *sp;
--- 51,71 ----
  } *shead;
  
  int
! pts_Interactive(struct cmd_syndesc *as, char *arock)
  {
      finished = 0;
      return 0;
  }
  
  int
! pts_Quit(struct cmd_syndesc *as, char *arock)
  {
      finished = 1;
      return 0;
  }
  
  int
! pts_Source(struct cmd_syndesc *as, char *arock)
  {
      FILE *fd;
      struct sourcestack *sp;
***************
*** 116,122 ****
  }
  
  int
! Sleep(struct cmd_syndesc *as, char *arock)
  {
      int delay;
      if (!as->parms[0].items) {
--- 93,99 ----
  }
  
  int
! pts_Sleep(struct cmd_syndesc *as, char *arock)
  {
      int delay;
      if (!as->parms[0].items) {
***************
*** 125,130 ****
--- 102,108 ----
      }
      delay = atoi(as->parms[0].items->data);
      IOMGR_Sleep(delay);
+     return 0;
  }
  
  int
***************
*** 141,148 ****
      return 1;
  }
  
- #endif /* SUPERGROUPS */
- 
  int
  osi_audit()
  {
--- 119,124 ----
***************
*** 188,194 ****
  int
  CleanUp(struct cmd_syndesc *as, char *arock)
  {
- #if defined(SUPERGROUPS)
      if (as && !strcmp(as->name, "help"))
  	return 0;
      if (pruclient) {
--- 164,169 ----
***************
*** 196,209 ****
  	pr_End();
  	rx_Finalize();
      }
- #else
-     if (!strcmp(as->name, "help"))
- 	return 0;
-     /* Need to shutdown the ubik_client & other connections */
-     pr_End();
-     rx_Finalize();
- #endif /* SUPERGROUPS */
- 
      return 0;
  }
  
--- 171,176 ----
***************
*** 237,248 ****
  			id);
  		return code;
  	    }
! #if defined(SUPERGROUPS)
! 	    if (id == 0) {
  		printf("0 isn't a valid user id; aborting\n");
  		return EINVAL;
  	    }
! #endif
  	    idi = idi->next;
  	} else
  	    id = 0;
--- 204,215 ----
  			id);
  		return code;
  	    }
! 	    
!             if (id == 0) {
  		printf("0 isn't a valid user id; aborting\n");
  		return EINVAL;
  	    }
! 
  	    idi = idi->next;
  	} else
  	    id = 0;
***************
*** 1023,1035 ****
  {
      register afs_int32 code;
      register struct cmd_syndesc *ts;
! #if defined(SUPERGROUPS)
      char line[2048];
      char *cp, *lastp;
      int parsec;
      char *parsev[CMD_MAXPARMS];
      char *savec;
! #endif
  #ifdef WIN32
      WSADATA WSAjunk;
  #endif
--- 990,1002 ----
  {
      register afs_int32 code;
      register struct cmd_syndesc *ts;
! 
      char line[2048];
      char *cp, *lastp;
      int parsec;
      char *parsev[CMD_MAXPARMS];
      char *savec;
! 
  #ifdef WIN32
      WSADATA WSAjunk;
  #endif
***************
*** 1138,1172 ****
      cmd_AddParm(ts, "-groups", CMD_FLAG, CMD_OPTIONAL, "list group entries");
      add_std_args(ts);
  
! #if defined(SUPERGROUPS)
! 
!     ts = cmd_CreateSyntax("interactive", Interactive, 0,
  			  "enter interactive mode");
      add_std_args(ts);
      cmd_CreateAlias(ts, "in");
  
!     ts = cmd_CreateSyntax("quit", Quit, 0, "exit program");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("source", Source, 0, "read commands from file");
      cmd_AddParm(ts, "-file", CMD_SINGLE, 0, "filename");
      add_std_args(ts);
  
!     ts = cmd_CreateSyntax("sleep", Sleep, 0, "pause for a bit");
      cmd_AddParm(ts, "-delay", CMD_SINGLE, 0, "seconds");
      add_std_args(ts);
  
- #endif /* SUPERGROUPS */
- 
      cmd_SetBeforeProc(GetGlobals, 0);
  
- #if defined(SUPERGROUPS)
      finished = 1;
      if (code = cmd_Dispatch(argc, argv)) {
  	CleanUp(NULL, NULL);
  	exit(1);
      }
-     source = stdin;
      while (!finished) {
  	if (isatty(fileno(source)))
  	    fprintf(stderr, "pts> ");
--- 1105,1134 ----
      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;
+     source = stdin;
      if (code = cmd_Dispatch(argc, argv)) {
  	CleanUp(NULL, NULL);
  	exit(1);
      }
      while (!finished) {
  	if (isatty(fileno(source)))
  	    fprintf(stderr, "pts> ");
***************
*** 1200,1210 ****
      }
      CleanUp(NULL, NULL);
      exit(0);
- 
- #else /* SUPERGROUPS */
- 
-     cmd_SetAfterProc(CleanUp, 0);
-     code = cmd_Dispatch(argc, argv);
-     exit(code != 0);
- #endif /* SUPERGROUPS */
  }
--- 1162,1165 ----
Index: openafs/src/ptserver/ptutils.c
diff -c openafs/src/ptserver/ptutils.c:1.19.6.2 openafs/src/ptserver/ptutils.c:1.19.6.3
*** openafs/src/ptserver/ptutils.c:1.19.6.2	Wed May 16 15:55:49 2007
--- openafs/src/ptserver/ptutils.c	Sat Aug 11 19:41:37 2007
***************
*** 24,30 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/ptutils.c,v 1.19.6.2 2007/05/16 19:55:49 shadow 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.19.6.3 2007/08/11 23:41:37 jaltman Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 848,854 ****
  	}			/* for all coentry slots */
  	hloc = nptr;
  	nptr = centry.next;
! 	bcopy((char *)&centry, (char *)&hentry, sizeof(centry));
      }				/* while there are coentries */
      return PRNOENT;
  }
--- 848,854 ----
  	}			/* for all coentry slots */
  	hloc = nptr;
  	nptr = centry.next;
! 	memcpy((char *)&centry, (char *)&hentry, sizeof(centry));
      }				/* while there are coentries */
      return PRNOENT;
  }
Index: openafs/src/ptserver/testpt.c
diff -c openafs/src/ptserver/testpt.c:1.14.14.1 openafs/src/ptserver/testpt.c:1.14.14.2
*** openafs/src/ptserver/testpt.c:1.14.14.1	Tue Apr 10 14:39:54 2007
--- openafs/src/ptserver/testpt.c	Sat Aug 11 19:41:37 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/testpt.c,v 1.14.14.1 2007/04/10 18:39:54 shadow Exp $");
  
  #include <ctype.h>
  #include <errno.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/testpt.c,v 1.14.14.2 2007/08/11 23:41:37 jaltman Exp $");
  
  #include <ctype.h>
  #include <errno.h>
***************
*** 308,321 ****
      }
  
      sprintf(name, "%s:%s%d", ownerName, createPrefix, g);
!     code = ubik_Call(PR_NewEntry, pruclient, 0, name, PRGRP, owner, &id);
      if (code) {
  	if (code == PREXIST) {
  	    code = pr_Delete(name);
  	    if (code == 0) {
  		nGDels++;
  		code =
! 		    ubik_Call(PR_NewEntry, pruclient, 0, name, PRGRP, owner,
  			      &id);
  		if (code == 0) {
  		    if (verbose)
--- 308,321 ----
      }
  
      sprintf(name, "%s:%s%d", ownerName, createPrefix, g);
!     code = ubik_PR_NewEntry(pruclient, 0, name, PRGRP, owner, &id);
      if (code) {
  	if (code == PREXIST) {
  	    code = pr_Delete(name);
  	    if (code == 0) {
  		nGDels++;
  		code =
! 		    ubik_PR_NewEntry(pruclient, 0, name, PRGRP, owner,
  			      &id);
  		if (code == 0) {
  		    if (verbose)
***************
*** 351,357 ****
      for (j = 0; j < number; j++) {	/* find an undeleted id */
  	m = (k + j) % number;
  	if (id = list[m]) {
! 	    code = ubik_Call(PR_Delete, pruclient, 0, id);
  	    if (code) {
  		afs_com_err(whoami, code, "Couldn't delete %di", id);
  		exit(22);
--- 351,357 ----
      for (j = 0; j < number; j++) {	/* find an undeleted id */
  	m = (k + j) % number;
  	if (id = list[m]) {
! 	    code = ubik_PR_Delete(pruclient, 0, id);
  	    if (code) {
  		afs_com_err(whoami, code, "Couldn't delete %di", id);
  		exit(22);
***************
*** 379,385 ****
  	CreateGroup(g);
      ui = users[u];
      gi = groups[g];
!     code = ubik_Call(PR_AddToGroup, pruclient, 0, ui, gi);
      if (code) {
  	afs_com_err(whoami, code, "couldn't add %d to %d", ui, gi);
  	exit(14);
--- 379,385 ----
  	CreateGroup(g);
      ui = users[u];
      gi = groups[g];
!     code = ubik_PR_AddToGroup(pruclient, 0, ui, gi);
      if (code) {
  	afs_com_err(whoami, code, "couldn't add %d to %d", ui, gi);
  	exit(14);
***************
*** 398,404 ****
  
      ui = users[u];
      gi = groups[g];
!     code = ubik_Call(PR_RemoveFromGroup, pruclient, 0, ui, gi);
      if (code) {
  	afs_com_err(whoami, code, "couldn't remove %d from %d", ui, gi);
  	exit(14);
--- 398,404 ----
  
      ui = users[u];
      gi = groups[g];
!     code = ubik_PR_RemoveFromGroup(pruclient, 0, ui, gi);
      if (code) {
  	afs_com_err(whoami, code, "couldn't remove %d from %d", ui, gi);
  	exit(14);
***************
*** 656,662 ****
  		}
  #define GETOWNED(xlist,xid) \
    (xlist).prlist_val = 0; (xlist).prlist_len = 0; \
!   code = ubik_Call (PR_ListOwned, pruclient, 0, (xid), &(xlist), &over); \
    if (code) { \
        afs_com_err (whoami, code, "getting owner list of (%di)", (xid)); \
        exit (23); } \
--- 656,662 ----
  		}
  #define GETOWNED(xlist,xid) \
    (xlist).prlist_val = 0; (xlist).prlist_len = 0; \
!   code = ubik_PR_ListOwned(pruclient, 0, (xid), &(xlist), &over); \
    if (code) { \
        afs_com_err (whoami, code, "getting owner list of (%di)", (xid)); \
        exit (23); } \
Index: openafs/src/tviced/NTMakefile
diff -c openafs/src/tviced/NTMakefile:1.10.2.1 openafs/src/tviced/NTMakefile:1.10.2.2
*** openafs/src/tviced/NTMakefile:1.10.2.1	Tue Jul  4 02:28:26 2006
--- openafs/src/tviced/NTMakefile	Mon Aug 20 13:39:08 2007
***************
*** 5,11 ****
  # License.  For details, see the LICENSE file in the top-level source
  # directory or online at http://www.openafs.org/dl/license10.html
  
! AFSDEV_AUXCDEFINES = -DAFS_PTHREAD_ENV -DRXDEBUG -DFSSYNC_BUILD_SERVER
  
  RELDIR=tviced
  !INCLUDE ..\config\NTMakefile.$(SYS_NAME)
--- 5,11 ----
  # License.  For details, see the LICENSE file in the top-level source
  # directory or online at http://www.openafs.org/dl/license10.html
  
! AFSDEV_AUXCDEFINES = -DAFS_PTHREAD_ENV -DRXDEBUG -DFSSYNC_BUILD_SERVER #-DAFS_DEMAND_ATTACH_FS
  
  RELDIR=tviced
  !INCLUDE ..\config\NTMakefile.$(SYS_NAME)
***************
*** 19,24 ****
--- 19,25 ----
  EXEFILE = $(DESTDIR)\root.server\usr\afs\bin\fileserver.exe
  
  VICED = ..\viced
+ TVICED = .
  VLSERVER = ..\vlserver
  LWP = ..\lwp
  LIBACL = ..\libacl
***************
*** 31,39 ****
  RXOBJS = $(OUT)\xdr_int64.obj \
           $(OUT)\xdr_int32.obj
  
! VICEDOBJS = $(OUT)\viced.obj $(OUT)\afsfileprocs.obj $(OUT)\host.obj $(OUT)\physio.obj $(OUT)\callback.obj
  VICEDRES =	$(OUT)\$(VICED)\fileserver.res
  
  VLSERVEROBJS = $(OUT)\vldbint.cs.obj $(OUT)\vldbint.xdr.obj
  
  LWPOBJS = $(OUT)\lock.obj $(OUT)\fasttime.obj $(OUT)\threadname.obj
--- 32,42 ----
  RXOBJS = $(OUT)\xdr_int64.obj \
           $(OUT)\xdr_int32.obj
  
! VICEDOBJS = $(OUT)\viced.obj $(OUT)\afsfileprocs.obj $(OUT)\host.obj $(OUT)\physio.obj $(OUT)\callback.obj 
  VICEDRES =	$(OUT)\$(VICED)\fileserver.res
  
+ TVICEDOBJS = $(OUT)\serialize_state.obj
+ 
  VLSERVEROBJS = $(OUT)\vldbint.cs.obj $(OUT)\vldbint.xdr.obj
  
  LWPOBJS = $(OUT)\lock.obj $(OUT)\fasttime.obj $(OUT)\threadname.obj
***************
*** 51,59 ****
  FSINTOBJS = $(OUT)\afsaux.obj $(OUT)\afscbint.cs.obj $(OUT)\afsint.ss.obj $(OUT)\afsint.xdr.obj
  
  EXEOBJS = $(VICEDOBJS) $(VICEDRES) $(VLSERVEROBJS) $(LWPOBJS) $(LIBACLOBJS) \
! 	 $(UTILOBJS) $(DIROBJS) $(VOLOBJS) $(FSINTOBJS) $(RXOBJS)
! 
! 
  
  noversion: install
  
--- 54,60 ----
  FSINTOBJS = $(OUT)\afsaux.obj $(OUT)\afscbint.cs.obj $(OUT)\afsint.ss.obj $(OUT)\afsint.xdr.obj
  
  EXEOBJS = $(VICEDOBJS) $(VICEDRES) $(VLSERVEROBJS) $(LWPOBJS) $(LIBACLOBJS) \
! 	 $(UTILOBJS) $(DIROBJS) $(VOLOBJS) $(FSINTOBJS) $(RXOBJS) #$(TVICEDOBJS) 
  
  noversion: install
  
***************
*** 65,70 ****
--- 66,74 ----
  $(VICEDOBJS): $(VICED)\$$(@B).c
  	$(C2OBJ) -I$(VICED) -I$(UTIL) $**
  
+ $(TVICEDOBJS): $(TVICED)\$$(@B).c
+ 	$(C2OBJ) -I$(TVICED) -I$(UTIL) $**
+ 
  $(UTILOBJS): $(UTIL)\$$(@B).c
  	$(C2OBJ) -I$(UTIL) $**
  
Index: openafs/src/tviced/serialize_state.c
diff -c openafs/src/tviced/serialize_state.c:1.1.4.2 openafs/src/tviced/serialize_state.c:1.1.4.3
*** openafs/src/tviced/serialize_state.c:1.1.4.2	Thu Feb  8 20:00:21 2007
--- openafs/src/tviced/serialize_state.c	Mon Aug 20 13:39:08 2007
***************
*** 16,22 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/tviced/serialize_state.c,v 1.1.4.2 2007/02/09 01:00:21 shadow Exp $");
  
  #include <stdio.h>
  #include <stdlib.h>		/* for malloc() */
--- 16,22 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/tviced/serialize_state.c,v 1.1.4.3 2007/08/20 17:39:08 jaltman Exp $");
  
  #include <stdio.h>
  #include <stdlib.h>		/* for malloc() */
***************
*** 107,114 ****
   * have been written so that it will be very simple to go
   * back to standard I/O for just those poorly written platforms
   */
  #define FS_STATE_USE_MMAP
! 
  
  #ifdef FS_STATE_USE_MMAP
  #define FS_STATE_INIT_FILESIZE (8 * 1024 * 1024)  /* truncate to 8MB initially */
--- 107,115 ----
   * have been written so that it will be very simple to go
   * back to standard I/O for just those poorly written platforms
   */
+ #ifndef _WIN32
  #define FS_STATE_USE_MMAP
! #endif
  
  #ifdef FS_STATE_USE_MMAP
  #define FS_STATE_INIT_FILESIZE (8 * 1024 * 1024)  /* truncate to 8MB initially */
Index: openafs/src/viced/afsfileprocs.c
diff -c openafs/src/viced/afsfileprocs.c:1.113.2.17 openafs/src/viced/afsfileprocs.c:1.113.2.18
*** openafs/src/viced/afsfileprocs.c:1.113.2.17	Mon Jul 30 09:19:02 2007
--- openafs/src/viced/afsfileprocs.c	Tue Aug 21 04:30:27 2007
***************
*** 29,35 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/viced/afsfileprocs.c,v 1.113.2.17 2007/07/30 13:19:02 shadow Exp $");
  
  #include <stdio.h>
  #include <stdlib.h>
--- 29,35 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/viced/afsfileprocs.c,v 1.113.2.18 2007/08/21 08:30:27 jaltman Exp $");
  
  #include <stdio.h>
  #include <stdlib.h>
***************
*** 7458,7468 ****
      if ( !thost->interface ) 
  	goto Bad_CallBackRxConnAddr;
      
-     assert(thost->interface->numberOfInterfaces > 0 );
-     
      /* the only address is the primary interface */
      /* can't change when there's only 1 address, anyway */
!     if ( thost->interface->numberOfInterfaces == 1 ) 
  	goto Bad_CallBackRxConnAddr;
      
      /* initialise a security object only once */
--- 7458,7466 ----
      if ( !thost->interface ) 
  	goto Bad_CallBackRxConnAddr;
      
      /* the only address is the primary interface */
      /* can't change when there's only 1 address, anyway */
!     if ( thost->interface->numberOfInterfaces <= 1 ) 
  	goto Bad_CallBackRxConnAddr;
      
      /* initialise a security object only once */
Index: openafs/src/viced/callback.c
diff -c openafs/src/viced/callback.c:1.77.2.4 openafs/src/viced/callback.c:1.77.2.5
*** openafs/src/viced/callback.c:1.77.2.4	Wed Aug  8 12:31:25 2007
--- openafs/src/viced/callback.c	Tue Aug 21 04:30:27 2007
***************
*** 85,91 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/viced/callback.c,v 1.77.2.4 2007/08/08 16:31:25 jaltman Exp $");
  
  #include <stdio.h>
  #include <stdlib.h>		/* for malloc() */
--- 85,91 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/viced/callback.c,v 1.77.2.5 2007/08/21 08:30:27 jaltman Exp $");
  
  #include <stdio.h>
  #include <stdlib.h>		/* for malloc() */
***************
*** 2991,3001 ****
      if (!host->interface)
  	return 1;		/* failure */
  
-     assert(host->interface->numberOfInterfaces > 0);
- 
      /* the only address is the primary interface */
!     if (host->interface->numberOfInterfaces == 1)
! 	return 1;		/* failure */
  
      /* initialise a security object only once */
      if (!sc)
--- 2991,2999 ----
      if (!host->interface)
  	return 1;		/* failure */
  
      /* the only address is the primary interface */
!     if (host->interface->numberOfInterfaces <= 1)
!         return 1;               /* failure */
  
      /* initialise a security object only once */
      if (!sc)
Index: openafs/src/viced/host.c
diff -c openafs/src/viced/host.c:1.93.2.19 openafs/src/viced/host.c:1.93.2.20
*** openafs/src/viced/host.c:1.93.2.19	Fri Aug 10 00:13:04 2007
--- openafs/src/viced/host.c	Thu Aug 23 12:30:30 2007
***************
*** 13,19 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/viced/host.c,v 1.93.2.19 2007/08/10 04:13:04 shadow Exp $");
  
  #include <stdio.h>
  #include <errno.h>
--- 13,19 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/viced/host.c,v 1.93.2.20 2007/08/23 16:30:30 shadow Exp $");
  
  #include <stdio.h>
  #include <errno.h>
***************
*** 3325,3330 ****
--- 3325,3421 ----
  
  }				/*CheckHost */
  
+ int
+ CheckHost_r(register struct host *host, int held, char *dummy)
+ {
+     register struct client *client;
+     struct rx_connection *cb_conn = NULL;
+     int code;
+ 
+     /* Host is held by h_Enumerate_r */
+     for (client = host->FirstClient; client; client = client->next) {
+ 	if (client->refCount == 0 && client->LastCall < clientdeletetime) {
+ 	    client->deleted = 1;
+ 	    host->hostFlags |= CLIENTDELETED;
+ 	}
+     }
+     if (host->LastCall < checktime) {
+ 	h_Lock_r(host);
+ 	if (!(host->hostFlags & HOSTDELETED)) {
+ 	    cb_conn = host->callback_rxcon;
+ 	    rx_GetConnection(cb_conn);
+ 	    if (host->LastCall < clientdeletetime) {
+ 		host->hostFlags |= HOSTDELETED;
+ 		if (!(host->hostFlags & VENUSDOWN)) {
+ 		    host->hostFlags &= ~ALTADDR;	/* alternate address invalid */
+ 		    if (host->interface) {
+ 			H_UNLOCK;
+ 			code =
+ 			    RXAFSCB_InitCallBackState3(cb_conn,
+ 						       &FS_HostUUID);
+ 			H_LOCK;
+ 		    } else {
+ 			H_UNLOCK;
+ 			code =
+ 			    RXAFSCB_InitCallBackState(cb_conn);
+ 			H_LOCK;
+ 		    }
+ 		    host->hostFlags |= ALTADDR;	/* alternate addresses valid */
+ 		    if (code) {
+ 			char hoststr[16];
+ 			(void)afs_inet_ntoa_r(host->host, hoststr);
+ 			ViceLog(0,
+ 				("CB: RCallBackConnectBack (host.c) failed for host %s:%d\n",
+ 				 hoststr, ntohs(host->port)));
+ 			host->hostFlags |= VENUSDOWN;
+ 		    }
+ 		    /* Note:  it's safe to delete hosts even if they have call
+ 		     * back state, because break delayed callbacks (called when a
+ 		     * message is received from the workstation) will always send a 
+ 		     * break all call backs to the workstation if there is no
+ 		     *callback.
+ 		     */
+ 		}
+ 	    } else {
+ 		if (!(host->hostFlags & VENUSDOWN) && host->cblist) {
+ 		    char hoststr[16];
+ 		    (void)afs_inet_ntoa_r(host->host, hoststr);
+ 		    if (host->interface) {
+ 			afsUUID uuid = host->interface->uuid;
+ 			H_UNLOCK;
+ 			code = RXAFSCB_ProbeUuid(cb_conn, &uuid);
+ 			H_LOCK;
+ 			if (code) {
+ 			    if (MultiProbeAlternateAddress_r(host)) {
+ 				ViceLog(0,("CheckHost_r: Probing all interfaces of host %s:%d failed, code %d\n",
+ 					    hoststr, ntohs(host->port), code));
+ 				host->hostFlags |= VENUSDOWN;
+ 			    }
+ 			}
+ 		    } else {
+ 			H_UNLOCK;
+ 			code = RXAFSCB_Probe(cb_conn);
+ 			H_LOCK;
+ 			if (code) {
+ 			    ViceLog(0,
+ 				    ("CheckHost_r: Probe failed for host %s:%d, code %d\n", 
+ 				     hoststr, ntohs(host->port), code));
+ 			    host->hostFlags |= VENUSDOWN;
+ 			}
+ 		    }
+ 		}
+ 	    }
+ 	    H_UNLOCK;
+ 	    rx_PutConnection(cb_conn);
+ 	    cb_conn=NULL;
+ 	    H_LOCK;
+ 	}
+ 	h_Unlock_r(host);
+     }
+     return held;
+ 
+ }				/*CheckHost_r */
+ 
  
  /*
   * Set VenusDown for any hosts that have not had a call in 15 minutes and
***************
*** 3347,3354 ****
       */
      checktime = now - 15 * 60;
      clientdeletetime = now - 120 * 60;	/* 2 hours ago */
!     h_Enumerate(CheckHost, NULL);
! 
  }				/*h_CheckHosts */
  
  /*
--- 3438,3447 ----
       */
      checktime = now - 15 * 60;
      clientdeletetime = now - 120 * 60;	/* 2 hours ago */
!     
!     H_LOCK;
!     h_Enumerate_r(CheckHost_r, hostList, NULL);
!     H_UNLOCK;
  }				/*h_CheckHosts */
  
  /*
Index: openafs/src/viced/viced.c
diff -c openafs/src/viced/viced.c:1.75.2.13 openafs/src/viced/viced.c:1.75.2.14
*** openafs/src/viced/viced.c:1.75.2.13	Fri Aug 10 00:13:04 2007
--- openafs/src/viced/viced.c	Sun Aug 12 22:26:41 2007
***************
*** 22,28 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/viced/viced.c,v 1.75.2.13 2007/08/10 04:13:04 shadow Exp $");
  
  #include <stdio.h>
  #include <stdlib.h>
--- 22,28 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/viced/viced.c,v 1.75.2.14 2007/08/13 02:26:41 jaltman Exp $");
  
  #include <stdio.h>
  #include <stdlib.h>
***************
*** 88,93 ****
--- 88,94 ----
  #ifndef AFS_NT40_ENV
  #include <afs/netutils.h>
  #endif
+ #include "viced_prototypes.h"
  #include "viced.h"
  #include "host.h"
  #ifdef AFS_PTHREAD_ENV
