Index: openafs/src/NTMakefile
diff -c openafs/src/NTMakefile:1.27 openafs/src/NTMakefile:1.27.2.1
*** openafs/src/NTMakefile:1.27	Tue Feb 14 09:03:17 2006
--- openafs/src/NTMakefile	Tue Jul  4 02:28:22 2006
***************
*** 137,143 ****
  	$(NTMAKE)
  	$(CD) ..\..
  
! rxstat: rx
       echo ***** $@
  	$(DOCD) $(SRC)\$@
  	$(CD) $(SRC)\$@
--- 137,150 ----
  	$(NTMAKE)
  	$(CD) ..\..
  
! ubik_headers: rx
!      echo ***** $@
! 	$(DOCD) $(SRC)\ubik
! 	$(CD) $(SRC)\ubik
! 	$(NTMAKE_HEADERS)
! 	$(CD) ..\..
! 
! rxstat: ubik_headers
       echo ***** $@
  	$(DOCD) $(SRC)\$@
  	$(CD) $(SRC)\$@
Index: openafs/src/WINNT/afsapplib/al_creds.cpp
diff -c openafs/src/WINNT/afsapplib/al_creds.cpp:1.6 openafs/src/WINNT/afsapplib/al_creds.cpp:1.6.4.1
*** openafs/src/WINNT/afsapplib/al_creds.cpp:1.6	Sat Nov  5 01:47:44 2005
--- openafs/src/WINNT/afsapplib/al_creds.cpp	Sun Jun 25 13:54:47 2006
***************
*** 177,183 ****
           lpp->hCreds = AfsAppLib_GetCredentials (NULL);
        }
  
!    int rc = ModalDialogParam (lpp->idd, lpp->hParent, (DLGPROC)OpenCell_DlgProc, (LPARAM)lpp);
  
     return (rc == IDOK) ? TRUE : FALSE;
  }
--- 177,183 ----
           lpp->hCreds = AfsAppLib_GetCredentials (NULL);
        }
  
!    INT_PTR rc = ModalDialogParam (lpp->idd, lpp->hParent, (DLGPROC)OpenCell_DlgProc, (LPARAM)lpp);
  
     return (rc == IDOK) ? TRUE : FALSE;
  }
***************
*** 480,486 ****
           lpp->hCreds = AfsAppLib_GetCredentials (NULL);
        }
  
!    int rc = ModalDialogParam (lpp->idd, lpp->hParent, (DLGPROC)NewCreds_DlgProc, (LPARAM)lpp);
  
     return (rc == IDOK) ? TRUE : FALSE;
  }
--- 480,486 ----
           lpp->hCreds = AfsAppLib_GetCredentials (NULL);
        }
  
!    INT_PTR rc = ModalDialogParam (lpp->idd, lpp->hParent, (DLGPROC)NewCreds_DlgProc, (LPARAM)lpp);
  
     return (rc == IDOK) ? TRUE : FALSE;
  }
***************
*** 834,840 ****
              pp.bcdp.idd = IDD_APPLIB_BADCREDS;
              }
  
!          int rc = ModalDialogParam (pp.bcdp.idd, pp.bcdp.hParent, (DLGPROC)BadCreds_DlgProc, (LPARAM)&pp);
           if (rc == IDCANCEL)
              {
              fCredsOK = TRUE; // user says ignore bad credentials this time.
--- 834,840 ----
              pp.bcdp.idd = IDD_APPLIB_BADCREDS;
              }
  
!          INT_PTR rc = ModalDialogParam (pp.bcdp.idd, pp.bcdp.hParent, (DLGPROC)BadCreds_DlgProc, (LPARAM)&pp);
           if (rc == IDCANCEL)
              {
              fCredsOK = TRUE; // user says ignore bad credentials this time.
Index: openafs/src/WINNT/afsapplib/al_error.cpp
diff -c openafs/src/WINNT/afsapplib/al_error.cpp:1.2 openafs/src/WINNT/afsapplib/al_error.cpp:1.2.32.1
*** openafs/src/WINNT/afsapplib/al_error.cpp:1.2	Sat Nov  4 05:01:19 2000
--- openafs/src/WINNT/afsapplib/al_error.cpp	Sun Jun 25 13:54:47 2006
***************
*** 42,48 ****
  {
     va_list arg;
     va_start (arg, pszFmt);
!    vErrorDialog (FALSE, dwStatus, (LONG)pszError, pszFmt, arg);
  }
  
  void cdecl ErrorDialog (DWORD dwStatus, int idsError, LPTSTR pszFmt, ...)
--- 42,48 ----
  {
     va_list arg;
     va_start (arg, pszFmt);
!    vErrorDialog (FALSE, dwStatus, (LONG)(LONG_PTR)pszError, pszFmt, arg);
  }
  
  void cdecl ErrorDialog (DWORD dwStatus, int idsError, LPTSTR pszFmt, ...)
***************
*** 56,62 ****
  {
     va_list arg;
     va_start (arg, pszFmt);
!    vErrorDialog (TRUE, dwStatus, (LONG)pszError, pszFmt, arg);
  }
  
  void cdecl FatalErrorDialog (DWORD dwStatus, int idsError, LPTSTR pszFmt, ...)
--- 56,62 ----
  {
     va_list arg;
     va_start (arg, pszFmt);
!    vErrorDialog (TRUE, dwStatus, (LONG)(LONG_PTR)pszError, pszFmt, arg);
  }
  
  void cdecl FatalErrorDialog (DWORD dwStatus, int idsError, LPTSTR pszFmt, ...)
Index: openafs/src/WINNT/afsapplib/al_help.cpp
diff -c openafs/src/WINNT/afsapplib/al_help.cpp:1.3 openafs/src/WINNT/afsapplib/al_help.cpp:1.3.4.1
*** openafs/src/WINNT/afsapplib/al_help.cpp:1.3	Wed Jul  6 20:23:21 2005
--- openafs/src/WINNT/afsapplib/al_help.cpp	Sun Jun 25 13:54:47 2006
***************
*** 131,137 ****
           else
              {
              if (g_szHelpfile)
!                WinHelp ((HWND)(lphi->hItemHandle), g_szHelpfile, HELP_WM_HELP, (DWORD)g_adh[ ih ].adwContext);
              }
  
           rc = TRUE;
--- 131,137 ----
           else
              {
              if (g_szHelpfile)
!                WinHelp ((HWND)(lphi->hItemHandle), g_szHelpfile, HELP_WM_HELP, (DWORD)(DWORD_PTR)g_adh[ ih ].adwContext);
              }
  
           rc = TRUE;
Index: openafs/src/WINNT/afsapplib/al_misc.cpp
diff -c openafs/src/WINNT/afsapplib/al_misc.cpp:1.5 openafs/src/WINNT/afsapplib/al_misc.cpp:1.5.4.1
*** openafs/src/WINNT/afsapplib/al_misc.cpp:1.5	Sat Nov  5 01:47:44 2005
--- openafs/src/WINNT/afsapplib/al_misc.cpp	Sun Jun 25 13:54:47 2006
***************
*** 61,67 ****
  }
  
  
! EXPORTED extern "C" BOOLEAN _stdcall DllEntryPoint (HANDLE hInst, DWORD dwReason, PVOID pReserved)
  {
     switch (dwReason)
        {
--- 61,67 ----
  }
  
  
! EXPORTED BOOLEAN _stdcall DllEntryPoint (HANDLE hInst, DWORD dwReason, PVOID pReserved)
  {
     switch (dwReason)
        {
***************
*** 167,173 ****
        {
        case WM_TIMER:
           int iFrame;
!          iFrame = GetWindowData (hIcon, GWD_ANIMATIONFRAME);
           AfsAppLib_AnimateIcon (hIcon, &iFrame);
           SetWindowData (hIcon, GWD_ANIMATIONFRAME, iFrame);
           break;
--- 167,173 ----
        {
        case WM_TIMER:
           int iFrame;
!          iFrame = (int)GetWindowData (hIcon, GWD_ANIMATIONFRAME);
           AfsAppLib_AnimateIcon (hIcon, &iFrame);
           SetWindowData (hIcon, GWD_ANIMATIONFRAME, iFrame);
           break;
***************
*** 178,186 ****
        }
  
     if (oldProc)
!       return CallWindowProc ((WNDPROC)oldProc, hIcon, msg, wp, lp);
     else
!       return DefWindowProc (hIcon, msg, wp, lp);
  }
  
  
--- 178,186 ----
        }
  
     if (oldProc)
!       return (BOOL)CallWindowProc ((WNDPROC)oldProc, hIcon, msg, wp, lp);
     else
!       return (BOOL)DefWindowProc (hIcon, msg, wp, lp);
  }
  
  
***************
*** 208,214 ****
  BOOL CALLBACK AfsAppLib_TranslateErrorFunc (LPTSTR pszText, ULONG code, LANGID idLanguage)
  {
     DWORD idClient;
!    if ((idClient = AfsAppLib_GetAdminServerClientID()) != 0)
        {
        ULONG status;
        return asc_ErrorCodeTranslate (idClient, code, idLanguage, pszText, &status);
--- 208,214 ----
  BOOL CALLBACK AfsAppLib_TranslateErrorFunc (LPTSTR pszText, ULONG code, LANGID idLanguage)
  {
     DWORD idClient;
!    if ((idClient = (DWORD)AfsAppLib_GetAdminServerClientID()) != 0)
        {
        ULONG status;
        return asc_ErrorCodeTranslate (idClient, code, idLanguage, pszText, &status);
***************
*** 263,269 ****
        if (RegOpenKey (hkBase, pszRegPath, &hk) == 0)
           {
           TCHAR szCell[ cchNAME ];
!          for (size_t ii = 0; RegEnumKey (hk, ii, szCell, cchNAME) == 0; ++ii)
              {
              if (REALLOC (lpcl->aCells, lpcl->nCells, 1+ii, cREALLOC_CELLLIST))
                 {
--- 263,269 ----
        if (RegOpenKey (hkBase, pszRegPath, &hk) == 0)
           {
           TCHAR szCell[ cchNAME ];
!          for (size_t ii = 0; RegEnumKey (hk, (DWORD)ii, szCell, cchNAME) == 0; ++ii)
              {
              if (REALLOC (lpcl->aCells, lpcl->nCells, 1+ii, cREALLOC_CELLLIST))
                 {
***************
*** 461,467 ****
     if (szCell[0] == TEXT('\0'))
        {
        DWORD idClient;
!       if ((idClient = AfsAppLib_GetAdminServerClientID()) != 0)
           {
           rc = asc_LocalCellGet (idClient, szCell, &status);
           }
--- 461,467 ----
     if (szCell[0] == TEXT('\0'))
        {
        DWORD idClient;
!       if ((idClient = (DWORD)AfsAppLib_GetAdminServerClientID()) != 0)
           {
           rc = asc_LocalCellGet (idClient, szCell, &status);
           }
Index: openafs/src/WINNT/afsapplib/al_progress.cpp
diff -c openafs/src/WINNT/afsapplib/al_progress.cpp:1.3 openafs/src/WINNT/afsapplib/al_progress.cpp:1.3.4.1
*** openafs/src/WINNT/afsapplib/al_progress.cpp:1.3	Sat Nov  5 01:47:44 2005
--- openafs/src/WINNT/afsapplib/al_progress.cpp	Sun Jun 25 13:54:47 2006
***************
*** 63,69 ****
  
  void PROGRESSDISPLAY::Init (HWND hWnd)
  {
!    SetWindowLongPtr (hWnd, DWLP_USER, (LONG)this);
     Subclass_AddHook (hWnd, PROGRESSDISPLAY::ProgressDisplay_HookProc);
  
     m_msgFinish = 0;
--- 63,69 ----
  
  void PROGRESSDISPLAY::Init (HWND hWnd)
  {
!    SetWindowLongPtr (hWnd, DWLP_USER, (LONG_PTR)this);
     Subclass_AddHook (hWnd, PROGRESSDISPLAY::ProgressDisplay_HookProc);
  
     m_msgFinish = 0;
***************
*** 204,212 ****
        }
  
     if (oldproc)
!       return CallWindowProc ((WNDPROC)oldproc, hWnd, msg, wp, lp);
     else
!       return DefWindowProc (hWnd, msg, wp, lp);
  }
  
  
--- 204,212 ----
        }
  
     if (oldproc)
!       return (BOOL)CallWindowProc ((WNDPROC)oldproc, hWnd, msg, wp, lp);
     else
!       return (BOOL)DefWindowProc (hWnd, msg, wp, lp);
  }
  
  
Index: openafs/src/WINNT/afsapplib/al_pump.cpp
diff -c openafs/src/WINNT/afsapplib/al_pump.cpp:1.4 openafs/src/WINNT/afsapplib/al_pump.cpp:1.4.4.1
*** openafs/src/WINNT/afsapplib/al_pump.cpp:1.4	Sat Nov  5 01:47:44 2005
--- openafs/src/WINNT/afsapplib/al_pump.cpp	Sun Jun 25 13:54:47 2006
***************
*** 81,89 ****
        }
  
     if (oldProc)
!       return CallWindowProc ((WNDPROC)oldProc, hDlg, msg, wp, lp);
     else
!       return DefWindowProc (hDlg, msg, wp, lp);
  }
  
  
--- 81,89 ----
        }
  
     if (oldProc)
!       return (BOOL)CallWindowProc ((WNDPROC)oldProc, hDlg, msg, wp, lp);
     else
!       return (BOOL)DefWindowProc (hDlg, msg, wp, lp);
  }
  
  
***************
*** 211,219 ****
        }
  
     if (oldProc)
!       return CallWindowProc ((WNDPROC)oldProc, hWnd, msg, wp, lp);
     else
!       return DefWindowProc (hWnd, msg, wp, lp);
  }
  
  
--- 211,219 ----
        }
  
     if (oldProc)
!       return (BOOL)CallWindowProc ((WNDPROC)oldProc, hWnd, msg, wp, lp);
     else
!       return (BOOL)DefWindowProc (hWnd, msg, wp, lp);
  }
  
  
Index: openafs/src/WINNT/afsapplib/al_wizard.cpp
diff -c openafs/src/WINNT/afsapplib/al_wizard.cpp:1.5 openafs/src/WINNT/afsapplib/al_wizard.cpp:1.5.4.1
*** openafs/src/WINNT/afsapplib/al_wizard.cpp:1.5	Sat Nov  5 01:47:44 2005
--- openafs/src/WINNT/afsapplib/al_wizard.cpp	Sun Jun 25 13:54:47 2006
***************
*** 639,645 ****
     LPWIZARD_STATE pState;
     if ((pState = FindState (st)) != NULL)
        {
!       rc = CallWindowProc ((WNDPROC)(pState->dlgproc), NULL, WM_COMMAND, MAKEWPARAM(IDC_WIZARD,(WORD)wc), (LPARAM)this);
        }
  
     return rc;
--- 639,645 ----
     LPWIZARD_STATE pState;
     if ((pState = FindState (st)) != NULL)
        {
!       rc = (BOOL)CallWindowProc ((WNDPROC)(pState->dlgproc), NULL, WM_COMMAND, MAKEWPARAM(IDC_WIZARD,(WORD)wc), (LPARAM)this);
        }
  
     return rc;
***************
*** 694,702 ****
        }
  
     if (oldProc)
!       return CallWindowProc ((WNDPROC)oldProc, hLHS, msg, wp, lp);
     else
!       return DefWindowProc (hLHS, msg, wp, lp);
  }
  
  
--- 694,702 ----
        }
  
     if (oldProc)
!       return (BOOL)CallWindowProc ((WNDPROC)oldProc, hLHS, msg, wp, lp);
     else
!       return (BOOL)DefWindowProc (hLHS, msg, wp, lp);
  }
  
  
***************
*** 704,714 ****
  {
     HWND hRHS;
     if ((hRHS = GetRightHandWindow()) != NULL)
!       return SendMessage (hRHS, msg, wp, lp);
  
     LPWIZARD_STATE pState;
     if ((pState = FindState (m_stCurrent)) != NULL)
!       return CallWindowProc ((WNDPROC)(pState->dlgproc), hWnd, msg, wp, lp);
  
     return FALSE;
  }
--- 704,714 ----
  {
     HWND hRHS;
     if ((hRHS = GetRightHandWindow()) != NULL)
!       return (BOOL)SendMessage (hRHS, msg, wp, lp);
  
     LPWIZARD_STATE pState;
     if ((pState = FindState (m_stCurrent)) != NULL)
!       return (BOOL)CallWindowProc ((WNDPROC)(pState->dlgproc), hWnd, msg, wp, lp);
  
     return FALSE;
  }
***************
*** 993,1001 ****
        }
  
     if (oldProc)
!       return CallWindowProc ((WNDPROC)oldProc, hBkg, msg, wp, lp);
     else
!       return DefWindowProc (hBkg, msg, wp, lp);
  }
  
  
--- 993,1001 ----
        }
  
     if (oldProc)
!       return (BOOL)CallWindowProc ((WNDPROC)oldProc, hBkg, msg, wp, lp);
     else
!       return (BOOL)DefWindowProc (hBkg, msg, wp, lp);
  }
  
  
***************
*** 1044,1051 ****
           for (COLORREF clr = clrWASH_BRIGHTEST; clr >= clrWASH_DARKEST; clr -= clrWASH_INCREMENT)
              {
              RECT rSection = rr;
!             rSection.top = yy;
!             rSection.bottom = yy +cy;
              HBRUSH hbr = CreateSolidBrush (ToPALETTERGB(clr));
              FillRect (hdcTarget, &rSection, hbr);
              DeleteObject (hbr);
--- 1044,1051 ----
           for (COLORREF clr = clrWASH_BRIGHTEST; clr >= clrWASH_DARKEST; clr -= clrWASH_INCREMENT)
              {
              RECT rSection = rr;
!             rSection.top = (LONG)yy;
!             rSection.bottom = (LONG)(yy +cy);
              HBRUSH hbr = CreateSolidBrush (ToPALETTERGB(clr));
              FillRect (hdcTarget, &rSection, hbr);
              DeleteObject (hbr);
Index: openafs/src/WINNT/afsapplib/checklist.cpp
diff -c openafs/src/WINNT/afsapplib/checklist.cpp:1.3 openafs/src/WINNT/afsapplib/checklist.cpp:1.3.4.1
*** openafs/src/WINNT/afsapplib/checklist.cpp:1.3	Sat Nov  5 01:47:44 2005
--- openafs/src/WINNT/afsapplib/checklist.cpp	Sun Jun 25 13:54:47 2006
***************
*** 218,226 ****
        }
  
     if (procListbox)
!       hResult = CallWindowProc ((WNDPROC)LongToPtr(procListbox), hList, msg, wp, lp);
     else
!       hResult = DefWindowProc (hList, msg, wp, lp);
  
      return (hResult?TRUE:FALSE);
  }
--- 218,226 ----
        }
  
     if (procListbox)
!       hResult = (BOOL)CallWindowProc ((WNDPROC)LongToPtr(procListbox), hList, msg, wp, lp);
     else
!       hResult = (BOOL)DefWindowProc (hList, msg, wp, lp);
  
      return (hResult?TRUE:FALSE);
  }
***************
*** 263,275 ****
              if (clrNew != clrLast)
                 hbrStatic = CreateSolidBrush (clrLast = clrNew);
              SetBkColor ((HDC)wp, clrLast);
!             return (BOOL)hbrStatic;
              }
           break;
        }
  
     if (procOld)
!       return CallWindowProc ((WNDPROC)procOld, hDlg, msg, wp, lp);
     else
        return FALSE;
  }
--- 263,275 ----
              if (clrNew != clrLast)
                 hbrStatic = CreateSolidBrush (clrLast = clrNew);
              SetBkColor ((HDC)wp, clrLast);
!             return (BOOL)(INT_PTR)hbrStatic;
              }
           break;
        }
  
     if (procOld)
!       return (BOOL)CallWindowProc ((WNDPROC)procOld, hDlg, msg, wp, lp);
     else
        return FALSE;
  }
***************
*** 365,371 ****
     // step 2e: draw the background field
     //
     BOOL fHit = CheckList_OnHitTest (hList, id);
!    BOOL fChecked = LB_GetCheck (hList, id);
  
     clrBack = GetSysColor (COLOR_WINDOW);
     if ( (lpds->itemState & ODS_DISABLED) ||
--- 365,371 ----
     // step 2e: draw the background field
     //
     BOOL fHit = CheckList_OnHitTest (hList, id);
!    BOOL fChecked = (BOOL)LB_GetCheck (hList, id);
  
     clrBack = GetSysColor (COLOR_WINDOW);
     if ( (lpds->itemState & ODS_DISABLED) ||
***************
*** 549,555 ****
  {
     if (GetCapture() == hList)
        {
!       int ii = LB_GetHit (hList);
        if (ii != -1)
           {
           CheckList_RedrawCheck (hList, ii);
--- 549,555 ----
  {
     if (GetCapture() == hList)
        {
!       int ii = (int)LB_GetHit (hList);
        if (ii != -1)
           {
           CheckList_RedrawCheck (hList, ii);
***************
*** 566,572 ****
        POINT pt = { LOWORD(dw), HIWORD(dw) };
        ScreenToClient (hList, &pt);
  
!       int ii = SendMessage (hList, LB_ITEMFROMPOINT, 0, MAKELPARAM(pt.x,pt.y));
        if (HIWORD(ii) == 0)
           {
           BOOL fHit = CheckList_OnHitTest (hList, ii);
--- 566,572 ----
        POINT pt = { LOWORD(dw), HIWORD(dw) };
        ScreenToClient (hList, &pt);
  
!       int ii = (int)SendMessage (hList, LB_ITEMFROMPOINT, 0, MAKELPARAM(pt.x,pt.y));
        if (HIWORD(ii) == 0)
           {
           BOOL fHit = CheckList_OnHitTest (hList, ii);
***************
*** 588,594 ****
        {
        ReleaseCapture();
  
!       int ii = LB_GetHit (hList);
        if (ii != -1)
           {
           LB_SetHit (hList, -1);
--- 588,594 ----
        {
        ReleaseCapture();
  
!       int ii = (int)LB_GetHit (hList);
        if (ii != -1)
           {
           LB_SetHit (hList, -1);
***************
*** 599,605 ****
              CheckList_RedrawCheck (hList, ii);
           else
              {
!             BOOL fChecked = LB_GetCheck (hList, ii);
              CheckList_OnSetCheck_Selected (hList, !fChecked);
              }
           }
--- 599,605 ----
              CheckList_RedrawCheck (hList, ii);
           else
              {
!             BOOL fChecked = (BOOL)LB_GetCheck (hList, ii);
              CheckList_OnSetCheck_Selected (hList, !fChecked);
              }
           }
***************
*** 615,624 ****
        POINT pt = { LOWORD(dw), HIWORD(dw) };
        ScreenToClient (hList, &pt);
  
!       int ii = SendMessage (hList, LB_ITEMFROMPOINT, 0, MAKELPARAM(pt.x,pt.y));
        if (HIWORD(ii) == 0)
           {
!          BOOL fChecked = LB_GetCheck (hList, ii);
  
           CheckList_OnSetCheck_Selected (hList, !fChecked);
           }
--- 615,624 ----
        POINT pt = { LOWORD(dw), HIWORD(dw) };
        ScreenToClient (hList, &pt);
  
!       int ii = (int)SendMessage (hList, LB_ITEMFROMPOINT, 0, MAKELPARAM(pt.x,pt.y));
        if (HIWORD(ii) == 0)
           {
!          BOOL fChecked = (BOOL)LB_GetCheck (hList, ii);
  
           CheckList_OnSetCheck_Selected (hList, !fChecked);
           }
***************
*** 648,654 ****
        }
     else // single-sel listbox
        {
!       int ii = SendMessage (hList, LB_GETCURSEL, 0, 0);
        if (ii != LB_ERR)
           {
           LB_SetCheck (hList, ii, fCheck);
--- 648,654 ----
        }
     else // single-sel listbox
        {
!       int ii = (int)SendMessage (hList, LB_GETCURSEL, 0, 0);
        if (ii != LB_ERR)
           {
           LB_SetCheck (hList, ii, fCheck);
Index: openafs/src/WINNT/afsapplib/ctl_date.cpp
diff -c openafs/src/WINNT/afsapplib/ctl_date.cpp:1.3 openafs/src/WINNT/afsapplib/ctl_date.cpp:1.3.4.1
*** openafs/src/WINNT/afsapplib/ctl_date.cpp:1.3	Wed Jul  6 20:23:21 2005
--- openafs/src/WINNT/afsapplib/ctl_date.cpp	Sun Jun 25 13:54:47 2006
***************
*** 262,268 ****
           }
        }
  
!    return DefWindowProc (hDate, msg, wp, lp);
  }
  
  
--- 262,268 ----
           }
        }
  
!    return (BOOL)DefWindowProc (hDate, msg, wp, lp);
  }
  
  
***************
*** 333,339 ****
                  WS_CHILD | WS_TABSTOP | ES_RIGHT | ES_NUMBER | ES_MULTILINE,
                  xx, yy, cx, cy,
                  GetParent(pdi->hDate),
!                 (HMENU)id,
                  THIS_HINST,
                  0);
     xx += cx;
--- 333,339 ----
                  WS_CHILD | WS_TABSTOP | ES_RIGHT | ES_NUMBER | ES_MULTILINE,
                  xx, yy, cx, cy,
                  GetParent(pdi->hDate),
!                 (HMENU)(INT_PTR)id,
                  THIS_HINST,
                  0);
     xx += cx;
***************
*** 374,380 ****
                  WS_CHILD | WS_TABSTOP | ES_RIGHT | ES_NUMBER | ES_MULTILINE,
                  xx, yy, cx, cy,
                  GetParent(pdi->hDate),
!                 (HMENU)id,
                  THIS_HINST,
                  0);
     xx += cx;
--- 374,380 ----
                  WS_CHILD | WS_TABSTOP | ES_RIGHT | ES_NUMBER | ES_MULTILINE,
                  xx, yy, cx, cy,
                  GetParent(pdi->hDate),
!                 (HMENU)(INT_PTR)id,
                  THIS_HINST,
                  0);
     xx += cx;
***************
*** 414,422 ****
                  WS_CHILD | WS_TABSTOP | ES_RIGHT | ES_NUMBER | ES_MULTILINE,
                  xx, yy, cx, cy,
                  GetParent(pdi->hDate),
!                 (HMENU)id,
                  THIS_HINST,
!                 0);
     xx += cx;
  
     switch (pdi->dwFormat)
--- 414,422 ----
                  WS_CHILD | WS_TABSTOP | ES_RIGHT | ES_NUMBER | ES_MULTILINE,
                  xx, yy, cx, cy,
                  GetParent(pdi->hDate),
!                 (HMENU)(INT_PTR)id,
                  THIS_HINST,
! 				0);
     xx += cx;
  
     switch (pdi->dwFormat)
***************
*** 557,563 ****
                 else
                    clr = GetSysColor (COLOR_BTNFACE);
                 SetBkColor ((HDC)wp, clr);
!                return (BOOL)CreateSolidBrush (clr);
                 }
              }
           break;
--- 557,563 ----
                 else
                    clr = GetSysColor (COLOR_BTNFACE);
                 SetBkColor ((HDC)wp, clr);
!                return (BOOL)(INT_PTR)CreateSolidBrush (clr);
                 }
              }
           break;
***************
*** 582,590 ****
        }
  
     if (oldProc)
!       return CallWindowProc ((WNDPROC)oldProc, hDlg, msg, wp, lp);
     else
!       return DefWindowProc (hDlg, msg, wp, lp);
  }
  
  
--- 582,590 ----
        }
  
     if (oldProc)
!       return (BOOL)CallWindowProc ((WNDPROC)oldProc, hDlg, msg, wp, lp);
     else
!       return (BOOL)DefWindowProc (hDlg, msg, wp, lp);
  }
  
  
***************
*** 618,626 ****
  
     PVOID oldProc = Subclass_FindNextHook (hEdit, DateEditProc);
     if (oldProc)
!       return CallWindowProc ((WNDPROC)oldProc, hEdit, msg, wp, lp);
     else
!       return DefWindowProc (hEdit, msg, wp, lp);
  }
  
  
--- 618,626 ----
  
     PVOID oldProc = Subclass_FindNextHook (hEdit, DateEditProc);
     if (oldProc)
!       return (BOOL)CallWindowProc ((WNDPROC)oldProc, hEdit, msg, wp, lp);
     else
!       return (BOOL)DefWindowProc (hEdit, msg, wp, lp);
  }
  
  
Index: openafs/src/WINNT/afsapplib/ctl_elapsed.cpp
diff -c openafs/src/WINNT/afsapplib/ctl_elapsed.cpp:1.3 openafs/src/WINNT/afsapplib/ctl_elapsed.cpp:1.3.4.1
*** openafs/src/WINNT/afsapplib/ctl_elapsed.cpp:1.3	Wed Jul  6 20:23:21 2005
--- openafs/src/WINNT/afsapplib/ctl_elapsed.cpp	Sun Jun 25 13:54:47 2006
***************
*** 274,280 ****
           }
        }
  
!    return DefWindowProc (hElapsed, msg, wp, lp);
  }
  
  
--- 274,280 ----
           }
        }
  
!    return (BOOL)DefWindowProc (hElapsed, msg, wp, lp);
  }
  
  
***************
*** 515,521 ****
                 else
                    clr = GetSysColor (COLOR_BTNFACE);
                 SetBkColor ((HDC)wp, clr);
!                return (BOOL)CreateSolidBrush (clr);
                 }
              }
           break;
--- 515,521 ----
                 else
                    clr = GetSysColor (COLOR_BTNFACE);
                 SetBkColor ((HDC)wp, clr);
!                return (BOOL)(INT_PTR)CreateSolidBrush (clr);
                 }
              }
           break;
***************
*** 540,548 ****
        }
  
     if (oldProc)
!       return CallWindowProc ((WNDPROC)oldProc, hDlg, msg, wp, lp);
     else
!       return DefWindowProc (hDlg, msg, wp, lp);
  }
  
  
--- 540,548 ----
        }
  
     if (oldProc)
!       return (BOOL)CallWindowProc ((WNDPROC)oldProc, hDlg, msg, wp, lp);
     else
!       return (BOOL)DefWindowProc (hDlg, msg, wp, lp);
  }
  
  
***************
*** 576,584 ****
  
     PVOID oldProc = Subclass_FindNextHook (hEdit, ElapsedEditProc);
     if (oldProc)
!       return CallWindowProc ((WNDPROC)oldProc, hEdit, msg, wp, lp);
     else
!       return DefWindowProc (hEdit, msg, wp, lp);
  }
  
  
--- 576,584 ----
  
     PVOID oldProc = Subclass_FindNextHook (hEdit, ElapsedEditProc);
     if (oldProc)
!       return (BOOL)CallWindowProc ((WNDPROC)oldProc, hEdit, msg, wp, lp);
     else
!       return (BOOL)DefWindowProc (hEdit, msg, wp, lp);
  }
  
  
Index: openafs/src/WINNT/afsapplib/ctl_sockaddr.cpp
diff -c openafs/src/WINNT/afsapplib/ctl_sockaddr.cpp:1.3 openafs/src/WINNT/afsapplib/ctl_sockaddr.cpp:1.3.4.1
*** openafs/src/WINNT/afsapplib/ctl_sockaddr.cpp:1.3	Wed Jul  6 20:23:21 2005
--- openafs/src/WINNT/afsapplib/ctl_sockaddr.cpp	Sun Jun 25 13:54:47 2006
***************
*** 236,242 ****
           }
        }
  
!    return DefWindowProc (hSockAddr, msg, wp, lp);
  }
  
  
--- 236,242 ----
           }
        }
  
!    return (BOOL)DefWindowProc (hSockAddr, msg, wp, lp);
  }
  
  
***************
*** 472,478 ****
                 else
                    clr = GetSysColor (COLOR_BTNFACE);
                 SetBkColor ((HDC)wp, clr);
!                return (BOOL)CreateSolidBrush (clr);
                 }
              }
           break;
--- 472,478 ----
                 else
                    clr = GetSysColor (COLOR_BTNFACE);
                 SetBkColor ((HDC)wp, clr);
!                return (BOOL)(INT_PTR)CreateSolidBrush (clr);
                 }
              }
           break;
***************
*** 510,518 ****
        }
  
     if (oldProc)
!       return CallWindowProc ((WNDPROC)oldProc, hDlg, msg, wp, lp);
     else
!       return DefWindowProc (hDlg, msg, wp, lp);
  }
  
  
--- 510,518 ----
        }
  
     if (oldProc)
!       return (BOOL)CallWindowProc ((WNDPROC)oldProc, hDlg, msg, wp, lp);
     else
!       return (BOOL)DefWindowProc (hDlg, msg, wp, lp);
  }
  
  
***************
*** 556,564 ****
  
     PVOID oldProc = Subclass_FindNextHook (hEdit, SockAddrEditProc);
     if (oldProc)
!       return CallWindowProc ((WNDPROC)oldProc, hEdit, msg, wp, lp);
     else
!       return DefWindowProc (hEdit, msg, wp, lp);
  }
  
  
--- 556,564 ----
  
     PVOID oldProc = Subclass_FindNextHook (hEdit, SockAddrEditProc);
     if (oldProc)
!       return (BOOL)CallWindowProc ((WNDPROC)oldProc, hEdit, msg, wp, lp);
     else
!       return (BOOL)DefWindowProc (hEdit, msg, wp, lp);
  }
  
  
Index: openafs/src/WINNT/afsapplib/ctl_spinner.cpp
diff -c openafs/src/WINNT/afsapplib/ctl_spinner.cpp:1.3 openafs/src/WINNT/afsapplib/ctl_spinner.cpp:1.3.4.1
*** openafs/src/WINNT/afsapplib/ctl_spinner.cpp:1.3	Wed Jul  6 20:23:21 2005
--- openafs/src/WINNT/afsapplib/ctl_spinner.cpp	Sun Jun 25 13:54:47 2006
***************
*** 136,142 ****
  
        if (GetClassInfo (THIS_HINST, TEXT("scrollbar"), &wc))
           {
!          oldSpinnerProc = (LONG)wc.lpfnWndProc;
  
           wc.lpfnWndProc = (WNDPROC)SpinnerProc;
           wc.style = CS_GLOBALCLASS;
--- 136,142 ----
  
        if (GetClassInfo (THIS_HINST, TEXT("scrollbar"), &wc))
           {
!          oldSpinnerProc = (LONG)(LONG_PTR)wc.lpfnWndProc;
  
           wc.lpfnWndProc = (WNDPROC)SpinnerProc;
           wc.style = CS_GLOBALCLASS;
***************
*** 265,271 ****
  
     if (msg == WM_CREATE)
        {
!       aSpinners[ (int)((LPCREATESTRUCT)lp)->lpCreateParams ].hSpinner = hSpinner;
        }
  
     SpinnerInfo *psi = Spinner_FindSpinnerInfo (hSpinner, NULL);
--- 265,271 ----
  
     if (msg == WM_CREATE)
        {
!       aSpinners[ (int)(INT_PTR)((LPCREATESTRUCT)lp)->lpCreateParams ].hSpinner = hSpinner;
        }
  
     SpinnerInfo *psi = Spinner_FindSpinnerInfo (hSpinner, NULL);
***************
*** 321,329 ****
        }
  
     if (oldSpinnerProc == 0)
!       return DefWindowProc (hSpinner, msg, wp, lp);
     else
!       return CallWindowProc ((WNDPROC)oldSpinnerProc, hSpinner, msg, wp, lp);
  }
  
  
--- 321,329 ----
        }
  
     if (oldSpinnerProc == 0)
!       return (BOOL)DefWindowProc (hSpinner, msg, wp, lp);
     else
!       return (BOOL)CallWindowProc ((WNDPROC)(LONG_PTR)oldSpinnerProc, hSpinner, msg, wp, lp);
  }
  
  
***************
*** 416,424 ****
        }
  
     if (oldProc == 0)
!       return DefWindowProc (hDlg, msg, wp, lp);
     else
!       return CallWindowProc ((WNDPROC)oldProc, hDlg, msg, wp, lp);
  }
  
  
--- 416,424 ----
        }
  
     if (oldProc == 0)
!       return (BOOL)DefWindowProc (hDlg, msg, wp, lp);
     else
!       return (BOOL)CallWindowProc ((WNDPROC)oldProc, hDlg, msg, wp, lp);
  }
  
  
***************
*** 457,463 ****
              break;
  
           case WM_ENABLE:
!             EnableWindow (psi->hSpinner, wp);
              break;
  
           case WM_KILLFOCUS:
--- 457,463 ----
              break;
  
           case WM_ENABLE:
!             EnableWindow (psi->hSpinner, (BOOL)wp);
              break;
  
           case WM_KILLFOCUS:
***************
*** 501,509 ****
        }
  
     if (oldProc)
!       return CallWindowProc ((WNDPROC)oldProc, hBuddy, msg, wp, lp);
     else
!       return DefWindowProc (hBuddy, msg, wp, lp);
  }
  
  
--- 501,509 ----
        }
  
     if (oldProc)
!       return (BOOL)CallWindowProc ((WNDPROC)oldProc, hBuddy, msg, wp, lp);
     else
!       return (BOOL)DefWindowProc (hBuddy, msg, wp, lp);
  }
  
  
***************
*** 663,669 ****
  
  BOOL Spinner_OnGetSpinner (SpinnerInfo *psi, WPARAM wp, LPARAM lp)
  {
!    return (BOOL)psi->hSpinner;
  }
  
  
--- 663,669 ----
  
  BOOL Spinner_OnGetSpinner (SpinnerInfo *psi, WPARAM wp, LPARAM lp)
  {
!    return (BOOL)(INT_PTR)psi->hSpinner;
  }
  
  
Index: openafs/src/WINNT/afsapplib/ctl_time.cpp
diff -c openafs/src/WINNT/afsapplib/ctl_time.cpp:1.3 openafs/src/WINNT/afsapplib/ctl_time.cpp:1.3.4.1
*** openafs/src/WINNT/afsapplib/ctl_time.cpp:1.3	Wed Jul  6 20:23:21 2005
--- openafs/src/WINNT/afsapplib/ctl_time.cpp	Sun Jun 25 13:54:47 2006
***************
*** 271,277 ****
           }
        }
  
!    return DefWindowProc (hTime, msg, wp, lp);
  }
  
  
--- 271,277 ----
           }
        }
  
!    return (BOOL)DefWindowProc (hTime, msg, wp, lp);
  }
  
  
***************
*** 539,545 ****
                 else
                    clr = GetSysColor (COLOR_BTNFACE);
                 SetBkColor ((HDC)wp, clr);
!                return (BOOL)CreateSolidBrush (clr);
                 }
              }
           break;
--- 539,545 ----
                 else
                    clr = GetSysColor (COLOR_BTNFACE);
                 SetBkColor ((HDC)wp, clr);
!                return (BOOL)(INT_PTR)CreateSolidBrush (clr);
                 }
              }
           break;
***************
*** 606,614 ****
        }
  
     if (oldProc)
!       return CallWindowProc ((WNDPROC)oldProc, hDlg, msg, wp, lp);
     else
!       return DefWindowProc (hDlg, msg, wp, lp);
  }
  
  
--- 606,614 ----
        }
  
     if (oldProc)
!       return (BOOL)CallWindowProc ((WNDPROC)oldProc, hDlg, msg, wp, lp);
     else
!       return (BOOL)DefWindowProc (hDlg, msg, wp, lp);
  }
  
  
***************
*** 642,650 ****
  
     PVOID oldProc = Subclass_FindNextHook (hEdit, TimeEditProc);
     if (oldProc)
!       return CallWindowProc ((WNDPROC)oldProc, hEdit, msg, wp, lp);
     else
!       return DefWindowProc (hEdit, msg, wp, lp);
  }
  
  
--- 642,650 ----
  
     PVOID oldProc = Subclass_FindNextHook (hEdit, TimeEditProc);
     if (oldProc)
!       return (BOOL)CallWindowProc ((WNDPROC)oldProc, hEdit, msg, wp, lp);
     else
!       return (BOOL)DefWindowProc (hEdit, msg, wp, lp);
  }
  
  
Index: openafs/src/WINNT/afsapplib/dialog.cpp
diff -c openafs/src/WINNT/afsapplib/dialog.cpp:1.5 openafs/src/WINNT/afsapplib/dialog.cpp:1.5.4.1
*** openafs/src/WINNT/afsapplib/dialog.cpp:1.5	Sat Nov  5 01:47:44 2005
--- openafs/src/WINNT/afsapplib/dialog.cpp	Sun Jun 25 13:54:47 2006
***************
*** 194,200 ****
           }
        }
  
!    return DefWindowProc (hDlg, msg, wp, lp);
  
  }
  
--- 194,200 ----
           }
        }
  
!    return (BOOL)DefWindowProc (hDlg, msg, wp, lp);
  
  }
  
***************
*** 207,213 ****
     psh->sh.dwFlags = PSH_MODELESS | ((fContextHelp) ? PSH_HASHELP : 0);
     psh->sh.hwndParent = hParent;
     psh->sh.hInstance = THIS_HINST;
!    psh->sh.pszCaption = (HIWORD(idsTitle)) ? (LPTSTR)idsTitle : FormatString(TEXT("%1"),TEXT("%m"),idsTitle);
     psh->fMadeCaption = (HIWORD(idsTitle)) ? FALSE : TRUE;
     psh->lpUser = lp;
     return psh;
--- 207,213 ----
     psh->sh.dwFlags = PSH_MODELESS | ((fContextHelp) ? PSH_HASHELP : 0);
     psh->sh.hwndParent = hParent;
     psh->sh.hInstance = THIS_HINST;
!    psh->sh.pszCaption = (HIWORD(idsTitle)) ? (LPTSTR)(LONG_PTR)idsTitle : FormatString(TEXT("%1"),TEXT("%m"),idsTitle);
     psh->fMadeCaption = (HIWORD(idsTitle)) ? FALSE : TRUE;
     psh->lpUser = lp;
     return psh;
***************
*** 220,226 ****
  
  LPPROPSHEET PropSheet_Create (LPTSTR pszTitle, BOOL fContextHelp, HWND hParent, LPARAM lp)
  {
!    return PropSheet_Create ((LONG)pszTitle, fContextHelp, hParent, lp);
  }
  
  
--- 220,226 ----
  
  LPPROPSHEET PropSheet_Create (LPTSTR pszTitle, BOOL fContextHelp, HWND hParent, LPARAM lp)
  {
!    return PropSheet_Create ((LONG)(LONG_PTR)pszTitle, fContextHelp, hParent, lp);
  }
  
  
***************
*** 244,250 ****
  
     if (HIWORD(idsTitle))
        {
!       psp.pszTitle = (LPTSTR)idsTitle;
        psp.dwFlags |= PSP_USETITLE;
        }
     else if (idsTitle != 0)
--- 244,250 ----
  
     if (HIWORD(idsTitle))
        {
!       psp.pszTitle = (LPTSTR)(LONG_PTR)idsTitle;
        psp.dwFlags |= PSP_USETITLE;
        }
     else if (idsTitle != 0)
***************
*** 284,290 ****
  
  BOOL PropSheet_AddTab (LPPROPSHEET psh, LPTSTR pszTitle, int idd, DLGPROC dlgproc, LPARAM lpUser, BOOL fHelpButton, BOOL fStartPage)
  {
!    return PropSheet_AddTab (psh, (LONG)pszTitle, idd, dlgproc, lpUser, fHelpButton, fStartPage);
  }
  
  
--- 284,290 ----
  
  BOOL PropSheet_AddTab (LPPROPSHEET psh, LPTSTR pszTitle, int idd, DLGPROC dlgproc, LPARAM lpUser, BOOL fHelpButton, BOOL fStartPage)
  {
!    return PropSheet_AddTab (psh, (LONG)(LONG_PTR)pszTitle, idd, dlgproc, lpUser, fHelpButton, fStartPage);
  }
  
  
***************
*** 306,314 ****
  
     BOOL rc;
     if (oldproc)
!       rc = CallWindowProc ((WNDPROC)oldproc, hSheet, msg, wp, lp);
     else
!       rc = DefWindowProc (hSheet, msg, wp, lp);
  
     switch (msg)
        {
--- 306,314 ----
  
     BOOL rc;
     if (oldproc)
!       rc = (BOOL)CallWindowProc ((WNDPROC)oldproc, hSheet, msg, wp, lp);
     else
!       rc = (BOOL)DefWindowProc (hSheet, msg, wp, lp);
  
     switch (msg)
        {
***************
*** 824,830 ****
           }
        else
           {
!          FastList_SetItemText (hList, hItem, ii, apszColumns[ iColumn ]);
           }
        }
  
--- 824,830 ----
           }
        else
           {
!          FastList_SetItemText (hList, hItem, (int)ii, apszColumns[ (int)iColumn ]);
           }
        }
  
***************
*** 1073,1079 ****
        lvc.fmt = (lpvi->cxColumns[ iColumn ] & COLUMN_RIGHTJUST) ? LVCFMT_RIGHT : (lpvi->cxColumns[ iColumn ] & COLUMN_CENTERJUST) ? LVCFMT_CENTER : LVCFMT_LEFT;
        lvc.pszText = szText;
        lvc.cx = (lpvi->cxColumns[ iColumn ] & (~COLUMN_JUSTMASK));
!       lvc.iSubItem = ii;
        ListView_InsertColumn (hList, ii, &lvc);
        }
  
--- 1073,1079 ----
        lvc.fmt = (lpvi->cxColumns[ iColumn ] & COLUMN_RIGHTJUST) ? LVCFMT_RIGHT : (lpvi->cxColumns[ iColumn ] & COLUMN_CENTERJUST) ? LVCFMT_CENTER : LVCFMT_LEFT;
        lvc.pszText = szText;
        lvc.cx = (lpvi->cxColumns[ iColumn ] & (~COLUMN_JUSTMASK));
!       lvc.iSubItem = (int)ii;
        ListView_InsertColumn (hList, ii, &lvc);
        }
  
***************
*** 1137,1146 ****
     int ii1 = LV_GetIndex (lpvsi->hList, lp1);
     int ii2 = LV_GetIndex (lpvsi->hList, lp2);
  
!    LV_GetItemText (lpvsi->hList, ii1, lpvsi->iColSort, szText);
     d1 = atof (szText);
  
!    LV_GetItemText (lpvsi->hList, ii2, lpvsi->iColSort, szText);
     d2 = atof (szText);
  
     if (lpvsi->fAscending)
--- 1137,1146 ----
     int ii1 = LV_GetIndex (lpvsi->hList, lp1);
     int ii2 = LV_GetIndex (lpvsi->hList, lp2);
  
!    LV_GetItemText (lpvsi->hList, ii1, (short)lpvsi->iColSort, szText);
     d1 = atof (szText);
  
!    LV_GetItemText (lpvsi->hList, ii2, (short)lpvsi->iColSort, szText);
     d2 = atof (szText);
  
     if (lpvsi->fAscending)
***************
*** 1159,1166 ****
     int ii1 = LV_GetIndex (lpvsi->hList, lp1);
     int ii2 = LV_GetIndex (lpvsi->hList, lp2);
  
!    LV_GetItemText (lpvsi->hList, ii1, lpvsi->iColSort, szText1);
!    LV_GetItemText (lpvsi->hList, ii2, lpvsi->iColSort, szText2);
  
     if (lpvsi->fAscending)
        return lstrcmp (szText2, szText1);
--- 1159,1166 ----
     int ii1 = LV_GetIndex (lpvsi->hList, lp1);
     int ii2 = LV_GetIndex (lpvsi->hList, lp2);
  
!    LV_GetItemText (lpvsi->hList, ii1, (short)lpvsi->iColSort, szText1);
!    LV_GetItemText (lpvsi->hList, ii2, (short)lpvsi->iColSort, szText2);
  
     if (lpvsi->fAscending)
        return lstrcmp (szText2, szText1);
***************
*** 1234,1240 ****
           }
        else
           {
!          ListView_SetItemText (hList, dw, ii, apszColumns[ iColumn ]);
           }
        }
  }
--- 1234,1240 ----
           }
        else
           {
!          ListView_SetItemText (hList, dw, (int)ii, apszColumns[ iColumn ]);
           }
        }
  }
***************
*** 1449,1455 ****
  void LB_EnsureVisible (HWND hList, UINT index)
  {
     int cyItem;
!    if ((cyItem = SendMessage (hList, LB_GETITEMHEIGHT, 0, 0)) != 0)
        {
        RECT rClient;
        GetClientRect (hList, &rClient);
--- 1449,1455 ----
  void LB_EnsureVisible (HWND hList, UINT index)
  {
     int cyItem;
!    if ((cyItem = (int)SendMessage (hList, LB_GETITEMHEIGHT, 0, 0)) != 0)
        {
        RECT rClient;
        GetClientRect (hList, &rClient);
***************
*** 1457,1463 ****
        if ((cWindow = cyRECT(rClient) / cyItem) == 0)
           cWindow = 1;
  
!       int idxTop = SendMessage (hList, LB_GETTOPINDEX, 0, 0);
        if (index < (UINT)idxTop)
           {
           SendMessage (hList, LB_SETTOPINDEX, index, 0);
--- 1457,1463 ----
        if ((cWindow = cyRECT(rClient) / cyItem) == 0)
           cWindow = 1;
  
!       int idxTop = (int)SendMessage (hList, LB_GETTOPINDEX, 0, 0);
        if (index < (UINT)idxTop)
           {
           SendMessage (hList, LB_SETTOPINDEX, index, 0);
***************
*** 1555,1561 ****
        case LB_DELETESTRING:
           {
           int iItemSkip = (int)wp;
!          int iItemMax = SendMessage (hList, LB_GETCOUNT, 0, 0);
           int cchMax = 0;
           int iItem;
  
--- 1555,1561 ----
        case LB_DELETESTRING:
           {
           int iItemSkip = (int)wp;
!          int iItemMax = (int)SendMessage (hList, LB_GETCOUNT, 0, 0);
           int cchMax = 0;
           int iItem;
  
***************
*** 1563,1569 ****
              {
              if (iItem == iItemSkip)
                 continue;
!             int cch = SendMessage (hList, LB_GETTEXTLEN, (WPARAM)iItem, 0);
              cchMax = max (cch, cchMax);
              }
  
--- 1563,1569 ----
              {
              if (iItem == iItemSkip)
                 continue;
!             int cch = (int)SendMessage (hList, LB_GETTEXTLEN, (WPARAM)iItem, 0);
              cchMax = max (cch, cchMax);
              }
  
***************
*** 1587,1595 ****
        }
  
     if (oldProc)
!       return CallWindowProc ((WNDPROC)oldProc, hList, msg, wp, lp);
     else
!       return DefWindowProc (hList, msg, wp, lp);
  }
  
  
--- 1587,1595 ----
        }
  
     if (oldProc)
!       return (BOOL)CallWindowProc ((WNDPROC)oldProc, hList, msg, wp, lp);
     else
!       return (BOOL)DefWindowProc (hList, msg, wp, lp);
  }
  
  
***************
*** 1803,1809 ****
  void DisplayContextMenu (HMENU hm, POINT ptScreen, HWND hParent)
  {
     HMENU hmDummy = CreateMenu();
!    InsertMenu (hmDummy, 0, MF_POPUP, (UINT)hm, NULL);
  
     TrackPopupMenu (GetSubMenu (hmDummy, 0),
                     TPM_LEFTALIGN | TPM_RIGHTBUTTON,
--- 1803,1809 ----
  void DisplayContextMenu (HMENU hm, POINT ptScreen, HWND hParent)
  {
     HMENU hmDummy = CreateMenu();
!    InsertMenu (hmDummy, 0, MF_POPUP, (UINT)(UINT_PTR)hm, NULL);
  
     TrackPopupMenu (GetSubMenu (hmDummy, 0),
                     TPM_LEFTALIGN | TPM_RIGHTBUTTON,
Index: openafs/src/WINNT/afsd/NTMakefile
diff -c openafs/src/WINNT/afsd/NTMakefile:1.46 openafs/src/WINNT/afsd/NTMakefile:1.46.2.2
*** openafs/src/WINNT/afsd/NTMakefile:1.46	Thu Apr 20 13:18:42 2006
--- openafs/src/WINNT/afsd/NTMakefile	Tue Jul  4 02:28:23 2006
***************
*** 232,239 ****
  LOGON_DLLLIBS =\
      $(DESTDIR)\lib\afsauthent.lib \
      $(DESTDIR)\lib\libafsconf.lib \
-     $(DESTDIR)\lib\afsrxkad.lib \
-     $(DESTDIR)\lib\afsdes.lib \
      $(LANAHELPERLIB) \
      $(AFSKFWLIB)
  
--- 232,237 ----
***************
*** 404,409 ****
--- 402,408 ----
  	$(DESTDIR)\lib\libafsconf.lib \
  	$(DESTDIR)\lib\afs\afsreg.lib \
  	$(DESTDIR)\lib\afs\afsutil.lib \
+ 	$(DESTDIR)\lib\afspthread.lib \
          $(LANAHELPERLIB)
  
  $(AFSD_EXEFILE): $(OUT)\afsd.obj $(AFSDOBJS) $(OUT)\afsd.res  $(RXOBJS) $(AFSD_EXELIBS)
Index: openafs/src/WINNT/afsd/afsd_init.c
diff -c openafs/src/WINNT/afsd/afsd_init.c:1.79 openafs/src/WINNT/afsd/afsd_init.c:1.79.2.1
*** openafs/src/WINNT/afsd/afsd_init.c:1.79	Fri Apr 21 11:03:34 2006
--- openafs/src/WINNT/afsd/afsd_init.c	Thu Jun 22 17:54:40 2006
***************
*** 1254,1264 ****
      /* this should really be in an init daemon from here on down */
  
      if (!cm_freelanceEnabled) {
          osi_Log0(afsd_logp, "Loading Root Volume from cell");
!         code = cm_GetVolumeByName(cm_data.rootCellp, cm_rootVolumeName, cm_rootUserp,
!                                   &req, CM_FLAG_CREATE, &cm_data.rootVolumep);
!         afsi_log("cm_GetVolumeByName code %x root vol %x", code,
!                  (code ? (cm_volume_t *)-1 : cm_data.rootVolumep));
          if (code != 0) {
              *reasonP = "can't find root volume in root cell";
              return -1;
--- 1254,1268 ----
      /* this should really be in an init daemon from here on down */
  
      if (!cm_freelanceEnabled) {
+ 	int attempts = 10;
+ 
          osi_Log0(afsd_logp, "Loading Root Volume from cell");
! 	do {
! 	    code = cm_GetVolumeByName(cm_data.rootCellp, cm_rootVolumeName, cm_rootUserp,
! 				       &req, CM_FLAG_CREATE, &cm_data.rootVolumep);
! 	    afsi_log("cm_GetVolumeByName code %x root vol %x", code,
! 		      (code ? (cm_volume_t *)-1 : cm_data.rootVolumep));
! 	} while (code && --attempts);
          if (code != 0) {
              *reasonP = "can't find root volume in root cell";
              return -1;
Index: openafs/src/WINNT/afsd/afskfw.c
diff -c openafs/src/WINNT/afsd/afskfw.c:1.28 openafs/src/WINNT/afsd/afskfw.c:1.28.4.1
*** openafs/src/WINNT/afsd/afskfw.c:1.28	Mon Dec 19 07:36:48 2005
--- openafs/src/WINNT/afsd/afskfw.c	Sun Jul  2 21:03:13 2006
***************
*** 1,4 ****
--- 1,5 ----
  /*
+  * Copyright (c) 2004, 2005 Secure Endpoints Inc.
   * Copyright (c) 2003 SkyRope, LLC
   * All rights reserved.
   * 
***************
*** 61,69 ****
  #include "afskfw.h"
  
  #include <osilog.h>
- #include <rxkad_prototypes.h>   /* for life_to_time */
  #include <afs/ptserver.h>
  #include <afs/ptuser.h>
  
  #include <WINNT\afsreg.h>
  
--- 62,70 ----
  #include "afskfw.h"
  
  #include <osilog.h>
  #include <afs/ptserver.h>
  #include <afs/ptuser.h>
+ #include <rx/rxkad.h>
  
  #include <WINNT\afsreg.h>
  
***************
*** 2549,2554 ****
--- 2550,2556 ----
          strncpy(sname, username, PR_MAXNAMELEN);
          sname[PR_MAXNAMELEN-1] = '\0';    
          status = pr_SNameToId (sname, &viceId);
+ 	pr_End();
      }
  
      /*
***************
*** 2588,2595 ****
                  return status;
              if (status = pr_Initialize(1L, confname, aserver->cell))
                  return status;
!             if (status = pr_CreateUser(username, &id))
!                 return status;
  #ifdef AFS_ID_TO_NAME
              strncpy(username_copy, username, BUFSIZ);
              snprintf (username, BUFSIZ, "%s (AFS ID %d)", username_copy, (int) viceId);
--- 2590,2599 ----
                  return status;
              if (status = pr_Initialize(1L, confname, aserver->cell))
                  return status;
!             status = pr_CreateUser(username, &id);
! 	    pr_End();
! 	    if (status)
! 		return status;
  #ifdef AFS_ID_TO_NAME
              strncpy(username_copy, username, BUFSIZ);
              snprintf (username, BUFSIZ, "%s (AFS ID %d)", username_copy, (int) viceId);
***************
*** 2962,2969 ****
              p[len] = '\0';
          }
  
!         ViceIDToUsername(aclient.name, realm_of_user, realm_of_cell, CellName, 
!                          &aclient, &aserver, &atoken);
  
          if ( smbname ) {
              strncpy(aclient.smbname, smbname, sizeof(aclient.smbname));
--- 2966,2975 ----
              p[len] = '\0';
          }
  
! 	GetEnvironmentVariable(DO_NOT_REGISTER_VARNAME, NULL, 0);
! 	if (GetLastError() == ERROR_ENVVAR_NOT_FOUND)
! 	    ViceIDToUsername(aclient.name, realm_of_user, realm_of_cell, CellName, 
! 			     &aclient, &aserver, &atoken);
  
          if ( smbname ) {
              strncpy(aclient.smbname, smbname, sizeof(aclient.smbname));
***************
*** 3080,3087 ****
  
      strcpy(aclient.cell, CellName);
  
!     ViceIDToUsername(aclient.name, realm_of_user, realm_of_cell, CellName, 
!                       &aclient, &aserver, &atoken);
  
      if ( smbname ) {
          strncpy(aclient.smbname, smbname, sizeof(aclient.smbname));
--- 3086,3095 ----
  
      strcpy(aclient.cell, CellName);
  
!     GetEnvironmentVariable(DO_NOT_REGISTER_VARNAME, NULL, 0);
!     if (GetLastError() == ERROR_ENVVAR_NOT_FOUND)
! 	ViceIDToUsername(aclient.name, realm_of_user, realm_of_cell, CellName, 
! 			 &aclient, &aserver, &atoken);
  
      if ( smbname ) {
          strncpy(aclient.smbname, smbname, sizeof(aclient.smbname));
***************
*** 3608,3610 ****
--- 3616,3769 ----
  
      return 0;
  }
+ 
+ /* We are including this 
+ 
+ /* Ticket lifetime.  This defines the table used to lookup lifetime for the
+    fixed part of rande of the one byte lifetime field.  Values less than 0x80
+    are intrpreted as the number of 5 minute intervals.  Values from 0x80 to
+    0xBF should be looked up in this table.  The value of 0x80 is the same using
+    both methods: 10 and two-thirds hours .  The lifetime of 0xBF is 30 days.
+    The intervening values of have a fixed ratio of roughly 1.06914.  The value
+    oxFF is defined to mean a ticket has no expiration time.  This should be
+    used advisedly since individual servers may impose defacto upperbounds on
+    ticket lifetimes. */
+ 
+ #define TKTLIFENUMFIXED 64
+ #define TKTLIFEMINFIXED 0x80
+ #define TKTLIFEMAXFIXED 0xBF
+ #define TKTLIFENOEXPIRE 0xFF
+ #define MAXTKTLIFETIME	(30*24*3600)	/* 30 days */
+ 
+ static const int tkt_lifetimes[TKTLIFENUMFIXED] = {
+     38400,			/* 10.67 hours, 0.44 days */
+     41055,			/* 11.40 hours, 0.48 days */
+     43894,			/* 12.19 hours, 0.51 days */
+     46929,			/* 13.04 hours, 0.54 days */
+     50174,			/* 13.94 hours, 0.58 days */
+     53643,			/* 14.90 hours, 0.62 days */
+     57352,			/* 15.93 hours, 0.66 days */
+     61318,			/* 17.03 hours, 0.71 days */
+     65558,			/* 18.21 hours, 0.76 days */
+     70091,			/* 19.47 hours, 0.81 days */
+     74937,			/* 20.82 hours, 0.87 days */
+     80119,			/* 22.26 hours, 0.93 days */
+     85658,			/* 23.79 hours, 0.99 days */
+     91581,			/* 25.44 hours, 1.06 days */
+     97914,			/* 27.20 hours, 1.13 days */
+     104684,			/* 29.08 hours, 1.21 days */
+     111922,			/* 31.09 hours, 1.30 days */
+     119661,			/* 33.24 hours, 1.38 days */
+     127935,			/* 35.54 hours, 1.48 days */
+     136781,			/* 37.99 hours, 1.58 days */
+     146239,			/* 40.62 hours, 1.69 days */
+     156350,			/* 43.43 hours, 1.81 days */
+     167161,			/* 46.43 hours, 1.93 days */
+     178720,			/* 49.64 hours, 2.07 days */
+     191077,			/* 53.08 hours, 2.21 days */
+     204289,			/* 56.75 hours, 2.36 days */
+     218415,			/* 60.67 hours, 2.53 days */
+     233517,			/* 64.87 hours, 2.70 days */
+     249664,			/* 69.35 hours, 2.89 days */
+     266926,			/* 74.15 hours, 3.09 days */
+     285383,			/* 79.27 hours, 3.30 days */
+     305116,			/* 84.75 hours, 3.53 days */
+     326213,			/* 90.61 hours, 3.78 days */
+     348769,			/* 96.88 hours, 4.04 days */
+     372885,			/* 103.58 hours, 4.32 days */
+     398668,			/* 110.74 hours, 4.61 days */
+     426234,			/* 118.40 hours, 4.93 days */
+     455705,			/* 126.58 hours, 5.27 days */
+     487215,			/* 135.34 hours, 5.64 days */
+     520904,			/* 144.70 hours, 6.03 days */
+     556921,			/* 154.70 hours, 6.45 days */
+     595430,			/* 165.40 hours, 6.89 days */
+     636601,			/* 176.83 hours, 7.37 days */
+     680618,			/* 189.06 hours, 7.88 days */
+     727680,			/* 202.13 hours, 8.42 days */
+     777995,			/* 216.11 hours, 9.00 days */
+     831789,			/* 231.05 hours, 9.63 days */
+     889303,			/* 247.03 hours, 10.29 days */
+     950794,			/* 264.11 hours, 11.00 days */
+     1016537,			/* 282.37 hours, 11.77 days */
+     1086825,			/* 301.90 hours, 12.58 days */
+     1161973,			/* 322.77 hours, 13.45 days */
+     1242318,			/* 345.09 hours, 14.38 days */
+     1328218,			/* 368.95 hours, 15.37 days */
+     1420057,			/* 394.46 hours, 16.44 days */
+     1518247,			/* 421.74 hours, 17.57 days */
+     1623226,			/* 450.90 hours, 18.79 days */
+     1735464,			/* 482.07 hours, 20.09 days */
+     1855462,			/* 515.41 hours, 21.48 days */
+     1983758,			/* 551.04 hours, 22.96 days */
+     2120925,			/* 589.15 hours, 24.55 days */
+     2267576,			/* 629.88 hours, 26.25 days */
+     2424367,			/* 673.44 hours, 28.06 days */
+     2592000
+ };				/* 720.00 hours, 30.00 days */
+ 
+ /* life_to_time - takes a start time and a Kerberos standard lifetime char and
+  * returns the corresponding end time.  There are four simple cases to be
+  * handled.  The first is a life of 0xff, meaning no expiration, and results in
+  * an end time of 0xffffffff.  The second is when life is less than the values
+  * covered by the table.  In this case, the end time is the start time plus the
+  * number of 5 minute intervals specified by life.  The third case returns
+  * start plus the MAXTKTLIFETIME if life is greater than TKTLIFEMAXFIXED.  The
+  * last case, uses the life value (minus TKTLIFEMINFIXED) as an index into the
+  * table to extract the lifetime in seconds, which is added to start to produce
+  * the end time. */
+ 
+ afs_uint32
+ life_to_time(afs_uint32 start, unsigned char life)
+ {
+     int realLife;
+ 
+     if (life == TKTLIFENOEXPIRE)
+ 	return NEVERDATE;
+     if (life < TKTLIFEMINFIXED)
+ 	return start + life * 5 * 60;
+     if (life > TKTLIFEMAXFIXED)
+ 	return start + MAXTKTLIFETIME;
+     realLife = tkt_lifetimes[life - TKTLIFEMINFIXED];
+     return start + realLife;
+ }
+ 
+ /* time_to_life - takes start and end times for the ticket and returns a
+  * Kerberos standard lifetime char possibily using the tkt_lifetimes table for
+  * lifetimes above 127*5minutes.  First, the special case of (end ==
+  * 0xffffffff) is handled to mean no expiration.  Then negative lifetimes and
+  * those greater than the maximum ticket lifetime are rejected.  Then lifetimes
+  * less than the first table entry are handled by rounding the requested
+  * lifetime *up* to the next 5 minute interval.  The final step is to search
+  * the table for the smallest entry *greater than or equal* to the requested
+  * entry.  The actual code is prepared to handle the case where the table is
+  * unordered but that it an unnecessary frill. */
+ 
+ static unsigned char
+ time_to_life(afs_uint32 start, afs_uint32 end)
+ {
+     int lifetime = end - start;
+     int best, best_i;
+     int i;
+ 
+     if (end == NEVERDATE)
+ 	return TKTLIFENOEXPIRE;
+     if ((lifetime > MAXKTCTICKETLIFETIME) || (lifetime <= 0))
+ 	return 0;
+     if (lifetime < tkt_lifetimes[0])
+ 	return (lifetime + 5 * 60 - 1) / (5 * 60);
+     best_i = -1;
+     best = MAXKTCTICKETLIFETIME;
+     for (i = 0; i < TKTLIFENUMFIXED; i++)
+ 	if (tkt_lifetimes[i] >= lifetime) {
+ 	    int diff = tkt_lifetimes[i] - lifetime;
+ 	    if (diff < best) {
+ 		best = diff;
+ 		best_i = i;
+ 	    }
+ 	}
+     if (best_i < 0)
+ 	return 0;
+     return best_i + TKTLIFEMINFIXED;
+ }
+ 
Index: openafs/src/WINNT/afsd/afskfw.h
diff -c openafs/src/WINNT/afsd/afskfw.h:1.4 openafs/src/WINNT/afsd/afskfw.h:1.4.4.1
*** openafs/src/WINNT/afsd/afskfw.h:1.4	Sun May 29 23:52:01 2005
--- openafs/src/WINNT/afsd/afskfw.h	Sun Jul  2 21:03:13 2006
***************
*** 88,93 ****
--- 88,94 ----
  #define PROBE_USERNAME               "OPENAFS-KDC-PROBE"
  #define PROBE_PASSWORD_LEN           16
  
+ #define DO_NOT_REGISTER_VARNAME  "OPENAFS_DO_NOT_REGISTER_AFS_ID"
  #ifdef  __cplusplus
  }
  #endif
Index: openafs/src/WINNT/afsd/afslogon.c
diff -c openafs/src/WINNT/afsd/afslogon.c:1.45 openafs/src/WINNT/afsd/afslogon.c:1.45.2.1
*** openafs/src/WINNT/afsd/afslogon.c:1.45	Thu Feb  9 10:28:56 2006
--- openafs/src/WINNT/afsd/afslogon.c	Sun Jul  2 21:03:13 2006
***************
*** 35,41 ****
  
  HANDLE hDLL;
  
- WSADATA WSAjunk;
  #define AFS_LOGON_EVENT_NAME TEXT("AFS Logon")
  
  void DebugEvent0(char *a) 
--- 35,40 ----
***************
*** 79,89 ****
      switch (reason) {
      case DLL_PROCESS_ATTACH:
          /* Initialization Mutex */
!         hInitMutex = CreateMutex(NULL, FALSE, NULL);
          break;
  
      case DLL_PROCESS_DETACH:
!         CloseHandle(hInitMutex);
          break;
  
      case DLL_THREAD_ATTACH:
--- 78,96 ----
      switch (reason) {
      case DLL_PROCESS_ATTACH:
          /* Initialization Mutex */
! 	if (!bInit) {
! 	    hInitMutex = CreateMutex(NULL, FALSE, NULL);
! 	    SetEnvironmentVariable(DO_NOT_REGISTER_VARNAME, "");
! 	}
          break;
  
      case DLL_PROCESS_DETACH:
! 	/* do nothing on unload because we might 
! 	 * be reloaded.
! 	 */
! 	CloseHandle(hInitMutex);
! 	hInitMutex = NULL;
! 	bInit = FALSE;
          break;
  
      case DLL_THREAD_ATTACH:
***************
*** 100,113 ****
  {
      if ( bInit == FALSE ) {
          if ( WaitForSingleObject( hInitMutex, INFINITE ) == WAIT_OBJECT_0 ) {
!             if ( bInit == FALSE ) {
!                 rx_Init(0);
!                 initAFSDirPath();
!                 ka_Init(0);
!                 bInit = TRUE;
!             }
!             ReleaseMutex(hInitMutex);
!         }
      }
  }
  
--- 107,134 ----
  {
      if ( bInit == FALSE ) {
          if ( WaitForSingleObject( hInitMutex, INFINITE ) == WAIT_OBJECT_0 ) {
! 	    /* initAFSDirPath() initializes an array and sets a 
! 	     * flag so that the initialization can only occur
! 	     * once.  No cleanup will be done when the DLL is 
! 	     * unloaded so the initialization will not be 
! 	     * performed again on a subsequent reload
! 	     */
! 	    initAFSDirPath();
! 
! 	    /* ka_Init initializes a number of error tables.
! 	     * and then calls ka_CellConfig() which grabs 
! 	     * an afsconf_dir structure via afsconf_Open().
! 	     * Upon a second attempt to call ka_CellConfig()
! 	     * the structure will be released with afsconf_Close()
! 	     * and then re-opened.  Could this corrupt memory?
! 	     * 
! 	     * We only need this if we are not using KFW.
! 	     */
! 	    if (!KFW_is_available())
! 		ka_Init(0);
! 	    bInit = TRUE;
! 	}
! 	ReleaseMutex(hInitMutex);
      }
  }
  
***************
*** 913,919 ****
      /* remove any kerberos 5 tickets currently held by the SYSTEM account
       * for this user 
       */
!     if ( KFW_is_available() ) {
  	sprintf(szLogonId,"%d.%d",lpLogonId->HighPart, lpLogonId->LowPart);
  	KFW_AFS_copy_cache_to_system_file(uname, szLogonId);
  
--- 934,940 ----
      /* remove any kerberos 5 tickets currently held by the SYSTEM account
       * for this user 
       */
!     if (ISLOGONINTEGRATED(opt.LogonOption) && KFW_is_available()) {
  	sprintf(szLogonId,"%d.%d",lpLogonId->HighPart, lpLogonId->LowPart);
  	KFW_AFS_copy_cache_to_system_file(uname, szLogonId);
  
Index: openafs/src/WINNT/afsd/cm.h
diff -c openafs/src/WINNT/afsd/cm.h:1.17 openafs/src/WINNT/afsd/cm.h:1.17.2.1
*** openafs/src/WINNT/afsd/cm.h:1.17	Mon Mar  6 15:07:08 2006
--- openafs/src/WINNT/afsd/cm.h	Sat Jun 24 16:41:54 2006
***************
*** 10,15 ****
--- 10,18 ----
  #ifndef __CM_H_ENV__
  #define __CM_H_ENV__ 1
  
+ #ifndef AFS_PTHREAD_ENV
+ #define AFS_PTHREAD_ENV 1
+ #endif
  #include <rx/rx.h>
  #ifdef DJGPP      /* we need these for vldbentry decl., etc. */
  #include <afs/vldbint.h>
Index: openafs/src/WINNT/afsd/cm_access.c
diff -c openafs/src/WINNT/afsd/cm_access.c:1.7.2.2 openafs/src/WINNT/afsd/cm_access.c:1.7.2.3
*** openafs/src/WINNT/afsd/cm_access.c:1.7.2.2	Thu Jun  1 11:40:57 2006
--- openafs/src/WINNT/afsd/cm_access.c	Wed Jun 28 01:34:50 2006
***************
*** 150,156 ****
              return code;
          }       
                  
!         osi_Log1(afsd_logp, "GetAccess parent scp %x user %x", aclScp, userp);
          lock_ObtainMutex(&aclScp->mx);
  
  	code = cm_GetCallback(aclScp, userp, reqp, 1);
--- 150,156 ----
              return code;
          }       
                  
!         osi_Log2(afsd_logp, "GetAccess parent scp %x user %x", aclScp, userp);
          lock_ObtainMutex(&aclScp->mx);
  
  	code = cm_GetCallback(aclScp, userp, reqp, 1);
Index: openafs/src/WINNT/afsd/cm_callback.c
diff -c openafs/src/WINNT/afsd/cm_callback.c:1.41.4.1 openafs/src/WINNT/afsd/cm_callback.c:1.41.4.5
*** openafs/src/WINNT/afsd/cm_callback.c:1.41.4.1	Thu Jun  1 11:40:57 2006
--- openafs/src/WINNT/afsd/cm_callback.c	Tue Jun 27 23:24:05 2006
***************
*** 21,30 ****
  #include <string.h>
  #include <stdlib.h>
  
  #include <osi.h>
  #include <rx_pthread.h>
  
- #include "afsd.h"
  #include <WINNT/syscfg.h>
  #include <WINNT/afsreg.h>
  #include <../afsrdr/kif.h>
--- 21,30 ----
  #include <string.h>
  #include <stdlib.h>
  
+ #include "afsd.h"
  #include <osi.h>
  #include <rx_pthread.h>
  
  #include <WINNT/syscfg.h>
  #include <WINNT/afsreg.h>
  #include <../afsrdr/kif.h>
***************
*** 475,483 ****
  	
  	lock_ReleaseWrite(&cm_scacheLock);
  	
! 	/* we're done with the server structure */
! 	if (tsp) 
              cm_PutServer(tsp);
      }
      MUTEX_EXIT(&callp->lock);
      return 0;
--- 475,488 ----
  	
  	lock_ReleaseWrite(&cm_scacheLock);
  	
! 	if (tsp) {
! 	    /* reset the No flags on the server */
! 	    cm_SetServerNo64Bit(tsp, 0);
! 	    cm_SetServerNoInlineBulk(tsp, 0);
! 
! 	    /* we're done with the server structure */
              cm_PutServer(tsp);
+ 	}
      }
      MUTEX_EXIT(&callp->lock);
      return 0;
***************
*** 829,835 ****
      cep->Length.high = scp->length.HighPart;
      cep->Length.low = scp->length.LowPart;
  #else
!     cep->Length = ((afs_int64)scp->length.HighPart)<<32 | scp->length.LowPart;
  #endif
      cep->DataVersion = scp->dataVersion;
      cep->callback = afs_data_pointer_to_int32(scp->cbServerp);
--- 834,840 ----
      cep->Length.high = scp->length.HighPart;
      cep->Length.low = scp->length.LowPart;
  #else
!     cep->Length = (afs_int64) scp->length.QuadPart;
  #endif
      cep->DataVersion = scp->dataVersion;
      cep->callback = afs_data_pointer_to_int32(scp->cbServerp);
***************
*** 1614,1620 ****
                      struct cm_req *reqp, long flags)
  {
      long code;
!     cm_conn_t *connp;
      AFSFetchStatus afsStatus;
      AFSVolSync volSync;
      AFSCallBack callback;
--- 1619,1625 ----
                      struct cm_req *reqp, long flags)
  {
      long code;
!     cm_conn_t *connp = NULL;
      AFSFetchStatus afsStatus;
      AFSVolSync volSync;
      AFSCallBack callback;
***************
*** 1623,1629 ****
      int mustCall;
      long sflags;
      cm_fid_t sfid;
!     struct rx_connection * callp;
  
      osi_Log4(afsd_logp, "GetCallback scp 0x%p cell %d vol %d flags %lX", 
               scp, scp->fid.cell, scp->fid.volume, flags);
--- 1628,1634 ----
      int mustCall;
      long sflags;
      cm_fid_t sfid;
!     struct rx_connection * callp = NULL;
  
      osi_Log4(afsd_logp, "GetCallback scp 0x%p cell %d vol %d flags %lX", 
               scp, scp->fid.cell, scp->fid.volume, flags);
***************
*** 1688,1694 ****
  		
          /* now make the RPC */
          osi_Log4(afsd_logp, "CALL FetchStatus scp 0x%p vol %u vn %u uniq %u", 
!                  scp, scp->fid.volume, scp->fid.vnode, scp->fid.unique);
          do {
              code = cm_Conn(&sfid, userp, reqp, &connp);
              if (code) 
--- 1693,1699 ----
  		
          /* now make the RPC */
          osi_Log4(afsd_logp, "CALL FetchStatus scp 0x%p vol %u vn %u uniq %u", 
!                  scp, sfid.volume, sfid.vnode, sfid.unique);
          do {
              code = cm_Conn(&sfid, userp, reqp, &connp);
              if (code) 
Index: openafs/src/WINNT/afsd/cm_conn.c
diff -c openafs/src/WINNT/afsd/cm_conn.c:1.49.2.1 openafs/src/WINNT/afsd/cm_conn.c:1.49.2.3
*** openafs/src/WINNT/afsd/cm_conn.c:1.49.2.1	Sat Jun  3 14:01:19 2006
--- openafs/src/WINNT/afsd/cm_conn.c	Tue Jun 27 11:40:33 2006
***************
*** 16,25 ****
  #include <string.h>
  #include <malloc.h>
  #include <osi.h>
  #include <rx/rx.h>
  #include <rx/rxkad.h>
  #include <afs/unified_afs.h>
- #include "afsd.h"
  
  osi_rwlock_t cm_connLock;
  
--- 16,25 ----
  #include <string.h>
  #include <malloc.h>
  #include <osi.h>
+ #include "afsd.h"
  #include <rx/rx.h>
  #include <rx/rxkad.h>
  #include <afs/unified_afs.h>
  
  osi_rwlock_t cm_connLock;
  
***************
*** 522,528 ****
              case EINVAL            : s = "EINVAL";             break;
  	    case UAEINVAL          : s = "UAEINVAL";	       break;
              case EACCES            : s = "EACCES";             break;
! 	    case UAEACCES 	   : s = "UAECCES";            break;
  	    case ENOENT            : s = "ENOENT"; 	       break;
  	    case UAENOENT          : s = "UAENOENT";           break;
  	    case CM_ERROR_NOSUCHCELL	    : s = "CM_ERROR_NOSUCHCELL";         break; 			
--- 522,528 ----
              case EINVAL            : s = "EINVAL";             break;
  	    case UAEINVAL          : s = "UAEINVAL";	       break;
              case EACCES            : s = "EACCES";             break;
! 	    case UAEACCES 	   : s = "UAEACCES";           break;
  	    case ENOENT            : s = "ENOENT"; 	       break;
  	    case UAENOENT          : s = "UAENOENT";           break;
  	    case CM_ERROR_NOSUCHCELL	    : s = "CM_ERROR_NOSUCHCELL";         break; 			
Index: openafs/src/WINNT/afsd/cm_conn.h
diff -c openafs/src/WINNT/afsd/cm_conn.h:1.13 openafs/src/WINNT/afsd/cm_conn.h:1.13.4.2
*** openafs/src/WINNT/afsd/cm_conn.h:1.13	Mon Nov 21 19:28:14 2005
--- openafs/src/WINNT/afsd/cm_conn.h	Wed Jun 28 01:34:50 2006
***************
*** 16,21 ****
--- 16,22 ----
  
  extern unsigned short ConnDeadtimeout;
  extern unsigned short HardDeadtimeout;
+ extern long           RDRtimeout; 
  
  typedef struct cm_conn {
  	struct cm_conn *nextp;		/* locked by cm_connLock */
***************
*** 91,96 ****
--- 92,100 ----
  				   cache managers treat it as "server is down"*/
  
  #include "cm_server.h"
+ #ifndef AFS_PTHREAD_ENV
+ #define AFS_PTHREAD_ENV 1
+ #endif
  #include "rx.h"
  
  extern void cm_InitConn(void);
Index: openafs/src/WINNT/afsd/cm_daemon.c
diff -c openafs/src/WINNT/afsd/cm_daemon.c:1.16.4.1 openafs/src/WINNT/afsd/cm_daemon.c:1.16.4.2
*** openafs/src/WINNT/afsd/cm_daemon.c:1.16.4.1	Thu Jun  1 11:36:46 2006
--- openafs/src/WINNT/afsd/cm_daemon.c	Sat Jun 24 16:41:54 2006
***************
*** 21,31 ****
  #include <malloc.h>
  #include <string.h>
  
  #include <rx/rx.h>
  #include <rx/rx_prototypes.h>
  #include <WINNT/afsreg.h>
  
- #include "afsd.h"
  #include "afsicf.h"
  
  /* in seconds */
--- 21,32 ----
  #include <malloc.h>
  #include <string.h>
  
+ #include "afsd.h"
+ 
  #include <rx/rx.h>
  #include <rx/rx_prototypes.h>
  #include <WINNT/afsreg.h>
  
  #include "afsicf.h"
  
  /* in seconds */
Index: openafs/src/WINNT/afsd/cm_dcache.c
diff -c openafs/src/WINNT/afsd/cm_dcache.c:1.30 openafs/src/WINNT/afsd/cm_dcache.c:1.30.2.1
*** openafs/src/WINNT/afsd/cm_dcache.c:1.30	Wed Feb  1 13:02:29 2006
--- openafs/src/WINNT/afsd/cm_dcache.c	Sat Jun 24 16:41:54 2006
***************
*** 33,38 ****
--- 33,48 ----
  extern osi_mutex_t cm_Freelance_Lock;
  #endif
  
+ #ifdef AFS_LARGEFILES
+ /* we can access connp->serverp without holding a lock because that
+    never changes since the connection is made. */
+ #define SERVERHAS64BIT(connp) (!((connp)->serverp->flags & CM_SERVERFLAG_NO64BIT))
+ #define SET_SERVERHASNO64BIT(connp) (cm_SetServerNo64Bit((connp)->serverp, TRUE))
+ #else
+ #define SERVERHAS64BIT(connp) (FALSE)
+ #define SET_SERVERHASNO64BIT(connp) (FALSE)
+ #endif
+ 
  /* functions called back from the buffer package when reading or writing data,
   * or when holding or releasing a vnode pointer.
   */
***************
*** 62,69 ****
      long wbytes;
      char *bufferp;
      cm_conn_t *connp;
!     long truncPos;
      cm_bulkIO_t biod;		/* bulk IO descriptor */
  
      osi_assert(userp != NULL);
  
--- 72,80 ----
      long wbytes;
      char *bufferp;
      cm_conn_t *connp;
!     osi_hyper_t truncPos;
      cm_bulkIO_t biod;		/* bulk IO descriptor */
+     int require_64bit_ops = 0;
  
      osi_assert(userp != NULL);
  
***************
*** 78,84 ****
      cm_AFSFidFromFid(&tfid, fidp);
  
      lock_ObtainMutex(&scp->mx);
!         
      code = cm_SetupStoreBIOD(scp, offsetp, length, &biod, userp, reqp);
      if (code) {
          osi_Log1(afsd_logp, "cm_SetupStoreBIOD code %x", code);
--- 89,95 ----
      cm_AFSFidFromFid(&tfid, fidp);
  
      lock_ObtainMutex(&scp->mx);
! 
      code = cm_SetupStoreBIOD(scp, offsetp, length, &biod, userp, reqp);
      if (code) {
          osi_Log1(afsd_logp, "cm_SetupStoreBIOD code %x", code);
***************
*** 93,99 ****
          cm_ReleaseBIOD(&biod, 1);	/* should be a NOOP */
          cm_ReleaseSCache(scp);
          return 0;
!     }   
  
      /* Serialize StoreData RPC's; for rationale see cm_scache.c */
      (void) cm_SyncOp(scp, NULL, userp, reqp, 0, CM_SCACHESYNC_STOREDATA_EXCL);
--- 104,110 ----
          cm_ReleaseBIOD(&biod, 1);	/* should be a NOOP */
          cm_ReleaseSCache(scp);
          return 0;
!     }
  
      /* Serialize StoreData RPC's; for rationale see cm_scache.c */
      (void) cm_SyncOp(scp, NULL, userp, reqp, 0, CM_SCACHESYNC_STOREDATA_EXCL);
***************
*** 101,110 ****
      /* prepare the output status for the store */
      scp->mask |= CM_SCACHEMASK_CLIENTMODTIME;
      cm_StatusFromAttr(&inStatus, scp, NULL);
!     truncPos = scp->length.LowPart;
      if ((scp->mask & CM_SCACHEMASK_TRUNCPOS)
!          && scp->truncPos.LowPart < (unsigned long) truncPos)
!         truncPos = scp->truncPos.LowPart;
  	scp->mask &= ~CM_SCACHEMASK_TRUNCPOS;
                  
      /* compute how many bytes to write from this buffer */
--- 112,121 ----
      /* prepare the output status for the store */
      scp->mask |= CM_SCACHEMASK_CLIENTMODTIME;
      cm_StatusFromAttr(&inStatus, scp, NULL);
!     truncPos = scp->length;
      if ((scp->mask & CM_SCACHEMASK_TRUNCPOS)
!         && LargeIntegerLessThan(scp->truncPos, truncPos))
!         truncPos = scp->truncPos;
  	scp->mask &= ~CM_SCACHEMASK_TRUNCPOS;
                  
      /* compute how many bytes to write from this buffer */
***************
*** 117,144 ****
          /* otherwise write out part of buffer before EOF, but not
           * more than bufferSize bytes.
           */
!         nbytes = thyper.LowPart;
!         if (nbytes > biod.length) 
              nbytes = biod.length;
      }
  
!     lock_ReleaseMutex(&scp->mx);
          
      /* now we're ready to do the store operation */
      do {
          code = cm_Conn(&scp->fid, userp, reqp, &connp);
          if (code) 
              continue;
! 		
          rxconnp = cm_GetRxConn(connp);
          callp = rx_NewCall(rxconnp);
          rx_PutConnection(rxconnp);
  
          osi_Log4(afsd_logp, "CALL StoreData scp 0x%p, offset 0x%x:%08x, length 0x%x",
                   scp, biod.offset.HighPart, biod.offset.LowPart, nbytes);
  
          code = StartRXAFS_StoreData(callp, &tfid, &inStatus,
!                                     biod.offset.LowPart, nbytes, truncPos);
  
          if (code == 0) {
              /* write the data from the the list of buffers */
--- 128,193 ----
          /* otherwise write out part of buffer before EOF, but not
           * more than bufferSize bytes.
           */
!         if (LargeIntegerGreaterThan(thyper,
!                                     ConvertLongToLargeInteger(biod.length))) {
              nbytes = biod.length;
+         } else {
+             /* if thyper is less than or equal to biod.length, then we
+                can safely assume that the value fits in a long. */
+             nbytes = thyper.LowPart;
+         }
      }
  
!     if (LargeIntegerGreaterThan(LargeIntegerAdd(biod.offset,
!                                                  ConvertLongToLargeInteger(nbytes)),
!                                  ConvertLongToLargeInteger(LONG_MAX)) ||
!          LargeIntegerGreaterThan(truncPos,
!                                  ConvertLongToLargeInteger(LONG_MAX))) {
!         require_64bit_ops = 1;
!     }
          
+     lock_ReleaseMutex(&scp->mx);
+ 
      /* now we're ready to do the store operation */
      do {
          code = cm_Conn(&scp->fid, userp, reqp, &connp);
          if (code) 
              continue;
! 
!     retry:
          rxconnp = cm_GetRxConn(connp);
          callp = rx_NewCall(rxconnp);
          rx_PutConnection(rxconnp);
  
+ #ifdef AFS_LARGEFILES
+         if (SERVERHAS64BIT(connp)) {
+             osi_Log4(afsd_logp, "CALL StoreData64 scp 0x%p, offset 0x%x:%08x, length 0x%x",
+                      scp, biod.offset.HighPart, biod.offset.LowPart, nbytes);
+ 
+             code = StartRXAFS_StoreData64(callp, &tfid, &inStatus,
+                                           biod.offset.QuadPart,
+                                           nbytes,
+                                           truncPos.QuadPart);
+         } else {
+ 
+             if (require_64bit_ops) {
+                 osi_Log0(afsd_logp, "Skipping StoreData.  The operation requires StoreData64");
+                 code = CM_ERROR_TOOBIG;
+             } else {
+                 osi_Log4(afsd_logp, "CALL StoreData scp 0x%p, offset 0x%x:%08x, length 0x%x",
+                          scp, biod.offset.HighPart, biod.offset.LowPart, nbytes);
+ 
+                 code = StartRXAFS_StoreData(callp, &tfid, &inStatus,
+                                             biod.offset.LowPart, nbytes, truncPos.LowPart);
+             }
+         }
+ #else
          osi_Log4(afsd_logp, "CALL StoreData scp 0x%p, offset 0x%x:%08x, length 0x%x",
                   scp, biod.offset.HighPart, biod.offset.LowPart, nbytes);
  
          code = StartRXAFS_StoreData(callp, &tfid, &inStatus,
!                                     biod.offset.LowPart, nbytes, truncPos.LowPart);
! #endif
  
          if (code == 0) {
              /* write the data from the the list of buffers */
***************
*** 168,185 ****
              }	/* while more bytes to write */
          }		/* if RPC started successfully */
          else {
!             osi_Log2(afsd_logp, "StartRXAFS_StoreData scp 0x%p failed (%lX)",scp,code);
          }
          if (code == 0) {
!             code = EndRXAFS_StoreData(callp, &outStatus, &volSync);
!             if (code)
!                 osi_Log2(afsd_logp, "EndRXAFS_StoreData scp 0x%p failed (%lX)",scp,code);
          }
          code = rx_EndCall(callp, code);
                  
      } while (cm_Analyze(connp, userp, reqp, &scp->fid, &volSync, NULL, NULL, code));
      code = cm_MapRPCError(code, reqp);
!         
      if (code)
          osi_Log2(afsd_logp, "CALL StoreData FAILURE scp 0x%p, code 0x%x", scp, code);
      else
--- 217,250 ----
              }	/* while more bytes to write */
          }		/* if RPC started successfully */
          else {
!             osi_Log2(afsd_logp, "StartRXAFS_StoreData?? scp 0x%p failed (%lX)",scp,code);
          }
+ 
          if (code == 0) {
!             if (SERVERHAS64BIT(connp)) {
!                 code = EndRXAFS_StoreData64(callp, &outStatus, &volSync);
!                 if (code)
!                     osi_Log2(afsd_logp, "EndRXAFS_StoreData64 scp 0x%p failed (%lX)", scp, code);
!             } else {
!                 code = EndRXAFS_StoreData(callp, &outStatus, &volSync);
!                 if (code)
!                     osi_Log2(afsd_logp, "EndRXAFS_StoreData scp 0x%p failed (%lX)",scp,code);
!             }
          }
+ 
          code = rx_EndCall(callp, code);
+ 
+ #ifdef AFS_LARGEFILES
+         if (code == RXGEN_OPCODE && SERVERHAS64BIT(connp)) {
+             SET_SERVERHASNO64BIT(connp);
+             goto retry;
+         }
+ #endif
                  
      } while (cm_Analyze(connp, userp, reqp, &scp->fid, &volSync, NULL, NULL, code));
+ 
      code = cm_MapRPCError(code, reqp);
! 
      if (code)
          osi_Log2(afsd_logp, "CALL StoreData FAILURE scp 0x%p, code 0x%x", scp, code);
      else
***************
*** 191,196 ****
--- 256,262 ----
      cm_SyncOpDone(scp, NULL, CM_SCACHESYNC_STOREDATA_EXCL);
  
      if (code == 0) {
+         osi_hyper_t t;
          /* now, here's something a little tricky: in AFS 3, a dirty
           * length can't be directly stored, instead, a dirty chunk is
           * stored that sets the file's size (by writing and by using
***************
*** 209,216 ****
           * We have to turn off the length dirty bit as soon as we can,
           * so that we see updates made by other machines.
           */
!         if (outStatus.Length >= scp->length.LowPart)
              scp->mask &= ~CM_SCACHEMASK_LENGTH;
          cm_MergeStatus(scp, &outStatus, &volSync, userp, 0);
      } else {
          if (code == CM_ERROR_SPACE)
--- 275,291 ----
           * We have to turn off the length dirty bit as soon as we can,
           * so that we see updates made by other machines.
           */
! 
!         if (SERVERHAS64BIT(connp)) {
!             t.LowPart = outStatus.Length;
!             t.HighPart = outStatus.Length_hi;
!         } else {
!             t = ConvertLongToLargeInteger(outStatus.Length);
!         }
! 
!         if (LargeIntegerGreaterThanOrEqualTo(t, scp->length))
              scp->mask &= ~CM_SCACHEMASK_LENGTH;
+ 
          cm_MergeStatus(scp, &outStatus, &volSync, userp, 0);
      } else {
          if (code == CM_ERROR_SPACE)
***************
*** 237,246 ****
      AFSVolSync volSync;
      AFSFid tfid;
      long code;
!     long truncPos;
      cm_conn_t *connp;
      struct rx_call *callp;
      struct rx_connection *rxconnp;
  
      /* Serialize StoreData RPC's; for rationale see cm_scache.c */
      (void) cm_SyncOp(scp, NULL, userp, reqp, 0,
--- 312,322 ----
      AFSVolSync volSync;
      AFSFid tfid;
      long code;
!     osi_hyper_t truncPos;
      cm_conn_t *connp;
      struct rx_call *callp;
      struct rx_connection *rxconnp;
+     int require_64bit_ops = 0;
  
      /* Serialize StoreData RPC's; for rationale see cm_scache.c */
      (void) cm_SyncOp(scp, NULL, userp, reqp, 0,
***************
*** 252,263 ****
      scp->mask &= ~CM_SCACHEMASK_CLIENTMODTIME;
  
      /* calculate truncation position */
!     truncPos = scp->length.LowPart;
      if ((scp->mask & CM_SCACHEMASK_TRUNCPOS)
!          && scp->truncPos.LowPart < (unsigned long) truncPos)
!         truncPos = scp->truncPos.LowPart;
      scp->mask &= ~CM_SCACHEMASK_TRUNCPOS;
  
      lock_ReleaseMutex(&scp->mx);
  
      cm_AFSFidFromFid(&tfid, &scp->fid);
--- 328,345 ----
      scp->mask &= ~CM_SCACHEMASK_CLIENTMODTIME;
  
      /* calculate truncation position */
!     truncPos = scp->length;
      if ((scp->mask & CM_SCACHEMASK_TRUNCPOS)
!         && LargeIntegerLessThan(scp->truncPos, truncPos))
!         truncPos = scp->truncPos;
      scp->mask &= ~CM_SCACHEMASK_TRUNCPOS;
  
+     if (LargeIntegerGreaterThan(truncPos,
+                                 ConvertLongToLargeInteger(LONG_MAX))) {
+ 
+         require_64bit_ops = 1;
+     }
+ 
      lock_ReleaseMutex(&scp->mx);
  
      cm_AFSFidFromFid(&tfid, &scp->fid);
***************
*** 267,284 ****
          code = cm_Conn(&scp->fid, userp, reqp, &connp);
          if (code) 
              continue;
! 		
          rxconnp = cm_GetRxConn(connp);
          callp = rx_NewCall(rxconnp);
          rx_PutConnection(rxconnp);
  
          code = StartRXAFS_StoreData(callp, &tfid, &inStatus,
!                                     0, 0, truncPos);
  
!         if (code == 0)
!             code = EndRXAFS_StoreData(callp, &outStatus, &volSync);
          code = rx_EndCall(callp, code);
  
      } while (cm_Analyze(connp, userp, reqp, &scp->fid, &volSync, NULL, NULL, code));
      code = cm_MapRPCError(code, reqp);
          
--- 349,392 ----
          code = cm_Conn(&scp->fid, userp, reqp, &connp);
          if (code) 
              continue;
! 
!     retry:	
          rxconnp = cm_GetRxConn(connp);
          callp = rx_NewCall(rxconnp);
          rx_PutConnection(rxconnp);
  
+ #ifdef AFS_LARGEFILES
+         if (SERVERHAS64BIT(connp)) {
+             code = StartRXAFS_StoreData64(callp, &tfid, &inStatus,
+                                           0, 0, truncPos.QuadPart);
+         } else {
+             if (require_64bit_ops) {
+                 code = CM_ERROR_TOOBIG;
+             } else {
+                 code = StartRXAFS_StoreData(callp, &tfid, &inStatus,
+                                             0, 0, truncPos.LowPart);
+             }
+         }
+ #else
          code = StartRXAFS_StoreData(callp, &tfid, &inStatus,
!                                     0, 0, truncPos.LowPart);
! #endif
  
!         if (code == 0) {
!             if (SERVERHAS64BIT(connp))
!                 code = EndRXAFS_StoreData64(callp, &outStatus, &volSync);
!             else
!                 code = EndRXAFS_StoreData(callp, &outStatus, &volSync);
!         }
          code = rx_EndCall(callp, code);
  
+ #ifdef AFS_LARGEFILES
+         if (code == RXGEN_OPCODE && SERVERHAS64BIT(connp)) {
+             SET_SERVERHASNO64BIT(connp);
+             goto retry;
+         }
+ #endif
+ 
      } while (cm_Analyze(connp, userp, reqp, &scp->fid, &volSync, NULL, NULL, code));
      code = cm_MapRPCError(code, reqp);
          
***************
*** 288,298 ****
      cm_SyncOpDone(scp, NULL, CM_SCACHESYNC_STOREDATA_EXCL);
  
      if (code == 0) {
          /*
           * For explanation of handling of CM_SCACHEMASK_LENGTH,
           * see cm_BufWrite().
           */
!         if (outStatus.Length >= scp->length.LowPart)
              scp->mask &= ~CM_SCACHEMASK_LENGTH;
          cm_MergeStatus(scp, &outStatus, &volSync, userp, 0);
      }
--- 396,414 ----
      cm_SyncOpDone(scp, NULL, CM_SCACHESYNC_STOREDATA_EXCL);
  
      if (code == 0) {
+         osi_hyper_t t;
          /*
           * For explanation of handling of CM_SCACHEMASK_LENGTH,
           * see cm_BufWrite().
           */
!         if (SERVERHAS64BIT(connp)) {
!             t.HighPart = outStatus.Length_hi;
!             t.LowPart = outStatus.Length;
!         } else {
!             t = ConvertLongToLargeInteger(outStatus.Length);
!         }
! 
!         if (LargeIntegerGreaterThanOrEqualTo(t, scp->length))
              scp->mask &= ~CM_SCACHEMASK_LENGTH;
          cm_MergeStatus(scp, &outStatus, &volSync, userp, 0);
      }
***************
*** 1117,1123 ****
                    cm_req_t *reqp)
  {
      long code;
!     long nbytes;			/* bytes in transfer */
      long rbytes;			/* bytes in rx_Read call */
      long temp;
      AFSFetchStatus afsStatus;
--- 1233,1241 ----
                    cm_req_t *reqp)
  {
      long code;
!     afs_int32 nbytes;			/* bytes in transfer */
!     afs_int32 nbytes_hi = 0;            /* high-order 32 bits of bytes in transfer */
!     afs_int64 length_found = 0;
      long rbytes;			/* bytes in rx_Read call */
      long temp;
      AFSFetchStatus afsStatus;
***************
*** 1133,1138 ****
--- 1251,1257 ----
      cm_conn_t *connp;
      int getroot;
      long t1, t2;
+     int require_64bit_ops = 0;
  
      /* now, the buffer may or may not be filled with good data (buf_GetNew
       * drops lots of locks, and may indeed return a properly initialized
***************
*** 1182,1190 ****
          lock_ObtainMutex(&scp->mx);
          return 0;
      }
!         
      lock_ReleaseMutex(&scp->mx);
  
  #ifdef DISKCACHE95
      DPRINTF("cm_GetBuffer: fetching data scpDV=%d bufDV=%d scp=%x bp=%x dcp=%x\n",
              scp->dataVersion, bufp->dataVersion, scp, bufp, bufp->dcp);
--- 1301,1315 ----
          lock_ObtainMutex(&scp->mx);
          return 0;
      }
! 
      lock_ReleaseMutex(&scp->mx);
  
+     if (LargeIntegerGreaterThan(LargeIntegerAdd(biod.offset,
+                                                 ConvertLongToLargeInteger(biod.length)),
+                                 ConvertLongToLargeInteger(LONG_MAX))) {
+         require_64bit_ops = 1;
+     }
+ 
  #ifdef DISKCACHE95
      DPRINTF("cm_GetBuffer: fetching data scpDV=%d bufDV=%d scp=%x bp=%x dcp=%x\n",
              scp->dataVersion, bufp->dataVersion, scp, bufp, bufp->dcp);
***************
*** 1259,1269 ****
          code = cm_Conn(&scp->fid, up, reqp, &connp);
          if (code) 
              continue;
! 	
          rxconnp = cm_GetRxConn(connp);
          callp = rx_NewCall(rxconnp);
          rx_PutConnection(rxconnp);
  
          osi_Log3(afsd_logp, "CALL FetchData scp 0x%p, off 0x%x, size 0x%x",
                   scp, biod.offset.LowPart, biod.length);
  
--- 1384,1451 ----
          code = cm_Conn(&scp->fid, up, reqp, &connp);
          if (code) 
              continue;
! 
          rxconnp = cm_GetRxConn(connp);
          callp = rx_NewCall(rxconnp);
          rx_PutConnection(rxconnp);
  
+ #ifdef AFS_LARGEFILES
+         nbytes = nbytes_hi = 0;
+ 
+         if (SERVERHAS64BIT(connp)) {
+             osi_Log4(afsd_logp, "CALL FetchData64 scp 0x%p, off 0x%x:%08x, size 0x%x",
+                      scp, biod.offset.HighPart, biod.offset.LowPart, biod.length);
+ 
+             code = StartRXAFS_FetchData64(callp, &tfid, biod.offset.QuadPart, biod.length);
+ 
+             if (code == 0) {
+                 temp = rx_Read(callp, (char *) &nbytes_hi, sizeof(afs_int32));
+                 if (temp == sizeof(afs_int32)) {
+                     nbytes_hi = ntohl(nbytes_hi);
+                 } else {
+                     nbytes_hi = 0;
+ 					code = callp->error;
+                     rx_EndCall(callp, code);
+                     callp = NULL;
+                 }
+             }
+         }
+ 
+         if (code == RXGEN_OPCODE || !SERVERHAS64BIT(connp)) {
+             if (require_64bit_ops) {
+                 osi_Log0(afsd_logp, "Skipping FetchData.  Operation requires FetchData64");
+                 code = CM_ERROR_TOOBIG;
+             } else {
+                 if (!callp) {
+                     rxconnp = cm_GetRxConn(connp);
+                     callp = rx_NewCall(rxconnp);
+                     rx_PutConnection(rxconnp);
+                 }
+ 
+                 osi_Log3(afsd_logp, "CALL FetchData scp 0x%p, off 0x%x, size 0x%x",
+                          scp, biod.offset.LowPart, biod.length);
+ 
+                 code = StartRXAFS_FetchData(callp, &tfid, biod.offset.LowPart,
+                                             biod.length);
+ 
+                 SET_SERVERHASNO64BIT(connp);
+             }
+         }
+ 
+         if (code == 0) {
+             temp  = rx_Read(callp, (char *)&nbytes, sizeof(afs_int32));
+             if (temp == sizeof(afs_int32)) {
+                 nbytes = ntohl(nbytes);
+                 FillInt64(length_found, nbytes_hi, nbytes);
+                 if (length_found > biod.length) 
+                     code = (callp->error < 0) ? callp->error : -1;
+             } else {
+                 code = (callp->error < 0) ? callp->error : -1;
+             }
+         }
+         /* for the moment, nbytes_hi will always be 0 if code == 0
+            because biod.length is a 32-bit quantity. */
+ #else
          osi_Log3(afsd_logp, "CALL FetchData scp 0x%p, off 0x%x, size 0x%x",
                   scp, biod.offset.LowPart, biod.length);
  
***************
*** 1271,1284 ****
                                      biod.length);
  
          /* now copy the data out of the pipe and put it in the buffer */
!         temp  = rx_Read(callp, (char *)&nbytes, 4);
!         if (temp == 4) {
!             nbytes = ntohl(nbytes);
!             if (nbytes > biod.length) 
                  code = (callp->error < 0) ? callp->error : -1;
          }
!         else 
!             code = (callp->error < 0) ? callp->error : -1;
  
          if (code == 0) {
              qdp = biod.bufListEndp;
--- 1453,1469 ----
                                      biod.length);
  
          /* now copy the data out of the pipe and put it in the buffer */
!         if (code == 0) {
!             temp  = rx_Read(callp, (char *)&nbytes, sizeof(afs_int32));
!             if (temp == sizeof(afs_int32)) {
!                 nbytes = ntohl(nbytes);
!                 if (nbytes > biod.length) 
!                     code = (callp->error < 0) ? callp->error : -1;
!             }
!             else 
                  code = (callp->error < 0) ? callp->error : -1;
          }
! #endif
  
          if (code == 0) {
              qdp = biod.bufListEndp;
***************
*** 1368,1380 ****
              }   
          }
  
!         if (code == 0)
!             code = EndRXAFS_FetchData(callp, &afsStatus, &callback, &volSync);
!         else
!             osi_Log1(afsd_logp, "CALL EndRXAFS_FetchData skipped due to error %d", code);
!         code = rx_EndCall(callp, code);
          if (code == RXKADUNKNOWNKEY)
              osi_Log0(afsd_logp, "CALL EndCall returns RXKADUNKNOWNKEY");
          osi_Log0(afsd_logp, "CALL FetchData DONE");
  
      } while (cm_Analyze(connp, up, reqp, &scp->fid, &volSync, NULL, NULL, code));
--- 1553,1576 ----
              }   
          }
  
!         if (code == 0) {
!             if (SERVERHAS64BIT(connp))
!                 code = EndRXAFS_FetchData64(callp, &afsStatus, &callback, &volSync);
!             else
!                 code = EndRXAFS_FetchData(callp, &afsStatus, &callback, &volSync);
!         } else {
!             if (SERVERHAS64BIT(connp))
!                 osi_Log1(afsd_logp, "CALL EndRXAFS_FetchData64 skipped due to error %d", code);
!             else
!                 osi_Log1(afsd_logp, "CALL EndRXAFS_FetchData skipped due to error %d", code);
!         }
! 
!         if (callp)
!             code = rx_EndCall(callp, code);
! 
          if (code == RXKADUNKNOWNKEY)
              osi_Log0(afsd_logp, "CALL EndCall returns RXKADUNKNOWNKEY");
+ 
          osi_Log0(afsd_logp, "CALL FetchData DONE");
  
      } while (cm_Analyze(connp, up, reqp, &scp->fid, &volSync, NULL, NULL, code));
Index: openafs/src/WINNT/afsd/cm_dir.c
diff -c openafs/src/WINNT/afsd/cm_dir.c:1.4 openafs/src/WINNT/afsd/cm_dir.c:1.4.4.1
*** openafs/src/WINNT/afsd/cm_dir.c:1.4	Sat Nov  5 01:47:46 2005
--- openafs/src/WINNT/afsd/cm_dir.c	Sat Jun 24 16:41:54 2006
***************
*** 16,24 ****
  #include <string.h>
  #include <malloc.h>
  #include <osi.h>
  #include <rx/rx.h>
  
- #include "afsd.h"
  
  /* compute how many 32 byte entries an AFS 3 dir requires for storing
   * the specified name.
--- 16,24 ----
  #include <string.h>
  #include <malloc.h>
  #include <osi.h>
+ #include "afsd.h"
  #include <rx/rx.h>
  
  
  /* compute how many 32 byte entries an AFS 3 dir requires for storing
   * the specified name.
Index: openafs/src/WINNT/afsd/cm_freelance.c
diff -c openafs/src/WINNT/afsd/cm_freelance.c:1.33 openafs/src/WINNT/afsd/cm_freelance.c:1.33.2.1
*** openafs/src/WINNT/afsd/cm_freelance.c:1.33	Fri Feb 24 02:45:35 2006
--- openafs/src/WINNT/afsd/cm_freelance.c	Sat Jun 24 16:41:54 2006
***************
*** 12,21 ****
  #include <malloc.h>
  #include <string.h>
  
- #include <rx/rx.h>
- 
  #include <WINNT/afsreg.h>
  #include "afsd.h"
  #ifdef AFS_FREELANCE_CLIENT
  #include "cm_freelance.h"
  #include "stdio.h"
--- 12,21 ----
  #include <malloc.h>
  #include <string.h>
  
  #include <WINNT/afsreg.h>
  #include "afsd.h"
+ #include <rx/rx.h>
+ 
  #ifdef AFS_FREELANCE_CLIENT
  #include "cm_freelance.h"
  #include "stdio.h"
Index: openafs/src/WINNT/afsd/cm_ioctl.c
diff -c openafs/src/WINNT/afsd/cm_ioctl.c:1.73.2.1 openafs/src/WINNT/afsd/cm_ioctl.c:1.73.2.3
*** openafs/src/WINNT/afsd/cm_ioctl.c:1.73.2.1	Sat Jun  3 14:01:20 2006
--- openafs/src/WINNT/afsd/cm_ioctl.c	Tue Jun 27 18:53:42 2006
***************
*** 2647,2652 ****
--- 2647,2671 ----
    return 0;
  }
  
+ long cm_IoctlUUIDControl(struct smb_ioctl * ioctlp, struct cm_user *userp)
+ {
+     long cmd;
+     afsUUID uuid;
+ 
+     memcpy(&cmd, ioctlp->inDatap, sizeof(long));
+ 
+     if (cmd) {             /* generate a new UUID */
+         UuidCreate((UUID *) &uuid);
+         cm_data.Uuid = uuid;
+ 	cm_ForceNewConnectionsAllServers();
+     }
+ 
+     memcpy(ioctlp->outDatap, &cm_data.Uuid, sizeof(cm_data.Uuid));
+     ioctlp->outDatap += sizeof(cm_data.Uuid);
+ 
+     return 0;
+ }
+ 
  /* 
   * functions to dump contents of various structures. 
   * In debug build (linked with crt debug library) will dump allocated but not freed memory
Index: openafs/src/WINNT/afsd/cm_ioctl.h
diff -c openafs/src/WINNT/afsd/cm_ioctl.h:1.14 openafs/src/WINNT/afsd/cm_ioctl.h:1.14.2.1
*** openafs/src/WINNT/afsd/cm_ioctl.h:1.14	Wed Feb  1 13:02:30 2006
--- openafs/src/WINNT/afsd/cm_ioctl.h	Tue Jun 27 18:19:35 2006
***************
*** 161,166 ****
--- 161,169 ----
  extern long cm_IoctlRxStatProcess(smb_ioctl_t *ioctlp, cm_user_t *userp);
  
  extern long cm_IoctlRxStatPeer(smb_ioctl_t *ioctlp, cm_user_t *userp);
+ 
+ extern long cm_IoctlUUIDControl(struct smb_ioctl * ioctlp, struct cm_user *userp);
+ 
  #endif /* __CM_IOCTL_INTERFACES_ONLY__ */
  
  #endif /*  __CM_IOCTL_H_ENV__ */
Index: openafs/src/WINNT/afsd/cm_scache.c
diff -c openafs/src/WINNT/afsd/cm_scache.c:1.35.2.6 openafs/src/WINNT/afsd/cm_scache.c:1.35.2.12
*** openafs/src/WINNT/afsd/cm_scache.c:1.35.2.6	Thu Jun  8 17:22:20 2006
--- openafs/src/WINNT/afsd/cm_scache.c	Wed Jun 28 11:01:21 2006
***************
*** 551,556 ****
--- 551,557 ----
  
          lock_ObtainMutex(&cm_Freelance_Lock);
          scp->length.LowPart = (DWORD)strlen(mp)+4;
+         scp->length.HighPart = 0;
          strncpy(scp->mountPointStringp,mp,MOUNTPOINTLEN);
          scp->mountPointStringp[MOUNTPOINTLEN-1] = '\0';
          lock_ReleaseMutex(&cm_Freelance_Lock);
***************
*** 940,952 ****
                  /* we don't know the required access rights */
                  if (bufLocked) lock_ReleaseMutex(&bufp->mx);
                  code = cm_GetAccessRights(scp, userp, reqp);
-                 if (code) 
-                     return code;
                  if (bufLocked) {
                      lock_ReleaseMutex(&scp->mx);
                      lock_ObtainMutex(&bufp->mx);
                      lock_ObtainMutex(&scp->mx);
                  }
                  continue;
              }
          }
--- 941,953 ----
                  /* we don't know the required access rights */
                  if (bufLocked) lock_ReleaseMutex(&bufp->mx);
                  code = cm_GetAccessRights(scp, userp, reqp);
                  if (bufLocked) {
                      lock_ReleaseMutex(&scp->mx);
                      lock_ObtainMutex(&bufp->mx);
                      lock_ObtainMutex(&scp->mx);
                  }
+                 if (code) 
+                     return code;
                  continue;
              }
          }
***************
*** 1148,1153 ****
--- 1149,1155 ----
          statusp->FileType = CM_SCACHETYPE_DIRECTORY;
          statusp->LinkCount = scp->linkCount;
          statusp->Length = cm_fakeDirSize;
+         statusp->Length_hi = 0;
          statusp->DataVersion = cm_data.fakeDirVersion;
          statusp->Author = 0x1;
          statusp->Owner = 0x0;
***************
*** 1162,1170 ****
--- 1164,1181 ----
          statusp->Group = 0;
          statusp->SyncCounter = 0;
          statusp->dataVersionHigh = 0;
+ 	statusp->errorCode = 0;
      }
  #endif /* AFS_FREELANCE_CLIENT */
  
+     if (statusp->errorCode != 0) {	
+ 	scp->flags |= CM_SCACHEFLAG_EACCESS;
+ 	osi_Log2(afsd_logp, "Merge, Failure scp %x code 0x%x", scp, statusp->errorCode);
+ 	return;
+     } else {
+ 	scp->flags &= ~CM_SCACHEFLAG_EACCESS;
+     }
+ 
      if (!(flags & CM_MERGEFLAG_FORCE)
           && statusp->DataVersion < (unsigned long) scp->dataVersion) {
          struct cm_cell *cellp;
***************
*** 1220,1230 ****
      }
      if (!(scp->mask & CM_SCACHEMASK_LENGTH)) {
          scp->length.LowPart = statusp->Length;
!         scp->length.HighPart = 0;
      }
  
      scp->serverLength.LowPart = statusp->Length;
!     scp->serverLength.HighPart = 0;
  
      scp->linkCount = statusp->LinkCount;
      scp->dataVersion = statusp->DataVersion;
--- 1231,1241 ----
      }
      if (!(scp->mask & CM_SCACHEMASK_LENGTH)) {
          scp->length.LowPart = statusp->Length;
!         scp->length.HighPart = statusp->Length_hi;
      }
  
      scp->serverLength.LowPart = statusp->Length;
!     scp->serverLength.HighPart = statusp->Length_hi;
  
      scp->linkCount = statusp->LinkCount;
      scp->dataVersion = statusp->DataVersion;
***************
*** 1243,1250 ****
              scp->fileType = CM_SCACHETYPE_SYMLINK;
      }       
      else {
!         osi_Log1(afsd_logp, "Merge, Invalid File Type, scp %x", scp);
!         scp->fileType = 0;	/* invalid */
      }
      /* and other stuff */
      scp->parentVnode = statusp->ParentVnode;
--- 1254,1261 ----
              scp->fileType = CM_SCACHETYPE_SYMLINK;
      }       
      else {
!         osi_Log2(afsd_logp, "Merge, Invalid File Type (%d), scp %x", statusp->FileType, scp);
!         scp->fileType = CM_SCACHETYPE_INVALID;	/* invalid */
      }
      /* and other stuff */
      scp->parentVnode = statusp->ParentVnode;
Index: openafs/src/WINNT/afsd/cm_scache.h
diff -c openafs/src/WINNT/afsd/cm_scache.h:1.21.2.1 openafs/src/WINNT/afsd/cm_scache.h:1.21.2.3
*** openafs/src/WINNT/afsd/cm_scache.h:1.21.2.1	Sat Jun  3 14:01:20 2006
--- openafs/src/WINNT/afsd/cm_scache.h	Wed Jun 28 11:01:21 2006
***************
*** 181,187 ****
                                    * include locks which have
                                    * CM_FILELOCK_FLAG_CLIENTONLY set.
                                    */
! 	
      afs_uint32   clientLocks;   /* number of locks on ::fileLocks that
                                     have CM_FILELOCK_FLAG_CLIENTONLY
                                     set. */
--- 181,187 ----
                                    * include locks which have
                                    * CM_FILELOCK_FLAG_CLIENTONLY set.
                                    */
! 
      afs_uint32   clientLocks;   /* number of locks on ::fileLocks that
                                     have CM_FILELOCK_FLAG_CLIENTONLY
                                     set. */
***************
*** 245,250 ****
--- 245,252 ----
  #define CM_SCACHEFLAG_ANYWATCH \
  			(CM_SCACHEFLAG_WATCHED | CM_SCACHEFLAG_WATCHEDSUBTREE)
  
+ #define CM_SCACHEFLAG_EACCESS           0x200000 /* Bulk Stat returned EACCES */
+ 
  /* sync flags for calls to the server.  The CM_SCACHEFLAG_FETCHING,
   * CM_SCACHEFLAG_STORING and CM_SCACHEFLAG_SIZESTORING flags correspond to the
   * below, except for FETCHDATA and STOREDATA, which correspond to non-null
Index: openafs/src/WINNT/afsd/cm_server.c
diff -c openafs/src/WINNT/afsd/cm_server.c:1.25.2.1 openafs/src/WINNT/afsd/cm_server.c:1.25.2.3
*** openafs/src/WINNT/afsd/cm_server.c:1.25.2.1	Thu Jun  1 11:36:46 2006
--- openafs/src/WINNT/afsd/cm_server.c	Tue Jun 27 23:24:05 2006
***************
*** 21,29 ****
  #include <malloc.h>
  #include <string.h>
  
  #include <osi.h>
  #include <rx/rx.h>
- #include "afsd.h"
  
  osi_rwlock_t cm_serverLock;
  
--- 21,29 ----
  #include <malloc.h>
  #include <string.h>
  
+ #include "afsd.h"
  #include <osi.h>
  #include <rx/rx.h>
  
  osi_rwlock_t cm_serverLock;
  
***************
*** 226,231 ****
--- 226,251 ----
      osi_assert(serverp->refCount-- > 0);
  }
  
+ void cm_SetServerNo64Bit(cm_server_t * serverp, int no64bit)
+ {
+     lock_ObtainMutex(&serverp->mx);
+     if (no64bit)
+         serverp->flags |= CM_SERVERFLAG_NO64BIT;
+     else
+         serverp->flags &= ~CM_SERVERFLAG_NO64BIT;
+     lock_ReleaseMutex(&serverp->mx);
+ }
+ 
+ void cm_SetServerNoInlineBulk(cm_server_t * serverp, int no)
+ {
+     lock_ObtainMutex(&serverp->mx);
+     if (no)
+         serverp->flags |= CM_SERVERFLAG_NOINLINEBULK;
+     else
+         serverp->flags &= ~CM_SERVERFLAG_NOINLINEBULK;
+     lock_ReleaseMutex(&serverp->mx);
+ }
+ 
  void cm_SetServerPrefs(cm_server_t * serverp)
  {
      unsigned long	serverAddr; 	/* in host byte order */
Index: openafs/src/WINNT/afsd/cm_server.h
diff -c openafs/src/WINNT/afsd/cm_server.h:1.13.2.1 openafs/src/WINNT/afsd/cm_server.h:1.13.2.3
*** openafs/src/WINNT/afsd/cm_server.h:1.13.2.1	Thu Jun  1 11:36:46 2006
--- openafs/src/WINNT/afsd/cm_server.h	Tue Jun 27 23:24:05 2006
***************
*** 48,56 ****
  #define CM_SERVER_FILE		2	/* a file server */
  
  /* flags */
! #define CM_SERVERFLAG_DOWN	1	/* server is down */
! #define CM_SERVERFLAG_PREF_SET	2       /* server preference set by user */
! #define CM_SERVERFLAG_PINGING 	4 	/* a ping against this server in progress */
  
  /* flags for procedures */
  #define CM_FLAG_CHECKUPSERVERS		1	/* check working servers */
--- 48,59 ----
  #define CM_SERVER_FILE		2	/* a file server */
  
  /* flags */
! #define CM_SERVERFLAG_DOWN	0x1	/* server is down */
! #define CM_SERVERFLAG_PREF_SET	0x2     /* server preference set by user */
! #define CM_SERVERFLAG_PINGING 	0x4 	/* a ping against this server in progress */
! #define CM_SERVERFLAG_NO64BIT   0x8     /* server has no support for
!                                            64-bit operations. */
! #define CM_SERVERFLAG_NOINLINEBULK 0x10	/* server has no support for inline bulk */
  
  /* flags for procedures */
  #define CM_FLAG_CHECKUPSERVERS		1	/* check working servers */
***************
*** 105,108 ****
--- 108,115 ----
  
  extern void cm_ForceNewConnectionsAllServers(void);
  
+ extern void cm_SetServerNo64Bit(cm_server_t * serverp, int no64bit);
+ 
+ extern void cm_SetServerNoInlineBulk(cm_server_t * serverp, int no);
+ 
  #endif /*  __CM_SERVER_H_ENV__ */
Index: openafs/src/WINNT/afsd/cm_user.c
diff -c openafs/src/WINNT/afsd/cm_user.c:1.8 openafs/src/WINNT/afsd/cm_user.c:1.8.4.1
*** openafs/src/WINNT/afsd/cm_user.c:1.8	Thu Jan 19 18:07:50 2006
--- openafs/src/WINNT/afsd/cm_user.c	Sat Jun 24 16:41:54 2006
***************
*** 16,25 ****
  #include <malloc.h>
  #include <string.h>
  
  #include <osi.h>
  #include <rx/rx.h>
  
- #include "afsd.h"
  
  osi_rwlock_t cm_userLock;
  
--- 16,25 ----
  #include <malloc.h>
  #include <string.h>
  
+ #include "afsd.h"
  #include <osi.h>
  #include <rx/rx.h>
  
  
  osi_rwlock_t cm_userLock;
  
Index: openafs/src/WINNT/afsd/cm_utils.c
diff -c openafs/src/WINNT/afsd/cm_utils.c:1.11.4.1 openafs/src/WINNT/afsd/cm_utils.c:1.11.4.2
*** openafs/src/WINNT/afsd/cm_utils.c:1.11.4.1	Sat Jun  3 14:01:20 2006
--- openafs/src/WINNT/afsd/cm_utils.c	Sat Jun 24 16:41:54 2006
***************
*** 64,73 ****
  
  #include <string.h>
  #include <malloc.h>
  #include <osi.h>
  #include <rx/rx.h>
  
- #include "afsd.h"
  
  static osi_once_t cm_utilsOnce;
  
--- 64,73 ----
  
  #include <string.h>
  #include <malloc.h>
+ #include "afsd.h"
  #include <osi.h>
  #include <rx/rx.h>
  
  
  static osi_once_t cm_utilsOnce;
  
Index: openafs/src/WINNT/afsd/cm_vnodeops.c
diff -c openafs/src/WINNT/afsd/cm_vnodeops.c:1.69.2.3 openafs/src/WINNT/afsd/cm_vnodeops.c:1.69.2.8
*** openafs/src/WINNT/afsd/cm_vnodeops.c:1.69.2.3	Tue Jun  6 13:00:08 2006
--- openafs/src/WINNT/afsd/cm_vnodeops.c	Wed Jun 28 11:01:21 2006
***************
*** 673,679 ****
                   && (scp->bulkStatProgress.QuadPart <= thyper.QuadPart))
              {
                  scp->flags |= CM_SCACHEFLAG_BULKSTATTING;
!                 cm_TryBulkStat(scp, &thyper, userp, reqp);
                  scp->flags &= ~CM_SCACHEFLAG_BULKSTATTING;
                  scp->bulkStatProgress = thyper;
              }
--- 673,679 ----
                   && (scp->bulkStatProgress.QuadPart <= thyper.QuadPart))
              {
                  scp->flags |= CM_SCACHEFLAG_BULKSTATTING;
!                 code = cm_TryBulkStat(scp, &thyper, userp, reqp);
                  scp->flags &= ~CM_SCACHEFLAG_BULKSTATTING;
                  scp->bulkStatProgress = thyper;
              }
***************
*** 1780,1786 ****
   * check anyway, but we want to minimize the chance that we have to leave stuff
   * unstat'd.
   */
! #define CM_BULKMAX		128
  
  /* rock for bulk stat calls */
  typedef struct cm_bulkStat {
--- 1780,1786 ----
   * check anyway, but we want to minimize the chance that we have to leave stuff
   * unstat'd.
   */
! #define CM_BULKMAX		(3 * AFSCBMAX)
  
  /* rock for bulk stat calls */
  typedef struct cm_bulkStat {
***************
*** 1840,1846 ****
      if (tscp) {
          if (lock_TryMutex(&tscp->mx)) {
              /* we have an entry that we can look at */
!             if (cm_HaveCallback(tscp)) {
                  /* we have a callback on it.  Don't bother
                   * fetching this stat entry, since we're happy
                   * with the info we have.
--- 1840,1846 ----
      if (tscp) {
          if (lock_TryMutex(&tscp->mx)) {
              /* we have an entry that we can look at */
!             if (!(tscp->flags & CM_SCACHEFLAG_EACCESS) && cm_HaveCallback(tscp)) {
                  /* we have a callback on it.  Don't bother
                   * fetching this stat entry, since we're happy
                   * with the info we have.
***************
*** 1878,1888 ****
  /* called with a locked scp and a pointer to a buffer.  Make bulk stat
   * calls on all undeleted files in the page of the directory specified.
   */
! void cm_TryBulkStat(cm_scache_t *dscp, osi_hyper_t *offsetp, cm_user_t *userp,
!                      cm_req_t *reqp)
  {
      long code;
!     cm_bulkStat_t bb;	/* this is *BIG*, probably 12K or so;
                           * watch for stack problems */
      AFSCBFids fidStruct;
      AFSBulkStats statStruct;
--- 1878,1889 ----
  /* called with a locked scp and a pointer to a buffer.  Make bulk stat
   * calls on all undeleted files in the page of the directory specified.
   */
! afs_int32
! cm_TryBulkStat(cm_scache_t *dscp, osi_hyper_t *offsetp, cm_user_t *userp,
! 	       cm_req_t *reqp)
  {
      long code;
!     cm_bulkStat_t bb;	/* this is *BIG*, probably 16K or so;
                           * watch for stack problems */
      AFSCBFids fidStruct;
      AFSBulkStats statStruct;
***************
*** 1897,1909 ****
      cm_scache_t *scp;
      cm_fid_t tfid;
      struct rx_connection * callp;
  
      osi_Log1(afsd_logp, "cm_TryBulkStat dir 0x%p", dscp);
  
      /* should be on a buffer boundary */
      osi_assert((offsetp->LowPart & (cm_data.buf_blockSize - 1)) == 0);
  
!     bb.counter = 0;
      bb.bufOffset = *offsetp;
  
      lock_ReleaseMutex(&dscp->mx);
--- 1898,1911 ----
      cm_scache_t *scp;
      cm_fid_t tfid;
      struct rx_connection * callp;
+     int inlinebulk = 0;		/* Did we use InlineBulkStatus RPC or not? */
  
      osi_Log1(afsd_logp, "cm_TryBulkStat dir 0x%p", dscp);
  
      /* should be on a buffer boundary */
      osi_assert((offsetp->LowPart & (cm_data.buf_blockSize - 1)) == 0);
  
!     memset(&bb, 0, sizeof(bb));
      bb.bufOffset = *offsetp;
  
      lock_ReleaseMutex(&dscp->mx);
***************
*** 1913,1919 ****
      /* if we failed, bail out early */
      if (code && code != CM_ERROR_STOPNOW) {
          lock_ObtainMutex(&dscp->mx);
!         return;
      }
  
      /* otherwise, we may have one or more bulk stat's worth of stuff in bb;
--- 1915,1921 ----
      /* if we failed, bail out early */
      if (code && code != CM_ERROR_STOPNOW) {
          lock_ObtainMutex(&dscp->mx);
!         return code;
      }
  
      /* otherwise, we may have one or more bulk stat's worth of stuff in bb;
***************
*** 1940,1957 ****
                  continue;
  
              callp = cm_GetRxConn(connp);
!             code = RXAFS_BulkStatus(callp, &fidStruct,
                                       &statStruct, &callbackStruct, &volSync);
              rx_PutConnection(callp);
  
          } while (cm_Analyze(connp, userp, reqp, &dscp->fid,
                               &volSync, NULL, &cbReq, code));
          code = cm_MapRPCError(code, reqp);
- 
          if (code)
!             osi_Log1(afsd_logp, "CALL BulkStatus FAILURE code 0x%x", code);
          else
!             osi_Log0(afsd_logp, "CALL BulkStatus SUCCESS");
  
          /* may as well quit on an error, since we're not going to do
           * much better on the next immediate call, either.
--- 1942,1970 ----
                  continue;
  
              callp = cm_GetRxConn(connp);
! 	    if (!(connp->serverp->flags & CM_SERVERFLAG_NOINLINEBULK)) {
! 		code = RXAFS_InlineBulkStatus(callp, &fidStruct,
                                       &statStruct, &callbackStruct, &volSync);
+ 		if (code == RXGEN_OPCODE) {
+ 		    cm_SetServerNoInlineBulk(connp->serverp, 0);
+ 		} else {
+ 		    inlinebulk = 1;
+ 		}
+ 	    }
+ 	    if (!inlinebulk) {
+ 		code = RXAFS_BulkStatus(callp, &fidStruct,
+ 					&statStruct, &callbackStruct, &volSync);
+ 	    }
              rx_PutConnection(callp);
  
          } while (cm_Analyze(connp, userp, reqp, &dscp->fid,
                               &volSync, NULL, &cbReq, code));
          code = cm_MapRPCError(code, reqp);
          if (code)
!             osi_Log2(afsd_logp, "CALL %sBulkStatus FAILURE code 0x%x", 
! 		      inlinebulk ? "Inline" : "", code);
          else
!             osi_Log1(afsd_logp, "CALL %sBulkStatus SUCCESS", inlinebulk ? "Inline" : "");
  
          /* may as well quit on an error, since we're not going to do
           * much better on the next immediate call, either.
***************
*** 1986,1992 ****
               * Right now, be pretty conservative: if there's a
               * callback or a pending call, skip it.
               */
!             if (scp->cbServerp == NULL
                   && !(scp->flags &
                         (CM_SCACHEFLAG_FETCHING
                           | CM_SCACHEFLAG_STORING
--- 1999,2005 ----
               * Right now, be pretty conservative: if there's a
               * callback or a pending call, skip it.
               */
!             if ((scp->cbServerp == NULL || (scp->flags & CM_SCACHEFLAG_EACCESS))
                   && !(scp->flags &
                         (CM_SCACHEFLAG_FETCHING
                           | CM_SCACHEFLAG_STORING
***************
*** 1994,2001 ****
                  cm_EndCallbackGrantingCall(scp, &cbReq,
                                              &bb.callbacks[j],
                                              CM_CALLBACK_MAINTAINCOUNT);
!                 cm_MergeStatus(scp, &bb.stats[j], &volSync,
!                                 userp, 0);
              }       
              lock_ReleaseMutex(&scp->mx);
              cm_ReleaseSCache(scp);
--- 2007,2013 ----
                  cm_EndCallbackGrantingCall(scp, &cbReq,
                                              &bb.callbacks[j],
                                              CM_CALLBACK_MAINTAINCOUNT);
!                 cm_MergeStatus(scp, &bb.stats[j], &volSync, userp, 0);
              }       
              lock_ReleaseMutex(&scp->mx);
              cm_ReleaseSCache(scp);
***************
*** 2007,2013 ****
          filex += filesThisCall;
      }	/* while there are still more files to process */
      lock_ObtainMutex(&dscp->mx);
!     osi_Log0(afsd_logp, "END cm_TryBulkStat");
  }       
  
  void cm_StatusFromAttr(AFSStoreStatus *statusp, cm_scache_t *scp, cm_attr_t *attrp)
--- 2019,2041 ----
          filex += filesThisCall;
      }	/* while there are still more files to process */
      lock_ObtainMutex(&dscp->mx);
! 
! #if 0
!     /* If we did the InlineBulk RPC pull out the return code */
!     if (inlinebulk) {
! 	if ((&bb.stats[0])->errorCode) {
! 	    cm_Analyze(NULL /*connp was released by the previous cm_Analyze */, 
! 			userp, reqp, &dscp->fid, &volSync, NULL, NULL, (&bb.stats[0])->errorCode);
! 	    code = cm_MapRPCError((&bb.stats[0])->errorCode, reqp);
! 	}
!     } else
! #endif	
!     { 
! 	code = 0;
!     }
! 
!     osi_Log1(afsd_logp, "END cm_TryBulkStat code = 0x%x", code);
!     return code;
  }       
  
  void cm_StatusFromAttr(AFSStoreStatus *statusp, cm_scache_t *scp, cm_attr_t *attrp)
***************
*** 2321,2332 ****
      lock_ReleaseWrite(&scp->bufCreateLock);
      if (code == 0) {
          lock_ObtainMutex(&scp->mx);
!         scp->flags &= ~(CM_SCACHEFLAG_OVERQUOTA
!                          | CM_SCACHEFLAG_OUTOFSPACE);
          if (scp->mask & (CM_SCACHEMASK_TRUNCPOS
                            | CM_SCACHEMASK_CLIENTMODTIME
                            | CM_SCACHEMASK_LENGTH))
              code = cm_StoreMini(scp, userp, reqp);
          lock_ReleaseMutex(&scp->mx);
      }
      return code;
--- 2349,2365 ----
      lock_ReleaseWrite(&scp->bufCreateLock);
      if (code == 0) {
          lock_ObtainMutex(&scp->mx);
! 
          if (scp->mask & (CM_SCACHEMASK_TRUNCPOS
                            | CM_SCACHEMASK_CLIENTMODTIME
                            | CM_SCACHEMASK_LENGTH))
              code = cm_StoreMini(scp, userp, reqp);
+ 
+         if (scp->flags & (CM_SCACHEFLAG_OVERQUOTA | CM_SCACHEFLAG_OUTOFSPACE)) {
+ 	    code = (scp->flags & CM_SCACHEFLAG_OVERQUOTA) ? CM_ERROR_QUOTA : CM_ERROR_SPACE;
+ 	    scp->flags &= ~(CM_SCACHEFLAG_OVERQUOTA | CM_SCACHEFLAG_OUTOFSPACE);
+ 	}
+ 
          lock_ReleaseMutex(&scp->mx);
      }
      return code;
***************
*** 3573,3579 ****
              }
  
          } else if ((scp->exclusiveLocks > 0) ||
!                 (scp->sharedLocks > 0 && scp->serverLock != LockRead)) {
  
              /* We are already waiting for some other lock.  We should
                 wait for the daemon to catch up instead of generating a
--- 3606,3612 ----
              }
  
          } else if ((scp->exclusiveLocks > 0) ||
!                    (scp->sharedLocks > 0 && scp->serverLock != LockRead)) {
  
              /* We are already waiting for some other lock.  We should
                 wait for the daemon to catch up instead of generating a
***************
*** 3609,3615 ****
              }
  
              if (scp->serverLock == LockRead && Which == LockWrite) {
!             
                  /* We want to escalate the lock to a LockWrite.
                     Unfortunately that's not really possible without
                     letting go of the current lock.  But for now we do
--- 3642,3648 ----
              }
  
              if (scp->serverLock == LockRead && Which == LockWrite) {
! 
                  /* We want to escalate the lock to a LockWrite.
                     Unfortunately that's not really possible without
                     letting go of the current lock.  But for now we do
***************
*** 3651,3657 ****
  
                  /* am I sane? */
                  osi_assert(newLock == LockRead);
!                 
                  code = cm_IntSetLock(scp, userp, newLock, reqp);
              }
  
--- 3684,3690 ----
  
                  /* am I sane? */
                  osi_assert(newLock == LockRead);
! 
                  code = cm_IntSetLock(scp, userp, newLock, reqp);
              }
  
***************
*** 4462,4470 ****
      /* Check if we already have a sufficient server lock to allow this
         lock to go through. */
      if (IS_LOCK_WAITLOCK(oldFileLock) &&
!        (!SERVERLOCKS_ENABLED(scp) ||
!         scp->serverLock == oldFileLock->lockType ||
!         scp->serverLock == LockWrite)) {
  
          oldFileLock->flags &= ~CM_FILELOCK_FLAG_WAITLOCK;
  
--- 4495,4503 ----
      /* Check if we already have a sufficient server lock to allow this
         lock to go through. */
      if (IS_LOCK_WAITLOCK(oldFileLock) &&
!         (!SERVERLOCKS_ENABLED(scp) ||
!          scp->serverLock == oldFileLock->lockType ||
!          scp->serverLock == LockWrite)) {
  
          oldFileLock->flags &= ~CM_FILELOCK_FLAG_WAITLOCK;
  
***************
*** 4505,4511 ****
              }
  
              if (IS_LOCK_ACCEPTED(fileLock) &&
!                INTERSECT_RANGE(oldFileLock->range, fileLock->range)) {
  
                  if (oldFileLock->lockType != LockRead ||
                     fileLock->lockType != LockRead) {
--- 4538,4544 ----
              }
  
              if (IS_LOCK_ACCEPTED(fileLock) &&
!                 INTERSECT_RANGE(oldFileLock->range, fileLock->range)) {
  
                  if (oldFileLock->lockType != LockRead ||
                     fileLock->lockType != LockRead) {
Index: openafs/src/WINNT/afsd/cm_vnodeops.h
diff -c openafs/src/WINNT/afsd/cm_vnodeops.h:1.14 openafs/src/WINNT/afsd/cm_vnodeops.h:1.14.4.1
*** openafs/src/WINNT/afsd/cm_vnodeops.h:1.14	Sun Jan  8 23:43:36 2006
--- openafs/src/WINNT/afsd/cm_vnodeops.h	Tue Jun 27 23:24:05 2006
***************
*** 76,82 ****
                                cm_user_t *userp, cm_req_t *reqp, 
                                cm_scache_t **outpScpp);
  
! extern void cm_TryBulkStat(cm_scache_t *dscp, osi_hyper_t *offsetp,
  	cm_user_t *userp, cm_req_t *reqp);
  
  extern long cm_SetAttr(cm_scache_t *scp, cm_attr_t *attrp, cm_user_t *userp,
--- 76,82 ----
                                cm_user_t *userp, cm_req_t *reqp, 
                                cm_scache_t **outpScpp);
  
! extern afs_int32 cm_TryBulkStat(cm_scache_t *dscp, osi_hyper_t *offsetp,
  	cm_user_t *userp, cm_req_t *reqp);
  
  extern long cm_SetAttr(cm_scache_t *scp, cm_attr_t *attrp, cm_user_t *userp,
Index: openafs/src/WINNT/afsd/cm_volume.c
diff -c openafs/src/WINNT/afsd/cm_volume.c:1.14 openafs/src/WINNT/afsd/cm_volume.c:1.14.4.1
*** openafs/src/WINNT/afsd/cm_volume.c:1.14	Wed Aug 31 19:52:03 2005
--- openafs/src/WINNT/afsd/cm_volume.c	Sat Jun 24 16:41:55 2006
***************
*** 19,29 ****
  #endif /* !DJGPP */
  #include <string.h>
  #include <malloc.h>
  #include <osi.h>
  #include <rx/rx.h>
  
- #include "afsd.h"
- 
  osi_rwlock_t cm_volumeLock;
  
  long 
--- 19,28 ----
  #endif /* !DJGPP */
  #include <string.h>
  #include <malloc.h>
+ #include "afsd.h"
  #include <osi.h>
  #include <rx/rx.h>
  
  osi_rwlock_t cm_volumeLock;
  
  long 
Index: openafs/src/WINNT/afsd/fs.c
diff -c openafs/src/WINNT/afsd/fs.c:1.32 openafs/src/WINNT/afsd/fs.c:1.32.4.1
*** openafs/src/WINNT/afsd/fs.c:1.32	Sat Nov  5 01:47:47 2005
--- openafs/src/WINNT/afsd/fs.c	Tue Jun 27 18:19:35 2006
***************
*** 3533,3538 ****
--- 3533,3588 ----
  #endif /* WIN32 */
  
  static int
+ UuidCmd(struct cmd_syndesc *asp, char *arock)
+ {
+     long code;
+     long inValue;
+     afsUUID outValue;
+     struct ViceIoctl blob;
+     char * uuidstring = NULL;
+ 
+ #ifdef WIN32
+     if ( !IsAdmin() ) {
+         fprintf (stderr,"Permission denied: requires AFS Client Administrator access.\n");
+         return EACCES;
+     }
+ #else
+     if (geteuid()) {
+         fprintf (stderr, "Permission denied: requires root access.\n");
+         return EACCES;
+     }
+ #endif
+ 
+     if (asp->parms[0].items) {
+         inValue = 1;            /* generate new UUID */
+     } else {
+         inValue = 0;            /* just show the current UUID */
+     }
+ 
+     blob.in_size = sizeof(inValue);
+     blob.in = (char *) &inValue;
+     blob.out_size = sizeof(outValue);
+     blob.out = (char *) &outValue;
+ 
+     code = pioctl(NULL, VIOC_UUIDCTL, &blob, 1);
+     if (code) {
+         Die(errno, NULL);
+         return code;
+     }
+ 
+     UuidToString((UUID *) &outValue, &uuidstring);
+ 
+     printf("%sUUID: %s",
+            ((inValue == 1)?"New ":""),
+            uuidstring);
+ 
+     if (uuidstring)
+         RpcStringFree(&uuidstring);
+ 
+     return 0;
+ }
+ 
+ static int
  TraceCmd(struct cmd_syndesc *asp, char *arock)
  {
      long code;
***************
*** 4543,4548 ****
--- 4593,4601 ----
      cmd_AddParm(ts, "-dump", CMD_FLAG, CMD_OPTIONAL, "dump log contents");
      cmd_CreateAlias(ts, "tr");
  
+     ts = cmd_CreateSyntax("uuid", UuidCmd, 0, "manage the UUID for the cache manager");
+     cmd_AddParm(ts, "-generate", CMD_FLAG, CMD_OPTIONAL, "generate a new UUID");
+ 
      ts = cmd_CreateSyntax("memdump", MemDumpCmd, 0, "dump memory allocs in debug builds");
      cmd_AddParm(ts, "-begin", CMD_FLAG, CMD_OPTIONAL, "set a memory checkpoint");
      cmd_AddParm(ts, "-end", CMD_FLAG, CMD_OPTIONAL, "dump memory allocs");
Index: openafs/src/WINNT/afsd/smb.c
diff -c openafs/src/WINNT/afsd/smb.c:1.118.2.7 openafs/src/WINNT/afsd/smb.c:1.118.2.11
*** openafs/src/WINNT/afsd/smb.c:1.118.2.7	Tue Jun  6 13:00:09 2006
--- openafs/src/WINNT/afsd/smb.c	Tue Jul  4 18:43:24 2006
***************
*** 24,34 ****
  #include <stdio.h>
  #include <time.h>
  
  #include <osi.h>
  #include <rx\rx.h>
  #include <rx/rx_prototypes.h>
- 
- #include "afsd.h"
  #include <WINNT\afsreg.h>
  
  #include "smb.h"
--- 24,33 ----
  #include <stdio.h>
  #include <time.h>
  
+ #include "afsd.h"
  #include <osi.h>
  #include <rx\rx.h>
  #include <rx/rx_prototypes.h>
  #include <WINNT\afsreg.h>
  
  #include "smb.h"
***************
*** 36,42 ****
  
  /* These characters are illegal in Windows filenames */
  static char *illegalChars = "\\/:*?\"<>|";
- BOOL isWindows2000 = FALSE;
  
  int smbShutdownFlag = 0;
  
--- 35,40 ----
***************
*** 351,356 ****
--- 349,356 ----
          return "(2d)ReceiveV3OpenX";
      case 0x2e:
          return "(2e)ReceiveV3ReadX";
+     case 0x2f:
+         return "(2f)ReceiveV3WriteX";
      case 0x32:
          return "(32)ReceiveV3Tran2A";
      case 0x33:
***************
*** 1964,1970 ****
          if (dsp->flags & SMB_DIRSEARCH_BULKST) {
              dsp->flags &= ~SMB_DIRSEARCH_BULKST;
              dsp->scp->flags &= ~CM_SCACHEFLAG_BULKSTATTING;
!             dsp->scp->bulkStatProgress = hones;
          }	
          lock_ReleaseMutex(&dsp->scp->mx);
      }	
--- 1964,1970 ----
          if (dsp->flags & SMB_DIRSEARCH_BULKST) {
              dsp->flags &= ~SMB_DIRSEARCH_BULKST;
              dsp->scp->flags &= ~CM_SCACHEFLAG_BULKSTATTING;
!             dsp->scp->bulkStatProgress = hzero;
          }	
          lock_ReleaseMutex(&dsp->scp->mx);
      }	
***************
*** 2965,2975 ****
      fd = smb_GetSMBParm(inp, 0);
      count = smb_GetSMBParm(inp, 3);
      minCount = smb_GetSMBParm(inp, 4);
-     offset.HighPart = 0;	/* too bad */
      offset.LowPart = smb_GetSMBParm(inp, 1) | (smb_GetSMBParm(inp, 2) << 16);
  
!     osi_Log3(smb_logp, "smb_ReceieveCoreReadRaw fd %d, off 0x%x, size 0x%x",
!              fd, offset.LowPart, count);
  
      fidp = smb_FindFID(vcp, fd, 0);
      if (!fidp)
--- 2965,2996 ----
      fd = smb_GetSMBParm(inp, 0);
      count = smb_GetSMBParm(inp, 3);
      minCount = smb_GetSMBParm(inp, 4);
      offset.LowPart = smb_GetSMBParm(inp, 1) | (smb_GetSMBParm(inp, 2) << 16);
  
!     if (*inp->wctp == 10) {
!         /* we were sent a request with 64-bit file offsets */
! #ifdef AFS_LARGEFILES
!         offset.HighPart = smb_GetSMBParm(inp, 8) | (smb_GetSMBParm(inp, 9) << 16);
! 
!         if (LargeIntegerLessThanZero(offset)) {
!             osi_Log0(smb_logp, "smb_ReceiveCoreReadRaw received negative 64-bit offset");
!             goto send1;
!         }
! #else
!         if ((smb_GetSMBParm(inp, 8) | (smb_GetSMBParm(inp, 9) << 16)) != 0) {
!             osi_Log0(smb_logp, "smb_ReceiveCoreReadRaw received 64-bit file offset.  Dropping request.");
!             goto send1;
!         } else {
!             offset.HighPart = 0;
!         }
! #endif
!     } else {
!         /* we were sent a request with 32-bit file offsets */
!         offset.HighPart = 0;
!     }
! 
!     osi_Log4(smb_logp, "smb_ReceieveCoreReadRaw fd %d, off 0x%x:%08x, size 0x%x",
!              fd, offset.HighPart, offset.LowPart, count);
  
      fidp = smb_FindFID(vcp, fd, 0);
      if (!fidp)
***************
*** 2982,2988 ****
  
          key = cm_GenerateKey(vcp->vcID, pid, fd);
  
!         LOffset.HighPart = 0;
          LOffset.LowPart = offset.LowPart;
          LLength.HighPart = 0;
          LLength.LowPart = count;
--- 3003,3009 ----
  
          key = cm_GenerateKey(vcp->vcID, pid, fd);
  
!         LOffset.HighPart = offset.HighPart;
          LOffset.LowPart = offset.LowPart;
          LLength.HighPart = 0;
          LLength.LowPart = count;
***************
*** 3113,3118 ****
--- 3134,3140 ----
      int coreProtoIndex;
      int v3ProtoIndex;
      int NTProtoIndex;
+     int VistaProtoIndex;
      int protoIndex;			        /* index we're using */
      int namex;
      int dbytes;
***************
*** 3133,3138 ****
--- 3155,3161 ----
      coreProtoIndex = -1;		/* not found */
      v3ProtoIndex = -1;
      NTProtoIndex = -1;
+     VistaProtoIndex = -1;
      while(namex < dbytes) {
          osi_Log1(smb_logp, "Protocol %s",
                    osi_LogSaveString(smb_logp, namep+1));
***************
*** 3150,3155 ****
--- 3173,3181 ----
          else if (smb_useV3 && strcmp("NT LM 0.12", namep+1) == 0) {
              NTProtoIndex = tcounter;
          }
+         else if (smb_useV3 && strcmp("SMB 2.001", namep+1) == 0) {
+             VistaProtoIndex = tcounter;
+         }
  
          /* compute size of protocol entry */
          entryLength = (int)strlen(namep+1);
***************
*** 3162,3167 ****
--- 3188,3197 ----
      }
  
      lock_ObtainMutex(&vcp->mx);
+     if (VistaProtoIndex != -1) {
+         protoIndex = VistaProtoIndex;
+         vcp->flags |= (SMB_VCFLAG_USENT | SMB_VCFLAG_USEV3);
+     }
      if (NTProtoIndex != -1) {
          protoIndex = NTProtoIndex;
          vcp->flags |= (SMB_VCFLAG_USENT | SMB_VCFLAG_USEV3);
***************
*** 3219,3224 ****
--- 3249,3257 ----
  #ifdef DFS_SUPPORT
                 NTNEGOTIATE_CAPABILITY_DFS |
  #endif
+ #ifdef AFS_LARGEFILES
+                NTNEGOTIATE_CAPABILITY_LARGEFILES |
+ #endif
                 NTNEGOTIATE_CAPABILITY_NTFIND |
                 NTNEGOTIATE_CAPABILITY_RAWMODE |
                 NTNEGOTIATE_CAPABILITY_NTSMB;
***************
*** 4097,4102 ****
--- 4130,4136 ----
                   && LargeIntegerGreaterOrEqualToZero(scp->bulkStatProgress)) {
                  scp->flags |= CM_SCACHEFLAG_BULKSTATTING;
                  dsp->flags |= SMB_DIRSEARCH_BULKST;
+ 		dsp->scp->bulkStatProgress = hzero;
              }
              lock_ReleaseMutex(&scp->mx);
          }
***************
*** 4204,4215 ****
                                                        scp->bulkStatProgress)) {
                      /* Don't bulk stat if risking timeout */
                      int now = GetTickCount();
!                     if (now - req.startTime > 5000) {
                          scp->bulkStatProgress = thyper;
                          scp->flags &= ~CM_SCACHEFLAG_BULKSTATTING;
                          dsp->flags &= ~SMB_DIRSEARCH_BULKST;
                      } else
!                         cm_TryBulkStat(scp, &thyper, userp, &req);
                  }
              } else {
                  lock_ObtainMutex(&scp->mx);
--- 4238,4250 ----
                                                        scp->bulkStatProgress)) {
                      /* Don't bulk stat if risking timeout */
                      int now = GetTickCount();
!                     if (now - req.startTime > RDRtimeout) {
                          scp->bulkStatProgress = thyper;
                          scp->flags &= ~CM_SCACHEFLAG_BULKSTATTING;
                          dsp->flags &= ~SMB_DIRSEARCH_BULKST;
+ 			dsp->scp->bulkStatProgress = hzero;
                      } else
!                         code = cm_TryBulkStat(scp, &thyper, userp, &req);
                  }
              } else {
                  lock_ObtainMutex(&scp->mx);
***************
*** 4580,4586 ****
          cm_ReleaseUser(userp);
          return code;
      }
! 	
  #ifdef DFS_SUPPORT
      if (newScp->fileType == CM_SCACHETYPE_DFSLINK) {
          cm_ReleaseSCache(newScp);
--- 4615,4621 ----
          cm_ReleaseUser(userp);
          return code;
      }
! 
  #ifdef DFS_SUPPORT
      if (newScp->fileType == CM_SCACHETYPE_DFSLINK) {
          cm_ReleaseSCache(newScp);
***************
*** 6456,6462 ****
  	if (code == 0 && written == 0)
              code = CM_ERROR_PARTIALWRITE;
  
!         offset.LowPart += written;
          count -= written;
          total_written += written;
          written = 0;
--- 6491,6498 ----
  	if (code == 0 && written == 0)
              code = CM_ERROR_PARTIALWRITE;
  
!         offset = LargeIntegerAdd(offset,
!                                  ConvertLongToLargeInteger(written));
          count -= written;
          total_written += written;
          written = 0;
***************
*** 6492,6499 ****
      fd = smb_GetSMBParm(inp, 0);
      fidp = smb_FindFID(vcp, fd, 0);
  
!     osi_Log2(smb_logp, "Completing Raw Write offset %x count %x",
!              rwcp->offset.LowPart, rwcp->count);
  
      userp = smb_GetUserFromVCP(vcp, inp);
  
--- 6528,6535 ----
      fd = smb_GetSMBParm(inp, 0);
      fidp = smb_FindFID(vcp, fd, 0);
  
!     osi_Log3(smb_logp, "Completing Raw Write offset 0x%x:%08x count %x",
!              rwcp->offset.HighPart, rwcp->offset.LowPart, rwcp->count);
  
      userp = smb_GetUserFromVCP(vcp, inp);
  
***************
*** 6566,6581 ****
      fd = smb_GetSMBParm(inp, 0);
      totalCount = smb_GetSMBParm(inp, 1);
      count = smb_GetSMBParm(inp, 10);
-     offset.HighPart = 0;	/* too bad */
-     offset.LowPart = smb_GetSMBParm(inp, 3) | (smb_GetSMBParm(inp, 4) << 16);
      writeMode = smb_GetSMBParm(inp, 7);
  
      op = (char *) inp->data;
      op += smb_GetSMBParm(inp, 11);
  
      osi_Log4(smb_logp,
!              "smb_ReceiveCoreWriteRaw fd %d, off 0x%x, size 0x%x, WriteMode 0x%x",
!              fd, offset.LowPart, count, writeMode);
          
      fd = smb_ChainFID(fd, inp);
      fidp = smb_FindFID(vcp, fd, 0);
--- 6602,6645 ----
      fd = smb_GetSMBParm(inp, 0);
      totalCount = smb_GetSMBParm(inp, 1);
      count = smb_GetSMBParm(inp, 10);
      writeMode = smb_GetSMBParm(inp, 7);
  
      op = (char *) inp->data;
      op += smb_GetSMBParm(inp, 11);
  
+     offset.HighPart = 0;
+     offset.LowPart = smb_GetSMBParm(inp, 3) | (smb_GetSMBParm(inp, 4) << 16);
+ 
+     if (*inp->wctp == 14) {
+         /* we received a 64-bit file offset */
+ #ifdef AFS_LARGEFILES
+         offset.HighPart = smb_GetSMBParm(inp, 12) | (smb_GetSMBParm(inp, 13) << 16);
+ 
+         if (LargeIntegerLessThanZero(offset)) {
+             osi_Log2(smb_logp,
+                      "smb_ReceiveCoreWriteRaw received negative file offset 0x%x:%08x",
+                      offset.HighPart, offset.LowPart);
+             return CM_ERROR_BADSMB;
+         }
+ #else
+         if ((smb_GetSMBParm(inp, 12) | (smb_GetSMBParm(inp, 13) << 16)) != 0) {
+             osi_Log0(smb_logp,
+                      "smb_ReceiveCoreWriteRaw received 64-bit file offset, but we don't support large files");
+             return CM_ERROR_BADSMB;
+         }
+ 
+         offset.HighPart = 0;
+ #endif
+     } else {
+         offset.HighPart = 0;    /* 32-bit file offset */
+     }
+     
      osi_Log4(smb_logp,
!              "smb_ReceiveCoreWriteRaw fd %d, off 0x%x:%08x, size 0x%x",
!              fd, offset.HighPart, offset.LowPart, count);
!     osi_Log1(smb_logp,
!              "               WriteRaw WriteMode 0x%x",
!              writeMode);
          
      fd = smb_ChainFID(fd, inp);
      fidp = smb_FindFID(vcp, fd, 0);
***************
*** 6636,6642 ****
  	if (code == 0 && written == 0)
              code = CM_ERROR_PARTIALWRITE;
  
!         offset.LowPart += written;
          count -= written;
          total_written += written;
          written = 0;
--- 6700,6708 ----
  	if (code == 0 && written == 0)
              code = CM_ERROR_PARTIALWRITE;
  
!         offset = LargeIntegerAdd(offset,
!                                  ConvertLongToLargeInteger(written));
! 
          count -= written;
          total_written += written;
          written = 0;
***************
*** 6680,6689 ****
          return code;
      }
  
      rwcp->code = 0;
      rwcp->buf = rawBuf;
!     rwcp->offset.HighPart = 0;
!     rwcp->offset.LowPart = offset.LowPart + count;
      rwcp->count = totalCount - count;
      rwcp->writeMode = writeMode;
      rwcp->alreadyWritten = total_written;
--- 6746,6758 ----
          return code;
      }
  
+     offset = LargeIntegerAdd(offset,
+                              ConvertLongToLargeInteger(count));
+ 
      rwcp->code = 0;
      rwcp->buf = rawBuf;
!     rwcp->offset.HighPart = offset.HighPart;
!     rwcp->offset.LowPart = offset.LowPart;
      rwcp->count = totalCount - count;
      rwcp->writeMode = writeMode;
      rwcp->alreadyWritten = total_written;
***************
*** 7103,7108 ****
--- 7172,7178 ----
  long smb_ReceiveCoreSeek(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
  {
      long code = 0;
+     osi_hyper_t new_offset;
      long offset;
      int whence;
      unsigned short fd;
***************
*** 7144,7158 ****
      if (code == 0) {
          if (whence == 1) {
              /* offset from current offset */
!             offset += fidp->offset;
          }
          else if (whence == 2) {
              /* offset from current EOF */
!             offset += scp->length.LowPart;
          }
!         fidp->offset = offset;
!         smb_SetSMBParm(outp, 0, offset & 0xffff);
!         smb_SetSMBParm(outp, 1, (offset>>16) & 0xffff);
          smb_SetSMBDataLength(outp, 0);
      }
      lock_ReleaseMutex(&scp->mx);
--- 7214,7233 ----
      if (code == 0) {
          if (whence == 1) {
              /* offset from current offset */
!             new_offset = LargeIntegerAdd(fidp->offset,
!                                          ConvertLongToLargeInteger(offset));
          }
          else if (whence == 2) {
              /* offset from current EOF */
!             new_offset = LargeIntegerAdd(scp->length,
!                                          ConvertLongToLargeInteger(offset));
!         } else {
!             new_offset = ConvertLongToLargeInteger(offset);
          }
! 
!         fidp->offset = new_offset;
!         smb_SetSMBParm(outp, 0, new_offset.LowPart & 0xffff);
!         smb_SetSMBParm(outp, 1, (new_offset.LowPart>>16) & 0xffff);
          smb_SetSMBDataLength(outp, 0);
      }
      lock_ReleaseMutex(&scp->mx);
***************
*** 8607,8612 ****
--- 8682,8689 ----
      smb_dispatchTable[0x2d].flags |= SMB_DISPATCHFLAG_CHAINED;
      smb_dispatchTable[0x2e].procp = smb_ReceiveV3ReadX;
      smb_dispatchTable[0x2e].flags |= SMB_DISPATCHFLAG_CHAINED;
+     smb_dispatchTable[0x2f].procp = smb_ReceiveV3WriteX;
+     smb_dispatchTable[0x2f].flags |= SMB_DISPATCHFLAG_CHAINED;
      smb_dispatchTable[0x32].procp = smb_ReceiveV3Tran2A;	/* both are same */
      smb_dispatchTable[0x32].flags |= SMB_DISPATCHFLAG_NORESPONSE;
      smb_dispatchTable[0x33].procp = smb_ReceiveV3Tran2A;
Index: openafs/src/WINNT/afsd/smb.h
diff -c openafs/src/WINNT/afsd/smb.h:1.41.2.1 openafs/src/WINNT/afsd/smb.h:1.41.2.4
*** openafs/src/WINNT/afsd/smb.h:1.41.2.1	Thu Jun  1 11:40:04 2006
--- openafs/src/WINNT/afsd/smb.h	Tue Jul  4 18:43:24 2006
***************
*** 16,21 ****
--- 16,24 ----
  
  #include <ntsecapi.h>
  
+ /* Support largefiles by default */
+ #define AFS_LARGEFILES
+ 
  /* basic core protocol SMB structure */
  typedef struct smb {
      unsigned char id[4];
***************
*** 78,83 ****
--- 81,87 ----
  #define SMB_QUERY_FILE_COMPRESSION_INFO 0x10B
  #define SMB_QUERY_FILE_UNIX_BASIC       0x200
  #define SMB_QUERY_FILE_UNIX_LINK        0x201
+ #define SMB_INFO_PASSTHROUGH           0x1000
  
  #define SMB_SET_FILE_UNIX_BASIC         0x200
  #define SMB_SET_FILE_UNIX_LINK          0x201
***************
*** 340,346 ****
                                             originally (used to close
                                             the file if session is
                                             terminated) */
!     long offset;			/* our file pointer */
      smb_ioctl_t *ioctlp;		/* ptr to ioctl structure */
  					/* Under NT, we may need to know the
  					 * parent directory and pathname used
--- 344,350 ----
                                             originally (used to close
                                             the file if session is
                                             terminated) */
!     osi_hyper_t offset;			/* our file pointer */
      smb_ioctl_t *ioctlp;		/* ptr to ioctl structure */
  					/* Under NT, we may need to know the
  					 * parent directory and pathname used
***************
*** 376,382 ****
  #define SMB_FID_SHARE_READ              0x1000
  #define SMB_FID_SHARE_WRITE             0x2000
  
! #define SMB_FID_QLOCK_HIGH              0x0fe00000
  #define SMB_FID_QLOCK_LOW               0x00000000
  #define SMB_FID_QLOCK_LENGTH            1
  #define SMB_FID_QLOCK_PID               0
--- 380,386 ----
  #define SMB_FID_SHARE_READ              0x1000
  #define SMB_FID_SHARE_WRITE             0x2000
  
! #define SMB_FID_QLOCK_HIGH              0x7f000000
  #define SMB_FID_QLOCK_LOW               0x00000000
  #define SMB_FID_QLOCK_LENGTH            1
  #define SMB_FID_QLOCK_PID               0
***************
*** 681,686 ****
--- 685,698 ----
  extern int smb_SUser(cm_user_t *userp);
  
  #ifndef DJGPP
+ long smb_WriteData(smb_fid_t *fidp, osi_hyper_t *offsetp, long count, char *op,
+ 	cm_user_t *userp, long *writtenp);
+ #else /* DJGPP */
+ long smb_WriteData(smb_fid_t *fidp, osi_hyper_t *offsetp, long count, char *op,
+ 	cm_user_t *userp, long *writtenp, int dosflag);
+ #endif /* !DJGPP */
+ 
+ #ifndef DJGPP
  extern long smb_ReadData(smb_fid_t *fidp, osi_hyper_t *offsetp, long count,
  	char *op, cm_user_t *userp, long *readp);
  #else /* DJGPP */
Index: openafs/src/WINNT/afsd/smb3.c
diff -c openafs/src/WINNT/afsd/smb3.c:1.95.2.5 openafs/src/WINNT/afsd/smb3.c:1.95.2.11
*** openafs/src/WINNT/afsd/smb3.c:1.95.2.5	Wed Jun  7 19:31:55 2006
--- openafs/src/WINNT/afsd/smb3.c	Tue Jul  4 18:43:24 2006
***************
*** 876,886 ****
          lock_ReleaseMutex(&unp->mx);
  
          uidp = smb_FindUID(vcp, newUid, SMB_FLAG_CREATE);
!         lock_ObtainMutex(&uidp->mx);
!         uidp->unp = unp;
!         osi_Log4(smb_logp,"smb_ReceiveV3SessionSetupX MakeNewUser:VCP[%p],Lana[%d],lsn[%d],userid[%d]",vcp,vcp->lana,vcp->lsn,newUid);
!         lock_ReleaseMutex(&uidp->mx);
!         smb_ReleaseUID(uidp);
      }
  
      /* Return UID to the client */
--- 876,888 ----
          lock_ReleaseMutex(&unp->mx);
  
          uidp = smb_FindUID(vcp, newUid, SMB_FLAG_CREATE);
! 	if (uidp) {
! 	    lock_ObtainMutex(&uidp->mx);
! 	    uidp->unp = unp;
! 	    osi_Log4(smb_logp,"smb_ReceiveV3SessionSetupX MakeNewUser:VCP[%p],Lana[%d],lsn[%d],userid[%d]",vcp,vcp->lana,vcp->lsn,newUid);
! 	    lock_ReleaseMutex(&uidp->mx);
! 	    smb_ReleaseUID(uidp);
! 	}
      }
  
      /* Return UID to the client */
***************
*** 980,986 ****
  long smb_ReceiveV3TreeConnectX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
  {
      smb_tid_t *tidp;
!     smb_user_t *uidp;
      unsigned short newTid;
      char shareName[256];
      char *sharePath;
--- 982,988 ----
  long smb_ReceiveV3TreeConnectX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
  {
      smb_tid_t *tidp;
!     smb_user_t *uidp = NULL;
      unsigned short newTid;
      char shareName[256];
      char *sharePath;
***************
*** 989,995 ****
      char *pathp;
      char *passwordp;
      char *servicep;
!     cm_user_t *userp;
      int ipc = 0;
          
      osi_Log0(smb_logp, "SMB3 receive tree connect");
--- 991,997 ----
      char *pathp;
      char *passwordp;
      char *servicep;
!     cm_user_t *userp = NULL;
      int ipc = 0;
          
      osi_Log0(smb_logp, "SMB3 receive tree connect");
***************
*** 1022,1028 ****
      }
  
      uidp = smb_FindUID(vcp, ((smb_t *)inp)->uid, 0);
!     userp = smb_GetUserFromUID(uidp);
  
      lock_ObtainMutex(&vcp->mx);
      newTid = vcp->tidCounter++;
--- 1024,1031 ----
      }
  
      uidp = smb_FindUID(vcp, ((smb_t *)inp)->uid, 0);
!     if (uidp)
! 	userp = smb_GetUserFromUID(uidp);
  
      lock_ObtainMutex(&vcp->mx);
      newTid = vcp->tidCounter++;
***************
*** 1035,1041 ****
  	    strcpy(shareName, "all");
  	shareFound = smb_FindShare(vcp, uidp, shareName, &sharePath);
  	if (!shareFound) {
! 	    smb_ReleaseUID(uidp);
              smb_ReleaseTID(tidp);
              return CM_ERROR_BADSHARENAME;
  	}
--- 1038,1045 ----
  	    strcpy(shareName, "all");
  	shareFound = smb_FindShare(vcp, uidp, shareName, &sharePath);
  	if (!shareFound) {
! 	    if (uidp)
! 		smb_ReleaseUID(uidp);
              smb_ReleaseTID(tidp);
              return CM_ERROR_BADSHARENAME;
  	}
***************
*** 1053,1059 ****
          smb_SetSMBParm(outp, 2, 0);
          sharePath = NULL;
      }
!     smb_ReleaseUID(uidp);
  
      lock_ObtainMutex(&tidp->mx);
      tidp->userp = userp;
--- 1057,1064 ----
          smb_SetSMBParm(outp, 2, 0);
          sharePath = NULL;
      }
!     if (uidp)
! 	smb_ReleaseUID(uidp);
  
      lock_ObtainMutex(&tidp->mx);
      tidp->userp = userp;
***************
*** 1071,1082 ****
          *tp++ = 'A';
          *tp++ = ':';
          *tp++ = 0;
!         *tp++ = 'N';
!         *tp++ = 'T';
          *tp++ = 'F';
          *tp++ = 'S';
          *tp++ = 0;
!         smb_SetSMBDataLength(outp, 8);
      } else {
          strcpy(tp, "IPC");
          smb_SetSMBDataLength(outp, 4);
--- 1076,1086 ----
          *tp++ = 'A';
          *tp++ = ':';
          *tp++ = 0;
!         *tp++ = 'A';
          *tp++ = 'F';
          *tp++ = 'S';
          *tp++ = 0;
!         smb_SetSMBDataLength(outp, 7);
      } else {
          strcpy(tp, "IPC");
          smb_SetSMBDataLength(outp, 4);
***************
*** 2638,2655 ****
          nbytesRequired = 22;
      else if (infoLevel == SMB_INFO_QUERY_EA_SIZE) 
          nbytesRequired = 26;
!     else if (infoLevel == SMB_QUERY_FILE_BASIC_INFO) 
          nbytesRequired = 40;
!     else if (infoLevel == SMB_QUERY_FILE_STANDARD_INFO) 
!         nbytesRequired = 24;
      else if (infoLevel == SMB_QUERY_FILE_EA_INFO) 
          nbytesRequired = 4;
      else if (infoLevel == SMB_QUERY_FILE_ALT_NAME_INFO) 
          nbytesRequired = 30;
      else {
          osi_Log2(smb_logp, "Bad Tran2 op 0x%x infolevel 0x%x",
                    p->opcode, infoLevel);
          smb_SendTran2Error(vcp, p, opx, CM_ERROR_INVAL);
          return 0;
      }
  
--- 2642,2679 ----
          nbytesRequired = 22;
      else if (infoLevel == SMB_INFO_QUERY_EA_SIZE) 
          nbytesRequired = 26;
!     else if (infoLevel == SMB_QUERY_FILE_BASIC_INFO) {
! #ifdef COMMENT
          nbytesRequired = 40;
! #else
!         nbytesRequired = 34;
! #endif
!     }
!     else if (infoLevel == SMB_QUERY_FILE_STANDARD_INFO) {
! #ifdef COMMENT
! 	nbytesRequired = 24;
! #else
! 	nbytesRequired = 22;
! #endif
!     }
      else if (infoLevel == SMB_QUERY_FILE_EA_INFO) 
          nbytesRequired = 4;
+ #if 0
+     else if (infoLevel == SMB_QUERY_FILE_NAME_INFO) 
+         nbytesRequired = ???;
+     else if (infoLevel == SMB_QUERY_FILE_ALL_INFO) 
+         nbytesRequired = ???;
+ #endif
      else if (infoLevel == SMB_QUERY_FILE_ALT_NAME_INFO) 
          nbytesRequired = 30;
      else {
          osi_Log2(smb_logp, "Bad Tran2 op 0x%x infolevel 0x%x",
                    p->opcode, infoLevel);
+ #ifdef COMMENT
          smb_SendTran2Error(vcp, p, opx, CM_ERROR_INVAL);
+ #else
+         smb_SendTran2Error(vcp, p, opx, CM_ERROR_BADOP);
+ #endif
          return 0;
      }
  
***************
*** 2811,2816 ****
--- 2835,2845 ----
          *((u_long *)op) = scp->length.LowPart; op += 4;	/* alloc size */
          attributes = smb_Attributes(scp);
          *((u_short *)op) = attributes; op += 2;	/* attributes */
+ 
+ 	/* now, if we are being asked about extended attrs, return a 0 size */
+ 	if (infoLevel == SMB_INFO_QUERY_EA_SIZE) {
+ 	    *((u_long *)op) = 0; op += 4;
+ 	}
      }
      else if (infoLevel == SMB_QUERY_FILE_BASIC_INFO) {
          smb_LargeSearchTimeFromUnixTime(&ft, scp->clientModTime);
***************
*** 2819,2826 ****
--- 2848,2860 ----
          *((FILETIME *)op) = ft; op += 8;	/* last write time */
          *((FILETIME *)op) = ft; op += 8;	/* last change time */
          extAttributes = smb_ExtAttributes(scp);
+ #ifdef COMMENT
          *((u_long *)op) = extAttributes; op += 4; /* extended attribs */
          *((u_long *)op) = 0; op += 4;	/* don't know what this is */
+ #else
+ 	/* The CIFS Specs say */
+         *((u_short *)op) = extAttributes; op += 2; /* extended attributes */
+ #endif 
      }
      else if (infoLevel == SMB_QUERY_FILE_STANDARD_INFO) {
          *((LARGE_INTEGER *)op) = scp->length; op += 8;	/* alloc size */
***************
*** 2830,2846 ****
          *op++ = ((scp->fileType == CM_SCACHETYPE_DIRECTORY || 
  		  scp->fileType == CM_SCACHETYPE_MOUNTPOINT ||
  		  scp->fileType == CM_SCACHETYPE_INVALID) ? 1 : 0);
          *op++ = 0;
          *op++ = 0;
      }
      else if (infoLevel == SMB_QUERY_FILE_EA_INFO) {
          memset(op, 0, 4); op += 4;	/* EA size */
      }
  
-     /* now, if we are being asked about extended attrs, return a 0 size */
-     if (infoLevel == SMB_INFO_QUERY_EA_SIZE) {
-         *((u_long *)op) = 0; op += 4;
-     }
  
  
      /* send and free the packets */
--- 2864,2878 ----
          *op++ = ((scp->fileType == CM_SCACHETYPE_DIRECTORY || 
  		  scp->fileType == CM_SCACHETYPE_MOUNTPOINT ||
  		  scp->fileType == CM_SCACHETYPE_INVALID) ? 1 : 0);
+ #ifdef COMMENT
          *op++ = 0;
          *op++ = 0;
+ #endif
      }
      else if (infoLevel == SMB_QUERY_FILE_EA_INFO) {
          memset(op, 0, 4); op += 4;	/* EA size */
      }
  
  
  
      /* send and free the packets */
***************
*** 4141,4152 ****
                      LargeIntegerGreaterThanOrEqualTo(thyper, scp->bulkStatProgress)) {
                      /* Don't bulk stat if risking timeout */
                      int now = GetTickCount();
!                     if (now - req.startTime > 5000) {
                          scp->bulkStatProgress = thyper;
                          scp->flags &= ~CM_SCACHEFLAG_BULKSTATTING;
                          dsp->flags &= ~SMB_DIRSEARCH_BULKST;
                      } else
!                         cm_TryBulkStat(scp, &thyper, userp, &req);
                  }
              } else {
                  lock_ObtainMutex(&scp->mx);
--- 4173,4184 ----
                      LargeIntegerGreaterThanOrEqualTo(thyper, scp->bulkStatProgress)) {
                      /* Don't bulk stat if risking timeout */
                      int now = GetTickCount();
!                     if (now - req.startTime > RDRtimeout) {
                          scp->bulkStatProgress = thyper;
                          scp->flags &= ~CM_SCACHEFLAG_BULKSTATTING;
                          dsp->flags &= ~SMB_DIRSEARCH_BULKST;
                      } else
!                         code = cm_TryBulkStat(scp, &thyper, userp, &req);
                  }
              } else {
                  lock_ObtainMutex(&scp->mx);
***************
*** 4242,4249 ****
              NeedShortName = 1;
          }
  
!         osi_Log3(smb_logp, "T2 search dir vn %u name %s (%s)",
!                   dep->fid.vnode, osi_LogSaveString(smb_logp, dep->name),
                    NeedShortName ? osi_LogSaveString(smb_logp, shortName) : "");
  
          /* When matching, we are using doing a case fold if we have a wildcard mask.
--- 4274,4282 ----
              NeedShortName = 1;
          }
  
!         osi_Log4(smb_logp, "T2 search dir vn %u uniq %u name %s (%s)",
!                   dep->fid.vnode, dep->fid.unique, 
! 		  osi_LogSaveString(smb_logp, dep->name),
                    NeedShortName ? osi_LogSaveString(smb_logp, shortName) : "");
  
          /* When matching, we are using doing a case fold if we have a wildcard mask.
***************
*** 4670,4676 ****
                  return CM_ERROR_BADSHARENAME;
          }
  #endif /* DFS_SUPPORT */
- 
          /* otherwise, scp points to the parent directory.  Do a lookup,
           * and truncate the file if we find it, otherwise we create the
           * file.
--- 4703,4708 ----
***************
*** 5250,5255 ****
--- 5282,5417 ----
      return code;
  }
  
+ long smb_ReceiveV3WriteX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
+ {
+     osi_hyper_t offset;
+     long count, written = 0, total_written = 0;
+     unsigned short fd;
+     unsigned pid;
+     smb_fid_t *fidp;
+     long code = 0;
+     cm_user_t *userp;
+     char *op;
+     int inDataBlockCount;
+ 
+     fd = smb_GetSMBParm(inp, 2);
+     count = smb_GetSMBParm(inp, 10);
+ 
+     offset.HighPart = 0;
+     offset.LowPart = smb_GetSMBParm(inp, 3) | (smb_GetSMBParm(inp, 4) << 16);
+ 
+     if (*inp->wctp == 14) {
+         /* we have a request with 64-bit file offsets */
+ #ifdef AFS_LARGEFILES
+         offset.HighPart = smb_GetSMBParm(inp, 12) | (smb_GetSMBParm(inp, 13) << 16);
+ #else
+         if ((smb_GetSMBParm(inp, 12) | (smb_GetSMBParm(inp, 13) << 16)) != 0) {
+             /* uh oh */
+             osi_Log0(smb_logp, "smb_ReceiveV3WriteX offset requires largefile support");
+             /* we shouldn't have received this op if we didn't specify
+                largefile support */
+             return CM_ERROR_BADOP;
+         }
+ #endif
+     }
+ 
+     op = inp->data + smb_GetSMBParm(inp, 11);
+     inDataBlockCount = count;
+ 
+     osi_Log4(smb_logp, "smb_ReceiveV3WriteX fid %d, off 0x%x:%08x, size 0x%x",
+              fd, offset.HighPart, offset.LowPart, count);
+         
+     fd = smb_ChainFID(fd, inp);
+     fidp = smb_FindFID(vcp, fd, 0);
+     if (!fidp)
+         return CM_ERROR_BADFD;
+         
+     lock_ObtainMutex(&fidp->mx);
+     if (fidp->flags & SMB_FID_IOCTL) {
+ 	lock_ReleaseMutex(&fidp->mx);
+         code = smb_IoctlV3Write(fidp, vcp, inp, outp);
+ 	smb_ReleaseFID(fidp);
+ 	return code;
+     }
+     lock_ReleaseMutex(&fidp->mx);
+     userp = smb_GetUserFromVCP(vcp, inp);
+ 
+     /* special case: 0 bytes transferred means there is no data
+        transferred.  A slight departure from SMB_COM_WRITE where this
+        means that we are supposed to truncate the file at this
+        position. */
+ 
+     {
+         cm_key_t key;
+         LARGE_INTEGER LOffset;
+         LARGE_INTEGER LLength;
+ 
+         pid = ((smb_t *) inp)->pid;
+         key = cm_GenerateKey(vcp->vcID, pid, fd);
+ 
+         LOffset.HighPart = offset.HighPart;
+         LOffset.LowPart = offset.LowPart;
+         LLength.HighPart = 0;
+         LLength.LowPart = count;
+ 
+         lock_ObtainMutex(&fidp->scp->mx);
+         code = cm_LockCheckWrite(fidp->scp, LOffset, LLength, key);
+         lock_ReleaseMutex(&fidp->scp->mx);
+ 
+         if (code)
+             goto done;
+     }
+ 
+     /*
+      * Work around bug in NT client
+      *
+      * When copying a file, the NT client should first copy the data,
+      * then copy the last write time.  But sometimes the NT client does
+      * these in the wrong order, so the data copies would inadvertently
+      * cause the last write time to be overwritten.  We try to detect this,
+      * and don't set client mod time if we think that would go against the
+      * intention.
+      */
+     lock_ObtainMutex(&fidp->mx);
+     if ((fidp->flags & SMB_FID_MTIMESETDONE) != SMB_FID_MTIMESETDONE) {
+         fidp->scp->mask |= CM_SCACHEMASK_CLIENTMODTIME;
+         fidp->scp->clientModTime = time(NULL);
+     }
+     lock_ReleaseMutex(&fidp->mx);
+ 
+     code = 0;
+     while ( code == 0 && count > 0 ) {
+ #ifndef DJGPP
+ 	code = smb_WriteData(fidp, &offset, count, op, userp, &written);
+ #else /* DJGPP */
+ 	code = smb_WriteData(fidp, &offset, count, op, userp, &written, FALSE);
+ #endif /* !DJGPP */
+ 	if (code == 0 && written == 0)
+             code = CM_ERROR_PARTIALWRITE;
+ 
+         offset = LargeIntegerAdd(offset,
+                                  ConvertLongToLargeInteger(written));
+         count -= written;
+         total_written += written;
+         written = 0;
+     }
+ 
+  done_writing:
+     
+     /* slots 0 and 1 are reserved for request chaining and will be
+        filled in when we return. */
+     smb_SetSMBParm(outp, 2, total_written);
+     smb_SetSMBParm(outp, 3, 0); /* reserved */
+     smb_SetSMBParm(outp, 4, 0); /* reserved */
+     smb_SetSMBParm(outp, 5, 0); /* reserved */
+     smb_SetSMBDataLength(outp, 0);
+ 
+  done:
+     smb_ReleaseFID(fidp);
+     cm_ReleaseUser(userp);
+ 
+     return code;
+ }
  
  long smb_ReceiveV3ReadX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
  {
***************
*** 5266,5277 ****
          
      fd = smb_GetSMBParm(inp, 2);
      count = smb_GetSMBParm(inp, 5);
-     offset.HighPart = 0;	/* too bad */
      offset.LowPart = smb_GetSMBParm(inp, 3) | (smb_GetSMBParm(inp, 4) << 16);
  
!     osi_Log3(smb_logp, "smb_ReceiveV3Read fd %d, off 0x%x, size 0x%x",
!              fd, offset.LowPart, count);
!         
      fd = smb_ChainFID(fd, inp);
      fidp = smb_FindFID(vcp, fd, 0);
      if (!fidp) {
--- 5428,5460 ----
          
      fd = smb_GetSMBParm(inp, 2);
      count = smb_GetSMBParm(inp, 5);
      offset.LowPart = smb_GetSMBParm(inp, 3) | (smb_GetSMBParm(inp, 4) << 16);
  
!     if (*inp->wctp == 12) {
!         /* a request with 64-bit offsets */
! #ifdef AFS_LARGEFILES
!         offset.HighPart = smb_GetSMBParm(inp, 10) | (smb_GetSMBParm(inp, 11) << 16);
! 
!         if (LargeIntegerLessThanZero(offset)) {
!             osi_Log2(smb_logp, "smb_ReceiveV3Read offset too large (0x%x:%08x)",
!                      offset.HighPart, offset.LowPart);
!             return CM_ERROR_BADSMB;
!         }
! #else
!         if ((smb_GetSMBParm(inp, 10) | (smb_GetSMBParm(inp, 11) << 16)) != 0) {
!             osi_Log0(smb_logp, "smb_ReceiveV3Read offset is 64-bit.  Dropping");
!             return CM_ERROR_BADSMB;
!         } else {
!             offset.HighPart = 0;
!         }
! #endif
!     } else {
!         offset.HighPart = 0;
!     }
! 
!     osi_Log4(smb_logp, "smb_ReceiveV3Read fd %d, off 0x%x:%08x, size 0x%x",
!              fd, offset.HighPart, offset.LowPart, count);
! 
      fd = smb_ChainFID(fd, inp);
      fidp = smb_FindFID(vcp, fd, 0);
      if (!fidp) {
Index: openafs/src/WINNT/afsd/smb3.h
diff -c openafs/src/WINNT/afsd/smb3.h:1.12 openafs/src/WINNT/afsd/smb3.h:1.12.2.1
*** openafs/src/WINNT/afsd/smb3.h:1.12	Thu Apr 27 11:49:56 2006
--- openafs/src/WINNT/afsd/smb3.h	Sat Jun 24 16:41:55 2006
***************
*** 175,180 ****
--- 175,182 ----
  
  extern long smb_ReceiveV3ReadX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp);
  
+ extern long smb_ReceiveV3WriteX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp);
+ 
  extern long smb_ReceiveV3SetAttributes(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp);
  
  extern long smb_ReceiveNTCreateX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp);
Index: openafs/src/WINNT/afsd/smb_iocons.h
diff -c openafs/src/WINNT/afsd/smb_iocons.h:1.10 openafs/src/WINNT/afsd/smb_iocons.h:1.10.4.1
*** openafs/src/WINNT/afsd/smb_iocons.h:1.10	Sun Oct  2 02:04:36 2005
--- openafs/src/WINNT/afsd/smb_iocons.h	Tue Jun 27 18:19:35 2006
***************
*** 96,99 ****
--- 96,100 ----
  #define VIOCGETOWNER                    0x2d
  #define VIOC_RXSTAT_PROC                0x2e
  #define VIOC_RXSTAT_PEER                0x2f
+ #define VIOC_UUIDCTL                    0x30
  #endif /*  __SMB_IOCONS_H_ENV_ */
Index: openafs/src/WINNT/afsd/smb_ioctl.c
diff -c openafs/src/WINNT/afsd/smb_ioctl.c:1.25 openafs/src/WINNT/afsd/smb_ioctl.c:1.25.2.2
*** openafs/src/WINNT/afsd/smb_ioctl.c:1.25	Sun Apr  9 03:28:58 2006
--- openafs/src/WINNT/afsd/smb_ioctl.c	Tue Jun 27 18:19:35 2006
***************
*** 83,88 ****
--- 83,89 ----
          smb_ioctlProcsp[VIOCGETOWNER] = cm_IoctlGetOwner;
          smb_ioctlProcsp[VIOC_RXSTAT_PROC] = cm_IoctlRxStatProcess;
          smb_ioctlProcsp[VIOC_RXSTAT_PEER] = cm_IoctlRxStatPeer;
+         smb_ioctlProcsp[VIOC_UUIDCTL] = cm_IoctlUUIDControl;
  }
  
  /* called to make a fid structure into an IOCTL fid structure */
***************
*** 280,285 ****
--- 281,331 ----
          return code;
  }
  
+ /* called from smb_ReceiveV3WriteX when we receive a write call on the IOCTL
+  * file descriptor.
+  */
+ long smb_IoctlV3Write(smb_fid_t *fidp, smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
+ {
+ 	smb_ioctl_t *iop;
+         long count;
+         long code;
+         char *op;
+         int inDataBlockCount;
+ 
+ 	code = 0;
+ 	count = smb_GetSMBParm(inp, 10);
+         iop = fidp->ioctlp;
+         
+ 	smb_IoctlPrepareWrite(fidp, iop);
+ 
+         op = inp->data + smb_GetSMBParm(inp, 11);
+         inDataBlockCount = count;
+ 	
+         if (count + iop->inCopied > SMB_IOCTL_MAXDATA) {
+ 		code = CM_ERROR_TOOBIG;
+                 goto done;
+         }
+         
+ 	/* copy data */
+         memcpy(iop->inDatap + iop->inCopied, op, count);
+         
+         /* adjust counts */
+         iop->inCopied += count;
+ 
+ done:
+ 	/* return # of bytes written */
+ 	if (code == 0) {
+ 		smb_SetSMBParm(outp, 2, count);
+                 smb_SetSMBParm(outp, 3, 0); /* reserved */
+ 	        smb_SetSMBParm(outp, 4, 0); /* reserved */
+ 	        smb_SetSMBParm(outp, 5, 0); /* reserved */
+ 	        smb_SetSMBDataLength(outp, 0);
+         }
+ 
+         return code;
+ }
+ 
+ 
  /* called from V3 read to handle IOCTL descriptor reads */
  long smb_IoctlV3Read(smb_fid_t *fidp, smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
  {
Index: openafs/src/WINNT/afsd/smb_ioctl.h
diff -c openafs/src/WINNT/afsd/smb_ioctl.h:1.4 openafs/src/WINNT/afsd/smb_ioctl.h:1.4.14.1
*** openafs/src/WINNT/afsd/smb_ioctl.h:1.4	Mon Jul 19 18:40:12 2004
--- openafs/src/WINNT/afsd/smb_ioctl.h	Sat Jun 24 16:41:55 2006
***************
*** 30,35 ****
--- 30,37 ----
  
  extern long smb_IoctlWrite(smb_fid_t *fidp, smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp);
  
+ extern long smb_IoctlV3Write(smb_fid_t *fidp, smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp);
+ 
  extern long smb_IoctlV3Read(smb_fid_t *fidp, smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp);
  
  #ifndef DJGPP
Index: openafs/src/WINNT/afsreg/afsreg.h
diff -c openafs/src/WINNT/afsreg/afsreg.h:1.6 openafs/src/WINNT/afsreg/afsreg.h:1.6.4.1
*** openafs/src/WINNT/afsreg/afsreg.h:1.6	Mon Dec 19 08:55:42 2005
--- openafs/src/WINNT/afsreg/afsreg.h	Sun Jun 25 22:25:49 2006
***************
*** 23,31 ****
  #define AFSREG_SVR_SW_NAME   "AFS Server"
  
  #define AFSREG_CLT_SVC_NAME  "TransarcAFSDaemon"
! #define AFSREG_CLT_SW_NAME   "AFS Client"
! 
! 
  
  /* ---- NT system configuration information ---- */
  
--- 23,30 ----
  #define AFSREG_SVR_SW_NAME   "AFS Server"
  
  #define AFSREG_CLT_SVC_NAME  "TransarcAFSDaemon"
! #define AFSREG_CLT_SW_NAME   	  "AFS Client"
! #define AFSREG_CLT_TOOLS_SW_NAME  "AFS Client 32-Bit Binaries"
  
  /* ---- NT system configuration information ---- */
  
***************
*** 123,128 ****
--- 122,134 ----
  #define AFSREG_CLT_SW_VERSION_KEY  AFSREG_CLT_SW_KEY "\\CurrentVersion"
  #define AFSREG_CLT_SW_VERSION_SUBKEY  AFSREG_CLT_SW_SUBKEY "\\CurrentVersion"
  
+ #define AFSREG_CLT_TOOLS_SW_SUBKEY \
+     "Software\\TransarcCorporation\\" AFSREG_CLT_TOOLS_SW_NAME
+ #define AFSREG_CLT_TOOLS_SW_KEY "HKEY_LOCAL_MACHINE\\" AFSREG_CLT_TOOLS_SW_SUBKEY
+ 
+ #define AFSREG_CLT_TOOLS_SW_VERSION_KEY  AFSREG_CLT_TOOLS_SW_KEY "\\CurrentVersion"
+ #define AFSREG_CLT_TOOLS_SW_VERSION_SUBKEY  AFSREG_CLT_TOOLS_SW_SUBKEY "\\CurrentVersion"
+ 
  /* AFSREG_CLT_SW_VERSION_KEY values */
  #define AFSREG_CLT_SW_VERSION_DIR_VALUE   "PathName"
  #define AFSREG_CLT_SW_VERSION_MAJOR_VALUE    "MajorVersion"
Index: openafs/src/WINNT/afsreg/afssw.c
diff -c openafs/src/WINNT/afsreg/afssw.c:1.4 openafs/src/WINNT/afsreg/afssw.c:1.4.4.1
*** openafs/src/WINNT/afsreg/afssw.c:1.4	Sat Nov  5 01:47:48 2005
--- openafs/src/WINNT/afsreg/afssw.c	Sun Jun 25 22:25:49 2006
***************
*** 58,66 ****
  int
  afssw_GetClientInstallDir(char **bufPP)   /* [out] data buffer */
  {
!     return StringDataRead(AFSREG_CLT_SW_VERSION_KEY,
  			  AFSREG_CLT_SW_VERSION_DIR_VALUE,
  			  bufPP);
  }
  
  /*
--- 58,71 ----
  int
  afssw_GetClientInstallDir(char **bufPP)   /* [out] data buffer */
  {
!     int retval = StringDataRead(AFSREG_CLT_SW_VERSION_KEY,
  			  AFSREG_CLT_SW_VERSION_DIR_VALUE,
  			  bufPP);
+     if (retval)
+ 	retval = StringDataRead(AFSREG_CLT_TOOLS_SW_VERSION_KEY,
+ 			  AFSREG_CLT_SW_VERSION_DIR_VALUE,
+ 			  bufPP);
+     return retval;
  }
  
  /*
Index: openafs/src/WINNT/aklog/NTMakefile
diff -c openafs/src/WINNT/aklog/NTMakefile:1.4 openafs/src/WINNT/aklog/NTMakefile:1.4.4.1
*** openafs/src/WINNT/aklog/NTMakefile:1.4	Sun Nov 20 20:56:14 2005
--- openafs/src/WINNT/aklog/NTMakefile	Sun Jun 25 13:58:06 2006
***************
*** 31,42 ****
      $(DESTDIR)\lib\afsauthent.lib \
      $(DESTDIR)\lib\afs\afskauth.lib
  
  OTHERLIBS = \
!     ..\kfw\lib\i386\krbv4w32.lib \
!     ..\kfw\lib\i386\krb5_32.lib \
!     ..\kfw\lib\i386\comerr32.lib \
      dnsapi.lib mpr.lib
! 
  afscflags = -I..\kfw\inc\krb5 -I..\kfw\inc\krb4 $(afscflags)
  
  $(AKLOGOBJS): $$(@B).c
--- 31,48 ----
      $(DESTDIR)\lib\afsauthent.lib \
      $(DESTDIR)\lib\afs\afskauth.lib
  
+ !IF "$(CPU)" == "IA64" || "$(CPU)" == "AMD64" || "$(CPU)" == "ALPHA64"
  OTHERLIBS = \
!     ..\kfw\lib\$(CPU)\krb5_64.lib \
!     ..\kfw\lib\$(CPU)\comerr64.lib \
      dnsapi.lib mpr.lib
! !else
! OTHERLIBS = \
!     ..\kfw\lib\$(CPU)\krbv4w32.lib \
!     ..\kfw\lib\$(CPU)\krb5_32.lib \
!     ..\kfw\lib\$(CPU)\comerr32.lib \
!     dnsapi.lib mpr.lib
! !endif
  afscflags = -I..\kfw\inc\krb5 -I..\kfw\inc\krb4 $(afscflags)
  
  $(AKLOGOBJS): $$(@B).c
Index: openafs/src/WINNT/client_exp/lang/NTMakefile
diff -c openafs/src/WINNT/client_exp/lang/NTMakefile:1.5 openafs/src/WINNT/client_exp/lang/NTMakefile:1.5.14.1
*** openafs/src/WINNT/client_exp/lang/NTMakefile:1.5	Fri Nov 21 02:59:59 2003
--- openafs/src/WINNT/client_exp/lang/NTMakefile	Sun Jun 25 12:58:00 2006
***************
*** 48,54 ****
  install : $(DLLFILE)
  
  clean ::
! 	$(DEL) $(OUT)\*.res RC* RD* $(DLLFILE)
  
  ############################################################################
  #
--- 48,54 ----
  install : $(DLLFILE)
  
  clean ::
! 	$(DEL) $(OUT)\*.res RC* RD* $(DLLFILE) AFS_component_version_number.h
  
  ############################################################################
  #
Index: openafs/src/WINNT/install/NSIS/OpenAFS.nsi
diff -c openafs/src/WINNT/install/NSIS/OpenAFS.nsi:1.88 openafs/src/WINNT/install/NSIS/OpenAFS.nsi:1.88.4.2
*** openafs/src/WINNT/install/NSIS/OpenAFS.nsi:1.88	Tue Sep 27 00:37:37 2005
--- openafs/src/WINNT/install/NSIS/OpenAFS.nsi	Sun Jul  2 21:04:36 2006
***************
*** 1071,1084 ****
  
  Section /o "Software Development Kit (SDK)" secSDK
  
!     SetOutPath "$INSTDIR\Client\Program\lib"
!     File /r "${AFS_CLIENT_LIBDIR}\*.*"
  
!     SetOutPath "$INSTDIR\Client\Program\Include"
!     File /r "${AFS_BUILD_INCDIR}\*.*"    
  
     ; Client Sample
!    SetOutPath "$INSTDIR\Client\Program\Sample"
     File "..\..\afsd\sample\token.c"
  
     ;Store install folder
--- 1071,1084 ----
  
  Section /o "Software Development Kit (SDK)" secSDK
  
!    SetOutPath "$INSTDIR\SDK\lib"
!    File /r "${AFS_CLIENT_LIBDIR}\*.*"
  
!    SetOutPath "$INSTDIR\SDK\Include"
!    File /r "${AFS_BUILD_INCDIR}\*.*"    
  
     ; Client Sample
!    SetOutPath "$INSTDIR\SDK\Sample"
     File "..\..\afsd\sample\token.c"
  
     ;Store install folder
***************
*** 1448,1454 ****
  ; the SDK is installed.  If not, we don't need to push it on the user.
  ; If they are there, we want to make sure they match the installed version.
  CheckSDK:
!    IfFileExists "$INSTDIR\Client\Program\Include\main.h" +1 NoSDK
     SectionGetFlags ${secSDK} $0
     IntOp $0 $0 | ${SF_SELECTED}
     SectionSetFlags ${secSDK} $0
--- 1448,1454 ----
  ; the SDK is installed.  If not, we don't need to push it on the user.
  ; If they are there, we want to make sure they match the installed version.
  CheckSDK:
!    IfFileExists "$INSTDIR\SDK\Include\main.h" +1 NoSDK
     SectionGetFlags ${secSDK} $0
     IntOp $0 $0 | ${SF_SELECTED}
     SectionSetFlags ${secSDK} $0
***************
*** 1838,1852 ****
  
    Delete /REBOOTOK "$INSTDIR\Client\Program\afscreds.pdb"
  
    Delete /REBOOTOK "$INSTDIR\Client\Program\*"
!   Delete /REBOOTOK "$INSTDIR\Client\Program\Include\*"
!   Delete /REBOOTOK "$INSTDIR\Client\Program\Include\afs\*"
!   Delete /REBOOTOK "$INSTDIR\Client\Program\Include\rx\*"
!   Delete /REBOOTOK "$INSTDIR\Client\Program\Sample\*"
!   RMDir  "$INSTDIR\Client\Program\Sample"
!   RMDir  "$INSTDIR\Client\Program\Include\afs"
!   RMDir  "$INSTDIR\Client\Program\Include\rx"
!   RMDir  "$INSTDIR\Client\Program\Include"
    RMDir  "$INSTDIR\Client\Program"
    RMDir  "$INSTDIR\Client"
  
--- 1838,1858 ----
  
    Delete /REBOOTOK "$INSTDIR\Client\Program\afscreds.pdb"
  
+   Delete /REBOOTOK "$INSTDIR\SDK\Include\*"
+   Delete /REBOOTOK "$INSTDIR\SDK\Include\afs\*"
+   Delete /REBOOTOK "$INSTDIR\SDK\Include\rx\*"
+   Delete /REBOOTOK "$INSTDIR\SDK\Sample\*"
+   Delete /REBOOTOK "$INSTDIR\SDK\*"
+ 
+   RMDir  "$INSTDIR\SDK\Sample"
+   RMDir  "$INSTDIR\SDK\Include\afs"
+   RMDir  "$INSTDIR\SDK\Include\rx"
+   RMDir  "$INSTDIR\SDK\Include"
+   RMDir  "$INSTDIR\SDK"
+ 
    Delete /REBOOTOK "$INSTDIR\Client\Program\*"
!   Delete /REBOOTOK "$INSTDIR\Client\*"
! 
    RMDir  "$INSTDIR\Client\Program"
    RMDir  "$INSTDIR\Client"
  
***************
*** 2849,2854 ****
--- 2855,2865 ----
     ;File "${AFS_CLIENT_BUILDDIR}\afscreds_1033.pdb"
  !endif
  
+    File "..\..\doc\help\en_US\afs-light.CNT"
+    File "..\..\doc\help\en_US\afs-light.hlp"
+    File "..\..\doc\help\en_US\afs-nt.CNT"
+    File "..\..\doc\help\en_US\afs-nt.HLP"
+ 
     SetOutPath "$INSTDIR\Common"
     !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_config_1033.dll"           "$INSTDIR\Common\afs_config_1033.dll" "$INSTDIR"
     !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa_1033.dll"              "$INSTDIR\Common\afs_cpa_1033.dll" "$INSTDIR"
***************
*** 2861,2870 ****
     !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1033.dll"   "$INSTDIR\Common\TaAfsServerManager_1033.dll" "$INSTDIR"
     File "..\..\doc\help\en_US\afs-cc.CNT"
     File "..\..\doc\help\en_US\afs-cc.hlp"
-    File "..\..\doc\help\en_US\afs-light.CNT"
-    File "..\..\doc\help\en_US\afs-light.hlp"
-    File "..\..\doc\help\en_US\afs-nt.CNT"
-    File "..\..\doc\help\en_US\afs-nt.HLP"
     File "..\..\doc\help\en_US\taafscfg.CNT"
     File "..\..\doc\help\en_US\taafscfg.hlp"
     File "..\..\doc\help\en_US\taafssvrmgr.CNT"
--- 2872,2877 ----
***************
*** 2907,2912 ****
--- 2914,2924 ----
     ;File "${AFS_CLIENT_BUILDDIR}\afscreds_1032.pdb"
  !endif
  
+    File "..\..\doc\help\de_DE\afs-light.CNT"
+    File "..\..\doc\help\de_DE\afs-light.hlp"
+    File "..\..\doc\help\de_DE\afs-nt.CNT"
+    File "..\..\doc\help\de_DE\afs-nt.HLP"
+ 
     SetOutPath "$INSTDIR\Common"
     !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_config_1032.dll"           "$INSTDIR\Common\afs_config_1032.dll" "$INSTDIR"
     !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa_1032.dll"              "$INSTDIR\Common\afs_cpa_1032.dll" "$INSTDIR" 
***************
*** 2919,2928 ****
     !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1032.dll"   "$INSTDIR\Common\TaAfsServerManager_1032.dll" "$INSTDIR" 
     File "..\..\doc\help\de_DE\afs-cc.CNT"
     File "..\..\doc\help\de_DE\afs-cc.hlp"
-    File "..\..\doc\help\de_DE\afs-light.CNT"
-    File "..\..\doc\help\de_DE\afs-light.hlp"
-    File "..\..\doc\help\de_DE\afs-nt.CNT"
-    File "..\..\doc\help\de_DE\afs-nt.HLP"
     File "..\..\doc\help\de_DE\taafscfg.CNT"
     File "..\..\doc\help\de_DE\taafscfg.hlp"
     File "..\..\doc\help\de_DE\taafssvrmgr.CNT"
--- 2931,2936 ----
***************
*** 2965,2970 ****
--- 2973,2983 ----
     ;File "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1034.pdb"
  !endif
  
+    File "..\..\doc\help\es_ES\afs-light.CNT"
+    File "..\..\doc\help\es_ES\afs-light.hlp"
+    File "..\..\doc\help\es_ES\afs-nt.CNT"
+    File "..\..\doc\help\es_ES\afs-nt.HLP"
+ 
     SetOutPath "$INSTDIR\Common"
     !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_config_1034.dll"          "$INSTDIR\Common\afs_config_1034.dll" "$INSTDIR"  
     !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa_1034.dll"             "$INSTDIR\Common\afs_cpa_1034.dll" "$INSTDIR"  
***************
*** 2977,2986 ****
     !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1034.dll"  "$INSTDIR\Common\TaAfsServerManager_1034.dll" "$INSTDIR"  
     File "..\..\doc\help\es_ES\afs-cc.CNT"
     File "..\..\doc\help\es_ES\afs-cc.hlp"
-    File "..\..\doc\help\es_ES\afs-light.CNT"
-    File "..\..\doc\help\es_ES\afs-light.hlp"
-    File "..\..\doc\help\es_ES\afs-nt.CNT"
-    File "..\..\doc\help\es_ES\afs-nt.HLP"
     File "..\..\doc\help\es_ES\taafscfg.CNT"
     File "..\..\doc\help\es_ES\taafscfg.hlp"
     File "..\..\doc\help\es_ES\taafssvrmgr.CNT"
--- 2990,2995 ----
***************
*** 3023,3028 ****
--- 3032,3042 ----
     ;File "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1041.pdb"
  !endif
  
+    File "..\..\doc\help\ja_JP\afs-light.CNT"
+    File "..\..\doc\help\ja_JP\afs-light.hlp"
+    File "..\..\doc\help\ja_JP\afs-nt.CNT"
+    File "..\..\doc\help\ja_JP\afs-nt.HLP"
+ 
     SetOutPath "$INSTDIR\Common"
     !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_config_1041.dll"           "$INSTDIR\Common\afs_config_1041.dll" "$INSTDIR"   
     !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa_1041.dll"              "$INSTDIR\Common\afs_cpa_1041.dll" "$INSTDIR"   
***************
*** 3035,3044 ****
     !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1041.dll"   "$INSTDIR\Common\TaAfsServerManager_1041.dll" "$INSTDIR"   
     File "..\..\doc\help\ja_JP\afs-cc.CNT"
     File "..\..\doc\help\ja_JP\afs-cc.hlp"
-    File "..\..\doc\help\ja_JP\afs-light.CNT"
-    File "..\..\doc\help\ja_JP\afs-light.hlp"
-    File "..\..\doc\help\ja_JP\afs-nt.CNT"
-    File "..\..\doc\help\ja_JP\afs-nt.HLP"
     File "..\..\doc\help\ja_JP\taafscfg.CNT"
     File "..\..\doc\help\ja_JP\taafscfg.hlp"
     File "..\..\doc\help\ja_JP\taafssvrmgr.CNT"
--- 3049,3054 ----
***************
*** 3081,3086 ****
--- 3091,3101 ----
     ;File "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1042.pdb"
  !endif
  
+    File "..\..\doc\help\ko_KR\afs-light.CNT"
+    File "..\..\doc\help\ko_KR\afs-light.hlp"
+    File "..\..\doc\help\ko_KR\afs-nt.CNT"
+    File "..\..\doc\help\ko_KR\afs-nt.HLP"
+ 
     SetOutPath "$INSTDIR\Common"
     !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_config_1042.dll"           "$INSTDIR\Common\afs_config_1042.dll" "$INSTDIR"    
     !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa_1042.dll"              "$INSTDIR\Common\afs_cpa_1042.dll" "$INSTDIR"    
***************
*** 3093,3102 ****
     !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1042.dll"   "$INSTDIR\Common\TaAfsServerManager_1042.dll" "$INSTDIR"    
     File "..\..\doc\help\ko_KR\afs-cc.CNT"
     File "..\..\doc\help\ko_KR\afs-cc.hlp"
-    File "..\..\doc\help\ko_KR\afs-light.CNT"
-    File "..\..\doc\help\ko_KR\afs-light.hlp"
-    File "..\..\doc\help\ko_KR\afs-nt.CNT"
-    File "..\..\doc\help\ko_KR\afs-nt.HLP"
     File "..\..\doc\help\ko_KR\taafscfg.CNT"
     File "..\..\doc\help\ko_KR\taafscfg.hlp"
     File "..\..\doc\help\ko_KR\taafssvrmgr.CNT"
--- 3108,3113 ----
***************
*** 3140,3145 ****
--- 3151,3161 ----
     ;File "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1046.pdb"
  !endif
  
+    File "..\..\doc\help\pt_BR\afs-light.CNT"
+    File "..\..\doc\help\pt_BR\afs-light.hlp"
+    File "..\..\doc\help\pt_BR\afs-nt.CNT"
+    File "..\..\doc\help\pt_BR\afs-nt.HLP"
+ 
     SetOutPath "$INSTDIR\Common"
     !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_config_1046.dll"           "$INSTDIR\Common\afs_config_1046.dll" "$INSTDIR"     
     !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa_1046.dll"              "$INSTDIR\Common\afs_cpa_1046.dll" "$INSTDIR"     
***************
*** 3152,3161 ****
     !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1046.dll"   "$INSTDIR\Common\TaAfsServerManager_1046.dll" "$INSTDIR"     
     File "..\..\doc\help\pt_BR\afs-cc.CNT"
     File "..\..\doc\help\pt_BR\afs-cc.hlp"
-    File "..\..\doc\help\pt_BR\afs-light.CNT"
-    File "..\..\doc\help\pt_BR\afs-light.hlp"
-    File "..\..\doc\help\pt_BR\afs-nt.CNT"
-    File "..\..\doc\help\pt_BR\afs-nt.HLP"
     File "..\..\doc\help\pt_BR\taafscfg.CNT"
     File "..\..\doc\help\pt_BR\taafscfg.hlp"
     File "..\..\doc\help\pt_BR\taafssvrmgr.CNT"
--- 3168,3173 ----
***************
*** 3198,3203 ****
--- 3210,3220 ----
     ;File "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_2052.pdb"
  !endif
  
+    File "..\..\doc\help\zh_CN\afs-light.CNT"
+    File "..\..\doc\help\zh_CN\afs-light.hlp"
+    File "..\..\doc\help\zh_CN\afs-nt.CNT"
+    File "..\..\doc\help\zh_CN\afs-nt.HLP"
+ 
     SetOutPath "$INSTDIR\Common"
     !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_config_2052.dll"           "$INSTDIR\Common\afs_config_2052.dll" "$INSTDIR"      
     !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa_2052.dll"              "$INSTDIR\Common\afs_cpa_2052.dll" "$INSTDIR"      
***************
*** 3210,3219 ****
     !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_2052.dll"   "$INSTDIR\Common\TaAfsServerManager_2052.dll" "$INSTDIR"      
     File "..\..\doc\help\zh_CN\afs-cc.CNT"
     File "..\..\doc\help\zh_CN\afs-cc.hlp"
-    File "..\..\doc\help\zh_CN\afs-light.CNT"
-    File "..\..\doc\help\zh_CN\afs-light.hlp"
-    File "..\..\doc\help\zh_CN\afs-nt.CNT"
-    File "..\..\doc\help\zh_CN\afs-nt.HLP"
     File "..\..\doc\help\zh_CN\taafscfg.CNT"
     File "..\..\doc\help\zh_CN\taafscfg.hlp"
     File "..\..\doc\help\zh_CN\taafssvrmgr.CNT"
--- 3227,3232 ----
***************
*** 3256,3261 ****
--- 3269,3279 ----
     ;File "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1028.pdb"
  !endif
  
+    File "..\..\doc\help\zh_TW\afs-light.CNT"
+    File "..\..\doc\help\zh_TW\afs-light.hlp"
+    File "..\..\doc\help\zh_TW\afs-nt.CNT"
+    File "..\..\doc\help\zh_TW\afs-nt.HLP"
+ 
     SetOutPath "$INSTDIR\Common"
     !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_config_1028.dll"           "$INSTDIR\Common\afs_config_1028.dll" "$INSTDIR"       
     !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa_1028.dll"              "$INSTDIR\Common\afs_cpa_1028.dll" "$INSTDIR"       
***************
*** 3268,3277 ****
     !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1028.dll"   "$INSTDIR\Common\TaAfsServerManager_1028.dll" "$INSTDIR"       
     File "..\..\doc\help\zh_TW\afs-cc.CNT"
     File "..\..\doc\help\zh_TW\afs-cc.hlp"
-    File "..\..\doc\help\zh_TW\afs-light.CNT"
-    File "..\..\doc\help\zh_TW\afs-light.hlp"
-    File "..\..\doc\help\zh_TW\afs-nt.CNT"
-    File "..\..\doc\help\zh_TW\afs-nt.HLP"
     File "..\..\doc\help\zh_TW\taafscfg.CNT"
     File "..\..\doc\help\zh_TW\taafscfg.hlp"
     File "..\..\doc\help\zh_TW\taafssvrmgr.CNT"
--- 3286,3291 ----
Index: openafs/src/WINNT/install/wix/NTMakefile
diff -c openafs/src/WINNT/install/wix/NTMakefile:1.9 openafs/src/WINNT/install/wix/NTMakefile:1.9.2.2
*** openafs/src/WINNT/install/wix/NTMakefile:1.9	Mon Mar 20 12:20:01 2006
--- openafs/src/WINNT/install/wix/NTMakefile	Sun Jul  2 21:46:33 2006
***************
*** 13,19 ****
--- 13,21 ----
  MEDIABINDIR = $(MEDIADIR)\Dll
  
  MSIFILE = $(MEDIADIR)\openafs-$(LANG).msi
+ !IF ("$(CPU)" == "i386")
  BINMSIFILE = $(MEDIADIR)\openafs-32bit-tools-$(LANG).msi
+ !ENDIF
  
  WIXINCLUDES = \
  	config.wxi \
***************
*** 25,31 ****
--- 27,35 ----
  	lang\$(LANG)\ui.wxi
  
  WIXOBJ = $(OUT)\openafs-$(LANG).wixobj
+ !IF ("$(CPU)" == "i386")
  BINWIXOBJ  = $(OUT)\openafs-32bit-tools-$(LANG).wixobj
+ !ENDIF
  
  LANGUAGES=en_US de_DE es_ES ja_JP ko_KR pt_BR zh_CN zh_TW
  
***************
*** 38,44 ****
  #	$(MAKE) /f NTMakefile /nologo LANG=%l lang
  #	)
  	$(MAKE) /f NTMakefile /nologo LANG=en_US lang
! 	
  
  lang:: lang_clean $(MSIFILE) $(BINMSIFILE)
  
--- 42,48 ----
  #	$(MAKE) /f NTMakefile /nologo LANG=%l lang
  #	)
  	$(MAKE) /f NTMakefile /nologo LANG=en_US lang
! 
  
  lang:: lang_clean $(MSIFILE) $(BINMSIFILE)
  
***************
*** 74,79 ****
--- 78,84 ----
  		-w0 \
          $(AFSDEV_AUXWIXDEFINES)	openafs.wxs
  
+ !IF ("$(CPU)" == "i386")
  $(BINWIXOBJ): oafwbins.wxs $(WIXINCLUDES)
  	candle -nologo -out $@	\
  		"-dCellName=$(CELLNAME_DEFAULT)" \
***************
*** 93,98 ****
--- 98,104 ----
  		-loc lang\en_US\strings.wxl \
  		$(BINWIXOBJ)
  	dir $(BINMSIFILE)
+ !ENDIF
  
  # Cleanup
  clean::
***************
*** 108,112 ****
--- 114,120 ----
  lang_clean:
  	-$(DEL) $(WIXOBJ)
  	-$(DEL) $(MSIFILE)
+ !IF ("$(CPU)" == "i386")
  	-$(DEL) $(BINWIXOBJ)
  	-$(DEL) $(BINMSIFILE)
+ !ENDIF
Index: openafs/src/WINNT/install/wix/files.wxi
diff -c openafs/src/WINNT/install/wix/files.wxi:1.22.2.1 openafs/src/WINNT/install/wix/files.wxi:1.22.2.4
*** openafs/src/WINNT/install/wix/files.wxi:1.22.2.1	Thu Jun  1 11:35:27 2006
--- openafs/src/WINNT/install/wix/files.wxi	Sun Jul  2 21:46:33 2006
***************
*** 155,166 ****
                  </Component>
  
                  <Directory Id="dirCommon_en_US" Name="en_US" src="$(var.SrcDir)\WINNT\doc\help\en_US\">
-                     <Component Id="cmf_afs_nt_HLP_en_US" Guid="A59FF1E3-984F-47E0-8A65-590A01B6E1C4">
-                         <File Id="fileafs_nt_HLP_en_US" Name="afs-nt.hlp" LongName="afs-nt.hlp" KeyPath="yes" DiskId="1">
- 							<Shortcut Id="scClientHelp_en_US" Directory="dirShortCut" Name="CliHelp.lnk" LongName="Client Help.lnk" Description="$(loc.StrHlpFileDesc)" Icon="ico_Help" IconIndex="0" Show="normal" WorkingDirectory="dirCommon" />
-                         </File>
-                         <File Id="fileafs_nt2_CNT_en_US" Name="afs-nt.cnt" LongName="afs-nt.cnt" DiskId="1"  />
-                     </Component>
  
                      <Component Id="cmp_Lang_en_US" Guid="9B6B5AB2-8BD1-402D-BFC0-63255740A653">
                          <File Id="filetaafssvrmgr_CNT_en_US" Name="taafs.cnt" LongName="taafssvrmgr.cnt" DiskId="1" />
--- 155,160 ----
***************
*** 835,840 ****
--- 829,844 ----
                          <File Id="fileafsdacl_EXE" Name="afsdacl.exe" KeyPath="yes" DiskId="1" />
                      </Component>
    <?ifndef BinsOnly ?>
+ 
+         <!-- en_US help -->
+ 
+                     <Component Id="cmf_afs_nt_HLP_en_US" Guid="E9CAF872-E71B-466E-9560-9E6F542128E4">
+                         <File Id="fileafs_nt_HLP_en_US" Name="afs-nt.hlp" LongName="afs-nt.hlp" KeyPath="yes" DiskId="1" src="$(var.SrcDir)WINNT\doc\help\en_US\afs-nt.hlp">
+ 							<Shortcut Id="scClientHelp_en_US" Directory="dirShortCut" Name="CliHelp.lnk" LongName="Client Help.lnk" Description="$(loc.StrHlpFileDesc)" Icon="ico_Help" IconIndex="0" Show="normal" WorkingDirectory="dirCommon" />
+                         </File>
+                         <File Id="fileafs_nt2_CNT_en_US" Name="afs-nt.cnt" LongName="afs-nt.cnt" DiskId="1" src="$(var.SrcDir)WINNT\doc\help\en_US\afs-nt.cnt" />
+                     </Component>
+ 
                      <Component Win64="$(var.Win64)" Id="cmf_afscreds_EXE" Guid="$(var.cmf_afscreds_EXE_guid)">
                          <File Id="fileafscreds_EXE" Name="afscreds.exe" LongName="afscreds.exe" KeyPath="yes" DiskId="1">
  							<Shortcut Id="scAfsCreds" Directory="dirShortCut" Name="Auth.lnk" LongName="Authentication.lnk" Description="$(loc.StrAfsCredsDesc)" Arguments="[CREDSAUTOINIT] [CREDSRENEWDRMAP] [CREDSIPCHDET] [CREDSQUIET] [CREDSSHOW]" Icon="ico_afscreds" IconIndex="0" Show="normal" WorkingDirectory="dirCommon" />
***************
*** 866,872 ****
                              <ServiceDependency Id="NetBIOS" />
                              <ServiceDependency Id="PNP_TDI" Group="yes"/>
                          </ServiceInstall>
-                         <Environment Id="envClient" Name="PATH" Action="create" System="yes" Permanent="no" Part="last" Separator=";" Value="[AFSDIR]Client\Program" />
                          <RemoveFile Id="removeCache" Directory="WindowsVolume" LongName="AFSCache" Name="AFSCache" On="uninstall" />
                      </Component>
    <?endif?>
--- 870,875 ----
***************
*** 907,912 ****
--- 910,916 ----
  		    <?endif?>
                       <Component Win64="$(var.Win64)" Id="cmf_cmdebug_EXE" Guid="$(var.cmf_cmdebug_EXE_guid)">
                          <File Id="filecmdebug_EXE" Name="cmdebug.exe" LongName="cmdebug.exe" KeyPath="yes" DiskId="1" />
+                         <Environment Id="envClient" Name="PATH" Action="create" System="yes" Permanent="no" Part="last" Separator=";" Value="[AFSDIR]Client\Program" />
                      </Component>
    <?ifndef BinsOnly?>
   		    <Component Win64="$(var.Win64)" Id="cmf_afs_cpa_CPL" Guid="$(var.cmf_afs_cpa_CPL_guid)">
***************
*** 945,951 ****
--- 949,1069 ----
    <?endif?>
                      </Component>
                  <?endif?>
+                 </Directory> <!-- /Program -->
+             </Directory> <!-- /Client -->
+   <?ifndef BinsOnly ?>
+             <Directory Id="dirServer" Name="Server">
+                 <Directory Id="dirusr" Name="usr">
+                     <Directory Id="dirafs" Name="afs">
+                         <Directory Id="dirbin" Name="bin" src="$(var.ServerDir)">
+                              <Component Win64="$(var.Win64)" Id="cmf_vlserver_EXE" Guid="$(var.cmf_vlserver_EXE_guid)">
+                                 <File Id="filevlserver_EXE" Name="vlser.exe" LongName="vlserver.exe" KeyPath="yes" DiskId="1" />
+                             </Component>
+                              <Component Win64="$(var.Win64)" Id="cmf_volinfo_EXE" Guid="$(var.cmf_volinfo_EXE_guid)">
+                                 <File Id="filevolinfo_EXE" Name="volin.exe" LongName="volinfo.exe" KeyPath="yes" DiskId="1" />
+                             </Component>
+                              <Component Win64="$(var.Win64)" Id="cmf_volserver_EXE" Guid="$(var.cmf_volserver_EXE_guid)">
+                                 <File Id="filevolserver_EXE" Name="volse.exe" LongName="volserver.exe" KeyPath="yes" DiskId="1" />
+                             </Component>
+                              <Component Win64="$(var.Win64)" Id="cmf_afskill_EXE" Guid="$(var.cmf_afskill_EXE_guid)">
+                                 <File Id="fileafskill_EXE" Name="afski.exe" LongName="afskill.exe" KeyPath="yes" DiskId="1" />
+                             </Component>
+                              <Component Win64="$(var.Win64)" Id="cmf_afssvrcfg_EXE" Guid="$(var.cmf_afssvrcfg_EXE_guid)">
+                                 <File Id="fileafssvrcfg_EXE" Name="afssv.exe" LongName="afssvrcfg.exe" KeyPath="yes" DiskId="1">
+ 									<Shortcut Id="scSvrCfgWizard" Directory="dirShortCut" Name="SvrCfgWz.lnk" LongName="Server Configuration Wizard.lnk" Description="$(loc.StrCfgWzdDesc)" Arguments="/wizard" Icon="ico_afssvrcfg" IconIndex="0" Show="normal" WorkingDirectory="dirCommon" />
+                                 </File>
+                             </Component>
+ 			    <?if $(env.CPU) = "i386"?>
+                                     <Component Win64="$(var.Win64)" Id="cmf_asetkey_EXE" Guid="$(var.cmf_asetkey_EXE_guid)">
+                                 	<File Id="fileasetkey_EXE" Name="asetk.exe" LongName="asetkey.exe" KeyPath="yes" DiskId="1" />
+ 	                            </Component>
+ 			    <?endif?>
+                              <Component Win64="$(var.Win64)" Id="cmf_bosctlsvc_EXE" Guid="$(var.cmf_bosctlsvc_EXE_guid)">
+                                 <File Id="filebosctlsvc_EXE" Name="bosct.exe" LongName="bosctlsvc.exe" KeyPath="yes" DiskId="1" />
+                                 <ServiceControl Id="TransarcAFSServer" Name="TransarcAFSServer" Stop="both" Remove="both" Wait="yes" />
+                                 <ServiceInstall Id="svc_Server" Name="TransarcAFSServer" DisplayName="OpenAFS Server" Type="ownProcess" Start="auto" ErrorControl="normal" Description="Manages AFS server processes" Interactive="yes">
+ 									<!-- ServiceConfig does nothing 
+                                     <ServiceConfig FirstFailureActionType="restart" RestartServiceDelayInSeconds="5" SecondFailureActionType="restart" ThirdFailureActionType="none"/>
+                                     -->
+                                 </ServiceInstall>
+                             </Component>
+                             <Component Win64="$(var.Win64)" Id="cmf_bosserver_EXE" Guid="$(var.cmf_bosserver_EXE_guid)">
+                                 <File Id="filebosserver_EXE" Name="bosse.exe" LongName="bosserver.exe" KeyPath="yes" DiskId="1" />
+                             </Component>
+                             <Component Win64="$(var.Win64)" Id="cmf_buserver_EXE" Guid="$(var.cmf_buserver_EXE_guid)">
+                                 <File Id="filebuserver_EXE" Name="buser.exe" LongName="buserver.exe" KeyPath="yes" DiskId="1" />
+                             </Component>
+                             <Component Win64="$(var.Win64)" Id="cmf_fileserver_EXE" Guid="$(var.cmf_fileserver_EXE_guid)">
+                                 <File Id="filefileserver_EXE" Name="files.exe" LongName="fileserver.exe" KeyPath="yes" DiskId="1" />
+                             </Component>
+                             <Component Win64="$(var.Win64)" Id="cmf_fms_EXE" Guid="$(var.cmf_fms_EXE_guid)">
+                                 <File Id="filefms_EXE" Name="fms.exe" LongName="fms.exe" KeyPath="yes" DiskId="1" src="$(var.EtcDir)\fms.exe"/>
+                             </Component>
+                             <Component Win64="$(var.Win64)" Id="cmf_butc_EXE" Guid="$(var.cmf_butc_EXE_guid)">
+                                 <File Id="filebutc_EXE" Name="butc.exe" LongName="butc.exe" KeyPath="yes" DiskId="1" src="$(var.EtcDir)\butc.exe"/>
+                             </Component>
+                             <Component Win64="$(var.Win64)" Id="cmf_kaserver_EXE" Guid="$(var.cmf_kaserver_EXE_guid)">
+                                 <File Id="filekaserver_EXE" Name="kaser.exe" LongName="kaserver.exe" KeyPath="yes" DiskId="1" />
+                             </Component>
+                             <Component Win64="$(var.Win64)" Id="cmf_ptserver_EXE" Guid="$(var.cmf_ptserver_EXE_guid)">
+                                 <File Id="fileptserver_EXE" Name="ptser.exe" LongName="ptserver.exe" KeyPath="yes" DiskId="1" />
+                             </Component>
+                             <Component Win64="$(var.Win64)" Id="cmf_salvager_EXE" Guid="$(var.cmf_salvager_EXE_guid)">
+                                 <File Id="filesalvager_EXE" Name="salva.exe" LongName="salvager.exe" KeyPath="yes" DiskId="1" />
+                             </Component>
+                             <Component Win64="$(var.Win64)" Id="cmf_upclient_EXE" Guid="$(var.cmf_upclient_EXE_guid)">
+                                 <File Id="fileupclient_EXE" Name="upcli.exe" LongName="upclient.exe" KeyPath="yes" DiskId="1" />
+                             </Component>
+                             <Component Win64="$(var.Win64)" Id="cmf_upserver_EXE" Guid="$(var.cmf_upserver_EXE_guid)">
+                                 <File Id="fileupserver_EXE" Name="upser.exe" LongName="upserver.exe" KeyPath="yes" DiskId="1" />
+                             </Component>
+ 							<Component Win64="$(var.Win64)" Id="cmf_afsserver_CPL" Guid="$(var.cmf_afsserver_CPL_guid)">
+ 								<File Id="fileafsserver_CPL" Name="afsserve.cpl" LongName="afsserver.cpl" KeyPath="yes" DiskId="1"/>
+ 						        <Registry Root="HKLM" Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Control Panel\Cpls" Name="AFS Server CPL" Type="string" Value="[#fileafsserver_CPL]" Id="reg_Server30" />
+ 							</Component>
+ 
+                             <Component Id="cmp_Server_Program" Guid="8C4D0351-8EBF-4192-BF63-DCB3AADF4115" KeyPath="yes">
+                                 <CreateFolder />
+                                 <CreateFolder Directory="dirlog" />
+                                 <CreateFolder Directory="diretc" />
+                                 <CreateFolder Directory="dirlocal" />
+                             </Component>
+                             
+                         <?ifdef DebugSyms?>
+                             <Component Win64="$(var.Win64)" Id="cmp_Server_Program_Debug" Guid="$(var.cmp_Server_Program_Debug_guid)">
+                                 <File Id="filevlserver_PDB" Name="vlser.pdb" LongName="vlserver.pdb" DiskId="1" />
+                                 <File Id="filevolinfo_PDB" Name="volin.pdb" LongName="volinfo.pdb" DiskId="1" />
+                                 <File Id="filevolserver_PDB" Name="volse.pdb" LongName="volserver.pdb" DiskId="1" />
+                                 <File Id="fileafskill_PDB" Name="afski.pdb" LongName="afskill.pdb" DiskId="1" />
+                                 <File Id="fileafssvrcfg_PDB" Name="afssv.pdb" LongName="afssvrcfg.pdb" DiskId="1" />
+ 				<?if $(env.CPU) = "i386"?>
+                                 	<File Id="fileasetkey_PDB" Name="asetk.pdb" LongName="asetkey.pdb" DiskId="1" />
+ 				<?endif?>
+                                 <File Id="filebosctlsvc_PDB" Name="bosct.pdb" LongName="bosctlsvc.pdb" DiskId="1" />
+                                 <File Id="filebosserver_PDB" Name="bosse.pdb" LongName="bosserver.pdb" DiskId="1" />
+                                 <File Id="filebuserver_PDB" Name="buser.pdb" LongName="buserver.pdb" DiskId="1" />
+                                 <File Id="filefileserver_PDB" Name="files.pdb" LongName="fileserver.pdb" DiskId="1" />
+                                 <File Id="filefms_PDB" Name="fms.pdb" LongName="fms.pdb" DiskId="1" src="$(var.EtcDir)\fms.pdb"/>
+                                 <File Id="filebutc_PDB" Name="butc.pdb" LongName="butc.pdb" DiskId="1" src="$(var.EtcDir)\butc.pdb"/>
+                                 <File Id="filekaserver_PDB" Name="kaser.pdb" LongName="kaserver.pdb" DiskId="1" />
+                                 <File Id="fileptserver_PDB" Name="ptser.pdb" LongName="ptserver.pdb" DiskId="1" />
+                                 <File Id="filesalvager_PDB" Name="salva.pdb" LongName="salvager.pdb" DiskId="1" />
+                                 <File Id="fileupclient_PDB" Name="upcli.pdb" LongName="upclient.pdb" DiskId="1" />
+                                 <File Id="fileupserver_PDB" Name="upser.pdb" LongName="upserver.pdb" DiskId="1" />
+ 								<File Id="fileafsserver_PDB" Name="afsserve.pdb" LongName="afsserver.pdb" KeyPath="yes" DiskId="1"/>
+                             </Component>
+                         <?endif?>
+                         
+                         </Directory>
+                         <Directory Id="dirlog" Name="log" />
+                         <Directory Id="diretc" Name="etc" />
+                         <Directory Id="dirlocal" Name="local" />
+                     </Directory>
+                 </Directory>
+             </Directory> <!-- Server -->
+   <?endif?>
    <?ifndef BinsOnly?>                  
+             <Directory Id="dirSDK" Name="SDK">
                      <Directory Id="dirSample" Name="Sample">
                          <Component Id="cmp_SDK_Sample" Guid="F9373E95-F410-4AA5-AA79-07C11EE00334">
                              <File Id="filetoken_C" Name="token.c" LongName="token.c" KeyPath="yes" DiskId="1" src="$(var.SrcDir)WINNT\afsd\sample\token.c"/>
***************
*** 1262,1380 ****
                              </Component>
                          </Directory>
                      </Directory>
!   <?endif?>
!                 </Directory> <!-- /Program -->
!             </Directory> <!-- /Client -->
!   <?ifndef BinsOnly ?>
!             <Directory Id="dirServer" Name="Server">
!                 <Directory Id="dirusr" Name="usr">
!                     <Directory Id="dirafs" Name="afs">
!                         <Directory Id="dirbin" Name="bin" src="$(var.ServerDir)">
!                              <Component Win64="$(var.Win64)" Id="cmf_vlserver_EXE" Guid="$(var.cmf_vlserver_EXE_guid)">
!                                 <File Id="filevlserver_EXE" Name="vlser.exe" LongName="vlserver.exe" KeyPath="yes" DiskId="1" />
!                             </Component>
!                              <Component Win64="$(var.Win64)" Id="cmf_volinfo_EXE" Guid="$(var.cmf_volinfo_EXE_guid)">
!                                 <File Id="filevolinfo_EXE" Name="volin.exe" LongName="volinfo.exe" KeyPath="yes" DiskId="1" />
!                             </Component>
!                              <Component Win64="$(var.Win64)" Id="cmf_volserver_EXE" Guid="$(var.cmf_volserver_EXE_guid)">
!                                 <File Id="filevolserver_EXE" Name="volse.exe" LongName="volserver.exe" KeyPath="yes" DiskId="1" />
!                             </Component>
!                              <Component Win64="$(var.Win64)" Id="cmf_afskill_EXE" Guid="$(var.cmf_afskill_EXE_guid)">
!                                 <File Id="fileafskill_EXE" Name="afski.exe" LongName="afskill.exe" KeyPath="yes" DiskId="1" />
!                             </Component>
!                              <Component Win64="$(var.Win64)" Id="cmf_afssvrcfg_EXE" Guid="$(var.cmf_afssvrcfg_EXE_guid)">
!                                 <File Id="fileafssvrcfg_EXE" Name="afssv.exe" LongName="afssvrcfg.exe" KeyPath="yes" DiskId="1">
! 									<Shortcut Id="scSvrCfgWizard" Directory="dirShortCut" Name="SvrCfgWz.lnk" LongName="Server Configuration Wizard.lnk" Description="$(loc.StrCfgWzdDesc)" Arguments="/wizard" Icon="ico_afssvrcfg" IconIndex="0" Show="normal" WorkingDirectory="dirCommon" />
!                                 </File>
!                             </Component>
! 			    <?if $(env.CPU) = "i386"?>
!                                     <Component Win64="$(var.Win64)" Id="cmf_asetkey_EXE" Guid="$(var.cmf_asetkey_EXE_guid)">
!                                 	<File Id="fileasetkey_EXE" Name="asetk.exe" LongName="asetkey.exe" KeyPath="yes" DiskId="1" />
! 	                            </Component>
! 			    <?endif?>
!                              <Component Win64="$(var.Win64)" Id="cmf_bosctlsvc_EXE" Guid="$(var.cmf_bosctlsvc_EXE_guid)">
!                                 <File Id="filebosctlsvc_EXE" Name="bosct.exe" LongName="bosctlsvc.exe" KeyPath="yes" DiskId="1" />
!                                 <ServiceControl Id="TransarcAFSServer" Name="TransarcAFSServer" Stop="both" Remove="both" Wait="yes" />
!                                 <ServiceInstall Id="svc_Server" Name="TransarcAFSServer" DisplayName="OpenAFS Server" Type="ownProcess" Start="auto" ErrorControl="normal" Description="Manages AFS server processes" Interactive="yes">
! 									<!-- ServiceConfig does nothing 
!                                     <ServiceConfig FirstFailureActionType="restart" RestartServiceDelayInSeconds="5" SecondFailureActionType="restart" ThirdFailureActionType="none"/>
!                                     -->
!                                 </ServiceInstall>
!                             </Component>
!                             <Component Win64="$(var.Win64)" Id="cmf_bosserver_EXE" Guid="$(var.cmf_bosserver_EXE_guid)">
!                                 <File Id="filebosserver_EXE" Name="bosse.exe" LongName="bosserver.exe" KeyPath="yes" DiskId="1" />
!                             </Component>
!                             <Component Win64="$(var.Win64)" Id="cmf_buserver_EXE" Guid="$(var.cmf_buserver_EXE_guid)">
!                                 <File Id="filebuserver_EXE" Name="buser.exe" LongName="buserver.exe" KeyPath="yes" DiskId="1" />
!                             </Component>
!                             <Component Win64="$(var.Win64)" Id="cmf_fileserver_EXE" Guid="$(var.cmf_fileserver_EXE_guid)">
!                                 <File Id="filefileserver_EXE" Name="files.exe" LongName="fileserver.exe" KeyPath="yes" DiskId="1" />
!                             </Component>
!                             <Component Win64="$(var.Win64)" Id="cmf_fms_EXE" Guid="$(var.cmf_fms_EXE_guid)">
!                                 <File Id="filefms_EXE" Name="fms.exe" LongName="fms.exe" KeyPath="yes" DiskId="1" src="$(var.EtcDir)\fms.exe"/>
!                             </Component>
!                             <Component Win64="$(var.Win64)" Id="cmf_butc_EXE" Guid="$(var.cmf_butc_EXE_guid)">
!                                 <File Id="filebutc_EXE" Name="butc.exe" LongName="butc.exe" KeyPath="yes" DiskId="1" src="$(var.EtcDir)\butc.exe"/>
!                             </Component>
!                             <Component Win64="$(var.Win64)" Id="cmf_kaserver_EXE" Guid="$(var.cmf_kaserver_EXE_guid)">
!                                 <File Id="filekaserver_EXE" Name="kaser.exe" LongName="kaserver.exe" KeyPath="yes" DiskId="1" />
!                             </Component>
!                             <Component Win64="$(var.Win64)" Id="cmf_ptserver_EXE" Guid="$(var.cmf_ptserver_EXE_guid)">
!                                 <File Id="fileptserver_EXE" Name="ptser.exe" LongName="ptserver.exe" KeyPath="yes" DiskId="1" />
!                             </Component>
!                             <Component Win64="$(var.Win64)" Id="cmf_salvager_EXE" Guid="$(var.cmf_salvager_EXE_guid)">
!                                 <File Id="filesalvager_EXE" Name="salva.exe" LongName="salvager.exe" KeyPath="yes" DiskId="1" />
!                             </Component>
!                             <Component Win64="$(var.Win64)" Id="cmf_upclient_EXE" Guid="$(var.cmf_upclient_EXE_guid)">
!                                 <File Id="fileupclient_EXE" Name="upcli.exe" LongName="upclient.exe" KeyPath="yes" DiskId="1" />
!                             </Component>
!                             <Component Win64="$(var.Win64)" Id="cmf_upserver_EXE" Guid="$(var.cmf_upserver_EXE_guid)">
!                                 <File Id="fileupserver_EXE" Name="upser.exe" LongName="upserver.exe" KeyPath="yes" DiskId="1" />
!                             </Component>
! 							<Component Win64="$(var.Win64)" Id="cmf_afsserver_CPL" Guid="$(var.cmf_afsserver_CPL_guid)">
! 								<File Id="fileafsserver_CPL" Name="afsserve.cpl" LongName="afsserver.cpl" KeyPath="yes" DiskId="1"/>
! 						        <Registry Root="HKLM" Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Control Panel\Cpls" Name="AFS Server CPL" Type="string" Value="[#fileafsserver_CPL]" Id="reg_Server30" />
! 							</Component>
! 
!                             <Component Id="cmp_Server_Program" Guid="8C4D0351-8EBF-4192-BF63-DCB3AADF4115" KeyPath="yes">
!                                 <CreateFolder />
!                                 <CreateFolder Directory="dirlog" />
!                                 <CreateFolder Directory="diretc" />
!                                 <CreateFolder Directory="dirlocal" />
!                             </Component>
!                             
!                         <?ifdef DebugSyms?>
!                             <Component Win64="$(var.Win64)" Id="cmp_Server_Program_Debug" Guid="$(var.cmp_Server_Program_Debug_guid)">
!                                 <File Id="filevlserver_PDB" Name="vlser.pdb" LongName="vlserver.pdb" DiskId="1" />
!                                 <File Id="filevolinfo_PDB" Name="volin.pdb" LongName="volinfo.pdb" DiskId="1" />
!                                 <File Id="filevolserver_PDB" Name="volse.pdb" LongName="volserver.pdb" DiskId="1" />
!                                 <File Id="fileafskill_PDB" Name="afski.pdb" LongName="afskill.pdb" DiskId="1" />
!                                 <File Id="fileafssvrcfg_PDB" Name="afssv.pdb" LongName="afssvrcfg.pdb" DiskId="1" />
! 				<?if $(env.CPU) = "i386"?>
!                                 	<File Id="fileasetkey_PDB" Name="asetk.pdb" LongName="asetkey.pdb" DiskId="1" />
! 				<?endif?>
!                                 <File Id="filebosctlsvc_PDB" Name="bosct.pdb" LongName="bosctlsvc.pdb" DiskId="1" />
!                                 <File Id="filebosserver_PDB" Name="bosse.pdb" LongName="bosserver.pdb" DiskId="1" />
!                                 <File Id="filebuserver_PDB" Name="buser.pdb" LongName="buserver.pdb" DiskId="1" />
!                                 <File Id="filefileserver_PDB" Name="files.pdb" LongName="fileserver.pdb" DiskId="1" />
!                                 <File Id="filefms_PDB" Name="fms.pdb" LongName="fms.pdb" DiskId="1" src="$(var.EtcDir)\fms.pdb"/>
!                                 <File Id="filebutc_PDB" Name="butc.pdb" LongName="butc.pdb" DiskId="1" src="$(var.EtcDir)\butc.pdb"/>
!                                 <File Id="filekaserver_PDB" Name="kaser.pdb" LongName="kaserver.pdb" DiskId="1" />
!                                 <File Id="fileptserver_PDB" Name="ptser.pdb" LongName="ptserver.pdb" DiskId="1" />
!                                 <File Id="filesalvager_PDB" Name="salva.pdb" LongName="salvager.pdb" DiskId="1" />
!                                 <File Id="fileupclient_PDB" Name="upcli.pdb" LongName="upclient.pdb" DiskId="1" />
!                                 <File Id="fileupserver_PDB" Name="upser.pdb" LongName="upserver.pdb" DiskId="1" />
! 								<File Id="fileafsserver_PDB" Name="afsserve.pdb" LongName="afsserver.pdb" KeyPath="yes" DiskId="1"/>
!                             </Component>
!                         <?endif?>
!                         
!                         </Directory>
!                         <Directory Id="dirlog" Name="log" />
!                         <Directory Id="diretc" Name="etc" />
!                         <Directory Id="dirlocal" Name="local" />
!                     </Directory>
!                 </Directory>
!             </Directory> <!-- Server -->
    <?endif?>
  
          </Directory> <!-- AFS -->
--- 1380,1386 ----
                              </Component>
                          </Directory>
                      </Directory>
!             </Directory> <!-- SDK -->
    <?endif?>
  
          </Directory> <!-- AFS -->
Index: openafs/src/WINNT/install/wix/registry.wxi
diff -c openafs/src/WINNT/install/wix/registry.wxi:1.10 openafs/src/WINNT/install/wix/registry.wxi:1.10.2.1
*** openafs/src/WINNT/install/wix/registry.wxi:1.10	Mon Mar 20 12:20:01 2006
--- openafs/src/WINNT/install/wix/registry.wxi	Mon Jun 26 01:48:31 2006
***************
*** 207,236 ****
      </Component>
  <?else?>
      <Component Id="rcm_BinsOnly_Parm" Guid="$(var.rcm_client_guid)" Win64="$(var.Win64)">
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries" KeyPath="yes" Id="reg_Control_Center2" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries" Action="createKeyAndRemoveKeyOnUninstall" Id="reg_Control_Center" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\CurrentVersion" Action="createKeyAndRemoveKeyOnUninstall" Id="reg_Control_Center3" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\CurrentVersion" Name="MinorVersion" Type="integer" Value="$(var.VersionMinor)" Id="reg_Control_Center4" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\CurrentVersion" Id="reg_Control_Center5" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\CurrentVersion" Name="PatchLevel" Type="integer" Value="$(var.VersionPatch)" Id="reg_Control_Center6" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\CurrentVersion" Name="MajorVersion" Type="integer" Value="$(var.VersionMajor)" Id="reg_Control_Center7" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\CurrentVersion" Name="ReleaseType" Type="string" Value="$(var.ReleaseType)" Id="reg_Control_Center8" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\CurrentVersion" Name="Software Type" Type="string" Value="File System" Id="reg_Control_Center9" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\CurrentVersion" Name="PathName" Type="string" Value="[AFSDIR]Control Center" Id="reg_Control_Center10" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\CurrentVersion" Name="VersionString" Type="string" Value="$(var.NumericVersion)" Id="reg_Control_Center11" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\CurrentVersion" Name="InstallDateString" Type="string" Value="$(var.InstallTimestamp)" Id="reg_Control_Center13" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\CurrentVersion" Name="Description" Type="string" Value="$(loc.StrAFSCCDesc)" Id="reg_Control_Center14" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\$(var.NumericVersion)" Action="createKeyAndRemoveKeyOnUninstall" Id="reg_Control_Center16" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\$(var.NumericVersion)" Name="MinorVersion" Type="integer" Value="$(var.VersionMinor)" Id="reg_Control_Center17" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\$(var.NumericVersion)" Id="reg_Control_Center18" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\$(var.NumericVersion)" Name="PatchLevel" Type="integer" Value="$(var.VersionPatch)" Id="reg_Control_Center19" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\$(var.NumericVersion)" Name="MajorVersion" Type="integer" Value="$(var.VersionMajor)" Id="reg_Control_Center20" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\$(var.NumericVersion)" Name="ReleaseType" Type="string" Value="$(var.ReleaseType)" Id="reg_Control_Center21" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\$(var.NumericVersion)" Name="Software Type" Type="string" Value="File System" Id="reg_Control_Center22" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\$(var.NumericVersion)" Name="PathName" Type="string" Value="[AFSDIR]Control Center" Id="reg_Control_Center23" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\$(var.NumericVersion)" Name="VersionString" Type="string" Value="$(var.NumericVersion)" Id="reg_Control_Center24" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\$(var.NumericVersion)" Name="InstallDateString" Type="string" Value="$(var.InstallTimestamp)" Id="reg_Control_Center26" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\$(var.NumericVersion)" Name="Description" Type="string" Value="$(loc.StrAFSCCDesc)" Id="reg_Control_Center27" />
      </Component>
  <?endif?>
  </Include>
--- 207,236 ----
      </Component>
  <?else?>
      <Component Id="rcm_BinsOnly_Parm" Guid="$(var.rcm_client_guid)" Win64="$(var.Win64)">
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries" KeyPath="yes" Id="reg_Client_Bins2" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries" Action="createKeyAndRemoveKeyOnUninstall" Id="reg_Client_Bins" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\CurrentVersion" Action="createKeyAndRemoveKeyOnUninstall" Id="reg_Client_Bins3" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\CurrentVersion" Name="MinorVersion" Type="integer" Value="$(var.VersionMinor)" Id="reg_Client_Bins4" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\CurrentVersion" Id="reg_Client_Bins5" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\CurrentVersion" Name="PatchLevel" Type="integer" Value="$(var.VersionPatch)" Id="reg_Client_Bins6" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\CurrentVersion" Name="MajorVersion" Type="integer" Value="$(var.VersionMajor)" Id="reg_Client_Bins7" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\CurrentVersion" Name="ReleaseType" Type="string" Value="$(var.ReleaseType)" Id="reg_Client_Bins8" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\CurrentVersion" Name="Software Type" Type="string" Value="File System" Id="reg_Client_Bins9" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\CurrentVersion" Name="PathName" Type="string" Value="[AFSDIR]Client" Id="reg_Client_Bins10" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\CurrentVersion" Name="VersionString" Type="string" Value="$(var.NumericVersion)" Id="reg_Client_Bins11" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\CurrentVersion" Name="InstallDateString" Type="string" Value="$(var.InstallTimestamp)" Id="reg_Client_Bins13" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\CurrentVersion" Name="Description" Type="string" Value="$(loc.StrAFSCCDesc)" Id="reg_Client_Bins14" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\$(var.NumericVersion)" Action="createKeyAndRemoveKeyOnUninstall" Id="reg_Client_Bins16" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\$(var.NumericVersion)" Name="MinorVersion" Type="integer" Value="$(var.VersionMinor)" Id="reg_Client_Bins17" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\$(var.NumericVersion)" Id="reg_Client_Bins18" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\$(var.NumericVersion)" Name="PatchLevel" Type="integer" Value="$(var.VersionPatch)" Id="reg_Client_Bins19" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\$(var.NumericVersion)" Name="MajorVersion" Type="integer" Value="$(var.VersionMajor)" Id="reg_Client_Bins20" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\$(var.NumericVersion)" Name="ReleaseType" Type="string" Value="$(var.ReleaseType)" Id="reg_Client_Bins21" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\$(var.NumericVersion)" Name="Software Type" Type="string" Value="File System" Id="reg_Client_Bins22" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\$(var.NumericVersion)" Name="PathName" Type="string" Value="[AFSDIR]Client" Id="reg_Client_Bins23" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\$(var.NumericVersion)" Name="VersionString" Type="string" Value="$(var.NumericVersion)" Id="reg_Client_Bins24" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\$(var.NumericVersion)" Name="InstallDateString" Type="string" Value="$(var.InstallTimestamp)" Id="reg_Client_Bins26" />
!         <Registry Root="HKLM" Key="SOFTWARE\TransarcCorporation\AFS Client 32-Bit Binaries\$(var.NumericVersion)" Name="Description" Type="string" Value="$(loc.StrAFSCCDesc)" Id="reg_Client_Bins27" />
      </Component>
  <?endif?>
  </Include>
Index: openafs/src/afs/afs_pioctl.c
diff -c openafs/src/afs/afs_pioctl.c:1.110 openafs/src/afs/afs_pioctl.c:1.110.2.1
*** openafs/src/afs/afs_pioctl.c:1.110	Thu Mar  2 17:34:27 2006
--- openafs/src/afs/afs_pioctl.c	Thu Jun 15 11:52:59 2006
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_pioctl.c,v 1.110 2006/03/02 22:34:27 rees 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.1 2006/06/15 15:52:59 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #ifdef AFS_OBSD_ENV
***************
*** 2175,2185 ****
  DECL_PIOCTL(PGetCacheSize)
  {
      afs_int32 results[MAXGCSTATS];
! 
      AFS_STATCNT(PGetCacheSize);
      memset((char *)results, 0, sizeof(results));
      results[0] = afs_cacheBlocks;
      results[1] = afs_blocksUsed;
      memcpy(aout, (char *)results, sizeof(results));
      *aoutSize = sizeof(results);
      return 0;
--- 2175,2225 ----
  DECL_PIOCTL(PGetCacheSize)
  {
      afs_int32 results[MAXGCSTATS];
!     afs_int32 flags;
!     register struct dcache * tdc;
!     int i, size;
!     
      AFS_STATCNT(PGetCacheSize);
+ 
+     if (sizeof(afs_int32) == ainSize){
+ 	memcpy((char *)&flags, ain, sizeof(afs_int32));
+     } else if (0 == ainSize){ 
+ 	flags = 0;
+     } else {
+ 	return EINVAL;
+     }
+     
      memset((char *)results, 0, sizeof(results));
      results[0] = afs_cacheBlocks;
      results[1] = afs_blocksUsed;
+     results[2] = afs_cacheFiles;
+     
+     if (1 == flags){
+         for (i = 0; i < afs_cacheFiles; i++) {
+ 	    if (afs_indexFlags[i] & IFFree) results[3]++;
+ 	}
+     } else if (2 == flags){
+         for (i = 0; i < afs_cacheFiles; i++) {
+ 	    if (afs_indexFlags[i] & IFFree) results[3]++;
+ 	    if (afs_indexFlags[i] & IFEverUsed) results[4]++;
+ 	    if (afs_indexFlags[i] & IFDataMod) results[5]++;
+ 	    if (afs_indexFlags[i] & IFDirtyPages) results[6]++;
+ 	    if (afs_indexFlags[i] & IFAnyPages) results[7]++;
+ 	    if (afs_indexFlags[i] & IFDiscarded) results[8]++;
+ 
+ 	    tdc = afs_indexTable[i];
+ 	    if (tdc){
+ 	        results[9]++;
+ 	        size = tdc->validPos;
+ 	        if ( 0 < size && size < (1<<12) ) results[10]++;
+     	        else if (size < (1<<14) ) results[11]++;
+ 	        else if (size < (1<<16) ) results[12]++;
+ 	        else if (size < (1<<18) ) results[13]++;
+ 	        else if (size < (1<<20) ) results[14]++;
+ 	        else if (size >= (1<<20) ) results[15]++;
+ 	    }
+         }
+     }
      memcpy(aout, (char *)results, sizeof(results));
      *aoutSize = sizeof(results);
      return 0;
Index: openafs/src/afs/afs_util.c
diff -c openafs/src/afs/afs_util.c:1.28.2.1 openafs/src/afs/afs_util.c:1.28.2.2
*** openafs/src/afs/afs_util.c:1.28.2.1	Thu Jun  1 11:49:56 2006
--- openafs/src/afs/afs_util.c	Thu Jun 15 11:45:19 2006
***************
*** 16,22 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_util.c,v 1.28.2.1 2006/06/01 15:49:56 shadow Exp $");
  
  #include "afs/stds.h"
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
--- 16,22 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_util.c,v 1.28.2.2 2006/06/15 15:45:19 shadow Exp $");
  
  #include "afs/stds.h"
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
***************
*** 601,613 ****
  	if(offset == 64){
  #if defined(AFSBIG_ENDIAN)
  	    int i;
! 	    afs_uint32 current[16];
  	    struct x32 *us = (struct x32*)m->save;
  	    for(i = 0; i < 8; i++){
! 		current[2*i+0] = swap_u_int32_t(us[i].a);
! 		current[2*i+1] = swap_u_int32_t(us[i].b);
  	    }
! 	    calc(m, current);
  #else
  	    calc(m, (afs_uint32*)m->save);
  #endif
--- 601,613 ----
  	if(offset == 64){
  #if defined(AFSBIG_ENDIAN)
  	    int i;
! 	    afs_uint32 temp[16];
  	    struct x32 *us = (struct x32*)m->save;
  	    for(i = 0; i < 8; i++){
! 		temp[2*i+0] = swap_u_int32_t(us[i].a);
! 		temp[2*i+1] = swap_u_int32_t(us[i].b);
  	    }
! 	    calc(m, temp);
  #else
  	    calc(m, (afs_uint32*)m->save);
  #endif
Index: openafs/src/afs/SOLARIS/osi_vfsops.c
diff -c openafs/src/afs/SOLARIS/osi_vfsops.c:1.18 openafs/src/afs/SOLARIS/osi_vfsops.c:1.18.14.1
*** openafs/src/afs/SOLARIS/osi_vfsops.c:1.18	Thu Jun 24 13:38:24 2004
--- openafs/src/afs/SOLARIS/osi_vfsops.c	Fri Jun 30 10:07:31 2006
***************
*** 14,20 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/SOLARIS/osi_vfsops.c,v 1.18 2004/06/24 17:38:24 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/SOLARIS/osi_vfsops.c,v 1.18.14.1 2006/06/30 14:07:31 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 277,283 ****
  int (*afs_orig_ioctl) (), (*afs_orig_ioctl32) ();
  int (*afs_orig_setgroups) (), (*afs_orig_setgroups32) ();
  
- struct streamtab *udp_infop = 0;
  #ifndef AFS_SUN510_ENV
  struct ill_s *ill_g_headp = 0;
  #endif
--- 277,282 ----
***************
*** 297,302 ****
--- 296,315 ----
  
  extern Afs_syscall();
  
+ static void *
+ do_mod_lookup(const char * mod, const char * sym)
+ {
+     void * ptr;
+ 
+     ptr = modlookup(mod, sym);
+     if (ptr == NULL) {
+         afs_warn("modlookup failed for symbol '%s' in module '%s'\n",
+ 		 sym, mod);
+     }
+ 
+     return ptr;
+ }
+ 
  #ifdef AFS_SUN510_ENV
  afsinit(int fstype, char *dummy)
  #else
***************
*** 318,381 ****
      afs_orig_ioctl32 = sysent32[SYS_ioctl].sy_call;
      sysent32[SYS_setgroups].sy_callc = afs_xsetgroups;
      sysent32[SYS_ioctl].sy_call = afs_xioctl;
! #endif
  
  #ifdef AFS_SUN510_ENV
      vfs_setfsops(fstype, afs_vfsops_template, &afs_vfsopsp);
      afsfstype = fstype;
      vn_make_ops("afs", afs_vnodeops_template, &afs_ops);
! #else
      vfsswp->vsw_vfsops = &Afs_vfsops;
      afsfstype = fstype;
! #endif
  
  
! #if	!defined(AFS_NONFSTRANS)
!     nfs_rfsdisptab_v2 = (int (*)())modlookup("nfssrv", "rfsdisptab_v2");
!     if (!nfs_rfsdisptab_v2) {
! 	afs_warn("warning : rfsdisptab_v2 NOT FOUND\n");
!     }
!     if (nfs_rfsdisptab_v2) {
! 	nfs_acldisptab_v2 = (int (*)())modlookup("nfssrv", "acldisptab_v2");
! 	if (!nfs_acldisptab_v2) {
! 	    afs_warn("warning : acldisptab_v2 NOT FOUND\n");
! 	} else {
  	    afs_xlatorinit_v2(nfs_rfsdisptab_v2, nfs_acldisptab_v2);
  	}
      }
!     nfs_rfsdisptab_v3 = (int (*)())modlookup("nfssrv", "rfsdisptab_v3");
!     if (!nfs_rfsdisptab_v3) {
! 	afs_warn("warning : rfsdisptab_v3 NOT FOUND\n");
!     }
!     if (nfs_rfsdisptab_v3) {
! 	nfs_acldisptab_v3 = (int (*)())modlookup("nfssrv", "acldisptab_v3");
! 	if (!nfs_acldisptab_v3) {
! 	    afs_warn("warning : acldisptab_v3 NOT FOUND\n");
! 	} else {
  	    afs_xlatorinit_v3(nfs_rfsdisptab_v3, nfs_acldisptab_v3);
  	}
      }
  
!     nfs_checkauth = (int (*)())modlookup("nfssrv", "checkauth");
!     if (!nfs_checkauth)
! 	afs_warn("nfs_checkauth not initialised");
! #endif
!     ufs_iallocp = (int (*)())modlookup("ufs", "ufs_ialloc");
!     ufs_iupdatp = (void (*)())modlookup("ufs", "ufs_iupdat");
!     ufs_igetp = (int (*)())modlookup("ufs", "ufs_iget");
!     ufs_itimes_nolockp = (void (*)())modlookup("ufs", "ufs_itimes_nolock");
!     udp_infop = (struct streamtab *)modlookup("udp", "udpinfo");
! #ifdef AFS_SUN510_ENV
!     if (!ufs_iallocp || !ufs_iupdatp || !ufs_itimes_nolockp || !ufs_igetp
! 	|| !udp_infop)
! 	afs_warn("AFS to UFS mapping cannot be fully initialised\n");
! #else
!     ill_g_headp = (struct ill_s *)modlookup("ip", "ill_g_head");
  
!     if (!ufs_iallocp || !ufs_iupdatp || !ufs_itimes_nolockp || !ufs_igetp
! 	|| !udp_infop || !ill_g_headp)
  	afs_warn("AFS to UFS mapping cannot be fully initialised\n");
! #endif
  
      afs_sinited = 1;
      return 0;
--- 331,379 ----
      afs_orig_ioctl32 = sysent32[SYS_ioctl].sy_call;
      sysent32[SYS_setgroups].sy_callc = afs_xsetgroups;
      sysent32[SYS_ioctl].sy_call = afs_xioctl;
! #endif /* AFS_SUN57_64BIT_ENV */
  
  #ifdef AFS_SUN510_ENV
      vfs_setfsops(fstype, afs_vfsops_template, &afs_vfsopsp);
      afsfstype = fstype;
      vn_make_ops("afs", afs_vnodeops_template, &afs_ops);
! #else /* !AFS_SUN510_ENV */
      vfsswp->vsw_vfsops = &Afs_vfsops;
      afsfstype = fstype;
! #endif /* !AFS_SUN510_ENV */
  
  
! #if !defined(AFS_NONFSTRANS)
!     nfs_rfsdisptab_v2 = (int (*)()) do_mod_lookup("nfssrv", "rfsdisptab_v2");
!     if (nfs_rfsdisptab_v2 != NULL) {
! 	nfs_acldisptab_v2 = (int (*)()) do_mod_lookup("nfssrv", "acldisptab_v2");
! 	if (nfs_acldisptab_v2 != NULL) {
  	    afs_xlatorinit_v2(nfs_rfsdisptab_v2, nfs_acldisptab_v2);
  	}
      }
!     nfs_rfsdisptab_v3 = (int (*)()) do_mod_lookup("nfssrv", "rfsdisptab_v3");
!     if (nfs_rfsdisptab_v3 != NULL) {
! 	nfs_acldisptab_v3 = (int (*)()) do_mod_lookup("nfssrv", "acldisptab_v3");
! 	if (nfs_acldisptab_v3 != NULL) {
  	    afs_xlatorinit_v3(nfs_rfsdisptab_v3, nfs_acldisptab_v3);
  	}
      }
  
!     nfs_checkauth = (int (*)()) do_mod_lookup("nfssrv", "checkauth");
! #endif /* !AFS_NONFSTRANS */
  
!     ufs_iallocp = (int (*)()) do_mod_lookup("ufs", "ufs_ialloc");
!     ufs_iupdatp = (void (*)()) do_mod_lookup("ufs", "ufs_iupdat");
!     ufs_igetp = (int (*)()) do_mod_lookup("ufs", "ufs_iget");
!     ufs_itimes_nolockp = (void (*)()) do_mod_lookup("ufs", "ufs_itimes_nolock");
! 
!     if (!ufs_iallocp || !ufs_iupdatp || !ufs_itimes_nolockp || !ufs_igetp) {
  	afs_warn("AFS to UFS mapping cannot be fully initialised\n");
!     }
! 
! #if !defined(AFS_SUN510_ENV)
!     ill_g_headp = (struct ill_s *) do_mod_lookup("ip", "ill_g_head");
! #endif /* !AFS_SUN510_ENV */
  
      afs_sinited = 1;
      return 0;
Index: openafs/src/afs/SOLARIS/osi_vnodeops.c
diff -c openafs/src/afs/SOLARIS/osi_vnodeops.c:1.28 openafs/src/afs/SOLARIS/osi_vnodeops.c:1.28.2.1
*** openafs/src/afs/SOLARIS/osi_vnodeops.c:1.28	Mon Feb 13 13:38:37 2006
--- openafs/src/afs/SOLARIS/osi_vnodeops.c	Mon Jul  3 14:54:34 2006
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/SOLARIS/osi_vnodeops.c,v 1.28 2006/02/13 18:38:37 shadow Exp $");
  
  /*
   * SOLARIS/osi_vnodeops.c
--- 11,17 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/SOLARIS/osi_vnodeops.c,v 1.28.2.1 2006/07/03 18:54:34 jaltman Exp $");
  
  /*
   * SOLARIS/osi_vnodeops.c
***************
*** 1698,1708 ****
  	    struct vnode *vp = AFSTOV(avcp), *pvp = AFSTOV(andp);
  	    
  	    mutex_enter(&vp->v_lock);
! 	    kmem_free(vp->v_path, strlen(vp->v_path) + 1);
! 	    vp->v_path = NULL;
  	    mutex_exit(&vp->v_lock);
! 	    VN_SETPATH(afs_globalVp, pvp, vp, aname2, strlen(aname2));
! 	    
  	    AFS_RELE(avcp);
  	}
      }
--- 1698,1710 ----
  	    struct vnode *vp = AFSTOV(avcp), *pvp = AFSTOV(andp);
  	    
  	    mutex_enter(&vp->v_lock);
! 	    if (vp->v_path != NULL) {
! 		kmem_free(vp->v_path, strlen(vp->v_path) + 1);
! 		vp->v_path = NULL;
! 	    }
  	    mutex_exit(&vp->v_lock);
! 	    vn_setpath(afs_globalVp, pvp, vp, aname2, strlen(aname2));
! 
  	    AFS_RELE(avcp);
  	}
      }
Index: openafs/src/afsd/afsd.c
diff -c openafs/src/afsd/afsd.c:1.60 openafs/src/afsd/afsd.c:1.60.2.1
*** openafs/src/afsd/afsd.c:1.60	Thu Mar 23 10:35:53 2006
--- openafs/src/afsd/afsd.c	Thu Jun 15 11:53:00 2006
***************
*** 58,64 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/afsd/afsd.c,v 1.60 2006/03/23 15:35:53 shadow Exp $");
  
  #define VFS 1
  
--- 58,64 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/afsd/afsd.c,v 1.60.2.1 2006/06/15 15:53:00 shadow Exp $");
  
  #define VFS 1
  
***************
*** 2396,2402 ****
  		param5, param6, param7);
  #endif
  
!     if (afsd_verbose)
  	printf("SScall(%d, %d, %d)=%d ", AFS_SYSCALL, AFSCALL_CALL, param1,
  	       error);
      return (error);
--- 2396,2402 ----
  		param5, param6, param7);
  #endif
  
!     if (afsd_debug)
  	printf("SScall(%d, %d, %d)=%d ", AFS_SYSCALL, AFSCALL_CALL, param1,
  	       error);
      return (error);
Index: openafs/src/afsweb/weblog.c
diff -c openafs/src/afsweb/weblog.c:1.8 openafs/src/afsweb/weblog.c:1.8.14.1
*** openafs/src/afsweb/weblog.c:1.8	Tue Jul 15 19:14:35 2003
--- openafs/src/afsweb/weblog.c	Mon Jul  3 15:07:13 2006
***************
*** 25,31 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/afsweb/weblog.c,v 1.8 2003/07/15 23:14:35 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 25,31 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/afsweb/weblog.c,v 1.8.14.1 2006/07/03 19:07:13 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 666,672 ****
       */
      reply_p = (adk_reply_ptr) 0;
      error_p = (adk_error_ptr) 0;
!     code = ubik_Call(ADK_GetTicket, ubik_handle, 0,	/* Ubik flags */
  		     name,	/* IN:  Principal: must be exact DCE principal */
  		     nonce,	/* IN:  Input nonce */
  		     lifetime,	/* IN:  lifetime */
--- 666,672 ----
       */
      reply_p = (adk_reply_ptr) 0;
      error_p = (adk_error_ptr) 0;
!     code = ubik_ADK_GetTicket(ubik_handle, 0,	/* Ubik flags */
  		     name,	/* IN:  Principal: must be exact DCE principal */
  		     nonce,	/* IN:  Input nonce */
  		     lifetime,	/* IN:  lifetime */
Index: openafs/src/auth/NTMakefile
diff -c openafs/src/auth/NTMakefile:1.10 openafs/src/auth/NTMakefile:1.10.4.1
*** openafs/src/auth/NTMakefile:1.10	Sun Nov 20 20:56:36 2005
--- openafs/src/auth/NTMakefile	Sun Jul  2 21:06:01 2006
***************
*** 112,118 ****
  
  install_headers: $(INCFILES)
  
! install: $(AFSAUTH_LIBFILE) $(OUT)\setkey.exe # $(COPYAUTH_EXEFILE) $(AFSAUTH_KRB_LIBFILE)
  
  install9x: install
  
--- 112,118 ----
  
  install_headers: $(INCFILES)
  
! install: $(AFSAUTH_LIBFILE) $(AFSAUTH_KRB_LIBFILE) $(OUT)\setkey.exe # $(COPYAUTH_EXEFILE)
  
  install9x: install
  
Index: openafs/src/bozo/NTMakefile
diff -c openafs/src/bozo/NTMakefile:1.10 openafs/src/bozo/NTMakefile:1.10.4.1
*** openafs/src/bozo/NTMakefile:1.10	Sun Nov 20 20:56:38 2005
--- openafs/src/bozo/NTMakefile	Tue Jul  4 02:28:23 2006
***************
*** 118,126 ****
  ############################################################################
  # Definitions for generating files via RXGEN
  
! bosint.h bosint.cs.c bosint.ss.c bosint.xdr.c: bosint.xg
! 	$(RXGEN) -x $**
  
  
  ############################################################################
  # Definitions for generating files via COMPILE_ET
--- 118,134 ----
  ############################################################################
  # Definitions for generating files via RXGEN
  
! bosint.cs.c: bosint.xg bosint.h
! 	$(RXGEN) -x -C -o $@ bosint.xg
  
+ bosint.ss.c: bosint.xg bosint.h
+ 	$(RXGEN) -x -S -o $@ bosint.xg
+ 
+ bosint.xdr.c: bosint.xg bosint.h
+ 	$(RXGEN) -x -c -o $@ bosint.xg
+ 
+ bosint.h: bosint.xg
+ 	$(RXGEN) -x -h -o $@ bosint.xg
  
  ############################################################################
  # Definitions for generating files via COMPILE_ET
Index: openafs/src/bozo/bosserver.c
diff -c openafs/src/bozo/bosserver.c:1.32 openafs/src/bozo/bosserver.c:1.32.2.2
*** openafs/src/bozo/bosserver.c:1.32	Fri Mar 17 14:54:36 2006
--- openafs/src/bozo/bosserver.c	Tue Jun 20 16:37:10 2006
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bozo/bosserver.c,v 1.32 2006/03/17 19:54:36 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bozo/bosserver.c,v 1.32.2.2 2006/06/20 20:37:10 jaltman Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 71,76 ****
--- 71,81 ----
  
  struct ktime bozo_nextRestartKT, bozo_nextDayKT;
  int bozo_newKTs;
+ int rxBind = 0;
+ 
+ #define ADDRSPERSITE 16         /* Same global is in rx/rx_user.c */
+ afs_uint32 SHostAddrs[ADDRSPERSITE];
+ 
  #ifdef BOS_RESTRICTED_MODE
  int bozo_isrestricted = 0;
  int bozo_restdisable = 0;
***************
*** 719,724 ****
--- 724,730 ----
      int i;
      char namebuf[AFSDIR_PATH_MAX];
      int rxMaxMTU = -1;
+     afs_uint32 host = htonl(INADDR_ANY);
  #ifndef AFS_NT40_ENV
      int nofork = 0;
      struct stat sb;
***************
*** 813,818 ****
--- 819,827 ----
  	    bozo_isrestricted = 1;
  	}
  #endif
+ 	else if (strcmp(argv[code], "-rxbind") == 0) {
+ 	    rxBind = 1;
+ 	}
  	else if (!strcmp(argv[i], "-rxmaxmtu")) {
  	    if ((i + 1) >= argc) {
  		fprintf(stderr, "missing argument for -rxmaxmtu\n"); 
***************
*** 864,877 ****
  #ifndef AFS_NT40_ENV
  	    printf("Usage: bosserver [-noauth] [-log] "
  		   "[-auditlog <log path>] "
! 		   "[-rxmaxmtu <bytes>] "
  		   "[-syslog[=FACILITY]] "
  		   "[-enable_peer_stats] [-enable_process_stats] "
  		   "[-nofork] " "[-help]\n");
  #else
  	    printf("Usage: bosserver [-noauth] [-log] "
  		   "[-auditlog <log path>] "
! 		   "[-rxmaxmtu <bytes>] "
  		   "[-enable_peer_stats] [-enable_process_stats] "
  		   "[-help]\n");
  #endif
--- 873,886 ----
  #ifndef AFS_NT40_ENV
  	    printf("Usage: bosserver [-noauth] [-log] "
  		   "[-auditlog <log path>] "
! 		   "[-rxmaxmtu <bytes>] [-rxbind] "
  		   "[-syslog[=FACILITY]] "
  		   "[-enable_peer_stats] [-enable_process_stats] "
  		   "[-nofork] " "[-help]\n");
  #else
  	    printf("Usage: bosserver [-noauth] [-log] "
  		   "[-auditlog <log path>] "
! 		   "[-rxmaxmtu <bytes>] [-rxbind] "
  		   "[-enable_peer_stats] [-enable_process_stats] "
  		   "[-help]\n");
  #endif
***************
*** 1028,1034 ****
  	rx_SetMaxMTU(rxMaxMTU);
      }
  
!     tservice = rx_NewService( /* port */ 0, /* service id */ 1,
  			     /*service name */ "bozo",
  			     /* security classes */
  			     bozo_rxsc,
--- 1037,1062 ----
  	rx_SetMaxMTU(rxMaxMTU);
      }
  
!     if (rxBind) {
! 	afs_int32 ccode;
! #ifndef AFS_NT40_ENV
!         if (AFSDIR_SERVER_NETRESTRICT_FILEPATH || 
!             AFSDIR_SERVER_NETINFO_FILEPATH) {
!             char reason[1024];
!             ccode = parseNetFiles(SHostAddrs, NULL, NULL,
!                                            ADDRSPERSITE, reason,
!                                            AFSDIR_SERVER_NETINFO_FILEPATH,
!                                            AFSDIR_SERVER_NETRESTRICT_FILEPATH);
!         } else 
! #endif	
! 	{
!             ccode = rx_getAllAddr(SHostAddrs, ADDRSPERSITE);
!         }
!         if (ccode == 1) 
!             host = SHostAddrs[0];
!     }
! 
!     tservice = rx_NewServiceHost(host,  /* port */ 0, /* service id */ 1,
  			     /*service name */ "bozo",
  			     /* security classes */
  			     bozo_rxsc,
***************
*** 1038,1045 ****
      rx_SetStackSize(tservice, BOZO_LWP_STACKSIZE);	/* so gethostbyname works (in cell stuff) */
  
      tservice =
! 	rx_NewService(0, RX_STATS_SERVICE_ID, "rpcstats", bozo_rxsc, 3,
! 		      RXSTATS_ExecuteRequest);
      rx_SetMinProcs(tservice, 2);
      rx_SetMaxProcs(tservice, 4);
      rx_StartServer(1);		/* donate this process */
--- 1066,1073 ----
      rx_SetStackSize(tservice, BOZO_LWP_STACKSIZE);	/* so gethostbyname works (in cell stuff) */
  
      tservice =
! 	rx_NewServiceHost(host, 0, RX_STATS_SERVICE_ID, "rpcstats", bozo_rxsc,
! 			  3, RXSTATS_ExecuteRequest);
      rx_SetMinProcs(tservice, 2);
      rx_SetMaxProcs(tservice, 4);
      rx_StartServer(1);		/* donate this process */
Index: openafs/src/bubasics/NTMakefile
diff -c openafs/src/bubasics/NTMakefile:1.4 openafs/src/bubasics/NTMakefile:1.4.14.1
*** openafs/src/bubasics/NTMakefile:1.4	Fri Nov 21 03:00:24 2003
--- openafs/src/bubasics/NTMakefile	Tue Jul  4 02:28:23 2006
***************
*** 46,57 ****
  ############################################################################
  # rxgen on butc.xg and bumon.xg
  
! butc.h butc.xdr.c butc.ss.c butc.cs.c: butc.xg
! 	$(RXGEN) $**
  
! bumon.h bumon.xdr.c bumon.ss.c bumon.cs.c: bumon.xg
! 	$(RXGEN) $**
  
  
  ############################################################################
  # compile_et on butm_errs.et and butc_errs.et 
--- 46,74 ----
  ############################################################################
  # rxgen on butc.xg and bumon.xg
  
! butc.xdr.c: butc.xg butc.h
! 	$(RXGEN) -c -o $@ butc.xg
  
! butc.ss.c: butc.xg butc.h
! 	$(RXGEN) -S -o $@ butc.xg
  
+ butc.cs.c: butc.xg butc.h
+ 	$(RXGEN) -C -o $@ butc.xg
+ 
+ butc.h: butc.xg
+ 	$(RXGEN) -h -o $@ butc.xg
+ 
+ bumon.xdr.c: bumon.xg bumon.h
+ 	$(RXGEN) -c -o $@ bumon.xg
+ 
+ bumon.ss.c: bumon.xg bumon.h
+ 	$(RXGEN) -S -o $@ bumon.xg
+ 
+ bumon.cs.c: bumon.xg bumon.h
+ 	$(RXGEN) -C -o $@ bumon.xg
+ 
+ bumon.h: bumon.xg
+ 	$(RXGEN) -h -o $@ bumon.xg
  
  ############################################################################
  # compile_et on butm_errs.et and butc_errs.et 
Index: openafs/src/bucoord/dump_sched.c
diff -c openafs/src/bucoord/dump_sched.c:1.9 openafs/src/bucoord/dump_sched.c:1.9.6.1
*** openafs/src/bucoord/dump_sched.c:1.9	Sun Apr  3 14:48:16 2005
--- openafs/src/bucoord/dump_sched.c	Mon Jul  3 15:07:14 2006
***************
*** 17,23 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/dump_sched.c,v 1.9 2005/04/03 18:48:16 shadow Exp $");
  
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
--- 17,23 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/dump_sched.c,v 1.9.6.1 2006/07/03 19:07:14 shadow Exp $");
  
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
***************
*** 579,585 ****
  
      /* fetch the version number */
      code =
! 	ubik_Call(BUDB_GetTextVersion, uhptr->uh_client, 0, ctPtr->textType,
  		  &ctPtr->textVersion);
      if (code)
  	ERROR(code);
--- 579,585 ----
  
      /* fetch the version number */
      code =
! 	ubik_BUDB_GetTextVersion(uhptr->uh_client, 0, ctPtr->textType,
  		  &ctPtr->textVersion);
      if (code)
  	ERROR(code);
Index: openafs/src/bucoord/tape_hosts.c
diff -c openafs/src/bucoord/tape_hosts.c:1.7 openafs/src/bucoord/tape_hosts.c:1.7.14.1
*** openafs/src/bucoord/tape_hosts.c:1.7	Tue Jul 15 19:14:47 2003
--- openafs/src/bucoord/tape_hosts.c	Mon Jul  3 15:07:14 2006
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/tape_hosts.c,v 1.7 2003/07/15 23:14:47 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/tape_hosts.c,v 1.7.14.1 2006/07/03 19:07:14 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 397,403 ****
  
      /* fetch the version number */
      code =
! 	ubik_Call(BUDB_GetTextVersion, uhptr->uh_client, 0, ctPtr->textType,
  		  &ctPtr->textVersion);
      if (code)
  	ERROR(code);
--- 397,403 ----
  
      /* fetch the version number */
      code =
! 	ubik_BUDB_GetTextVersion(uhptr->uh_client, 0, ctPtr->textType,
  		  &ctPtr->textVersion);
      if (code)
  	ERROR(code);
Index: openafs/src/bucoord/vol_sets.c
diff -c openafs/src/bucoord/vol_sets.c:1.11 openafs/src/bucoord/vol_sets.c:1.11.6.1
*** openafs/src/bucoord/vol_sets.c:1.11	Sun Apr  3 14:48:16 2005
--- openafs/src/bucoord/vol_sets.c	Mon Jul  3 15:07:14 2006
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/vol_sets.c,v 1.11 2005/04/03 18:48:16 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/vol_sets.c,v 1.11.6.1 2006/07/03 19:07:14 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 708,714 ****
  
      /* fetch the version number */
      code =
! 	ubik_Call(BUDB_GetTextVersion, uhptr->uh_client, 0, ctPtr->textType,
  		  &ctPtr->textVersion);
      if (code)
  	ERROR(code);
--- 708,714 ----
  
      /* fetch the version number */
      code =
! 	ubik_BUDB_GetTextVersion(uhptr->uh_client, 0, ctPtr->textType,
  		  &ctPtr->textVersion);
      if (code)
  	ERROR(code);
Index: openafs/src/bucoord/volstub.c
diff -c openafs/src/bucoord/volstub.c:1.6 openafs/src/bucoord/volstub.c:1.6.14.1
*** openafs/src/bucoord/volstub.c:1.6	Sun Dec  7 17:49:19 2003
--- openafs/src/bucoord/volstub.c	Mon Jul  3 15:07:14 2006
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/volstub.c,v 1.6 2003/12/07 22:49:19 jaltman Exp $");
  
  #include <sys/types.h>
  #include <stdio.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/volstub.c,v 1.6.14.1 2006/07/03 19:07:14 shadow Exp $");
  
  #include <sys/types.h>
  #include <stdio.h>
***************
*** 45,51 ****
      afs_int32 code = 0;
  
      code =
! 	ubik_Call(VL_GetEntryByID, uclient, 0, volID, volType, vldbEntryPtr);
      return (code);
  }
  
--- 45,51 ----
      afs_int32 code = 0;
  
      code =
! 	ubik_VL_GetEntryByID(uclient, 0, volID, volType, vldbEntryPtr);
      return (code);
  }
  
Index: openafs/src/budb/Makefile.in
diff -c openafs/src/budb/Makefile.in:1.10 openafs/src/budb/Makefile.in:1.10.14.1
*** openafs/src/budb/Makefile.in:1.10	Tue Jul  1 15:14:29 2003
--- openafs/src/budb/Makefile.in	Mon Jul  3 15:07:14 2006
***************
*** 74,80 ****
  	${CC} ${LDFLAGS} -o budb_server $(SERVER_OBJS) ${LIBS} ${XLIBS}
  
  budb.cs.c: budb.rg
! 	${RXGEN} -C -o $@ ${srcdir}/budb.rg
  
  budb.ss.c: budb.rg
  	${RXGEN} -S -o $@ ${srcdir}/budb.rg
--- 74,80 ----
  	${CC} ${LDFLAGS} -o budb_server $(SERVER_OBJS) ${LIBS} ${XLIBS}
  
  budb.cs.c: budb.rg
! 	${RXGEN} -u -C -o $@ ${srcdir}/budb.rg
  
  budb.ss.c: budb.rg
  	${RXGEN} -S -o $@ ${srcdir}/budb.rg
***************
*** 83,89 ****
  	${RXGEN} -c -o $@ ${srcdir}/budb.rg
  
  budb.h: budb.rg
! 	${RXGEN} -h -o $@ ${srcdir}/budb.rg
  
  budb.cs.c: budb.h
  budb.xdr.c: budb.h
--- 83,89 ----
  	${RXGEN} -c -o $@ ${srcdir}/budb.rg
  
  budb.h: budb.rg
! 	${RXGEN} -u -h -o $@ ${srcdir}/budb.rg
  
  budb.cs.c: budb.h
  budb.xdr.c: budb.h
Index: openafs/src/budb/NTMakefile
diff -c openafs/src/budb/NTMakefile:1.10 openafs/src/budb/NTMakefile:1.10.4.1
*** openafs/src/budb/NTMakefile:1.10	Sun Nov 20 20:56:41 2005
--- openafs/src/budb/NTMakefile	Tue Jul  4 02:28:24 2006
***************
*** 92,99 ****
  
  ############################################################################
  # rxgen budb.rg
! budb.xdr.c budb.cs.c budb.ss.c 	$(INCFILEDIR)\budb.h: budb.rg
! 	$(RXGEN) $**
  	$(COPY) budb.h $(INCFILEDIR)\budb.h 
  
  ############################################################################
--- 92,111 ----
  
  ############################################################################
  # rxgen budb.rg
! 
! budb.cs.c: budb.rg budb.h
! 	$(RXGEN) -u -C -o $@ budb.rg
! 
! budb.ss.c: budb.rg budb.h
! 	$(RXGEN) -S -o $@ budb.rg
! 
! budb.xdr.c: budb.rg budb.h
! 	$(RXGEN) -c -o $@ budb.rg
! 
! budb.h: budb.rg
! 	$(RXGEN) -u -h -o budb.h budb.rg
! 
! $(INCFILEDIR)\budb.h: budb.h
  	$(COPY) budb.h $(INCFILEDIR)\budb.h 
  
  ############################################################################
Index: openafs/src/budb/server.c
diff -c openafs/src/budb/server.c:1.16 openafs/src/budb/server.c:1.16.2.2
*** openafs/src/budb/server.c:1.16	Wed Feb  1 11:09:18 2006
--- openafs/src/budb/server.c	Tue Jun 20 16:37:11 2006
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/budb/server.c,v 1.16 2006/02/01 16:09:18 shadow Exp $");
  
  #include <fcntl.h>
  #include <sys/stat.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/budb/server.c,v 1.16.2.2 2006/06/20 20:37:11 jaltman Exp $");
  
  #include <fcntl.h>
  #include <sys/stat.h>
***************
*** 76,81 ****
--- 76,86 ----
  /* debugging control */
  int debugging = 0;
  
+ int rxBind = 0;
+ 
+ #define ADDRSPERSITE 16         /* Same global is in rx/rx_user.c */
+ afs_uint32 SHostAddrs[ADDRSPERSITE];
+ 
  #if defined(AFS_PTHREAD_ENV)
  char *
  threadNum(void)
***************
*** 357,367 ****
      struct afsconf_cell cellinfo;
      time_t currentTime;
      afs_int32 code = 0;
  
      char  clones[MAXHOSTSPERCELL];
  
- 	
- 	
      struct rx_service *tservice;
      struct rx_securityClass *sca[3];
  
--- 362,371 ----
      struct afsconf_cell cellinfo;
      time_t currentTime;
      afs_int32 code = 0;
+     afs_uint32 host = ntohl(INADDR_ANY);
  
      char  clones[MAXHOSTSPERCELL];
  
      struct rx_service *tservice;
      struct rx_securityClass *sca[3];
  
***************
*** 517,522 ****
--- 521,547 ----
  
      rx_SetRxDeadTime(60);	/* 60 seconds inactive before timeout */
  
+     if (rxBind) {
+ 	afs_int32 ccode;
+ #ifndef AFS_NT40_ENV
+         if (AFSDIR_SERVER_NETRESTRICT_FILEPATH || 
+             AFSDIR_SERVER_NETINFO_FILEPATH) {
+             char reason[1024];
+             ccode = parseNetFiles(SHostAddrs, NULL, NULL,
+                                            ADDRSPERSITE, reason,
+                                            AFSDIR_SERVER_NETINFO_FILEPATH,
+                                            AFSDIR_SERVER_NETRESTRICT_FILEPATH);
+         } else 
+ #endif	
+ 	{
+             ccode = rx_getAllAddr(SHostAddrs, ADDRSPERSITE);
+         }
+         if (ccode == 1) {
+             host = SHostAddrs[0];
+ 	    rx_InitHost(host, htons(AFSCONF_BUDBPORT));
+ 	}
+     }
+ 
      code = ubik_ServerInitByInfo (globalConfPtr->myHost,
  				  htons(AFSCONF_BUDBPORT), 
  				  &cellinfo,
***************
*** 540,546 ****
      rx_SetNoJumbo();
  
      tservice =
! 	rx_NewService(0, BUDB_SERVICE, "BackupDatabase", sca, 3,
  		      BUDB_ExecuteRequest);
      if (tservice == (struct rx_service *)0) {
  	LogError(0, "Could not create backup database rx service\n");
--- 565,571 ----
      rx_SetNoJumbo();
  
      tservice =
! 	rx_NewServiceHost(host, 0, BUDB_SERVICE, "BackupDatabase", sca, 3,
  		      BUDB_ExecuteRequest);
      if (tservice == (struct rx_service *)0) {
  	LogError(0, "Could not create backup database rx service\n");
Index: openafs/src/butc/dbentries.c
diff -c openafs/src/butc/dbentries.c:1.8 openafs/src/butc/dbentries.c:1.8.14.1
*** openafs/src/butc/dbentries.c:1.8	Sun Dec  7 17:49:23 2003
--- openafs/src/butc/dbentries.c	Sat Jul  1 01:02:49 2006
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/butc/dbentries.c,v 1.8 2003/12/07 22:49:23 jaltman Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/butc/dbentries.c,v 1.8.14.1 2006/07/01 05:02:49 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
***************
*** 46,54 ****
  int dbWatcherinprogress;
  
  afs_int32
! threadEntryDir(anEntry, size, type)
!      char *anEntry;
!      afs_int32 size, type;
  {
      dlqlinkP entryPtr;
      char *entry = NULL;
--- 46,52 ----
  int dbWatcherinprogress;
  
  afs_int32
! threadEntryDir(char *anEntry, afs_int32 size, afs_int32 type)
  {
      dlqlinkP entryPtr;
      char *entry = NULL;
***************
*** 91,99 ****
   */
  
  afs_int32
! threadEntry(anEntry, size, type)
!      char *anEntry;
!      afs_int32 size, type;
  {
      dlqlinkP entryPtr;
      char *entry = NULL;
--- 89,95 ----
   */
  
  afs_int32
! threadEntry(char *anEntry, afs_int32 size, afs_int32 type)
  {
      dlqlinkP entryPtr;
      char *entry = NULL;
***************
*** 132,139 ****
  /* ------------------------------------------------------------------ */
  
  afs_int32
! useDump(dumpEntryPtr)
!      struct budb_dumpEntry *dumpEntryPtr;
  {
      afs_int32 code = 0;
  
--- 128,134 ----
  /* ------------------------------------------------------------------ */
  
  afs_int32
! useDump(struct budb_dumpEntry *dumpEntryPtr)
  {
      afs_int32 code = 0;
  
***************
*** 147,154 ****
   *     Creates a dump entry (finished) and puts it onto the savedEntries list.
   */
  afs_int32
! finishDump(aDumpEntryPtr)
!      struct budb_dumpEntry *aDumpEntryPtr;
  {
      afs_int32 code = 0;
  
--- 142,148 ----
   *     Creates a dump entry (finished) and puts it onto the savedEntries list.
   */
  afs_int32
! finishDump(struct budb_dumpEntry *aDumpEntryPtr)
  {
      afs_int32 code = 0;
  
***************
*** 163,178 ****
   *     Creates a tape entry and puts it onto the savedEntries list.
   */
  afs_int32
! useTape(aTapeEntryPtr, dumpID, tapename, tapeSeq, useCount, written,
! 	expiration, tapepos)
!      struct budb_tapeEntry *aTapeEntryPtr;
!      afs_int32 dumpID;
!      char *tapename;
!      afs_int32 tapeSeq;
!      afs_int32 useCount;
!      Date written;
!      Date expiration;
!      afs_int32 tapepos;
  {
      afs_int32 code = 0;
  
--- 157,163 ----
   *     Creates a tape entry and puts it onto the savedEntries list.
   */
  afs_int32
! useTape(struct budb_tapeEntry *aTapeEntryPtr, afs_int32 dumpID, char *tapename, afs_int32 tapeSeq, afs_int32 useCount, Date written, Date expiration, afs_int32 tapepos)
  {
      afs_int32 code = 0;
  
***************
*** 197,205 ****
   *     Creates a tape entry (finished) and puts it onto the savedEntries list.
   */
  afs_int32
! finishTape(aTapeEntryPtr, useKBytes)
!      struct budb_tapeEntry *aTapeEntryPtr;
!      afs_int32 useKBytes;
  {
      afs_int32 code = 0;
  
--- 182,188 ----
   *     Creates a tape entry (finished) and puts it onto the savedEntries list.
   */
  afs_int32
! finishTape(struct budb_tapeEntry *aTapeEntryPtr, afs_int32 useKBytes)
  {
      afs_int32 code = 0;
  
***************
*** 217,234 ****
   *     Creates a volume entry and puts it onto the savedEntries list.
   */
  afs_int32
! addVolume(aVolEntryPtr, dumpID, tapename, volname, volid, cloneDate, startPos,
! 	  volBytes, fragment, flags)
!      struct budb_volumeEntry *aVolEntryPtr;
!      afs_int32 dumpID;
!      char *tapename;
!      char *volname;
!      afs_int32 volid;
!      Date cloneDate;
!      afs_int32 startPos;
!      afs_int32 volBytes;
!      int fragment;
!      afs_int32 flags;
  {
      afs_int32 code = 0;
      int allo = 0;
--- 200,206 ----
   *     Creates a volume entry and puts it onto the savedEntries list.
   */
  afs_int32
! addVolume(struct budb_volumeEntry *aVolEntryPtr, afs_int32 dumpID, char *tapename, char *volname, afs_int32 volid, Date cloneDate, afs_int32 startPos, afs_int32 volBytes, int fragment, afs_int32 flags)
  {
      afs_int32 code = 0;
      int allo = 0;
***************
*** 270,277 ****
   *     and tapes and volumes should not be added to the DB.
   */
  afs_int32
! flushSavedEntries(status)
!      afs_int32 status;
  {
      dlqlinkP entryPtr;
      struct budb_tapeEntry *tapePtr;
--- 242,248 ----
   *     and tapes and volumes should not be added to the DB.
   */
  afs_int32
! flushSavedEntries(afs_int32 status)
  {
      dlqlinkP entryPtr;
      struct budb_tapeEntry *tapePtr;
***************
*** 318,323 ****
--- 289,295 ----
      return (code);
  }
  
+ void
  waitDbWatcher()
  {
      int message = 0;
***************
*** 342,347 ****
--- 314,320 ----
  #define MAXVOLUMESTOADD 100
  int addvolumes = 1;
  
+ void
  dbWatcher()
  {
      dlqlinkP entryPtr;
Index: openafs/src/butc/list.c
diff -c openafs/src/butc/list.c:1.8 openafs/src/butc/list.c:1.8.14.1
*** openafs/src/butc/list.c:1.8	Sun Dec  7 17:49:23 2003
--- openafs/src/butc/list.c	Sat Jul  1 01:02:49 2006
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/butc/list.c,v 1.8 2003/12/07 22:49:23 jaltman Exp $");
  
  #ifndef AFS_NT40_ENV
  #include <sys/time.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/butc/list.c,v 1.8.14.1 2006/07/01 05:02:49 shadow Exp $");
  
  #ifndef AFS_NT40_ENV
  #include <sys/time.h>
***************
*** 40,60 ****
  }
  
  
- #ifdef notdef
- void static
- DisplayNode(nodePtr)
-      struct dumpNode *nodePtr;
- {
-     TapeLog(99, nodePtr->dumpId, "Created dumpNode");
-     return;
- 
- }
- #endif
- 
  /* initialize the node list used to keep track of the active dumps */
  void
! InitNodeList(portOffset)
!      afs_int32 portOffset;
  {
      maxTaskID = (portOffset * 1000) + 1;	/* this is the first task id alotted */
      headNode.taskID = -1;
--- 40,48 ----
  }
  
  
  /* initialize the node list used to keep track of the active dumps */
  void
! InitNodeList(afs_int32 portOffset)
  {
      maxTaskID = (portOffset * 1000) + 1;	/* this is the first task id alotted */
      headNode.taskID = -1;
***************
*** 74,81 ****
   */
  
  void
! CreateNode(newNode)
!      struct dumpNode **newNode;
  {
      /* get space */
      *newNode = (struct dumpNode *)(malloc(sizeof(struct dumpNode)));
--- 62,68 ----
   */
  
  void
! CreateNode(struct dumpNode **newNode)
  {
      /* get space */
      *newNode = (struct dumpNode *)(malloc(sizeof(struct dumpNode)));
***************
*** 91,98 ****
  
  /* free the space allotted to the node with <taskID> */
  void
! FreeNode(taskID)
!      afs_int32 taskID;
  {
      struct dumpNode *oldPtr, *newPtr, *curPtr;
      int done;
--- 78,84 ----
  
  /* free the space allotted to the node with <taskID> */
  void
! FreeNode(afs_int32 taskID)
  {
      struct dumpNode *oldPtr, *newPtr, *curPtr;
      int done;
***************
*** 132,140 ****
  }
  
  afs_int32
! GetNthNode(aindex, aresult)
!      afs_int32 aindex;
!      afs_int32 *aresult;
  {
      register struct dumpNode *tn;
      register int i;
--- 118,124 ----
  }
  
  afs_int32
! GetNthNode(afs_int32 aindex, afs_int32 *aresult)
  {
      register struct dumpNode *tn;
      register int i;
***************
*** 155,163 ****
  
  /* return the node with <taskID> into <resultNode> */
  afs_int32
! GetNode(taskID, resultNode)
!      afs_int32 taskID;
!      struct dumpNode **resultNode;
  {
      struct dumpNode *tmpPtr;
      int done;
--- 139,145 ----
  
  /* return the node with <taskID> into <resultNode> */
  afs_int32
! GetNode(afs_int32 taskID, struct dumpNode **resultNode)
  {
      struct dumpNode *tmpPtr;
      int done;
Index: openafs/src/butc/recoverDb.c
diff -c openafs/src/butc/recoverDb.c:1.13 openafs/src/butc/recoverDb.c:1.13.4.1
*** openafs/src/butc/recoverDb.c:1.13	Sun Jul 10 23:22:20 2005
--- openafs/src/butc/recoverDb.c	Sat Jul  1 01:02:49 2006
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/butc/recoverDb.c,v 1.13 2005/07/11 03:22:20 shadow Exp $");
  
  #include <stdio.h>
  #ifdef AFS_NT40_ENV
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/butc/recoverDb.c,v 1.13.4.1 2006/07/01 05:02:49 shadow Exp $");
  
  #include <stdio.h>
  #ifdef AFS_NT40_ENV
***************
*** 54,62 ****
  /* PrintDumpLabel
   *	print out the tape (dump) label.
   */
! 
! PrintDumpLabel(labelptr)
!      struct butm_tapeLabel *labelptr;
  {
      char tapeName[BU_MAXTAPELEN + 32];
      time_t t;
--- 54,61 ----
  /* PrintDumpLabel
   *	print out the tape (dump) label.
   */
! void
! PrintDumpLabel(struct butm_tapeLabel *labelptr)
  {
      char tapeName[BU_MAXTAPELEN + 32];
      time_t t;
***************
*** 87,95 ****
  /* PrintVolumeHeader
   *	print the contents of a volume header. 
   */
! static
! PrintVolumeHeader(volHeader)
!      struct volumeHeader *volHeader;
  {
      time_t t;
  
--- 86,93 ----
  /* PrintVolumeHeader
   *	print the contents of a volume header. 
   */
! static void
! PrintVolumeHeader(struct volumeHeader *volHeader)
  {
      time_t t;
  
***************
*** 115,122 ****
   */
  
  afs_int32
! Ask(st)
!      char *st;
  {
      int response;
  
--- 113,119 ----
   */
  
  afs_int32
! Ask(char *st)
  {
      int response;
  
***************
*** 152,165 ****
   */
  #define BIGCHUNK 102400
  
! static
! scanVolData(taskId, curTapePtr, tapeVersion, volumeHeader, volumeTrailer,
! 	    bytesRead)
!      afs_int32 taskId;
!      struct butm_tapeInfo *curTapePtr;
!      afs_int32 tapeVersion;
!      struct volumeHeader *volumeHeader, *volumeTrailer;
!      afs_uint32 *bytesRead;
  {
      afs_int32 headBytes, tailBytes;
      char *block = NULL;
--- 149,156 ----
   */
  #define BIGCHUNK 102400
  
! static int
! scanVolData(afs_int32 taskId, struct butm_tapeInfo *curTapePtr, afs_int32 tapeVersion, struct volumeHeader *volumeHeader, struct volumeHeader *volumeTrailer, afs_uint32 *bytesRead)
  {
      afs_int32 headBytes, tailBytes;
      char *block = NULL;
***************
*** 290,297 ****
   */
  
  char *
! nextTapeLabel(prevTapeName)
!      char *prevTapeName;
  {
      char *prevdot;
      char *retval;
--- 281,287 ----
   */
  
  char *
! nextTapeLabel(char *prevTapeName)
  {
      char *prevdot;
      char *retval;
***************
*** 331,341 ****
  
  afs_int32 RcreateDump();
  
! static
! readDump(taskId, tapeInfoPtr, scanInfoPtr)
!      afs_uint32 taskId;
!      struct butm_tapeInfo *tapeInfoPtr;
!      struct tapeScanInfo *scanInfoPtr;
  {
      int moreTapes = 1;
      afs_int32 nbytes, flags, seq;
--- 321,328 ----
  
  afs_int32 RcreateDump();
  
! static int
! readDump(afs_uint32 taskId, struct butm_tapeInfo *tapeInfoPtr, struct tapeScanInfo *scanInfoPtr)
  {
      int moreTapes = 1;
      afs_int32 nbytes, flags, seq;
***************
*** 577,586 ****
   * try to read that dump too.
   * The first tape label is the first dumpLabel.
   */
! readDumps(taskId, tapeInfoPtr, scanInfoPtr)
!      afs_uint32 taskId;
!      struct butm_tapeInfo *tapeInfoPtr;
!      struct tapeScanInfo *scanInfoPtr;
  {
      afs_int32 code, c;
  
--- 564,571 ----
   * try to read that dump too.
   * The first tape label is the first dumpLabel.
   */
! int
! readDumps(afs_uint32 taskId, struct butm_tapeInfo *tapeInfoPtr, struct tapeScanInfo *scanInfoPtr)
  {
      afs_int32 code, c;
  
***************
*** 611,623 ****
  }
  
  afs_int32
! getScanTape(taskId, tapeInfoPtr, tname, tapeId, prompt, tapeLabelPtr)
!      afs_int32 taskId;
!      struct butm_tapeInfo *tapeInfoPtr;
!      char *tname;
!      afs_int32 tapeId;
!      int prompt;
!      struct butm_tapeLabel *tapeLabelPtr;
  {
      afs_int32 code = 0;
      int tapecount = 1;
--- 596,602 ----
  }
  
  afs_int32
! getScanTape(afs_int32 taskId, struct butm_tapeInfo *tapeInfoPtr, char *tname, afs_int32 tapeId, int prompt, struct butm_tapeLabel *tapeLabelPtr)
  {
      afs_int32 code = 0;
      int tapecount = 1;
***************
*** 710,717 ****
   *	
   */
  
! ScanDumps(ptr)
!      struct scanTapeIf *ptr;
  {
      struct butm_tapeInfo curTapeInfo;
      struct tapeScanInfo tapeScanInfo;
--- 689,696 ----
   *	
   */
  
! int
! ScanDumps(struct scanTapeIf *ptr)
  {
      struct butm_tapeInfo curTapeInfo;
      struct tapeScanInfo tapeScanInfo;
***************
*** 778,786 ****
   *	0 - not ok
   *	1 - ok
   */
! validatePath(labelptr, pathptr)
!      struct butm_tapeLabel *labelptr;
!      char *pathptr;
  {
      char *up, *tp;
      char tapeName[BU_MAXTAPELEN];
--- 757,764 ----
   *	0 - not ok
   *	1 - ok
   */
! int
! validatePath(struct butm_tapeLabel *labelptr, char *pathptr)
  {
      char *up, *tp;
      char tapeName[BU_MAXTAPELEN];
***************
*** 828,835 ****
   */
  
  char *
! volumesetNamePtr(ptr)
!      char *ptr;
  {
      static char vsname[BU_MAXUNAMELEN];
      char *dotPtr;
--- 806,812 ----
   */
  
  char *
! volumesetNamePtr(char *ptr)
  {
      static char vsname[BU_MAXUNAMELEN];
      char *dotPtr;
***************
*** 850,857 ****
  }
  
  char *
! extractDumpName(ptr)
!      char *ptr;
  {
      static char dname[BU_MAXTAPELEN];
      char *dotPtr;
--- 827,833 ----
  }
  
  char *
! extractDumpName(char *ptr)
  {
      static char dname[BU_MAXTAPELEN];
      char *dotPtr;
***************
*** 882,889 ****
   *	-1 - error, couldn't extract sequence number
   */
  
! extractTapeSeq(tapename)
!      char *tapename;
  {
      char *sptr;
  
--- 858,865 ----
   *	-1 - error, couldn't extract sequence number
   */
  
! int
! extractTapeSeq(char *tapename)
  {
      char *sptr;
  
***************
*** 899,906 ****
   *   a database tape or not.
   */
  int
! databaseTape(tapeName)
!      char *tapeName;
  {
      char *sptr;
      int c;
--- 875,881 ----
   *   a database tape or not.
   */
  int
! databaseTape(char *tapeName)
  {
      char *sptr;
      int c;
***************
*** 917,925 ****
  }
  
  afs_int32
! RcreateDump(tapeScanInfoPtr, volHeaderPtr)
!      struct tapeScanInfo *tapeScanInfoPtr;
!      struct volumeHeader *volHeaderPtr;
  {
      afs_int32 code;
      struct butm_tapeLabel *dumpLabelPtr = &tapeScanInfoPtr->dumpLabel;
--- 892,898 ----
  }
  
  afs_int32
! RcreateDump(struct tapeScanInfo *tapeScanInfoPtr, struct volumeHeader *volHeaderPtr)
  {
      afs_int32 code;
      struct butm_tapeLabel *dumpLabelPtr = &tapeScanInfoPtr->dumpLabel;
Index: openafs/src/butc/tcmain.c
diff -c openafs/src/butc/tcmain.c:1.16 openafs/src/butc/tcmain.c:1.16.8.4
*** openafs/src/butc/tcmain.c:1.16	Wed Sep  8 17:35:51 2004
--- openafs/src/butc/tcmain.c	Sat Jul  1 01:02:49 2006
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/butc/tcmain.c,v 1.16 2004/09/08 21:35:51 jaltman Exp $");
  
  #include <sys/types.h>
  #include <sys/stat.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/butc/tcmain.c,v 1.16.8.4 2006/07/01 05:02:49 shadow Exp $");
  
  #include <sys/types.h>
  #include <sys/stat.h>
***************
*** 106,111 ****
--- 106,115 ----
  afs_int32 BufferSize;		/* Size in B stored for data */
  char *centralLogFile;
  afs_int32 lastLog;		/* Log last pass info */
+ int rxBind = 0;
+ 
+ #define ADDRSPERSITE 16         /* Same global is in rx/rx_user.c */
+ afs_uint32 SHostAddrs[ADDRSPERSITE];
  
  /* dummy routine for the audit work.  It should do nothing since audits */
  /* occur at the server level and bos is not a server. */
***************
*** 115,122 ****
  }
  
  static afs_int32
! SafeATOL(anum)
!      register char *anum;
  {
      register afs_int32 total;
      register int tc;
--- 119,125 ----
  }
  
  static afs_int32
! SafeATOL(register char *anum)
  {
      register afs_int32 total;
      register int tc;
***************
*** 151,160 ****
   *	should deal with signed numbers. Should signal error if no digits
   *	seen.
   */
! atocl(numstring, crunit, number)
!      char *numstring;
!      char crunit;		/* Units to report number in */
!      afs_int32 *number;
  {
      float total;
      afs_int32 runits;
--- 154,161 ----
   *	should deal with signed numbers. Should signal error if no digits
   *	seen.
   */
! int
! atocl(char *numstring, char crunit, afs_int32 *number)
  {
      float total;
      afs_int32 runits;
***************
*** 251,258 ****
  
  /* replace last two ocurrences of / by _ */
  static
! stringReplace(name)
!      char *name;
  {
      char *pos;
      char buffer[256];
--- 252,258 ----
  
  /* replace last two ocurrences of / by _ */
  static
! stringReplace(char *name)
  {
      char *pos;
      char buffer[256];
***************
*** 267,275 ****
  }
  
  static
! stringNowReplace(logFile, deviceName)
!      char *logFile, *deviceName;
! 
  {
      char *pos = 0;
      char storeDevice[256];
--- 267,273 ----
  }
  
  static
! stringNowReplace(char *logFile, char *deviceName)
  {
      char *pos = 0;
      char storeDevice[256];
***************
*** 319,328 ****
  
  #define	LINESIZE	256
  static afs_int32
! GetDeviceConfig(filename, config, portOffset)
!      char *filename;
!      struct tapeConfig *config;
!      afs_int32 portOffset;
  {
      FILE *devFile = 0;
      char line[LINESIZE];
--- 317,323 ----
  
  #define	LINESIZE	256
  static afs_int32
! GetDeviceConfig(char *filename, struct tapeConfig *config, afs_int32 portOffset)
  {
      FILE *devFile = 0;
      char line[LINESIZE];
***************
*** 411,419 ****
  /* GetConfigParams
   */
  static afs_int32
! GetConfigParams(filename, port)
!      char *filename;
!      afs_int32 port;
  {
      char paramFile[256];
      FILE *devFile = 0;
--- 406,412 ----
  /* GetConfigParams
   */
  static afs_int32
! GetConfigParams(char *filename, afs_int32 port)
  {
      char paramFile[256];
      FILE *devFile = 0;
***************
*** 836,845 ****
      return (code);
  }
  
! static
! WorkerBee(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
  {
      register afs_int32 code;
      struct rx_securityClass *(securityObjects[3]);
--- 829,836 ----
      return (code);
  }
  
! static int
! WorkerBee(struct cmd_syndesc *as, char *arock)
  {
      register afs_int32 code;
      struct rx_securityClass *(securityObjects[3]);
***************
*** 857,862 ****
--- 848,854 ----
      PROCESS dbWatcherPid;
  #endif
      time_t t;
+     afs_uint32 host = htonl(INADDR_ANY);
  
      debugLevel = 0;
  
***************
*** 1039,1046 ****
  	autoQuery = 0;
  
      localauth = (as->parms[5].items ? 1 : 0);
  
!     code = rx_Init(htons(BC_TAPEPORT + portOffset));
      if (code) {
  	TapeLog(0, 0, code, 0, "rx init failed on port %u\n",
  		BC_TAPEPORT + portOffset);
--- 1031,1058 ----
  	autoQuery = 0;
  
      localauth = (as->parms[5].items ? 1 : 0);
+     rxBind = (as->parms[8].items ? 1 : 0);
+ 
+     if (rxBind) {
+         afs_int32 ccode;
+ #ifndef AFS_NT40_ENV
+         if (AFSDIR_SERVER_NETRESTRICT_FILEPATH || 
+             AFSDIR_SERVER_NETINFO_FILEPATH) {
+             char reason[1024];
+             ccode = parseNetFiles(SHostAddrs, NULL, NULL,
+                                            ADDRSPERSITE, reason,
+                                            AFSDIR_SERVER_NETINFO_FILEPATH,
+                                            AFSDIR_SERVER_NETRESTRICT_FILEPATH);
+         } else 
+ #endif	
+ 	{
+             ccode = rx_getAllAddr(SHostAddrs, ADDRSPERSITE);
+         }
+         if (ccode == 1) 
+             host = SHostAddrs[0];
+     }
  
!     code = rx_InitHost(host, htons(BC_TAPEPORT + portOffset));
      if (code) {
  	TapeLog(0, 0, code, 0, "rx init failed on port %u\n",
  		BC_TAPEPORT + portOffset);
***************
*** 1080,1086 ****
      }
  
      service =
! 	rx_NewService(0, 1, "BUTC", securityObjects, 3, TC_ExecuteRequest);
      if (!service) {
  	TLog(0, "rx_NewService");
  	exit(1);
--- 1092,1098 ----
      }
  
      service =
! 	rx_NewServiceHost(host, 0, 1, "BUTC", securityObjects, 3, TC_ExecuteRequest);
      if (!service) {
  	TLog(0, "rx_NewService");
  	exit(1);
***************
*** 1144,1152 ****
  #include "AFS_component_version_number.c"
  #endif
  
! main(argc, argv)
!      int argc;
!      char **argv;
  {
      register struct cmd_syndesc *ts;
      register struct cmd_item *ti;
--- 1156,1163 ----
  #include "AFS_component_version_number.c"
  #endif
  
! int
! main(int argc, char **argv)
  {
      register struct cmd_syndesc *ts;
      register struct cmd_item *ti;
***************
*** 1183,1188 ****
--- 1194,1201 ----
  		"file to restore to");
      cmd_AddParm(ts, "-xbsaforcemultiple", CMD_FLAG, (CMD_OPTIONAL | CMD_HIDE),
  		"Force multiple XBSA server support");
+     cmd_AddParm(ts, "-rxbind", CMD_FLAG, CMD_OPTIONAL,
+ 		"bind Rx socket");
  
      /* Initialize dirpaths */
      if (!(initAFSDirPath() & AFSDIR_SERVER_PATHS_OK)) {
Index: openafs/src/butc/tcprocs.c
diff -c openafs/src/butc/tcprocs.c:1.14 openafs/src/butc/tcprocs.c:1.14.6.1
*** openafs/src/butc/tcprocs.c:1.14	Sun Apr  3 14:48:19 2005
--- openafs/src/butc/tcprocs.c	Sat Jul  1 01:02:50 2006
***************
*** 13,19 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/butc/tcprocs.c,v 1.14 2005/04/03 18:48:19 shadow Exp $");
  
  #include <sys/types.h>
  #include <errno.h>
--- 13,19 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/butc/tcprocs.c,v 1.14.6.1 2006/07/01 05:02:50 shadow Exp $");
  
  #include <sys/types.h>
  #include <errno.h>
***************
*** 42,49 ****
  #include "error_macros.h"
  #include "butc_xbsa.h"
  
! callPermitted(call)
!      struct rx_call *call;
  {
      /* before this code can be used, the rx connection, on the bucoord side, must */
      /* be changed so that it will set up for token passing instead of using  a    */
--- 42,49 ----
  #include "error_macros.h"
  #include "butc_xbsa.h"
  
! int
! callPermitted(struct rx_call *call)
  {
      /* before this code can be used, the rx connection, on the bucoord side, must */
      /* be changed so that it will set up for token passing instead of using  a    */
***************
*** 57,65 ****
   */
  
  static int
! CopyDumpDesc(toDump, fromDump)
!      struct tc_dumpDesc *toDump;
!      tc_dumpArray *fromDump;
  {
      struct tc_dumpDesc *toPtr, *fromPtr;
      int i;
--- 57,63 ----
   */
  
  static int
! CopyDumpDesc(struct tc_dumpDesc *toDump, tc_dumpArray *fromDump)
  {
      struct tc_dumpDesc *toPtr, *fromPtr;
      int i;
***************
*** 82,90 ****
  
  
  static int
! CopyRestoreDesc(toRestore, fromRestore)
!      struct tc_restoreDesc *toRestore;
!      tc_restoreArray *fromRestore;
  {
      struct tc_restoreDesc *toPtr, *fromPtr;
      int i;
--- 80,86 ----
  
  
  static int
! CopyRestoreDesc(struct tc_restoreDesc *toRestore, tc_restoreArray *fromRestore)
  {
      struct tc_restoreDesc *toPtr, *fromPtr;
      int i;
***************
*** 112,119 ****
  }
  
  static int
! CopyTapeSetDesc(toPtr, fromPtr)
!      struct tc_tapeSet *toPtr, *fromPtr;
  {
  
      toPtr->id = fromPtr->id;
--- 108,114 ----
  }
  
  static int
! CopyTapeSetDesc(struct tc_tapeSet *toPtr, struct tc_tapeSet *fromPtr)
  {
  
      toPtr->id = fromPtr->id;
***************
*** 134,143 ****
   */
  
  afs_int32
! STC_LabelTape(acid, label, taskId)
!      struct rx_call *acid;
!      struct tc_tapeLabel *label;
!      afs_uint32 *taskId;
  {
  #ifdef AFS_PTHREAD_ENV
      pthread_t pid;
--- 129,135 ----
   */
  
  afs_int32
! STC_LabelTape(struct rx_call *acid, struct tc_tapeLabel *label, afs_uint32 *taskId)
  {
  #ifdef AFS_PTHREAD_ENV
      pthread_t pid;
***************
*** 217,227 ****
   */
  
  afs_int32
! STC_PerformDump(rxCallId, tcdiPtr, tc_dumpArrayPtr, taskId)
!      struct rx_call *rxCallId;
!      struct tc_dumpInterface *tcdiPtr;
!      tc_dumpArray *tc_dumpArrayPtr;
!      afs_int32 *taskId;
  {
      struct dumpNode *newNode = 0;
      statusP statusPtr = 0;
--- 209,215 ----
   */
  
  afs_int32
! STC_PerformDump(struct rx_call *rxCallId, struct tc_dumpInterface *tcdiPtr, tc_dumpArray *tc_dumpArrayPtr, afs_int32 *taskId)
  {
      struct dumpNode *newNode = 0;
      statusP statusPtr = 0;
***************
*** 320,330 ****
  }
  
  afs_int32
! STC_PerformRestore(acid, dumpSetName, arestores, taskID)
!      struct rx_call *acid;
!      char *dumpSetName;		/* not used */
!      tc_restoreArray *arestores;
!      afs_int32 *taskID;
  {
      struct dumpNode *newNode;
      statusP statusPtr;
--- 308,314 ----
  }
  
  afs_int32
! STC_PerformRestore(struct rx_call *acid, char *dumpSetName, tc_restoreArray *arestores, afs_int32 *taskID)
  {
      struct dumpNode *newNode;
      statusP statusPtr;
***************
*** 401,410 ****
  }
  
  afs_int32
! STC_ReadLabel(acid, label, taskId)
!      struct rx_call *acid;
!      struct tc_tapeLabel *label;
!      afs_uint32 *taskId;
  {
      afs_int32 code;
  
--- 385,391 ----
  }
  
  afs_int32
! STC_ReadLabel(struct rx_call *acid, struct tc_tapeLabel *label, afs_uint32 *taskId)
  {
      afs_int32 code;
  
***************
*** 427,435 ****
   */
  
  afs_int32
! STC_RestoreDb(rxCall, taskId)
!      struct rx_call *rxCall;
!      afs_uint32 *taskId;
  {
  #ifdef AFS_PTHREAD_ENV
      pthread_t pid;
--- 408,414 ----
   */
  
  afs_int32
! STC_RestoreDb(struct rx_call *rxCall, afs_uint32 *taskId)
  {
  #ifdef AFS_PTHREAD_ENV
      pthread_t pid;
***************
*** 499,508 ****
   */
  
  afs_int32
! STC_SaveDb(rxCall, archiveTime, taskId)
!      struct rx_call *rxCall;
!      Date archiveTime;
!      afs_uint32 *taskId;
  {
  #ifdef AFS_PTHREAD_ENV
      pthread_t pid;
--- 478,484 ----
   */
  
  afs_int32
! STC_SaveDb(struct rx_call *rxCall, Date archiveTime, afs_uint32 *taskId)
  {
  #ifdef AFS_PTHREAD_ENV
      pthread_t pid;
***************
*** 585,594 ****
   */
  
  afs_int32
! STC_ScanDumps(acid, addDbFlag, taskId)
!      struct rx_call *acid;
!      afs_int32 addDbFlag;
!      afs_uint32 *taskId;
  {
  #ifdef AFS_PTHREAD_ENV
      pthread_t pid;
--- 561,567 ----
   */
  
  afs_int32
! STC_ScanDumps(struct rx_call *acid, afs_int32 addDbFlag, afs_uint32 *taskId)
  {
  #ifdef AFS_PTHREAD_ENV
      pthread_t pid;
***************
*** 667,675 ****
   */
  
  afs_int32
! STC_TCInfo(acid, tciptr)
!      struct rx_call *acid;
!      struct tc_tcInfo *tciptr;
  {
      if (callPermitted(acid) == 0)
  	return (TC_NOTPERMITTED);
--- 640,646 ----
   */
  
  afs_int32
! STC_TCInfo(struct rx_call *acid, struct tc_tcInfo *tciptr)
  {
      if (callPermitted(acid) == 0)
  	return (TC_NOTPERMITTED);
***************
*** 681,690 ****
  /* STC_DeleteDump
   */
  afs_int32
! STC_DeleteDump(acid, dumpID, taskId)
!      struct rx_call *acid;
!      afs_uint32 dumpID;
!      afs_uint32 *taskId;
  {
      struct deleteDumpIf *ptr = 0;
      statusP statusPtr = 0;
--- 652,658 ----
  /* STC_DeleteDump
   */
  afs_int32
! STC_DeleteDump(struct rx_call *acid, afs_uint32 dumpID, afs_uint32 *taskId)
  {
      struct deleteDumpIf *ptr = 0;
      statusP statusPtr = 0;
Index: openafs/src/butc/tcudbprocs.c
diff -c openafs/src/butc/tcudbprocs.c:1.15 openafs/src/butc/tcudbprocs.c:1.15.6.1
*** openafs/src/butc/tcudbprocs.c:1.15	Sun Apr  3 14:48:19 2005
--- openafs/src/butc/tcudbprocs.c	Mon Jul  3 15:07:14 2006
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/butc/tcudbprocs.c,v 1.15 2005/04/03 18:48:19 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/butc/tcudbprocs.c,v 1.15.6.1 2006/07/03 19:07:14 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
***************
*** 1168,1174 ****
  
      /* Add the database header to the database */
      code =
! 	ubik_Call(BUDB_RestoreDbHeader, udbHandle.uh_client, 0,
  		  &hostDbHeader);
      if (code) {
  	ErrorLog(0, rstTapeInfoPtr->taskId, code, 0,
--- 1168,1174 ----
  
      /* Add the database header to the database */
      code =
! 	ubik_BUDB_RestoreDbHeader(udbHandle.uh_client, 0,
  		  &hostDbHeader);
      if (code) {
  	ErrorLog(0, rstTapeInfoPtr->taskId, code, 0,
Index: openafs/src/butc/test_budb.c
diff -c openafs/src/butc/test_budb.c:1.5 openafs/src/butc/test_budb.c:1.5.14.1
*** openafs/src/butc/test_budb.c:1.5	Tue Jul 15 19:14:49 2003
--- openafs/src/butc/test_budb.c	Mon Jul  3 15:07:14 2006
***************
*** 14,20 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/butc/test_budb.c,v 1.5 2003/07/15 23:14:49 shadow Exp $");
  
  #include <afs/auth.h>
  #include <afs/budb_client.h>
--- 14,20 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/butc/test_budb.c,v 1.5.14.1 2006/07/03 19:07:14 shadow Exp $");
  
  #include <afs/auth.h>
  #include <afs/budb_client.h>
***************
*** 55,61 ****
      }
  
      /* Get the versin */
!     code = ubik_Call(BUDB_T_GetVersion, udbHandle.uh_client, 0, &version);
      if (code) {
  	printf("Error in ubik_Call to BUDB_T_GetVersion\n");
  	ERROR(code);
--- 55,61 ----
      }
  
      /* Get the versin */
!     code = ubik_BUDB_T_GetVersion(udbHandle.uh_client, 0, &version);
      if (code) {
  	printf("Error in ubik_Call to BUDB_T_GetVersion\n");
  	ERROR(code);
***************
*** 73,79 ****
      afs_int32 status, orphans, host;
  
      code =
! 	ubik_Call(BUDB_DbVerify, udbHandle.uh_client, 0, &status, &orphans,
  		  &host);
      if (code) {
  	printf("Error in ubik_Call to BUDB_DbVerify\n");
--- 73,79 ----
      afs_int32 status, orphans, host;
  
      code =
! 	ubik_BUDB_DbVerify(udbHandle.uh_client, 0, &status, &orphans,
  		  &host);
      if (code) {
  	printf("Error in ubik_Call to BUDB_DbVerify\n");
Index: openafs/src/cf/kerberos.m4
diff -c openafs/src/cf/kerberos.m4:1.7 openafs/src/cf/kerberos.m4:1.7.2.1
*** openafs/src/cf/kerberos.m4:1.7	Fri Feb 17 12:58:21 2006
--- openafs/src/cf/kerberos.m4	Sat Jun 24 12:24:19 2006
***************
*** 1,5 ****
  dnl
! dnl $Id: kerberos.m4,v 1.7 2006/02/17 17:58:21 rees Exp $
  dnl
  dnl Kerberos autoconf glue
  dnl
--- 1,5 ----
  dnl
! dnl $Id: kerberos.m4,v 1.7.2.1 2006/06/24 16:24:19 rra Exp $
  dnl
  dnl Kerberos autoconf glue
  dnl
***************
*** 58,64 ****
  	CPPFLAGS="$CPPFLAGS $KRB5CFLAGS"
  	save_LIBS="$LIBS"
  	LIBS="$LIBS $KRB5LIBS"
! 	AC_CHECK_FUNCS([add_to_error_table add_error_table krb5_princ_size krb5_principal_get_comp_string krb5_524_convert_creds krb524_convert_creds_kdc])
  	AC_CHECK_HEADERS([kerberosIV/krb.h])
  	AC_CHECK_HEADERS([kerberosV/heim_err.h])
  
--- 58,71 ----
  	CPPFLAGS="$CPPFLAGS $KRB5CFLAGS"
  	save_LIBS="$LIBS"
  	LIBS="$LIBS $KRB5LIBS"
! 	AC_CHECK_FUNCS([add_to_error_table add_error_table krb5_princ_size krb5_principal_get_comp_string])
! 	AC_CHECK_FUNCS([krb5_524_convert_creds], ,
! 	    [AC_CHECK_FUNCS([krb524_convert_creds_kdc], ,
! 		[AC_CHECK_LIB([krb524], [krb524_convert_creds_kdc],
! 		    [LIBS="-lkrb524 $LIBS"
! 		     KRB5LIBS="-lkrb524 $LIBS"
! 		     AC_DEFINE([HAVE_KRB524_CONVERT_CREDS_KDC], 1,
! 			 [Define to 1 if you have the `krb524_convert_creds_kdc' function.])])])])
  	AC_CHECK_HEADERS([kerberosIV/krb.h])
  	AC_CHECK_HEADERS([kerberosV/heim_err.h])
  
Index: openafs/src/cmd/cmd.c
diff -c openafs/src/cmd/cmd.c:1.12 openafs/src/cmd/cmd.c:1.12.4.1
*** openafs/src/cmd/cmd.c:1.12	Sat Nov  5 01:48:06 2005
--- openafs/src/cmd/cmd.c	Fri Jun 30 15:47:08 2006
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/cmd/cmd.c,v 1.12 2005/11/05 06:48:06 jaltman Exp $");
  
  #include <sys/types.h>
  #include <ctype.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/cmd/cmd.c,v 1.12.4.1 2006/06/30 19:47:08 shadow Exp $");
  
  #include <sys/types.h>
  #include <ctype.h>
***************
*** 165,170 ****
--- 165,179 ----
  	printf(" <arg>+");
  }
  
+ extern char *AFSVersion;
+ 
+ static int
+ VersionProc(register struct cmd_syndesc *as, char *arock)
+ {
+     printf("%s\n", AFSVersion);
+     return 0;
+ }
+ 
  void
  PrintSyntax(register struct cmd_syndesc *as)
  {
***************
*** 658,663 ****
--- 667,682 ----
  				  "search by help text");
  	    cmd_AddParm(ts, "-topic", CMD_SINGLE, CMD_REQUIRED,
  			"help string");
+ 	    ts = cmd_CreateSyntax("version", VersionProc, (char *)0,
+ 				  (char *)CMD_HIDDEN);
+ 	    ts = cmd_CreateSyntax("-version", VersionProc, (char *)0,
+ 				  (char *)CMD_HIDDEN);
+ 	    ts = cmd_CreateSyntax("-help", HelpProc, (char *)0,
+ 				  (char *)CMD_HIDDEN);
+ 	    ts = cmd_CreateSyntax("--version", VersionProc, (char *)0,
+ 				  (char *)CMD_HIDDEN);
+ 	    ts = cmd_CreateSyntax("--help", HelpProc, (char *)0,
+ 				  (char *)CMD_HIDDEN);
  	}
      }
  
Index: openafs/src/config/NTDllmap.txt
diff -c openafs/src/config/NTDllmap.txt:1.3 openafs/src/config/NTDllmap.txt:1.3.4.1
*** openafs/src/config/NTDllmap.txt:1.3	Sat Nov  5 01:48:07 2005
--- openafs/src/config/NTDllmap.txt	Wed Jul  5 20:18:33 2006
***************
*** 1,6 ****
  afspthread.dll                 0x61000000    0x00040000
! afsrpc.dll                     0x61040000    0x000B0000
! afsauthent.dll                 0x61100000    0x00080000
  afspioctl.dll                  0x61200000    0x00080000
  afsprocmgmt.dll                0x61280000    0x00080000
  afsadminutil.dll               0x61300000    0x00080000
--- 1,6 ----
  afspthread.dll                 0x61000000    0x00040000
! afsrpc.dll                     0x61040000    0x00100000
! afsauthent.dll                 0x61140000    0x000B0000
  afspioctl.dll                  0x61200000    0x00080000
  afsprocmgmt.dll                0x61280000    0x00080000
  afsadminutil.dll               0x61300000    0x00080000
Index: openafs/src/config/NTMakefile.amd64_w2k
diff -c openafs/src/config/NTMakefile.amd64_w2k:1.24.2.1 openafs/src/config/NTMakefile.amd64_w2k:1.24.2.2
*** openafs/src/config/NTMakefile.amd64_w2k:1.24.2.1	Sun Jun  4 23:26:33 2006
--- openafs/src/config/NTMakefile.amd64_w2k	Wed Jul  5 13:12:50 2006
***************
*** 84,90 ****
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=5
! AFSPRODUCT_VER_PATCH=0002
  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=0003
  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.1 openafs/src/config/NTMakefile.i386_nt40:1.84.2.2
*** openafs/src/config/NTMakefile.i386_nt40:1.84.2.1	Sun Jun  4 23:26:33 2006
--- openafs/src/config/NTMakefile.i386_nt40	Wed Jul  5 13:12:50 2006
***************
*** 84,90 ****
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=5
! AFSPRODUCT_VER_PATCH=0002
  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=0003
  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.1 openafs/src/config/NTMakefile.i386_w2k:1.23.2.2
*** openafs/src/config/NTMakefile.i386_w2k:1.23.2.1	Sun Jun  4 23:26:33 2006
--- openafs/src/config/NTMakefile.i386_w2k	Wed Jul  5 13:12:50 2006
***************
*** 84,90 ****
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=5
! AFSPRODUCT_VER_PATCH=0002
  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=0003
  AFSPRODUCT_VER_BUILD=0
  
  AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
Index: openafs/src/config/param.alpha_linux_24.h
diff -c openafs/src/config/param.alpha_linux_24.h:1.7 openafs/src/config/param.alpha_linux_24.h:1.7.6.1
*** openafs/src/config/param.alpha_linux_24.h:1.7	Sun Apr 24 20:01:13 2005
--- openafs/src/config/param.alpha_linux_24.h	Mon Jun 12 12:25:47 2006
***************
*** 56,62 ****
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       2	/* Set to Userdisabled, allow sysctl to override */
  
  /* Machine / Operating system information */
  #define SYS_NAME       "alpha_linux_24"
--- 56,62 ----
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       1
  
  /* Machine / Operating system information */
  #define SYS_NAME       "alpha_linux_24"
Index: openafs/src/config/param.alpha_linux_26.h
diff -c openafs/src/config/param.alpha_linux_26.h:1.3 openafs/src/config/param.alpha_linux_26.h:1.3.6.1
*** openafs/src/config/param.alpha_linux_26.h:1.3	Sun Apr 24 20:01:13 2005
--- openafs/src/config/param.alpha_linux_26.h	Mon Jun 12 12:25:47 2006
***************
*** 61,67 ****
  #include <afs/afs_sysnames.h>
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       2	/* Set to Userdisabled, allow sysctl to override */
  
  #define AFSLITTLE_ENDIAN    1
  #define AFS_HAVE_FFS        1	/* Use system's ffs. */
--- 61,67 ----
  #include <afs/afs_sysnames.h>
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       1
  
  #define AFSLITTLE_ENDIAN    1
  #define AFS_HAVE_FFS        1	/* Use system's ffs. */
Index: openafs/src/config/param.amd64_linux24.h
diff -c openafs/src/config/param.amd64_linux24.h:1.5 openafs/src/config/param.amd64_linux24.h:1.5.6.1
*** openafs/src/config/param.amd64_linux24.h:1.5	Sun Apr 24 20:01:13 2005
--- openafs/src/config/param.amd64_linux24.h	Mon Jun 12 12:25:47 2006
***************
*** 69,75 ****
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       2	/* Set to Userdisabled, allow sysctl to override */
  
  /* Machine / Operating system information */
  #define SYS_NAME	"amd64_linux24"
--- 69,75 ----
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       1
  
  /* Machine / Operating system information */
  #define SYS_NAME	"amd64_linux24"
Index: openafs/src/config/param.amd64_linux26.h
diff -c openafs/src/config/param.amd64_linux26.h:1.4 openafs/src/config/param.amd64_linux26.h:1.4.6.1
*** openafs/src/config/param.amd64_linux26.h:1.4	Sun Apr 24 20:01:13 2005
--- openafs/src/config/param.amd64_linux26.h	Mon Jun 12 12:25:47 2006
***************
*** 57,63 ****
  #include <afs/afs_sysnames.h>
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       2	/* Set to Userdisabled, allow sysctl to override */
  
  #define AFSLITTLE_ENDIAN    1
  #define AFS_HAVE_FFS        1	/* Use system's ffs. */
--- 57,63 ----
  #include <afs/afs_sysnames.h>
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       1
  
  #define AFSLITTLE_ENDIAN    1
  #define AFS_HAVE_FFS        1	/* Use system's ffs. */
Index: openafs/src/config/param.i386_linux24.h
diff -c openafs/src/config/param.i386_linux24.h:1.21 openafs/src/config/param.i386_linux24.h:1.21.6.1
*** openafs/src/config/param.i386_linux24.h:1.21	Sun Apr 24 20:01:13 2005
--- openafs/src/config/param.i386_linux24.h	Mon Jun 12 12:25:47 2006
***************
*** 57,63 ****
  #include <afs/afs_sysnames.h>
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       2	/* Set to Userdisabled, allow sysctl to override */
  
  #define AFSLITTLE_ENDIAN    1
  #define AFS_HAVE_FFS        1	/* Use system's ffs. */
--- 57,63 ----
  #include <afs/afs_sysnames.h>
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       1
  
  #define AFSLITTLE_ENDIAN    1
  #define AFS_HAVE_FFS        1	/* Use system's ffs. */
Index: openafs/src/config/param.i386_linux26.h
diff -c openafs/src/config/param.i386_linux26.h:1.8 openafs/src/config/param.i386_linux26.h:1.8.2.1
*** openafs/src/config/param.i386_linux26.h:1.8	Fri Mar 31 00:51:06 2006
--- openafs/src/config/param.i386_linux26.h	Mon Jun 12 12:25:47 2006
***************
*** 58,64 ****
  #include <afs/afs_sysnames.h>
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       2	/* Set to Userdisabled, allow sysctl to override */
  
  #define AFSLITTLE_ENDIAN    1
  #define AFS_HAVE_FFS        1	/* Use system's ffs. */
--- 58,64 ----
  #include <afs/afs_sysnames.h>
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       1
  
  #define AFSLITTLE_ENDIAN    1
  #define AFS_HAVE_FFS        1	/* Use system's ffs. */
Index: openafs/src/config/param.i386_umlinux24.h
diff -c openafs/src/config/param.i386_umlinux24.h:1.4 openafs/src/config/param.i386_umlinux24.h:1.4.6.1
*** openafs/src/config/param.i386_umlinux24.h:1.4	Sun Apr 24 20:01:13 2005
--- openafs/src/config/param.i386_umlinux24.h	Mon Jun 12 12:25:47 2006
***************
*** 65,71 ****
  #include <afs/afs_sysnames.h>
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       2	/* Set to Userdisabled, allow sysctl to override */
  
  #define AFSLITTLE_ENDIAN    1
  #define AFS_HAVE_FFS        1	/* Use system's ffs. */
--- 65,71 ----
  #include <afs/afs_sysnames.h>
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       1
  
  #define AFSLITTLE_ENDIAN    1
  #define AFS_HAVE_FFS        1	/* Use system's ffs. */
Index: openafs/src/config/param.i386_umlinux26.h
diff -c openafs/src/config/param.i386_umlinux26.h:1.3 openafs/src/config/param.i386_umlinux26.h:1.3.6.1
*** openafs/src/config/param.i386_umlinux26.h:1.3	Sun Apr 24 20:01:13 2005
--- openafs/src/config/param.i386_umlinux26.h	Mon Jun 12 12:25:48 2006
***************
*** 58,64 ****
  #include <afs/afs_sysnames.h>
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       2	/* Set to Userdisabled, allow sysctl to override */
  
  #define AFSLITTLE_ENDIAN    1
  #define AFS_HAVE_FFS        1	/* Use system's ffs. */
--- 58,64 ----
  #include <afs/afs_sysnames.h>
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       1
  
  #define AFSLITTLE_ENDIAN    1
  #define AFS_HAVE_FFS        1	/* Use system's ffs. */
Index: openafs/src/config/param.ia64_linux24.h
diff -c openafs/src/config/param.ia64_linux24.h:1.11 openafs/src/config/param.ia64_linux24.h:1.11.6.1
*** openafs/src/config/param.ia64_linux24.h:1.11	Sun Apr 24 20:01:13 2005
--- openafs/src/config/param.ia64_linux24.h	Mon Jun 12 12:25:48 2006
***************
*** 69,75 ****
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       2	/* Set to Userdisabled, allow sysctl to override */
  
  /* Machine / Operating system information */
  #define SYS_NAME	"ia64_linux24"
--- 69,75 ----
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       1
  
  /* Machine / Operating system information */
  #define SYS_NAME	"ia64_linux24"
Index: openafs/src/config/param.ia64_linux26.h
diff -c openafs/src/config/param.ia64_linux26.h:1.4 openafs/src/config/param.ia64_linux26.h:1.4.6.1
*** openafs/src/config/param.ia64_linux26.h:1.4	Sun Apr 24 20:01:13 2005
--- openafs/src/config/param.ia64_linux26.h	Mon Jun 12 12:25:48 2006
***************
*** 78,84 ****
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       2	/* Set to Userdisabled, allow sysctl to override */
  
  /* Machine / Operating system information */
  #define SYS_NAME	"ia64_linux26"
--- 78,84 ----
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       1
  
  /* Machine / Operating system information */
  #define SYS_NAME	"ia64_linux26"
Index: openafs/src/config/param.parisc_linux24.h
diff -c openafs/src/config/param.parisc_linux24.h:1.9 openafs/src/config/param.parisc_linux24.h:1.9.6.1
*** openafs/src/config/param.parisc_linux24.h:1.9	Sun Apr 24 20:01:13 2005
--- openafs/src/config/param.parisc_linux24.h	Mon Jun 12 12:25:48 2006
***************
*** 52,58 ****
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       2	/* Set to Userdisabled, allow sysctl to override */
  
  /* Machine / Operating system information */
  #define SYS_NAME       "parisc_linux24"
--- 52,58 ----
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       1
  
  /* Machine / Operating system information */
  #define SYS_NAME       "parisc_linux24"
Index: openafs/src/config/param.ppc64_linux24.h
diff -c openafs/src/config/param.ppc64_linux24.h:1.4 openafs/src/config/param.ppc64_linux24.h:1.4.6.1
*** openafs/src/config/param.ppc64_linux24.h:1.4	Sun Apr 24 20:01:13 2005
--- openafs/src/config/param.ppc64_linux24.h	Mon Jun 12 12:25:48 2006
***************
*** 57,63 ****
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       2 /* Set to Userdisabled, allow sysctl to override */
  
  /* Machine / Operating system information */
  #define SYS_NAME       "ppc64_linux24"
--- 57,63 ----
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       1
  
  /* Machine / Operating system information */
  #define SYS_NAME       "ppc64_linux24"
Index: openafs/src/config/param.ppc64_linux26.h
diff -c openafs/src/config/param.ppc64_linux26.h:1.3 openafs/src/config/param.ppc64_linux26.h:1.3.6.1
*** openafs/src/config/param.ppc64_linux26.h:1.3	Sun Apr 24 20:01:13 2005
--- openafs/src/config/param.ppc64_linux26.h	Mon Jun 12 12:25:48 2006
***************
*** 58,64 ****
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       2 /* Set to Userdisabled, allow sysctl to override */
  
  /* Machine / Operating system information */
  #define SYS_NAME       "ppc64_linux26"
--- 58,64 ----
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       1
  
  /* Machine / Operating system information */
  #define SYS_NAME       "ppc64_linux26"
Index: openafs/src/config/param.ppc_linux24.h
diff -c openafs/src/config/param.ppc_linux24.h:1.12 openafs/src/config/param.ppc_linux24.h:1.12.6.1
*** openafs/src/config/param.ppc_linux24.h:1.12	Sun Apr 24 20:01:13 2005
--- openafs/src/config/param.ppc_linux24.h	Mon Jun 12 12:25:48 2006
***************
*** 54,60 ****
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       2	/* Set to Userdisabled, allow sysctl to override */
  
  /* Machine / Operating system information */
  #define SYS_NAME       "ppc_linux24"
--- 54,60 ----
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       1
  
  /* Machine / Operating system information */
  #define SYS_NAME       "ppc_linux24"
Index: openafs/src/config/param.ppc_linux26.h
diff -c openafs/src/config/param.ppc_linux26.h:1.3 openafs/src/config/param.ppc_linux26.h:1.3.6.1
*** openafs/src/config/param.ppc_linux26.h:1.3	Sun Apr 24 20:01:13 2005
--- openafs/src/config/param.ppc_linux26.h	Mon Jun 12 12:25:48 2006
***************
*** 56,62 ****
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       2	/* Set to Userdisabled, allow sysctl to override */
  
  /* Machine / Operating system information */
  #define SYS_NAME       "ppc_linux26"
--- 56,62 ----
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       1
  
  /* Machine / Operating system information */
  #define SYS_NAME       "ppc_linux26"
Index: openafs/src/config/param.s390_linux24.h
diff -c openafs/src/config/param.s390_linux24.h:1.14 openafs/src/config/param.s390_linux24.h:1.14.6.1
*** openafs/src/config/param.s390_linux24.h:1.14	Sun Apr 24 20:01:13 2005
--- openafs/src/config/param.s390_linux24.h	Mon Jun 12 12:25:48 2006
***************
*** 66,72 ****
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       2	/* Set to Userdisabled, allow sysctl to override */
  
  /* Machine / Operating system information */
  #define SYS_NAME	"s390_linux24"
--- 66,72 ----
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       1
  
  /* Machine / Operating system information */
  #define SYS_NAME	"s390_linux24"
Index: openafs/src/config/param.s390_linux26.h
diff -c openafs/src/config/param.s390_linux26.h:1.1 openafs/src/config/param.s390_linux26.h:1.1.6.1
*** openafs/src/config/param.s390_linux26.h:1.1	Wed Mar 15 11:15:07 2006
--- openafs/src/config/param.s390_linux26.h	Mon Jun 12 12:25:48 2006
***************
*** 68,74 ****
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       2	/* Set to Userdisabled, allow sysctl to override */
  
  /* Machine / Operating system information */
  #define SYS_NAME	"s390_linux26"
--- 68,74 ----
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       1
  
  /* Machine / Operating system information */
  #define SYS_NAME	"s390_linux26"
Index: openafs/src/config/param.s390x_linux24.h
diff -c openafs/src/config/param.s390x_linux24.h:1.3 openafs/src/config/param.s390x_linux24.h:1.3.6.1
*** openafs/src/config/param.s390x_linux24.h:1.3	Sun Apr 24 20:01:13 2005
--- openafs/src/config/param.s390x_linux24.h	Mon Jun 12 12:25:48 2006
***************
*** 71,77 ****
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       2	/* Set to Userdisabled, allow sysctl to override */
  
  /* Machine / Operating system information */
  #define SYS_NAME	"s390x_linux24"
--- 71,77 ----
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       1
  
  /* Machine / Operating system information */
  #define SYS_NAME	"s390x_linux24"
Index: openafs/src/config/param.s390x_linux26.h
diff -c openafs/src/config/param.s390x_linux26.h:1.4 openafs/src/config/param.s390x_linux26.h:1.4.4.1
*** openafs/src/config/param.s390x_linux26.h:1.4	Mon May 30 00:20:19 2005
--- openafs/src/config/param.s390x_linux26.h	Mon Jun 12 12:25:48 2006
***************
*** 71,77 ****
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       2	/* Set to Userdisabled, allow sysctl to override */
  
  /* Machine / Operating system information */
  #define SYS_NAME	"s390x_linux26"
--- 71,77 ----
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       1
  
  /* Machine / Operating system information */
  #define SYS_NAME	"s390x_linux26"
Index: openafs/src/config/param.sparc64_linux24.h
diff -c openafs/src/config/param.sparc64_linux24.h:1.9 openafs/src/config/param.sparc64_linux24.h:1.9.6.1
*** openafs/src/config/param.sparc64_linux24.h:1.9	Sun Apr 24 20:01:13 2005
--- openafs/src/config/param.sparc64_linux24.h	Mon Jun 12 12:25:48 2006
***************
*** 65,71 ****
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS		0	/* if nonzero, garbage collect PAGs */
  
  /* Machine / Operating system information */
  #define SYS_NAME	"sparc64_linux24"
--- 65,71 ----
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS	1
  
  /* Machine / Operating system information */
  #define SYS_NAME	"sparc64_linux24"
Index: openafs/src/config/param.sparc64_linux26.h
diff -c openafs/src/config/param.sparc64_linux26.h:1.2 openafs/src/config/param.sparc64_linux26.h:1.2.4.1
*** openafs/src/config/param.sparc64_linux26.h:1.2	Sat Jan 14 03:00:03 2006
--- openafs/src/config/param.sparc64_linux26.h	Mon Jun 12 12:25:48 2006
***************
*** 67,73 ****
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS		0	/* if nonzero, garbage collect PAGs */
  
  /* Machine / Operating system information */
  #define SYS_NAME	"sparc64_linux26"
--- 67,73 ----
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS	1
  
  /* Machine / Operating system information */
  #define SYS_NAME	"sparc64_linux26"
Index: openafs/src/config/param.sparc_linux24.h
diff -c openafs/src/config/param.sparc_linux24.h:1.10 openafs/src/config/param.sparc_linux24.h:1.10.6.1
*** openafs/src/config/param.sparc_linux24.h:1.10	Sun Apr 24 20:01:13 2005
--- openafs/src/config/param.sparc_linux24.h	Mon Jun 12 12:25:48 2006
***************
*** 63,69 ****
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       2	/* Set to Userdisabled, allow sysctl to override */
  
  /* Machine / Operating system information */
  #define SYS_NAME	"sparc_linux24"
--- 63,69 ----
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       1
  
  /* Machine / Operating system information */
  #define SYS_NAME	"sparc_linux24"
Index: openafs/src/dauth/Makefile.in
diff -c openafs/src/dauth/Makefile.in:1.9 openafs/src/dauth/Makefile.in:1.9.14.1
*** openafs/src/dauth/Makefile.in:1.9	Sat Jan 11 02:34:05 2003
--- openafs/src/dauth/Makefile.in	Mon Jul  3 15:07:14 2006
***************
*** 46,58 ****
  adkint.xdr.o:	adkint.xdr.c adkint.h
  
  adkint.cs.c: adkint.xg
! 	${RXGEN} -C -o $@ ${srcdir}/adkint.xg
  
  adkint.xdr.c: adkint.xg
  	${RXGEN} -c -o $@ ${srcdir}/adkint.xg
  
  adkint.h: adkint.xg
! 	${RXGEN} -h -o $@ ${srcdir}/adkint.xg
  
  dlog:		dlog.o $(VERS) $(OBJS) $(LIBS)
  		$(CC) ${LDFLAGS} -o dlog dlog.o $(VERS) $(OBJS) ${LIBS} \
--- 46,58 ----
  adkint.xdr.o:	adkint.xdr.c adkint.h
  
  adkint.cs.c: adkint.xg
! 	${RXGEN} -C -u -o $@ ${srcdir}/adkint.xg
  
  adkint.xdr.c: adkint.xg
  	${RXGEN} -c -o $@ ${srcdir}/adkint.xg
  
  adkint.h: adkint.xg
! 	${RXGEN} -h -u -o $@ ${srcdir}/adkint.xg
  
  dlog:		dlog.o $(VERS) $(OBJS) $(LIBS)
  		$(CC) ${LDFLAGS} -o dlog dlog.o $(VERS) $(OBJS) ${LIBS} \
Index: openafs/src/dauth/dlog.c
diff -c openafs/src/dauth/dlog.c:1.9 openafs/src/dauth/dlog.c:1.9.14.1
*** openafs/src/dauth/dlog.c:1.9	Tue Jul 15 19:14:58 2003
--- openafs/src/dauth/dlog.c	Mon Jul  3 15:07:14 2006
***************
*** 20,32 ****
   * to decode the decrypted result. As a side-effect of using the AFS/DFS
   * translator as the intermediary, this program also does not have to access
   * any KRB5 location/configuration information--it just contacts the servers
!  * listed in the CellServDB in the usual manner (via ubik_Call).
   *
   * This works as follows:
   * 
   * 1. dlog sends a GetTickets request to the intermediary.
   *
!  * 2. The intermediary reformats the request as an KRB5 AS request, asking
   *    for a ticket made out to the specified principal, suitable for contacting
   *    the AFS/DFS translator principal. This is determined by the server, and
   *    is by default "afs".
--- 20,32 ----
   * to decode the decrypted result. As a side-effect of using the AFS/DFS
   * translator as the intermediary, this program also does not have to access
   * any KRB5 location/configuration information--it just contacts the servers
!  * listed in the CellServDB in the usual manner (via ubik_.
   *
   * This works as follows:
   * 
   * 1. dlog sends a GetTickets request to the intermediary.
   *
!  * 2. The intermediary reformats the request as an KRB5 AS request(asking
   *    for a ticket made out to the specified principal, suitable for contacting
   *    the AFS/DFS translator principal. This is determined by the server, and
   *    is by default "afs".
***************
*** 72,78 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/dauth/dlog.c,v 1.9 2003/07/15 23:14:58 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 72,78 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/dauth/dlog.c,v 1.9.14.1 2006/07/03 19:07:14 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 665,671 ****
       */
      reply_p = (adk_reply_ptr) 0;
      error_p = (adk_error_ptr) 0;
!     code = ubik_Call(ADK_GetTicket, ubik_handle, 0,	/* Ubik flags */
  		     name,	/* IN:  Principal: must be exact DCE principal */
  		     nonce,	/* IN:  Input nonce */
  		     lifetime,	/* IN:  lifetime */
--- 665,671 ----
       */
      reply_p = (adk_reply_ptr) 0;
      error_p = (adk_error_ptr) 0;
!     code = ubik_ADK_GetTicket(ubik_handle, 0,	/* Ubik flags */
  		     name,	/* IN:  Principal: must be exact DCE principal */
  		     nonce,	/* IN:  Input nonce */
  		     lifetime,	/* IN:  lifetime */
Index: openafs/src/export/Makefile.in
diff -c openafs/src/export/Makefile.in:1.20 openafs/src/export/Makefile.in:1.20.4.1
*** openafs/src/export/Makefile.in:1.20	Mon Aug 15 11:04:12 2005
--- openafs/src/export/Makefile.in	Tue Jun 20 17:40:04 2006
***************
*** 113,119 ****
  	${CC} -q64 ${CFLAGS} -c ${srcdir}/cfgafs.c -o cfgafs64.o
  
  clean:
! 	$(RM) -f *.o *.Zlst *.map *.out cfgexport cfgafs *.ext AFS_component_version_number.c export.exp export64.exp
  
  ${DEST}/root.client/usr/vice/etc/dkload/export.ext: export.ext
  	${INSTALL} $? $@
--- 113,123 ----
  	${CC} -q64 ${CFLAGS} -c ${srcdir}/cfgafs.c -o cfgafs64.o
  
  clean:
! 	$(RM) -f *.o *.Zlst *.map *.out AFS_component_version_number.c
! 	$(RM) -f export.exp export64.exp
! 	$(RM) -f cfgexport cfgexport64
! 	$(RM) -f cfgafs cfgafs64
! 	$(RM) -f *.ext *.ext.nonfs
  
  ${DEST}/root.client/usr/vice/etc/dkload/export.ext: export.ext
  	${INSTALL} $? $@
Index: openafs/src/fsint/NTMakefile
diff -c openafs/src/fsint/NTMakefile:1.5 openafs/src/fsint/NTMakefile:1.5.14.1
*** openafs/src/fsint/NTMakefile:1.5	Fri Nov 21 03:00:47 2003
--- openafs/src/fsint/NTMakefile	Tue Jul  4 02:28:24 2006
***************
*** 37,47 ****
  	$(LIBARCH)  
  
  # use rxgen on afscbint.xg and afsint.xg
! afscbint.cs.c afscbint.ss.c afscbint.xdr.c afscbint.h : afscbint.xg common.xg
! 	$(RXGEN) -x -y afscbint.xg
  
- afsint.cs.c afsint.ss.c afsint.xdr.c afsint.h: afsint.xg common.xg
- 	$(RXGEN) -x afsint.xg
  
  # mtafsint.lib
  
--- 37,66 ----
  	$(LIBARCH)  
  
  # use rxgen on afscbint.xg and afsint.xg
! afscbint.cs.c: common.xg afscbint.xg afsint.h afscbint.h 
! 	$(RXGEN) -x -C -o afscbint.cs.c afscbint.xg
! 
! afscbint.ss.c: common.xg afscbint.xg afsint.h afscbint.h
! 	$(RXGEN) -x -S -o afscbint.ss.c afscbint.xg
! 
! afscbint.xdr.c: common.xg afscbint.xg afsint.h afscbint.h
! 	$(RXGEN) -x -y -c -o afscbint.xdr.c afscbint.xg
! 
! afscbint.h: common.xg afscbint.xg
! 	$(RXGEN) -x -h -o afscbint.h afscbint.xg
! 
! afsint.cs.c: common.xg afsint.xg afsint.h
! 	$(RXGEN) -x -C -o afsint.cs.c afsint.xg
! 
! afsint.ss.c: common.xg afsint.xg afsint.h
! 	$(RXGEN) -x -S -o afsint.ss.c afsint.xg
! 
! afsint.xdr.c: common.xg afsint.xg
! 	$(RXGEN) -x -c -o afsint.xdr.c afsint.xg
! 
! afsint.h: common.xg afsint.xg
! 	$(RXGEN) -x -h -o afsint.h afsint.xg
  
  
  # mtafsint.lib
  
Index: openafs/src/kauth/Makefile.in
diff -c openafs/src/kauth/Makefile.in:1.12 openafs/src/kauth/Makefile.in:1.12.8.1
*** openafs/src/kauth/Makefile.in:1.12	Fri Oct 15 17:41:10 2004
--- openafs/src/kauth/Makefile.in	Mon Jul  3 15:07:15 2006
***************
*** 96,102 ****
  $(UKSRCS): kauth.h
  
  kauth.cs.c: kauth.rg
! 	${RXGEN} -x -C -o $@ ${srcdir}/kauth.rg
  
  kauth.ss.c: kauth.rg
  	${RXGEN} -x -S -o $@ ${srcdir}/kauth.rg
--- 96,102 ----
  $(UKSRCS): kauth.h
  
  kauth.cs.c: kauth.rg
! 	${RXGEN} -u -x -C -o $@ ${srcdir}/kauth.rg
  
  kauth.ss.c: kauth.rg
  	${RXGEN} -x -S -o $@ ${srcdir}/kauth.rg
***************
*** 105,111 ****
  	${RXGEN} -x -c -o $@ ${srcdir}/kauth.rg
  
  kauth.h: kauth.rg
! 	${RXGEN} -x -h -o $@ ${srcdir}/kauth.rg
  
  kauth.xdr.c: kauth.h
  kauth.cs.c: kauth.h
--- 105,111 ----
  	${RXGEN} -x -c -o $@ ${srcdir}/kauth.rg
  
  kauth.h: kauth.rg
! 	${RXGEN} -u -x -h -o $@ ${srcdir}/kauth.rg
  
  kauth.xdr.c: kauth.h
  kauth.cs.c: kauth.h
Index: openafs/src/kauth/NTMakefile
diff -c openafs/src/kauth/NTMakefile:1.11 openafs/src/kauth/NTMakefile:1.11.4.1
*** openafs/src/kauth/NTMakefile:1.11	Sun Nov 20 20:56:52 2005
--- openafs/src/kauth/NTMakefile	Tue Jul  4 02:28:24 2006
***************
*** 198,205 ****
  ############################################################################
  # rxgen on kauth.rg
  
! kauth.ss.c kauth.cs.c kauth.xdr.c kauth.h: kauth.rg
! 	$(RXGEN) -x $**
  
  ############################################################################
  # compile_et on kaerrors.c 
--- 198,214 ----
  ############################################################################
  # rxgen on kauth.rg
  
! kauth.cs.c: kauth.rg kauth.h
! 	$(RXGEN) -u -x -C -o $@ kauth.rg
! 
! kauth.ss.c: kauth.rg kauth.h
! 	$(RXGEN) -x -S -o $@ kauth.rg
! 
! kauth.xdr.c: kauth.rg kauth.h
! 	$(RXGEN) -x -c -o $@ kauth.rg
! 
! kauth.h: kauth.rg
! 	$(RXGEN) -u -x -h -o $@ kauth.rg
  
  ############################################################################
  # compile_et on kaerrors.c 
Index: openafs/src/kauth/kaserver.c
diff -c openafs/src/kauth/kaserver.c:1.19 openafs/src/kauth/kaserver.c:1.19.2.2
*** openafs/src/kauth/kaserver.c:1.19	Wed Feb  1 11:09:18 2006
--- openafs/src/kauth/kaserver.c	Tue Jun 20 16:37:11 2006
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/kaserver.c,v 1.19 2006/02/01 16:09:18 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/kaserver.c,v 1.19.2.2 2006/06/20 20:37:11 jaltman Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 59,64 ****
--- 59,68 ----
  afs_int32 myHost = 0;
  afs_int32 verbose_track = 1;
  afs_int32 krb4_cross = 0;
+ afs_int32 rxBind = 0;
+ 
+ #define ADDRSPERSITE 16         /* Same global is in rx/rx_user.c */
+ afs_uint32 SHostAddrs[ADDRSPERSITE];
  
  struct afsconf_dir *KA_conf;	/* for getting cell info */
  
***************
*** 168,173 ****
--- 172,178 ----
      int level;			/* security level for Ubik */
      afs_int32 i;
      char clones[MAXHOSTSPERCELL];
+     afs_uint32 host = ntohl(INADDR_ANY);
  
      struct rx_service *tservice;
      struct rx_securityClass *sca[1];
***************
*** 203,209 ****
      if (argc == 0) {
        usage:
  	printf("Usage: kaserver [-noAuth] [-fastKeys] [-database <dbpath>] "
! 	       "[-auditlog <log path>] "
  	       "[-localfiles <lclpath>] [-minhours <n>] [-servers <serverlist>] "
  	       "[-crossrealm]"
  	       /*" [-enable_peer_stats] [-enable_process_stats] " */
--- 208,214 ----
      if (argc == 0) {
        usage:
  	printf("Usage: kaserver [-noAuth] [-fastKeys] [-database <dbpath>] "
! 	       "[-auditlog <log path>] [-rxbind] "
  	       "[-localfiles <lclpath>] [-minhours <n>] [-servers <serverlist>] "
  	       "[-crossrealm]"
  	       /*" [-enable_peer_stats] [-enable_process_stats] " */
***************
*** 305,310 ****
--- 310,317 ----
  	    verbose_track = 0;
  	else if (IsArg("-crossrealm"))
  	    krb4_cross = 1;
+ 	else if (IsArg("-rxbind"))
+ 	    rxBind = 1;
  	else if (IsArg("-minhours")) {
  	    MinHours = atoi(argv[++a]);
  	} else if (IsArg("-enable_peer_stats")) {
***************
*** 377,382 ****
--- 384,411 ----
      ubik_CheckRXSecurityRock = (char *)KA_conf;
  
      ubik_nBuffers = 80;
+ 
+     if (rxBind) {
+ 	afs_int32 ccode;
+ #ifndef AFS_NT40_ENV
+         if (AFSDIR_SERVER_NETRESTRICT_FILEPATH || 
+             AFSDIR_SERVER_NETINFO_FILEPATH) {
+             char reason[1024];
+             ccode = parseNetFiles(SHostAddrs, NULL, NULL,
+                                            ADDRSPERSITE, reason,
+                                            AFSDIR_SERVER_NETINFO_FILEPATH,
+                                            AFSDIR_SERVER_NETRESTRICT_FILEPATH);
+         } else 
+ #endif	
+ 	{
+             ccode = rx_getAllAddr(SHostAddrs, ADDRSPERSITE);
+         }
+         if (ccode == 1) {
+             host = SHostAddrs[0];
+ 	    rx_InitHost(host, htons(AFSCONF_KAUTHPORT));
+ 	}
+     }
+ 
      if (servers)
  	code =
  	    ubik_ServerInit(myHost, htons(AFSCONF_KAUTHPORT), serverList,
***************
*** 397,404 ****
      rx_SetNoJumbo();
  
      tservice =
! 	rx_NewService(0, KA_AUTHENTICATION_SERVICE, "AuthenticationService",
! 		      sca, 1, KAA_ExecuteRequest);
      if (tservice == (struct rx_service *)0) {
  	ViceLog(0, ("Could not create Authentication rx service\n"));
  	exit(3);
--- 426,433 ----
      rx_SetNoJumbo();
  
      tservice =
! 	rx_NewServiceHost(host, 0, KA_AUTHENTICATION_SERVICE, 
! 			  "AuthenticationService", sca, 1, KAA_ExecuteRequest);
      if (tservice == (struct rx_service *)0) {
  	ViceLog(0, ("Could not create Authentication rx service\n"));
  	exit(3);
***************
*** 406,413 ****
      rx_SetMinProcs(tservice, 1);
      rx_SetMaxProcs(tservice, 1);
  
      tservice =
! 	rx_NewService(0, KA_TICKET_GRANTING_SERVICE, "TicketGrantingService",
  		      sca, 1, KAT_ExecuteRequest);
      if (tservice == (struct rx_service *)0) {
  	ViceLog(0, ("Could not create Ticket Granting rx service\n"));
--- 435,443 ----
      rx_SetMinProcs(tservice, 1);
      rx_SetMaxProcs(tservice, 1);
  
+     
      tservice =
! 	rx_NewServiceHost(host, 0, KA_TICKET_GRANTING_SERVICE, "TicketGrantingService",
  		      sca, 1, KAT_ExecuteRequest);
      if (tservice == (struct rx_service *)0) {
  	ViceLog(0, ("Could not create Ticket Granting rx service\n"));
***************
*** 421,427 ****
      scm[RX_SCINDEX_KAD] =
  	rxkad_NewServerSecurityObject(rxkad_crypt, 0, kvno_admin_key, 0);
      tservice =
! 	rx_NewService(0, KA_MAINTENANCE_SERVICE, "Maintenance", scm, 3,
  		      KAM_ExecuteRequest);
      if (tservice == (struct rx_service *)0) {
  	ViceLog(0, ("Could not create Maintenance rx service\n"));
--- 451,457 ----
      scm[RX_SCINDEX_KAD] =
  	rxkad_NewServerSecurityObject(rxkad_crypt, 0, kvno_admin_key, 0);
      tservice =
! 	rx_NewServiceHost(host, 0, KA_MAINTENANCE_SERVICE, "Maintenance", scm, 3,
  		      KAM_ExecuteRequest);
      if (tservice == (struct rx_service *)0) {
  	ViceLog(0, ("Could not create Maintenance rx service\n"));
***************
*** 432,438 ****
      rx_SetStackSize(tservice, 10000);
  
      tservice =
! 	rx_NewService(0, RX_STATS_SERVICE_ID, "rpcstats", scm, 3,
  		      RXSTATS_ExecuteRequest);
      if (tservice == (struct rx_service *)0) {
  	ViceLog(0, ("Could not create rpc stats rx service\n"));
--- 462,468 ----
      rx_SetStackSize(tservice, 10000);
  
      tservice =
! 	rx_NewServiceHost(host, 0, RX_STATS_SERVICE_ID, "rpcstats", scm, 3,
  		      RXSTATS_ExecuteRequest);
      if (tservice == (struct rx_service *)0) {
  	ViceLog(0, ("Could not create rpc stats rx service\n"));
Index: openafs/src/libadmin/kas/NTMakefile
diff -c openafs/src/libadmin/kas/NTMakefile:1.6 openafs/src/libadmin/kas/NTMakefile:1.6.4.1
*** openafs/src/libadmin/kas/NTMakefile:1.6	Sun Nov 20 20:57:02 2005
--- openafs/src/libadmin/kas/NTMakefile	Tue Jul  4 02:28:24 2006
***************
*** 35,41 ****
  	$(DESTDIR)\lib\afs\afsadminutil.lib \
  	$(DESTDIR)\lib\afsauthent.lib \
  	$(DESTDIR)\lib\afsrpc.lib \
! 	$(DESTDIR)\lib\afspthread.lib
  
  $(DLLFILE): $(DLLOBJS) $(DLLLIBS)
  	$(DLLCONLINK) /DEF:kasadmin.def
--- 35,42 ----
  	$(DESTDIR)\lib\afs\afsadminutil.lib \
  	$(DESTDIR)\lib\afsauthent.lib \
  	$(DESTDIR)\lib\afsrpc.lib \
! 	$(DESTDIR)\lib\afspthread.lib \
! 	$(DESTDIR)\lib\afs\afsutil.lib
  
  $(DLLFILE): $(DLLOBJS) $(DLLLIBS)
  	$(DLLCONLINK) /DEF:kasadmin.def
Index: openafs/src/libadmin/pts/NTMakefile
diff -c openafs/src/libadmin/pts/NTMakefile:1.6 openafs/src/libadmin/pts/NTMakefile:1.6.4.1
*** openafs/src/libadmin/pts/NTMakefile:1.6	Sun Nov 20 20:57:02 2005
--- openafs/src/libadmin/pts/NTMakefile	Tue Jul  4 02:28:24 2006
***************
*** 38,44 ****
  	$(DESTDIR)\lib\afs\afsadminutil.lib \
  	$(DESTDIR)\lib\afsauthent.lib \
  	$(DESTDIR)\lib\afsrpc.lib \
! 	$(DESTDIR)\lib\afspthread.lib
  
  $(DLLFILE): $(DLLOBJS) $(DLLLIBS)
  	$(DLLCONLINK) /DEF:ptsadmin.def
--- 38,45 ----
  	$(DESTDIR)\lib\afs\afsadminutil.lib \
  	$(DESTDIR)\lib\afsauthent.lib \
  	$(DESTDIR)\lib\afsrpc.lib \
! 	$(DESTDIR)\lib\afspthread.lib \
! 	$(DESTDIR)\lib\afs\afsutil.lib
  
  $(DLLFILE): $(DLLOBJS) $(DLLLIBS)
  	$(DLLCONLINK) /DEF:ptsadmin.def
Index: openafs/src/libadmin/vos/NTMakefile
diff -c openafs/src/libadmin/vos/NTMakefile:1.6 openafs/src/libadmin/vos/NTMakefile:1.6.4.1
*** openafs/src/libadmin/vos/NTMakefile:1.6	Sun Nov 20 20:57:06 2005
--- openafs/src/libadmin/vos/NTMakefile	Tue Jul  4 02:28:24 2006
***************
*** 59,65 ****
  	$(DESTDIR)\lib\afspthread.lib \
  	$(DESTDIR)\lib\afs\afsadminutil.lib \
  	$(DESTDIR)\lib\afsauthent.lib \
! 	$(DESTDIR)\lib\afsrpc.lib
  
  $(DLLFILE): $(DLLOBJS) $(DLLLIBS)
  	$(DLLCONLINK) /DEF:vosadmin.def
--- 59,66 ----
  	$(DESTDIR)\lib\afspthread.lib \
  	$(DESTDIR)\lib\afs\afsadminutil.lib \
  	$(DESTDIR)\lib\afsauthent.lib \
! 	$(DESTDIR)\lib\afsrpc.lib \
! 	$(DESTDIR)\lib\afs\afsutil.lib
  
  $(DLLFILE): $(DLLOBJS) $(DLLLIBS)
  	$(DLLCONLINK) /DEF:vosadmin.def
Index: openafs/src/libafs/Makefile.common.in
diff -c openafs/src/libafs/Makefile.common.in:1.24 openafs/src/libafs/Makefile.common.in:1.24.2.1
*** openafs/src/libafs/Makefile.common.in:1.24	Thu Mar  9 01:34:40 2006
--- openafs/src/libafs/Makefile.common.in	Tue Jun 20 17:40:07 2006
***************
*** 410,416 ****
  
  
  clean:
! 	-$(RM) -rf STATIC* MODLOAD*
  	-$(RM) -rf  h net netinet rpc ufs machine inet nfs sys afs afsint asm asm-generic config rx linux
  
  include ${TOP_OBJDIR}/src/config/Makefile.version
--- 410,416 ----
  
  
  clean:
! 	-$(RM) -rf STATIC* MODLOAD* $(AFS_OS_CLEAN)
  	-$(RM) -rf  h net netinet rpc ufs machine inet nfs sys afs afsint asm asm-generic config rx linux
  
  include ${TOP_OBJDIR}/src/config/Makefile.version
Index: openafs/src/libafs/MakefileProto.AIX.in
diff -c openafs/src/libafs/MakefileProto.AIX.in:1.25 openafs/src/libafs/MakefileProto.AIX.in:1.25.4.1
*** openafs/src/libafs/MakefileProto.AIX.in:1.25	Mon Aug 15 11:06:13 2005
--- openafs/src/libafs/MakefileProto.AIX.in	Tue Jun 20 17:40:07 2006
***************
*** 35,40 ****
--- 35,44 ----
  	osi_vfsops_iauth.o \
  	osi_vnodeops_iauth.o
  
+ AFS_OS_CLEAN = \
+ 	*.exp \
+ 	export.h
+ 
  # System specific build commands
  STRIP = /bin/strip
  DBUG  = -g
Index: openafs/src/libafs/MakefileProto.SOLARIS.in
diff -c openafs/src/libafs/MakefileProto.SOLARIS.in:1.25 openafs/src/libafs/MakefileProto.SOLARIS.in:1.25.6.1
*** openafs/src/libafs/MakefileProto.SOLARIS.in:1.25	Wed Feb 16 14:22:49 2005
--- openafs/src/libafs/MakefileProto.SOLARIS.in	Mon Jul  3 14:54:34 2006
***************
*** 44,57 ****
  CFLAGS=-I. -I.. -I${TOP_OBJDIR}/src/config ${FSINCLUDES} $(DEFINES) $(KDEFS) $(KOPTS) ${DBUG}
  
  # Name of directory to hold object files and libraries.
! <all -sun4x_57 -sun4x_58 -sun4x_59 -sunx86_57 -sunx86_58 -sunx86_59>
  KOBJ = MODLOAD
! <sun4x_57 sun4x_58 sun4x_59 sun4x_510 sunx86_57 sunx86_58 sunx86_59 sunx86_510>
  KOBJ = MODLOAD32 MODLOAD64
! 
  
  # This tells Makefile.common to use it's single directory build target.
! <all -sun4x_57 -sun4x_58 -sun4x_59 -sunx86_57 -sunx86_58 -sunx86_59>
  COMPDIRS = single_compdir
  INSTDIRS = single_instdir
  DESTDIRS = single_destdir
--- 44,58 ----
  CFLAGS=-I. -I.. -I${TOP_OBJDIR}/src/config ${FSINCLUDES} $(DEFINES) $(KDEFS) $(KOPTS) ${DBUG}
  
  # Name of directory to hold object files and libraries.
! <all -sun4x_57 -sun4x_58 -sun4x_59 -sun4x_510 -sunx86_57 -sunx86_58 -sunx86_59 -sunx86_510>
  KOBJ = MODLOAD
! <sun4x_57 sun4x_58 sun4x_59 sunx86_57 sunx86_58 sunx86_59 sunx86_510>
  KOBJ = MODLOAD32 MODLOAD64
! <sun4x_510>
! KOBJ = MODLOAD64
  
  # This tells Makefile.common to use it's single directory build target.
! <all -sun4x_57 -sun4x_58 -sun4x_59 -sun4x_510 -sunx86_57 -sunx86_58 -sunx86_59 -sunx86_510>
  COMPDIRS = single_compdir
  INSTDIRS = single_instdir
  DESTDIRS = single_destdir
Index: openafs/src/libafs/afs.ppc_darwin_70.plist.in
diff -c openafs/src/libafs/afs.ppc_darwin_70.plist.in:1.2.10.1 openafs/src/libafs/afs.ppc_darwin_70.plist.in:1.2.10.2
*** openafs/src/libafs/afs.ppc_darwin_70.plist.in:1.2.10.1	Wed Jun  7 01:03:08 2006
--- openafs/src/libafs/afs.ppc_darwin_70.plist.in	Wed Jul  5 16:21:29 2006
***************
*** 15,25 ****
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.5.2</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.5.2</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.3</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.5.3</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.1 openafs/src/libafs/afs.ppc_darwin_80.plist.in:1.2.4.2
*** openafs/src/libafs/afs.ppc_darwin_80.plist.in:1.2.4.1	Wed Jun  7 01:03:08 2006
--- openafs/src/libafs/afs.ppc_darwin_80.plist.in	Wed Jul  5 16:21:29 2006
***************
*** 15,25 ****
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.5.2</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.5.2</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.3</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.5.3</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.1 openafs/src/libafs/afs.ppc_darwin_90.plist.in:1.1.6.2
*** openafs/src/libafs/afs.ppc_darwin_90.plist.in:1.1.6.1	Wed Jun  7 01:03:08 2006
--- openafs/src/libafs/afs.ppc_darwin_90.plist.in	Wed Jul  5 16:21:29 2006
***************
*** 15,25 ****
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.5.2</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.5.2</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.3</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.5.3</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.1 openafs/src/libafs/afs.x86_darwin_80.plist.in:1.1.6.2
*** openafs/src/libafs/afs.x86_darwin_80.plist.in:1.1.6.1	Wed Jun  7 01:03:08 2006
--- openafs/src/libafs/afs.x86_darwin_80.plist.in	Wed Jul  5 16:21:29 2006
***************
*** 15,25 ****
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.5.2</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.5.2</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.3</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.5.3</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.1 openafs/src/libafs/afs.x86_darwin_90.plist.in:1.1.6.2
*** openafs/src/libafs/afs.x86_darwin_90.plist.in:1.1.6.1	Wed Jun  7 01:03:08 2006
--- openafs/src/libafs/afs.x86_darwin_90.plist.in	Wed Jul  5 16:21:29 2006
***************
*** 15,25 ****
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.5.2</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.5.2</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.3</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.5.3</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kpi.bsd</key>
Index: openafs/src/libafsauthent/afsauthent.def
diff -c openafs/src/libafsauthent/afsauthent.def:1.5 openafs/src/libafsauthent/afsauthent.def:1.5.2.2
*** openafs/src/libafsauthent/afsauthent.def:1.5	Thu Apr 20 13:19:22 2006
--- openafs/src/libafsauthent/afsauthent.def	Tue Jul  4 02:28:25 2006
***************
*** 110,125 ****
          PR_ListSuperGroups				@108
  	ka_AuthSpecificServersConn			@109
  	ka_KeyCheckSum					@110
! 
! 
! 
! 
! 
! 
! 
! 
! 
! 
! 
! 
! 
--- 110,116 ----
          PR_ListSuperGroups				@108
  	ka_AuthSpecificServersConn			@109
  	ka_KeyCheckSum					@110
! 	rx_Finalize					@111
! 	rx_InitHost					@112
! 	VOTE_GetSyncSite				@113
! 	ubik_RefreshConn				@114
Index: openafs/src/libafsrpc/NTMakefile
diff -c openafs/src/libafsrpc/NTMakefile:1.11 openafs/src/libafsrpc/NTMakefile:1.11.4.1
*** openafs/src/libafsrpc/NTMakefile:1.11	Sun Nov 20 20:57:09 2005
--- openafs/src/libafsrpc/NTMakefile	Tue Jul  4 02:28:25 2006
***************
*** 30,36 ****
  	$(OUT)\xdr_rec.obj  $(OUT)\xdr_refernce.obj $(OUT)\xdr_rx.obj $(OUT)\xdr_update.obj \
  	$(OUT)\xdr_afsuuid.obj $(OUT)\xdr_int64.obj $(OUT)\xdr_int32.obj
  
! RXOBJS = $(OUT)\rx_event.obj $(OUT)\rx_user.obj $(OUT)\rx_pthread.obj $(OUT)\rx.obj \
  	$(OUT)\rx_null.obj $(OUT)\rx_globals.obj $(OUT)\rx_getaddr.obj $(OUT)\rx_misc.obj $(OUT)\rx_packet.obj \
  	$(OUT)\rx_rdwr.obj $(OUT)\rx_trace.obj $(OUT)\rx_xmit_nt.obj $(OUT)\rx_conncache.obj
  
--- 30,36 ----
  	$(OUT)\xdr_rec.obj  $(OUT)\xdr_refernce.obj $(OUT)\xdr_rx.obj $(OUT)\xdr_update.obj \
  	$(OUT)\xdr_afsuuid.obj $(OUT)\xdr_int64.obj $(OUT)\xdr_int32.obj
  
! RXOBJS = $(OUT)\rx_event.obj $(OUT)\rx_user.obj $(OUT)\rx_pthread.obj $(OUT)\rx.obj $(OUT)\rx_clock_nt.obj \
  	$(OUT)\rx_null.obj $(OUT)\rx_globals.obj $(OUT)\rx_getaddr.obj $(OUT)\rx_misc.obj $(OUT)\rx_packet.obj \
  	$(OUT)\rx_rdwr.obj $(OUT)\rx_trace.obj $(OUT)\rx_xmit_nt.obj $(OUT)\rx_conncache.obj
  
Index: openafs/src/libafsrpc/afsrpc.def
diff -c openafs/src/libafsrpc/afsrpc.def:1.11 openafs/src/libafsrpc/afsrpc.def:1.11.4.2
*** openafs/src/libafsrpc/afsrpc.def:1.11	Mon Dec 19 07:35:22 2005
--- openafs/src/libafsrpc/afsrpc.def	Sat Jun 24 16:41:55 2006
***************
*** 215,220 ****
          rx_StartClientThread                    @220
  	rxkad_global_stats_lock			@221 DATA
  	rxkad_stats_key				@222 DATA
!         rx_DebugOnOff                           @223
!         
! 
--- 215,221 ----
          rx_StartClientThread                    @220
  	rxkad_global_stats_lock			@221 DATA
  	rxkad_stats_key				@222 DATA
! 	rx_DebugOnOff				@223
! 	rx_InitHost				@224
! 	rx_NewServiceHost			@225
!         osi_AssertFailU				@226
Index: openafs/src/libuafs/Makefile.common.in
diff -c openafs/src/libuafs/Makefile.common.in:1.13 openafs/src/libuafs/Makefile.common.in:1.13.4.1
*** openafs/src/libuafs/Makefile.common.in:1.13	Sat Jun 18 20:19:06 2005
--- openafs/src/libuafs/Makefile.common.in	Tue Jun 20 17:40:11 2006
***************
*** 1314,1320 ****
  
  clean:
  	-$(RM) -rf UAFS* JUAFS* AFSWEB* nsapi des afs afsint config rx
! 	-$(RM) -f  h net netinet rpc ufs machine inet nfs sys des linktest
  
  
  ${TOP_LIBDIR}/$(LIBAFSWEB): AFSWEB/$(LIBAFSWEB)
--- 1314,1320 ----
  
  clean:
  	-$(RM) -rf UAFS* JUAFS* AFSWEB* nsapi des afs afsint config rx
! 	-$(RM) -f  h net netinet rpc ufs machine inet nfs sys des linktest $(AFS_OS_CLEAN)
  
  
  ${TOP_LIBDIR}/$(LIBAFSWEB): AFSWEB/$(LIBAFSWEB)
Index: openafs/src/libuafs/MakefileProto.AIX.in
diff -c openafs/src/libuafs/MakefileProto.AIX.in:1.9 openafs/src/libuafs/MakefileProto.AIX.in:1.9.8.1
*** openafs/src/libuafs/MakefileProto.AIX.in:1.9	Tue Dec  7 11:49:08 2004
--- openafs/src/libuafs/MakefileProto.AIX.in	Tue Jun 20 17:40:11 2006
***************
*** 30,35 ****
--- 30,40 ----
  LIBAFSWEB = nsafs.a
  LIBAFSWEBKRB = nsafs.krb.a
  
+ 
+ AFS_OS_CLEAN = \
+ 	*.exp \
+ 	export.h
+ 
  # To get __file__ (afs_osi_pag.c) you need to specify language level 
  # C99 to xlc_r like this:
  OPTF=-O -qlanglvl=stdc99
Index: openafs/src/packaging/MacOS/OpenAFS.Info.plist
diff -c openafs/src/packaging/MacOS/OpenAFS.Info.plist:1.2.10.1 openafs/src/packaging/MacOS/OpenAFS.Info.plist:1.2.10.2
*** openafs/src/packaging/MacOS/OpenAFS.Info.plist:1.2.10.1	Wed Jun  7 01:03:08 2006
--- openafs/src/packaging/MacOS/OpenAFS.Info.plist	Wed Jul  5 16:21:29 2006
***************
*** 3,15 ****
  <plist version="1.0">
  <dict>
  	<key>CFBundleGetInfoString</key>
! 	<string>OpenAFS 1.5.2</string>
  	<key>CFBundleIdentifier</key>
  	<string>org.openafs.OpenAFS.pkg</string>
  	<key>CFBundleName</key>
  	<string>OpenAFS</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.5.2</string>
  	<key>IFMajorVersion</key>
  	<integer>1</integer>
  	<key>IFMinorVersion</key>
--- 3,15 ----
  <plist version="1.0">
  <dict>
  	<key>CFBundleGetInfoString</key>
! 	<string>OpenAFS 1.5.3</string>
  	<key>CFBundleIdentifier</key>
  	<string>org.openafs.OpenAFS.pkg</string>
  	<key>CFBundleName</key>
  	<string>OpenAFS</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.5.3</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.1 openafs/src/packaging/MacOS/OpenAFS.info:1.1.12.2
*** openafs/src/packaging/MacOS/OpenAFS.info:1.1.12.1	Wed Jun  7 01:03:08 2006
--- openafs/src/packaging/MacOS/OpenAFS.info	Wed Jul  5 16:21:29 2006
***************
*** 1,5 ****
  Title OpenAFS
! Version 1.5.2
  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.3
  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/Makefile.in
diff -c openafs/src/ptserver/Makefile.in:1.16 openafs/src/ptserver/Makefile.in:1.16.6.1
*** openafs/src/ptserver/Makefile.in:1.16	Tue Apr 26 21:49:47 2005
--- openafs/src/ptserver/Makefile.in	Mon Jul  3 15:07:15 2006
***************
*** 75,81 ****
  ptint.xdr.o: ptint.xdr.c ptint.h ptint.xg
  
  ptint.cs.c: ptint.xg
! 	${RXGEN} -x -C -o $@ ${srcdir}/ptint.xg
  
  ptint.ss.c: ptint.xg
  	${RXGEN} -x -S -o $@ ${srcdir}/ptint.xg
--- 75,81 ----
  ptint.xdr.o: ptint.xdr.c ptint.h ptint.xg
  
  ptint.cs.c: ptint.xg
! 	${RXGEN} -x -C -u -o $@ ${srcdir}/ptint.xg
  
  ptint.ss.c: ptint.xg
  	${RXGEN} -x -S -o $@ ${srcdir}/ptint.xg
***************
*** 84,90 ****
  	${RXGEN} -x -c -o $@ ${srcdir}/ptint.xg
  
  ptint.h: ptint.xg
! 	${RXGEN} -x -h -o $@ ${srcdir}/ptint.xg
  
  ptint.cs.c: ptint.h
  ptint.ss.c: ptint.h
--- 84,90 ----
  	${RXGEN} -x -c -o $@ ${srcdir}/ptint.xg
  
  ptint.h: ptint.xg
! 	${RXGEN} -x -h -u -o $@ ${srcdir}/ptint.xg
  
  ptint.cs.c: ptint.h
  ptint.ss.c: ptint.h
Index: openafs/src/ptserver/NTMakefile
diff -c openafs/src/ptserver/NTMakefile:1.14 openafs/src/ptserver/NTMakefile:1.14.4.1
*** openafs/src/ptserver/NTMakefile:1.14	Sun Nov 20 20:57:17 2005
--- openafs/src/ptserver/NTMakefile	Tue Jul  4 02:28:25 2006
***************
*** 10,15 ****
--- 10,16 ----
  RELDIR=ptserver
  !INCLUDE ..\config\NTMakefile.$(SYS_NAME)
  !include ..\config\NTMakefile.version
+ AFSDEV_AUXCDEFINES = -DAFS_USE_GETTIMEOFDAY
  
  ############################################################################
  # Definitions for installing header files
***************
*** 137,144 ****
  
  $(INCFILEDIR)\afs\ptint.h : ptint.h
  
! ptint.ss.c ptint.cs.c ptint.xdr.c ptint.h: ptint.xg
! 	$(RXGEN) -x $**
  
  ############################################################################
  # Definitions for generating files via COMPILE_ET
--- 138,154 ----
  
  $(INCFILEDIR)\afs\ptint.h : ptint.h
  
! ptint.cs.c: ptint.xg ptint.h
! 	$(RXGEN) -x -C -u -o $@ ptint.xg
! 
! ptint.ss.c: ptint.xg ptint.h
! 	$(RXGEN) -x -S -o $@ ptint.xg
! 
! ptint.xdr.c: ptint.xg ptint.h
! 	$(RXGEN) -x -c -o $@ ptint.xg
! 
! ptint.h: ptint.xg
! 	$(RXGEN) -x -h -u -o $@ ptint.xg
  
  ############################################################################
  # Definitions for generating files via COMPILE_ET
Index: openafs/src/ptserver/ptclient.c
diff -c openafs/src/ptserver/ptclient.c:1.12 openafs/src/ptserver/ptclient.c:1.12.14.2
*** openafs/src/ptserver/ptclient.c:1.12	Sun Dec  7 17:49:35 2003
--- openafs/src/ptserver/ptclient.c	Tue Jul  4 02:28:25 2006
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/ptclient.c,v 1.12 2003/12/07 22:49:35 jaltman 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.2 2006/07/04 06:28:25 jaltman Exp $");
  
  #ifdef	AFS_AIX32_ENV
  #include <signal.h>
***************
*** 171,177 ****
      register afs_int32 code;
      char op[8];
      char name[PR_MAXNAMELEN];
!     afs_int32 id, oid, gid;
      afs_int32 pos;
      int i;
      struct prentry entry;
--- 171,177 ----
      register afs_int32 code;
      char op[8];
      char name[PR_MAXNAMELEN];
!     afs_int32 id, oid = ANONYMOUSID, gid;
      afs_int32 pos;
      int i;
      struct prentry entry;
***************
*** 267,273 ****
  	    /* use ubik_Call to do the work, finding an up server and handling
  	     * the job of finding a sync site, if need be */
  	    else
! 		code = ubik_Call(PR_INewEntry, pruclient, 0, name, id, oid);
  	    if (CodeOk(code))
  		com_err(whoami, code, "on %s %s %d %d", op, name, id, oid);
  	} else if (!strcmp(op, "sf")) {
--- 267,273 ----
  	    /* use ubik_Call to do the work, finding an up server and handling
  	     * the job of finding a sync site, if need be */
  	    else
! 		code = ubik_PR_INewEntry(pruclient, 0, name, id, oid);
  	    if (CodeOk(code))
  		com_err(whoami, code, "on %s %s %d %d", op, name, id, oid);
  	} else if (!strcmp(op, "sf")) {
***************
*** 277,283 ****
  		code = PRBADARG;
  	    else
  		code =
! 		    ubik_Call(PR_SetFieldsEntry, pruclient, 0, id, mask,
  			      access, gq, uq, 0, 0);
  	    if (CodeOk(code))
  		com_err(whoami, code, "on %s %d %x %x %d %d", op, id, mask,
--- 277,283 ----
  		code = PRBADARG;
  	    else
  		code =
! 		    ubik_PR_SetFieldsEntry(pruclient, 0, id, mask,
  			      access, gq, uq, 0, 0);
  	    if (CodeOk(code))
  		com_err(whoami, code, "on %s %d %x %x %d %d", op, id, mask,
***************
*** 290,296 ****
  		code = PRBADARG;
  	    else
  		code =
! 		    ubik_Call(PR_ChangeEntry, pruclient, 0, id, newname, oid,
  			      newid);
  	    if (CodeOk(code))
  		com_err(whoami, code, "on %s %d %s %d %d", op, id, newname,
--- 290,296 ----
  		code = PRBADARG;
  	    else
  		code =
! 		    ubik_PR_ChangeEntry(pruclient, 0, id, newname, oid,
  			      newid);
  	    if (CodeOk(code))
  		com_err(whoami, code, "on %s %d %s %d %d", op, id, newname,
***************
*** 300,306 ****
  	    if (GetInt32(&id))
  		code = PRBADARG;
  	    else
! 		code = ubik_Call(PR_WhereIsIt, pruclient, 0, id, &pos);
  	    if (CodeOk(code))
  		printf("%s\n", pr_ErrorMsg(code));
  	    else
--- 300,306 ----
  	    if (GetInt32(&id))
  		code = PRBADARG;
  	    else
! 		code = ubik_PR_WhereIsIt(pruclient, 0, id, &pos);
  	    if (CodeOk(code))
  		printf("%s\n", pr_ErrorMsg(code));
  	    else
***************
*** 311,317 ****
  	    if (GetInt32(&pos))
  		code = PRBADARG;
  	    else
! 		code = ubik_Call(PR_DumpEntry, pruclient, 0, pos, &entry);
  	    if (CodeOk(code))
  		printf("%s\n", pr_ErrorMsg(code));
  	    if (code == PRSUCCESS) {
--- 311,317 ----
  	    if (GetInt32(&pos))
  		code = PRBADARG;
  	    else
! 		code = ubik_PR_DumpEntry(pruclient, 0, pos, &entry);
  	    if (CodeOk(code))
  		printf("%s\n", pr_ErrorMsg(code));
  	    if (code == PRSUCCESS) {
***************
*** 332,338 ****
  	    if (GetInt32(&id) || GetInt32(&gid))
  		code = PRBADARG;
  	    else
! 		code = ubik_Call(PR_AddToGroup, pruclient, 0, id, gid);
  	    if (CodeOk(code))
  		com_err(whoami, code, "on %s %d %d", op, id, gid);
  	} else if (!strcmp(op, "iton")) {
--- 332,338 ----
  	    if (GetInt32(&id) || GetInt32(&gid))
  		code = PRBADARG;
  	    else
! 		code = ubik_PR_AddToGroup(pruclient, 0, id, gid);
  	    if (CodeOk(code))
  		com_err(whoami, code, "on %s %d %d", op, id, gid);
  	} else if (!strcmp(op, "iton")) {
***************
*** 351,357 ****
  	    }
  	    lnames.namelist_val = 0;
  	    lnames.namelist_len = 0;
! 	    code = ubik_Call(PR_IDToName, pruclient, 0, &lid, &lnames);
  	    if (CodeOk(code))
  		printf("%s\n", pr_ErrorMsg(code));
  	    if (code == PRSUCCESS) {
--- 351,357 ----
  	    }
  	    lnames.namelist_val = 0;
  	    lnames.namelist_len = 0;
! 	    code = ubik_PR_IDToName(pruclient, 0, &lid, &lnames);
  	    if (CodeOk(code))
  		printf("%s\n", pr_ErrorMsg(code));
  	    if (code == PRSUCCESS) {
***************
*** 382,388 ****
  	    }
  	    lid.idlist_val = 0;
  	    lid.idlist_len = 0;
! 	    code = ubik_Call(PR_NameToID, pruclient, 0, &lnames, &lid);
  	    if (CodeOk(code))
  		printf("%s\n", pr_ErrorMsg(code));
  	    if (code == PRSUCCESS) {
--- 382,388 ----
  	    }
  	    lid.idlist_val = 0;
  	    lid.idlist_len = 0;
! 	    code = ubik_PR_NameToID(pruclient, 0, &lnames, &lid);
  	    if (CodeOk(code))
  		printf("%s\n", pr_ErrorMsg(code));
  	    if (code == PRSUCCESS) {
***************
*** 399,405 ****
  	    if (GetInt32(&id))
  		code = PRBADARG;
  	    else
! 		code = ubik_Call(PR_Delete, pruclient, 0, id);
  	    if (CodeOk(code))
  		printf("%s\n", pr_ErrorMsg(code));
  	} else if (!strcmp(op, "dg")) {
--- 399,405 ----
  	    if (GetInt32(&id))
  		code = PRBADARG;
  	    else
! 		code = ubik_PR_Delete(pruclient, 0, id);
  	    if (CodeOk(code))
  		printf("%s\n", pr_ErrorMsg(code));
  	} else if (!strcmp(op, "dg")) {
***************
*** 407,413 ****
  	    if (GetInt32(&id))
  		code = PRBADARG;
  	    else
! 		code = ubik_Call(PR_Delete, pruclient, 0, id);
  	    if (CodeOk(code))
  		printf("%s\n", pr_ErrorMsg(code));
  	} else if (!strcmp(op, "rm")) {
--- 407,413 ----
  	    if (GetInt32(&id))
  		code = PRBADARG;
  	    else
! 		code = ubik_PR_Delete(pruclient, 0, id);
  	    if (CodeOk(code))
  		printf("%s\n", pr_ErrorMsg(code));
  	} else if (!strcmp(op, "rm")) {
***************
*** 415,421 ****
  	    if (GetInt32(&id) || GetInt32(&gid))
  		code = PRBADARG;
  	    else
! 		code = ubik_Call(PR_RemoveFromGroup, pruclient, 0, id, gid);
  	    if (CodeOk(code))
  		printf("%s\n", pr_ErrorMsg(code));
  	}
--- 415,421 ----
  	    if (GetInt32(&id) || GetInt32(&gid))
  		code = PRBADARG;
  	    else
! 		code = ubik_PR_RemoveFromGroup(pruclient, 0, id, gid);
  	    if (CodeOk(code))
  		printf("%s\n", pr_ErrorMsg(code));
  	}
***************
*** 428,434 ****
  		code = PRBADARG;
  	    else
  		code =
! 		    ubik_Call(PR_ListSuperGroups, pruclient, 0, id, &alist,
  			      &over);
  	    if (CodeOk(code))
  		printf("%s\n", pr_ErrorMsg(code));
--- 428,434 ----
  		code = PRBADARG;
  	    else
  		code =
! 		    ubik_PR_ListSuperGroups(pruclient, 0, id, &alist,
  			      &over);
  	    if (CodeOk(code))
  		printf("%s\n", pr_ErrorMsg(code));
***************
*** 453,459 ****
  	    if (GetInt32(&id))
  		code = PRBADARG;
  	    else
! 		code = ubik_Call(PR_GetCPS, pruclient, 0, id, &alist, &over);
  	    if (CodeOk(code))
  		printf("%s\n", pr_ErrorMsg(code));
  	    if (code == PRSUCCESS) {
--- 453,459 ----
  	    if (GetInt32(&id))
  		code = PRBADARG;
  	    else
! 		code = ubik_PR_GetCPS(pruclient, 0, id, &alist, &over);
  	    if (CodeOk(code))
  		printf("%s\n", pr_ErrorMsg(code));
  	    if (code == PRSUCCESS) {
***************
*** 480,486 ****
  		hostaddr = hostinfo->h_addr_list[0];
  		id = ntohl(hostaddr->s_addr);
  		code =
! 		    ubik_Call(PR_GetHostCPS, pruclient, 0, id, &alist, &over);
  	    }
  	    if (CodeOk(code))
  		printf("%s\n", pr_ErrorMsg(code));
--- 480,486 ----
  		hostaddr = hostinfo->h_addr_list[0];
  		id = ntohl(hostaddr->s_addr);
  		code =
! 		    ubik_PR_GetHostCPS(pruclient, 0, id, &alist, &over);
  	    }
  	    if (CodeOk(code))
  		printf("%s\n", pr_ErrorMsg(code));
***************
*** 506,512 ****
  		code = PRBADARG;
  	    else
  		code =
! 		    ubik_Call(PR_ListElements, pruclient, 0, id, &alist,
  			      &over);
  	    if (CodeOk(code))
  		printf("%s\n", pr_ErrorMsg(code));
--- 506,512 ----
  		code = PRBADARG;
  	    else
  		code =
! 		    ubik_PR_ListElements(pruclient, 0, id, &alist,
  			      &over);
  	    if (CodeOk(code))
  		printf("%s\n", pr_ErrorMsg(code));
***************
*** 539,551 ****
  	    if (GetString(name, sizeof(name)))
  		code = PRBADARG;
  	    else
! 		code = ubik_Call(PR_NewEntry, pruclient, 0, name, 1, &id);
  	    if (CodeOk(code))
  		printf("%s\n", pr_ErrorMsg(code));
  	    if (code == PRSUCCESS)
  		printf("Id is %d.\n", id);
  	} else if (!strcmp(op, "lm")) {
! 	    code = ubik_Call(PR_ListMax, pruclient, 0, &id, &gid);
  	    if (CodeOk(code))
  		printf("%s\n", pr_ErrorMsg(code));
  	    if (code == PRSUCCESS)
--- 539,551 ----
  	    if (GetString(name, sizeof(name)))
  		code = PRBADARG;
  	    else
! 		code = ubik_PR_NewEntry(pruclient, 0, name, 1, oid, &id);
  	    if (CodeOk(code))
  		printf("%s\n", pr_ErrorMsg(code));
  	    if (code == PRSUCCESS)
  		printf("Id is %d.\n", id);
  	} else if (!strcmp(op, "lm")) {
! 	    code = ubik_PR_ListMax(pruclient, 0, &id, &gid);
  	    if (CodeOk(code))
  		printf("%s\n", pr_ErrorMsg(code));
  	    if (code == PRSUCCESS)
***************
*** 556,562 ****
  	    if (GetInt32(&id))
  		code = PRBADARG;
  	    else
! 		code = ubik_Call(PR_SetMax, pruclient, 0, id, 0);
  	    if (CodeOk(code))
  		printf("%s\n", pr_ErrorMsg(code));
  	} else if (!strcmp(op, "smg")) {
--- 556,562 ----
  	    if (GetInt32(&id))
  		code = PRBADARG;
  	    else
! 		code = ubik_PR_SetMax(pruclient, 0, id, 0);
  	    if (CodeOk(code))
  		printf("%s\n", pr_ErrorMsg(code));
  	} else if (!strcmp(op, "smg")) {
***************
*** 564,570 ****
  	    if (GetInt32(&id))
  		code = PRBADARG;
  	    else
! 		code = ubik_Call(PR_SetMax, pruclient, 0, id, 1);
  	    if (CodeOk(code))
  		printf("%s\n", pr_ErrorMsg(code));
  	} else if (!strcmp(op, "sin")) {
--- 564,570 ----
  	    if (GetInt32(&id))
  		code = PRBADARG;
  	    else
! 		code = ubik_PR_SetMax(pruclient, 0, id, 1);
  	    if (CodeOk(code))
  		printf("%s\n", pr_ErrorMsg(code));
  	} else if (!strcmp(op, "sin")) {
***************
*** 609,615 ****
  /*		continue;*/
  	    }
  	    uentry.Mask = PRUPDATE_IDHASH;
! 	    code = ubik_Call(PR_UpdateEntry, pruclient, 0, 0, name, &uentry);
  	    if (code) {
  		printf("Failed to update entry %s (err=%d)\n", name, code);
  		continue;
--- 609,615 ----
  /*		continue;*/
  	    }
  	    uentry.Mask = PRUPDATE_IDHASH;
! 	    code = ubik_PR_UpdateEntry(pruclient, 0, 0, name, &uentry);
  	    if (code) {
  		printf("Failed to update entry %s (err=%d)\n", name, code);
  		continue;
***************
*** 637,643 ****
  	    }
  	    uentry.Mask = PRUPDATE_NAMEHASH;
  	    code =
! 		ubik_Call(PR_UpdateEntry, pruclient, 0, id, "_foo_", &uentry);
  	    if (code) {
  		printf("Failed to update entry with id %d (err=%d)\n", id,
  		       code);
--- 637,643 ----
  	    }
  	    uentry.Mask = PRUPDATE_NAMEHASH;
  	    code =
! 		ubik_PR_UpdateEntry(pruclient, 0, id, "_foo_", &uentry);
  	    if (code) {
  		printf("Failed to update entry with id %d (err=%d)\n", id,
  		       code);
***************
*** 667,673 ****
  /*		continue;*/
  	    }
  	    uentry.Mask = PRUPDATE_IDHASH;
! 	    code = ubik_Call(PR_UpdateEntry, pruclient, 0, 0, name, &uentry);
  	    if (code) {
  		printf("Failed to update entry %s (err=%d)\n", name, code);
  		continue;
--- 667,673 ----
  /*		continue;*/
  	    }
  	    uentry.Mask = PRUPDATE_IDHASH;
! 	    code = ubik_PR_UpdateEntry(pruclient, 0, 0, name, &uentry);
  	    if (code) {
  		printf("Failed to update entry %s (err=%d)\n", name, code);
  		continue;
***************
*** 695,701 ****
  	    }
  	    uentry.Mask = PRUPDATE_NAMEHASH;
  	    code =
! 		ubik_Call(PR_UpdateEntry, pruclient, 0, id, "_foo_", &uentry);
  	    if (code) {
  		printf("Failed to update entry with id %d (err=%d)\n", id,
  		       code);
--- 695,701 ----
  	    }
  	    uentry.Mask = PRUPDATE_NAMEHASH;
  	    code =
! 		ubik_PR_UpdateEntry(pruclient, 0, id, "_foo_", &uentry);
  	    if (code) {
  		printf("Failed to update entry with id %d (err=%d)\n", id,
  		       code);
Index: openafs/src/ptserver/ptprocs.c
diff -c openafs/src/ptserver/ptprocs.c:1.29 openafs/src/ptserver/ptprocs.c:1.29.2.1
*** openafs/src/ptserver/ptprocs.c:1.29	Mon Mar 13 10:09:40 2006
--- openafs/src/ptserver/ptprocs.c	Mon Jul  3 23:57:24 2006
***************
*** 51,57 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/ptprocs.c,v 1.29 2006/03/13 15:09:40 jaltman Exp $");
  
  #include <afs/stds.h>
  #include <ctype.h>
--- 51,57 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/ptprocs.c,v 1.29.2.1 2006/07/04 03:57:24 shadow Exp $");
  
  #include <afs/stds.h>
  #include <ctype.h>
***************
*** 104,110 ****
  afs_int32 listSuperGroups();
  #endif
  
- static stolower();
  extern int IDCmp();
  
  extern int prp_group_default;
--- 104,109 ----
***************
*** 2217,2235 ****
      return code;
  }
  
- 
- static
- stolower(s)
-      register char *s;
- {
-     register int tc;
-     while ((tc = *s)) {
- 	if (isupper(tc))
- 	    *s = tolower(tc);
- 	s++;
-     }
- }
- 
  #if IP_WILDCARDS
  afs_int32
  addWildCards(tt, alist, host)
--- 2216,2221 ----
Index: openafs/src/ptserver/ptserver.c
diff -c openafs/src/ptserver/ptserver.c:1.25 openafs/src/ptserver/ptserver.c:1.25.2.3
*** openafs/src/ptserver/ptserver.c:1.25	Tue Feb 21 23:07:39 2006
--- openafs/src/ptserver/ptserver.c	Tue Jun 20 16:37:11 2006
***************
*** 112,118 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/ptserver.c,v 1.25 2006/02/22 04:07:39 jaltman Exp $");
  
  #include <afs/stds.h>
  #ifdef	AFS_AIX32_ENV
--- 112,118 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/ptserver.c,v 1.25.2.3 2006/06/20 20:37:11 jaltman Exp $");
  
  #include <afs/stds.h>
  #ifdef	AFS_AIX32_ENV
***************
*** 167,172 ****
--- 167,176 ----
  
  int restricted = 0;
  int rxMaxMTU = -1;
+ int rxBind = 0;
+ 
+ #define ADDRSPERSITE 16         /* Same global is in rx/rx_user.c */
+ afs_uint32 SHostAddrs[ADDRSPERSITE];
  
  static struct afsconf_cell info;
  
***************
*** 222,227 ****
--- 226,232 ----
      int kerberosKeys;		/* set if found some keys */
      int lwps = 3;
      char clones[MAXHOSTSPERCELL];
+     afs_uint32 host = htonl(INADDR_ANY);
  
      const char *pr_dbaseName;
      char *whoami = "ptserver";
***************
*** 305,310 ****
--- 310,318 ----
  	else if (strncmp(arg, "-restricted", alen) == 0) {
  	    restricted = 1;
  	}
+ 	else if (strncmp(arg, "-rxbind", alen) == 0) {
+ 	    rxBind = 1;
+ 	}
  	else if (strncmp(arg, "-enable_peer_stats", alen) == 0) {
  	    rx_enablePeerRPCStats();
  	} else if (strncmp(arg, "-enable_process_stats", alen) == 0) {
***************
*** 374,389 ****
  		   "[-syslog[=FACILITY]] "
  		   "[-p <number of processes>] [-rebuild] "
  		   "[-groupdepth <depth>] "
! 		   "[-restricted] [-rxmaxmtu <bytes>]"
  		   "[-enable_peer_stats] [-enable_process_stats] "
  		   "[-default_access default_user_access default_group_access] "
  		   "[-help]\n");
  #else /* AFS_NT40_ENV */
  	    printf("Usage: ptserver [-database <db path>] "
  		   "[-auditlog <log path>] "
! 		   "[-p <number of processes>] [-rebuild] "
  		   "[-default_access default_user_access default_group_access] "
! 		   "[-restricted] [-rxmaxmtu <bytes>]"
  		   "[-groupdepth <depth>] " "[-help]\n");
  #endif
  #else
--- 382,397 ----
  		   "[-syslog[=FACILITY]] "
  		   "[-p <number of processes>] [-rebuild] "
  		   "[-groupdepth <depth>] "
! 		   "[-restricted] [-rxmaxmtu <bytes>] [-rxbind] "
  		   "[-enable_peer_stats] [-enable_process_stats] "
  		   "[-default_access default_user_access default_group_access] "
  		   "[-help]\n");
  #else /* AFS_NT40_ENV */
  	    printf("Usage: ptserver [-database <db path>] "
  		   "[-auditlog <log path>] "
! 		   "[-p <number of processes>] [-rebuild] [-rxbind] "
  		   "[-default_access default_user_access default_group_access] "
! 		   "[-restricted] [-rxmaxmtu <bytes>] [-rxbind] "
  		   "[-groupdepth <depth>] " "[-help]\n");
  #endif
  #else
***************
*** 394,406 ****
  		   "[-p <number of processes>] [-rebuild] "
  		   "[-enable_peer_stats] [-enable_process_stats] "
  		   "[-default_access default_user_access default_group_access] "
! 		   "[-restricted] [-rxmaxmtu <bytes>]"
  		   "[-help]\n");
  #else /* AFS_NT40_ENV */
  	    printf("Usage: ptserver [-database <db path>] "
  		   "[-auditlog <log path>] "
  		   "[-default_access default_user_access default_group_access] "
! 		   "[-restricted] [-rxmaxmtu <bytes>]"
  		   "[-p <number of processes>] [-rebuild] " "[-help]\n");
  #endif
  #endif
--- 402,414 ----
  		   "[-p <number of processes>] [-rebuild] "
  		   "[-enable_peer_stats] [-enable_process_stats] "
  		   "[-default_access default_user_access default_group_access] "
! 		   "[-restricted] [-rxmaxmtu <bytes>] [-rxbind] "
  		   "[-help]\n");
  #else /* AFS_NT40_ENV */
  	    printf("Usage: ptserver [-database <db path>] "
  		   "[-auditlog <log path>] "
  		   "[-default_access default_user_access default_group_access] "
! 		   "[-restricted] [-rxmaxmtu <bytes>] [-rxbind] "
  		   "[-p <number of processes>] [-rebuild] " "[-help]\n");
  #endif
  #endif
***************
*** 493,498 ****
--- 501,528 ----
       * and the header are in separate Ubik buffers then 120 buffers may be
       * required. */
      ubik_nBuffers = 120 + /*fudge */ 40;
+ 
+     if (rxBind) {
+ 	afs_int32 ccode;
+ #ifndef AFS_NT40_ENV
+ 	if (AFSDIR_SERVER_NETRESTRICT_FILEPATH || 
+ 	    AFSDIR_SERVER_NETINFO_FILEPATH) {
+ 	    char reason[1024];
+ 	    ccode = parseNetFiles(SHostAddrs, NULL, NULL,
+ 					   ADDRSPERSITE, reason,
+ 					   AFSDIR_SERVER_NETINFO_FILEPATH,
+ 					   AFSDIR_SERVER_NETRESTRICT_FILEPATH);
+ 	} else 
+ #endif
+ 	{
+ 	    ccode = rx_getAllAddr(SHostAddrs, ADDRSPERSITE);
+ 	}
+ 	if (ccode == 1) {
+ 	    host = SHostAddrs[0];
+ 	    rx_InitHost(host, htons(AFSCONF_PROTPORT));
+ 	}
+     }
+ 
      code =
  	ubik_ServerInitByInfo(myHost, htons(AFSCONF_PROTPORT), &info, &clones,
  			      pr_dbaseName, &dbase);
***************
*** 519,525 ****
      }
  
      tservice =
! 	rx_NewService(0, PRSRV, "Protection Server", sc, 3,
  		      PR_ExecuteRequest);
      if (tservice == (struct rx_service *)0) {
  	fprintf(stderr, "ptserver: Could not create new rx service.\n");
--- 549,555 ----
      }
  
      tservice =
! 	rx_NewServiceHost(host, 0, PRSRV, "Protection Server", sc, 3,
  		      PR_ExecuteRequest);
      if (tservice == (struct rx_service *)0) {
  	fprintf(stderr, "ptserver: Could not create new rx service.\n");
***************
*** 529,535 ****
      rx_SetMaxProcs(tservice, lwps);
  
      tservice =
! 	rx_NewService(0, RX_STATS_SERVICE_ID, "rpcstats", sc, 3,
  		      RXSTATS_ExecuteRequest);
      if (tservice == (struct rx_service *)0) {
  	fprintf(stderr, "ptserver: Could not create new rx service.\n");
--- 559,565 ----
      rx_SetMaxProcs(tservice, lwps);
  
      tservice =
! 	rx_NewServiceHost(host, 0, RX_STATS_SERVICE_ID, "rpcstats", sc, 3,
  		      RXSTATS_ExecuteRequest);
      if (tservice == (struct rx_service *)0) {
  	fprintf(stderr, "ptserver: Could not create new rx service.\n");
Index: openafs/src/ptserver/ptuser.c
diff -c openafs/src/ptserver/ptuser.c:1.25 openafs/src/ptserver/ptuser.c:1.25.2.2
*** openafs/src/ptserver/ptuser.c:1.25	Fri Mar  3 15:27:23 2006
--- openafs/src/ptserver/ptuser.c	Mon Jul  3 23:57:24 2006
***************
*** 15,21 ****
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/ptuser.c,v 1.25 2006/03/03 20:27:23 rees Exp $");
  
  #if defined(UKERNEL)
  #include "afs/sysincludes.h"
--- 15,21 ----
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/ptuser.c,v 1.25.2.2 2006/07/04 03:57:24 shadow Exp $");
  
  #if defined(UKERNEL)
  #include "afs/sysincludes.h"
***************
*** 263,272 ****
  
      stolower(name);
      if (*id) {
! 	code = ubik_Call(PR_INewEntry, pruclient, 0, name, *id, 0);
  	return code;
      } else {
! 	code = ubik_Call(PR_NewEntry, pruclient, 0, name, 0, 0, id);
  	return code;
      }
  
--- 263,272 ----
  
      stolower(name);
      if (*id) {
! 	code = ubik_PR_INewEntry(pruclient, 0, name, *id, 0);
  	return code;
      } else {
! 	code = ubik_PR_NewEntry(pruclient, 0, name, 0, 0, id);
  	return code;
      }
  
***************
*** 289,298 ****
      }
      flags |= PRGRP;
      if (*id) {
! 	code = ubik_Call(PR_INewEntry, pruclient, 0, name, *id, oid);
  	return code;
      } else {
! 	code = ubik_Call(PR_NewEntry, pruclient, 0, name, flags, oid, id);
  	return code;
      }
  }
--- 289,298 ----
      }
      flags |= PRGRP;
      if (*id) {
! 	code = ubik_PR_INewEntry(pruclient, 0, name, *id, oid);
  	return code;
      } else {
! 	code = ubik_PR_NewEntry(pruclient, 0, name, flags, oid, id);
  	return code;
      }
  }
***************
*** 309,315 ****
  	return code;
      if (id == ANONYMOUSID)
  	return PRNOENT;
!     code = ubik_Call(PR_Delete, pruclient, 0, id);
      return code;
  }
  
--- 309,315 ----
  	return code;
      if (id == ANONYMOUSID)
  	return PRNOENT;
!     code = ubik_PR_Delete(pruclient, 0, id);
      return code;
  }
  
***************
*** 318,324 ****
  {
      register afs_int32 code;
  
!     code = ubik_Call(PR_Delete, pruclient, 0, id);
      return code;
  }
  
--- 318,324 ----
  {
      register afs_int32 code;
  
!     code = ubik_PR_Delete(pruclient, 0, id);
      return code;
  }
  
***************
*** 345,351 ****
  	goto done;
      }
      code =
! 	ubik_Call(PR_AddToGroup, pruclient, 0, lids.idlist_val[0],
  		  lids.idlist_val[1]);
    done:
      if (lnames.namelist_val)
--- 345,351 ----
  	goto done;
      }
      code =
! 	ubik_PR_AddToGroup(pruclient, 0, lids.idlist_val[0],
  		  lids.idlist_val[1]);
    done:
      if (lnames.namelist_val)
***************
*** 378,384 ****
  	goto done;
      }
      code =
! 	ubik_Call(PR_RemoveFromGroup, pruclient, 0, lids.idlist_val[0],
  		  lids.idlist_val[1]);
    done:
      if (lnames.namelist_val)
--- 378,384 ----
  	goto done;
      }
      code =
! 	ubik_PR_RemoveFromGroup(pruclient, 0, lids.idlist_val[0],
  		  lids.idlist_val[1]);
    done:
      if (lnames.namelist_val)
***************
*** 397,403 ****
  
      for (i = 0; i < names->namelist_len; i++)
  	stolower(names->namelist_val[i]);
!     code = ubik_Call(PR_NameToID, pruclient, 0, names, ids);
      return code;
  }
  
--- 397,403 ----
  
      for (i = 0; i < names->namelist_len; i++)
  	stolower(names->namelist_val[i]);
!     code = ubik_PR_NameToID(pruclient, 0, names, ids);
      return code;
  }
  
***************
*** 414,420 ****
      lnames.namelist_val = (prname *) malloc(PR_MAXNAMELEN);
      stolower(name);
      strncpy(lnames.namelist_val[0], name, PR_MAXNAMELEN);
!     code = ubik_Call(PR_NameToID, pruclient, 0, &lnames, &lids);
      if (lids.idlist_val) {
  	*id = *lids.idlist_val;
  	free(lids.idlist_val);
--- 414,420 ----
      lnames.namelist_val = (prname *) malloc(PR_MAXNAMELEN);
      stolower(name);
      strncpy(lnames.namelist_val[0], name, PR_MAXNAMELEN);
!     code = ubik_PR_NameToID(pruclient, 0, &lnames, &lids);
      if (lids.idlist_val) {
  	*id = *lids.idlist_val;
  	free(lids.idlist_val);
***************
*** 429,435 ****
  {
      register afs_int32 code;
  
!     code = ubik_Call(PR_IDToName, pruclient, 0, ids, names);
      return code;
  }
  
--- 429,435 ----
  {
      register afs_int32 code;
  
!     code = ubik_PR_IDToName(pruclient, 0, ids, names);
      return code;
  }
  
***************
*** 445,451 ****
      *lids.idlist_val = id;
      lnames.namelist_len = 0;
      lnames.namelist_val = 0;
!     code = ubik_Call(PR_IDToName, pruclient, 0, &lids, &lnames);
      if (lnames.namelist_val) {
  	strncpy(name, lnames.namelist_val[0], PR_MAXNAMELEN);
  	free(lnames.namelist_val);
--- 445,451 ----
      *lids.idlist_val = id;
      lnames.namelist_len = 0;
      lnames.namelist_val = 0;
!     code = ubik_PR_IDToName(pruclient, 0, &lids, &lnames);
      if (lnames.namelist_val) {
  	strncpy(name, lnames.namelist_val[0], PR_MAXNAMELEN);
  	free(lnames.namelist_val);
***************
*** 462,468 ****
      afs_int32 over;
  
      over = 0;
!     code = ubik_Call(PR_GetCPS, pruclient, 0, id, CPS, &over);
      if (code != PRSUCCESS)
  	return code;
      if (over) {
--- 462,468 ----
      afs_int32 over;
  
      over = 0;
!     code = ubik_PR_GetCPS(pruclient, 0, id, CPS, &over);
      if (code != PRSUCCESS)
  	return code;
      if (over) {
***************
*** 481,487 ****
      afs_int32 over;
  
      over = 0;
!     code = ubik_Call(PR_GetCPS2, pruclient, 0, id, host, CPS, &over);
      if (code != PRSUCCESS)
  	return code;
      if (over) {
--- 481,487 ----
      afs_int32 over;
  
      over = 0;
!     code = ubik_PR_GetCPS2(pruclient, 0, id, host, CPS, &over);
      if (code != PRSUCCESS)
  	return code;
      if (over) {
***************
*** 500,506 ****
      afs_int32 over;
  
      over = 0;
!     code = ubik_Call(PR_GetHostCPS, pruclient, 0, host, CPS, &over);
      if (code != PRSUCCESS)
  	return code;
      if (over) {
--- 500,506 ----
      afs_int32 over;
  
      over = 0;
!     code = ubik_PR_GetHostCPS(pruclient, 0, host, CPS, &over);
      if (code != PRSUCCESS)
  	return code;
      if (over) {
***************
*** 537,543 ****
  
      alist.prlist_len = 0;
      alist.prlist_val = 0;
!     code = ubik_Call(PR_ListOwned, pruclient, 0, oid, &alist, moreP);
      if (code)
  	return code;
      if (*moreP == 1) {
--- 537,543 ----
  
      alist.prlist_len = 0;
      alist.prlist_val = 0;
!     code = ubik_PR_ListOwned(pruclient, 0, oid, &alist, moreP);
      if (code)
  	return code;
      if (*moreP == 1) {
***************
*** 565,571 ****
  
      alist.prlist_len = 0;
      alist.prlist_val = 0;
!     code = ubik_Call(PR_ListElements, pruclient, 0, gid, &alist, &over);
      if (code)
  	return code;
      if (over) {
--- 565,571 ----
  
      alist.prlist_len = 0;
      alist.prlist_val = 0;
!     code = ubik_PR_ListElements(pruclient, 0, gid, &alist, &over);
      if (code)
  	return code;
      if (over) {
***************
*** 586,592 ****
  {
      register afs_int32 code;
  
!     code = ubik_Call(PR_ListEntry, pruclient, 0, id, aentry);
      return code;
  }
  
--- 586,592 ----
  {
      register afs_int32 code;
  
!     code = ubik_PR_ListEntry(pruclient, 0, id, aentry);
      return code;
  }
  
***************
*** 603,609 ****
      bulkentries.prentries_len = 0;
  
      code =
! 	ubik_Call(PR_ListEntries, pruclient, 0, flag, startindex,
  		  &bulkentries, nextstartindex);
      *nentries = bulkentries.prentries_len;
      *entries = bulkentries.prentries_val;
--- 603,609 ----
      bulkentries.prentries_len = 0;
  
      code =
! 	ubik_PR_ListEntries(pruclient, 0, flag, startindex,
  		  &bulkentries, nextstartindex);
      *nentries = bulkentries.prentries_len;
      *entries = bulkentries.prentries_val;
***************
*** 622,628 ****
  	return code;
      if (*id == ANONYMOUSID)
  	return PRNOENT;
!     code = ubik_Call(PR_ListEntry, pruclient, 0, *id, &aentry);
      if (code)
  	return code;
      /* this should be done in one RPC, but I'm lazy. */
--- 622,629 ----
  	return code;
      if (*id == ANONYMOUSID)
  	return PRNOENT;
!     code = ubik_PR_ListEntry(pruclient, 0, *id, &aentry);
!       //code = ubik_PR_ListEntry(pruclient, 0, *id, &aentry);
      if (code)
  	return code;
      /* this should be done in one RPC, but I'm lazy. */
***************
*** 647,653 ****
  	return code;
      if (id == ANONYMOUSID)
  	return PRNOENT;
!     code = ubik_Call(PR_ListEntry, pruclient, 0, id, &aentry);
      if (code)
  	return code;
      /* this should be done in one RPC, but I'm lazy. */
--- 648,654 ----
  	return code;
      if (id == ANONYMOUSID)
  	return PRNOENT;
!     code = ubik_PR_ListEntry(pruclient, 0, id, &aentry);
      if (code)
  	return code;
      /* this should be done in one RPC, but I'm lazy. */
***************
*** 679,685 ****
  	if (oid == ANONYMOUSID)
  	    return PRNOENT;
      }
!     code = ubik_Call(PR_ChangeEntry, pruclient, 0, id, newname, oid, newid);
      return code;
  }
  
--- 680,686 ----
  	if (oid == ANONYMOUSID)
  	    return PRNOENT;
      }
!     code = ubik_PR_ChangeEntry(pruclient, 0, id, newname, oid, newid);
      return code;
  }
  
***************
*** 707,713 ****
  	return code;
      }
      code =
! 	ubik_Call(PR_IsAMemberOf, pruclient, 0, lids.idlist_val[0],
  		  lids.idlist_val[1], flag);
      if (lnames.namelist_val)
  	free(lnames.namelist_val);
--- 708,714 ----
  	return code;
      }
      code =
! 	ubik_PR_IsAMemberOf(pruclient, 0, lids.idlist_val[0],
  		  lids.idlist_val[1], flag);
      if (lnames.namelist_val)
  	free(lnames.namelist_val);
***************
*** 721,727 ****
  {
      register afs_int32 code;
      afs_int32 gid;
!     code = ubik_Call(PR_ListMax, pruclient, 0, mid, &gid);
      return code;
  }
  
--- 722,728 ----
  {
      register afs_int32 code;
      afs_int32 gid;
!     code = ubik_PR_ListMax(pruclient, 0, mid, &gid);
      return code;
  }
  
***************
*** 730,736 ****
  {
      register afs_int32 code;
      afs_int32 flag = 0;
!     code = ubik_Call(PR_SetMax, pruclient, 0, mid, flag);
      return code;
  }
  
--- 731,737 ----
  {
      register afs_int32 code;
      afs_int32 flag = 0;
!     code = ubik_PR_SetMax(pruclient, 0, mid, flag);
      return code;
  }
  
***************
*** 739,745 ****
  {
      register afs_int32 code;
      afs_int32 id;
!     code = ubik_Call(PR_ListMax, pruclient, 0, &id, mid);
      return code;
  }
  
--- 740,746 ----
  {
      register afs_int32 code;
      afs_int32 id;
!     code = ubik_PR_ListMax(pruclient, 0, &id, mid);
      return code;
  }
  
***************
*** 750,756 ****
      afs_int32 flag = 0;
  
      flag |= PRGRP;
!     code = ubik_Call(PR_SetMax, pruclient, 0, mid, flag);
      return code;
  }
  
--- 751,757 ----
      afs_int32 flag = 0;
  
      flag |= PRGRP;
!     code = ubik_PR_SetMax(pruclient, 0, mid, flag);
      return code;
  }
  
***************
*** 760,777 ****
      register afs_int32 code;
  
      code =
! 	ubik_Call(PR_SetFieldsEntry, pruclient, 0, id, mask, flags, ngroups,
  		  nusers, 0, 0);
      return code;
  }
- 
- int
- stolower(char *s)
- {
-     while (*s) {
- 	if (isupper(*s))
- 	    *s = tolower(*s);
- 	s++;
-     }
-     return 0;
- }
--- 761,767 ----
      register afs_int32 code;
  
      code =
! 	ubik_PR_SetFieldsEntry(pruclient, 0, id, mask, flags, ngroups,
  		  nusers, 0, 0);
      return code;
  }
Index: openafs/src/rx/rx.c
diff -c openafs/src/rx/rx.c:1.97 openafs/src/rx/rx.c:1.97.2.3
*** openafs/src/rx/rx.c:1.97	Fri Feb 17 23:46:01 2006
--- openafs/src/rx/rx.c	Sun Jul  2 21:06:45 2006
***************
*** 17,23 ****
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx.c,v 1.97 2006/02/18 04:46:01 jaltman Exp $");
  
  #ifdef KERNEL
  #include "afs/sysincludes.h"
--- 17,23 ----
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx.c,v 1.97.2.3 2006/07/03 01:06:45 jaltman Exp $");
  
  #ifdef KERNEL
  #include "afs/sysincludes.h"
***************
*** 1259,1267 ****
                           service name might be used for probing for
                           statistics) */
  struct rx_service *
! rx_NewService(u_short port, u_short serviceId, char *serviceName,
! 	      struct rx_securityClass **securityObjects, int nSecurityObjects,
! 	      afs_int32(*serviceProc) (struct rx_call * acall))
  {
      osi_socket socket = OSI_NULLSOCKET;
      register struct rx_service *tservice;
--- 1259,1268 ----
                           service name might be used for probing for
                           statistics) */
  struct rx_service *
! rx_NewServiceHost(afs_uint32 host, u_short port, u_short serviceId, 
! 		  char *serviceName, struct rx_securityClass **securityObjects,
! 		  int nSecurityObjects, 
! 		  afs_int32(*serviceProc) (struct rx_call * acall))
  {
      osi_socket socket = OSI_NULLSOCKET;
      register struct rx_service *tservice;
***************
*** 1292,1298 ****
      for (i = 0; i < RX_MAX_SERVICES; i++) {
  	register struct rx_service *service = rx_services[i];
  	if (service) {
! 	    if (port == service->servicePort) {
  		if (service->serviceId == serviceId) {
  		    /* The identical service has already been
  		     * installed; if the caller was intending to
--- 1293,1299 ----
      for (i = 0; i < RX_MAX_SERVICES; i++) {
  	register struct rx_service *service = rx_services[i];
  	if (service) {
! 	    if (port == service->servicePort && host == service->serviceHost) {
  		if (service->serviceId == serviceId) {
  		    /* The identical service has already been
  		     * installed; if the caller was intending to
***************
*** 1313,1319 ****
  	    if (socket == OSI_NULLSOCKET) {
  		/* If we don't already have a socket (from another
  		 * service on same port) get a new one */
! 		socket = rxi_GetHostUDPSocket(htonl(INADDR_ANY), port);
  		if (socket == OSI_NULLSOCKET) {
  		    USERPRI;
  		    rxi_FreeService(tservice);
--- 1314,1320 ----
  	    if (socket == OSI_NULLSOCKET) {
  		/* If we don't already have a socket (from another
  		 * service on same port) get a new one */
! 		socket = rxi_GetHostUDPSocket(host, port);
  		if (socket == OSI_NULLSOCKET) {
  		    USERPRI;
  		    rxi_FreeService(tservice);
***************
*** 1322,1327 ****
--- 1323,1329 ----
  	    }
  	    service = tservice;
  	    service->socket = socket;
+ 	    service->serviceHost = host;
  	    service->servicePort = port;
  	    service->serviceId = serviceId;
  	    service->serviceName = serviceName;
***************
*** 1345,1350 ****
--- 1347,1360 ----
      return 0;
  }
  
+ struct rx_service *
+ rx_NewService(u_short port, u_short serviceId, char *serviceName,
+ 	      struct rx_securityClass **securityObjects, int nSecurityObjects,
+ 	      afs_int32(*serviceProc) (struct rx_call * acall))
+ {
+     return rx_NewServiceHost(htonl(INADDR_ANY), port, serviceId, serviceName, securityObjects, nSecurityObjects, serviceProc);
+ }
+ 
  /* Generic request processing loop. This routine should be called
   * by the implementation dependent rx_ServerProc. If socketp is
   * non-null, it will be set to the file descriptor that this thread
***************
*** 2015,2020 ****
--- 2025,2034 ----
      }
      rxi_flushtrace();
  
+ #ifdef AFS_NT40_ENV
+     afs_winsockCleanup();
+ #endif
+ 
      rxinit_status = 1;
      UNLOCK_RX_INIT;
  }
***************
*** 3611,3616 ****
--- 3625,3633 ----
  	if (serial
  	    && (tp->header.serial == serial || tp->firstSerial == serial))
  	    rxi_ComputePeerNetStats(call, tp, ap, np);
+ 	if (!(tp->flags & RX_PKTFLAG_ACKED)) {
+ 	    newAckCount++;
+ 	}
  #ifdef	AFS_GLOBAL_RXLOCK_KERNEL
  	/* XXX Hack. Because we have to release the global rx lock when sending
  	 * packets (osi_NetSend) we drop all acks while we're traversing the tq
***************
*** 3621,3629 ****
  	 * set the ack bits in the packets and have rxi_Start remove the packets
  	 * when it's done transmitting.
  	 */
- 	if (!(tp->flags & RX_PKTFLAG_ACKED)) {
- 	    newAckCount++;
- 	}
  	if (call->flags & RX_CALL_TQ_BUSY) {
  #ifdef RX_ENABLE_LOCKS
  	    tp->flags |= RX_PKTFLAG_ACKED;
--- 3638,3643 ----
Index: openafs/src/rx/rx.h
diff -c openafs/src/rx/rx.h:1.28 openafs/src/rx/rx.h:1.28.4.1
*** openafs/src/rx/rx.h:1.28	Wed Sep 14 01:07:26 2005
--- openafs/src/rx/rx.h	Mon Jun 12 17:56:23 2006
***************
*** 295,300 ****
--- 295,301 ----
  
  struct rx_service {
      u_short serviceId;		/* Service number */
+     afs_uint32 serviceHost;	/* IP address for this service */
      u_short servicePort;	/* UDP port for this service */
      char *serviceName;		/* Name of the service */
      osi_socket socket;		/* socket structure or file descriptor */
Index: openafs/src/rx/rx_clock_nt.c
diff -c openafs/src/rx/rx_clock_nt.c:1.12 openafs/src/rx/rx_clock_nt.c:1.12.2.1
*** openafs/src/rx/rx_clock_nt.c:1.12	Sun Mar  5 22:04:38 2006
--- openafs/src/rx/rx_clock_nt.c	Tue Jul  4 02:28:25 2006
***************
*** 14,20 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx_clock_nt.c,v 1.12 2006/03/06 03:04:38 jaltman Exp $");
  
  #ifdef AFS_NT40_ENV
  #include <stdio.h>
--- 14,20 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx_clock_nt.c,v 1.12.2.1 2006/07/04 06:28:25 jaltman Exp $");
  
  #ifdef AFS_NT40_ENV
  #include <stdio.h>
***************
*** 23,37 ****
  #include <winbase.h>
  #include "rx_clock.h"
  
- void clock_UpdateTime(void);	/* forward reference */
- 
  struct clock clock_now;		/* The last elapsed time ready by clock_GetTimer */
  
  /* This is set to 1 whenever the time is read, and reset to 0 whenever
   * clock_NewTime is called.  This is to allow the caller to control the
   * frequency with which the actual time is re-evaluated.
   */
! int clock_haveCurrentTime;
  
  int clock_nUpdates;		/* The actual number of clock updates */
  static int clockInitialized = 0;
--- 23,36 ----
  #include <winbase.h>
  #include "rx_clock.h"
  
  struct clock clock_now;		/* The last elapsed time ready by clock_GetTimer */
  
  /* This is set to 1 whenever the time is read, and reset to 0 whenever
   * clock_NewTime is called.  This is to allow the caller to control the
   * frequency with which the actual time is re-evaluated.
   */
! #undef clock_haveCurrentTime
! int clock_haveCurrentTime = 0;
  
  int clock_nUpdates;		/* The actual number of clock updates */
  static int clockInitialized = 0;
***************
*** 43,48 ****
--- 42,48 ----
  #undef clock_UpdateTime
  void clock_UpdateTime(void);
  
+ #undef clock_Init
  void
  clock_Init(void)
  {
Index: openafs/src/rx/rx_getaddr.c
diff -c openafs/src/rx/rx_getaddr.c:1.23.4.2 openafs/src/rx/rx_getaddr.c:1.23.4.4
*** openafs/src/rx/rx_getaddr.c:1.23.4.2	Thu Jun  1 11:41:49 2006
--- openafs/src/rx/rx_getaddr.c	Thu Jun 15 11:20:56 2006
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx_getaddr.c,v 1.23.4.2 2006/06/01 15:41:49 shadow Exp $");
  
  #ifndef AFS_DJGPP_ENV
  #ifndef KERNEL
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx_getaddr.c,v 1.23.4.4 2006/06/15 15:20:56 shadow Exp $");
  
  #ifndef AFS_DJGPP_ENV
  #ifndef KERNEL
***************
*** 204,214 ****
  	    if (count >= maxSize)	/* no more space */
  		dpf(("Too many interfaces..ignoring 0x%x\n",
  		       a->sin_addr.s_addr));
! 	    else if (!loopbacks && a->sin_addr.s_addr == htonl(0x7f000001)) 
  		continue;	/* skip loopback address as well. */
! 	    else if (loopbacks && ifm->ifm_flags & IFF_LOOPBACK) 
  		continue;	/* skip aliased loopbacks as well. */
! 	    else
  		buffer[count++] = a->sin_addr.s_addr;
  	    addrcount--;
  	    ifam = (struct ifa_msghdr *)((char *)ifam + ifam->ifam_msglen);
--- 204,216 ----
  	    if (count >= maxSize)	/* no more space */
  		dpf(("Too many interfaces..ignoring 0x%x\n",
  		       a->sin_addr.s_addr));
! 	    else if (!loopbacks && a->sin_addr.s_addr == htonl(0x7f000001)) {
! 		addrcount--;
  		continue;	/* skip loopback address as well. */
! 	    } else if (loopbacks && ifm->ifm_flags & IFF_LOOPBACK) {
! 		addrcount--;
  		continue;	/* skip aliased loopbacks as well. */
! 	    } else
  		buffer[count++] = a->sin_addr.s_addr;
  	    addrcount--;
  	    ifam = (struct ifa_msghdr *)((char *)ifam + ifam->ifam_msglen);
***************
*** 233,246 ****
      char *buf, *lim, *next;
      int count = 0, addrcount = 0, i;
  
- #if !defined(AFS_USERSPACE_IP_ADDR)
-     count = rx_getAllAddr_internal(addrBuffer, 1024, 0);
-     for (i = 0; i < count; i++) {
- 	maskBuffer[i] = htonl(0xffffffff);
- 	mtuBuffer[i] = htonl(1500);
-     }
-     return count;
- #else /* AFS_USERSPACE_IP_ADDR */
      mib[0] = CTL_NET;
      mib[1] = PF_ROUTE;
      mib[2] = 0;
--- 235,240 ----
***************
*** 323,329 ****
      }
      free(buf);
      return count;
- #endif
  }
  
  
--- 317,322 ----
Index: openafs/src/rx/rx_globals.c
diff -c openafs/src/rx/rx_globals.c:1.9 openafs/src/rx/rx_globals.c:1.9.8.2
*** openafs/src/rx/rx_globals.c:1.9	Wed Dec  1 18:36:49 2004
--- openafs/src/rx/rx_globals.c	Tue Jul  4 17:24:09 2006
***************
*** 26,39 ****
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx_globals.c,v 1.9 2004/12/01 23:36:49 shadow Exp $");
  
  /* Enable data initialization when the header file is included */
  #define INIT(stuff) = stuff
  #if defined(AFS_NT40_ENV) && defined(AFS_PTHREAD_ENV)
  #define EXT __declspec(dllexport)
  #else
  #define EXT
  #endif
  
  #ifdef KERNEL
--- 26,41 ----
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx_globals.c,v 1.9.8.2 2006/07/04 21:24:09 jaltman Exp $");
  
  /* Enable data initialization when the header file is included */
  #define INIT(stuff) = stuff
  #if defined(AFS_NT40_ENV) && defined(AFS_PTHREAD_ENV)
  #define EXT __declspec(dllexport)
+ #define EXT2 __declspec(dllexport)
  #else
  #define EXT
+ #define EXT2 
  #endif
  
  #ifdef KERNEL
Index: openafs/src/rx/rx_globals.h
diff -c openafs/src/rx/rx_globals.h:1.21 openafs/src/rx/rx_globals.h:1.21.2.2
*** openafs/src/rx/rx_globals.h:1.21	Fri Feb 17 23:11:30 2006
--- openafs/src/rx/rx_globals.h	Tue Jul  4 13:05:40 2006
***************
*** 21,31 ****
  
  #ifndef INIT
  #define INIT(x)
! #if defined(AFS_NT40_ENV) && defined(AFS_PTHREAD_ENV)
  #define EXT __declspec(dllimport) extern
  #else
  #define	EXT extern
  #endif
  #endif /* !INIT */
  
  /* Basic socket for client requests; other sockets (for receiving server requests) are in the service structures */
--- 21,37 ----
  
  #ifndef INIT
  #define INIT(x)
! #if defined(AFS_NT40_ENV)
! #if defined(AFS_PTHREAD_ENV)
  #define EXT __declspec(dllimport) extern
  #else
  #define	EXT extern
  #endif
+ #define EXT2 __declspec(dllimport) extern
+ #else
+ #define EXT2 extern
+ #define EXT extern
+ #endif
  #endif /* !INIT */
  
  /* Basic socket for client requests; other sockets (for receiving server requests) are in the service structures */
***************
*** 569,575 ****
  EXT afs_kmutex_t rx_stats_mutex;	/* used to activate stats gathering */
  #endif
  
! EXT int rx_enable_stats INIT(0);
  
  /*
   * Set this flag to enable the listener thread to trade places with an idle
--- 575,581 ----
  EXT afs_kmutex_t rx_stats_mutex;	/* used to activate stats gathering */
  #endif
  
! EXT2 int rx_enable_stats INIT(0);
  
  /*
   * Set this flag to enable the listener thread to trade places with an idle
Index: openafs/src/rx/rx_prototypes.h
diff -c openafs/src/rx/rx_prototypes.h:1.29 openafs/src/rx/rx_prototypes.h:1.29.4.1
*** openafs/src/rx/rx_prototypes.h:1.29	Mon Dec 19 07:35:15 2005
--- openafs/src/rx/rx_prototypes.h	Mon Jun 12 17:56:23 2006
***************
*** 46,51 ****
--- 46,60 ----
  					afs_int32(*serviceProc) (struct
  								 rx_call *
  								 acall));
+ extern struct rx_service *rx_NewServiceHost(afs_uint32 host, u_short port, 
+ 					    u_short serviceId,
+ 					    char *serviceName,
+ 					    struct rx_securityClass
+ 					    **securityObjects,
+ 					    int nSecurityObjects,
+ 					    afs_int32(*serviceProc) (struct
+ 								     rx_call *
+ 								     acall));
  extern void rxi_ServerProc(int threadID, struct rx_call *newcall,
  			   osi_socket * socketp);
  extern void rx_WakeupServerProcs(void);
Index: openafs/src/rx/rx_pthread.c
diff -c openafs/src/rx/rx_pthread.c:1.24 openafs/src/rx/rx_pthread.c:1.24.4.1
*** openafs/src/rx/rx_pthread.c:1.24	Sat Nov  5 01:48:18 2005
--- openafs/src/rx/rx_pthread.c	Sun Jul  2 21:06:45 2006
***************
*** 19,25 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx_pthread.c,v 1.24 2005/11/05 06:48:18 jaltman Exp $");
  
  #include <sys/types.h>
  #include <errno.h>
--- 19,25 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx_pthread.c,v 1.24.4.1 2006/07/03 01:06:45 jaltman Exp $");
  
  #include <sys/types.h>
  #include <errno.h>
***************
*** 87,93 ****
  void
  rxi_InitializeThreadSupport(void)
  {
!     listeners_started = 0;
      clock_GetTime(&rxi_clockNow);
  }
  
--- 87,95 ----
  void
  rxi_InitializeThreadSupport(void)
  {
! 	/* listeners_started must only be reset if
! 	 * the listener thread terminates */
! 	/* listeners_started = 0; */
      clock_GetTime(&rxi_clockNow);
  }
  
***************
*** 322,327 ****
--- 324,332 ----
      pthread_attr_t tattr;
      AFS_SIGSET_DECL;
  
+ 	if (listeners_started)
+ 		return;
+ 
      if (pthread_attr_init(&tattr) != 0) {
  	dpf
  	    (("Unable to create Rx event handling thread (pthread_attr_init)\n"));
Index: openafs/src/rxgen/rpc_hout.c
diff -c openafs/src/rxgen/rpc_hout.c:1.10 openafs/src/rxgen/rpc_hout.c:1.10.4.2
*** openafs/src/rxgen/rpc_hout.c:1.10	Sat Nov  5 01:48:20 2005
--- openafs/src/rxgen/rpc_hout.c	Mon Jul  3 15:38:36 2006
***************
*** 36,42 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxgen/rpc_hout.c,v 1.10 2005/11/05 06:48:20 jaltman Exp $");
  
  #include <stdio.h>
  #include <string.h>
--- 36,42 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxgen/rpc_hout.c,v 1.10.4.2 2006/07/03 19:38:36 shadow Exp $");
  
  #include <stdio.h>
  #include <string.h>
***************
*** 223,230 ****
      f_print(fout, "\nextern %s %s%s%s(\n", type, prefix, defp->pc.proc_prefix,
  	    defp->pc.proc_name);
  
!     if (callTconnF) {
  	f_print(fout, "\t/*IN */ struct rx_call *z_call");
      } else {
  	f_print(fout, "\t/*IN */ struct rx_connection *z_conn");
      }
--- 223,232 ----
      f_print(fout, "\nextern %s %s%s%s(\n", type, prefix, defp->pc.proc_prefix,
  	    defp->pc.proc_name);
  
!     if (callTconnF == 1) {
  	f_print(fout, "\t/*IN */ struct rx_call *z_call");
+     } else if (callTconnF == 2) {
+ 	f_print(fout, "\tregister struct ubik_client *aclient, afs_int32 aflags");
      } else {
  	f_print(fout, "\t/*IN */ struct rx_connection *z_conn");
      }
***************
*** 270,275 ****
--- 272,280 ----
  	psproc1(defp, 0, "int", "", 0xFFFFFFFF);
      }
  
+     if (uflag && !kflag)
+ 	psproc1(defp, 2, "int", "ubik_", 0xFFFFFFFF);
+ 
      if (*ServerPrefix)
  	psproc1(defp, 1, "afs_int32", ServerPrefix, 0xFFFFFFFF);
  }
Index: openafs/src/rxgen/rpc_main.c
diff -c openafs/src/rxgen/rpc_main.c:1.23 openafs/src/rxgen/rpc_main.c:1.23.4.1
*** openafs/src/rxgen/rpc_main.c:1.23	Sat Nov  5 01:48:20 2005
--- openafs/src/rxgen/rpc_main.c	Mon Jul  3 15:07:15 2006
***************
*** 37,43 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxgen/rpc_main.c,v 1.23 2005/11/05 06:48:20 jaltman Exp $");
  
  #include <limits.h>
  #include <stdio.h>
--- 37,43 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxgen/rpc_main.c,v 1.23.4.1 2006/07/03 19:07:15 shadow Exp $");
  
  #include <limits.h>
  #include <stdio.h>
***************
*** 79,84 ****
--- 79,85 ----
      int dflag;
      int xflag;
      int yflag;
+     int uflag;
      char *infile;
      char *outfile;
  };
***************
*** 91,97 ****
  int nincludes = 0;
  char *OutFileFlag = "";
  char OutFile[256];
! char Sflag = 0, Cflag = 0, hflag = 0, cflag = 0, kflag = 0;
  char zflag = 0;			/* If set, abort server stub if rpc call returns non-zero */
  char xflag = 0;			/* if set, add stats code to stubs */
  char yflag = 0;			/* if set, only emit function name arrays to xdr file */
--- 92,98 ----
  int nincludes = 0;
  char *OutFileFlag = "";
  char OutFile[256];
! char Sflag = 0, Cflag = 0, hflag = 0, cflag = 0, kflag = 0, uflag = 0;
  char zflag = 0;			/* If set, abort server stub if rpc call returns non-zero */
  char xflag = 0;			/* if set, add stats code to stubs */
  char yflag = 0;			/* if set, only emit function name arrays to xdr file */
***************
*** 181,187 ****
      if (!parseargs(argc, argv, &cmd)) {
  	f_print(stderr, "usage: %s infile\n", cmdname);
  	f_print(stderr,
! 		"       %s [-c | -h | -l | -m | -C | -S | -r | -k | -R | -p | -d | -z] [-Pprefix] [-Idir] [-o outfile] [infile]\n",
  		cmdname);
  	f_print(stderr, "       %s [-s udp|tcp]* [-o outfile] [infile]\n",
  		cmdname);
--- 182,188 ----
      if (!parseargs(argc, argv, &cmd)) {
  	f_print(stderr, "usage: %s infile\n", cmdname);
  	f_print(stderr,
! 		"       %s [-c | -h | -l | -m | -C | -S | -r | -k | -R | -p | -d | -z | -u] [-Pprefix] [-Idir] [-o outfile] [infile]\n",
  		cmdname);
  	f_print(stderr, "       %s [-s udp|tcp]* [-o outfile] [infile]\n",
  		cmdname);
***************
*** 470,475 ****
--- 471,478 ----
      if (xflag) {
  	f_print(fout, "#include \"rx/rx_globals.h\"\n");
      }
+     if (uflag)
+ 	f_print(fout, "#include <ubik.h>\n");
      f_print(fout, "#else	/* UKERNEL */\n");
      f_print(fout, "#include \"h/types.h\"\n");
      f_print(fout, "#ifndef	SOCK_DGRAM  /* XXXXX */\n");
***************
*** 521,526 ****
--- 524,531 ----
  	f_print(fout, "#include <rx/rx_globals.h>\n");
      }
      f_print(fout, "#include <afs/rxgen_consts.h>\n");
+     if (uflag)
+ 	f_print(fout, "#include <ubik.h>\n");
      f_print(fout, "#endif	/* KERNEL */\n\n");
      f_print(fout, "#ifdef AFS_NT40_ENV\n");
      f_print(fout, "#ifndef AFS_RXGEN_EXPORT\n");
***************
*** 813,818 ****
--- 818,824 ----
  		case 'k':
  		case 'p':
  		case 'd':
+ 		case 'u':
  		case 'x':
  		case 'y':
  		case 'z':
***************
*** 869,874 ****
--- 875,881 ----
      cmd->Cflag = Cflag = flag['C'];
      cmd->Sflag = Sflag = flag['S'];
      cmd->rflag = flag['r'];
+     cmd->uflag = uflag = flag['u'];
      cmd->kflag = kflag = flag['k'];
      cmd->pflag = flag['p'];
      cmd->dflag = debug = flag['d'];
Index: openafs/src/rxgen/rpc_parse.c
diff -c openafs/src/rxgen/rpc_parse.c:1.20 openafs/src/rxgen/rpc_parse.c:1.20.4.2
*** openafs/src/rxgen/rpc_parse.c:1.20	Sat Nov  5 01:48:21 2005
--- openafs/src/rxgen/rpc_parse.c	Tue Jul  4 02:28:26 2006
***************
*** 36,42 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxgen/rpc_parse.c,v 1.20 2005/11/05 06:48:21 jaltman Exp $");
  
  #include <stdlib.h>
  #include <stdio.h>
--- 36,42 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxgen/rpc_parse.c,v 1.20.4.2 2006/07/04 06:28:26 jaltman Exp $");
  
  #include <stdlib.h>
  #include <stdio.h>
***************
*** 134,139 ****
--- 134,143 ----
  static void cs_ProcSendPacket_setup(definition * defp, int split_flag);
  static void cs_ProcUnmarshallOutParams_setup(definition * defp);
  static void cs_ProcTail_setup(definition * defp, int split_flag);
+ static void ucs_ProcName_setup(definition * defp, char *procheader,
+ 			      int split_flag);
+ static void ucs_ProcParams_setup(definition * defp, int split_flag);
+ static void ucs_ProcTail_setup(definition * defp, int split_flag);
  static void ss_Proc_CodeGeneration(definition * defp);
  static void ss_ProcName_setup(definition * defp);
  static void ss_ProcParams_setup(definition * defp, int *somefrees);
***************
*** 1102,1107 ****
--- 1106,1119 ----
  	}
  	cs_ProcTail_setup(defp, split_flag);
      }
+ 
+     if (!kflag && !split_flag && uflag) {
+ 	ucs_ProcName_setup(defp, "ubik_", split_flag);
+ 	if (!cflag) {
+ 	    ucs_ProcParams_setup(defp, split_flag);
+ 	    ucs_ProcTail_setup(defp, split_flag);
+ 	}
+     }
  }
  
  
***************
*** 1730,1735 ****
--- 1742,1945 ----
  }
  
  
+ static void
+ ucs_ProcName_setup(definition * defp, char *procheader, int split_flag)
+ {
+     proc1_list *plist;
+ 
+     if (!cflag) {
+       f_print(fout, "int %s%s%s%s(aclient, aflags", procheader, prefix,
+ 	      PackagePrefix[PackageIndex], defp->pc.proc_name);
+     }
+     if ((strlen(procheader) + strlen(prefix) +
+ 	 strlen(PackagePrefix[PackageIndex]) + strlen(defp->pc.proc_name)) >=
+ 	MAX_FUNCTION_NAME_LEN) {
+ 	error("function name is too long, increase MAX_FUNCTION_NAME_LEN");
+     }
+     if (!cflag) {
+ 	for (plist = defp->pc.plists; plist; plist = plist->next) {
+ 	    if (plist->component_kind == DEF_PARAM) {
+ 		plist->pl.param_flag &= ~PROCESSED_PARAM;
+ 		f_print(fout, ", %s", plist->pl.param_name);
+ 	    }
+ 	}
+ 	f_print(fout, ")\n");
+     }
+ }
+ 
+ 
+ static void
+ ucs_ProcParams_setup(definition * defp, int split_flag)
+ {
+     proc1_list *plist, *plist1;
+ 
+     f_print(fout, "\tregister struct ubik_client *aclient;\n\tafs_int32 aflags;\n");
+     for (plist = defp->pc.plists; plist; plist = plist->next) {
+ 	if (plist->component_kind == DEF_PARAM
+ 	    && !(plist->pl.param_flag & PROCESSED_PARAM)) {
+ 	    if (plist->pl.param_flag & OUT_STRING) {
+ 		f_print(fout, "\t%s *%s", plist->pl.param_type,
+ 			plist->pl.param_name);
+ 	    } else {
+ 		f_print(fout, "\t%s %s", plist->pl.param_type,
+ 			plist->pl.param_name);
+ 	    }
+ 	    plist->pl.param_flag |= PROCESSED_PARAM;
+ 	    for (plist1 = defp->pc.plists; plist1; plist1 = plist1->next) {
+ 		if ((plist1->component_kind == DEF_PARAM)
+ 		    && streq(plist->pl.param_type, plist1->pl.param_type)
+ 		    && !(plist1->pl.param_flag & PROCESSED_PARAM)) {
+ 		    char *star = "";
+ 		    char *pntr = strchr(plist1->pl.param_type, '*');
+ 		    if (pntr)
+ 			star = "*";
+ 		    if (plist1->pl.param_flag & OUT_STRING) {
+ 			f_print(fout, ", *%s%s", star, plist1->pl.param_name);
+ 		    } else {
+ 			f_print(fout, ", %s%s", star, plist1->pl.param_name);
+ 		    }
+ 		    plist1->pl.param_flag |= PROCESSED_PARAM;
+ 		}
+ 	    }
+ 	    f_print(fout, ";\n");
+ 	}
+     }
+ }
+ 
+ static void
+ ucs_ProcTail_setup(definition * defp, int split_flag)
+ {
+     proc1_list *plist;
+ 
+     f_print(fout, "{\tafs_int32 rcode, code, newHost, thisHost, i, _ucount;\n");
+     f_print(fout, "\tint chaseCount, pass, needsync, inlist;\n");
+ #if 0 /* goes with block below */
+     f_print(fout, "\tint j;\n");
+ #endif
+     f_print(fout, "\tstruct rx_connection *tc;\n");
+     f_print(fout, "\tstruct rx_peer *rxp;\n");
+     f_print(fout, "\tshort origLevel;\n\n");
+     f_print(fout, "\tif (!aclient)\n");
+     f_print(fout, "\t\treturn UNOENT;\n");
+     f_print(fout, "\tLOCK_UBIK_CLIENT(aclient);\n\n");
+     f_print(fout, "\t restart:\n");
+     f_print(fout, "\torigLevel = aclient->initializationState;\n");
+     f_print(fout, "\trcode = UNOSERVERS;\n");
+     f_print(fout, "\tchaseCount = inlist = needsync = 0;\n\n");
+ #if 0 /* We should do some sort of caching algorithm for this, but I need to think about it - shadow 26 jun 06 */
+     f_print(fout, "\tLOCK_UCLNT_CACHE;\n");
+     f_print(fout, "\tfor (j = 0; ((j < SYNCCOUNT) && calls_needsync[j]); j++) {\n");
+     f_print(fout, "\t\tif (calls_needsync[j] == (int *)%s%s%s) {\n", prefix, PackagePrefix[PackageIndex], defp->pc.proc_name);
+     f_print(fout, "\t\t\tinlist = needsync = 1;\n");
+     f_print(fout, "\t\t\tbreak;\n");
+     f_print(fout, "\t\t}\n");
+     f_print(fout, "\t}\n");
+     f_print(fout, "\tUNLOCK_UCLNT_CACHE;\n");
+ #endif
+     f_print(fout, "\t/* \n\t* First  pass, we try all servers that are up.\n\t* Second pass, we try all servers.\n\t*/\n");
+     f_print(fout, "\tfor (pass = 0; pass < 2; pass++) {  /*p */\n");
+     f_print(fout, "\t\t/* For each entry in our servers list */\n");
+     f_print(fout, "\t\tfor (_ucount = 0;; _ucount++) {     /*s */\n\n");
+     f_print(fout, "\t\tif (needsync) {\n");
+     f_print(fout, "\t\t\t/* Need a sync site. Lets try to quickly find it */\n");
+     f_print(fout, "\t\t\tif (aclient->syncSite) {\n");
+     f_print(fout, "\t\t\t\tnewHost = aclient->syncSite;        /* already in network order */\n");
+     f_print(fout, "\t\t\t\taclient->syncSite = 0;      /* Will reset if it works */\n");
+     f_print(fout, "\t\t\t} else if (aclient->conns[3]) {\n");
+     f_print(fout, "\t\t\t\t/* If there are fewer than four db servers in a cell,\n");
+     f_print(fout, "\t\t\t\t* there's no point in making the GetSyncSite call.\n");
+     f_print(fout, "\t\t\t\t* At best, it's a wash. At worst, it results in more\n");
+     f_print(fout, "\t\t\t\t* RPCs than you would otherwise make.\n");
+     f_print(fout, "\t\t\t\t*/\n");
+     f_print(fout, "\t\t\t\ttc = aclient->conns[_ucount];\n");
+     f_print(fout, "\t\t\t\tif (tc && rx_ConnError(tc)) {\n");
+     f_print(fout, "\t\t\t\t\taclient->conns[_ucount] = tc = ubik_RefreshConn(tc);\n");
+     f_print(fout, "\t\t\t\t}\n");
+     f_print(fout, "\t\t\t\tif (!tc)\n");
+     f_print(fout, "\t\t\t\t\tbreak;\n");
+     f_print(fout, "\t\t\t\tcode = VOTE_GetSyncSite(tc, &newHost);\n");
+     f_print(fout, "\t\t\t\tif (aclient->initializationState != origLevel)\n");
+     f_print(fout, "\t\t\t\t\tgoto restart;   /* somebody did a ubik_ClientInit */\n");
+     f_print(fout, "\t\t\t\tif (code)\n");
+     f_print(fout, "\t\t\t\t\tnewHost = 0;\n");
+     f_print(fout, "\t\t\t\tnewHost = htonl(newHost);   /* convert to network order */\n");
+     f_print(fout, "\t\t\t} else {\n");
+     f_print(fout, "\t\t\t\tnewHost = 0;\n");
+     f_print(fout, "\t\t\t}\n");
+     f_print(fout, "\t\t\tif (newHost) {\n");
+     f_print(fout, "\t\t\t\t/* position count at the appropriate slot in the client\n");
+     f_print(fout, "\t\t\t\t* structure and retry. If we can't find in slot, we'll\n");
+     f_print(fout, "\t\t\t\t* just continue through the whole list \n");
+     f_print(fout, "\t\t\t\t*/\n");
+     f_print(fout, "\t\t\t\tfor (i = 0; i < MAXSERVERS && aclient->conns[i]; i++) {\n");
+     f_print(fout, "\t\t\t\t\trxp = rx_PeerOf(aclient->conns[i]);\n");
+     f_print(fout, "\t\t\t\t\tthisHost = rx_HostOf(rxp);\n");
+     f_print(fout, "\t\t\t\t\tif (!thisHost)\n");
+     f_print(fout, "\t\t\t\t\t\tbreak;\n");
+     f_print(fout, "\t\t\t\t\tif (thisHost == newHost) {\n");
+     f_print(fout, "\t\t\t\t\t\tif (chaseCount++ > 2)\n");
+     f_print(fout, "\t\t\t\t\t\t\tbreak;  /* avoid loop asking */\n");
+     f_print(fout, "\t\t\t\t\t\t_ucount = i;  /* this index is the sync site */\n");
+     f_print(fout, "\t\t\t\t\t\tbreak;\n");
+     f_print(fout, "\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n");
+     f_print(fout, "\t\t/*needsync */\n");
+     f_print(fout, "\t\ttc = aclient->conns[_ucount];\n");
+     f_print(fout, "\t\tif (tc && rx_ConnError(tc)) {\n");
+     f_print(fout, "\t\t\taclient->conns[_ucount] = tc = ubik_RefreshConn(tc);\n");
+     f_print(fout, "\t\t}\n");
+     f_print(fout, "\t\tif (!tc)\n");
+     f_print(fout, "\t\t\tbreak;\n\n");
+     f_print(fout, "\t\tif ((pass == 0) && (aclient->states[_ucount] & CFLastFailed)) {\n");
+     f_print(fout, "\t\t\tcontinue;       /* this guy's down */\n");
+     f_print(fout, "\t\t}\n");
+     
+     f_print(fout, "\t\trcode = %s%s%s(tc\n", prefix, PackagePrefix[PackageIndex], defp->pc.proc_name);
+     for (plist = defp->pc.plists; plist; plist = plist->next) {
+ 	if (plist->component_kind == DEF_PARAM) {
+ 	    plist->pl.param_flag &= ~PROCESSED_PARAM;
+ 	    f_print(fout, ", %s", plist->pl.param_name);
+ 	}
+     }
+     f_print(fout, ");\n");
+     f_print(fout, "\t\tif (aclient->initializationState != origLevel) {\n");
+     f_print(fout, "\t\t\t/* somebody did a ubik_ClientInit */\n");
+     f_print(fout, "\t\t\tif (rcode)\n");
+     f_print(fout, "\t\t\t\tgoto restart;       /* call failed */\n");
+     f_print(fout, "\t\t\telse\n");
+     f_print(fout, "\t\t\t\tgoto done;  /* call suceeded */\n");
+     f_print(fout, "\t\t}\n");
+     f_print(fout, "\t\tif (rcode < 0) {    /* network errors */\n");
+     f_print(fout, "\t\t\taclient->states[_ucount] |= CFLastFailed; /* Mark server down */\n");
+     f_print(fout, "\t\t} else if (rcode == UNOTSYNC) {\n");
+     f_print(fout, "\t\t\tneedsync = 1;\n");
+     f_print(fout, "\t\t} else if (rcode != UNOQUORUM) {\n");
+     f_print(fout, "\t\t\t/* either misc ubik code, or misc appl code, or success. */\n");
+     f_print(fout, "\t\t\taclient->states[_ucount] &= ~CFLastFailed;        /* mark server up*/\n");
+     f_print(fout, "\t\t\tgoto done;      /* all done */\n");
+     f_print(fout, "\t\t}\n");
+     f_print(fout, "\t\t}                       /*s */\n");
+     f_print(fout, "\t}                           /*p */\n\n");
+     f_print(fout, "\tdone:\n");
+     f_print(fout, "\tif (needsync) {\n");
+     f_print(fout, "\t\tif (!inlist) {          /* Remember proc call that needs sync site */\n");
+ #if 0 /* We should do some sort of caching algorithm for this, but I need to think about it - shadow 26 jun 06 */
+     f_print(fout, "\t\t\tLOCK_UCLNT_CACHE;\n");
+     f_print(fout, "\t\t\tcalls_needsync[synccount % SYNCCOUNT] = (int *)%s%s%s;\n", prefix, PackagePrefix[PackageIndex], defp->pc.proc_name);
+     f_print(fout, "\t\t\tsynccount++;\n");
+     f_print(fout, "\t\t\tUNLOCK_UCLNT_CACHE;\n");
+ #endif
+     f_print(fout, "\t\t\tinlist = 1;\n");
+     f_print(fout, "\t\t}\n");
+     f_print(fout, "\t\tif (!rcode) {           /* Remember the sync site - cmd successful */\n");
+     f_print(fout, "\t\t\trxp = rx_PeerOf(aclient->conns[_ucount]);\n");
+     f_print(fout, "\t\t\taclient->syncSite = rx_HostOf(rxp);\n");
+     f_print(fout, "\t\t}\n");
+     f_print(fout, "\t}\n");
+     f_print(fout, "\tUNLOCK_UBIK_CLIENT(aclient);\n");
+     f_print(fout, "\treturn rcode;\n}\n\n");
+ }
+ 
+ 
  static int
  opcode_holes_exist(void)
  {
Index: openafs/src/rxgen/rpc_util.h
diff -c openafs/src/rxgen/rpc_util.h:1.4 openafs/src/rxgen/rpc_util.h:1.4.14.1
*** openafs/src/rxgen/rpc_util.h:1.4	Tue Jul 15 19:16:41 2003
--- openafs/src/rxgen/rpc_util.h	Mon Jul  3 15:07:15 2006
***************
*** 56,62 ****
  extern int nincludes;
  extern char *OutFileFlag;
  extern char OutFile[];
! extern char Sflag, Cflag, hflag, cflag, kflag;
  extern char zflag;
  extern char xflag;
  extern char yflag;
--- 56,62 ----
  extern int nincludes;
  extern char *OutFileFlag;
  extern char OutFile[];
! extern char Sflag, Cflag, hflag, cflag, kflag, uflag;
  extern char zflag;
  extern char xflag;
  extern char yflag;
Index: openafs/src/rxkad/ticket5.c
diff -c openafs/src/rxkad/ticket5.c:1.10 openafs/src/rxkad/ticket5.c:1.10.2.1
*** openafs/src/rxkad/ticket5.c:1.10	Wed Feb 22 00:07:48 2006
--- openafs/src/rxkad/ticket5.c	Thu Jun 29 19:27:16 2006
***************
*** 62,68 ****
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxkad/ticket5.c,v 1.10 2006/02/22 05:07:48 jaltman Exp $");
  
  #if defined(UKERNEL)
  #include "../afs/sysincludes.h"
--- 62,68 ----
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxkad/ticket5.c,v 1.10.2.1 2006/06/29 23:27:16 jaltman Exp $");
  
  #if defined(UKERNEL)
  #include "../afs/sysincludes.h"
***************
*** 284,290 ****
  	v5_comp1 = decr_part.cname.name_string.val[1];
  	p = sconv_list;
  	while (p->v4_str) {
! 	    if (strncmp(p->v5_str, v5_comp0, p->len) == 0) {
  		/*
  		 * It is, so set the new name now, and chop off
  		 * instance's domain name if requested.
--- 284,290 ----
  	v5_comp1 = decr_part.cname.name_string.val[1];
  	p = sconv_list;
  	while (p->v4_str) {
! 	    if (strcmp(p->v5_str, v5_comp0) == 0) {
  		/*
  		 * It is, so set the new name now, and chop off
  		 * instance's domain name if requested.
Index: openafs/src/rxstat/NTMakefile
diff -c openafs/src/rxstat/NTMakefile:1.8 openafs/src/rxstat/NTMakefile:1.8.14.1
*** openafs/src/rxstat/NTMakefile:1.8	Fri Nov 21 03:01:20 2003
--- openafs/src/rxstat/NTMakefile	Tue Jul  4 02:28:26 2006
***************
*** 31,38 ****
  $(LIBFILE): $(LIBOBJS)
  	$(LIBARCH)
  
! rxstat.cs.c rxstat.ss.c rxstat.xdr.c rxstat.h: rxstat.xg
! 	$(RXGEN) -x $**
  
  copyheader: rxstat.h
     $(COPY) rxstat.h $(INCFILEDIR)\rx\rxstat.h
--- 31,47 ----
  $(LIBFILE): $(LIBOBJS)
  	$(LIBARCH)
  
! rxstat.cs.c: rxstat.xg rxstat.h
! 	$(RXGEN) -x -C -o $@ rxstat.xg
! 
! rxstat.ss.c: rxstat.xg rxstat.h
! 	$(RXGEN) -x -S -o $@ rxstat.xg
! 
! rxstat.xdr.c: rxstat.xg rxstat.h
! 	$(RXGEN) -x -c -o $@ rxstat.xg
! 
! rxstat.h: rxstat.xg
! 	$(RXGEN) -x -h -o $@ rxstat.xg
  
  copyheader: rxstat.h
     $(COPY) rxstat.h $(INCFILEDIR)\rx\rxstat.h
Index: openafs/src/shlibafsauthent/afsauthent.def
diff -c openafs/src/shlibafsauthent/afsauthent.def:1.1 openafs/src/shlibafsauthent/afsauthent.def:1.1.16.1
*** openafs/src/shlibafsauthent/afsauthent.def:1.1	Wed Aug 28 02:05:49 2002
--- openafs/src/shlibafsauthent/afsauthent.def	Sun Jul  2 21:06:45 2006
***************
*** 84,86 ****
--- 84,88 ----
  
  	DISK_function_names				@83 DATA
  	VOTE_function_names				@84 DATA
+ 	rx_Finalize					@85
+ 	pr_End						@86
Index: openafs/src/shlibafsrpc/Makefile.in
diff -c openafs/src/shlibafsrpc/Makefile.in:1.22.4.1 openafs/src/shlibafsrpc/Makefile.in:1.22.4.2
*** openafs/src/shlibafsrpc/Makefile.in:1.22.4.1	Wed Jun  7 00:23:56 2006
--- openafs/src/shlibafsrpc/Makefile.in	Wed Jul  5 14:36:14 2006
***************
*** 1,7 ****
  # API version. When something changes, increment as appropriate. 
  # Ignore at your own risk.
  LIBAFSRPCMAJOR=1
! LIBAFSRPCMINOR=0
  
  # Copyright 2000, International Business Machines Corporation and others.
  # All Rights Reserved.
--- 1,7 ----
  # API version. When something changes, increment as appropriate. 
  # Ignore at your own risk.
  LIBAFSRPCMAJOR=1
! LIBAFSRPCMINOR=1
  
  # Copyright 2000, International Business Machines Corporation and others.
  # All Rights Reserved.
***************
*** 282,288 ****
  #
  #   $ what /opt/langtools/bin/pxdb32
  #   /opt/langtools/bin/pxdb32:
! #           HP92453-02 A.10.0A HP-UX SYMBOLIC DEBUGGER (PXDB) $Revision: 1.22.4.1 $
  #
  # The problem occurs when -g and -O are both used when compiling des.c.
  # The simplest way to work around the problem is to leave out either -g or -O.
--- 282,288 ----
  #
  #   $ what /opt/langtools/bin/pxdb32
  #   /opt/langtools/bin/pxdb32:
! #           HP92453-02 A.10.0A HP-UX SYMBOLIC DEBUGGER (PXDB) $Revision: 1.22.4.2 $
  #
  # The problem occurs when -g and -O are both used when compiling des.c.
  # The simplest way to work around the problem is to leave out either -g or -O.
Index: openafs/src/shlibafsrpc/mapfile
diff -c openafs/src/shlibafsrpc/mapfile:1.5 openafs/src/shlibafsrpc/mapfile:1.5.4.1
*** openafs/src/shlibafsrpc/mapfile:1.5	Mon Aug  8 11:37:30 2005
--- openafs/src/shlibafsrpc/mapfile	Wed Jul  5 14:36:14 2006
***************
*** 81,86 ****
--- 81,90 ----
  	multi_Finalize_Ignore;
  	add_to_error_table;
  	xdr_afsUUID;
+ 	xdr_afs_int32;
+ 	xdr_afs_uint32;
+ 	xdr_afs_int64;
+ 	xdr_afs_uint64;
  	rx_IncrementTimeAndCount;
  	rx_enable_stats;
  	rx_GetServerDebug;
Index: openafs/src/tviced/NTMakefile
diff -c openafs/src/tviced/NTMakefile:1.10 openafs/src/tviced/NTMakefile:1.10.2.1
*** openafs/src/tviced/NTMakefile:1.10	Mon Mar 20 12:29:56 2006
--- openafs/src/tviced/NTMakefile	Tue Jul  4 02:28:26 2006
***************
*** 88,93 ****
--- 88,94 ----
  
  EXELIBS = \
  	$(DESTDIR)\lib\afsauthent.lib \
+ 	$(DESTDIR)\lib\afs\afsprot.lib \
  	$(DESTDIR)\lib\afsrpc.lib \
  	$(DESTDIR)\lib\afs\afscmd.lib \
  	$(DESTDIR)\lib\afs\afsaudit.lib \
Index: openafs/src/ubik/NTMakefile
diff -c openafs/src/ubik/NTMakefile:1.9 openafs/src/ubik/NTMakefile:1.9.4.1
*** openafs/src/ubik/NTMakefile:1.9	Sun Nov 20 20:57:32 2005
--- openafs/src/ubik/NTMakefile	Tue Jul  4 02:28:26 2006
***************
*** 18,24 ****
  	$(INCFILEDIR)\ubik.h \
  	$(INCFILEDIR)\ubik_int.h 
  
! 
  
  ############################################################################
  # install afsubik.lib
--- 18,24 ----
  	$(INCFILEDIR)\ubik.h \
  	$(INCFILEDIR)\ubik_int.h 
  
! install_headers: $(INCFILES)
  
  ############################################################################
  # install afsubik.lib
***************
*** 87,94 ****
  $(INCFILES):$$(@F)
  	 $(COPY)  $** $(INCFILEDIR)\.
  
! ubik_int.ss.c ubik_int.cs.c ubik_int.xdr.c ubik_int.h: ubik_int.xg
! 	$(RXGEN) -x $**
  
  ############################################################################
  # compile_et on uerrors.et
--- 87,103 ----
  $(INCFILES):$$(@F)
  	 $(COPY)  $** $(INCFILEDIR)\.
  
! ubik_int.cs.c: ubik_int.xg ubik_int.h
! 	$(RXGEN) -x -C -o $@ ubik_int.xg
! 
! ubik_int.ss.c: ubik_int.xg ubik_int.h
! 	$(RXGEN) -x -S -o $@ ubik_int.xg
! 
! ubik_int.xdr.c: ubik_int.xg ubik_int.h
! 	$(RXGEN) -x -c -o $@ ubik_int.xg
! 
! ubik_int.h: ubik_int.xg
! 	$(RXGEN) -x -h -o $@ ubik_int.xg
  
  ############################################################################
  # compile_et on uerrors.et
Index: openafs/src/ubik/ubik.c
diff -c openafs/src/ubik/ubik.c:1.15 openafs/src/ubik/ubik.c:1.15.14.1
*** openafs/src/ubik/ubik.c:1.15	Sun Aug  8 19:57:23 2004
--- openafs/src/ubik/ubik.c	Mon Jun 12 17:56:24 2006
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ubik/ubik.c,v 1.15 2004/08/08 23:57:23 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ubik/ubik.c,v 1.15.14.1 2006/06/12 21:56:24 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
***************
*** 240,245 ****
--- 240,247 ----
  	    ubik_sc[secIndex] = secClass;
  	}
      }
+     /* for backwards compat this should keep working as it does now 
+        and not host bind */
      code = rx_Init(myPort);
      if (code < 0)
  	return code;
Index: openafs/src/ubik/ubik.p.h
diff -c openafs/src/ubik/ubik.p.h:1.18 openafs/src/ubik/ubik.p.h:1.18.8.1
*** openafs/src/ubik/ubik.p.h:1.18	Wed Dec  8 13:33:48 2004
--- openafs/src/ubik/ubik.p.h	Mon Jul  3 15:07:15 2006
***************
*** 360,365 ****
--- 360,367 ----
  			       long p8, long p9, long p10, long p11, long p12,
  			       long p13, long p14, long p15, long p16);
  
+ extern struct rx_connection *ubik_RefreshConn(struct rx_connection *tc);
+ 
  /* ubik.c */
  extern int ubik_BeginTrans(register struct ubik_dbase *dbase,
  			   afs_int32 transMode, struct ubik_trans **transPtr);
Index: openafs/src/ubik/ubikclient.c
diff -c openafs/src/ubik/ubikclient.c:1.10 openafs/src/ubik/ubikclient.c:1.10.8.1
*** openafs/src/ubik/ubikclient.c:1.10	Wed Dec  8 13:33:48 2004
--- openafs/src/ubik/ubikclient.c	Mon Jul  3 15:07:15 2006
***************
*** 15,21 ****
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/ubik/ubikclient.c,v 1.10 2004/12/08 18:33:48 rees Exp $");
  
  #if defined(UKERNEL)
  #include "afs/sysincludes.h"
--- 15,21 ----
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/ubik/ubikclient.c,v 1.10.8.1 2006/07/03 19:07:15 shadow Exp $");
  
  #if defined(UKERNEL)
  #include "afs/sysincludes.h"
***************
*** 306,313 ****
   *     error.
   */
  
! static struct rx_connection *
! RefreshConn(struct rx_connection *tc)
  {
      afs_uint32 host;
      u_short port;
--- 306,313 ----
   *     error.
   */
  
! struct rx_connection *
! ubik_RefreshConn(struct rx_connection *tc)
  {
      afs_uint32 host;
      u_short port;
***************
*** 428,434 ****
  		     */
  		    tc = aclient->conns[count];
  		    if (tc && rx_ConnError(tc)) {
! 			aclient->conns[count] = tc = RefreshConn(tc);
  		    }
  		    if (!tc)
  			break;
--- 428,434 ----
  		     */
  		    tc = aclient->conns[count];
  		    if (tc && rx_ConnError(tc)) {
! 			aclient->conns[count] = tc = ubik_RefreshConn(tc);
  		    }
  		    if (!tc)
  			break;
***************
*** 463,469 ****
  	    /*needsync */
  	    tc = aclient->conns[count];
  	    if (tc && rx_ConnError(tc)) {
! 		aclient->conns[count] = tc = RefreshConn(tc);
  	    }
  	    if (!tc)
  		break;
--- 463,469 ----
  	    /*needsync */
  	    tc = aclient->conns[count];
  	    if (tc && rx_ConnError(tc)) {
! 		aclient->conns[count] = tc = ubik_RefreshConn(tc);
  	    }
  	    if (!tc)
  		break;
***************
*** 537,543 ****
      /* get this conn */
      tc = aclient->conns[apos];
      if (tc && rx_ConnError(tc)) {
! 	aclient->conns[apos] = (tc = RefreshConn(tc));
      }
      if (!tc) {
  	return -1;
--- 537,543 ----
      /* get this conn */
      tc = aclient->conns[apos];
      if (tc && rx_ConnError(tc)) {
! 	aclient->conns[apos] = (tc = ubik_RefreshConn(tc));
      }
      if (!tc) {
  	return -1;
***************
*** 626,632 ****
  	}
  
  	if (rx_ConnError(tc)) {
! 	    tc = RefreshConn(tc);
  	    aclient->conns[*apos] = tc;
  	}
  
--- 626,632 ----
  	}
  
  	if (rx_ConnError(tc)) {
! 	    tc = ubik_RefreshConn(tc);
  	    aclient->conns[*apos] = tc;
  	}
  
Index: openafs/src/update/Makefile.in
diff -c openafs/src/update/Makefile.in:1.8 openafs/src/update/Makefile.in:1.8.14.1
*** openafs/src/update/Makefile.in:1.8	Sat Jan 11 02:34:59 2003
--- openafs/src/update/Makefile.in	Mon Jul  3 15:07:15 2006
***************
*** 33,39 ****
  client.o server.o: update.h global.h AFS_component_version_number.c
  
  update.cs.c: update.xg
! 	${RXGEN} -C -o $@ ${srcdir}/update.xg
  
  update.ss.c: update.xg
  	${RXGEN} -S -o $@ ${srcdir}/update.xg
--- 33,39 ----
  client.o server.o: update.h global.h AFS_component_version_number.c
  
  update.cs.c: update.xg
! 	${RXGEN} -u -C -o $@ ${srcdir}/update.xg
  
  update.ss.c: update.xg
  	${RXGEN} -S -o $@ ${srcdir}/update.xg
***************
*** 42,48 ****
  	${RXGEN} -c -o $@ ${srcdir}/update.xg
  
  update.h: update.xg
! 	${RXGEN} -h -o $@ ${srcdir}/update.xg
  
  update.cs.c: update.h
  upcate.ss.c: update.h
--- 42,48 ----
  	${RXGEN} -c -o $@ ${srcdir}/update.xg
  
  update.h: update.xg
! 	${RXGEN} -u -h -o $@ ${srcdir}/update.xg
  
  update.cs.c: update.h
  upcate.ss.c: update.h
Index: openafs/src/update/NTMakefile
diff -c openafs/src/update/NTMakefile:1.9 openafs/src/update/NTMakefile:1.9.4.1
*** openafs/src/update/NTMakefile:1.9	Sun Nov 20 20:57:34 2005
--- openafs/src/update/NTMakefile	Tue Jul  4 02:28:26 2006
***************
*** 27,34 ****
  ############################################################################
  # Definitions for generating files via RXGEN
  
! update.cs.c update.ss.c update.er.c update.h: update.xg
! 	$(RXGEN) $**
  
  ############################################################################
  # upserver
--- 27,43 ----
  ############################################################################
  # Definitions for generating files via RXGEN
  
! update.cs.c: update.xg update.h
! 	$(RXGEN) -u -C -o $@ update.xg
! 
! update.ss.c: update.xg update.h
! 	$(RXGEN) -S -o $@ update.xg
! 
! update.xdr.c: update.xg	update.h
! 	$(RXGEN) -c -o $@ update.xg
! 
! update.h: update.xg
! 	$(RXGEN) -u -h -o $@ update.xg
  
  ############################################################################
  # upserver
Index: openafs/src/update/server.c
diff -c openafs/src/update/server.c:1.13 openafs/src/update/server.c:1.13.14.2
*** openafs/src/update/server.c:1.13	Wed Jun 23 10:27:46 2004
--- openafs/src/update/server.c	Tue Jun 20 16:37:12 2006
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/update/server.c,v 1.13 2004/06/23 14:27:46 shadow Exp $");
  
  #include <afs/stds.h>
  #ifdef	AFS_AIX32_ENV
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/update/server.c,v 1.13.14.2 2006/06/20 20:37:12 jaltman Exp $");
  
  #include <afs/stds.h>
  #ifdef	AFS_AIX32_ENV
***************
*** 69,74 ****
--- 69,79 ----
  
  static int Quit();
  
+ int rxBind = 0;
+ 
+ #define ADDRSPERSITE 16         /* Same global is in rx/rx_user.c */
+ afs_uint32 SHostAddrs[ADDRSPERSITE];
+ 
  /* check whether caller is authorized to manage RX statistics */
  int
  update_rxstat_userok(struct rx_call *call)
***************
*** 183,188 ****
--- 188,194 ----
  {
      struct rx_securityClass *securityObjects[3];
      struct rx_service *service;
+     afs_uint32 host = htonl(INADDR_ANY);
  
      int a = 0;
      rxkad_level level;
***************
*** 234,248 ****
  
      for (a = 1; a < argc; a++) {
  	if (argv[a][0] == '-') {	/* parse options */
! 	    char arg[256];
! 	    lcstring(arg, argv[a], sizeof(arg));
! 	    newLevel = rxkad_StringToLevel(&argv[a][1]);
! 	    if (newLevel != -1) {
! 		level = newLevel;	/* set new level */
  		continue;
  	    }
  	  usage:
! 	    Quit("Usage: upserver [<directory>+] [-crypt <directory>+] [-clear <directory>+] [-auth <directory>+] [-help]\n");
  	} else {
  	    int dirlen;
  	    if (nDirs >= sizeof(dirName) / sizeof(dirName[0]))
--- 240,259 ----
  
      for (a = 1; a < argc; a++) {
  	if (argv[a][0] == '-') {	/* parse options */
! 	    if (strcmp(argv[a], "-rxbind") == 0) {
! 		rxBind = 1;
  		continue;
+ 	    } else {
+ 		char arg[256];
+ 		lcstring(arg, argv[a], sizeof(arg));
+ 		newLevel = rxkad_StringToLevel(&argv[a][1]);
+ 		if (newLevel != -1) {
+ 		    level = newLevel;	/* set new level */
+ 		    continue;
+ 		}
  	    }
  	  usage:
! 	    Quit("Usage: upserver [<directory>+] [-crypt <directory>+] [-clear <directory>+] [-auth <directory>+] [-rxbind] [-help]\n");
  	} else {
  	    int dirlen;
  	    if (nDirs >= sizeof(dirName) / sizeof(dirName[0]))
***************
*** 270,278 ****
  	exit(1);
      }
  
      /* Initialize Rx, telling it port number this server will use for its
       * single service */
!     if (rx_Init(htons(AFSCONF_UPDATEPORT)) < 0)
  	Quit("rx_init");
  
      /* Create a single security object, in this case the null security object,
--- 281,308 ----
  	exit(1);
      }
  
+     if (rxBind) {
+ 	afs_int32 ccode;
+ #ifndef AFS_NT40_ENV
+         if (AFSDIR_SERVER_NETRESTRICT_FILEPATH || 
+             AFSDIR_SERVER_NETINFO_FILEPATH) {
+             char reason[1024];
+             ccode = parseNetFiles(SHostAddrs, NULL, NULL,
+                                            ADDRSPERSITE, reason,
+                                            AFSDIR_SERVER_NETINFO_FILEPATH,
+                                            AFSDIR_SERVER_NETRESTRICT_FILEPATH);
+         } else 
+ #endif	
+ 	{
+             ccode = rx_getAllAddr(SHostAddrs, ADDRSPERSITE);
+         }
+         if (ccode == 1) 
+             host = SHostAddrs[0];
+     }
+ 
      /* Initialize Rx, telling it port number this server will use for its
       * single service */
!     if (rx_InitHost(host, htons(AFSCONF_UPDATEPORT)) < 0)
  	Quit("rx_init");
  
      /* Create a single security object, in this case the null security object,
***************
*** 296,303 ****
       * which is called to decode requests is passed in here
       * (UPDATE_ExecuteRequest). */
      service =
! 	rx_NewService(0, UPDATE_SERVICEID, "UPDATE", securityObjects, 3,
! 		      UPDATE_ExecuteRequest);
      if (service == (struct rx_service *)0)
  	Quit("rx_NewService");
      rx_SetMaxProcs(service, 2);
--- 326,333 ----
       * which is called to decode requests is passed in here
       * (UPDATE_ExecuteRequest). */
      service =
! 	rx_NewServiceHost(host, 0, UPDATE_SERVICEID, "UPDATE", securityObjects,
! 			  3, UPDATE_ExecuteRequest);
      if (service == (struct rx_service *)0)
  	Quit("rx_NewService");
      rx_SetMaxProcs(service, 2);
Index: openafs/src/util/afsutil.h
diff -c openafs/src/util/afsutil.h:1.21 openafs/src/util/afsutil.h:1.21.2.1
*** openafs/src/util/afsutil.h:1.21	Wed Mar 15 14:32:49 2006
--- openafs/src/util/afsutil.h	Sun Jul  2 21:06:45 2006
***************
*** 97,102 ****
--- 97,103 ----
  
  /* Initialize the windows sockets before calling networking routines. */
       extern int afs_winsockInit(void);
+      extern void afs_winsockCleanup(void);
  
       struct timezone {
  	 int tz_minuteswest;	/* of Greenwich */
Index: openafs/src/util/casestrcpy.c
diff -c openafs/src/util/casestrcpy.c:1.6 openafs/src/util/casestrcpy.c:1.6.14.1
*** openafs/src/util/casestrcpy.c:1.6	Tue Jul 15 19:17:16 2003
--- openafs/src/util/casestrcpy.c	Mon Jul  3 23:57:25 2006
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/util/casestrcpy.c,v 1.6 2003/07/15 23:17:16 shadow Exp $");
  
  #ifdef HAVE_STRING_H
  #include <string.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/util/casestrcpy.c,v 1.6.14.1 2006/07/04 03:57:25 shadow Exp $");
  
  #ifdef HAVE_STRING_H
  #include <string.h>
***************
*** 67,72 ****
--- 67,94 ----
      return original_d;
  }
  
+ int
+ stolower(char *s)
+ {
+   while (*s) {
+         if (isupper(*s))
+             *s = tolower(*s);
+         s++;
+     }
+     return 0;
+ }
+ 
+ int
+ stoupper(char *s)
+ {
+   while (*s) {
+         if (islower(*s))
+             *s = toupper(*s);
+         s++;
+     }
+     return 0;
+ }
+ 
  /* strcompose - concatenate strings passed to it.
   * Input: 
   *   buf: storage for the composed string. Any data in it will be lost.
Index: openafs/src/util/winsock_nt.c
diff -c openafs/src/util/winsock_nt.c:1.6 openafs/src/util/winsock_nt.c:1.6.4.1
*** openafs/src/util/winsock_nt.c:1.6	Sat Nov  5 01:48:27 2005
--- openafs/src/util/winsock_nt.c	Sun Jul  2 21:06:45 2006
***************
*** 13,19 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/util/winsock_nt.c,v 1.6 2005/11/05 06:48:27 jaltman Exp $");
  
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
--- 13,19 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/util/winsock_nt.c,v 1.6.4.1 2006/07/03 01:06:45 jaltman Exp $");
  
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
***************
*** 25,35 ****
   * 
   * Returns 0 on success, -1 on error.
   */
  int
  afs_winsockInit(void)
  {
-     static int once = 1;
- 
      if (once) {
  	int code;
  	WSADATA data;
--- 25,35 ----
   * 
   * Returns 0 on success, -1 on error.
   */
+ static int once = 1;
+ 
  int
  afs_winsockInit(void)
  {
      if (once) {
  	int code;
  	WSADATA data;
***************
*** 48,53 ****
--- 48,60 ----
      return 0;
  }
  
+ void
+ afs_winsockCleanup(void)
+ {
+     WSACleanup();
+     once = 0;
+ }
+ 
  /* This function will begin to fail in the year 2038 */
  int
  afs_gettimeofday(struct timeval *tv, struct timezone *tz)
Index: openafs/src/venus/cmdebug.c
diff -c openafs/src/venus/cmdebug.c:1.19 openafs/src/venus/cmdebug.c:1.19.4.1
*** openafs/src/venus/cmdebug.c:1.19	Thu Jan 19 19:00:18 2006
--- openafs/src/venus/cmdebug.c	Mon Jun 26 12:20:50 2006
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/venus/cmdebug.c,v 1.19 2006/01/20 00:00:18 shadow Exp $");
  
  
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/venus/cmdebug.c,v 1.19.4.1 2006/06/26 16:20:50 rra Exp $");
  
  
  #include <sys/types.h>
***************
*** 41,46 ****
--- 41,47 ----
  #include <rx/rx.h>
  #include <lock.h>
  #include <afs/afs_args.h>
+ #include <afs/afsutil.h>
  
  extern struct hostent *hostutil_GetHostByName();
  
Index: openafs/src/venus/fs.c
diff -c openafs/src/venus/fs.c:1.30 openafs/src/venus/fs.c:1.30.2.2
*** openafs/src/venus/fs.c:1.30	Thu Mar 30 12:13:40 2006
--- openafs/src/venus/fs.c	Mon Jul  3 15:07:16 2006
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/venus/fs.c,v 1.30 2006/03/30 17:13:40 rees Exp $");
  
  #include <afs/afs_args.h>
  #include <rx/xdr.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/venus/fs.c,v 1.30.2.2 2006/07/03 19:07:16 shadow Exp $");
  
  #include <afs/afs_args.h>
  #include <rx/xdr.h>
***************
*** 1208,1214 ****
          struct vcxstat2 stat;
          blob.out_size = sizeof(struct vcxstat2);
          blob.in_size = 0;
!         blob.out = &stat;
          code = pioctl(ti->data, VIOC_GETVCXSTATUS2, &blob, 1);
          if (code) {
              Die(errno, ti->data);
--- 1208,1214 ----
          struct vcxstat2 stat;
          blob.out_size = sizeof(struct vcxstat2);
          blob.in_size = 0;
!         blob.out = (void *)&stat;
          code = pioctl(ti->data, VIOC_GETVCXSTATUS2, &blob, 1);
          if (code) {
              Die(errno, ti->data);
***************
*** 1714,1720 ****
  	if (code == 0) {
  	    /* make the check.  Don't complain if there are problems with init */
  	    code =
! 		ubik_Call(VL_GetEntryByNameO, uclient, 0, volName,
  			  &vldbEntry);
  	    if (code == VL_NOENT) {
  		fprintf(stderr,
--- 1714,1720 ----
  	if (code == 0) {
  	    /* make the check.  Don't complain if there are problems with init */
  	    code =
! 		ubik_VL_GetEntryByNameO(uclient, 0, volName,
  			  &vldbEntry);
  	    if (code == VL_NOENT) {
  		fprintf(stderr,
***************
*** 2006,2018 ****
  static int
  GetCacheParmsCmd(struct cmd_syndesc *as, char *arock)
  {
!     afs_int32 code;
      struct ViceIoctl blob;
      afs_int32 parms[MAXGCSIZE];
  
      memset(parms, '\0', sizeof parms);	/* avoid Purify UMR error */
!     blob.in = NULL;
!     blob.in_size = 0;
      blob.out_size = sizeof(parms);
      blob.out = (char *)parms;
      code = pioctl(0, VIOCGETCACHEPARMS, &blob, 1);
--- 2006,2033 ----
  static int
  GetCacheParmsCmd(struct cmd_syndesc *as, char *arock)
  {
!     afs_int32 code, filesUsed;
      struct ViceIoctl blob;
      afs_int32 parms[MAXGCSIZE];
+     double percentFiles, percentBlocks;
+     afs_int32 flags = 0;
+ 
+     if (as->parms[0].items){ /* -files */
+ 	flags = 1;
+     } else if (as->parms[1].items){ /* -excessive */
+ 	flags = 2;
+     } else {
+ 	flags = 0;
+     }
  
      memset(parms, '\0', sizeof parms);	/* avoid Purify UMR error */
!     if (flags){
! 	blob.in = (char *)&flags;
! 	blob.in_size = sizeof(afs_int32);
!     } else {	/* be backward compatible */
! 	blob.in = NULL;
! 	blob.in_size = 0;
!     }
      blob.out_size = sizeof(parms);
      blob.out = (char *)parms;
      code = pioctl(0, VIOCGETCACHEPARMS, &blob, 1);
***************
*** 2020,2030 ****
  	Die(errno, NULL);
  	return 1;
      }
!     printf("AFS using %d of the cache's available %d 1K byte blocks.\n",
! 	   parms[1], parms[0]);
!     if (parms[1] > parms[0])
! 	printf
! 	    ("[Cache guideline temporarily deliberately exceeded; it will be adjusted down but you may wish to increase the cache size.]\n");
      return 0;
  }
  
--- 2035,2079 ----
  	Die(errno, NULL);
  	return 1;
      }
! 
!     if (!flags){
! 	printf("AFS using %d of the cache's available %d 1K byte blocks.\n",
! 		parms[1], parms[0]);
! 	if (parms[1] > parms[0])
! 		printf("[Cache guideline temporarily deliberately exceeded; it will be adjusted down but you may wish to increase the cache size.]\n");
! 	return 0;
!     }
! 
!     percentBlocks = ((double)parms[1]/parms[0]) * 100;
!     printf("AFS using %5.0f%% of cache blocks (%d of %d 1k blocks)\n",
! 	   percentBlocks, parms[1], parms[0]);
! 
!     filesUsed = parms[2] - parms[3];
!     percentFiles = ((double)filesUsed/parms[2]) * 100;
!     printf("          %5.0f%% of the cache files (%d of %d files)\n",
! 	    percentFiles, filesUsed, parms[2]);
!     if (flags == 2){
! 	printf("	afs_cacheFiles: %10d\n", parms[2]);
! 	printf("	IFFree:         %10d\n", parms[3]); 
! 	printf("	IFEverUsed:     %10d\n", parms[4]); 
! 	printf("	IFDataMod:      %10d\n", parms[5]); 
! 	printf("	IFDirtyPages:   %10d\n", parms[6]);
! 	printf("	IFAnyPages:     %10d\n", parms[7]); 
! 	printf("	IFDiscarded:    %10d\n", parms[8]);
! 	printf("	DCentries:  %10d\n", parms[9]);
! 	printf("	  0k-   4K: %10d\n", parms[10]); 
! 	printf("	  4k-  16k: %10d\n", parms[11]); 
! 	printf("	 16k-  64k: %10d\n", parms[12]); 
! 	printf("	 64k- 256k: %10d\n", parms[13]); 
! 	printf("	256k-   1M: %10d\n", parms[14]); 
! 	printf("	      >=1M: %10d\n", parms[15]); 
!     }
! 
!     if (percentBlocks > 90)
! 	printf("[cache size usage over 90%, consider increasing cache size]\n");
!     if (percentFiles > 90)
! 	printf("[cache file usage over 90%, consider increasing '-files' argument to afsd]\n");
! 	 
      return 0;
  }
  
***************
*** 3372,3377 ****
--- 3421,3428 ----
  
      ts = cmd_CreateSyntax("getcacheparms", GetCacheParmsCmd, 0,
  			  "get cache usage info");
+     cmd_AddParm(ts, "-files", CMD_FLAG, CMD_OPTIONAL, "Show cach files used as well");
+     cmd_AddParm(ts, "-excessive", CMD_FLAG, CMD_OPTIONAL, "excessively verbose cache stats");
  
      ts = cmd_CreateSyntax("listcells", ListCellsCmd, 0,
  			  "list configured cells");
Index: openafs/src/viced/NTMakefile
diff -c openafs/src/viced/NTMakefile:1.6 openafs/src/viced/NTMakefile:1.6.2.3
*** openafs/src/viced/NTMakefile:1.6	Mon Mar 20 11:07:20 2006
--- openafs/src/viced/NTMakefile	Sat Jun 24 10:10:46 2006
***************
*** 65,85 ****
  	$(EXEPREP) 
  
  ############################################################################
- # generate versioninfo resources
- $(OUT)\fileserver.res: AFS_component_version_number.h
- 
- install:  $(INCFILES) $(OUT)\fileserver.res
- 
- ############################################################################
  # Build cbd - not generally distributed debugging program
! CBD = $(OUT)\cbd.exe
  
! $(OUT)\cbd.obj: callback.c
! 	$(C2OBJ) $** -DINTERPRET_DUMP
  
  $(CBD): $(OUT)\cbd.obj 
  	$(EXECONLINK)
          $(_VC_MANIFEST_EMBED_EXE)
  
  mkdir:
  	
--- 65,85 ----
  	$(EXEPREP) 
  
  ############################################################################
  # Build cbd - not generally distributed debugging program
! CBD = $(DESTDIR)\root.server\usr\afs\bin\cbd.exe
  
! $(OUT)\cbd.obj: callback.c AFS_component_version_number.h
! 	$(C2OBJ) callback.c -DINTERPRET_DUMP
  
  $(CBD): $(OUT)\cbd.obj 
  	$(EXECONLINK)
          $(_VC_MANIFEST_EMBED_EXE)
  
+ ############################################################################
+ # generate versioninfo resources
+ $(OUT)\fileserver.res: AFS_component_version_number.h
+ 
+ install:  $(INCFILES) $(OUT)\fileserver.res $(CBD)
+ 
  mkdir:
  	
Index: openafs/src/viced/afsfileprocs.c
diff -c openafs/src/viced/afsfileprocs.c:1.113.2.2 openafs/src/viced/afsfileprocs.c:1.113.2.4
*** openafs/src/viced/afsfileprocs.c:1.113.2.2	Thu Jun  1 11:36:58 2006
--- openafs/src/viced/afsfileprocs.c	Tue Jul  4 02:18:30 2006
***************
*** 29,35 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/viced/afsfileprocs.c,v 1.113.2.2 2006/06/01 15:36:58 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.4 2006/07/04 06:18:30 jaltman Exp $");
  
  #include <stdio.h>
  #include <stdlib.h>
***************
*** 309,314 ****
--- 309,316 ----
      int retry_flag = 1;
      int code = 0;
      char hoststr[16], hoststr2[16];
+     struct ubik_client *uclient;
+ 
      if (!tconn) {
  	ViceLog(0, ("CallPreamble: unexpected null tconn!\n"));
  	return -1;
***************
*** 332,340 ****
  	/* Take down the old connection and re-read the key file */
  	ViceLog(0,
  		("CallPreamble: Couldn't get CPS. Reconnect to ptserver\n"));
  	H_UNLOCK;
! 	code = pr_Initialize(2, AFSDIR_SERVER_ETC_DIRPATH, 0);
  	H_LOCK;
  	if (code) {
  	    h_ReleaseClient_r(tclient);
  	    h_Release_r(thost);
--- 334,353 ----
  	/* Take down the old connection and re-read the key file */
  	ViceLog(0,
  		("CallPreamble: Couldn't get CPS. Reconnect to ptserver\n"));
+ #ifdef AFS_PTHREAD_ENV
+ 	uclient = (struct ubik_client *)pthread_getspecific(viced_uclient_key);
+ 
+ 	/* Is it still necessary to drop this? We hit the net, we should... */
  	H_UNLOCK;
! 	if (uclient) 
! 	    hpr_End(uclient);
! 	code = hpr_Initialize(&uclient);
! 
! 	assert(pthread_setspecific(viced_uclient_key, (void *)uclient) == 0);
  	H_LOCK;
+ #else
+ 	code = pr_Initialize(2, AFSDIR_SERVER_ETC_DIRPATH, 0);
+ #endif
  	if (code) {
  	    h_ReleaseClient_r(tclient);
  	    h_Release_r(thost);
***************
*** 5514,5520 ****
  {				/*SRXAFS_XStatsVersion */
  
      struct client *t_client = NULL;	/* tmp ptr to client data */
!     struct rx_connection *tcon;
  #if FS_STATS_DETAILED
      struct fs_stats_opTimingData *opP;	/* Ptr to this op's timing struct */
      struct timeval opStartTime, opStopTime;	/* Start/stop times for RPC op */
--- 5527,5533 ----
  {				/*SRXAFS_XStatsVersion */
  
      struct client *t_client = NULL;	/* tmp ptr to client data */
!     struct rx_connection *tcon = rx_ConnectionOf(a_call);
  #if FS_STATS_DETAILED
      struct fs_stats_opTimingData *opP;	/* Ptr to this op's timing struct */
      struct timeval opStartTime, opStopTime;	/* Start/stop times for RPC op */
Index: openafs/src/viced/callback.c
diff -c openafs/src/viced/callback.c:1.77 openafs/src/viced/callback.c:1.77.2.2
*** openafs/src/viced/callback.c:1.77	Fri Mar 17 14:54:49 2006
--- openafs/src/viced/callback.c	Sat Jun 24 10:10:46 2006
***************
*** 85,91 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/viced/callback.c,v 1.77 2006/03/17 19:54:49 shadow 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.2 2006/06/24 14:10:46 jaltman Exp $");
  
  #include <stdio.h>
  #include <stdlib.h>		/* for malloc() */
***************
*** 2723,2729 ****
--- 2723,2733 ----
      return now;
  }
  
+ #ifdef AFS_NT40_ENV
+ #include "AFS_component_version_number.h"
+ #else
  #include "AFS_component_version_number.c"
+ #endif
  
  int
  main(int argc, char **argv)
Index: openafs/src/viced/host.c
diff -c openafs/src/viced/host.c:1.93.2.5 openafs/src/viced/host.c:1.93.2.10
*** openafs/src/viced/host.c:1.93.2.5	Wed Jun  7 00:56:29 2006
--- openafs/src/viced/host.c	Mon Jul  3 23:51:30 2006
***************
*** 13,19 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/viced/host.c,v 1.93.2.5 2006/06/07 04:56:29 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.10 2006/07/04 03:51:30 shadow Exp $");
  
  #include <stdio.h>
  #include <errno.h>
***************
*** 269,274 ****
--- 269,498 ----
  
  }				/*FreeHT */
  
+ afs_int32
+ hpr_Initialize(struct ubik_client **uclient)
+ {
+     afs_int32 code;
+     struct rx_connection *serverconns[MAXSERVERS];
+     struct rx_securityClass *sc[3];
+     struct afsconf_dir *tdir;
+     char tconfDir[100] = "";
+     char tcell[64] = "";
+     struct ktc_token ttoken;
+     afs_int32 scIndex;
+     struct afsconf_cell info;
+     afs_int32 i;
+     char cellstr[64];
+ 
+     tdir = afsconf_Open(AFSDIR_SERVER_ETC_DIRPATH);
+     if (!tdir) {
+ 	fprintf(stderr,
+ 		"libprot: Could not open configuration directory: %s.\n",
+ 		AFSDIR_SERVER_ETC_DIRPATH);
+       return -1;
+     }
+     
+     code = afsconf_GetLocalCell(tdir, cellstr, sizeof(cellstr));
+     if (code) {
+ 	fprintf(stderr,
+ 		"libprot: Could not get local cell. [%d]\n", code);
+ 	return code;
+     }
+     
+     code = afsconf_GetCellInfo(tdir, cellstr, "afsprot", &info);
+     if (code) {
+ 	fprintf(stderr, "libprot: Could not locate cell %s in %s/%s\n",
+ 		cellstr, confDir, AFSDIR_CELLSERVDB_FILE);
+ 	return code;
+     }
+     
+     afsconf_Close(tdir);
+     
+     code = rx_Init(0);
+     if (code) {
+         fprintf(stderr, "libprot:  Could not initialize rx.\n");
+         return code;
+     }
+     
+     scIndex = 2;
+     sc[0] = 0;
+     sc[1] = 0;
+     sc[2] = 0;
+     /* Most callers use secLevel==1, however, the fileserver uses secLevel==2
+      * to force use of the KeyFile.  secLevel == 0 implies -noauth was
+      * specified. */
+     if ((afsconf_GetLatestKey(tdir, 0, 0) == 0)) {
+         code = afsconf_ClientAuthSecure(tdir, &sc[2], &scIndex);
+         if (code)
+             fprintf(stderr,
+                     "libprot: clientauthsecure returns %d %s"
+                     " (so trying noauth)\n", code, error_message(code));
+         if (code)
+             scIndex = 0;        /* use noauth */
+         if (scIndex != 2)
+             /* if there was a problem, an unauthenticated conn is returned */
+             sc[scIndex] = sc[2];
+     } else {
+         struct ktc_principal sname;
+         strcpy(sname.cell, info.name);
+         sname.instance[0] = 0;
+         strcpy(sname.name, "afs");
+         code = ktc_GetToken(&sname, &ttoken, sizeof(ttoken), NULL);
+         if (code)
+             scIndex = 0;
+         else {
+             if (ttoken.kvno >= 0 && ttoken.kvno <= 256)
+                 /* this is a kerberos ticket, set scIndex accordingly */
+                 scIndex = 2;
+             else {
+                 fprintf(stderr,
+                         "libprot: funny kvno (%d) in ticket, proceeding\n",
+                         ttoken.kvno);
+                 scIndex = 2;
+             }
+             sc[2] =
+                 rxkad_NewClientSecurityObject(rxkad_clear, &ttoken.sessionKey,
+                                               ttoken.kvno, ttoken.ticketLen,
+                                               ttoken.ticket);
+         }
+     }
+     if ((scIndex == 0) && (sc[0] == 0))
+         sc[0] = rxnull_NewClientSecurityObject();
+     if ((scIndex == 0))
+         com_err("fileserver", code,
+                 "Could not get afs tokens, running unauthenticated.");
+     
+     memset(serverconns, 0, sizeof(serverconns));        /* terminate list!!! */
+     for (i = 0; i < info.numServers; i++) {
+         serverconns[i] =
+             rx_NewConnection(info.hostAddr[i].sin_addr.s_addr,
+                              info.hostAddr[i].sin_port, PRSRV, sc[scIndex],
+                              scIndex);
+     }
+ 
+     code = ubik_ClientInit(serverconns, uclient);
+     if (code) {
+         com_err("fileserver", code, "ubik client init failed.");
+     }
+ 
+     code = rxs_Release(sc[scIndex]);
+     return code;
+ }
+ 
+ int
+ hpr_End(struct ubik_client *uclient)
+ {
+     int code = 0;
+ 
+     if (uclient) {
+         code = ubik_ClientDestroy(uclient);
+     }
+     return code;
+ }
+ 
+ int
+ hpr_GetHostCPS(afs_int32 host, prlist *CPS)
+ {
+ #ifdef AFS_PTHREAD_ENV
+     register afs_int32 code;
+     afs_int32 over;
+     struct ubik_client *uclient = 
+ 	(struct ubik_client *)pthread_getspecific(viced_uclient_key);
+ 
+     if (!uclient) {
+         code = hpr_Initialize(&uclient);
+         assert(pthread_setspecific(viced_uclient_key, (void *)uclient) == 0);
+     }
+ 
+     over = 0;
+     code = ubik_PR_GetHostCPS(uclient, 0, host, CPS, &over);
+     if (code != PRSUCCESS)
+         return code;
+     if (over) {
+       /* do something about this, probably make a new call */
+       /* don't forget there's a hard limit in the interface */
+         fprintf(stderr,
+                 "membership list for host id %d exceeds display limit\n",
+                 host);
+     }
+     return 0;
+ #else
+     return pr_GetHostCPS(host, CPS);
+ #endif
+ }
+ 
+ int
+ hpr_NameToId(namelist *names, idlist *ids)
+ {
+ #ifdef AFS_PTHREAD_ENV
+     register afs_int32 code;
+     register afs_int32 i;
+     struct ubik_client *uclient = 
+ 	(struct ubik_client *)pthread_getspecific(viced_uclient_key);
+ 
+     if (!uclient) {
+         code = hpr_Initialize(&uclient);
+         assert(pthread_setspecific(viced_uclient_key, (void *)uclient) == 0);
+     }
+ 
+     for (i = 0; i < names->namelist_len; i++)
+         stolower(names->namelist_val[i]);
+     code = ubik_PR_NameToID(uclient, 0, names, ids);
+     return code;
+ #else
+     return pr_NameToId(names, ids);
+ #endif
+ }
+ 
+ int
+ hpr_IdToName(idlist *ids, namelist *names)
+ {
+ #ifdef AFS_PTHREAD_ENV
+     register afs_int32 code;
+     struct ubik_client *uclient = 
+ 	(struct ubik_client *)pthread_getspecific(viced_uclient_key);
+     
+     if (!uclient) {
+         code = hpr_Initialize(&uclient);
+         assert(pthread_setspecific(viced_uclient_key, (void *)uclient) == 0);
+     }
+ 
+     code = ubik_PR_IDToName(uclient, 0, ids, names);
+     return code;
+ #else
+     return pr_IdToName(ids, names);
+ #endif
+ }
+ 
+ int
+ hpr_GetCPS(afs_int32 id, prlist *CPS)
+ {
+ #ifdef AFS_PTHREAD_ENV
+     register afs_int32 code;
+     afs_int32 over;
+     struct ubik_client *uclient = 
+ 	(struct ubik_client *)pthread_getspecific(viced_uclient_key);
+ 
+     if (!uclient) {
+         code = hpr_Initialize(&uclient);
+         assert(pthread_setspecific(viced_uclient_key, (void *)uclient) == 0);
+     }
+ 
+     over = 0;
+     code = ubik_PR_GetCPS(uclient, 0, id, CPS, &over);
+     if (code != PRSUCCESS)
+         return code;
+     if (over) {
+       /* do something about this, probably make a new call */
+       /* don't forget there's a hard limit in the interface */
+         fprintf(stderr, "membership list for id %d exceeds display limit\n",
+                 id);
+     }
+     return 0;
+ #else
+     return pr_GetCPS(id, CPS);
+ #endif
+ }
  
  static short consolePort = 0;
  
***************
*** 466,472 ****
      host->cpsCall = slept ? (FT_ApproxTime()) : (now);
  
      H_UNLOCK;
!     code = pr_GetHostCPS(ntohl(host->host), &host->hcps);
      H_LOCK;
      if (code) {
  	/*
--- 690,696 ----
      host->cpsCall = slept ? (FT_ApproxTime()) : (now);
  
      H_UNLOCK;
!     code = hpr_GetHostCPS(ntohl(host->host), &host->hcps);
      H_LOCK;
      if (code) {
  	/*
***************
*** 1545,1551 ****
      }
  
      H_UNLOCK;
!     code = pr_NameToId(&lnames, &lids);
      H_LOCK;
      if (code == 0) {
  	if (lids.idlist_val) {
--- 1769,1775 ----
      }
  
      H_UNLOCK;
!     code = hpr_NameToId(&lnames, &lids);
      H_LOCK;
      if (code == 0) {
  	if (lids.idlist_val) {
***************
*** 1645,1650 ****
--- 1869,1876 ----
  	H_UNLOCK;
  	ObtainWriteLock(&client->lock);	/* released at end */
  	H_LOCK;
+     } else {
+ 	client = NULL;
      }
  
      authClass = rx_SecurityClassOf((struct rx_connection *)tcon);
***************
*** 1658,1664 ****
  	expTime = 0x7fffffff;
      } else if (authClass == 2) {
  	afs_int32 kvno;
! 
  	/* kerberos ticket */
  	code = rxkad_GetServerInfo(tcon, /*level */ 0, &expTime,
  				   tname, tinst, tcell, &kvno);
--- 1884,1890 ----
  	expTime = 0x7fffffff;
      } else if (authClass == 2) {
  	afs_int32 kvno;
!     
  	/* kerberos ticket */
  	code = rxkad_GetServerInfo(tcon, /*level */ 0, &expTime,
  				   tname, tinst, tcell, &kvno);
***************
*** 1755,1761 ****
  	    client->CPS.prlist_val = AnonCPS.prlist_val;
  	} else {
  	    H_UNLOCK;
! 	    code = pr_GetCPS(viceid, &client->CPS);
  	    H_LOCK;
  	    if (code) {
  		char hoststr[16];
--- 1981,1987 ----
  	    client->CPS.prlist_val = AnonCPS.prlist_val;
  	} else {
  	    H_UNLOCK;
! 	    code = hpr_GetCPS(viceid, &client->CPS);
  	    H_LOCK;
  	    if (code) {
  		char hoststr[16];
***************
*** 1795,1801 ****
       * the RPC from the other client structure's rock.
       */
      oldClient = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
!     if (oldClient && oldClient->sid == rxr_CidOf(tcon)
  	&& oldClient->VenusEpoch == rxr_GetEpoch(tcon)) {
  	char hoststr[16];
  	if (!oldClient->deleted) {
--- 2021,2027 ----
       * the RPC from the other client structure's rock.
       */
      oldClient = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
!     if (oldClient && oldClient != client && oldClient->sid == rxr_CidOf(tcon)
  	&& oldClient->VenusEpoch == rxr_GetEpoch(tcon)) {
  	char hoststr[16];
  	if (!oldClient->deleted) {
***************
*** 1818,1825 ****
  		FreeCE(client);
  		created = 0;
  	    } 
- 	    ObtainWriteLock(&oldClient->lock);
  	    oldClient->refCount++;
  	    client = oldClient;
  	} else {
  	    ViceLog(0, ("FindClient: deleted client %x(%x) already had conn %x (host %s:%d), stolen by client %x(%x)\n", 
--- 2044,2053 ----
  		FreeCE(client);
  		created = 0;
  	    } 
  	    oldClient->refCount++;
+ 	    H_UNLOCK;
+ 	    ObtainWriteLock(&oldClient->lock);
+ 	    H_LOCK;
  	    client = oldClient;
  	} else {
  	    ViceLog(0, ("FindClient: deleted client %x(%x) already had conn %x (host %s:%d), stolen by client %x(%x)\n", 
***************
*** 1920,1925 ****
--- 2148,2154 ----
      static char User[PR_MAXNAMELEN + 1];
      namelist lnames;
      idlist lids;
+     afs_int32 code;
  
      lids.idlist_len = 1;
      lids.idlist_val = (afs_int32 *) malloc(1 * sizeof(afs_int32));
***************
*** 1930,1936 ****
      lnames.namelist_len = 0;
      lnames.namelist_val = (prname *) 0;
      lids.idlist_val[0] = client->ViceId;
!     if (pr_IdToName(&lids, &lnames)) {
  	/* We need to free id we alloced above! */
  	free(lids.idlist_val);
  	return "*UNKNOWN USER NAME*";
--- 2159,2165 ----
      lnames.namelist_len = 0;
      lnames.namelist_val = (prname *) 0;
      lids.idlist_val[0] = client->ViceId;
!     if (hpr_IdToName(&lids, &lnames)) {
  	/* We need to free id we alloced above! */
  	free(lids.idlist_val);
  	return "*UNKNOWN USER NAME*";
Index: openafs/src/viced/host.h
diff -c openafs/src/viced/host.h:1.21.2.1 openafs/src/viced/host.h:1.21.2.2
*** openafs/src/viced/host.h:1.21.2.1	Wed Jun  7 00:40:43 2006
--- openafs/src/viced/host.h	Mon Jul  3 14:46:06 2006
***************
*** 30,35 ****
--- 30,36 ----
      assert(pthread_mutex_lock(&host_glock_mutex) == 0)
  #define H_UNLOCK \
      assert(pthread_mutex_unlock(&host_glock_mutex) == 0)
+ extern pthread_key_t viced_uclient_key;
  #else /* AFS_PTHREAD_ENV */
  #define H_LOCK
  #define H_UNLOCK
Index: openafs/src/viced/viced.c
diff -c openafs/src/viced/viced.c:1.75.2.1 openafs/src/viced/viced.c:1.75.2.4
*** openafs/src/viced/viced.c:1.75.2.1	Wed Jun  7 00:40:43 2006
--- openafs/src/viced/viced.c	Mon Jul  3 15:07:16 2006
***************
*** 22,28 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/viced/viced.c,v 1.75.2.1 2006/06/07 04:40:43 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.4 2006/07/03 19:07:16 shadow Exp $");
  
  #include <stdio.h>
  #include <stdlib.h>
***************
*** 172,177 ****
--- 172,178 ----
  int debuglevel = 0;
  int printBanner = 0;
  int rxJumbograms = 1;		/* default is to send and receive jumbograms. */
+ int rxBind = 0;		/* don't bind */
  int rxMaxMTU = -1;
  afs_int32 implicitAdminRights = PRSFS_LOOKUP;	/* The ADMINISTER right is 
  						 * already implied */
***************
*** 202,207 ****
--- 203,220 ----
  
  struct timeval tp;
  
+ #ifdef AFS_PTHREAD_ENV
+ pthread_key_t viced_uclient_key;
+ #endif
+ 
+ #ifdef AFS_PTHREAD_ENV
+ pthread_key_t viced_uclient_key;
+ #endif
+ 
+ #ifdef AFS_PTHREAD_ENV
+ pthread_key_t viced_uclient_key;
+ #endif
+ 
  /*
   * FileServer's name and IP address, both network byte order and
   * host byte order.
***************
*** 889,894 ****
--- 902,908 ----
      strcat(buffer, "[-rxdbg (enable rx debugging)] ");
      strcat(buffer, "[-rxdbge (enable rxevent debugging)] ");
      strcat(buffer, "[-rxmaxmtu <bytes>] ");
+     strcat(buffer, "[-rxbind (bind the Rx socket to one address)] ");
  #ifdef AFS_DEMAND_ATTACH_FS
      strcat(buffer, "[-fs-state-dont-save (disable state save during shutdown)] ");
      strcat(buffer, "[-fs-state-dont-restore (disable state restore during startup)] ");
***************
*** 1266,1271 ****
--- 1280,1287 ----
  #endif
  	else if (!strcmp(argv[i], "-nojumbo")) {
  	    rxJumbograms = 0;
+ 	} else if (!strcmp(argv[i], "-rxbind")) {
+ 	    rxBind = 1;
  	} else if (!strcmp(argv[i], "-rxmaxmtu")) {
  	    if ((i + 1) >= argc) {
  		fprintf(stderr, "missing argument for -rxmaxmtu\n"); 
***************
*** 1515,1520 ****
--- 1531,1541 ----
  		("Couldn't initialize protection library; code=%d.\n", code));
  	return code;
      }
+ 
+ #ifdef AFS_PTHREAD_ENV
+     assert(pthread_key_create(&viced_uclient_key, NULL) == 0);
+ #endif
+ 
      SystemId = SYSADMINID;
      SystemAnyUser = ANYUSERID;
      SystemAnyUserCPS.prlist_len = 0;
***************
*** 1750,1756 ****
  	FS_HostAddrs_HBO[i] = ntohl(FS_HostAddrs[i]);
      addrs.bulkaddrs_len = FS_HostAddr_cnt;
      addrs.bulkaddrs_val = (afs_uint32 *) FS_HostAddrs_HBO;
!     code = ubik_Call(VL_RegisterAddrs, cstruct, 0, &FS_HostUUID, 0, &addrs);
      if (code) {
  	if (code == VL_MULTIPADDR) {
  	    ViceLog(0,
--- 1771,1777 ----
  	FS_HostAddrs_HBO[i] = ntohl(FS_HostAddrs[i]);
      addrs.bulkaddrs_len = FS_HostAddr_cnt;
      addrs.bulkaddrs_val = (afs_uint32 *) FS_HostAddrs_HBO;
!     code = ubik_VL_RegisterAddrs(cstruct, 0, &FS_HostUUID, 0, &addrs);
      if (code) {
  	if (code == VL_MULTIPADDR) {
  	    ViceLog(0,
***************
*** 1776,1781 ****
--- 1797,1839 ----
  }
  
  afs_int32
+ SetupVL()
+ {
+     afs_int32 code;
+     extern int rxi_numNetAddrs;
+     extern afs_uint32 rxi_NetAddrs[];
+ 
+ #ifndef AFS_NT40_ENV
+     if (AFSDIR_SERVER_NETRESTRICT_FILEPATH || AFSDIR_SERVER_NETINFO_FILEPATH) {
+ 	/*
+ 	 * Find addresses we are supposed to register as per the netrestrict 
+ 	 * and netinfo files (/usr/afs/local/NetInfo and 
+ 	 * /usr/afs/local/NetRestict)
+ 	 */
+ 	char reason[1024];
+ 	afs_int32 code = parseNetFiles(FS_HostAddrs, NULL, NULL,
+ 				       ADDRSPERSITE, reason,
+ 				       AFSDIR_SERVER_NETINFO_FILEPATH,
+ 				       AFSDIR_SERVER_NETRESTRICT_FILEPATH);
+ 	if (code < 0) {
+ 	    ViceLog(0, ("Can't register any valid addresses: %s\n", reason));
+ 	    exit(1);
+ 	}
+ 	FS_HostAddr_cnt = (afs_uint32) code;
+     } else
+ #endif
+     {
+ 	FS_HostAddr_cnt = rx_getAllAddr(FS_HostAddrs, ADDRSPERSITE);
+     }
+ 
+     if (FS_HostAddr_cnt == 1 && rxBind == 1)
+ 	code = FS_HostAddrs[0];
+     else 
+ 	code = htonl(INADDR_ANY);
+     return code;
+ }
+ 
+ afs_int32
  InitVL()
  {
      afs_int32 code;
***************
*** 1806,1835 ****
      /* A good sysid file exists; inform the vlserver. If any conflicts,
       * we always use the latest interface available as the real truth.
       */
- #ifndef AFS_NT40_ENV
-     if (AFSDIR_SERVER_NETRESTRICT_FILEPATH || AFSDIR_SERVER_NETINFO_FILEPATH) {
- 	/*
- 	 * Find addresses we are supposed to register as per the netrestrict 
- 	 * and netinfo files (/usr/afs/local/NetInfo and 
- 	 * /usr/afs/local/NetRestict)
- 	 */
- 	char reason[1024];
- 	afs_int32 code = parseNetFiles(FS_HostAddrs, NULL, NULL,
- 				       ADDRSPERSITE, reason,
- 				       AFSDIR_SERVER_NETINFO_FILEPATH,
- 				       AFSDIR_SERVER_NETRESTRICT_FILEPATH);
- 	if (code < 0) {
- 	    ViceLog(0, ("Can't register any valid addresses: %s\n", reason));
- 	    exit(1);
- 	}
- 	FS_HostAddr_cnt = (afs_uint32) code;
-     } else
- #endif
-     {
- 	FS_HostAddr_cnt = rx_getAllAddr(FS_HostAddrs, ADDRSPERSITE);
-     }
  
-     FS_registered = 1;
      code = Do_VLRegisterRPC();
      return code;
  }
--- 1864,1870 ----
***************
*** 1854,1859 ****
--- 1889,1895 ----
  #endif
      int curLimit;
      time_t t;
+     afs_uint32 rx_bindhost;
  
  #ifdef	AFS_AIX32_ENV
      struct sigaction nsa;
***************
*** 2019,2025 ****
  #endif
      if (udpBufSize)
  	rx_SetUdpBufSize(udpBufSize);	/* set the UDP buffer size for receive */
!     if (rx_Init((int)htons(7000)) < 0) {
  	ViceLog(0, ("Cannot initialize RX\n"));
  	exit(1);
      }
--- 2055,2063 ----
  #endif
      if (udpBufSize)
  	rx_SetUdpBufSize(udpBufSize);	/* set the UDP buffer size for receive */
!     rx_bindhost = SetupVL();
! 
!     if (rx_InitHost(rx_bindhost, (int)htons(7000)) < 0) {
  	ViceLog(0, ("Cannot initialize RX\n"));
  	exit(1);
      }
***************
*** 2036,2046 ****
      sc[1] = 0;			/* rxvab_NewServerSecurityObject(key1, 0) */
      sc[2] = rxkad_NewServerSecurityObject(rxkad_clear, NULL, get_key, NULL);
      sc[3] = rxkad_NewServerSecurityObject(rxkad_crypt, NULL, get_key, NULL);
!     tservice = rx_NewService( /* port */ 0, /* service id */ 1,	/*service name */
! 			     "AFS",
! 							/* security classes */ sc,
! 							/* numb sec classes */
! 			     4, RXAFS_ExecuteRequest);
      if (!tservice) {
  	ViceLog(0,
  		("Failed to initialize RX, probably two servers running.\n"));
--- 2074,2085 ----
      sc[1] = 0;			/* rxvab_NewServerSecurityObject(key1, 0) */
      sc[2] = rxkad_NewServerSecurityObject(rxkad_clear, NULL, get_key, NULL);
      sc[3] = rxkad_NewServerSecurityObject(rxkad_crypt, NULL, get_key, NULL);
!     tservice = rx_NewServiceHost(rx_bindhost,  /* port */ 0, /* service id */ 
! 				 1,	/*service name */
! 				 "AFS",
! 				 /* security classes */ sc,
! 				 /* numb sec classes */
! 				 4, RXAFS_ExecuteRequest);
      if (!tservice) {
  	ViceLog(0,
  		("Failed to initialize RX, probably two servers running.\n"));
Index: openafs/src/vlserver/Makefile.in
diff -c openafs/src/vlserver/Makefile.in:1.12 openafs/src/vlserver/Makefile.in:1.12.14.1
*** openafs/src/vlserver/Makefile.in:1.12	Mon Jan 13 13:55:07 2003
--- openafs/src/vlserver/Makefile.in	Mon Jul  3 15:07:16 2006
***************
*** 72,78 ****
  vldbint.xdr.o: vldbint.xdr.c vldbint.h
  
  vldbint.cs.c: vldbint.xg
! 	${RXGEN} -x -C -o $@ ${srcdir}/vldbint.xg
  
  vldbint.ss.c: vldbint.xg
  	${RXGEN} -x -S -o $@ ${srcdir}/vldbint.xg
--- 72,78 ----
  vldbint.xdr.o: vldbint.xdr.c vldbint.h
  
  vldbint.cs.c: vldbint.xg
! 	${RXGEN} -u -x -C -o $@ ${srcdir}/vldbint.xg
  
  vldbint.ss.c: vldbint.xg
  	${RXGEN} -x -S -o $@ ${srcdir}/vldbint.xg
***************
*** 81,87 ****
  	${RXGEN} -x -c -o $@ ${srcdir}/vldbint.xg
  
  vldbint.h: vldbint.xg
! 	${RXGEN} -x -h -o $@ ${srcdir}/vldbint.xg
  
  vldbint.cs.c: vldbint.h
  vldbint.ss.c: vldbint.h
--- 81,87 ----
  	${RXGEN} -x -c -o $@ ${srcdir}/vldbint.xg
  
  vldbint.h: vldbint.xg
! 	${RXGEN} -u -x -h -o $@ ${srcdir}/vldbint.xg
  
  vldbint.cs.c: vldbint.h
  vldbint.ss.c: vldbint.h
Index: openafs/src/vlserver/NTMakefile
diff -c openafs/src/vlserver/NTMakefile:1.10 openafs/src/vlserver/NTMakefile:1.10.4.2
*** openafs/src/vlserver/NTMakefile:1.10	Sun Nov 20 20:57:41 2005
--- openafs/src/vlserver/NTMakefile	Wed Jul  5 15:21:05 2006
***************
*** 104,111 ****
  $(INCFILES):$$(@F)
  	 $(COPY)  $** $(INCFILEDIR)\.
  
! vldbint.ss.c vldbint.cs.c vldbint.xdr.c vldbint.h: vldbint.xg
! 	$(RXGEN) -x $**
  	$(COPY) vldbint.h $(DESTDIR)\include\afs\vldbint.h
  
  ############################################################################
--- 104,120 ----
  $(INCFILES):$$(@F)
  	 $(COPY)  $** $(INCFILEDIR)\.
  
! vldbint.cs.c: vldbint.xg vldbint.h
! 	$(RXGEN) -u -x -C -o $@ vldbint.xg
! 
! vldbint.ss.c: vldbint.xg vldbint.h
! 	$(RXGEN) -x -S -o $@ vldbint.xg
! 
! vldbint.xdr.c: vldbint.xg vldbint.h
! 	$(RXGEN) -x -c -o $@ vldbint.xg
! 
! vldbint.h: vldbint.xg
! 	$(RXGEN) -u -x -h -o $@ vldbint.xg
  	$(COPY) vldbint.h $(DESTDIR)\include\afs\vldbint.h
  
  ############################################################################
***************
*** 157,163 ****
  # clean up
  
  clean::
! 	$(DEL) vldbint.cs.c vldbint.ss.c vldbint.xdr.c vldbint.h$$ 
  	$(DEL) vlserver.h vl_errors.c $(INCFILES)
  
  mkdir:
--- 166,172 ----
  # clean up
  
  clean::
! 	$(DEL) vldbint.cs.c vldbint.ss.c vldbint.xdr.c vldbint.h
  	$(DEL) vlserver.h vl_errors.c $(INCFILES)
  
  mkdir:
Index: openafs/src/vlserver/vlserver.c
diff -c openafs/src/vlserver/vlserver.c:1.22 openafs/src/vlserver/vlserver.c:1.22.2.2
*** openafs/src/vlserver/vlserver.c:1.22	Wed Apr 26 11:22:33 2006
--- openafs/src/vlserver/vlserver.c	Tue Jun 20 16:37:12 2006
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vlserver/vlserver.c,v 1.22 2006/04/26 15:22:33 jaltman Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vlserver/vlserver.c,v 1.22.2.2 2006/06/20 20:37:12 jaltman Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 72,77 ****
--- 72,81 ----
  int smallMem = 0;
  int rxJumbograms = 1;		/* default is to send and receive jumbo grams */
  int rxMaxMTU = -1;
+ afs_int32 rxBind = 0;
+ 
+ #define ADDRSPERSITE 16         /* Same global is in rx/rx_user.c */
+ afs_uint32 SHostAddrs[ADDRSPERSITE];
  
  static void
  CheckSignal_Signal()
***************
*** 144,149 ****
--- 148,154 ----
      extern int rx_extraPackets;
      char commandLine[150];
      char clones[MAXHOSTSPERCELL];
+     afs_uint32 host = ntohl(INADDR_ANY);
  
  #ifdef	AFS_AIX32_ENV
      /*
***************
*** 179,184 ****
--- 184,192 ----
  	} else if (strcmp(argv[index], "-nojumbo") == 0) {
  	    rxJumbograms = 0;
  
+ 	} else if (strcmp(argv[index], "-rxbind") == 0) {
+ 	    rxBind = 1;
+ 
  	} else if (!strcmp(argv[index], "-rxmaxmtu")) {
  	    if ((index + 1) >= argc) {
  		fprintf(stderr, "missing argument for -rxmaxmtu\n"); 
***************
*** 245,258 ****
  	    /* support help flag */
  #ifndef AFS_NT40_ENV
  	    printf("Usage: vlserver [-p <number of processes>] [-nojumbo] "
! 		   "[-rxmaxmtu <bytes>] "
  		   "[-auditlog <log path>] "
  		   "[-syslog[=FACILITY]] "
  		   "[-enable_peer_stats] [-enable_process_stats] "
  		   "[-help]\n");
  #else
  	    printf("Usage: vlserver [-p <number of processes>] [-nojumbo] "
! 		   "[-rxmaxmtu <bytes>] "
  		   "[-auditlog <log path>] "
  		   "[-enable_peer_stats] [-enable_process_stats] "
  		   "[-help]\n");
--- 253,266 ----
  	    /* support help flag */
  #ifndef AFS_NT40_ENV
  	    printf("Usage: vlserver [-p <number of processes>] [-nojumbo] "
! 		   "[-rxmaxmtu <bytes>] [-rxbind] "
  		   "[-auditlog <log path>] "
  		   "[-syslog[=FACILITY]] "
  		   "[-enable_peer_stats] [-enable_process_stats] "
  		   "[-help]\n");
  #else
  	    printf("Usage: vlserver [-p <number of processes>] [-nojumbo] "
! 		   "[-rxmaxmtu <bytes>] [-rxbind] "
  		   "[-auditlog <log path>] "
  		   "[-enable_peer_stats] [-enable_process_stats] "
  		   "[-help]\n");
***************
*** 323,328 ****
--- 331,357 ----
      if (noAuth)
  	afsconf_SetNoAuthFlag(tdir, 1);
  
+     if (rxBind) {
+ 	afs_int32 ccode;
+ #ifndef AFS_NT40_ENV
+         if (AFSDIR_SERVER_NETRESTRICT_FILEPATH || 
+             AFSDIR_SERVER_NETINFO_FILEPATH) {
+             char reason[1024];
+             ccode = parseNetFiles(SHostAddrs, NULL, NULL,
+ 				  ADDRSPERSITE, reason,
+ 				  AFSDIR_SERVER_NETINFO_FILEPATH,
+ 				  AFSDIR_SERVER_NETRESTRICT_FILEPATH);
+         } else 
+ #endif	
+ 	{
+             ccode = rx_getAllAddr(SHostAddrs, ADDRSPERSITE);
+         }
+         if (ccode == 1) {
+             host = SHostAddrs[0];
+ 	    rx_InitHost(host, htons(AFSCONF_VLDBPORT));
+ 	}
+     }
+ 
      ubik_nBuffers = 512;
      ubik_CRXSecurityProc = afsconf_ClientAuth;
      ubik_CRXSecurityRock = (char *)tdir;
***************
*** 351,358 ****
      sc[0] = rxnull_NewServerSecurityObject();
      sc[1] = (struct rx_securityClass *)0;
      sc[2] = rxkad_NewServerSecurityObject(0, tdir, afsconf_GetKey, NULL);
      tservice =
! 	rx_NewService(0, USER_SERVICE_ID, "Vldb server", sc, 3,
  		      VL_ExecuteRequest);
      if (tservice == (struct rx_service *)0) {
  	printf("vlserver: Could not create VLDB_SERVICE rx service\n");
--- 380,388 ----
      sc[0] = rxnull_NewServerSecurityObject();
      sc[1] = (struct rx_securityClass *)0;
      sc[2] = rxkad_NewServerSecurityObject(0, tdir, afsconf_GetKey, NULL);
+ 
      tservice =
! 	rx_NewServiceHost(host, 0, USER_SERVICE_ID, "Vldb server", sc, 3,
  		      VL_ExecuteRequest);
      if (tservice == (struct rx_service *)0) {
  	printf("vlserver: Could not create VLDB_SERVICE rx service\n");
***************
*** 364,370 ****
      rx_SetMaxProcs(tservice, lwps);
  
      tservice =
! 	rx_NewService(0, RX_STATS_SERVICE_ID, "rpcstats", sc, 3,
  		      RXSTATS_ExecuteRequest);
      if (tservice == (struct rx_service *)0) {
  	printf("vlserver: Could not create rpc stats rx service\n");
--- 394,400 ----
      rx_SetMaxProcs(tservice, lwps);
  
      tservice =
! 	rx_NewServiceHost(host, 0, RX_STATS_SERVICE_ID, "rpcstats", sc, 3,
  		      RXSTATS_ExecuteRequest);
      if (tservice == (struct rx_service *)0) {
  	printf("vlserver: Could not create rpc stats rx service\n");
Index: openafs/src/vol/namei_ops.c
diff -c openafs/src/vol/namei_ops.c:1.28 openafs/src/vol/namei_ops.c:1.28.2.1
*** openafs/src/vol/namei_ops.c:1.28	Wed Apr 26 11:43:17 2006
--- openafs/src/vol/namei_ops.c	Mon Jun 12 20:01:51 2006
***************
*** 13,19 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vol/namei_ops.c,v 1.28 2006/04/26 15:43:17 shadow Exp $");
  
  #ifdef AFS_NAMEI_ENV
  #include <stdio.h>
--- 13,19 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vol/namei_ops.c,v 1.28.2.1 2006/06/13 00:01:51 shadow Exp $");
  
  #ifdef AFS_NAMEI_ENV
  #include <stdio.h>
***************
*** 695,710 ****
  		FDH_REALLYCLOSE(fdP);
  		return -1;
  	    }
  	}
  	if (count == 0) {
  	    IHandle_t *th;
  	    IH_INIT(th, ih->ih_dev, ih->ih_vid, ino);
! #if 0
! 	    /* This triggers in the fileserver on the volume index vnodes */
! 	    if (th->ih_refcnt > 1)
! 		Log("Warning: Leaked ref on ihandle dev %d vid %d ino %lld\n",
! 		    th->ih_dev, th->ih_vid, (int64_t) th->ih_ino);
! #endif
  	    namei_HandleToName(&name, th);
  	    IH_RELEASE(th);
  	    code = unlink(name.n_path);
--- 695,718 ----
  		FDH_REALLYCLOSE(fdP);
  		return -1;
  	    }
+ 	} else {
+ 	    IHandle_t *th;
+ 	    IH_INIT(th, ih->ih_dev, ih->ih_vid, ino);
+ 	    Log("Warning: Lost ref on ihandle dev %d vid %d ino %lld\n",
+ 		th->ih_dev, th->ih_vid, (int64_t) th->ih_ino);
+ 	    IH_RELEASE(th);
+ 	  
+ 	    /* If we're less than 0, someone presumably unlinked;
+ 	       don't bother setting count to 0, but we need to drop a lock */
+ 	    if (namei_SetLinkCount(fdP, ino, 0, 1) < 0) {
+ 		FDH_REALLYCLOSE(fdP);
+ 		return -1;
+ 	    }
  	}
  	if (count == 0) {
  	    IHandle_t *th;
  	    IH_INIT(th, ih->ih_dev, ih->ih_vid, ino);
! 
  	    namei_HandleToName(&name, th);
  	    IH_RELEASE(th);
  	    code = unlink(name.n_path);
Index: openafs/src/vol/vol-salvage.c
diff -c openafs/src/vol/vol-salvage.c:1.51 openafs/src/vol/vol-salvage.c:1.51.2.2
*** openafs/src/vol/vol-salvage.c:1.51	Tue Apr  4 17:32:22 2006
--- openafs/src/vol/vol-salvage.c	Fri Jun 30 10:00:45 2006
***************
*** 87,93 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vol/vol-salvage.c,v 1.51 2006/04/04 21:32:22 rees Exp $");
  
  #ifndef AFS_NT40_ENV
  #include <sys/param.h>
--- 87,93 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vol/vol-salvage.c,v 1.51.2.2 2006/06/30 14:00:45 shadow Exp $");
  
  #ifndef AFS_NT40_ENV
  #include <sys/param.h>
***************
*** 2228,2234 ****
      struct VnodeDiskObject vnode;
      struct VnodeClassInfo *vcp = &VnodeClassInfo[vLarge];
      Inode oldinode, newinode;
!     int code;
  
      if (dir->copied || Testing)
  	return;
--- 2228,2234 ----
      struct VnodeDiskObject vnode;
      struct VnodeClassInfo *vcp = &VnodeClassInfo[vLarge];
      Inode oldinode, newinode;
!     afs_sfsize_t code;
  
      if (dir->copied || Testing)
  	return;
***************
*** 2279,2296 ****
      struct VnodeClassInfo *vcp = &VnodeClassInfo[vLarge];
      Inode oldinode, newinode;
      DirHandle newdir;
!     register afs_int32 code;
      afs_int32 parentUnique = 1;
      struct VnodeEssence *vnodeEssence;
  
      if (Testing)
  	return;
      Log("Salvaging directory %u...\n", dir->vnodeNumber);
!     code =
  	IH_IREAD(vnodeInfo[vLarge].handle,
  		 vnodeIndexOffset(vcp, dir->vnodeNumber), (char *)&vnode,
  		 sizeof(vnode));
!     assert(code == sizeof(vnode));
      oldinode = VNDISK_GET_INO(&vnode);
      /* Increment the version number by a whole lot to avoid problems with
       * clients that were promised new version numbers--but the file server
--- 2279,2297 ----
      struct VnodeClassInfo *vcp = &VnodeClassInfo[vLarge];
      Inode oldinode, newinode;
      DirHandle newdir;
!     afs_int32 code;
!     afs_sfsize_t lcode;
      afs_int32 parentUnique = 1;
      struct VnodeEssence *vnodeEssence;
  
      if (Testing)
  	return;
      Log("Salvaging directory %u...\n", dir->vnodeNumber);
!     lcode =
  	IH_IREAD(vnodeInfo[vLarge].handle,
  		 vnodeIndexOffset(vcp, dir->vnodeNumber), (char *)&vnode,
  		 sizeof(vnode));
!     assert(lcode == sizeof(vnode));
      oldinode = VNDISK_GET_INO(&vnode);
      /* Increment the version number by a whole lot to avoid problems with
       * clients that were promised new version numbers--but the file server
***************
*** 2321,2328 ****
      if (code) {
  	/* didn't really build the new directory properly, let's just give up. */
  	code = IH_DEC(dir->ds_linkH, newinode, dir->rwVid);
- 	assert(code == 0);
  	Log("Directory salvage returned code %d, continuing.\n", code);
  	assert(1 == 2);
      }
      Log("Checking the results of the directory salvage...\n");
--- 2322,2331 ----
      if (code) {
  	/* didn't really build the new directory properly, let's just give up. */
  	code = IH_DEC(dir->ds_linkH, newinode, dir->rwVid);
  	Log("Directory salvage returned code %d, continuing.\n", code);
+ 	if (code) {
+ 	    Log("also failed to decrement link count on new inode");
+ 	}
  	assert(1 == 2);
      }
      Log("Checking the results of the directory salvage...\n");
***************
*** 2335,2345 ****
      vnode.cloned = 0;
      VNDISK_SET_INO(&vnode, newinode);
      VNDISK_SET_LEN(&vnode, Length(&newdir));
!     code =
  	IH_IWRITE(vnodeInfo[vLarge].handle,
  		  vnodeIndexOffset(vcp, dir->vnodeNumber), (char *)&vnode,
  		  sizeof(vnode));
!     assert(code == sizeof(vnode));
  #ifdef AFS_NT40_ENV
      nt_sync(fileSysDevice);
  #else
--- 2338,2348 ----
      vnode.cloned = 0;
      VNDISK_SET_INO(&vnode, newinode);
      VNDISK_SET_LEN(&vnode, Length(&newdir));
!     lcode =
  	IH_IWRITE(vnodeInfo[vLarge].handle,
  		  vnodeIndexOffset(vcp, dir->vnodeNumber), (char *)&vnode,
  		  sizeof(vnode));
!     assert(lcode == sizeof(vnode));
  #ifdef AFS_NT40_ENV
      nt_sync(fileSysDevice);
  #else
***************
*** 2786,2792 ****
      struct VnodeEssence *vep;
      afs_int32 v, pv;
      IHandle_t *h;
!     int nBytes;
      ViceFid pa;
      VnodeId LFVnode, ThisVnode;
      Unique LFUnique, ThisUnique;
--- 2789,2795 ----
      struct VnodeEssence *vep;
      afs_int32 v, pv;
      IHandle_t *h;
!     afs_sfsize_t nBytes;
      ViceFid pa;
      VnodeId LFVnode, ThisVnode;
      Unique LFUnique, ThisUnique;
***************
*** 3059,3065 ****
  ClearROInUseBit(struct VolumeSummary *summary)
  {
      IHandle_t *h = summary->volumeInfoHandle;
!     int nBytes;
  
      VolumeDiskData volHeader;
  
--- 3062,3068 ----
  ClearROInUseBit(struct VolumeSummary *summary)
  {
      IHandle_t *h = summary->volumeInfoHandle;
!     afs_sfsize_t nBytes;
  
      VolumeDiskData volHeader;
  
***************
*** 3071,3077 ****
      volHeader.inService = 1;
      volHeader.dontSalvage = DONT_SALVAGE;
      if (!Testing) {
! 	nBytes = IH_IREAD(h, 0, (char *)&volHeader, sizeof(volHeader));
  	assert(nBytes == sizeof(volHeader));
      }
  }
--- 3074,3080 ----
      volHeader.inService = 1;
      volHeader.dontSalvage = DONT_SALVAGE;
      if (!Testing) {
! 	nBytes = IH_IWRITE(h, 0, (char *)&volHeader, sizeof(volHeader));
  	assert(nBytes == sizeof(volHeader));
      }
  }
Index: openafs/src/volser/NTMakefile
diff -c openafs/src/volser/NTMakefile:1.11 openafs/src/volser/NTMakefile:1.11.2.1
*** openafs/src/volser/NTMakefile:1.11	Mon Mar 20 11:07:21 2006
--- openafs/src/volser/NTMakefile	Tue Jul  4 02:28:28 2006
***************
*** 140,148 ****
  $(INCFILES):$$(@F)
  	 $(COPY)  $** $(INCFILEDIR)\.
  
! volint.h volint.cs.c volint.ss.c volint.xdr.c: volint.xg
! 	$(RXGEN) -x $**
  
  
  ############################################################################
  # Definitions for generating files via COMPILE_ET
--- 140,156 ----
  $(INCFILES):$$(@F)
  	 $(COPY)  $** $(INCFILEDIR)\.
  
! volint.cs.c: volint.xg volint.h
! 	$(RXGEN) -x -C -o $@ volint.xg
  
+ volint.ss.c: volint.xg volint.h
+ 	$(RXGEN) -x -S -o $@ volint.xg
+ 
+ volint.xdr.c: volint.xg volint.h
+ 	$(RXGEN) -x -c -o $@ volint.xg
+ 
+ volint.h: volint.xg
+ 	$(RXGEN) -x -h -o $@ volint.xg
  
  ############################################################################
  # Definitions for generating files via COMPILE_ET
Index: openafs/src/volser/dumpstuff.c
diff -c openafs/src/volser/dumpstuff.c:1.29 openafs/src/volser/dumpstuff.c:1.29.2.1
*** openafs/src/volser/dumpstuff.c:1.29	Wed Apr 26 11:43:20 2006
--- openafs/src/volser/dumpstuff.c	Tue Jun 20 17:40:12 2006
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/dumpstuff.c,v 1.29 2006/04/26 15:43:20 shadow Exp $");
  
  #include <sys/types.h>
  #include <ctype.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/dumpstuff.c,v 1.29.2.1 2006/06/20 21:40:12 shadow Exp $");
  
  #include <sys/types.h>
  #include <ctype.h>
***************
*** 524,532 ****
  static int
  DumpFile(struct iod *iodp, int vnode, FdHandle_t * handleP)
  {
!     int code = 0, lcode = 0, error = 0;
      afs_int32 pad = 0, offset;
      afs_sfsize_t n, nbytes, howMany, howBig;
      byte *p;
  #ifndef AFS_NT40_ENV
      struct afs_stat status;
--- 524,533 ----
  static int
  DumpFile(struct iod *iodp, int vnode, FdHandle_t * handleP)
  {
!     int code = 0, error = 0;
      afs_int32 pad = 0, offset;
      afs_sfsize_t n, nbytes, howMany, howBig;
+     afs_foff_t lcode;
      byte *p;
  #ifndef AFS_NT40_ENV
      struct afs_stat status;
***************
*** 534,540 ****
--- 535,546 ----
      afs_sfsize_t size;
  #ifdef	AFS_AIX_ENV
  #include <sys/statfs.h>
+ #ifdef AFS_LARGEFILE_ENV
+     struct statfs64 tstatfs;
+ #else /* !AFS_LARGEFILE_ENV */
      struct statfs tstatfs;
+ #endif /* !AFS_LARGEFILE_ENV */
+     int statfs_code;
  #endif
  
  #ifdef AFS_NT40_ENV
***************
*** 549,556 ****
      /* Unfortunately in AIX valuable fields such as st_blksize are 
       * gone from the stat structure.
       */
!     fstatfs(handleP->fd_fd, &tstatfs);
      howMany = tstatfs.f_bsize;
  #else
      howMany = status.st_blksize;
  #endif /* AFS_AIX_ENV */
--- 555,571 ----
      /* Unfortunately in AIX valuable fields such as st_blksize are 
       * gone from the stat structure.
       */
! #ifdef AFS_LARGEFILE_ENV
!     statfs_code = fstatfs64(handleP->fd_fd, &tstatfs);
! #else /* !AFS_LARGEFILE_ENV */
!     statfs_code = fstatfs(handleP->fd_fd, &tstatfs);
! #endif /* !AFS_LARGEFILE_ENV */
!     if (statfs_code != 0) {
!         Log("DumpFile: fstatfs returned error code %d on descriptor %d\n", errno, handleP->fd_fd);
! 	return VOLSERDUMPERROR;
!     }
      howMany = tstatfs.f_bsize;
+     Log("DumpFile: fstatfs returned block size of %lld; howMany=%lld", tstatfs.f_bsize, howMany);
  #else
      howMany = status.st_blksize;
  #endif /* AFS_AIX_ENV */
***************
*** 575,583 ****
  	return VOLSERDUMPERROR;
      }
  
!     p = (unsigned char *)malloc(howMany);
      if (!p) {
! 	Log("1 Volser: DumpFile: no memory");
  	return VOLSERDUMPERROR;
      }
  
--- 590,598 ----
  	return VOLSERDUMPERROR;
      }
  
!     p = (unsigned char *)malloc((size_t)howMany);
      if (!p) {
! 	Log("1 Volser: DumpFile: not enough memory to allocate %u bytes\n", howMany);
  	return VOLSERDUMPERROR;
      }
  
***************
*** 586,592 ****
  	    howMany = nbytes;
  
  	/* Read the data - unless we know we can't */
! 	n = (lcode ? 0 : FDH_READ(handleP, p, howMany));
  
  	/* If read any good data and we null padded previously, log the
  	 * amount that we had null padded.
--- 601,607 ----
  	    howMany = nbytes;
  
  	/* Read the data - unless we know we can't */
! 	n = (lcode ? 0 : FDH_READ(handleP, p, (size_t)howMany));
  
  	/* If read any good data and we null padded previously, log the
  	 * amount that we had null padded.
***************
*** 620,626 ****
  	    /* Now seek over the data we could not get. An error here means we
  	     * can't do the next read.
  	     */
! 	    lcode = FDH_SEEK(handleP, ((size - nbytes) + howMany), SEEK_SET);
  	    if (lcode != ((size - nbytes) + howMany)) {
  		if (lcode < 0) {
  		    Log("1 Volser: DumpFile: Error %d seeking in inode %s for vnode %d\n", errno, PrintInode(NULL, handleP->fd_ih->ih_ino), vnode);
--- 635,641 ----
  	    /* Now seek over the data we could not get. An error here means we
  	     * can't do the next read.
  	     */
! 	    lcode = FDH_SEEK(handleP, (size_t)((size - nbytes) + howMany), SEEK_SET);
  	    if (lcode != ((size - nbytes) + howMany)) {
  		if (lcode < 0) {
  		    Log("1 Volser: DumpFile: Error %d seeking in inode %s for vnode %d\n", errno, PrintInode(NULL, handleP->fd_ih->ih_ino), vnode);
***************
*** 634,640 ****
  	}
  
  	/* Now write the data out */
! 	if (iod_Write(iodp, (char *)p, howMany) != howMany)
  	    error = VOLSERDUMPERROR;
  #ifndef AFS_PTHREAD_ENV
  	IOMGR_Poll();
--- 649,655 ----
  	}
  
  	/* Now write the data out */
! 	if (iod_Write(iodp, (char *)p, (size_t)howMany) != howMany)
  	    error = VOLSERDUMPERROR;
  #ifndef AFS_PTHREAD_ENV
  	IOMGR_Poll();
Index: openafs/src/volser/volmain.c
diff -c openafs/src/volser/volmain.c:1.22 openafs/src/volser/volmain.c:1.22.2.2
*** openafs/src/volser/volmain.c:1.22	Tue Feb 21 23:07:40 2006
--- openafs/src/volser/volmain.c	Tue Jun 20 16:37:12 2006
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/volmain.c,v 1.22 2006/02/22 04:07:40 jaltman Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/volmain.c,v 1.22.2.2 2006/06/20 20:37:12 jaltman Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
***************
*** 95,100 ****
--- 95,104 ----
  int udpBufSize = 0;		/* UDP buffer size for receive */
  
  int Testing = 0;		/* for ListViceInodes */
+ int rxBind = 0;
+ 
+ #define ADDRSPERSITE 16         /* Same global is in rx/rx_user.c */
+ afs_uint32 SHostAddrs[ADDRSPERSITE];
  
  #define VS_EXIT(code)  {                                          \
                            osi_audit(VS_ExitEvent, code, AUD_END); \
***************
*** 244,249 ****
--- 248,254 ----
      int rxJumbograms = 1;	/* default is to send and receive jumbograms. */
      int rxMaxMTU = -1;
      int bufSize = 0;		/* temp variable to read in udp socket buf size */
+     afs_uint32 host = ntohl(INADDR_ANY);
  
  #ifdef	AFS_AIX32_ENV
      /*
***************
*** 288,293 ****
--- 293,300 ----
  	    DoLogging = 1;
  	} else if (strcmp(argv[code], "-help") == 0) {
  	    goto usage;
+ 	} else if (strcmp(argv[code], "-rxbind") == 0) {
+ 	    rxBind = 1;
  	} else if (strcmp(argv[code], "-p") == 0) {
  	    lwps = atoi(argv[++code]);
  	    if (lwps > MAXLWP) {
***************
*** 379,385 ****
  #ifndef AFS_NT40_ENV
  	    printf("Usage: volserver [-log] [-p <number of processes>] "
  		   "[-auditlog <log path>] "
! 		   "[-nojumbo] [-rxmaxmtu <bytes>] "
  		   "[-udpsize <size of socket buffer in bytes>] "
  		   "[-syslog[=FACILITY]] "
  		   "[-enable_peer_stats] [-enable_process_stats] "
--- 386,392 ----
  #ifndef AFS_NT40_ENV
  	    printf("Usage: volserver [-log] [-p <number of processes>] "
  		   "[-auditlog <log path>] "
! 		   "[-nojumbo] [-rxmaxmtu <bytes>] [-rxbind] "
  		   "[-udpsize <size of socket buffer in bytes>] "
  		   "[-syslog[=FACILITY]] "
  		   "[-enable_peer_stats] [-enable_process_stats] "
***************
*** 387,393 ****
  #else
  	    printf("Usage: volserver [-log] [-p <number of processes>] "
  		   "[-auditlog <log path>] "
! 		   "[-nojumbo] [-rxmaxmtu <bytes>] "
  		   "[-udpsize <size of socket buffer in bytes>] "
  		   "[-enable_peer_stats] [-enable_process_stats] "
  		   "[-help]\n");
--- 394,400 ----
  #else
  	    printf("Usage: volserver [-log] [-p <number of processes>] "
  		   "[-auditlog <log path>] "
! 		   "[-nojumbo] [-rxmaxmtu <bytes>] [-rxbind] "
  		   "[-udpsize <size of socket buffer in bytes>] "
  		   "[-enable_peer_stats] [-enable_process_stats] "
  		   "[-help]\n");
***************
*** 426,432 ****
      rx_nPackets = rxpackets;	/* set the max number of packets */
      if (udpBufSize)
  	rx_SetUdpBufSize(udpBufSize);	/* set the UDP buffer size for receive */
!     code = rx_Init((int)htons(AFSCONF_VOLUMEPORT));
      if (code) {
  	fprintf(stderr, "rx init failed on socket AFSCONF_VOLUMEPORT %u\n",
  		AFSCONF_VOLUMEPORT);
--- 433,458 ----
      rx_nPackets = rxpackets;	/* set the max number of packets */
      if (udpBufSize)
  	rx_SetUdpBufSize(udpBufSize);	/* set the UDP buffer size for receive */
!     if (rxBind) {
! 	afs_int32 ccode;
! #ifndef AFS_NT40_ENV
!         if (AFSDIR_SERVER_NETRESTRICT_FILEPATH || 
!             AFSDIR_SERVER_NETINFO_FILEPATH) {
!             char reason[1024];
!             ccode = parseNetFiles(SHostAddrs, NULL, NULL,
!                                            ADDRSPERSITE, reason,
!                                            AFSDIR_SERVER_NETINFO_FILEPATH,
!                                            AFSDIR_SERVER_NETRESTRICT_FILEPATH);
!         } else 
! #endif	
! 	{
!             ccode = rx_getAllAddr(SHostAddrs, ADDRSPERSITE);
!         }
!         if (ccode == 1) 
!             host = SHostAddrs[0];
!     }
! 
!     code = rx_InitHost(host, (int)htons(AFSCONF_VOLUMEPORT));
      if (code) {
  	fprintf(stderr, "rx init failed on socket AFSCONF_VOLUMEPORT %u\n",
  		AFSCONF_VOLUMEPORT);
***************
*** 478,484 ****
      if (securityObjects[0] == (struct rx_securityClass *)0)
  	Abort("rxnull_NewServerSecurityObject");
      service =
! 	rx_NewService(0, VOLSERVICE_ID, "VOLSER", securityObjects, 3,
  		      AFSVolExecuteRequest);
      if (service == (struct rx_service *)0)
  	Abort("rx_NewService");
--- 504,510 ----
      if (securityObjects[0] == (struct rx_securityClass *)0)
  	Abort("rxnull_NewServerSecurityObject");
      service =
! 	rx_NewServiceHost(host, 0, VOLSERVICE_ID, "VOLSER", securityObjects, 3,
  		      AFSVolExecuteRequest);
      if (service == (struct rx_service *)0)
  	Abort("rx_NewService");
Index: openafs/src/volser/vsutils.c
diff -c openafs/src/volser/vsutils.c:1.18 openafs/src/volser/vsutils.c:1.18.8.1
*** openafs/src/volser/vsutils.c:1.18	Tue Dec  7 11:36:43 2004
--- openafs/src/volser/vsutils.c	Mon Jul  3 15:07:16 2006
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/vsutils.c,v 1.18 2004/12/07 16:36:43 shadow Exp $");
  
  #include <afs/stds.h>
  #ifdef AFS_NT40_ENV
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/vsutils.c,v 1.18.8.1 2006/07/03 19:07:16 shadow Exp $");
  
  #include <afs/stds.h>
  #ifdef AFS_NT40_ENV
***************
*** 120,129 ****
  	code = nvlentry_to_ovlentry(entryp, &oentry);
  	if (code)
  	    return code;
! 	code = ubik_Call(VL_CreateEntry, cstruct, 0, &oentry);
  	return code;
      }
!     code = ubik_Call(VL_CreateEntryN, cstruct, 0, entryp);
      if (!newvlserver) {
  	if (code == RXGEN_OPCODE) {
  	    newvlserver = 1;	/* Doesn't support new interface */
--- 120,129 ----
  	code = nvlentry_to_ovlentry(entryp, &oentry);
  	if (code)
  	    return code;
! 	code = ubik_VL_CreateEntry(cstruct, 0, &oentry);
  	return code;
      }
!     code = ubik_VL_CreateEntryN(cstruct, 0, entryp);
      if (!newvlserver) {
  	if (code == RXGEN_OPCODE) {
  	    newvlserver = 1;	/* Doesn't support new interface */
***************
*** 145,156 ****
      if (newvlserver == 1) {
        tryold:
  	code =
! 	    ubik_Call(VL_GetEntryByID, cstruct, 0, volid, voltype, &oentry);
  	if (!code)
  	    ovlentry_to_nvlentry(&oentry, entryp);
  	return code;
      }
!     code = ubik_Call(VL_GetEntryByIDN, cstruct, 0, volid, voltype, entryp);
      if (!newvlserver) {
  	if (code == RXGEN_OPCODE) {
  	    newvlserver = 1;	/* Doesn't support new interface */
--- 145,156 ----
      if (newvlserver == 1) {
        tryold:
  	code =
! 	    ubik_VL_GetEntryByID(cstruct, 0, volid, voltype, &oentry);
  	if (!code)
  	    ovlentry_to_nvlentry(&oentry, entryp);
  	return code;
      }
!     code = ubik_VL_GetEntryByIDN(cstruct, 0, volid, voltype, entryp);
      if (!newvlserver) {
  	if (code == RXGEN_OPCODE) {
  	    newvlserver = 1;	/* Doesn't support new interface */
***************
*** 171,182 ****
  
      if (newvlserver == 1) {
        tryold:
! 	code = ubik_Call(VL_GetEntryByNameO, cstruct, 0, namep, &oentry);
  	if (!code)
  	    ovlentry_to_nvlentry(&oentry, entryp);
  	return code;
      }
!     code = ubik_Call(VL_GetEntryByNameN, cstruct, 0, namep, entryp);
      if (!newvlserver) {
  	if (code == RXGEN_OPCODE) {
  	    newvlserver = 1;	/* Doesn't support new interface */
--- 171,182 ----
  
      if (newvlserver == 1) {
        tryold:
! 	code = ubik_VL_GetEntryByNameO(cstruct, 0, namep, &oentry);
  	if (!code)
  	    ovlentry_to_nvlentry(&oentry, entryp);
  	return code;
      }
!     code = ubik_VL_GetEntryByNameN(cstruct, 0, namep, entryp);
      if (!newvlserver) {
  	if (code == RXGEN_OPCODE) {
  	    newvlserver = 1;	/* Doesn't support new interface */
***************
*** 201,212 ****
  	if (code)
  	    return code;
  	code =
! 	    ubik_Call(VL_ReplaceEntry, cstruct, 0, volid, voltype, &oentry,
  		      releasetype);
  	return code;
      }
      code =
! 	ubik_Call(VL_ReplaceEntryN, cstruct, 0, volid, voltype, entryp,
  		  releasetype);
      if (!newvlserver) {
  	if (code == RXGEN_OPCODE) {
--- 201,212 ----
  	if (code)
  	    return code;
  	code =
! 	    ubik_VL_ReplaceEntry(cstruct, 0, volid, voltype, &oentry,
  		      releasetype);
  	return code;
      }
      code =
! 	ubik_VL_ReplaceEntryN(cstruct, 0, volid, voltype, entryp,
  		  releasetype);
      if (!newvlserver) {
  	if (code == RXGEN_OPCODE) {
***************
*** 233,239 ****
        tryold:
  	memset(&arrayEntries, 0, sizeof(arrayEntries));	/*initialize to hint the stub  to alloc space */
  	code =
! 	    ubik_Call(VL_ListAttributes, cstruct, 0, attrp, entriesp,
  		      &arrayEntries);
  	if (!code) {
  	    blkentriesp->nbulkentries_val =
--- 233,239 ----
        tryold:
  	memset(&arrayEntries, 0, sizeof(arrayEntries));	/*initialize to hint the stub  to alloc space */
  	code =
! 	    ubik_VL_ListAttributes(cstruct, 0, attrp, entriesp,
  		      &arrayEntries);
  	if (!code) {
  	    blkentriesp->nbulkentries_val =
***************
*** 248,254 ****
  	return code;
      }
      code =
! 	ubik_Call(VL_ListAttributesN, cstruct, 0, attrp, entriesp,
  		  blkentriesp);
      if (!newvlserver) {
  	if (code == RXGEN_OPCODE) {
--- 248,254 ----
  	return code;
      }
      code =
! 	ubik_VL_ListAttributesN(cstruct, 0, attrp, entriesp,
  		  blkentriesp);
      if (!newvlserver) {
  	if (code == RXGEN_OPCODE) {
***************
*** 273,279 ****
      afs_int32 code;
  
      code =
! 	ubik_Call(VL_ListAttributesN2, cstruct, 0, attrp, (name ? name : ""),
  		  thisindex, nentriesp, blkentriesp, nextindexp);
      return code;
  }
--- 273,279 ----
      afs_int32 code;
  
      code =
! 	ubik_VL_ListAttributesN2(cstruct, 0, attrp, (name ? name : ""),
  		  thisindex, nentriesp, blkentriesp, nextindexp);
      return code;
  }
***************
*** 342,348 ****
      memset(&addrs, 0, sizeof(addrs));
      memset(&uuid, 0, sizeof(uuid));
      code =
! 	ubik_Call(VL_GetAddrsU, cstruct, 0, &attrs, &uuid, &unique, &nentries,
  		  &addrs);
      if (vlserverv4 == -1) {
  	if (code == RXGEN_OPCODE) {
--- 342,348 ----
      memset(&addrs, 0, sizeof(addrs));
      memset(&uuid, 0, sizeof(uuid));
      code =
! 	ubik_VL_GetAddrsU(cstruct, 0, &attrs, &uuid, &unique, &nentries,
  		  &addrs);
      if (vlserverv4 == -1) {
  	if (code == RXGEN_OPCODE) {
***************
*** 377,411 ****
  }
  
  
- #ifdef	notdef
- afs_int32
- subik_Call(aproc, aclient, aflags, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10,
- 	   p11, p12, p13, p14, p15, p16)
-      register struct ubik_client *aclient;
-      int (*aproc) ();
-      afs_int32 aflags;
-      afs_int32 p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14,
- 	 p15, p16;
- {
-     struct vldbentry vldbentry;
-     register int code, (*nproc) ();
- 
-     if (newvlserver == 1) {
-     }
-     code =
- 	ubik_Call(aproc, aclient, aflags, p1, p2, p3, p4, p5, p6, p7, p8, p9,
- 		  p10, p11, p12, p13, p14, p15, p16);
-     if (!newvlserver) {
- 	if (code == RXGEN_OPCODE) {
- 	    newvlserver = 1;	/* Doesn't support new interface */
- 	} else if (!code) {
- 	    newvlserver = 2;
- 	}
-     }
- }
- #endif /* notdef */
- 
- 
  /*
    Set encryption.  If 'cryptflag' is nonzero, encrpytion is turned on
    for authenticated connections; if zero, encryption is turned off.
--- 377,382 ----
Index: openafs/src/xstat/xstat_cm.c
diff -c openafs/src/xstat/xstat_cm.c:1.10 openafs/src/xstat/xstat_cm.c:1.10.2.1
*** openafs/src/xstat/xstat_cm.c:1.10	Sun Mar  5 22:11:31 2006
--- openafs/src/xstat/xstat_cm.c	Mon Jun 26 12:20:50 2006
***************
*** 18,28 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/xstat/xstat_cm.c,v 1.10 2006/03/06 03:11:31 jaltman Exp $");
  
  #include "xstat_cm.h"		/*Interface for this module */
  #include <lwp.h>		/*Lightweight process package */
  
  #ifdef HAVE_STRING_H
  #include <string.h>
  #else
--- 18,30 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/xstat/xstat_cm.c,v 1.10.2.1 2006/06/26 16:20:50 rra Exp $");
  
  #include "xstat_cm.h"		/*Interface for this module */
  #include <lwp.h>		/*Lightweight process package */
  
+ #include <afs/afsutil.h>
+ 
  #ifdef HAVE_STRING_H
  #include <string.h>
  #else
Index: openafs/src/xstat/xstat_fs.c
diff -c openafs/src/xstat/xstat_fs.c:1.10 openafs/src/xstat/xstat_fs.c:1.10.2.1
*** openafs/src/xstat/xstat_fs.c:1.10	Sun Mar  5 22:11:31 2006
--- openafs/src/xstat/xstat_fs.c	Mon Jun 26 12:20:50 2006
***************
*** 18,28 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/xstat/xstat_fs.c,v 1.10 2006/03/06 03:11:31 jaltman Exp $");
  
  #include "xstat_fs.h"		/*Interface for this module */
  #include <lwp.h>		/*Lightweight process package */
  
  #ifdef HAVE_STRING_H
  #include <string.h>
  #else
--- 18,30 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/xstat/xstat_fs.c,v 1.10.2.1 2006/06/26 16:20:50 rra Exp $");
  
  #include "xstat_fs.h"		/*Interface for this module */
  #include <lwp.h>		/*Lightweight process package */
  
+ #include <afs/afsutil.h>
+ 
  #ifdef HAVE_STRING_H
  #include <string.h>
  #else
