Index: openafs/src/WINNT/afsadmsvr/NTMakefile
diff -c openafs/src/WINNT/afsadmsvr/NTMakefile:1.8.4.1 openafs/src/WINNT/afsadmsvr/NTMakefile:1.8.4.2
*** openafs/src/WINNT/afsadmsvr/NTMakefile:1.8.4.1	Wed Sep 19 13:58:45 2007
--- openafs/src/WINNT/afsadmsvr/NTMakefile	Tue Feb 12 08:32:48 2008
***************
*** 76,82 ****
  VCLIBS =\
  	gdi32.lib \
  	user32.lib \
! 	rpcns4.lib \
  	rpcrt4.lib \
  	comctl32.lib \
  	gdi32.lib
--- 76,82 ----
  VCLIBS =\
  	gdi32.lib \
  	user32.lib \
! #	rpcns4.lib \
  	rpcrt4.lib \
  	comctl32.lib \
  	gdi32.lib
Index: openafs/src/WINNT/afsadmsvr/TaAfsAdmSvrClientBind.cpp
diff -c openafs/src/WINNT/afsadmsvr/TaAfsAdmSvrClientBind.cpp:1.3 openafs/src/WINNT/afsadmsvr/TaAfsAdmSvrClientBind.cpp:1.3.4.1
*** openafs/src/WINNT/afsadmsvr/TaAfsAdmSvrClientBind.cpp:1.3	Sat Nov  5 01:47:40 2005
--- openafs/src/WINNT/afsadmsvr/TaAfsAdmSvrClientBind.cpp	Tue Feb 12 08:32:49 2008
***************
*** 52,57 ****
--- 52,58 ----
  
     for (DWORD dwTickStart = GetTickCount(); ; )
        {
+ #ifdef notdef
        // First we'll enumerate the name services around here to see if
        // an admin server is already running.
        //
***************
*** 69,75 ****
           else if (status != RPC_S_CALL_FAILED_DNE) // server rejected us!
              break;
           }
! 
        // Failing that, we'll try to bind to the well-known endpoint that the
        // admin server may have had to use. (if RpcNsBindingExport failed.)
        //
--- 70,76 ----
           else if (status != RPC_S_CALL_FAILED_DNE) // server rejected us!
              break;
           }
! #endif
        // Failing that, we'll try to bind to the well-known endpoint that the
        // admin server may have had to use. (if RpcNsBindingExport failed.)
        //
Index: openafs/src/WINNT/afsadmsvr/TaAfsAdmSvrMain.cpp
diff -c openafs/src/WINNT/afsadmsvr/TaAfsAdmSvrMain.cpp:1.5 openafs/src/WINNT/afsadmsvr/TaAfsAdmSvrMain.cpp:1.5.4.1
*** openafs/src/WINNT/afsadmsvr/TaAfsAdmSvrMain.cpp:1.5	Sat Nov  5 01:47:40 2005
--- openafs/src/WINNT/afsadmsvr/TaAfsAdmSvrMain.cpp	Tue Feb 12 08:32:49 2008
***************
*** 80,86 ****
--- 80,88 ----
     // Clean up any broken interface registration
     //
     RpcServerUnregisterIf (ITaAfsAdminSvr_v1_0_s_ifspec, 0, FALSE);
+ #ifdef notdef
     RpcNsBindingUnexport (RPC_C_NS_SYNTAX_DEFAULT, pszENTRYNAME, ITaAfsAdminSvr_v1_0_s_ifspec, NULL);
+ #endif
  
     // Register our interface
     //
***************
*** 118,127 ****
--- 120,131 ----
           {
           BOOL fExportedBinding = FALSE;
  
+ #ifdef notdef
           if ((status = RpcNsBindingExport (RPC_C_NS_SYNTAX_DEFAULT, pszENTRYNAME, ITaAfsAdminSvr_v1_0_s_ifspec, pBindingVector, NULL)) == 0)
              fExportedBinding = TRUE;
           else
              Print (dlWARNING, TEXT("RpcNsBindingExport failed (benign); error 0x%08lX"), status);
+ #endif
  
           if (!fExportedBinding && !fGotPort)
              {
***************
*** 157,162 ****
--- 161,167 ----
              AfsAdmSvr_Shutdown();
              }
  
+ #ifdef notdef
           if (fExportedBinding)
              {
              if ((status = RpcNsBindingUnexport (RPC_C_NS_SYNTAX_DEFAULT, pszENTRYNAME, ITaAfsAdminSvr_v1_0_s_ifspec, NULL)) != 0)
***************
*** 164,170 ****
                 Print (dlWARNING, TEXT("RpcNsBindingExport failed; error 0x%08lX"), status);
                 }
              }
! 
           if ((status = RpcEpUnregister (ITaAfsAdminSvr_v1_0_s_ifspec, pBindingVector, NULL)) != 0)
              {
              Print (dlWARNING, TEXT("RpcEpUnregister failed; error 0x%08lX"), status);
--- 169,175 ----
                 Print (dlWARNING, TEXT("RpcNsBindingExport failed; error 0x%08lX"), status);
                 }
              }
! #endif
           if ((status = RpcEpUnregister (ITaAfsAdminSvr_v1_0_s_ifspec, pBindingVector, NULL)) != 0)
              {
              Print (dlWARNING, TEXT("RpcEpUnregister failed; error 0x%08lX"), status);
Index: openafs/src/WINNT/afsapplib/NTMakefile
diff -c openafs/src/WINNT/afsapplib/NTMakefile:1.12 openafs/src/WINNT/afsapplib/NTMakefile:1.12.4.1
*** openafs/src/WINNT/afsapplib/NTMakefile:1.12	Sun Nov 20 20:56:03 2005
--- openafs/src/WINNT/afsapplib/NTMakefile	Tue Feb 12 08:32:50 2008
***************
*** 76,82 ****
  VCLIBS =\
  	comctl32.lib \
  	rpcrt4.lib \
! 	rpcns4.lib \
  
  DLLLIBS = \
  	$(DESTDIR)\lib\afs\TaAfsAdmSvrClient.lib \
--- 76,82 ----
  VCLIBS =\
  	comctl32.lib \
  	rpcrt4.lib \
! #	rpcns4.lib \
  
  DLLLIBS = \
  	$(DESTDIR)\lib\afs\TaAfsAdmSvrClient.lib \
Index: openafs/src/WINNT/afsd/afsd_init.c
diff -c openafs/src/WINNT/afsd/afsd_init.c:1.79.2.27 openafs/src/WINNT/afsd/afsd_init.c:1.79.2.28
*** openafs/src/WINNT/afsd/afsd_init.c:1.79.2.27	Fri Feb  1 16:39:40 2008
--- openafs/src/WINNT/afsd/afsd_init.c	Thu Feb 14 22:26:35 2008
***************
*** 1016,1021 ****
--- 1016,1030 ----
      if (rx_nojumbo)
          afsi_log("RX Jumbograms are disabled");
  
+     dummyLen = sizeof(rx_extraPackets);
+     code = RegQueryValueEx(parmKey, "RxExtraPackets", NULL, NULL,
+                            (BYTE *) &rx_extraPackets, &dummyLen);
+     if (code != ERROR_SUCCESS) {
+         rx_extraPackets = 120;
+     }
+     if (rx_extraPackets)
+         afsi_log("RX extraPackets is %d", rx_extraPackets);
+ 
      dummyLen = sizeof(rx_mtu);
      code = RegQueryValueEx(parmKey, "RxMaxMTU", NULL, NULL,
                             (BYTE *) &rx_mtu, &dummyLen);
Index: openafs/src/WINNT/afsd/afskfw.c
diff -c openafs/src/WINNT/afsd/afskfw.c:1.28.4.15 openafs/src/WINNT/afsd/afskfw.c:1.28.4.16
*** openafs/src/WINNT/afsd/afskfw.c:1.28.4.15	Fri Feb  8 21:32:19 2008
--- openafs/src/WINNT/afsd/afskfw.c	Mon Feb 18 09:17:11 2008
***************
*** 1,5 ****
  /*
!  * Copyright (c) 2004, 2005, 2006, 2007 Secure Endpoints Inc.
   * Copyright (c) 2003 SkyRope, LLC
   * All rights reserved.
   * 
--- 1,5 ----
  /*
!  * Copyright (c) 2004, 2005, 2006, 2007, 2008 Secure Endpoints Inc.
   * Copyright (c) 2003 SkyRope, LLC
   * All rights reserved.
   * 
***************
*** 686,691 ****
--- 686,692 ----
      char * pname = NULL;
      const char * ccname = NULL;
      const char * cctype = NULL;
+     char * ccfullname = NULL;
      krb5_error_code code = 0;
      krb5_error_code cc_code = 0;
      krb5_cc_cursor cur;
***************
*** 708,717 ****
      cctype = pkrb5_cc_get_type(ctx, cc);
      if (!cctype) goto cleanup;
  
      // Search the existing list to see if we have a match 
      if ( next ) {
          for ( ; next ; next = next->next ) {
!             if ( !strcmp(next->principal,pname) && !strcmp(next->ccache_name, ccname) )
                  break;
          }
      } 
--- 709,723 ----
      cctype = pkrb5_cc_get_type(ctx, cc);
      if (!cctype) goto cleanup;
  
+     ccfullname = malloc(strlen(ccname) + strlen(cctype) + 2);
+     if (!ccfullname) goto cleanup;
+ 	
+     sprintf(ccfullname, "%s:%s", cctype, ccname);
+ 
      // Search the existing list to see if we have a match 
      if ( next ) {
          for ( ; next ; next = next->next ) {
!             if ( !strcmp(next->principal,pname) && !strcmp(next->ccache_name, ccfullname) )
                  break;
          }
      } 
***************
*** 722,730 ****
          next->next = princ_cc_data;
          princ_cc_data = next;
          next->principal = _strdup(pname);
!         next->ccache_name = malloc(strlen(ccname) + strlen(cctype) + 2);
!         if (next->ccache_name) 
!             sprintf(next->ccache_name, "%s:%s", cctype, ccname);
          next->from_lsa = lsa;
          next->expired = 1;
          next->expiration_time = 0;
--- 728,735 ----
          next->next = princ_cc_data;
          princ_cc_data = next;
          next->principal = _strdup(pname);
!         next->ccache_name = ccfullname;
!         ccfullname = NULL;
          next->from_lsa = lsa;
          next->expired = 1;
          next->expiration_time = 0;
***************
*** 783,788 ****
--- 788,795 ----
      flags = KRB5_TC_OPENCLOSE;  //turn on OPENCLOSE
      code = pkrb5_cc_set_flags(ctx, cc, flags);
  
+     if ( ccfullname)
+         free(ccfullname);
      if ( pname )
          pkrb5_free_unparsed_name(ctx,pname);
      if ( principal )
Index: openafs/src/WINNT/afsd/cm_cell.c
diff -c openafs/src/WINNT/afsd/cm_cell.c:1.23.2.12 openafs/src/WINNT/afsd/cm_cell.c:1.23.2.13
*** openafs/src/WINNT/afsd/cm_cell.c:1.23.2.12	Fri Feb  1 16:39:41 2008
--- openafs/src/WINNT/afsd/cm_cell.c	Thu Feb 14 22:31:36 2008
***************
*** 71,77 ****
   * and check to make sure we have a valid set of volume servers
   * this function must be called with a Write Lock on cm_cellLock
   */
! static cm_cell_t *cm_UpdateCell(cm_cell_t * cp, afs_uint32 flags)
  {
      long code = 0;
      cm_cell_rock_t rock;
--- 71,77 ----
   * and check to make sure we have a valid set of volume servers
   * this function must be called with a Write Lock on cm_cellLock
   */
! cm_cell_t *cm_UpdateCell(cm_cell_t * cp, afs_uint32 flags)
  {
      long code = 0;
      cm_cell_rock_t rock;
***************
*** 405,410 ****
--- 405,411 ----
              for (cellp = cm_data.allCellsp; cellp; cellp=cellp->allNextp) {
                  lock_InitializeMutex(&cellp->mx, "cm_cell_t mutex");
                  cellp->vlServersp = NULL;
+                 cellp->flags |= CM_CELLFLAG_VLSERVER_INVALID;
              }
          }
  
Index: openafs/src/WINNT/afsd/cm_cell.h
diff -c openafs/src/WINNT/afsd/cm_cell.h:1.7.6.7 openafs/src/WINNT/afsd/cm_cell.h:1.7.6.8
*** openafs/src/WINNT/afsd/cm_cell.h:1.7.6.7	Thu Jan 31 00:49:00 2008
--- openafs/src/WINNT/afsd/cm_cell.h	Thu Feb 14 22:31:36 2008
***************
*** 72,75 ****
--- 72,77 ----
  
  extern long cm_AddCellProc(void *rockp, struct sockaddr_in *addrp, char *namep);
  
+ extern cm_cell_t *cm_UpdateCell(cm_cell_t * cp, afs_uint32 flags);
+ 
  #endif /* __CELL_H_ENV_ */
Index: openafs/src/WINNT/afsd/cm_conn.c
diff -c openafs/src/WINNT/afsd/cm_conn.c:1.49.2.30 openafs/src/WINNT/afsd/cm_conn.c:1.49.2.34
*** openafs/src/WINNT/afsd/cm_conn.c:1.49.2.30	Thu Feb  7 09:48:53 2008
--- openafs/src/WINNT/afsd/cm_conn.c	Mon Feb 18 12:34:51 2008
***************
*** 291,297 ****
                  else if (fidp->volume == volp->bk.ID)
                      statep = &volp->bk;
  
!                 if (statep->state != vl_offline) {
                      retry = 1;
                  } else {
                      if (cm_CheckOfflineVolume(volp, statep->ID))
--- 291,297 ----
                  else if (fidp->volume == volp->bk.ID)
                      statep = &volp->bk;
  
!                 if (statep->state != vl_offline && statep->state != vl_unknown) {
                      retry = 1;
                  } else {
                      if (cm_CheckOfflineVolume(volp, statep->ID))
***************
*** 323,329 ****
                      else if (fidp->volume == volp->bk.ID)
                          statep = &volp->bk;
  
!                     if (statep->state != vl_offline && statep->state != vl_busy) {
                          retry = 1;
                      } else {
                          if (!serversp) {
--- 323,331 ----
                      else if (fidp->volume == volp->bk.ID)
                          statep = &volp->bk;
  
!                     if (statep->state != vl_offline && 
!                         statep->state != vl_busy &&
!                         statep->state != vl_unknown) {
                          retry = 1;
                      } else {
                          if (!serversp) {
***************
*** 457,473 ****
              break;
          }
  
!         /* Log server being offline for this volume */
!         sprintf(addr, "%d.%d.%d.%d", 
!                  ((serverp->addr.sin_addr.s_addr & 0xff)),
!                  ((serverp->addr.sin_addr.s_addr & 0xff00)>> 8),
!                  ((serverp->addr.sin_addr.s_addr & 0xff0000)>> 16),
!                  ((serverp->addr.sin_addr.s_addr & 0xff000000)>> 24)); 
  
! 	osi_Log2(afsd_logp, format, osi_LogSaveString(afsd_logp,addr), fidp->volume);
  #ifndef DJGPP
! 	LogEvent(EVENTLOG_WARNING_TYPE, msgID, addr, fidp->volume);
  #endif
  
          /* Mark server offline for this volume */
          if (!serversp && fidp) {
--- 459,477 ----
              break;
          }
  
!         if (serverp && fidp) {
!             /* Log server being offline for this volume */
!             sprintf(addr, "%d.%d.%d.%d", 
!                     ((serverp->addr.sin_addr.s_addr & 0xff)),
!                     ((serverp->addr.sin_addr.s_addr & 0xff00)>> 8),
!                     ((serverp->addr.sin_addr.s_addr & 0xff0000)>> 16),
!                     ((serverp->addr.sin_addr.s_addr & 0xff000000)>> 24)); 
  
!             osi_Log2(afsd_logp, format, osi_LogSaveString(afsd_logp,addr), fidp->volume);
  #ifndef DJGPP
!             LogEvent(EVENTLOG_WARNING_TYPE, msgID, addr, fidp->volume);
  #endif
+         }
  
          /* Mark server offline for this volume */
          if (!serversp && fidp) {
***************
*** 477,482 ****
--- 481,487 ----
                  free_svr_list = 1;
              }
          }
+ 
          lock_ObtainWrite(&cm_serverLock);
          for (tsrp = serversp; tsrp; tsrp=tsrp->next) {
              if (tsrp->server == serverp) {
***************
*** 536,541 ****
--- 541,547 ----
  		lock_ObtainWrite(&cm_scacheLock);
  		cm_RemoveSCacheFromHashTable(scp);
  		lock_ReleaseWrite(&cm_scacheLock);
+                 cm_LockMarkSCacheLost(scp);
  		scp->flags |= CM_SCACHEFLAG_DELETED;
  		lock_ReleaseMutex(&scp->mx);
  		cm_ReleaseSCache(scp);
***************
*** 594,600 ****
          if ( timeLeft > 2 )
              retry = 1;
      }
!     else if (errorCode == RXKADEXPIRED || errorCode == RXKADBADTICKET) {
          if (!dead_session) {
              lock_ObtainMutex(&userp->mx);
              ucellp = cm_GetUCell(userp, serverp->cellp);
--- 600,606 ----
          if ( timeLeft > 2 )
              retry = 1;
      }
!     else if (errorCode == RXKADEXPIRED) {
          if (!dead_session) {
              lock_ObtainMutex(&userp->mx);
              ucellp = cm_GetUCell(userp, serverp->cellp);
Index: openafs/src/WINNT/afsd/cm_dcache.c
diff -c openafs/src/WINNT/afsd/cm_dcache.c:1.30.2.24 openafs/src/WINNT/afsd/cm_dcache.c:1.30.2.25
*** openafs/src/WINNT/afsd/cm_dcache.c:1.30.2.24	Mon Jan  7 12:56:37 2008
--- openafs/src/WINNT/afsd/cm_dcache.c	Sun Feb 17 00:28:04 2008
***************
*** 696,702 ****
--- 696,705 ----
              lock_ReleaseMutex(&scp->mx);
              mxheld = 0;
          }
+ 
+         lock_ObtainRead(&scp->bufCreateLock);
          code = buf_Get(scp, &offset, &bp);
+         lock_ReleaseRead(&scp->bufCreateLock);
          if (code)
              break;
  
***************
*** 1089,1095 ****
--- 1092,1100 ----
          if (LargeIntegerGreaterThanOrEqualTo(pageBase, fileSize)) 
              break;
  
+         lock_ObtainRead(&scp->bufCreateLock);
          code = buf_Get(scp, &pageBase, &tbp);
+         lock_ReleaseRead(&scp->bufCreateLock);
          if (code) {
              //lock_ReleaseMutex(&cm_bufGetMutex);
              lock_ObtainMutex(&scp->mx);
Index: openafs/src/WINNT/afsd/cm_dir.c
diff -c openafs/src/WINNT/afsd/cm_dir.c:1.4.4.9 openafs/src/WINNT/afsd/cm_dir.c:1.4.4.10
*** openafs/src/WINNT/afsd/cm_dir.c:1.4.4.9	Wed Nov 14 12:19:41 2007
--- openafs/src/WINNT/afsd/cm_dir.c	Mon Feb 18 23:15:03 2008
***************
*** 127,135 ****
  {
      long i;
          
!     i = (long)strlen(namep) + 1;
      if (lenp) *lenp = i;
!     return 1 + ((i+15) >> 5);
  }
  
  /* Create an entry in a file.  Dir is a file representation, while
--- 127,135 ----
  {
      long i;
          
!     i = (long)strlen(namep);
      if (lenp) *lenp = i;
!     return 1 + ((i+16) >> 5);
  }
  
  /* Create an entry in a file.  Dir is a file representation, while
Index: openafs/src/WINNT/afsd/cm_scache.c
diff -c openafs/src/WINNT/afsd/cm_scache.c:1.35.2.56 openafs/src/WINNT/afsd/cm_scache.c:1.35.2.58
*** openafs/src/WINNT/afsd/cm_scache.c:1.35.2.56	Thu Feb  7 20:21:46 2008
--- openafs/src/WINNT/afsd/cm_scache.c	Sun Feb 17 00:28:04 2008
***************
*** 640,647 ****
      long code;
      cm_volume_t *volp = NULL;
      cm_cell_t *cellp;
!     int special; // yj: boolean variable to test if file is on root.afs
!     int isRoot;
      extern cm_fid_t cm_rootFid;
          
      hash = CM_SCACHE_HASH(fidp);
--- 640,647 ----
      long code;
      cm_volume_t *volp = NULL;
      cm_cell_t *cellp;
!     int special = 0; // yj: boolean variable to test if file is on root.afs
!     int isRoot = 0;
      extern cm_fid_t cm_rootFid;
          
      hash = CM_SCACHE_HASH(fidp);
***************
*** 1659,1689 ****
         	for (bp = cm_data.buf_fileHashTablepp[i]; bp; bp=nextBp)
  	{
              nextBp = bp->fileHashp;
  
!             if (cm_FidCmp(&scp->fid, &bp->fid) == 0) {
!                 prevBp = bp->fileHashBackp;
!                 bp->fileHashBackp = bp->fileHashp = NULL;
!                 if (prevBp)
!                     prevBp->fileHashp = nextBp;
!                 else
!                     cm_data.buf_fileHashTablepp[i] = nextBp;
!                 if (nextBp)
!                     nextBp->fileHashBackp = prevBp;
! 
!                 j = BUF_HASH(&bp->fid, &bp->offset);
!                 lbpp = &(cm_data.buf_scacheHashTablepp[j]);
!                 for(tbp = *lbpp; tbp; lbpp = &tbp->hashp, tbp = *lbpp) {
!                     if (tbp == bp) 
!                         break;
!                 }
! 
!                 *lbpp = bp->hashp;	/* hash out */
!                 bp->hashp = NULL;
  
!                 bp->flags &= ~CM_BUF_INHASH;
              }
  	}
- 
          lock_ReleaseWrite(&buf_globalLock);
      }
      scp->dataVersion = dataVersion;
--- 1659,1699 ----
         	for (bp = cm_data.buf_fileHashTablepp[i]; bp; bp=nextBp)
  	{
              nextBp = bp->fileHashp;
+             /* 
+              * if the buffer belongs to this stat cache entry
+              * and the buffer mutex can be obtained, check the
+              * reference count and if it is zero, remove the buffer
+              * from the hash tables.  If there are references,
+              * the buffer might be updated to the current version
+              * so leave it in place.
+              */
+             if (cm_FidCmp(&scp->fid, &bp->fid) == 0 &&
+                  lock_TryMutex(&bp->mx)) {
+                 if (bp->refCount == 0) {
+                     prevBp = bp->fileHashBackp;
+                     bp->fileHashBackp = bp->fileHashp = NULL;
+                     if (prevBp)
+                         prevBp->fileHashp = nextBp;
+                     else
+                         cm_data.buf_fileHashTablepp[i] = nextBp;
+                     if (nextBp)
+                         nextBp->fileHashBackp = prevBp;
+ 
+                     j = BUF_HASH(&bp->fid, &bp->offset);
+                     lbpp = &(cm_data.buf_scacheHashTablepp[j]);
+                     for(tbp = *lbpp; tbp; lbpp = &tbp->hashp, tbp = *lbpp) {
+                         if (tbp == bp) 
+                             break;
+                     }
  
!                     *lbpp = bp->hashp;	/* hash out */
!                     bp->hashp = NULL;
  
!                     bp->flags &= ~CM_BUF_INHASH;
!                 }
!                 lock_ReleaseMutex(&bp->mx);
              }
  	}
          lock_ReleaseWrite(&buf_globalLock);
      }
      scp->dataVersion = dataVersion;
Index: openafs/src/WINNT/afsd/cm_vnodeops.c
diff -c openafs/src/WINNT/afsd/cm_vnodeops.c:1.69.2.56 openafs/src/WINNT/afsd/cm_vnodeops.c:1.69.2.60
*** openafs/src/WINNT/afsd/cm_vnodeops.c:1.69.2.56	Sun Feb 10 19:18:32 2008
--- openafs/src/WINNT/afsd/cm_vnodeops.c	Sun Feb 17 00:59:30 2008
***************
*** 1284,1291 ****
              else
                  return CM_ERROR_NOSUCHFILE;
          }
! 		else if (!strchr(namep, '#') && !strchr(namep, '%') &&
!                          strcmp(namep, "srvsvc") && strcmp(namep, "wkssvc")) { 
              /* nonexistent dir on freelance root, so add it */
              char fullname[200] = ".";
              int  found = 0;
--- 1284,1292 ----
              else
                  return CM_ERROR_NOSUCHFILE;
          }
!         else if (!strchr(namep, '#') && !strchr(namep, '%') &&
!                  strcmp(namep, "srvsvc") && strcmp(namep, "wkssvc") &&
!                  strcmp(namep, "ipc$")) {
              /* nonexistent dir on freelance root, so add it */
              char fullname[200] = ".";
              int  found = 0;
***************
*** 1300,1305 ****
--- 1301,1307 ----
               * new value automatically.
               */
  
+             code = -1;
              if (namep[0] == '.') {
                  if (cm_GetCell_Gen(&namep[1], &fullname[1], CM_FLAG_CREATE)) {
                      found = 1;
***************
*** 1698,1704 ****
--- 1700,1708 ----
          /* read the link data */
          lock_ReleaseMutex(&linkScp->mx);
          thyper.LowPart = thyper.HighPart = 0;
+         lock_ObtainRead(&linkScp->bufCreateLock);
          code = buf_Get(linkScp, &thyper, &bufp);
+         lock_ReleaseRead(&linkScp->bufCreateLock);
          lock_ObtainMutex(&linkScp->mx);
          if (code) 
              return code;
***************
*** 2689,2694 ****
--- 2693,2708 ----
          return CM_ERROR_ATSYS;
      }
  
+ #ifdef AFS_FREELANCE_CLIENT
+     /* Freelance root volume does not hold files */
+     if (cm_freelanceEnabled &&
+         dscp->fid.cell==AFS_FAKE_ROOT_CELL_ID &&
+         dscp->fid.volume==AFS_FAKE_ROOT_VOL_ID )
+     {
+         return CM_ERROR_NOACCESS;
+     }
+ #endif /* AFS_FREELANCE_CLIENT */
+ 
      /* before starting the RPC, mark that we're changing the file data, so
       * that someone who does a chmod will know to wait until our call
       * completes.
***************
*** 2839,2844 ****
--- 2853,2868 ----
          return CM_ERROR_ATSYS;
      }
  
+ #ifdef AFS_FREELANCE_CLIENT
+     /* Freelance root volume does not hold subdirectories */
+     if (cm_freelanceEnabled &&
+         dscp->fid.cell==AFS_FAKE_ROOT_CELL_ID &&
+         dscp->fid.volume==AFS_FAKE_ROOT_VOL_ID )
+     {
+         return CM_ERROR_NOACCESS;
+     }
+ #endif /* AFS_FREELANCE_CLIENT */
+ 
      /* before starting the RPC, mark that we're changing the directory
       * data, so that someone who does a chmod on the dir will wait until
       * our call completes.
***************
*** 3935,3943 ****
  #endif
  }
  
- /* Forward dcl. */
- static void cm_LockMarkSCacheLost(cm_scache_t * scp);
- 
  /* Called with cm_scacheLock write locked */
  static cm_file_lock_t * cm_GetFileLock(void) {
      cm_file_lock_t * l;
--- 3959,3964 ----
***************
*** 4883,4889 ****
  }
  
  /* called with scp->mx held */
! static void cm_LockMarkSCacheLost(cm_scache_t * scp)
  {
      cm_file_lock_t *fileLock;
      osi_queue_t *q;
--- 4904,4910 ----
  }
  
  /* called with scp->mx held */
! void cm_LockMarkSCacheLost(cm_scache_t * scp)
  {
      cm_file_lock_t *fileLock;
      osi_queue_t *q;
***************
*** 5007,5013 ****
                  if (!IS_LOCK_ACTIVE(fileLock))
                      goto pre_syncopdone;
  
!                 if (scp->serverLock != -1) {
                      cm_fid_t cfid;
                      cm_user_t * userp;
  
--- 5028,5034 ----
                  if (!IS_LOCK_ACTIVE(fileLock))
                      goto pre_syncopdone;
  
!                 if (scp->serverLock != -1 && !(scp->flags & CM_SCACHEFLAG_DELETED)) {
                      cm_fid_t cfid;
                      cm_user_t * userp;
  
***************
*** 5084,5090 ****
                          }
                      }
  
!                     if (code == EINVAL || code == CM_ERROR_INVAL) {
                          cm_LockMarkSCacheLost(scp);
                      }
  
--- 5105,5112 ----
                          }
                      }
  
!                     if (code == EINVAL || code == CM_ERROR_INVAL ||
!                         code == CM_ERROR_BADFD) {
                          cm_LockMarkSCacheLost(scp);
                      }
  
Index: openafs/src/WINNT/afsd/cm_vnodeops.h
diff -c openafs/src/WINNT/afsd/cm_vnodeops.h:1.14.4.7 openafs/src/WINNT/afsd/cm_vnodeops.h:1.14.4.8
*** openafs/src/WINNT/afsd/cm_vnodeops.h:1.14.4.7	Sat Dec 22 23:52:58 2007
--- openafs/src/WINNT/afsd/cm_vnodeops.h	Sun Feb 17 00:59:30 2008
***************
*** 224,229 ****
--- 224,231 ----
  
  extern void cm_ReleaseAllLocks(void);
  
+ extern void cm_LockMarkSCacheLost(cm_scache_t * scp);
+ 
  extern long cm_RetryLock(cm_file_lock_t *oldFileLock, int client_is_dead);
  
  #define CM_SESSION_SMB      0xffff
Index: openafs/src/WINNT/afsd/cm_volume.c
diff -c openafs/src/WINNT/afsd/cm_volume.c:1.14.4.27 openafs/src/WINNT/afsd/cm_volume.c:1.14.4.29
*** openafs/src/WINNT/afsd/cm_volume.c:1.14.4.27	Thu Feb  7 01:14:59 2008
--- openafs/src/WINNT/afsd/cm_volume.c	Thu Feb 14 22:31:36 2008
***************
*** 213,218 ****
--- 213,221 ----
      } else
  #endif
      {
+         if (cellp->flags & CM_CELLFLAG_VLSERVER_INVALID)
+             cm_UpdateCell(cellp, 0);
+ 
          /* now we have volume structure locked and held; make RPC to fill it */
  	osi_Log2(afsd_logp, "CALL VL_GetEntryByName{UNO} name %s:%s", volp->cellp->name, volp->namep);
          do {
***************
*** 1013,1020 ****
  
      lock_ObtainMutex(&volp->mx);
  
      if (volp->rw.ID != 0 && (!volID || volID == volp->rw.ID) &&
!          (volp->rw.state == vl_busy || volp->rw.state == vl_offline)) {
          cm_InitReq(&req);
  
          for (serversp = volp->rw.serversp; serversp; serversp = serversp->next) {
--- 1016,1031 ----
  
      lock_ObtainMutex(&volp->mx);
  
+     if (volp->flags & CM_VOLUMEFLAG_RESET) {
+         cm_InitReq(&req);
+         code = cm_UpdateVolume(volp->cellp, cm_rootUserp, &req, volp);
+         if (code == 0)
+             volp->flags &= ~CM_VOLUMEFLAG_RESET;
+     }
+ 
      if (volp->rw.ID != 0 && (!volID || volID == volp->rw.ID) &&
! 		volp->rw.serversp &&
!          (volp->rw.state == vl_busy || volp->rw.state == vl_offline || volp->rw.state == vl_unknown)) {
          cm_InitReq(&req);
  
          for (serversp = volp->rw.serversp; serversp; serversp = serversp->next) {
***************
*** 1049,1055 ****
      }
  
      if (volp->ro.ID != 0 && (!volID || volID == volp->ro.ID) &&
!          (volp->ro.state == vl_busy || volp->ro.state == vl_offline)) {
          cm_InitReq(&req);
  
          for (serversp = volp->ro.serversp; serversp; serversp = serversp->next) {
--- 1060,1067 ----
      }
  
      if (volp->ro.ID != 0 && (!volID || volID == volp->ro.ID) &&
! 		volp->ro.serversp &&
!          (volp->ro.state == vl_busy || volp->ro.state == vl_offline || volp->ro.state == vl_unknown)) {
          cm_InitReq(&req);
  
          for (serversp = volp->ro.serversp; serversp; serversp = serversp->next) {
***************
*** 1084,1090 ****
      }
  
      if (volp->bk.ID != 0 && (!volID || volID == volp->bk.ID) &&
!          (volp->bk.state == vl_busy || volp->bk.state == vl_offline)) {
          cm_InitReq(&req);
  
          for (serversp = volp->bk.serversp; serversp; serversp = serversp->next) {
--- 1096,1103 ----
      }
  
      if (volp->bk.ID != 0 && (!volID || volID == volp->bk.ID) &&
! 		volp->bk.serversp &&
!          (volp->bk.state == vl_busy || volp->bk.state == vl_offline || volp->bk.state == vl_unknown)) {
          cm_InitReq(&req);
  
          for (serversp = volp->bk.serversp; serversp; serversp = serversp->next) {
Index: openafs/src/WINNT/afsd/smb.c
diff -c openafs/src/WINNT/afsd/smb.c:1.118.2.58 openafs/src/WINNT/afsd/smb.c:1.118.2.60
*** openafs/src/WINNT/afsd/smb.c:1.118.2.58	Fri Feb  8 21:32:19 2008
--- openafs/src/WINNT/afsd/smb.c	Mon Feb 18 12:34:51 2008
***************
*** 1808,1813 ****
--- 1808,1815 ----
      }
  
      if (_stricmp(shareName, "IPC$") == 0 ||
+         _stricmp(shareName, "srvsvc") == 0 ||
+         _stricmp(shareName, "wkssvc") == 0 ||
          _stricmp(shareName, SMB_IOCTL_FILENAME_NOSLASH) == 0 ||
          _stricmp(shareName, "DESKTOP.INI") == 0
           ) {
***************
*** 2880,2887 ****
      else if (code == CM_ERROR_ALLOFFLINE || code == CM_ERROR_ALLDOWN) {
          NTStatus = 0xC00000BEL; /* Bad Network Path */
      } 
!     else if (code == RXKADUNKNOWNKEY) {
! 	NTStatus = 0xC0000322L; /* Bad Kerberos key */
      } 
      else if (code == CM_ERROR_BAD_LEVEL) {
  	NTStatus = 0xC0000148L;	/* Invalid Level */
--- 2882,2889 ----
      else if (code == CM_ERROR_ALLOFFLINE || code == CM_ERROR_ALLDOWN) {
          NTStatus = 0xC00000BEL; /* Bad Network Path */
      } 
!     else if (code >= ERROR_TABLE_BASE_RXK && code < ERROR_TABLE_BASE_RXK + 256) {
! 	NTStatus = 0xC0000322L; /* No Kerberos key */
      } 
      else if (code == CM_ERROR_BAD_LEVEL) {
  	NTStatus = 0xC0000148L;	/* Invalid Level */
Index: openafs/src/WINNT/afsd/smb3.c
diff -c openafs/src/WINNT/afsd/smb3.c:1.95.2.51 openafs/src/WINNT/afsd/smb3.c:1.95.2.53
*** openafs/src/WINNT/afsd/smb3.c:1.95.2.51	Mon Jan 28 02:23:35 2008
--- openafs/src/WINNT/afsd/smb3.c	Mon Feb 18 00:53:56 2008
***************
*** 1472,1485 ****
  } smb_rap_share_info_1_t;
  
  typedef struct smb_rap_share_info_2 {
!     char				shi2_netname[13];
!     char				shi2_pad;
      unsigned short		shi2_type;
!     DWORD				shi2_remark; /* char *shi2_remark; data offset */
      unsigned short		shi2_permissions;
      unsigned short		shi2_max_uses;
      unsigned short		shi2_current_uses;
!     DWORD				shi2_path;  /* char *shi2_path; data offset */
      unsigned short		shi2_passwd[9];
      unsigned short		shi2_pad2;
  } smb_rap_share_info_2_t;
--- 1472,1485 ----
  } smb_rap_share_info_1_t;
  
  typedef struct smb_rap_share_info_2 {
!     char			shi2_netname[13];
!     char			shi2_pad;
      unsigned short		shi2_type;
!     DWORD			shi2_remark; /* char *shi2_remark; data offset */
      unsigned short		shi2_permissions;
      unsigned short		shi2_max_uses;
      unsigned short		shi2_current_uses;
!     DWORD			shi2_path;  /* char *shi2_path; data offset */
      unsigned short		shi2_passwd[9];
      unsigned short		shi2_pad2;
  } smb_rap_share_info_2_t;
***************
*** 1693,1698 ****
--- 1693,1703 ----
      DWORD allSubmount;
      LONG rv;
      long code = 0;
+     cm_scache_t *scp = NULL;
+     cm_user_t   *userp;
+     cm_req_t    req;
+ 
+     cm_InitReq(&req);
  
      tp = p->parmsp + 1; /* skip over function number (always 1) */
      (void) smb_ParseString( (char *) tp, (char **) &tp); /* skip over param descriptor */
***************
*** 1712,1719 ****
      else
          return CM_ERROR_INVAL;
  
-     outp = smb_GetTran2ResponsePacket(vcp, p, op, totalParam, totalData);
- 
      if(!stricmp(shareName,"all") || !strcmp(shareName,"*.")) {
          rv = RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSREG_CLT_SVC_PARAM_SUBKEY, 0,
                            KEY_QUERY_VALUE, &hkParam);
--- 1717,1722 ----
***************
*** 1731,1752 ****
              shareFound = TRUE;
  
      } else {
!         rv = RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSREG_CLT_SVC_PARAM_SUBKEY "\\Submounts", 0,
!                           KEY_QUERY_VALUE, &hkSubmount);
!         if (rv == ERROR_SUCCESS) {
!             rv = RegQueryValueEx(hkSubmount, shareName, NULL, NULL, NULL, NULL);
              if (rv == ERROR_SUCCESS) {
!                 shareFound = TRUE;
              }
-             RegCloseKey(hkSubmount);
          }
      }
  
!     if (!shareFound) {
!         smb_FreeTran2Packet(outp);
          return CM_ERROR_BADSHARENAME;
-     }
  
      memset(outp->datap, 0, totalData);
  
      outp->parmsp[0] = 0;
--- 1734,1767 ----
              shareFound = TRUE;
  
      } else {
!         userp = smb_GetTran2User(vcp, p);
!         if (!userp) {
!             osi_Log1(smb_logp,"ReceiveTran2GetDfsReferral unable to resolve user [%d]", p->uid);
!             return CM_ERROR_BADSMB;
!         }   
!         code = cm_NameI(cm_data.rootSCachep, shareName,
!                          CM_FLAG_FOLLOW | CM_FLAG_CASEFOLD | CM_FLAG_DFS_REFERRAL,
!                          userp, NULL, &req, &scp);
!         if (code == 0) {
!             cm_ReleaseSCache(scp);
!             shareFound = TRUE;
!         } else {
!             rv = RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSREG_CLT_SVC_PARAM_SUBKEY "\\Submounts", 0,
!                               KEY_QUERY_VALUE, &hkSubmount);
              if (rv == ERROR_SUCCESS) {
!                 rv = RegQueryValueEx(hkSubmount, shareName, NULL, NULL, NULL, NULL);
!                 if (rv == ERROR_SUCCESS) {
!                     shareFound = TRUE;
!                 }
!                 RegCloseKey(hkSubmount);
              }
          }
      }
  
!     if (!shareFound)
          return CM_ERROR_BADSHARENAME;
  
+     outp = smb_GetTran2ResponsePacket(vcp, p, op, totalParam, totalData);
      memset(outp->datap, 0, totalData);
  
      outp->parmsp[0] = 0;
***************
*** 2139,2145 ****
      spacep = cm_GetSpace();
      smb_StripLastComponent(spacep->data, &lastNamep, pathp);
  
!     if (lastNamep && strcmp(lastNamep, SMB_IOCTL_FILENAME) == 0) {
          /* special case magic file name for receiving IOCTL requests
           * (since IOCTL calls themselves aren't getting through).
           */
--- 2154,2164 ----
      spacep = cm_GetSpace();
      smb_StripLastComponent(spacep->data, &lastNamep, pathp);
  
!     if (lastNamep && 
!          (stricmp(lastNamep, SMB_IOCTL_FILENAME) == 0 ||
!            stricmp(lastNamep, "\\srvsvc") == 0 ||
!            stricmp(lastNamep, "\\wkssvc") == 0 ||
!            stricmp(lastNamep, "\\ipc$") == 0)) {
          /* special case magic file name for receiving IOCTL requests
           * (since IOCTL calls themselves aren't getting through).
           */
***************
*** 5475,5481 ****
      spacep = inp->spacep;
      smb_StripLastComponent(spacep->data, &lastNamep, pathp);
  
!     if (lastNamep && strcmp(lastNamep, SMB_IOCTL_FILENAME) == 0) {
          /* special case magic file name for receiving IOCTL requests
           * (since IOCTL calls themselves aren't getting through).
           */
--- 5494,5504 ----
      spacep = inp->spacep;
      smb_StripLastComponent(spacep->data, &lastNamep, pathp);
  
!     if (lastNamep && 
!          (stricmp(lastNamep, SMB_IOCTL_FILENAME) == 0 ||
!            stricmp(lastNamep, "\\srvsvc") == 0 ||
!            stricmp(lastNamep, "\\wkssvc") == 0 ||
!            stricmp(lastNamep, "ipc$") == 0)) {
          /* special case magic file name for receiving IOCTL requests
           * (since IOCTL calls themselves aren't getting through).
           */
***************
*** 6597,6603 ****
      osi_Log4(smb_logp,"... da=[%x] ea=[%x] cd=[%x] co=[%x]", desiredAccess, extAttributes, createDisp, createOptions);
      osi_Log3(smb_logp,"... share=[%x] flags=[%x] lastNamep=[%s]", shareAccess, flags, osi_LogSaveString(smb_logp,(lastNamep?lastNamep:"null")));
  
!     if (lastNamep && strcmp(lastNamep, SMB_IOCTL_FILENAME) == 0) {
          /* special case magic file name for receiving IOCTL requests
           * (since IOCTL calls themselves aren't getting through).
           */
--- 6620,6630 ----
      osi_Log4(smb_logp,"... da=[%x] ea=[%x] cd=[%x] co=[%x]", desiredAccess, extAttributes, createDisp, createOptions);
      osi_Log3(smb_logp,"... share=[%x] flags=[%x] lastNamep=[%s]", shareAccess, flags, osi_LogSaveString(smb_logp,(lastNamep?lastNamep:"null")));
  
! 	if (lastNamep && 
!              (stricmp(lastNamep, SMB_IOCTL_FILENAME) == 0 ||
!                stricmp(lastNamep, "\\srvsvc") == 0 ||
!                stricmp(lastNamep, "\\wkssvc") == 0 ||
!                stricmp(lastNamep, "ipc$") == 0)) {
          /* special case magic file name for receiving IOCTL requests
           * (since IOCTL calls themselves aren't getting through).
           */
Index: openafs/src/WINNT/client_creds/NTMakefile
diff -c openafs/src/WINNT/client_creds/NTMakefile:1.16.4.4 openafs/src/WINNT/client_creds/NTMakefile:1.16.4.5
*** openafs/src/WINNT/client_creds/NTMakefile:1.16.4.4	Fri Feb  8 21:32:23 2008
--- openafs/src/WINNT/client_creds/NTMakefile	Tue Feb 12 08:21:17 2008
***************
*** 55,61 ****
  	ole32.lib \
  	mpr.lib \
  	userenv.lib \
!     	netapi32.lib 
  
  EXELIBS = \
  	$(DESTDIR)\lib\afs\afspioctl.lib \
--- 55,62 ----
  	ole32.lib \
  	mpr.lib \
  	userenv.lib \
!     	netapi32.lib \
!         secur32.lib 
  
  EXELIBS = \
  	$(DESTDIR)\lib\afs\afspioctl.lib \
Index: openafs/src/WINNT/client_creds/advtab.cpp
diff -c openafs/src/WINNT/client_creds/advtab.cpp:1.9.4.1 openafs/src/WINNT/client_creds/advtab.cpp:1.9.4.2
*** openafs/src/WINNT/client_creds/advtab.cpp:1.9.4.1	Fri Feb  8 21:32:23 2008
--- openafs/src/WINNT/client_creds/advtab.cpp	Mon Feb 11 11:44:27 2008
***************
*** 292,309 ****
  
  void Advanced_OnStartup (HWND hDlg)
  {
!    g.fStartup = IsDlgButtonChecked (hDlg, IDC_STARTUP);
  
!    HKEY hk;
!    if (RegCreateKeyEx (HKEY_LOCAL_MACHINE, TEXT(AFSREG_CLT_SVC_PARAM_SUBKEY), 0, NULL, 0,
!                         (IsWow64()?KEY_WOW64_64KEY:0)|KEY_WRITE, NULL, &hk, NULL) == 0)
!       {
!       DWORD dwSize = sizeof(g.fStartup);
!       DWORD dwType = REG_DWORD;
!       RegSetValueEx (hk, TEXT("ShowTrayIcon"), NULL, dwType, (PBYTE)&g.fStartup, dwSize);
!       RegCloseKey (hk);
!       }
  
!    Shortcut_FixStartup (cszSHORTCUT_NAME, g.fStartup);
  }
  
--- 292,319 ----
  
  void Advanced_OnStartup (HWND hDlg)
  {
!     BOOL bSuccess  = FALSE;
!     g.fStartup = IsDlgButtonChecked (hDlg, IDC_STARTUP);
  
!     HKEY hk;
!     if (RegCreateKeyEx (HKEY_LOCAL_MACHINE, TEXT(AFSREG_CLT_SVC_PARAM_SUBKEY), 0, NULL, 0,
!                          (IsWow64()?KEY_WOW64_64KEY:0)|KEY_WRITE, NULL, &hk, NULL) == 0)
!     {
!         DWORD dwSize = sizeof(g.fStartup);
!         DWORD dwType = REG_DWORD;
!         RegSetValueEx (hk, TEXT("ShowTrayIcon"), NULL, dwType, (PBYTE)&g.fStartup, dwSize);
!         RegCloseKey (hk);
  
!         bSuccess = Shortcut_FixStartup (cszSHORTCUT_NAME, g.fStartup);
!     }
! 
!     if (!bSuccess) {
!         // Reset the state
!         g.fStartup = !g.fStartup;
!         CheckDlgButton(hDlg, IDC_STARTUP, g.fStartup);
! 
!         // Report error to user
!         Message (MB_OK | MB_ICONHAND, IDS_STARTUP_CHANGE_TITLE, IDS_STARTUP_CHANGE_ERROR);
!     }
  }
  
Index: openafs/src/WINNT/client_creds/main.cpp
diff -c openafs/src/WINNT/client_creds/main.cpp:1.16.4.1 openafs/src/WINNT/client_creds/main.cpp:1.16.4.2
*** openafs/src/WINNT/client_creds/main.cpp:1.16.4.1	Fri Feb  8 21:32:23 2008
--- openafs/src/WINNT/client_creds/main.cpp	Mon Feb 11 11:44:27 2008
***************
*** 148,154 ****
              fUninstall = TRUE;
              break;
  
! 		 case ':':
               CopyAnsiToString(g.SmbName,pszCmdLineA);
  			 MapShareName(pszCmdLineA);
  			 break;
--- 148,154 ----
              fUninstall = TRUE;
              break;
  
!          case ':':
               CopyAnsiToString(g.SmbName,pszCmdLineA);
  			 MapShareName(pszCmdLineA);
  			 break;
***************
*** 175,181 ****
     else if (fUninstall)
        Shortcut_FixStartup (cszSHORTCUT_NAME, g.fStartup = FALSE);
  
!    if (fInstall)
        {
        HKEY hk;
        if (RegCreateKeyEx (HKEY_CURRENT_USER, AFSREG_USER_OPENAFS_SUBKEY, 0, NULL, 0,
--- 175,181 ----
     else if (fUninstall)
        Shortcut_FixStartup (cszSHORTCUT_NAME, g.fStartup = FALSE);
  
!    if (fInstall || fUninstall)
        {
        HKEY hk;
        if (RegCreateKeyEx (HKEY_CURRENT_USER, AFSREG_USER_OPENAFS_SUBKEY, 0, NULL, 0,
Index: openafs/src/WINNT/client_creds/resource.h
diff -c openafs/src/WINNT/client_creds/resource.h:1.6 openafs/src/WINNT/client_creds/resource.h:1.6.4.1
*** openafs/src/WINNT/client_creds/resource.h:1.6	Sun Aug 14 07:25:23 2005
--- openafs/src/WINNT/client_creds/resource.h	Mon Feb 11 11:44:27 2008
***************
*** 59,64 ****
--- 59,66 ----
  #define IDS_BADSUB_DESC                       49
  #define IDS_TITLE_95                          50
  #define IDS_CREDS_EXPIRED                     51
+ #define IDS_STARTUP_CHANGE_TITLE              52
+ #define IDS_STARTUP_CHANGE_ERROR              53
  
  #define IDI_MAIN                        100
  #define IDD_MAIN                        101
Index: openafs/src/WINNT/client_creds/shortcut.cpp
diff -c openafs/src/WINNT/client_creds/shortcut.cpp:1.10.4.1 openafs/src/WINNT/client_creds/shortcut.cpp:1.10.4.2
*** openafs/src/WINNT/client_creds/shortcut.cpp:1.10.4.1	Fri Feb  8 21:32:23 2008
--- openafs/src/WINNT/client_creds/shortcut.cpp	Mon Feb 11 11:44:27 2008
***************
*** 79,87 ****
  } 
  
  
! void Shortcut_FixStartup (LPCTSTR pszLinkName, BOOL fAutoStart)
  {
     TCHAR szShortcut[ MAX_PATH + 10 ] = TEXT("");
  
     HKEY hk;
     if (RegOpenKey (HKEY_LOCAL_MACHINE, TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders"), &hk) == 0)
--- 79,88 ----
  } 
  
  
! BOOL Shortcut_FixStartup (LPCTSTR pszLinkName, BOOL fAutoStart)
  {
     TCHAR szShortcut[ MAX_PATH + 10 ] = TEXT("");
+    BOOL bSuccess;
  
     HKEY hk;
     if (RegOpenKey (HKEY_LOCAL_MACHINE, TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders"), &hk) == 0)
***************
*** 133,143 ****
                 RegCloseKey (hk);
             }
         }
!        Shortcut_Create (szShortcut, szSource, "Autostart Authentication Agent", szParams);
     }
     else // (!g.fAutoStart)
     {
!       DeleteFile (szShortcut);
     }
  }
  
--- 134,146 ----
                 RegCloseKey (hk);
             }
         }
!        bSuccess = Shortcut_Create (szShortcut, szSource, "Autostart Authentication Agent", szParams);
     }
     else // (!g.fAutoStart)
     {
!       bSuccess = DeleteFile (szShortcut);
     }
+ 
+    return bSuccess;
  }
  
Index: openafs/src/WINNT/client_creds/shortcut.h
diff -c openafs/src/WINNT/client_creds/shortcut.h:1.3 openafs/src/WINNT/client_creds/shortcut.h:1.3.14.1
*** openafs/src/WINNT/client_creds/shortcut.h:1.3	Fri Nov 21 13:33:10 2003
--- openafs/src/WINNT/client_creds/shortcut.h	Mon Feb 11 11:44:27 2008
***************
*** 19,25 ****
  void Shortcut_Init (void);
  void Shortcut_Exit (void);
  BOOL Shortcut_Create (LPTSTR pszTarget, LPCTSTR pszSource, LPTSTR pszDesc = NULL, LPTSTR pszArgs = NULL);
! void Shortcut_FixStartup (LPCTSTR pszLinkName, BOOL fAutoStart);
  
  
  #endif
--- 19,25 ----
  void Shortcut_Init (void);
  void Shortcut_Exit (void);
  BOOL Shortcut_Create (LPTSTR pszTarget, LPCTSTR pszSource, LPTSTR pszDesc = NULL, LPTSTR pszArgs = NULL);
! BOOL Shortcut_FixStartup (LPCTSTR pszLinkName, BOOL fAutoStart);
  
  
  #endif
Index: openafs/src/WINNT/client_creds/window.cpp
diff -c openafs/src/WINNT/client_creds/window.cpp:1.16.4.2 openafs/src/WINNT/client_creds/window.cpp:1.16.4.3
*** openafs/src/WINNT/client_creds/window.cpp:1.16.4.2	Fri Feb  8 21:32:23 2008
--- openafs/src/WINNT/client_creds/window.cpp	Tue Feb 12 08:21:17 2008
***************
*** 16,21 ****
--- 16,24 ----
  
  #include "afscreds.h"
  
+ #define SECURITY_WIN32 1
+ #include <security.h>
+ 
  /*
   * DEFINITIONS ________________________________________________________________
   *
***************
*** 255,261 ****
  
      TCHAR szVersion[256];
      DWORD dwPatch = 0;
!     TCHAR szUser[256];
      GetString (szVersion, IDS_UNKNOWN);
      GetString (szUser, IDS_UNKNOWN);
  
--- 258,264 ----
  
      TCHAR szVersion[256];
      DWORD dwPatch = 0;
!     TCHAR szUser[1024];
      GetString (szVersion, IDS_UNKNOWN);
      GetString (szUser, IDS_UNKNOWN);
  
***************
*** 273,321 ****
          RegCloseKey (hk);
      }
  
!     /* We should probably be using GetUserNameEx() for this */
!     BOOL fFoundUserName = FALSE;
!     if (RegOpenKey (HKEY_CURRENT_USER, TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer"), &hk) == 0)
!     {
!         DWORD dwSize = sizeof(szUser);
!         DWORD dwType = REG_SZ;
!         if (RegQueryValueEx (hk, TEXT("Logon User Name"), NULL, &dwType, (PBYTE)szUser, &dwSize) == 0)
!             fFoundUserName = TRUE;
!         RegCloseKey (hk);
!     }
!     if (!fFoundUserName ) 
!     {
!         if (RegOpenKey (HKEY_LOCAL_MACHINE, TEXT("Software\\Microsoft\\Windows NT\\CurrentVersion\\Explorer"), &hk) == 0)
!         {
!             DWORD dwSize = sizeof(szUser);
!             DWORD dwType = REG_SZ;
!             if (RegQueryValueEx (hk, TEXT("Logon User Name"), NULL, &dwType, (PBYTE)szUser, &dwSize) == 0)
!                 fFoundUserName = TRUE;
!             RegCloseKey (hk);
!         }
!     }
!     if (!fFoundUserName ) 
!     {
!         if (RegOpenKey (HKEY_LOCAL_MACHINE, TEXT("Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon"), &hk) == 0)
!         {
!             DWORD dwSize = sizeof(szUser);
!             DWORD dwType = REG_SZ;
!             if (RegQueryValueEx (hk, TEXT("DefaultUserName"), NULL, &dwType, (PBYTE)szUser, &dwSize) == 0)
!                 fFoundUserName = TRUE;
!             RegCloseKey (hk);
!         }
!     }   
!     if (!fFoundUserName)
!     {
!         if (RegOpenKey (HKEY_LOCAL_MACHINE, TEXT("Network\\Logon"), &hk) == 0)
!         {
!             DWORD dwSize = sizeof(szUser);
!             DWORD dwType = REG_SZ;
!             if (RegQueryValueEx (hk, TEXT("UserName"), NULL, &dwType, (PBYTE)szUser, &dwSize) == 0)
!                 fFoundUserName = TRUE;
!             RegCloseKey (hk);
!         }
!     }
  
      TCHAR szSource[ cchRESOURCE ];
      TCHAR szTarget[ cchRESOURCE ];
--- 276,284 ----
          RegCloseKey (hk);
      }
  
!     DWORD dwUserLen =  sizeof(szUser)/sizeof(TCHAR);
!     if (!GetUserNameEx(NameUserPrincipal, szUser, &dwUserLen))
!         GetUserNameEx(NameSamCompatible, szUser, &dwUserLen);
  
      TCHAR szSource[ cchRESOURCE ];
      TCHAR szTarget[ cchRESOURCE ];
Index: openafs/src/WINNT/client_creds/lang/en_US/afscreds.rc
diff -c openafs/src/WINNT/client_creds/lang/en_US/afscreds.rc:1.9.4.1 openafs/src/WINNT/client_creds/lang/en_US/afscreds.rc:1.9.4.2
*** openafs/src/WINNT/client_creds/lang/en_US/afscreds.rc:1.9.4.1	Tue Dec 12 15:41:18 2006
--- openafs/src/WINNT/client_creds/lang/en_US/afscreds.rc	Mon Feb 11 11:44:29 2008
***************
*** 561,566 ****
--- 561,568 ----
      IDS_BADSUB_DESC         "The drive letter description you entered cannot be used.\n\nA drive letter description may have no more than 12 characters, and may not contain spaces or tabs."
      IDS_TITLE_95            "AFS Light"
      IDS_CREDS_EXPIRED       "%1   (expired)"
+     IDS_STARTUP_CHANGE_TITLE "Error - Startup Setting"
+     IDS_STARTUP_CHANGE_ERROR "Unable to change startup state.\nPermission denied."
  END
  #endif    // English (U.S.) resources
  /////////////////////////////////////////////////////////////////////////////
Index: openafs/src/WINNT/client_osi/NTMakefile
diff -c openafs/src/WINNT/client_osi/NTMakefile:1.10.4.2 openafs/src/WINNT/client_osi/NTMakefile:1.10.4.3
*** openafs/src/WINNT/client_osi/NTMakefile:1.10.4.2	Sat Feb  2 08:43:23 2008
--- openafs/src/WINNT/client_osi/NTMakefile	Tue Feb 12 08:32:53 2008
***************
*** 45,51 ****
  	osidebug.obj
  
  EXELIBS = \
! 	rpcrt4.lib rpcns4.lib \
  	Ws2_32.lib shell32.lib \
  	$(DESTDIR)\lib\libosi.lib
  
--- 45,52 ----
  	osidebug.obj
  
  EXELIBS = \
! 	rpcrt4.lib \
! #       rpcns4.lib \
  	Ws2_32.lib shell32.lib \
  	$(DESTDIR)\lib\libosi.lib
  
***************
*** 71,77 ****
  
  DLLLIBS =\
          rpcrt4.lib \
!         rpcns4.lib
  
  $(DLLFILE): $(DLLOBJS) 
  	$(DLLGUILINK) $(DLLLIBS) -def:libosi.def
--- 72,78 ----
  
  DLLLIBS =\
          rpcrt4.lib \
! #       rpcns4.lib
  
  $(DLLFILE): $(DLLOBJS) 
  	$(DLLGUILINK) $(DLLLIBS) -def:libosi.def
Index: openafs/src/WINNT/client_osi/osilog.c
diff -c openafs/src/WINNT/client_osi/osilog.c:1.12.4.2 openafs/src/WINNT/client_osi/osilog.c:1.12.4.3
*** openafs/src/WINNT/client_osi/osilog.c:1.12.4.2	Sat Oct  7 18:36:03 2006
--- openafs/src/WINNT/client_osi/osilog.c	Thu Feb 14 09:09:18 2008
***************
*** 273,278 ****
--- 273,282 ----
  {
  	char *saveplace;
  
+         if (!logp) return s;
+ 
+         if (!logp->enabled) s;
+ 
  	if (s == NULL) return NULL;
  
          thrd_EnterCrit(&logp->cs);
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.26 openafs/src/WINNT/doc/install/Documentation/en_US/html/index.htm:1.5.4.27
*** openafs/src/WINNT/doc/install/Documentation/en_US/html/index.htm:1.5.4.26	Wed Feb  6 12:58:17 2008
--- openafs/src/WINNT/doc/install/Documentation/en_US/html/index.htm	Sun Feb 17 23:37:44 2008
***************
*** 57,63 ****
  
  <h1>OpenAFS for Windows</h1>
  
! <h2>Version 1.5.31</h2>
  
  <p class=MsoNormal>&nbsp; </p>
  
--- 57,63 ----
  
  <h1>OpenAFS for Windows</h1>
  
! <h2>Version 1.5.32</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.31
  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.32
  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.26 openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/logo.htm:1.1.6.27
*** openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/logo.htm:1.1.6.26	Wed Feb  6 12:58:20 2008
--- openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/logo.htm	Sun Feb 17 23:37:48 2008
***************
*** 18,24 ****
  .shape {behavior:url(#default#VML);}
  </style>
  <![endif]-->
! <title>OpenAFS for Windows 1.5.31 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.32 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.28 openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes-frames.htm:1.1.4.29
*** openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes-frames.htm:1.1.4.28	Wed Feb  6 12:58:20 2008
--- openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes-frames.htm	Sun Feb 17 23:37:48 2008
***************
*** 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.31 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.32 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.32 openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes.htm:1.6.4.33
*** openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes.htm:1.6.4.32	Wed Feb  6 12:58:20 2008
--- openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes.htm	Sun Feb 17 23:37:48 2008
***************
*** 19,25 ****
  .shape {behavior:url(#default#VML);}
  </style>
  <![endif]-->
! <title>OpenAFS for Windows 1.5.31 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.32 Release Notes</title>
  <o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
   name="PostalCode"/>
  <o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
***************
*** 597,603 ****
  
  <div class=Section1>
  
! <p class=MsoTitle>OpenAFS for Windows 1.5.31<br>
  Release Notes</p>
  
  <p class=MsoBodyText>The Andrew File System (AFS) is a location-independent
--- 597,603 ----
  
  <div class=Section1>
  
! <p class=MsoTitle>OpenAFS for Windows 1.5.32<br>
  Release Notes</p>
  
  <p class=MsoBodyText>The Andrew File System (AFS) is a location-independent
***************
*** 657,668 ****
  Operational Notes<span style='color:windowtext;display:none;mso-hide:all;
  text-decoration:none;text-underline:none'>. 2</span></a></span></p>
  
! <p class=MsoToc1><span class=MsoHyperlink><a href="#_Toc170268869">4. How to
! Debug Problems with OpenAFS for Windows:<span style='color:windowtext;
  display:none;mso-hide:all;text-decoration:none;text-underline:none'> 11</span></a></span></p>
  
  <p class=MsoToc1><span class=MsoHyperlink><a href="#_Toc115417113">5. Reporting
! Bugs:<span style='color:windowtext;display:none;mso-hide:all;text-decoration:
  none;text-underline:none'> 13</span></a></span></p>
  
  <p class=MsoToc1><span class=MsoHyperlink><a href="#_Toc115417114">6. How to
--- 657,668 ----
  Operational Notes<span style='color:windowtext;display:none;mso-hide:all;
  text-decoration:none;text-underline:none'>. 2</span></a></span></p>
  
! <p class=MsoToc1><span class=MsoHyperlink><a href="#_Toc190064072">4. How to
! Debug Problems with OpenAFS for Windows<span style='color:windowtext;
  display:none;mso-hide:all;text-decoration:none;text-underline:none'> 11</span></a></span></p>
  
  <p class=MsoToc1><span class=MsoHyperlink><a href="#_Toc115417113">5. Reporting
! Bugs<span style='color:windowtext;display:none;mso-hide:all;text-decoration:
  none;text-underline:none'> 13</span></a></span></p>
  
  <p class=MsoToc1><span class=MsoHyperlink><a href="#_Toc115417114">6. How to
***************
*** 2346,2352 ****
  allocate additional space.</span></p>
  
  <h1><span style='mso-bookmark:_Toc115416145'><a name="_Toc190064072">4. How to
! Debug Problems with OpenAFS for Windows:</a></span></h1>
  
  <p class=MsoNormal>OpenAFS for Windows provides a wide range of tools to assist
  you in debugging problems.&nbsp; The techniques available to you are varied
--- 2346,2352 ----
  allocate additional space.</span></p>
  
  <h1><span style='mso-bookmark:_Toc115416145'><a name="_Toc190064072">4. How to
! Debug Problems with OpenAFS for Windows</a></span></h1>
  
  <p class=MsoNormal>OpenAFS for Windows provides a wide range of tools to assist
  you in debugging problems.&nbsp; The techniques available to you are varied
***************
*** 2512,2517 ****
--- 2512,2520 ----
  with access to the source code and a debugger.&nbsp;&nbsp; The &quot;fs
  minidump&quot; command can be used to force the generation of a MiniDump file
  containing the state of all of the threads in the AFS Client Service process.</p>
+ <p class=MsoNormal>The <a href="#_Toc190064189">MiniDumpType</a> registry
+ value can be used to adjust the scope of the process information included within
+ the dump file.<p>
  
  <h2><a name="_Toc190064078"></a><a name="_Toc139993139"></a><a
  name="_Toc126872216"></a><a name="_Toc115417087"></a><span style='mso-bookmark:
***************
*** 2644,2651 ****
  
  <h1><a name="_Toc190064083"></a><a name="_Toc139993143"></a><a
  name="_Toc126872220"></a><a name="_Toc115417113"></a><a name="_Toc115417091"></a><a
! name="_5._Reporting_Bugs:"></a><span style='mso-bookmark:_Toc190064083'>5.
! Reporting Bugs:</span></h1>
  
  <p class=MsoNormal>Bug reports should be sent to <a
  href="mailto:openafs-bugs@openafs.org?subject=Bug%20Report">openafs-bugs@openafs.org</a>.&nbsp;
--- 2647,2654 ----
  
  <h1><a name="_Toc190064083"></a><a name="_Toc139993143"></a><a
  name="_Toc126872220"></a><a name="_Toc115417113"></a><a name="_Toc115417091"></a><a
! name="_5._Reporting_Bugs"></a><span style='mso-bookmark:_Toc190064083'>5.
! Reporting Bugs</span></h1>
  
  <p class=MsoNormal>Bug reports should be sent to <a
  href="mailto:openafs-bugs@openafs.org?subject=Bug%20Report">openafs-bugs@openafs.org</a>.&nbsp;
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.27 openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/toc.htm:1.2.6.28
*** openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/toc.htm:1.2.6.27	Wed Feb  6 12:58:21 2008
--- openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/toc.htm	Sun Feb 17 23:37:49 2008
***************
*** 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.31 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.32 Table of Contents</title>
  <!--[if gte mso 9]><xml>
   <o:DocumentProperties>
    <o:Author>Jeffrey Altman</o:Author>
Index: openafs/src/WINNT/netidmgr_plugin/NTMakefile
diff -c openafs/src/WINNT/netidmgr_plugin/NTMakefile:1.1.2.6 openafs/src/WINNT/netidmgr_plugin/NTMakefile:1.1.2.7
*** openafs/src/WINNT/netidmgr_plugin/NTMakefile:1.1.2.6	Tue Aug 28 12:54:46 2007
--- openafs/src/WINNT/netidmgr_plugin/NTMakefile	Tue Feb 12 09:02:35 2008
***************
*** 59,65 ****
  incflags=$(kfwincflags) $(afsincflags) -I.
  pldefines=-DUNICODE -D_UNICODE
  cdebug=$(cdebug) -Os -Zi
! cwarn=$(cwarn) /Wp64 /WX
  
  plcflags=$(cdebug) $(cflags) $(incflags) $(pldefines) $(cwarn) $(cvarsdll)
  
--- 59,65 ----
  incflags=$(kfwincflags) $(afsincflags) -I.
  pldefines=-DUNICODE -D_UNICODE
  cdebug=$(cdebug) -Os -Zi
! cwarn=$(cwarn) /Wp64
  
  plcflags=$(cdebug) $(cflags) $(incflags) $(pldefines) $(cwarn) $(cvarsdll)
  
Index: openafs/src/config/NTMakefile.amd64_w2k
diff -c openafs/src/config/NTMakefile.amd64_w2k:1.24.2.37 openafs/src/config/NTMakefile.amd64_w2k:1.24.2.38
*** openafs/src/config/NTMakefile.amd64_w2k:1.24.2.37	Sun Feb 10 23:04:05 2008
--- openafs/src/config/NTMakefile.amd64_w2k	Mon Feb 18 23:30:19 2008
***************
*** 84,90 ****
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=5
! AFSPRODUCT_VER_PATCH=3100
  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=3200
  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.36 openafs/src/config/NTMakefile.i386_nt40:1.84.2.37
*** openafs/src/config/NTMakefile.i386_nt40:1.84.2.36	Sun Feb 10 23:04:05 2008
--- openafs/src/config/NTMakefile.i386_nt40	Mon Feb 18 23:30:19 2008
***************
*** 84,90 ****
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=5
! AFSPRODUCT_VER_PATCH=3100
  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=3200
  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.37 openafs/src/config/NTMakefile.i386_w2k:1.23.2.38
*** openafs/src/config/NTMakefile.i386_w2k:1.23.2.37	Sun Feb 10 23:04:05 2008
--- openafs/src/config/NTMakefile.i386_w2k	Mon Feb 18 23:30:19 2008
***************
*** 84,90 ****
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=5
! AFSPRODUCT_VER_PATCH=3100
  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=3200
  AFSPRODUCT_VER_BUILD=0
  
  AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
Index: openafs/src/config/param.arm_linux26.h
diff -c openafs/src/config/param.arm_linux26.h:1.1.2.2 openafs/src/config/param.arm_linux26.h:1.1.2.3
*** openafs/src/config/param.arm_linux26.h:1.1.2.2	Tue Jan 15 00:12:14 2008
--- openafs/src/config/param.arm_linux26.h	Mon Feb 18 22:39:17 2008
***************
*** 23,28 ****
--- 23,31 ----
  #define AFS_MOUNT_AFS "afs"	/* The name of the filesystem type. */
  #define AFS_SYSCALL 137
  #define AFS_64BIT_IOPS_ENV  1
+ #ifndef __NR_afs_syscall
+ #define __NR_afs_syscall 137
+ #endif
  #define AFS_NAMEI_ENV     1	/* User space interface to file system */
  #define AFS_64BIT_ENV		1
  #define AFS_64BIT_CLIENT	1
Index: openafs/src/libafs/MakefileProto.LINUX.in
diff -c openafs/src/libafs/MakefileProto.LINUX.in:1.54.4.3 openafs/src/libafs/MakefileProto.LINUX.in:1.54.4.4
*** openafs/src/libafs/MakefileProto.LINUX.in:1.54.4.3	Mon Jul 31 17:27:41 2006
--- openafs/src/libafs/MakefileProto.LINUX.in	Tue Feb 19 10:07:36 2008
***************
*** 194,200 ****
  	ln -fs ${LINUX_KERNEL_PATH}/arch/um/include/sysdep
  <amd64_linux24 amd64_linux26>
  	ln -fs ${LINUX_KERNEL_PATH}/include/asm-x86_64 asm
! <s390_linux22 s390_linux24 s390_linux26 s390x_linux26>
  	ln -fs ${LINUX_KERNEL_PATH}/include/asm-s390 asm
  <s390x_linux22 s390x_linux24 s390x_linux26>
  	ln -fs ${LINUX_KERNEL_PATH}/include/asm-s390x asm
--- 194,200 ----
  	ln -fs ${LINUX_KERNEL_PATH}/arch/um/include/sysdep
  <amd64_linux24 amd64_linux26>
  	ln -fs ${LINUX_KERNEL_PATH}/include/asm-x86_64 asm
! <s390_linux22 s390_linux24 s390_linux26>
  	ln -fs ${LINUX_KERNEL_PATH}/include/asm-s390 asm
  <s390x_linux22 s390x_linux24 s390x_linux26>
  	ln -fs ${LINUX_KERNEL_PATH}/include/asm-s390x asm
Index: openafs/src/packaging/RedHat/kmodtool
diff -c openafs/src/packaging/RedHat/kmodtool:1.1.2.3 openafs/src/packaging/RedHat/kmodtool:removed
*** openafs/src/packaging/RedHat/kmodtool:1.1.2.3	Wed Jan 23 00:30:30 2008
--- openafs/src/packaging/RedHat/kmodtool	Tue Feb 19 22:42:31 2008
***************
*** 1,176 ****
- #!/bin/bash
- 
- # kmodtool - Helper script for building kernel module RPMs
- # Copyright (c) 2003-2007 Ville SkyttÃ¤ <ville.skytta@iki.fi>,
- #                         Thorsten Leemhuis <fedora@leemhuis.info>
- #
- # Modified by Simon Wilkinson for OpenAFS
- 
- # Permission is hereby granted, free of charge, to any person obtaining
- # a copy of this software and associated documentation files (the
- # "Software"), to deal in the Software without restriction, including
- # without limitation the rights to use, copy, modify, merge, publish,
- # distribute, sublicense, and/or sell copies of the Software, and to
- # permit persons to whom the Software is furnished to do so, subject to
- # the following conditions:
- #
- # The above copyright notice and this permission notice shall be
- # included in all copies or substantial portions of the Software.
- #
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- 
- shopt -s extglob
- 
- myprog="kmodtool"
- myver="0.10.13"
- knownvariants=@(BOOT|PAE?(-debug)|@(big|huge)mem|debug|enterprise|kdump|?(large)smp?(-debug)|uml|xen?([0U])?(-PAE))
- kmod_name=
- kver=
- verrel=
- variant=
- 
- get_verrel ()
- {
-   verrel=${1:-$(uname -r)}
-   verrel=${verrel%%$knownvariants}
- }
- 
- print_verrel ()
- {
-   get_verrel $@
-   echo "${verrel}"
- }
- 
- get_variant ()
- {
-   get_verrel $@
-   variant=${1:-$(uname -r)}
-   variant=${variant##$verrel}
-   variant=${variant:-'""'}
- }
- 
- print_variant ()
- {
-   get_variant $@
-   echo "${variant}"
- }
- 
- 
- get_rpmtemplate ()
- {
-     local variant="${1}"
-     local dashvariant="${variant:+-${variant}}"
-     case "$verrel" in
-         *.EL*) kdep="kernel${dashvariant}-%{_target_cpu} = ${verrel}" ;;
-         *)     kdep="kernel-%{_target_cpu} = ${verrel}${variant}"     ;;
-     esac
-     cat <<EOF
- %package       -n kmod-${kmod_name}${dashvariant}
- Summary:          ${kmod_name} kernel module(s)
- Group:            System Environment/Kernel
- Provides:         kernel-modules = ${verrel}${variant}
- Provides:         ${kmod_name}-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
- Provides:         openafs-kernel = %{PACKAGE_VERSION}
- Requires:         ${kdep}
- Requires:         ${kmod_name}-kmod-common >= %{?epoch:%{epoch}:}%{version}
- Requires(post):   /sbin/depmod
- Requires(postun): /sbin/depmod
- Release:          %{pkgrel}.%(echo ${verrel} | tr - _)
- BuildRequires:    kernel${dashvariant}-devel-%{_target_cpu} = ${verrel}
- %description   -n kmod-${kmod_name}${dashvariant}
- This package provides the ${kmod_name} kernel modules built for the Linux
- kernel ${verrel}${variant} for the %{_target_cpu} family of processors.
- %post          -n kmod-${kmod_name}${dashvariant}
- /sbin/depmod -aeF /boot/System.map-${verrel}${variant} ${verrel}${variant} > /dev/null || :
- %postun        -n kmod-${kmod_name}${dashvariant}
- /sbin/depmod -aF /boot/System.map-${verrel}${variant} ${verrel}${variant} &> /dev/null || :
- %files         -n kmod-${kmod_name}${dashvariant}
- %defattr(644,root,root,755)
- /lib/modules/${verrel}${variant}/extra/${kmod_name}/
- 
- EOF
- }
- 
- print_rpmtemplate ()
- {
-   kmod_name="${1}"
-   shift
-   kver="${1}"
-   get_verrel "${1}"
-   shift
-   if [ -z "${kmod_name}" ] ; then
-     echo "Please provide the kmodule-name as first parameter." >&2
-     exit 2
-   elif [ -z "${kver}" ] ; then
-     echo "Please provide the kver as second parameter." >&2
-     exit 2
-   elif [ -z "${verrel}" ] ; then
-     echo "Couldn't find out the verrel." >&2
-     exit 2
-   fi
- 
-   for variant in "$@" ; do
-     get_rpmtemplate "${variant}"
-   done
- }
- 
- usage ()
- {
-   cat <<EOF
- You called: ${invocation}
- 
- Usage: ${myprog} <command> <option>+
-  Commands:
-   verrel <uname>                               
-     - Get "base" version-release.
-   variant <uname>                               
-     - Get variant from uname.
-   rpmtemplate <mainpgkname> <uname> <variants> 
-     - Return a template for
-   version  
-     - Output version number and exit.
- EOF
- }
- 
- invocation="$(basename ${0}) $@"
- while [ "${1}" ] ; do
-   case "${1}" in
-     verrel)
-       shift
-       print_verrel $@
-       exit $?
-       ;;
-     variant)
-       shift
-       print_variant $@
-       exit $?
-       ;;
-     rpmtemplate)
-       shift
-       print_rpmtemplate "$@"
-       exit $?
-       ;;
-     version)
-       echo "${myprog} ${myver}"
-       exit 0
-       ;;
-     *)
-       echo "Error: Unknown option '${1}'." >&2
-       usage >&2
-       exit 2
-       ;;
-   esac
- done
- 
- # Local variables:
- # mode: sh
- # sh-indentation: 2
- # indent-tabs-mode: nil
- # End:
- # ex: ts=2 sw=2 et
--- 0 ----
Index: openafs/src/packaging/RedHat/mockbuild.pl
diff -c /dev/null openafs/src/packaging/RedHat/mockbuild.pl:1.1.4.2
*** /dev/null	Tue Feb 19 22:42:31 2008
--- openafs/src/packaging/RedHat/mockbuild.pl	Mon Feb 18 14:20:52 2008
***************
*** 0 ****
--- 1,313 ----
+ #!/usr/bin/perl
+ # mockbuild - mass RPM build driver for use with mock and many kernel-devel
+ #             RPMs
+ # from Simon Wilkinson for OpenAFS
+ # for "modern" yum, use "showdupesfromrepos=1" in all cfg files in /etc/mock
+ 
+ use strict;
+ use warnings;
+ 
+ use Getopt::Long;
+ use File::Path;
+ use IO::Dir;
+ 
+ my $suser="nsu";
+ my $rootbase="/var/lib/mock/";
+ my $resultbase="/tmp/result/";
+ my $stashbase="/disk/scratch/repository/";
+ my $mockcommand = "/usr/bin/mock";
+ my $buildall = 0;
+ 
+ my @newrpms;
+ 
+ my %platconf = ( "fedora-5-i386" => { osver => "fc5",
+ 				      kmod => '1',
+ 				      basearch => 'i386',
+ 				      updaterepo => 'updates-released',
+ 				      results => 'fc5/i386' },
+ 		 "fedora-5-x86_64" => { osver => "fc5",
+ 				       kmod => '1',
+ 				       basearch => 'x86_64',
+ 				       updaterepo => 'updates-released',
+ 				       results => 'fc5/x86_64' },
+ 		 "fedora-6-i386" => { osver => "fc6", 
+ 				      kmod => '1', 
+ 				      basearch => 'i386',
+ 				      updaterepo => 'updates-released',
+ 				      results => "fc6/i386" },
+ 		 "fedora-6-x86_64" => { osver => "fc6",
+ 					kmod => '1',
+ 					basearch => 'x86_64',
+ 				        updaterepo => 'updates-released',
+ 					results => "fc6/x86_64" },
+ 		 "fedora-7-i386" => { osver => "fc7", 
+ 				      kmod => '1', 
+ 				      basearch => 'i386',
+ 				      updaterepo => 'updates-released',
+ 				      results => "fc7/i386" },
+ 		 "fedora-7-x86_64" => { osver => "fc7",
+ 					kmod => '1',
+ 					basearch => 'x86_64',
+ 				        updaterepo => 'updates-released',
+ 					results => "fc7/x86_64" },
+ 		 "fedora-8-i386" => { osver => "fc8", 
+ 				      kmod => '1', 
+ 				      basearch => 'i386',
+ 				      updaterepo => 'updates-released',
+ 				      results => "fc8/i386" },
+ 		 "fedora-8-x86_64" => { osver => "fc8",
+ 					kmod => '1',
+ 					basearch => 'x86_64',
+ 				        updaterepo => 'updates-released',
+ 					results => "fc8/x86_64" },
+ 		 "centos-4-i386" => { osver => "el4",
+ 				     kmod => '1',
+ 				     basearch => 'i386',
+ 				     updaterepo => 'update',
+ 				     results => 'el4/i386' },
+ 		 "centos-4-x86_64" => { osver => "el4",
+ 				       kmod => '1',
+ 				       basearch => 'x86_64',
+ 				       updaterepo => 'update',
+ 				       results => "el4/x86_64" },
+ 		 "centos-5-i386" => { osver => "el5", 
+ 				      kmod => '1', 
+ 				      basearch => 'i386',
+ 				      updaterepo => 'update',
+ 				      results => "el5/i386" },
+ 		 "centos-5-x86_64" => { osver => "el5",
+ 					kmod => '1',
+ 				   	basearch => 'x86_64',
+ 				        updaterepo => 'update',
+ 					results => "el5/x86_64" },
+ #		 "fedora-development-i386" => { osver => "fcd",
+ #					  kmod => '1',
+ #					  basearch => 'i386',
+ #					  results => 'fedora-devel/i386'},
+ #		 "fedora-development-x86_64" => { osver => "fcd",
+ #					    kmod => '1',
+ #					    basearch => 'x86_64',
+ #					    results => 'fedora-devel/x86_64'} 
+ );
+ 
+ # The following are kernels that we can't successfully build modules against
+ # due to issues in the packaged kernel-devel RPM.
+ 
+ my %badkernels = (
+ 	"2.6.21-2950.fc8" => { "xen" => 1} # Missing build ID
+ );
+ 
+ my @platforms = @ARGV;
+ my $srpm = pop @platforms;
+ 
+ if (!$srpm || $#platforms==-1) {
+   print "Usage: $0 <platform> [<platform> [<platform> ...] ]  <srpm>\n";
+   print "    Platform may be:\n";
+   foreach ("all", sort(keys(%platconf))) { print "        ".$_."\n"; };
+   exit(1);
+ }
+ 
+ my $oafsversion = `rpm -q --queryformat=%{VERSION} -p $srpm` or die $!;
+ chomp $oafsversion;
+ my $oafsrelease = `rpm -q --queryformat=%{RELEASE} -p $srpm` or die $!;
+ chomp $oafsrelease;
+ $oafsrelease=~s/^[^\.]*\.(.*)$/$1/;
+ 
+ print "Release is $oafsrelease\n";
+ 
+ if ($platforms[0] eq "all" and $#platforms == 0) {
+   @platforms = keys(%platconf);
+ }
+ 
+ foreach my $platform (@platforms) {
+   print "*******************************************************************\n";
+   print "Building for $platform\n";
+   die "Unknown platform $platform" if !$platconf{$platform};
+   my $osver = $platconf{$platform}{'osver'};
+   my $root = $rootbase.$platform."/root";
+   my $mockresults = $rootbase.$platform."/result";
+   my $resultdir = $resultbase.$platconf{$platform}{'results'};
+   my $basearch = $platconf{$platform}{'basearch'};
+   my $rpmstashdir = $stashbase.$platconf{$platform}{'results'}."/";
+ 
+   my $yumcachedir;
+   if (exists($platconf{$platform}{'updaterepo'})) {
+     $yumcachedir = $rootbase."cache/".$platform."/yum_cache/".
+ 		   $platconf{$platform}{'updaterepo'}."/packages/";
+   }
+ 
+   File::Path::mkpath($resultdir, 0, 0755);
+ 
+   if (system($mockcommand, "-r", $platform, "init") != 0) {
+     die "Initialising the root failed: $?\n";
+   }
+ 
+   my %modulelist;
+ 
+   print "-------------------------------------------------------------------\n";
+   print "Finding available kernel modules\n";
+ 
+   my $arbitraryversion = "";
+   my $modules=`$suser -c 'yum --installroot $root provides kernel-devel'`;
+   if ($modules eq "") {
+       $modules=`$suser -c 'yum -d 2 --installroot $root provides kernel-devel'`;
+       my $modulen;
+       my %modulel;
+       foreach $modulen (split(/\n/, $modules)) {
+ 	  my ($pk, $colon, $comment)=split(/\s+/, $modulen);
+ 	  if ($pk =~ /^kernel/) {
+ 	      $modulel{$pk} = "$pk";
+ 	  } 
+       }
+       $modulen=join(" ", keys(%modulel));
+       $modules=`$suser -c 'yum --installroot $root list $modulen'`;
+   }
+   foreach my $module (split(/\n/, $modules)) {
+       my ($package, $version, $repo)=split(/\s+/, $module);
+       my ($arch) = ($package=~/\.(.*)$/);
+       my ($variant) = ($package=~/kernel-(.*)-devel/);
+       $variant = "" if !defined($variant);
+       next if ($package !~ /^kernel/);
+       next if ($arch eq "noarch");
+       next 
+ 	  if (exists($badkernels{$version}) && ($badkernels{$version}{$variant}));
+       if ($platform=~/fedora-5/) {
+ 	  next if ($variant eq "xen0"); # Fedora 5 has some bad xen0 kernel-devels
+ 	  next if ($variant eq "smp");
+       }
+       print "$arch : $variant : $version\n";
+       $modulelist{$arch} ={} if !$modulelist{$arch};
+       $modulelist{$arch}{$version} = {} if !$modulelist{$arch}{$version};
+       $modulelist{$arch}{$version}{$variant} = 1;
+       $arbitraryversion = $version;
+   }
+ 
+   if (!$arbitraryversion) {
+     die "Unable to find a valid kernel-devel package for $platform\n";
+   }
+ 
+   print "-------------------------------------------------------------------\n";
+   print "Building the userland RPMs\n";
+   my @rpms = ('', '-authlibs', '-authlibs-devel', '-client', '-compat',
+ 	      '-debuginfo', '-devel', '-docs', '-kernel-source', '-kpasswd',
+ 	      '-krb5', '-server');
+ 
+   my $missing = 0;
+   foreach my $rpm (@rpms) {
+     if (! -f $resultdir."/openafs".$rpm."-".$oafsversion."-".$osver.".".
+ 	     $oafsrelease.".".$basearch.".rpm") {
+       $missing++;
+       print $resultdir."/openafs".$rpm."-".$oafsversion."-".$osver.".".
+ 	    $oafsrelease.".".$basearch.".rpm is missing!\n"
+     }
+   }
+   if ($missing) {
+     system($mockcommand." -r ".$platform." rebuild ".
+ 		        ' --define "fedorakmod 1" '.
+ 		        ' --define "kernvers '.$arbitraryversion.'" '.
+ 		        ' --define "osvers '.$osver.'" '.
+ 		        ' --define "build_modules 0" '.
+ 		        ' --define "build_userspace 1" '.
+ 		        ' --define "build_authlibs 1" '.
+ 		        $srpm) == 0
+       or die "build failed with : $!\n";
+     foreach my $rpm (@rpms) {
+       system("cp ".$mockresults."/openafs".$rpm."-".$oafsversion."-".
+ 		   $osver.".".$oafsrelease.".".$basearch.".rpm ".
+ 		   $resultdir) == 0
+           or die "Copy failed with : $!\n";
+       push @newrpms, $mockresults."/openafs".$rpm."-".$oafsversion."-".
+ 		     $osver.".".$oafsrelease.".".$basearch.".rpm";
+     }
+   } else {
+     print "All userland RPMs present for $platform. Skipping build\n";
+   }
+ 
+    print "-------------------------------------------------------------------\n";
+   print "Building kernel modules\n";
+ 
+  foreach my $arch (keys(%modulelist)) {
+     foreach my $version (keys(%{$modulelist{$arch}})) {
+       my $kversion = $version;
+       $kversion=~s/-/_/g;
+       my @tobuild;
+ 
+       if ($buildall) {
+ 	@tobuild = keys(%{$modulelist{$arch}{$version}});
+       } else {
+         foreach my $variant (keys(%{$modulelist{$arch}{$version}})) {
+           my $dvariant=$variant;
+           $dvariant.="-" if ($dvariant);
+           if (!-f $resultdir."/kmod-openafs-".$dvariant.
+ 		  $oafsversion."-".$oafsrelease.".".$kversion.".".
+ 		  $arch.".rpm") {
+ 	    push @tobuild, $variant;
+ 	    print $resultdir."/kmod-openafs-".$dvariant.
+                   $oafsversion."-".$oafsrelease.".".$kversion.".".
+                   $arch.".rpm is missing\n";
+           }
+         }
+       }
+ 
+       if ($#tobuild>=0) {
+         my $variants = join(" ", map {$_ or '\\\\\"\\\\\"'} @tobuild);
+         print "Building $arch module for kernel $version with variants $variants\n";
+         system ("setarch $arch $mockcommand -r $platform rebuild ".
+ 			     " --arch ".$arch.
+ 			     ' --define "fedorakmod 1" '.
+ 			     ' --define "osvers '.$osver.'" '.
+ 			     ' --define "kernvers '.$version.'" '.
+ 			     ' --define "kvariants '.$variants.'" '.
+ 			     ' --define "build_modules 1" '.
+ 			     ' --define "build_userspace 0" '.
+ 			     $srpm) == 0
+           or die "Build failed with : $!\n";
+         foreach my $variant (@tobuild) {
+           if ($variant) {
+             $variant.="-";
+           }
+           system("cp ".$mockresults."/kmod-openafs-".$variant.$oafsversion."-".$oafsrelease.".".$kversion.".".$arch.".rpm $resultdir") == 0
+             or die "Copy failed with : $!\n";
+ 	  push @newrpms, $mockresults."/kmod-openafs-".$variant.$oafsversion."-".$oafsrelease.".".$kversion.".".$arch.".rpm";
+         }
+       } else {
+          print "All kernel modules already built for $version on $arch\n";
+       }
+     }
+   }
+   print "-------------------------------------------------------------------\n";
+   print "Creating repository data\n";
+   system ("cd $resultdir; createrepo .") == 0
+     or die "Unable to build repository data\n";
+ 
+   if ($yumcachedir) {
+     print "-------------------------------------------------------------------\n";
+     print "Stashing kernel-devel RPMs\n";
+   
+     my $changed;
+     my $dirh = IO::Dir->new($yumcachedir);
+     if (defined($dirh)) {
+       my $file;
+       while (defined($file = $dirh->read)) {
+         if ( $file=~/^kernel-devel/ &&
+               -f $yumcachedir.$file && ! -f $rpmstashdir.$file) {
+           print "Stashing $file for later use\n";
+           system("cp ".$yumcachedir.$file." ".$rpmstashdir.$file) == 0
+             or die "Copy failed with : $!\n";
+           $changed++;
+         }
+       }
+     }
+  
+     if ($changed) {
+       print "Updating stash repodata\n";
+       system ("cd $rpmstashdir; createrepo .") == 0
+         or die "Unable to update RPM stash repository data\n";
+     }
+   }
+ }
+ 
+ print "=====================================================================\n";
+ print "All builds complete\nBuilt:\n";
+ print join("\n",@newrpms);
+ 
Index: openafs/src/packaging/RedHat/openafs-kmodtool
diff -c /dev/null openafs/src/packaging/RedHat/openafs-kmodtool:1.1.2.2
*** /dev/null	Tue Feb 19 22:42:31 2008
--- openafs/src/packaging/RedHat/openafs-kmodtool	Wed Feb 13 00:28:58 2008
***************
*** 0 ****
--- 1,176 ----
+ #!/bin/bash
+ 
+ # kmodtool - Helper script for building kernel module RPMs
+ # Copyright (c) 2003-2007 Ville SkyttÃ¤ <ville.skytta@iki.fi>,
+ #                         Thorsten Leemhuis <fedora@leemhuis.info>
+ #
+ # Modified by Simon Wilkinson for OpenAFS
+ 
+ # Permission is hereby granted, free of charge, to any person obtaining
+ # a copy of this software and associated documentation files (the
+ # "Software"), to deal in the Software without restriction, including
+ # without limitation the rights to use, copy, modify, merge, publish,
+ # distribute, sublicense, and/or sell copies of the Software, and to
+ # permit persons to whom the Software is furnished to do so, subject to
+ # the following conditions:
+ #
+ # The above copyright notice and this permission notice shall be
+ # included in all copies or substantial portions of the Software.
+ #
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ 
+ shopt -s extglob
+ 
+ myprog="kmodtool"
+ myver="0.10.13"
+ knownvariants=@(BOOT|PAE?(-debug)|@(big|huge)mem|debug|enterprise|kdump|?(large)smp?(-debug)|uml|xen?([0U])?(-PAE))
+ kmod_name=
+ kver=
+ verrel=
+ variant=
+ 
+ get_verrel ()
+ {
+   verrel=${1:-$(uname -r)}
+   verrel=${verrel%%$knownvariants}
+ }
+ 
+ print_verrel ()
+ {
+   get_verrel $@
+   echo "${verrel}"
+ }
+ 
+ get_variant ()
+ {
+   get_verrel $@
+   variant=${1:-$(uname -r)}
+   variant=${variant##$verrel}
+   variant=${variant:-'""'}
+ }
+ 
+ print_variant ()
+ {
+   get_variant $@
+   echo "${variant}"
+ }
+ 
+ 
+ get_rpmtemplate ()
+ {
+     local variant="${1}"
+     local dashvariant="${variant:+-${variant}}"
+     case "$verrel" in
+         *.EL*) kdep="kernel${dashvariant}-%{_target_cpu} = ${verrel}" ;;
+         *)     kdep="kernel-%{_target_cpu} = ${verrel}${variant}"     ;;
+     esac
+     cat <<EOF
+ %package       -n kmod-${kmod_name}${dashvariant}
+ Summary:          ${kmod_name} kernel module(s)
+ Group:            System Environment/Kernel
+ Provides:         kernel-modules = ${verrel}${variant}
+ Provides:         ${kmod_name}-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
+ Provides:         openafs-kernel = %{PACKAGE_VERSION}
+ Requires:         ${kdep}
+ Requires:         ${kmod_name}-kmod-common >= %{?epoch:%{epoch}:}%{version}
+ Requires(post):   /sbin/depmod
+ Requires(postun): /sbin/depmod
+ Release:          %{pkgrel}.%(echo ${verrel} | tr - _)
+ BuildRequires:    kernel${dashvariant}-devel-%{_target_cpu} = ${verrel}
+ %description   -n kmod-${kmod_name}${dashvariant}
+ This package provides the ${kmod_name} kernel modules built for the Linux
+ kernel ${verrel}${variant} for the %{_target_cpu} family of processors.
+ %post          -n kmod-${kmod_name}${dashvariant}
+ /sbin/depmod -aeF /boot/System.map-${verrel}${variant} ${verrel}${variant} > /dev/null || :
+ %postun        -n kmod-${kmod_name}${dashvariant}
+ /sbin/depmod -aF /boot/System.map-${verrel}${variant} ${verrel}${variant} &> /dev/null || :
+ %files         -n kmod-${kmod_name}${dashvariant}
+ %defattr(644,root,root,755)
+ /lib/modules/${verrel}${variant}/extra/${kmod_name}/
+ 
+ EOF
+ }
+ 
+ print_rpmtemplate ()
+ {
+   kmod_name="${1}"
+   shift
+   kver="${1}"
+   get_verrel "${1}"
+   shift
+   if [ -z "${kmod_name}" ] ; then
+     echo "Please provide the kmodule-name as first parameter." >&2
+     exit 2
+   elif [ -z "${kver}" ] ; then
+     echo "Please provide the kver as second parameter." >&2
+     exit 2
+   elif [ -z "${verrel}" ] ; then
+     echo "Couldn't find out the verrel." >&2
+     exit 2
+   fi
+ 
+   for variant in "$@" ; do
+     get_rpmtemplate "${variant}"
+   done
+ }
+ 
+ usage ()
+ {
+   cat <<EOF
+ You called: ${invocation}
+ 
+ Usage: ${myprog} <command> <option>+
+  Commands:
+   verrel <uname>                               
+     - Get "base" version-release.
+   variant <uname>                               
+     - Get variant from uname.
+   rpmtemplate <mainpgkname> <uname> <variants> 
+     - Return a template for
+   version  
+     - Output version number and exit.
+ EOF
+ }
+ 
+ invocation="$(basename ${0}) $@"
+ while [ "${1}" ] ; do
+   case "${1}" in
+     verrel)
+       shift
+       print_verrel $@
+       exit $?
+       ;;
+     variant)
+       shift
+       print_variant $@
+       exit $?
+       ;;
+     rpmtemplate)
+       shift
+       print_rpmtemplate "$@"
+       exit $?
+       ;;
+     version)
+       echo "${myprog} ${myver}"
+       exit 0
+       ;;
+     *)
+       echo "Error: Unknown option '${1}'." >&2
+       usage >&2
+       exit 2
+       ;;
+   esac
+ done
+ 
+ # Local variables:
+ # mode: sh
+ # sh-indentation: 2
+ # indent-tabs-mode: nil
+ # End:
+ # ex: ts=2 sw=2 et
Index: openafs/src/packaging/RedHat/openafs.spec.in
diff -c openafs/src/packaging/RedHat/openafs.spec.in:1.2.2.18 openafs/src/packaging/RedHat/openafs.spec.in:1.2.2.19
*** openafs/src/packaging/RedHat/openafs.spec.in:1.2.2.18	Thu Jan 24 18:56:47 2008
--- openafs/src/packaging/RedHat/openafs.spec.in	Wed Feb 13 00:28:58 2008
***************
*** 1,4 ****
! # Openafs Spec $Revision: 1.2.2.18 $
  
  %define afsvers @VERSION@
  %define pkgvers @VERSION@
--- 1,4 ----
! # Openafs Spec $Revision: 1.2.2.19 $
  
  %define afsvers @VERSION@
  %define pkgvers @VERSION@
***************
*** 29,35 ****
  %endif
  
  %if %{fedorakmod}
! %define kmodtool bash %{_sourcedir}/kmodtool
  
  %define kmod_name openafs
  %define kverrel %(%{kmodtool} verrel %{?kernvers} 2>/dev/null)
--- 29,35 ----
  %endif
  
  %if %{fedorakmod}
! %define kmodtool bash %{_sourcedir}/openafs-kmodtool
  
  %define kmod_name openafs
  %define kverrel %(%{kmodtool} verrel %{?kernvers} 2>/dev/null)
***************
*** 248,254 ****
  Source996: openafs-kvers-is.sh
  Source997: openafs-buildfedora.pl
  Source998: openafs-buildall.sh
! Source999: kmodtool
  
  Patch0:  openafs-1.4.0-kmodule26.patch
  
--- 248,254 ----
  Source996: openafs-kvers-is.sh
  Source997: openafs-buildfedora.pl
  Source998: openafs-buildall.sh
! Source999: openafs-kmodtool
  
  Patch0:  openafs-1.4.0-kmodule26.patch
  
Index: openafs/src/rx/rx.c
diff -c openafs/src/rx/rx.c:1.97.2.13 openafs/src/rx/rx.c:1.97.2.14
*** openafs/src/rx/rx.c:1.97.2.13	Fri Feb  8 16:21:06 2008
--- openafs/src/rx/rx.c	Mon Feb 18 12:29:16 2008
***************
*** 17,23 ****
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx.c,v 1.97.2.13 2008/02/08 21:21:06 shadow Exp $");
  
  #ifdef KERNEL
  #include "afs/sysincludes.h"
--- 17,23 ----
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx.c,v 1.97.2.14 2008/02/18 17:29:16 jaltman Exp $");
  
  #ifdef KERNEL
  #include "afs/sysincludes.h"
***************
*** 7094,7099 ****
--- 7094,7102 ----
  			 int isServer)
  {
  
+     if (!(rxi_monitor_peerStats || rxi_monitor_processStats))
+         return;
+ 
      MUTEX_ENTER(&rx_rpc_stats);
      MUTEX_ENTER(&peer->peer_lock);
  
Index: openafs/src/viced/afsfileprocs.c
diff -c openafs/src/viced/afsfileprocs.c:1.113.2.21 openafs/src/viced/afsfileprocs.c:1.113.2.22
*** openafs/src/viced/afsfileprocs.c:1.113.2.21	Mon Jan  7 15:23:50 2008
--- openafs/src/viced/afsfileprocs.c	Tue Feb 19 09:38:20 2008
***************
*** 29,35 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/viced/afsfileprocs.c,v 1.113.2.21 2008/01/07 20:23:50 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.22 2008/02/19 14:38:20 shadow Exp $");
  
  #include <stdio.h>
  #include <stdlib.h>
***************
*** 1285,1290 ****
--- 1285,1291 ----
  	if (IsEmpty(&childdir) != 0)
  	    return (EEXIST);
  	DZap(&childdir);
+ 	FidZap(&childdir);
  	(*targetptr)->delete = 1;
      } else if ((--(*targetptr)->disk.linkCount) == 0)
  	(*targetptr)->delete = 1;
Index: openafs/src/viced/callback.c
diff -c openafs/src/viced/callback.c:1.77.2.14 openafs/src/viced/callback.c:1.77.2.15
*** openafs/src/viced/callback.c:1.77.2.14	Wed Dec  5 15:43:57 2007
--- openafs/src/viced/callback.c	Mon Feb 18 14:20:53 2008
***************
*** 85,91 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/viced/callback.c,v 1.77.2.14 2007/12/05 20:43:57 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.15 2008/02/18 19:20:53 shadow Exp $");
  
  #include <stdio.h>
  #include <stdlib.h>		/* for malloc() */
***************
*** 646,651 ****
--- 646,659 ----
      return 0;
  }
  
+ static int
+ CompareCBA(const void *e1, const void *e2)
+ {
+     const struct cbstruct *cba1 = (const struct cbstruct *)e1;
+     const struct cbstruct *cba2 = (const struct cbstruct *)e2;
+     return ((cba1->hp)->index - (cba2->hp)->index);
+ }
+ 
  /* Take an array full of hosts, all held.  Break callbacks to them, and 
   * release the holds once you're done, except don't release xhost.  xhost 
   * may be NULL.  Currently only works for a single Fid in afidp array.
***************
*** 675,680 ****
--- 683,691 ----
  
      assert(ncbas <= MAX_CB_HOSTS);
  
+     /* sort cba list to avoid makecall issues */
+     qsort(cba, ncbas, sizeof(struct cbstruct), CompareCBA);
+ 
      /* set up conns for multi-call */
      for (i = 0, j = 0; i < ncbas; i++) {
  	struct host *thishost = cba[i].hp;
