Index: openafs/src/WINNT/afsd/afslogon.c
diff -c openafs/src/WINNT/afsd/afslogon.c:1.24.2.14 openafs/src/WINNT/afsd/afslogon.c:1.24.2.15
*** openafs/src/WINNT/afsd/afslogon.c:1.24.2.14	Fri Jul  1 14:40:50 2005
--- openafs/src/WINNT/afsd/afslogon.c	Mon Aug 29 15:40:59 2005
***************
*** 657,663 ****
  
      MSV1_0_INTERACTIVE_LOGON *IL;
  
!     DWORD code, code2;
  
      int pw_exp;
      char *reason;
--- 657,663 ----
  
      MSV1_0_INTERACTIVE_LOGON *IL;
  
!     DWORD code = 0, code2;
  
      int pw_exp;
      char *reason;
Index: openafs/src/WINNT/afsd/cm_cell.c
diff -c openafs/src/WINNT/afsd/cm_cell.c:1.14.2.4 openafs/src/WINNT/afsd/cm_cell.c:1.14.2.5
*** openafs/src/WINNT/afsd/cm_cell.c:1.14.2.4	Fri Mar 11 01:58:40 2005
--- openafs/src/WINNT/afsd/cm_cell.c	Wed Aug 31 20:07:41 2005
***************
*** 70,79 ****
  #ifdef AFS_FREELANCE_CLIENT
            && !(cp->flags & CM_CELLFLAG_FREELANCE)
  #endif
!           )
  #ifdef AFS_AFSDB_ENV
          || (cm_dnsEnabled && (cp->flags & CM_CELLFLAG_DNS) &&
!          ((cp->flags & CM_CELLFLAG_VLSERVER_INVALID) || (time(0) > cp->timeout)))
  #endif
              ) {
          /* must empty cp->vlServersp */
--- 70,79 ----
  #ifdef AFS_FREELANCE_CLIENT
            && !(cp->flags & CM_CELLFLAG_FREELANCE)
  #endif
!           ) || (time(0) > cp->timeout)
  #ifdef AFS_AFSDB_ENV
          || (cm_dnsEnabled && (cp->flags & CM_CELLFLAG_DNS) &&
!          ((cp->flags & CM_CELLFLAG_VLSERVER_INVALID)))
  #endif
              ) {
          /* must empty cp->vlServersp */
***************
*** 92,97 ****
--- 92,98 ----
                  if (code == 0) {   /* got cell from DNS */
                      cp->flags |= CM_CELLFLAG_DNS;
                      cp->flags &= ~CM_CELLFLAG_VLSERVER_INVALID;
+ 		    cp->timeout = time(0) + ttl;
  #ifdef DEBUG
                      fprintf(stderr, "cell %s: ttl=%d\n", cp->name, ttl);
  #endif
***************
*** 107,115 ****
              {
                  cp = NULL;          /* return NULL to indicate failure */
              }
!         }
      }
- 
      return cp;
  }
  
--- 108,117 ----
              {
                  cp = NULL;          /* return NULL to indicate failure */
              }
!         } else {
! 	    cp->timeout = time(0) + 7200;
! 	}	
      }
      return cp;
  }
  
***************
*** 169,181 ****
                      cp->flags &= ~CM_CELLFLAG_VLSERVER_INVALID;
                      cp->timeout = time(0) + ttl;
                  }
!             } else 
  #endif
-             {   
                  cp = NULL;
                  goto done;
!             }
!         }
  
          /* randomise among those vlservers having the same rank*/ 
          cm_RandomizeServer(&cp->vlServersp);
--- 171,186 ----
                      cp->flags &= ~CM_CELLFLAG_VLSERVER_INVALID;
                      cp->timeout = time(0) + ttl;
                  }
!             } else {
  #endif
                  cp = NULL;
                  goto done;
! #ifdef AFS_AFSDB_ENV
! 	    }
! #endif
!         } else {
! 	    cp->timeout = time(0) + 7200;	/* two hour timeout */
! 	}
  
          /* randomise among those vlservers having the same rank*/ 
          cm_RandomizeServer(&cp->vlServersp);
***************
*** 207,214 ****
  cm_cell_t *cm_FindCellByID(long cellID)
  {
      cm_cell_t *cp;
-     int ttl;
-     int code;
  
      lock_ObtainWrite(&cm_cellLock);
      for (cp = cm_data.allCellsp; cp; cp=cp->nextp) {
--- 212,217 ----
Index: openafs/src/WINNT/afsd/cm_config.c
diff -c openafs/src/WINNT/afsd/cm_config.c:1.20.2.3 openafs/src/WINNT/afsd/cm_config.c:1.20.2.4
*** openafs/src/WINNT/afsd/cm_config.c:1.20.2.3	Sun May 29 23:52:53 2005
--- openafs/src/WINNT/afsd/cm_config.c	Wed Aug 31 20:07:41 2005
***************
*** 125,181 ****
  
  static long cm_ParsePair(char *lineBufferp, char *leftp, char *rightp)
  {
! 	char *tp;
      char tc;
      int sawEquals;
! 	int sawBracket;
          
      sawEquals = 0;
! 	sawBracket = 0;
      for(tp = lineBufferp; *tp; tp++) {
          tc = *tp;
  
! 		if (sawBracket) {
! 			if (tc == ']')
! 				sawBracket = 0;
! 			continue;
! 		}
  
! 		/* comment or line end */
          if (tc == '#' || tc == '\r' || tc == '\n') 
              break;
  
! 		/* square bracket comment -- look for closing delim */
! 		if (tc == '[') {
              sawBracket = 1; 
              continue;
!         }
  
! 		/* space or tab */
          if (tc == ' ' || tc == '\t') 
              continue;
  
          if (tc == '=') {
              sawEquals = 1;
              continue;
! 		}
!                 
          /* now we have a real character, put it in the appropriate bucket */
          if (sawEquals == 0) {
! 			*leftp++ = tc;
!         }
!         else {
! 			*rightp++ = tc;
          }
      }
  
! 	/* null terminate the strings */
! 	*leftp = 0;
      *rightp = 0;
  
      return 0;	/* and return success */
  }
  
  /* search for a cell, and either return an error code if we don't find it,
   * or return 0 if we do, in which case we also fill in the addresses in
   * the cellp field.
--- 125,205 ----
  
  static long cm_ParsePair(char *lineBufferp, char *leftp, char *rightp)
  {
!     char *tp;
      char tc;
      int sawEquals;
!     int sawBracket;
          
      sawEquals = 0;
!     sawBracket = 0;
      for(tp = lineBufferp; *tp; tp++) {
          tc = *tp;
  
! 	if (sawBracket) {
! 	    if (tc == ']')
! 		sawBracket = 0;
! 	    continue;
! 	}
  
! 	/* comment or line end */
          if (tc == '#' || tc == '\r' || tc == '\n') 
              break;
  
! 	/* square bracket comment -- look for closing delim */
! 	if (tc == '[') {
              sawBracket = 1; 
              continue;
!         }	
  
! 	/* space or tab */
          if (tc == ' ' || tc == '\t') 
              continue;
  
          if (tc == '=') {
              sawEquals = 1;
              continue;
! 	}
! 
          /* now we have a real character, put it in the appropriate bucket */
          if (sawEquals == 0) {
! 	    *leftp++ = tc;
!         }	
!         else {	
! 	    *rightp++ = tc;
          }
      }
  
!     /* null terminate the strings */
!     *leftp = 0;
      *rightp = 0;
  
      return 0;	/* and return success */
  }
  
+ static int
+ IsWindowsModule(const char * name)
+ {
+     char * p;
+     int i;
+ 
+     /* Do not perform searches for probable Windows modules */
+     for (p = name, i=0; *p; p++) {
+ 	if ( *p == '.' )
+ 	    i++;
+     }
+     p = strrchr(name, '.');
+     if (p) {
+ 	if (i == 1 && 
+ 	    (!stricmp(p,".dll") ||
+ 	     !stricmp(p,".exe") ||
+ 	     !stricmp(p,".ini") ||
+ 	     !stricmp(p,".db") ||
+ 	     !stricmp(p,".drv")))
+ 	    return 1;
+     }
+     return 0;
+ }
+ 
  /* search for a cell, and either return an error code if we don't find it,
   * or return 0 if we do, in which case we also fill in the addresses in
   * the cellp field.
***************
*** 198,209 ****
      int inRightCell;
      int foundCell = 0;
      long code;
! 	int tracking = 1, partial = 0;
  #if defined(DJGPP) || defined(AFS_WIN95_ENV)
      char *afsconf_path;
      DWORD dwSize;
  #endif
  
      cm_GetCellServDB(wdir);
      tfilep = fopen(wdir, "r");
  
--- 222,236 ----
      int inRightCell;
      int foundCell = 0;
      long code;
!     int tracking = 1, partial = 0;
  #if defined(DJGPP) || defined(AFS_WIN95_ENV)
      char *afsconf_path;
      DWORD dwSize;
  #endif
  
+     if ( IsWindowsModule(cellNamep) )
+ 	return -3;
+ 
      cm_GetCellServDB(wdir);
      tfilep = fopen(wdir, "r");
  
***************
*** 226,232 ****
          strcat(wdir, AFS_CELLSERVDB);
          /*fprintf(stderr, "opening cellservdb file %s\n", wdir);*/
          tfilep = fopen(wdir, "r");
!         if (!tfilep) return -2;
      }
  #else
      /* If we are NT or higher, we don't do DJGPP, So just fail */
--- 253,260 ----
          strcat(wdir, AFS_CELLSERVDB);
          /*fprintf(stderr, "opening cellservdb file %s\n", wdir);*/
          tfilep = fopen(wdir, "r");
!         if (!tfilep) 
! 	    return -2;
      }
  #else
      /* If we are NT or higher, we don't do DJGPP, So just fail */
***************
*** 234,273 ****
          return -2;
  #endif
  
! 	bestp = fopen(wdir, "r");
      
  #ifdef DEBUG
      DebugEvent_local("AFS- cm_searchfile fopen", "Handle[%x], wdir[%s]", bestp, wdir);
  #endif
  
! 	/* have we seen the cell line for the guy we're looking for? */
! 	inRightCell = 0;
! 	while (1) {
          tp = fgets(lineBuffer, sizeof(lineBuffer), tfilep);
          if (tracking)
! 			(void) fgets(lineBuffer, sizeof(lineBuffer), bestp);
!         if (tp == NULL) {
! 			if (feof(tfilep)) {
! 				/* hit EOF */
! 				if (partial) {
! 					/*
! 					 * found partial match earlier;
! 					 * now go back to it
! 					 */
! 					tempp = bestp;
! 					bestp = tfilep;
! 					tfilep = tempp;
! 					inRightCell = 1;
! 					partial = 0;
! 					continue;
! 				}
! 				else {
! 					fclose(tfilep);
! 					fclose(bestp);
! 					return (foundCell? 0 : -3);
! 				}
! 			}
!         }
  
          /* turn trailing cr or lf into null */
          tp = strchr(lineBuffer, '\r');
--- 262,301 ----
          return -2;
  #endif
  
!     bestp = fopen(wdir, "r");
      
  #ifdef DEBUG
      DebugEvent_local("AFS- cm_searchfile fopen", "Handle[%x], wdir[%s]", bestp, wdir);
  #endif
  
!     /* have we seen the cell line for the guy we're looking for? */
!     inRightCell = 0;
!     while (1) {
          tp = fgets(lineBuffer, sizeof(lineBuffer), tfilep);
          if (tracking)
! 	    (void) fgets(lineBuffer, sizeof(lineBuffer), bestp);
!         if (	tp == NULL) {
! 	    if (feof(tfilep)) {
! 		/* hit EOF */
! 		if (partial) {
! 		    /*
! 		     * found partial match earlier;
! 		     * now go back to it
! 		     */
! 		    tempp = bestp;
! 		    bestp = tfilep;
! 		    tfilep = tempp;
! 		    inRightCell = 1;
! 		    partial = 0;
! 		    continue;
! 		}
! 		else {
! 		    fclose(tfilep);
! 		    fclose(bestp);
! 		    return (foundCell? 0 : -3);
! 		}
! 	    }
!         }	
  
          /* turn trailing cr or lf into null */
          tp = strchr(lineBuffer, '\r');
***************
*** 275,285 ****
          tp = strchr(lineBuffer, '\n');
          if (tp) *tp = 0;
  
! 		/* skip blank lines */
          if (lineBuffer[0] == 0) continue;
  
          if (lineBuffer[0] == '>') {
! 			/* trim off at white space or '#' chars */
              tp = strchr(lineBuffer, ' ');
              if (tp) *tp = 0;
              tp = strchr(lineBuffer, '\t');
--- 303,313 ----
          tp = strchr(lineBuffer, '\n');
          if (tp) *tp = 0;
  
! 	/* skip blank lines */
          if (lineBuffer[0] == 0) continue;
  
          if (lineBuffer[0] == '>') {
! 	    /* trim off at white space or '#' chars */
              tp = strchr(lineBuffer, ' ');
              if (tp) *tp = 0;
              tp = strchr(lineBuffer, '\t');
***************
*** 287,340 ****
              tp = strchr(lineBuffer, '#');
              if (tp) *tp = 0;
  
! 			/* now see if this is the right cell */
              if (stricmp(lineBuffer+1, cellNamep) == 0) {
! 				/* found the cell we're looking for */
! 				if (newCellNamep)
! 					strcpy(newCellNamep, lineBuffer+1);
                  inRightCell = 1;
! 				tracking = 0;
  #ifdef DEBUG
                  DebugEvent_local("AFS- cm_searchfile is cell", "inRightCell[%x], linebuffer[%s]", 
!                                  inRightCell, lineBuffer);
  #endif
! 			}
! 			else if (strnicmp(lineBuffer+1, cellNamep,
!                                strlen(cellNamep)) == 0) {
! 				/* partial match */
! 				if (partial) {	/* ambiguous */
! 					fclose(tfilep);
! 					fclose(bestp);
! 					return -5;
! 				}
! 				if (newCellNamep)
! 					strcpy(newCellNamep, lineBuffer+1);
! 				inRightCell = 0;
! 				tracking = 0;
! 				partial = 1;
! 			}
              else inRightCell = 0;
          }
          else {
  #if !defined(DJGPP) && !defined(AFS_WIN95_ENV)
              valuep = strchr(lineBuffer, '#');
! 			if (valuep == NULL) {
! 				fclose(tfilep);
! 				fclose(bestp);
! 				return -4;
! 			}
              valuep++;	/* skip the "#" */
  
              valuep += strspn(valuep, " \t"); /* skip SP & TAB */
              /* strip spaces and tabs in the end. They should not be there according to CellServDB format
!             so do this just in case                        */
              while (valuep[strlen(valuep) - 1] == ' ' || valuep[strlen(valuep) - 1] == '\t') 
                  valuep[strlen(valuep) - 1] = '\0';
  
  #endif /* !DJGPP */
! 			if (inRightCell) {
  #if !defined(DJGPP) && !defined(AFS_WIN95_ENV)
! 				/* add the server to the VLDB list */
                  WSASetLastError(0);
                  thp = gethostbyname(valuep);
  #ifdef DEBUG
--- 315,369 ----
              tp = strchr(lineBuffer, '#');
              if (tp) *tp = 0;
  
! 	    /* now see if this is the right cell */
              if (stricmp(lineBuffer+1, cellNamep) == 0) {
! 		/* found the cell we're looking for */
! 		if (newCellNamep)
! 		    strcpy(newCellNamep, lineBuffer+1);
                  inRightCell = 1;
! 		tracking = 0;
  #ifdef DEBUG
                  DebugEvent_local("AFS- cm_searchfile is cell", "inRightCell[%x], linebuffer[%s]", 
! 				 inRightCell, lineBuffer);
  #endif
! 	    }
! 	    else if (strnicmp(lineBuffer+1, cellNamep,
! 			       strlen(cellNamep)) == 0) {
! 		/* partial match */
! 		if (partial) {	/* ambiguous */
! 		    fclose(tfilep);
! 		    fclose(bestp);
! 		    return -5;
! 		}
! 		if (newCellNamep)
! 		    strcpy(newCellNamep, lineBuffer+1);
! 		inRightCell = 0;
! 		tracking = 0;
! 		partial = 1;
! 	    }
              else inRightCell = 0;
          }
          else {
  #if !defined(DJGPP) && !defined(AFS_WIN95_ENV)
              valuep = strchr(lineBuffer, '#');
! 	    if (valuep == NULL) {
! 		fclose(tfilep);
! 		fclose(bestp);
! 		return -4;
! 	    }
              valuep++;	/* skip the "#" */
  
              valuep += strspn(valuep, " \t"); /* skip SP & TAB */
              /* strip spaces and tabs in the end. They should not be there according to CellServDB format
!              * so do this just in case                        
! 	     */
              while (valuep[strlen(valuep) - 1] == ' ' || valuep[strlen(valuep) - 1] == '\t') 
                  valuep[strlen(valuep) - 1] = '\0';
  
  #endif /* !DJGPP */
! 	    if (inRightCell) {
  #if !defined(DJGPP) && !defined(AFS_WIN95_ENV)
! 		/* add the server to the VLDB list */
                  WSASetLastError(0);
                  thp = gethostbyname(valuep);
  #ifdef DEBUG
***************
*** 346,370 ****
                  }
  #endif
                  if (thp) {
! 					memcpy(&vlSockAddr.sin_addr.s_addr, thp->h_addr,
                              sizeof(long));
                      vlSockAddr.sin_family = AF_INET;
                      /* sin_port supplied by connection code */
! 					if (procp)
! 						(*procp)(rockp, &vlSockAddr, valuep);
                      foundCell = 1;
! 				}
  #else
                  thp = 0;
  #endif /* !DJGPP */
                  if (!thp) {
                      long ip_addr;
! 					int c1, c2, c3, c4;
! 					char aname[241] = "";                    
                      
                      /* Since there is no gethostbyname() data 
!                      * available we will read the IP address
!                      * stored in the CellServDB file
                       */
                      code = sscanf(lineBuffer, "%d.%d.%d.%d #%s",
                                     &c1, &c2, &c3, &c4, aname);
--- 375,399 ----
                  }
  #endif
                  if (thp) {
! 		    memcpy(&vlSockAddr.sin_addr.s_addr, thp->h_addr,
                              sizeof(long));
                      vlSockAddr.sin_family = AF_INET;
                      /* sin_port supplied by connection code */
! 		    if (procp)
! 			(*procp)(rockp, &vlSockAddr, valuep);
                      foundCell = 1;
! 		}
  #else
                  thp = 0;
  #endif /* !DJGPP */
                  if (!thp) {
                      long ip_addr;
! 		    int c1, c2, c3, c4;
! 		    char aname[241] = "";                    
                      
                      /* Since there is no gethostbyname() data 
! 		     * available we will read the IP address
! 		     * stored in the CellServDB file
                       */
                      code = sscanf(lineBuffer, "%d.%d.%d.%d #%s",
                                     &c1, &c2, &c3, &c4, aname);
***************
*** 403,408 ****
--- 432,440 ----
  #ifdef DEBUG
      DebugEvent_local("AFS SearchCellDNS-","Doing search for [%s]", cellNamep);
  #endif
+ 
+     if ( IsWindowsModule(cellNamep) )
+ 	return -1;
      rc = getAFSServer(cellNamep, cellHostAddrs, cellHostNames, &numServers, ttl);
      if (rc == 0 && numServers > 0) {     /* found the cell */
          for (i = 0; i < numServers; i++) {
***************
*** 420,426 ****
      else
         return -1;  /* not found */
  #else
! 	return -1;  /* not found */
  #endif /* AFS_AFSDB_ENV */
  }
  
--- 452,458 ----
      else
         return -1;  /* not found */
  #else
!     return -1;  /* not found */
  #endif /* AFS_AFSDB_ENV */
  }
  
Index: openafs/src/WINNT/afsd/cm_volume.c
diff -c openafs/src/WINNT/afsd/cm_volume.c:1.8.2.5 openafs/src/WINNT/afsd/cm_volume.c:1.8.2.6
*** openafs/src/WINNT/afsd/cm_volume.c:1.8.2.5	Wed Mar 30 15:50:16 2005
--- openafs/src/WINNT/afsd/cm_volume.c	Wed Aug 31 20:07:41 2005
***************
*** 168,178 ****
  #endif
      {
          /* now we have volume structure locked and held; make RPC to fill it */
          do {
              code = cm_ConnByMServers(cellp->vlServersp, userp, reqp, &connp);
              if (code) 
                  continue;
-             osi_Log1(afsd_logp, "CALL VL_GetEntryByName{UNO} name %s", volp->namep);
  #ifdef MULTIHOMED
              code = VL_GetEntryByNameU(connp->callp, volp->namep, &uvldbEntry);
              type = 2;
--- 168,178 ----
  #endif
      {
          /* now we have volume structure locked and held; make RPC to fill it */
+ 	osi_Log2(afsd_logp, "CALL VL_GetEntryByName{UNO} name %s:%s", volp->cellp->name, volp->namep);
          do {
              code = cm_ConnByMServers(cellp->vlServersp, userp, reqp, &connp);
              if (code) 
                  continue;
  #ifdef MULTIHOMED
              code = VL_GetEntryByNameU(connp->callp, volp->namep, &uvldbEntry);
              type = 2;
***************
*** 188,193 ****
--- 188,199 ----
              }
          } while (cm_Analyze(connp, userp, reqp, NULL, NULL, cellp->vlServersp, NULL, code));
          code = cm_MapVLRPCError(code, reqp);
+ 	if ( code )
+ 	    osi_Log3(afsd_logp, "CALL VL_GetEntryByName{UNO} name %s:%s FAILURE, code 0x%x", 
+ 		      volp->cellp->name, volp->namep, code);
+ 	else
+ 	    osi_Log2(afsd_logp, "CALL VL_GetEntryByName{UNO} name %s:%s SUCCESS", 
+ 		      volp->cellp->name, volp->namep);
      }
      if (code == 0) {
          afs_int32 flags;
Index: openafs/src/WINNT/afsd/fs.c
diff -c openafs/src/WINNT/afsd/fs.c:1.16.2.9 openafs/src/WINNT/afsd/fs.c:1.16.2.10
*** openafs/src/WINNT/afsd/fs.c:1.16.2.9	Wed Aug 17 12:07:24 2005
--- openafs/src/WINNT/afsd/fs.c	Wed Aug 31 07:00:31 2005
***************
*** 724,729 ****
--- 724,750 ----
      return enabled;
  }
  
+ static const char * NetbiosName(void)
+ {
+     static char buffer[1024] = "AFS";
+     HKEY  parmKey;
+     DWORD code;
+     DWORD dummyLen;
+     DWORD enabled = 0;
+ 
+     code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSREG_CLT_SVC_PARAM_SUBKEY,
+                          0, KEY_QUERY_VALUE, &parmKey);
+     if (code == ERROR_SUCCESS) {
+         dummyLen = sizeof(buffer);
+         code = RegQueryValueEx(parmKey, "NetbiosName", NULL, NULL,
+ 			       buffer, &dummyLen);
+         RegCloseKey (parmKey);
+     } else {
+ 	strcpy(buffer, "AFS");
+     }
+     return buffer;
+ }
+ 
  #define AFSCLIENT_ADMIN_GROUPNAME "AFS Client Admins"
  
  static BOOL IsAdmin (void)
***************
*** 1728,1733 ****
--- 1749,1768 ----
  	    strncpy(parent_dir, true_name, last_component - true_name + 1);
  	    parent_dir[last_component - true_name + 1] = 0;
  	    last_component++;   /*Skip the slash*/
+ #ifdef WIN32
+ 	    if (!InAFS(parent_dir)) {
+ 		const char * nbname = NetbiosName();
+ 		int len = strlen(nbname);
+ 
+ 		if (parent_dir[0] == '\\' && parent_dir[1] == '\\' &&
+ 		    parent_dir[len+2] == '\\' &&
+ 		    parent_dir[len+3] == '\0' &&
+ 		    !strnicmp(nbname,&parent_dir[2],len))
+ 		{
+ 		    sprintf(parent_dir,"\\\\%s\\all\\", nbname);
+ 		}
+ 	    }
+ #endif
  	} else {
  	    /*
  	     * No slash appears in the given file name.  Set parent_dir to the current
***************
*** 1778,1801 ****
      afs_int32 code;
      char *cellName, *volName, *tmpName;
  #ifdef WIN32
!     char localCellName[1000];
! #else /* not WIN32 */
      struct afsconf_cell info;
      struct vldbentry vldbEntry;
- #endif /* not WIN32 */
      struct ViceIoctl blob;
      char * parent;
  
-     /*
- 
-     defect #3069
- 
-     if (as->parms[5].items && !as->parms[2].items) {
- 	fprintf(stderr,"%s: must provide cell when creating cellular mount point.\n", pn);
- 	return 1;
-     }
-     */
- 
      if (as->parms[2].items)	/* cell name specified */
  	cellName = as->parms[2].items->data;
      else
--- 1813,1826 ----
      afs_int32 code;
      char *cellName, *volName, *tmpName;
  #ifdef WIN32
!     char localCellName[128];
! #endif
!     char path[1024] = "";
      struct afsconf_cell info;
      struct vldbentry vldbEntry;
      struct ViceIoctl blob;
      char * parent;
  
      if (as->parms[2].items)	/* cell name specified */
  	cellName = as->parms[2].items->data;
      else
***************
*** 1823,1851 ****
  
      parent = Parent(as->parms[0].items->data);
      if (!InAFS(parent)) {
! 	fprintf(stderr,"%s: mount points must be created within the AFS file system\n", pn);
! 	return 1;
!     }
  
!     if ( IsFreelanceRoot(parent) && !IsAdmin() ) {
! 	fprintf(stderr,"%s: Only AFS Client Administrators may alter the root.afs volume\n", pn);
! 	return 1;
      }
  
!     if (!cellName) {
! 	blob.in_size = 0;
! 	blob.out_size = MAXSIZE;
! 	blob.out = space;
! 	code = pioctl(Parent(as->parms[0].items->data), VIOC_FILE_CELL_NAME, &blob, 1);
      }
  
- #ifdef WIN32
-     strcpy(localCellName, (cellName? cellName : space));
- #else /* not win32 */
      code = GetCellName(cellName?cellName:space, &info);
      if (code) {
  	return 1;
      }
      if (!(as->parms[4].items)) {
        /* not fast, check which cell the mountpoint is being created in */
        code = 0;
--- 1848,1903 ----
  
      parent = Parent(as->parms[0].items->data);
      if (!InAFS(parent)) {
! #ifdef WIN32
! 	const char * nbname = NetbiosName();
! 	int len = strlen(nbname);
  
! 	if (parent[0] == '\\' && parent[1] == '\\' &&
! 	    parent[len+2] == '\\' &&
! 	    parent[len+3] == '\0' &&
! 	    !strnicmp(nbname,&parent[2],len))
! 	{
! 	    sprintf(path,"%sall\\%s", parent, &as->parms[0].items->data[strlen(parent)]);
! 	    parent = Parent(path);
! 	    if (!InAFS(parent)) {
! 		fprintf(stderr,"%s: mount points must be created within the AFS file system\n", pn);
! 		return 1;
! 	    }
! 	} else 
! #endif
! 	{
! 	    fprintf(stderr,"%s: mount points must be created within the AFS file system\n", pn);
! 	    return 1;
! 	}
      }
  
!     if ( strlen(path) == 0 )
! 	strcpy(path, as->parms[0].items->data);
! 
!     if ( IsFreelanceRoot(parent) ) {
! 	if ( !IsAdmin() ) {
! 	    fprintf(stderr,"%s: Only AFS Client Administrators may alter the root.afs volume\n", pn);
! 	    return 1;
! 	}
! 
! 	if (!cellName) {
! 	    blob.in_size = 0;
! 	    blob.out_size = sizeof(localCellName);
! 	    blob.out = localCellName;
! 	    code = pioctl(parent, VIOC_GET_WS_CELL, &blob, 1);
! 	    if (!code)
! 		cellName = localCellName;
! 	}
!     } else {
! 	if (!cellName)
! 	    GetCell(parent,space);
      }
  
      code = GetCellName(cellName?cellName:space, &info);
      if (code) {
  	return 1;
      }
+ #ifndef WIN32
      if (!(as->parms[4].items)) {
        /* not fast, check which cell the mountpoint is being created in */
        code = 0;
***************
*** 1869,1879 ****
  	strcpy(space, "#");
      if (cellName) {
  	/* cellular mount point, prepend cell prefix */
- #ifdef WIN32
- 	strcat(space, localCellName);
- #else /* not WIN32 */
  	strcat(space, info.name);
- #endif /* not WIN32 */
  	strcat(space, ":");
      }
      strcat(space, volName);	/* append volume name */
--- 1921,1927 ----
***************
*** 1886,1897 ****
      blob.in_size = 1 + strlen(space);
      blob.in = space;
      blob.out = NULL;
!     code = pioctl(as->parms[0].items->data, VIOC_AFS_CREATE_MT_PT, &blob, 0);
  #else /* not WIN32 */
!     code = symlink(space, as->parms[0].items->data);
  #endif /* not WIN32 */
      if (code) {
! 	Die(errno, as->parms[0].items->data);
  	return 1;
      }
      return 0;
--- 1934,1945 ----
      blob.in_size = 1 + strlen(space);
      blob.in = space;
      blob.out = NULL;
!     code = pioctl(path, VIOC_AFS_CREATE_MT_PT, &blob, 0);
  #else /* not WIN32 */
!     code = symlink(space, path);
  #endif /* not WIN32 */
      if (code) {
! 	Die(errno, path);
  	return 1;
      }
      return 0;
***************
*** 1922,1927 ****
--- 1970,1990 ----
  	    strncpy(tbuffer, ti->data, code=tp-ti->data+1);  /* the dir name */
              tbuffer[code] = 0;
  	    tp++;   /* skip the slash */
+ 
+ #ifdef WIN32
+ 	    if (!InAFS(tbuffer)) {
+ 		const char * nbname = NetbiosName();
+ 		int len = strlen(nbname);
+ 
+ 		if (tbuffer[0] == '\\' && tbuffer[1] == '\\' &&
+ 		    tbuffer[len+2] == '\\' &&
+ 		    tbuffer[len+3] == '\0' &&
+ 		    !strnicmp(nbname,&tbuffer[2],len))
+ 		{
+ 		    sprintf(tbuffer,"\\\\%s\\all\\", nbname);
+ 		}
+ 	    }
+ #endif
  	} else {
  	    fs_ExtractDriveLetter(ti->data, tbuffer);
  	    strcat(tbuffer, ".");
***************
*** 1943,1949 ****
  	    continue;	/* don't bother trying */
  	}
  
!         if ( IsFreelanceRoot(Parent(ti->data)) && !IsAdmin() ) {
              fprintf(stderr,"%s: Only AFS Client Administrators may alter the root.afs volume\n", pn);
              error = 1;
              continue;   /* skip */
--- 2006,2012 ----
  	    continue;	/* don't bother trying */
  	}
  
!         if ( IsFreelanceRoot(tbuffer) && !IsAdmin() ) {
              fprintf(stderr,"%s: Only AFS Client Administrators may alter the root.afs volume\n", pn);
              error = 1;
              continue;   /* skip */
***************
*** 3711,3717 ****
  static int
  MiniDumpCmd(struct cmd_syndesc *asp, char *arock)
  {
-     long code;
      BOOL success = 0;
      SERVICE_STATUS status;
      SC_HANDLE hManager = NULL;
--- 3774,3779 ----
***************
*** 4322,4328 ****
      cmd_AddParm(ts, "-cell", CMD_SINGLE, CMD_OPTIONAL, "cell to check");
      cmd_AddParm(ts, "-all", CMD_FLAG, CMD_OPTIONAL, "check all cells");
      cmd_AddParm(ts, "-fast", CMD_FLAG, CMD_OPTIONAL, "just list, don't check");
! 	cmd_AddParm(ts,"-interval",CMD_SINGLE,CMD_OPTIONAL,"seconds between probes");
      
      ts = cmd_CreateSyntax("checkvolumes", CheckVolumesCmd,0, "check volumeID/name mappings");
      cmd_CreateAlias(ts, "checkbackups");
--- 4384,4390 ----
      cmd_AddParm(ts, "-cell", CMD_SINGLE, CMD_OPTIONAL, "cell to check");
      cmd_AddParm(ts, "-all", CMD_FLAG, CMD_OPTIONAL, "check all cells");
      cmd_AddParm(ts, "-fast", CMD_FLAG, CMD_OPTIONAL, "just list, don't check");
!     cmd_AddParm(ts,"-interval",CMD_SINGLE,CMD_OPTIONAL,"seconds between probes");
      
      ts = cmd_CreateSyntax("checkvolumes", CheckVolumesCmd,0, "check volumeID/name mappings");
      cmd_CreateAlias(ts, "checkbackups");
Index: openafs/src/WINNT/afsd/symlink.c
diff -c openafs/src/WINNT/afsd/symlink.c:1.2.20.3 openafs/src/WINNT/afsd/symlink.c:1.2.20.4
*** openafs/src/WINNT/afsd/symlink.c:1.2.20.3	Wed Aug 17 12:07:24 2005
--- openafs/src/WINNT/afsd/symlink.c	Wed Aug 31 07:00:31 2005
***************
*** 22,27 ****
--- 22,28 ----
  
  #include <osi.h>
  #include <afsint.h>
+ #include <WINNT\afsreg.h>
  
  #include "fs_utils.h"
  #include "cmd.h"
***************
*** 91,96 ****
--- 92,118 ----
      return 1;   /* assume it is because it is more restrictive that way */
  }
  
+ static const char * NetbiosName(void)
+ {
+     static char buffer[1024] = "AFS";
+     HKEY  parmKey;
+     DWORD code;
+     DWORD dummyLen;
+     DWORD enabled = 0;
+ 
+     code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSREG_CLT_SVC_PARAM_SUBKEY,
+                          0, KEY_QUERY_VALUE, &parmKey);
+     if (code == ERROR_SUCCESS) {
+         dummyLen = sizeof(buffer);
+         code = RegQueryValueEx(parmKey, "NetbiosName", NULL, NULL,
+ 			       buffer, &dummyLen);
+         RegCloseKey (parmKey);
+     } else {
+ 	strcpy(buffer, "AFS");
+     }
+     return buffer;
+ }
+ 
  #define AFSCLIENT_ADMIN_GROUPNAME "AFS Client Admins"
  
  static BOOL IsAdmin (void)
***************
*** 338,343 ****
--- 360,380 ----
  	    strncpy(parent_dir, true_name, last_component - true_name + 1);
  	    parent_dir[last_component - true_name + 1] = 0;
  	    last_component++;   /*Skip the slash*/
+ 
+ #ifdef WIN32
+ 	    if (!InAFS(parent_dir)) {
+ 		const char * nbname = NetbiosName();
+ 		int len = strlen(nbname);
+ 
+ 		if (parent_dir[0] == '\\' && parent_dir[1] == '\\' &&
+ 		    parent_dir[len+2] == '\\' &&
+ 		    parent_dir[len+3] == '\0' &&
+ 		    !strnicmp(nbname,&parent_dir[2],len))
+ 		{
+ 		    sprintf(parent_dir,"\\\\%s\\all\\", nbname);
+ 		}
+ 	    }
+ #endif
  	}
  	else {
  	    /*
***************
*** 388,423 ****
      register afs_int32 code;
      struct ViceIoctl blob;
      char * parent;
  
!     parent = Parent(as->parms[0].items->data);
  
      if (!InAFS(parent)) {
! 	fprintf(stderr,"%s: symlinks must be created within the AFS file system\n", pn);
! 	return 1;
      }
  
      if ( IsFreelanceRoot(parent) && !IsAdmin() ) {
  	fprintf(stderr,"%s: Only AFS Client Administrators may alter the root.afs volume\n", pn);
  	return 1;
      }
  
-     strcpy(space, as->parms[1].items->data);
- #ifdef WIN32
      /* create symlink with a special pioctl for Windows NT, since it doesn't
       * have a symlink system call.
       */
- 
-     /* TODO: Code needs to go here to prevent the creation of symlinks
-      * in \\AFS\all when not in the "AFS Client Admins" group.
-      */
- 
      blob.out_size = 0;
!     blob.in_size = 1 + strlen(space);
!     blob.in = space;
      blob.out = NULL;
!     code = pioctl(as->parms[0].items->data, VIOC_SYMLINK, &blob, 0);
  #else /* not WIN32 */
!     code = symlink(space, as->parms[0].items->data);
  #endif /* not WIN32 */
      if (code) {
  	Die(errno, as->parms[0].items->data);
--- 425,475 ----
      register afs_int32 code;
      struct ViceIoctl blob;
      char * parent;
+     char path[1024] = "";
  
!     strcpy(path, as->parms[0].items->data);
!     parent = Parent(path);
  
      if (!InAFS(parent)) {
! #ifdef WIN32
! 	const char * nbname = NetbiosName();
! 	int len = strlen(nbname);
! 
! 	if (parent[0] == '\\' && parent[1] == '\\' &&
! 	    parent[len+2] == '\\' &&
! 	    parent[len+3] == '\0' &&
! 	    !strnicmp(nbname,&parent[2],len))
! 	{
! 	    sprintf(path,"%sall\\%s", parent, &as->parms[0].items->data[strlen(parent)]);
! 	    parent = Parent(path);
! 	    if (!InAFS(parent)) {
! 		fprintf(stderr,"%s: symlinks must be created within the AFS file system\n", pn);
! 		return 1;
! 	    }
! 	} else 
! #endif
! 	{
! 	    fprintf(stderr,"%s: symlinks must be created within the AFS file system\n", pn);
! 	    return 1;
! 	}
      }
  
+ #ifdef WIN32
      if ( IsFreelanceRoot(parent) && !IsAdmin() ) {
  	fprintf(stderr,"%s: Only AFS Client Administrators may alter the root.afs volume\n", pn);
  	return 1;
      }
  
      /* create symlink with a special pioctl for Windows NT, since it doesn't
       * have a symlink system call.
       */
      blob.out_size = 0;
!     blob.in_size = 1 + strlen(as->parms[1].items->data);
!     blob.in = as->parms[1].items->data;
      blob.out = NULL;
!     code = pioctl(path, VIOC_SYMLINK, &blob, 0);
  #else /* not WIN32 */
!     code = symlink(as->parms[1].items->data, path);
  #endif /* not WIN32 */
      if (code) {
  	Die(errno, as->parms[0].items->data);
***************
*** 450,455 ****
--- 502,522 ----
  	    strncpy(tbuffer, ti->data, code=tp-ti->data+1);  /* the dir name */
              tbuffer[code] = 0;
  	    tp++;   /* skip the slash */
+ 
+ #ifdef WIN32
+ 	    if (!InAFS(tbuffer)) {
+ 		const char * nbname = NetbiosName();
+ 		int len = strlen(nbname);
+ 
+ 		if (tbuffer[0] == '\\' && tbuffer[1] == '\\' &&
+ 		     tbuffer[len+2] == '\\' &&
+ 		     tbuffer[len+3] == '\0' &&
+ 		     !strnicmp(nbname,&tbuffer[2],len))
+ 		{
+ 		    sprintf(tbuffer,"\\\\%s\\all\\", nbname);
+ 		}
+ 	    }
+ #endif
  	}
  	else {
  	    fs_ExtractDriveLetter(ti->data, tbuffer);
***************
*** 471,477 ****
  	    continue;	/* don't bother trying */
  	}
  
!         if ( IsFreelanceRoot(Parent(ti->data)) && !IsAdmin() ) {
              fprintf(stderr,"symlink: Only AFS Client Administrators may alter the root.afs volume\n");
              code = 1;
              continue;   /* skip */
--- 538,544 ----
  	    continue;	/* don't bother trying */
  	}
  
!         if ( IsFreelanceRoot(tbuffer) && !IsAdmin() ) {
              fprintf(stderr,"symlink: Only AFS Client Administrators may alter the root.afs volume\n");
              code = 1;
              continue;   /* skip */
***************
*** 529,536 ****
      cmd_AddParm(ts, "-name", CMD_SINGLE, 0, "name");
      cmd_AddParm(ts, "-to", CMD_SINGLE, 0, "target");
  
!     ts = cmd_CreateSyntax("rm", RemoveLinkCmd, 0, "remove symlink");
      cmd_AddParm(ts, "-name", CMD_LIST, 0, "name");
  
      code = cmd_Dispatch(argc, argv);
  
--- 596,604 ----
      cmd_AddParm(ts, "-name", CMD_SINGLE, 0, "name");
      cmd_AddParm(ts, "-to", CMD_SINGLE, 0, "target");
  
!     ts = cmd_CreateSyntax("remove", RemoveLinkCmd, 0, "remove symlink");
      cmd_AddParm(ts, "-name", CMD_LIST, 0, "name");
+     cmd_CreateAlias(ts, "rm");
  
      code = cmd_Dispatch(argc, argv);
  
Index: openafs/src/WINNT/client_exp/gui2fs.cpp
diff -c openafs/src/WINNT/client_exp/gui2fs.cpp:1.10.2.5 openafs/src/WINNT/client_exp/gui2fs.cpp:1.10.2.6
*** openafs/src/WINNT/client_exp/gui2fs.cpp:1.10.2.5	Tue Jul 19 01:06:59 2005
--- openafs/src/WINNT/client_exp/gui2fs.cpp	Wed Aug 31 20:08:43 2005
***************
*** 31,36 ****
--- 31,37 ----
  #include "fs_utils.h"
  #include <afsint.h>
  #include <afs/auth.h>
+ #include <WINNT\afsreg.h>
  }
  
  
***************
*** 66,72 ****
  static char *szLogFileName = "afsguilog.txt";
  #endif
  
- 
  FILE *OpenFile(char *file, char *rwp)
  {
      char wdir[256];
--- 67,72 ----
***************
*** 937,942 ****
--- 937,1164 ----
      return strMountPointInfo;
  }       
  
+ BOOL IsPathInAfs(const CHAR *strPath)
+ {
+     struct ViceIoctl blob;
+     int code;
+ 
+     HOURGLASS hourglass;
+ 
+     blob.in_size = 0;
+     blob.out_size = MAXSIZE;
+     blob.out = space;
+ 
+     code = pioctl((LPTSTR)((LPCTSTR)strPath), VIOC_FILE_CELL_NAME, &blob, 1);
+     if (code)
+         return FALSE;
+     return TRUE;
+ }
+ 
+ static int 
+ IsFreelanceRoot(char *apath)
+ {
+     struct ViceIoctl blob;
+     afs_int32 code;
+ 
+     blob.in_size = 0;
+     blob.out_size = MAXSIZE;
+     blob.out = space;
+ 
+     code = pioctl(apath, VIOC_FILE_CELL_NAME, &blob, 1);
+     if (code == 0)
+         return !strcmp("Freelance.Local.Root",space);
+     return 1;   /* assume it is because it is more restrictive that way */
+ }
+ 
+ const char * NetbiosName(void)
+ {
+     static char buffer[1024] = "AFS";
+     HKEY  parmKey;
+     DWORD code;
+     DWORD dummyLen;
+     DWORD enabled = 0;
+ 
+     code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSREG_CLT_SVC_PARAM_SUBKEY,
+                          0, KEY_QUERY_VALUE, &parmKey);
+     if (code == ERROR_SUCCESS) {
+         dummyLen = sizeof(buffer);
+         code = RegQueryValueEx(parmKey, "NetbiosName", NULL, NULL,
+ 			       (LPBYTE)buffer, &dummyLen);
+         RegCloseKey (parmKey);
+     } else {
+ 	strcpy(buffer, "AFS");
+     }
+     return buffer;
+ }
+ 
+ #define AFSCLIENT_ADMIN_GROUPNAME "AFS Client Admins"
+ 
+ static BOOL IsAdmin (void)
+ {
+     static BOOL fAdmin = FALSE;
+     static BOOL fTested = FALSE;
+ 
+     if (!fTested)
+     {
+         /* Obtain the SID for the AFS client admin group.  If the group does
+          * not exist, then assume we have AFS client admin privileges.
+          */
+         PSID psidAdmin = NULL;
+         DWORD dwSize, dwSize2;
+         char pszAdminGroup[ MAX_COMPUTERNAME_LENGTH + sizeof(AFSCLIENT_ADMIN_GROUPNAME) + 2 ];
+         char *pszRefDomain = NULL;
+         SID_NAME_USE snu = SidTypeGroup;
+ 
+         dwSize = sizeof(pszAdminGroup);
+ 
+         if (!GetComputerName(pszAdminGroup, &dwSize)) {
+             /* Can't get computer name.  We return false in this case.
+                Retain fAdmin and fTested. This shouldn't happen.*/
+             return FALSE;
+         }
+ 
+         dwSize = 0;
+         dwSize2 = 0;
+ 
+         strcat(pszAdminGroup,"\\");
+         strcat(pszAdminGroup, AFSCLIENT_ADMIN_GROUPNAME);
+ 
+         LookupAccountName(NULL, pszAdminGroup, NULL, &dwSize, NULL, &dwSize2, &snu);
+         /* that should always fail. */
+ 
+         if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) {
+             /* if we can't find the group, then we allow the operation */
+             fAdmin = TRUE;
+             return TRUE;
+         }
+ 
+         if (dwSize == 0 || dwSize2 == 0) {
+             /* Paranoia */
+             fAdmin = TRUE;
+             return TRUE;
+         }
+ 
+         psidAdmin = (PSID)malloc(dwSize); memset(psidAdmin,0,dwSize);
+         pszRefDomain = (char *)malloc(dwSize2);
+ 
+         if (!LookupAccountName(NULL, pszAdminGroup, psidAdmin, &dwSize, pszRefDomain, &dwSize2, &snu)) {
+             /* We can't lookup the group now even though we looked it up earlier.  
+                Could this happen? */
+             fAdmin = TRUE;
+         } else {
+             /* Then open our current ProcessToken */
+             HANDLE hToken;
+ 
+             if (OpenProcessToken (GetCurrentProcess(), TOKEN_QUERY, &hToken))
+             {
+ 
+                 if (!CheckTokenMembership(hToken, psidAdmin, &fAdmin)) {
+                     /* We'll have to allocate a chunk of memory to store the list of
+                      * groups to which this user belongs; find out how much memory
+                      * we'll need.
+                      */
+                     DWORD dwSize = 0;
+                     PTOKEN_GROUPS pGroups;
+ 
+                     GetTokenInformation (hToken, TokenGroups, NULL, dwSize, &dwSize);
+ 
+                     pGroups = (PTOKEN_GROUPS)malloc(dwSize);
+ 
+                     /* Allocate that buffer, and read in the list of groups. */
+                     if (GetTokenInformation (hToken, TokenGroups, pGroups, dwSize, &dwSize))
+                     {
+                         /* Look through the list of group SIDs and see if any of them
+                          * matches the AFS Client Admin group SID.
+                          */
+                         size_t iGroup = 0;
+                         for (; (!fAdmin) && (iGroup < pGroups->GroupCount); ++iGroup)
+                         {
+                             if (EqualSid (psidAdmin, pGroups->Groups[ iGroup ].Sid)) {
+                                 fAdmin = TRUE;
+                             }
+                         }
+                     }
+ 
+                     if (pGroups)
+                         free(pGroups);
+                 }
+ 
+                 /* if do not have permission because we were not explicitly listed
+                  * in the Admin Client Group let's see if we are the SYSTEM account
+                  */
+                 if (!fAdmin) {
+                     PTOKEN_USER pTokenUser;
+                     SID_IDENTIFIER_AUTHORITY SIDAuth = SECURITY_NT_AUTHORITY;
+                     PSID pSidLocalSystem = 0;
+                     DWORD gle;
+ 
+                     GetTokenInformation(hToken, TokenUser, NULL, 0, &dwSize);
+ 
+                     pTokenUser = (PTOKEN_USER)malloc(dwSize);
+ 
+                     if (!GetTokenInformation(hToken, TokenUser, pTokenUser, dwSize, &dwSize))
+                         gle = GetLastError();
+ 
+                     if (AllocateAndInitializeSid( &SIDAuth, 1,
+                                                   SECURITY_LOCAL_SYSTEM_RID,
+                                                   0, 0, 0, 0, 0, 0, 0,
+                                                   &pSidLocalSystem))
+                     {
+                         if (EqualSid(pTokenUser->User.Sid, pSidLocalSystem)) {
+                             fAdmin = TRUE;
+                         }
+ 
+                         FreeSid(pSidLocalSystem);
+                     }
+ 
+                     if ( pTokenUser )
+                         free(pTokenUser);
+                 }
+             }
+         }
+ 
+         free(psidAdmin);
+         free(pszRefDomain);
+ 
+         fTested = TRUE;
+     }
+ 
+     return fAdmin;
+ }
+ 
+ /* return a static pointer to a buffer */
+ static char *Parent(char *apath)
+ {
+     register char *tp;
+ 
+     strcpy(tspace, apath);
+     tp = strrchr(tspace, '\\');
+     if (tp) {
+         *(tp+1) = 0;	/* lv trailing slash so Parent("k:\foo") is "k:\" not "k:" */
+     }
+     else {
+         fs_ExtractDriveLetter(apath, tspace);
+     	strcat(tspace, ".");
+     }
+     
+     return tspace;
+ }
+ 
+ static afs_int32
+ GetCell(char *fname, char *cellname)
+ {
+     afs_int32 code;
+     struct ViceIoctl blob;
+ 
+     blob.in_size = 0;
+     blob.out_size = MAXCELLCHARS;
+     blob.out = cellname;
+ 
+     code = pioctl(fname, VIOC_FILE_CELL_NAME, &blob, 1);
+     return code ? errno : 0;
+ }
+ 
+ 
  BOOL ListMount(CStringArray& files)
  {
      register LONG code;
***************
*** 968,973 ****
--- 1190,1208 ----
              strncpy(parent_dir, true_name, last_component - true_name + 1);
              parent_dir[last_component - true_name + 1] = 0;
              last_component++;   /* Skip the slash */
+ 
+ 	    if (!IsPathInAfs(parent_dir)) {
+ 		const char * nbname = NetbiosName();
+ 		int len = strlen(nbname);
+ 
+ 		if (parent_dir[0] == '\\' && parent_dir[1] == '\\' &&
+ 		    parent_dir[len+2] == '\\' &&
+ 		    parent_dir[len+3] == '\0' &&
+ 		    !strnicmp(nbname,&parent_dir[2],len))
+ 		{
+ 		    sprintf(parent_dir,"\\\\%s\\all\\", nbname);
+ 		}
+ 	    }
          }
          else {
              /*
***************
*** 1008,1087 ****
      return !error;
  }
  
- BOOL IsPathInAfs(const CHAR *strPath)
- {
-     struct ViceIoctl blob;
-     int code;
- 
-     HOURGLASS hourglass;
- 
-     blob.in_size = 0;
-     blob.out_size = MAXSIZE;
-     blob.out = space;
- 
-     code = pioctl((LPTSTR)((LPCTSTR)strPath), VIOC_FILE_CELL_NAME, &blob, 1);
-     if (code)
-         return FALSE;
-     return TRUE;
- }
- 
- /* return a static pointer to a buffer */
- static char *Parent(char *apath)
- {
-     register char *tp;
- 
-     strcpy(tspace, apath);
-     tp = strrchr(tspace, '\\');
-     if (tp) {
-         *(tp+1) = 0;	/* lv trailing slash so Parent("k:\foo") is "k:\" not "k:" */
-     }
-     else {
-         fs_ExtractDriveLetter(apath, tspace);
-     	strcat(tspace, ".");
-     }
-     
-     return tspace;
- }
- 
  BOOL MakeMount(const CString& strDir, const CString& strVolName, const CString& strCellName, BOOL bRW)
  {
      register LONG code;
      register char *cellName;
!     char localCellName[1000];
      struct ViceIoctl blob;
  
      HOURGLASS hourglass;
  
      ASSERT(strVolName.GetLength() < 64);
  
-     /*
- 
-     defect #3069
- 
-     if (as->parms[5].items && !as->parms[2].items) {
- 	fprintf(stderr,"fs: must provide cell when creating cellular mount point.\n");
- 	return FALSE;
-     }
-     */
- 
      if (strCellName.GetLength() > 0)	/* cell name specified */
          cellName = PCCHAR(strCellName);
      else
          cellName = (char *) 0;
  
!     if (!IsPathInAfs(Parent(PCCHAR(strDir)))) {
!         ShowMessageBox(IDS_MAKE_MP_NOT_AFS_ERROR, MB_ICONEXCLAMATION, IDS_MAKE_MP_NOT_AFS_ERROR);
!         return FALSE;
      }
  
!     if (cellName) {
!         blob.in_size = 0;
!         blob.out_size = MAXSIZE;
!         blob.out = space;
!         code = pioctl(Parent(PCCHAR(strDir)), VIOC_FILE_CELL_NAME, &blob, 1);
!     }   
! 
!     strcpy(localCellName, (cellName? cellName : space));
  
      if (bRW)	/* if -rw specified */
          strcpy(space, "%");
--- 1243,1315 ----
      return !error;
  }
  
  BOOL MakeMount(const CString& strDir, const CString& strVolName, const CString& strCellName, BOOL bRW)
  {
      register LONG code;
      register char *cellName;
!     char localCellName[128];
!     struct afsconf_cell info;
      struct ViceIoctl blob;
+     char * parent;
+     char path[1024] = "";
  
      HOURGLASS hourglass;
  
      ASSERT(strVolName.GetLength() < 64);
  
      if (strCellName.GetLength() > 0)	/* cell name specified */
          cellName = PCCHAR(strCellName);
      else
          cellName = (char *) 0;
  
!     parent = Parent(PCCHAR(strDir));
!     if (!IsPathInAfs(parent)) {
! 	const char * nbname = NetbiosName();
! 	int len = strlen(nbname);
! 
! 	if (parent[0] == '\\' && parent[1] == '\\' &&
! 	    parent[len+2] == '\\' &&
! 	    parent[len+3] == '\0' &&
! 	    !strnicmp(nbname,&parent[2],len))
! 	{
! 	    sprintf(path,"%sall\\%s", parent, &(PCCHAR(strDir)[strlen(parent)]));
! 	    parent = Parent(path);
! 	    if (!IsPathInAfs(parent)) {
! 		ShowMessageBox(IDS_MAKE_MP_NOT_AFS_ERROR, MB_ICONEXCLAMATION, IDS_MAKE_MP_NOT_AFS_ERROR);
! 		return FALSE;
! 	    }
! 	} else {
! 	    ShowMessageBox(IDS_MAKE_MP_NOT_AFS_ERROR, MB_ICONEXCLAMATION, IDS_MAKE_MP_NOT_AFS_ERROR);
! 	    return FALSE;
! 	}
!     }
! 
!     if ( strlen(path) == 0 )
! 	strcpy(path, PCCHAR(strDir));
! 
!     if ( IsFreelanceRoot(parent) ) {
! 	if ( !IsAdmin() ) {
! 	    ShowMessageBox(IDS_NOT_AFS_CLIENT_ADMIN_ERROR, MB_ICONEXCLAMATION, IDS_NOT_AFS_CLIENT_ADMIN_ERROR);
! 	    return FALSE;
! 	}
! 
! 	if (!cellName) {
! 	    blob.in_size = 0;
! 	    blob.out_size = sizeof(localCellName);
! 	    blob.out = localCellName;
! 	    code = pioctl(parent, VIOC_GET_WS_CELL, &blob, 1);
! 	    if (!code)
! 		cellName = localCellName;
! 	}
!     } else {
! 	if (!cellName)
! 	    GetCell(parent,space);
      }
  
!     code = GetCellName(cellName?cellName:space, &info);
!     if (code) {
! 	return FALSE;
!     }
  
      if (bRW)	/* if -rw specified */
          strcpy(space, "%");
***************
*** 1090,1096 ****
  
      /* If cellular mount point, prepend cell prefix */
      if (cellName) {
!         strcat(space, localCellName);
          strcat(space, ":");
      }   
  
--- 1318,1324 ----
  
      /* If cellular mount point, prepend cell prefix */
      if (cellName) {
!         strcat(space, info.name);
          strcat(space, ":");
      }   
  
***************
*** 1104,1110 ****
      blob.in_size = 1 + strlen(space);
      blob.in = space;
      blob.out = NULL;
!     code = pioctl(PCCHAR(strDir), VIOC_AFS_CREATE_MT_PT, &blob, 0);
  
      if (code) {
          ShowMessageBox(IDS_MOUNT_POINT_ERROR, MB_ICONEXCLAMATION, IDS_MOUNT_POINT_ERROR, GetAfsError(errno, strDir));
--- 1332,1338 ----
      blob.in_size = 1 + strlen(space);
      blob.in = space;
      blob.out = NULL;
!     code = pioctl(path, VIOC_AFS_CREATE_MT_PT, &blob, 0);
  
      if (code) {
          ShowMessageBox(IDS_MOUNT_POINT_ERROR, MB_ICONEXCLAMATION, IDS_MOUNT_POINT_ERROR, GetAfsError(errno, strDir));
***************
*** 1165,1170 ****
--- 1393,1411 ----
          strncpy(tbuffer, linkName, code=tp-linkName+1);  /* the dir name */
          tbuffer[code] = 0;
          tp++;   /* skip the slash */
+ 
+ 	if (!IsPathInAfs(tbuffer)) {
+ 	    const char * nbname = NetbiosName();
+ 	    int len = strlen(nbname);
+ 
+ 	    if (tbuffer[0] == '\\' && tbuffer[1] == '\\' &&
+ 		 tbuffer[len+2] == '\\' &&
+ 		 tbuffer[len+3] == '\0' &&
+ 		 !strnicmp(nbname,&tbuffer[2],len))
+ 	    {
+ 		sprintf(tbuffer,"\\\\%s\\all\\", nbname);
+ 	    }
+ 	}
      }
      else {
          fs_ExtractDriveLetter(linkName, tbuffer);
***************
*** 1172,1177 ****
--- 1413,1424 ----
          fs_StripDriveLetter(tp, tpbuffer, 0);
          tp=tpbuffer;
      }
+ 
+     if ( IsFreelanceRoot(tbuffer) && !IsAdmin() ) {
+ 	ShowMessageBox(IDS_NOT_AFS_CLIENT_ADMIN_ERROR, MB_ICONEXCLAMATION, IDS_NOT_AFS_CLIENT_ADMIN_ERROR);
+ 	return FALSE;
+     }
+ 
      blob.in = tp;
      blob.in_size = strlen(tp)+1;
      blob.out = lsbuffer;
***************
*** 1206,1211 ****
--- 1453,1471 ----
          strncpy(parent_dir, true_name, last_component - true_name + 1);
          parent_dir[last_component - true_name + 1] = 0;
          last_component++;   /*Skip the slash*/
+ 
+ 	if (!IsPathInAfs(parent_dir)) {
+ 	    const char * nbname = NetbiosName();
+ 	    int len = strlen(nbname);
+ 
+ 	    if (parent_dir[0] == '\\' && parent_dir[1] == '\\' &&
+ 		 parent_dir[len+2] == '\\' &&
+ 		 parent_dir[len+3] == '\0' &&
+ 		 !strnicmp(nbname,&parent_dir[2],len))
+ 	    {
+ 		sprintf(parent_dir,"\\\\%s\\all\\", nbname);
+ 	    }
+ 	}
      }
      else {
          /*
***************
*** 1244,1249 ****
--- 1504,1522 ----
          strncpy(tbuffer, szCurItem, code = tp - szCurItem + 1);  /* the dir name */
          tbuffer[code] = 0;
          tp++;   /* skip the slash */
+ 
+ 	if (!IsPathInAfs(tbuffer)) {
+ 	    const char * nbname = NetbiosName();
+ 	    int len = strlen(nbname);
+ 
+ 	    if (tbuffer[0] == '\\' && tbuffer[1] == '\\' &&
+ 		 tbuffer[len+2] == '\\' &&
+ 		 tbuffer[len+3] == '\0' &&
+ 		 !strnicmp(nbname,&tbuffer[2],len))
+ 	    {
+ 		sprintf(tbuffer,"\\\\%s\\all\\", nbname);
+ 	    }
+ 	}
      } else {
          fs_ExtractDriveLetter(szCurItem, tbuffer);
          strcat(tbuffer, ".");
***************
*** 1300,1305 ****
--- 1573,1591 ----
              strncpy(tbuffer, szCurItem, code = tp - szCurItem + 1);  /* the dir name */
              tbuffer[code] = 0;
              tp++;   /* skip the slash */
+ 
+ 	    if (!IsPathInAfs(tbuffer)) {
+ 		const char * nbname = NetbiosName();
+ 		int len = strlen(nbname);
+ 
+ 		if (tbuffer[0] == '\\' && tbuffer[1] == '\\' &&
+ 		    tbuffer[len+2] == '\\' &&
+ 		    tbuffer[len+3] == '\0' &&
+ 		    !strnicmp(nbname,&tbuffer[2],len))
+ 		{
+ 		    sprintf(tbuffer,"\\\\%s\\all\\", nbname);
+ 		}
+ 	    }
          } else {
              fs_ExtractDriveLetter(szCurItem, tbuffer);
              strcat(tbuffer, ".");
***************
*** 1307,1312 ****
--- 1593,1604 ----
              fs_StripDriveLetter(tp, tp, 0);
          }
  
+ 	if ( IsFreelanceRoot(tbuffer) && !IsAdmin() ) {
+ 	    results.Add(GetMessageString(IDS_NOT_AFS_CLIENT_ADMIN_ERROR, StripPath(files[i])));
+             error = TRUE;
+             continue;   /* skip */
+         }
+ 
          blob.out_size = 0;
          blob.in = tp;
          blob.in_size = strlen(tp)+1;
***************
*** 1602,1618 ****
      return TRUE;
  }
  
! UINT MakeSymbolicLink(const char *strName ,const char *strDir)
  {
      struct ViceIoctl blob;
      char space[MAXSIZE];
      UINT code;
  
      HOURGLASS hourglass;
  
      /*lets confirm its a good symlink*/
!     if (!IsPathInAfs(strDir))
!         return 1;
      LPTSTR lpsz = new TCHAR[strlen(strDir)+1];
      _tcscpy(lpsz, strName);
      strcpy(space, strDir);
--- 1894,1946 ----
      return TRUE;
  }
  
! UINT MakeSymbolicLink(const char *strName, const char *strDir)
  {
      struct ViceIoctl blob;
      char space[MAXSIZE];
+     char * parent;
+     char path[1024] = "";
      UINT code;
  
      HOURGLASS hourglass;
+     static char message[2048];
+ 
+     strcpy(path, strDir);
+     parent = Parent(path);
+ 
+     sprintf(message,"MakeSymbolicLink: path = %s parent = %s\n",path,parent);
+     OutputDebugString(message);
  
      /*lets confirm its a good symlink*/
!     if (!IsPathInAfs(path)) {
! 	const char * nbname = NetbiosName();
! 	int len = strlen(nbname);
! 
! 	if (parent[0] == '\\' && parent[1] == '\\' &&
! 	    parent[len+2] == '\\' &&
! 	    parent[len+3] == '\0' &&
! 	    !strnicmp(nbname,&parent[2],len))
! 	{
! 	    sprintf(path,"%sall\\%s", parent, &strDir[strlen(parent)]);
! 	    parent = Parent(path);
! 	    sprintf(message,"MakeSymbolicLink: new path = %s parent = %s\n",path,parent);
! 	    OutputDebugString(message);
! 
! 	    if (!IsPathInAfs(parent)) {
! 		ShowMessageBox(IDS_MAKE_LNK_NOT_AFS_ERROR, MB_ICONEXCLAMATION, IDS_MAKE_LNK_NOT_AFS_ERROR);
! 		return TRUE;
! 	    }
! 	} else {
! 	    ShowMessageBox(IDS_MAKE_LNK_NOT_AFS_ERROR, MB_ICONEXCLAMATION, IDS_MAKE_LNK_NOT_AFS_ERROR);
! 	    return TRUE;
! 	}
!     }
! 
!     if ( IsFreelanceRoot(parent) && !IsAdmin() ) {
! 	ShowMessageBox(IDS_NOT_AFS_CLIENT_ADMIN_ERROR, MB_ICONEXCLAMATION, IDS_NOT_AFS_CLIENT_ADMIN_ERROR);
! 	return FALSE;
!     }
! 
      LPTSTR lpsz = new TCHAR[strlen(strDir)+1];
      _tcscpy(lpsz, strName);
      strcpy(space, strDir);
***************
*** 1620,1628 ****
      blob.in_size = 1 + strlen(space);
      blob.in = space;
      blob.out = NULL;
!     if ((code=pioctl(lpsz, VIOC_SYMLINK, &blob, 0))!=0)
          return code;
!     return 0;
  }
  
  void ListSymbolicLinkPath(const char *strName,char *strPath,UINT nlenPath)
--- 1948,1958 ----
      blob.in_size = 1 + strlen(space);
      blob.in = space;
      blob.out = NULL;
!     code=pioctl(lpsz, VIOC_SYMLINK, &blob, 0);
!     delete lpsz;
!     if (code != 0)
          return code;
!     return FALSE;
  }
  
  void ListSymbolicLinkPath(const char *strName,char *strPath,UINT nlenPath)
***************
*** 1639,1658 ****
  
      strcpy(orig_name, strName);
      strcpy(true_name, orig_name);
! 	/*
! 	 * Find rightmost slash, if any.
! 	 */
      last_component = (char *) strrchr(true_name, '\\');
      if (!last_component)
          last_component = (char *) strrchr(true_name, '/');
      if (last_component) {
! 	    /*
! 	     * Found it.  Designate everything before it as the parent directory,
! 	     * everything after it as the final component.
! 	     */
          strncpy(parent_dir, true_name, last_component - true_name + 1);
          parent_dir[last_component - true_name + 1] = 0;
          last_component++;   /*Skip the slash*/
      }
      else {
          /*
--- 1969,2001 ----
  
      strcpy(orig_name, strName);
      strcpy(true_name, orig_name);
!     /*
!      * Find rightmost slash, if any.
!      */
      last_component = (char *) strrchr(true_name, '\\');
      if (!last_component)
          last_component = (char *) strrchr(true_name, '/');
      if (last_component) {
! 	/*
! 	 * Found it.  Designate everything before it as the parent directory,
! 	 * everything after it as the final component.
! 	 */
          strncpy(parent_dir, true_name, last_component - true_name + 1);
          parent_dir[last_component - true_name + 1] = 0;
          last_component++;   /*Skip the slash*/
+ 
+ 	if (!IsPathInAfs(parent_dir)) {
+ 	    const char * nbname = NetbiosName();
+ 	    int len = strlen(nbname);
+ 
+ 	    if (parent_dir[0] == '\\' && parent_dir[1] == '\\' &&
+ 		 parent_dir[len+2] == '\\' &&
+ 		 parent_dir[len+3] == '\0' &&
+ 		 !strnicmp(nbname,&parent_dir[2],len))
+ 	    {
+ 		sprintf(parent_dir,"\\\\%s\\all\\", nbname);
+ 	    }
+ 	}
      }
      else {
          /*
Index: openafs/src/WINNT/client_exp/gui2fs.h
diff -c openafs/src/WINNT/client_exp/gui2fs.h:1.5.2.1 openafs/src/WINNT/client_exp/gui2fs.h:1.5.2.2
*** openafs/src/WINNT/client_exp/gui2fs.h:1.5.2.1	Wed Apr 20 22:20:05 2005
--- openafs/src/WINNT/client_exp/gui2fs.h	Wed Aug 31 20:08:43 2005
***************
*** 42,45 ****
--- 42,46 ----
  BOOL IsMountPoint(const char * name);
  UINT MakeSymbolicLink(const char *,const char *);
  void ListSymbolicLinkPath(const char *strName,char *strPath,UINT nlenPath);
+ const char * NetbiosName(void);
  #endif //__GUI2FS_H__
Index: openafs/src/WINNT/client_exp/resource.h
diff -c openafs/src/WINNT/client_exp/resource.h:1.7 openafs/src/WINNT/client_exp/resource.h:1.7.2.1
*** openafs/src/WINNT/client_exp/resource.h:1.7	Sat Apr  3 21:41:07 2004
--- openafs/src/WINNT/client_exp/resource.h	Wed Aug 31 20:08:43 2005
***************
*** 125,130 ****
--- 125,132 ----
  #define IDS_UNABLE_TO_SET_CURRENT_DIRECTORY    133
  #define IDS_CURRENT_DIRECTORY_PATH_TOO_LONG    134
  #define IDS_CLEANACL_ERROR                     135
+ #define IDS_MAKE_LNK_NOT_AFS_ERROR             136
+ #define IDS_NOT_AFS_CLIENT_ADMIN_ERROR         137
                                             
  #define IDM_AUTHENTICATION                    0
  #define IDM_ACL_SET                           1
Index: openafs/src/WINNT/client_exp/lang/en_US/afs_shl_ext.rc
diff -c openafs/src/WINNT/client_exp/lang/en_US/afs_shl_ext.rc:1.6.2.1 openafs/src/WINNT/client_exp/lang/en_US/afs_shl_ext.rc:1.6.2.2
*** openafs/src/WINNT/client_exp/lang/en_US/afs_shl_ext.rc:1.6.2.1	Fri Nov  5 14:21:55 2004
--- openafs/src/WINNT/client_exp/lang/en_US/afs_shl_ext.rc	Wed Aug 31 20:08:43 2005
***************
*** 656,662 ****
      IDS_UNABLE_TO_CREATE_SYMBOLIC_LINK    "Unable to create symbolic link: %o."
      IDS_UNABLE_TO_SET_CURRENT_DIRECTORY   "Unable to set current directory."
      IDS_CURRENT_DIRECTORY_PATH_TOO_LONG   "Current directory pathname is too long."
!     IDS_CLEANACL_ERROR                    "Error Cleaning ACL(s)"
  END
  
  STRINGTABLE DISCARDABLE 
--- 656,664 ----
      IDS_UNABLE_TO_CREATE_SYMBOLIC_LINK    "Unable to create symbolic link: %o."
      IDS_UNABLE_TO_SET_CURRENT_DIRECTORY   "Unable to set current directory."
      IDS_CURRENT_DIRECTORY_PATH_TOO_LONG   "Current directory pathname is too long."
!     IDS_CLEANACL_ERROR                    "Error Cleaning ACL(s)."
!     IDS_MAKE_LNK_NOT_AFS_ERROR            "Symlinks must be created within the AFS file system."
!     IDS_NOT_AFS_CLIENT_ADMIN_ERROR        "Must be AFS Client Administrators to modify the root.afs volume."
  END
  
  STRINGTABLE DISCARDABLE 
Index: openafs/src/WINNT/install/loopback/loopbackutils.cpp
diff -c openafs/src/WINNT/install/loopback/loopbackutils.cpp:1.6.2.2 openafs/src/WINNT/install/loopback/loopbackutils.cpp:1.6.2.3
*** openafs/src/WINNT/install/loopback/loopbackutils.cpp:1.6.2.2	Sun Jun 12 07:23:14 2005
--- openafs/src/WINNT/install/loopback/loopbackutils.cpp	Wed Aug 31 21:56:07 2005
***************
*** 544,550 ****
      ret = SetIpAddress(pCfgGuidString, ip, mask);
      if (ret)
      {
!         ReportMessage(0,"Could not set the ip address and network mask",NULL,NULL,0);
          goto cleanup;
      }
      ret = LoopbackBindings(pCfgGuidString);
--- 544,550 ----
      ret = SetIpAddress(pCfgGuidString, ip, mask);
      if (ret)
      {
!         ReportMessage(0,"Could not set the ip address and network mask",NULL,NULL,ret);
          goto cleanup;
      }
      ret = LoopbackBindings(pCfgGuidString);
Index: openafs/src/WINNT/install/loopback/wmi.cpp
diff -c openafs/src/WINNT/install/loopback/wmi.cpp:1.3 openafs/src/WINNT/install/loopback/wmi.cpp:1.3.2.1
*** openafs/src/WINNT/install/loopback/wmi.cpp:1.3	Wed Aug  4 23:09:26 2004
--- openafs/src/WINNT/install/loopback/wmi.cpp	Wed Aug 31 21:56:07 2005
***************
*** 237,242 ****
--- 237,244 ----
      BSTR InstancePath = 0;
      BSTR MethodName = 0; // needs to be BSTR for ExecMethod()
  
+     BOOL comInitialized = FALSE;
+ 
      VARIANT v_ip_list;
      VariantInit(&v_ip_list);
  
***************
*** 261,268 ****
  
      // Initialize COM and connect up to CIMOM
  
      hr = CoInitializeEx(0, COINIT_MULTITHREADED);
!     CLEANUP_ON_FAILURE(hr);
  
      /* When called from an MSI this will generally fail.  This should only be called once
  	   per process and not surprisingly MSI beats us to it.  So ignore return value and
--- 263,275 ----
  
      // Initialize COM and connect up to CIMOM
  
+     ReportMessage(0, "Intializing COM", NULL, NULL, 0);
      hr = CoInitializeEx(0, COINIT_MULTITHREADED);
!     if (hr == S_OK || hr == S_FALSE) {
!         comInitialized = TRUE;
!     } else {
!         goto cleanup;
!     }
  
      /* When called from an MSI this will generally fail.  This should only be called once
  	   per process and not surprisingly MSI beats us to it.  So ignore return value and
***************
*** 271,282 ****
--- 278,292 ----
                                RPC_C_AUTHN_LEVEL_CONNECT,
                                RPC_C_IMP_LEVEL_IMPERSONATE,
                                NULL, EOAC_NONE, 0);
+ 
      /* CLEANUP_ON_FAILURE(hr); */
  
+     ReportMessage(0, "Creating Wbem Locator object", NULL, NULL, 0);
      hr = CoCreateInstance(CLSID_WbemLocator, 0, CLSCTX_INPROC_SERVER,
                            IID_IWbemLocator, (LPVOID *) &pLocator);
      CLEANUP_ON_FAILURE(hr);
  
+     ReportMessage(0, "Connecting to WMI", NULL, NULL, 0);
      hr = pLocator->ConnectServer(NamespacePath, NULL, NULL, NULL, 0,
                                   NULL, NULL, &pNamespace);
      CLEANUP_ON_FAILURE(hr);
***************
*** 400,405 ****
--- 410,416 ----
      VariantClear(&v_ip_list);
      VariantClear(&v_mask_list);
  
+     // SysFreeString is NULL safe
      SysFreeString(NamespacePath);
      SysFreeString(ClassPath);
      SysFreeString(InstancePath);
***************
*** 412,418 ****
      if (pLocator) pLocator->Release();
      if (pNamespace) pNamespace->Release();
  
!     CoUninitialize();
      return hr;
  }
  
--- 423,431 ----
      if (pLocator) pLocator->Release();
      if (pNamespace) pNamespace->Release();
  
!     if (comInitialized)
!         CoUninitialize();
! 
      return hr;
  }
  
***************
*** 507,514 ****
                          }                        
                          
                          if ( !_wcsicmp(swId, L"ms_netbios")  || 
!                             !_wcsicmp(swId, L"ms_tcpip")    ||
!                             !_wcsicmp(swId, L"ms_netbt")      )
                          {
                              if (pPath->IsEnabled()!=S_OK)
                              {
--- 520,528 ----
                          }                        
                          
                          if ( !_wcsicmp(swId, L"ms_netbios")  || 
!                              !_wcsicmp(swId, L"ms_tcpip")    ||
!                              !_wcsicmp(swId, L"ms_netbt")    ||
!                              !_wcsicmp(swId, L"ms_msclient"))
                          {
                              if (pPath->IsEnabled()!=S_OK)
                              {
***************
*** 518,524 ****
                                  bConfigChanged=TRUE;
                              }
                              
-                             
                          }
                          else //if (!_wcsicmp(swId, L"ms_server") || (!_wcsicmp(swId, L"ms_msclient")) 
                          {
--- 532,537 ----
Index: openafs/src/afs/LINUX/osi_vnodeops.c
diff -c openafs/src/afs/LINUX/osi_vnodeops.c:1.81.2.35 openafs/src/afs/LINUX/osi_vnodeops.c:1.81.2.36
*** openafs/src/afs/LINUX/osi_vnodeops.c:1.81.2.35	Fri Aug 19 11:33:28 2005
--- openafs/src/afs/LINUX/osi_vnodeops.c	Sun Sep  4 00:11:55 2005
***************
*** 22,28 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_vnodeops.c,v 1.81.2.35 2005/08/19 15:33:28 shadow Exp $");
  
  #include "afs/sysincludes.h"
  #include "afsincludes.h"
--- 22,28 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_vnodeops.c,v 1.81.2.36 2005/09/04 04:11:55 shadow Exp $");
  
  #include "afs/sysincludes.h"
  #include "afsincludes.h"
***************
*** 631,636 ****
--- 631,637 ----
  #endif
      AFS_GLOCK();
  
+ #ifdef notyet
      /* Make this a fast path (no crref), since it's called so often. */
      if (vcp->states & CStatd) {
  
***************
*** 643,648 ****
--- 644,650 ----
  #endif
  	return 0;
      }
+ #endif
  
      credp = crref();
      code = afs_getattr(vcp, &vattr, credp);
Index: openafs/src/config/NTMakefile.amd64_w2k
diff -c openafs/src/config/NTMakefile.amd64_w2k:1.1.2.14 openafs/src/config/NTMakefile.amd64_w2k:1.1.2.16
*** openafs/src/config/NTMakefile.amd64_w2k:1.1.2.14	Sat Aug 27 23:47:13 2005
--- openafs/src/config/NTMakefile.amd64_w2k	Wed Aug 31 20:15:20 2005
***************
*** 80,86 ****
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=4
! AFSPRODUCT_VER_PATCH=0001
  AFSPRODUCT_VER_BUILD=0
  
  # For MSI installer, each major release should have a different GUID
--- 80,86 ----
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=4
! AFSPRODUCT_VER_PATCH=0002
  AFSPRODUCT_VER_BUILD=0
  
  # For MSI installer, each major release should have a different GUID
***************
*** 258,263 ****
--- 258,267 ----
  !ENDIF
  !ENDIF
  
+ !IF ("$(AFSIFS)" == "TRUE")
+ afscdefs = $(afscdefs) -DAFSIFS
+ !ENDIF
+ 
  !IF ("$(AFSDEV_BUILDTYPE)" == "FREE")
  
  afscflags = $(afscflags) /Ox /Zi
***************
*** 269,279 ****
  cdebug = $(cdebug:-Z7=-Zi)  # avoid annoying override warning (D4025)
  
  !IF ("$(AFSVER_CL)"=="1200")
! afscdefs = $(afscdefs) -DDEBUG
! afscflags = $(afscflags) /GZ
  !ELSE 
! afscdefs = $(afscdefs) -DDEBUG
! afscflags = $(afscflags) /RTCs /RTCu
  !ENDIF
  
  !IFDEF _CRTDBG_MAP_ALLOC
--- 273,281 ----
  cdebug = $(cdebug:-Z7=-Zi)  # avoid annoying override warning (D4025)
  
  !IF ("$(AFSVER_CL)"=="1200")
! afscdefs = $(afscdefs) -DDEBUG /GZ
  !ELSE 
! afscdefs = $(afscdefs) -DDEBUG /RTCs /RTCu
  !ENDIF
  
  !IFDEF _CRTDBG_MAP_ALLOC
Index: openafs/src/config/NTMakefile.i386_nt40
diff -c openafs/src/config/NTMakefile.i386_nt40:1.46.2.29 openafs/src/config/NTMakefile.i386_nt40:1.46.2.31
*** openafs/src/config/NTMakefile.i386_nt40:1.46.2.29	Sat Aug 27 23:47:13 2005
--- openafs/src/config/NTMakefile.i386_nt40	Wed Aug 31 20:15:20 2005
***************
*** 80,86 ****
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=4
! AFSPRODUCT_VER_PATCH=0001
  AFSPRODUCT_VER_BUILD=0
  
  # For MSI installer, each major release should have a different GUID
--- 80,86 ----
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=4
! AFSPRODUCT_VER_PATCH=0002
  AFSPRODUCT_VER_BUILD=0
  
  # For MSI installer, each major release should have a different GUID
***************
*** 249,261 ****
  !ENDIF
  
  !IF ("$(AFSVER_CL)"!="1200")
! afscflags = $(afscflags) /GT /GS
  #/Wp64
  !IF ("$(AFSVER_CL)"!="1400")
! afscflags = $(afscflags) /G7
  !ENDIF
  !ENDIF
  
  !IF ("$(AFSDEV_BUILDTYPE)" == "FREE")
  
  afscflags = $(afscflags) /Ox /Zi
--- 249,265 ----
  !ENDIF
  
  !IF ("$(AFSVER_CL)"!="1200")
! afscdefs = $(afscdefs) /GT /GS
  #/Wp64
  !IF ("$(AFSVER_CL)"!="1400")
! afscdefs = $(afscdefs) /G7
  !ENDIF
  !ENDIF
  
+ !IF ("$(AFSIFS)" == "TRUE")
+ afscdefs = $(afscdefs) -DAFSIFS
+ !ENDIF
+ 
  !IF ("$(AFSDEV_BUILDTYPE)" == "FREE")
  
  afscflags = $(afscflags) /Ox /Zi
***************
*** 267,281 ****
  cdebug = $(cdebug:-Z7=-Zi)  # avoid annoying override warning (D4025)
  
  !IF ("$(AFSVER_CL)"=="1200")
! afscdefs = $(afscdefs) -DDEBUG
  afscflags = $(afscflags) /GZ
  !ELSE 
! afscdefs = $(afscdefs) -DDEBUG
  afscflags = $(afscflags) /RTCs /RTCu
  !ENDIF
  
  !IFDEF _CRTDBG_MAP_ALLOC
! afscflags = $(afscflags) -D_DEBUG -D_CRTDBG_MAP_ALLOC
  !ENDIF
  
  !UNDEF NODEBUG
--- 271,285 ----
  cdebug = $(cdebug:-Z7=-Zi)  # avoid annoying override warning (D4025)
  
  !IF ("$(AFSVER_CL)"=="1200")
! afscdefs = $(afscdefs) -DDEBUG 
  afscflags = $(afscflags) /GZ
  !ELSE 
! afscdefs = $(afscdefs) -DDEBUG 
  afscflags = $(afscflags) /RTCs /RTCu
  !ENDIF
  
  !IFDEF _CRTDBG_MAP_ALLOC
! afscdefs = $(afscdefs) -D_DEBUG -D_CRTDBG_MAP_ALLOC
  !ENDIF
  
  !UNDEF NODEBUG
***************
*** 298,304 ****
  afscflags = $(afscflags) /W$(AFSDEV_WARNLEVEL)
  
  # C/C++ compilation macros
! C2OBJ   = $(cc) /Fo$@ /Fd$*.pdb $(cflags) $(cdebug) $(cvarsdll) $(afscflags) $(afscdefs) /c  
  CPP2OBJ = $(C2OBJ)
  # Inference rules for building and installing targets
  # Compile .c files, from current directory to defined by OUT
--- 302,308 ----
  afscflags = $(afscflags) /W$(AFSDEV_WARNLEVEL)
  
  # C/C++ compilation macros
! C2OBJ   = $(cc) /Fo$@ /Fd$*.pdb $(cflags) $(cdebug) $(dafsifs) $(cvarsdll) $(afscflags) $(afscdefs) /c  
  CPP2OBJ = $(C2OBJ)
  # Inference rules for building and installing targets
  # Compile .c files, from current directory to defined by OUT
Index: openafs/src/config/NTMakefile.i386_w2k
diff -c openafs/src/config/NTMakefile.i386_w2k:1.1.2.14 openafs/src/config/NTMakefile.i386_w2k:1.1.2.17
*** openafs/src/config/NTMakefile.i386_w2k:1.1.2.14	Sat Aug 27 23:47:13 2005
--- openafs/src/config/NTMakefile.i386_w2k	Fri Sep  2 13:37:08 2005
***************
*** 78,86 ****
  LIB = $(AFSDEV_LIB)
  
  #define used in WinNT/2000 installation and program version display
- AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=4
! AFSPRODUCT_VER_PATCH=0001
  AFSPRODUCT_VER_BUILD=0
  
  # For MSI installer, each major release should have a different GUID
--- 78,85 ----
  LIB = $(AFSDEV_LIB)
  
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MINOR=4
! AFSPRODUCT_VER_PATCH=0002
  AFSPRODUCT_VER_BUILD=0
  
  # For MSI installer, each major release should have a different GUID
***************
*** 256,261 ****
--- 255,264 ----
  !ENDIF
  !ENDIF
  
+ !IF ("$(AFSIFS)" == "TRUE")
+ afscdefs = $(afscdefs) -DAFSIFS
+ !ENDIF
+ 
  !IF ("$(AFSDEV_BUILDTYPE)" == "FREE")
  
  afscflags = $(afscflags) /Ox /Zi
***************
*** 267,277 ****
  cdebug = $(cdebug:-Z7=-Zi)  # avoid annoying override warning (D4025)
  
  !IF ("$(AFSVER_CL)"=="1200")
! afscdefs = $(afscdefs) -DDEBUG
! afscflags = $(afscflags) /GZ
  !ELSE 
! afscdefs = $(afscdefs) -DDEBUG
! afscflags = $(afscflags) /RTCs /RTCu
  !ENDIF
  
  !IFDEF _CRTDBG_MAP_ALLOC
--- 270,278 ----
  cdebug = $(cdebug:-Z7=-Zi)  # avoid annoying override warning (D4025)
  
  !IF ("$(AFSVER_CL)"=="1200")
! afscdefs = $(afscdefs) -DDEBUG /GZ
  !ELSE 
! afscdefs = $(afscdefs) -DDEBUG /RTCs /RTCu
  !ENDIF
  
  !IFDEF _CRTDBG_MAP_ALLOC
Index: openafs/src/config/NTMakefile.i386_win95
diff -c openafs/src/config/NTMakefile.i386_win95:1.9 openafs/src/config/NTMakefile.i386_win95:1.9.2.1
*** openafs/src/config/NTMakefile.i386_win95:1.9	Wed Mar 17 19:00:15 2004
--- openafs/src/config/NTMakefile.i386_win95	Wed Aug 31 20:11:31 2005
***************
*** 36,42 ****
  !ENDIF
  
  #define used in Win9x installation and program version display
! AFSPRODUCT_VERSION=1.3.60
  CELLNAME_DEFAULT=Your Cell Name
  CELLSERVDB_INSTALL=CellServDB.GrandCentral
  CELLSERVDB_WEB=http://grand.central.org/dl/cellservdb/CellServDB
--- 36,42 ----
  !ENDIF
  
  #define used in Win9x installation and program version display
! AFSPRODUCT_VERSION=0.0.00
  CELLNAME_DEFAULT=Your Cell Name
  CELLSERVDB_INSTALL=CellServDB.GrandCentral
  CELLSERVDB_WEB=http://grand.central.org/dl/cellservdb/CellServDB
Index: openafs/src/packaging/MacOS/OpenAFS.info
diff -c openafs/src/packaging/MacOS/OpenAFS.info:1.1.4.16 openafs/src/packaging/MacOS/OpenAFS.info:1.1.4.17
*** openafs/src/packaging/MacOS/OpenAFS.info:1.1.4.16	Sun Aug 28 16:55:26 2005
--- openafs/src/packaging/MacOS/OpenAFS.info	Mon Sep  5 01:04:19 2005
***************
*** 1,5 ****
  Title OpenAFS
! Version 1.4.0-rc2
  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.4.0-rc3
  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/rx/rx.c
diff -c openafs/src/rx/rx.c:1.58.2.21 openafs/src/rx/rx.c:1.58.2.22
*** openafs/src/rx/rx.c:1.58.2.21	Sun Aug 28 16:43:36 2005
--- openafs/src/rx/rx.c	Fri Sep  2 18:50:59 2005
***************
*** 17,23 ****
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx.c,v 1.58.2.21 2005/08/28 20:43:36 shadow Exp $");
  
  #ifdef KERNEL
  #include "afs/sysincludes.h"
--- 17,23 ----
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx.c,v 1.58.2.22 2005/09/02 22:50:59 shadow Exp $");
  
  #ifdef KERNEL
  #include "afs/sysincludes.h"
***************
*** 1146,1153 ****
  
      /* Client is initially in send mode */
      call->state = RX_STATE_ACTIVE;
!     call->mode = RX_MODE_SENDING;
! 
      /* remember start time for call in case we have hard dead time limit */
      call->queueTime = queueTime;
      clock_GetTime(&call->startTime);
--- 1146,1157 ----
  
      /* Client is initially in send mode */
      call->state = RX_STATE_ACTIVE;
!     call->error = conn->error;
!     if (call->error)
! 	call->mode = RX_MODE_ERROR;
!     else
! 	call->mode = RX_MODE_SENDING;
!     
      /* remember start time for call in case we have hard dead time limit */
      call->queueTime = queueTime;
      clock_GetTime(&call->startTime);
Index: openafs/src/shlibafsrpc/Makefile.in
diff -c openafs/src/shlibafsrpc/Makefile.in:1.15.2.4 openafs/src/shlibafsrpc/Makefile.in:1.15.2.5
*** openafs/src/shlibafsrpc/Makefile.in:1.15.2.4	Mon Aug  8 11:39:24 2005
--- openafs/src/shlibafsrpc/Makefile.in	Fri Sep  2 19:38:54 2005
***************
*** 31,38 ****
  DES = ../des
  COMERR = ../comerr
  UTIL = ../util
! SYS = ../sys
! LWP = ../lwp
  
  SYSOBJS =\
  	syscall.o
--- 31,38 ----
  DES = ../des
  COMERR = ../comerr
  UTIL = ../util
! SYS = ${srcdir}/../sys
! LWP = ${srcdir}/../lwp
  
  SYSOBJS =\
  	syscall.o
***************
*** 279,285 ****
  #
  #   $ what /opt/langtools/bin/pxdb32
  #   /opt/langtools/bin/pxdb32:
! #           HP92453-02 A.10.0A HP-UX SYMBOLIC DEBUGGER (PXDB) $Revision: 1.15.2.4 $
  #
  # 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.
--- 279,285 ----
  #
  #   $ what /opt/langtools/bin/pxdb32
  #   /opt/langtools/bin/pxdb32:
! #           HP92453-02 A.10.0A HP-UX SYMBOLIC DEBUGGER (PXDB) $Revision: 1.15.2.5 $
  #
  # 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/sys/pioctl_nt.c
diff -c openafs/src/sys/pioctl_nt.c:1.18.2.10 openafs/src/sys/pioctl_nt.c:1.18.2.11
*** openafs/src/sys/pioctl_nt.c:1.18.2.10	Fri Apr 29 15:57:19 2005
--- openafs/src/sys/pioctl_nt.c	Fri Sep  2 13:28:36 2005
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/sys/pioctl_nt.c,v 1.18.2.10 2005/04/29 19:57:19 jaltman Exp $");
  
  #include <afs/stds.h>
  #include <windows.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/sys/pioctl_nt.c,v 1.18.2.11 2005/09/02 17:28:36 jaltman Exp $");
  
  #include <afs/stds.h>
  #include <windows.h>
***************
*** 322,335 ****
              tbuffer[1] = ':';
              strcpy(tbuffer + 2, SMB_IOCTL_FILENAME);
          } else if (fileNamep[0] == fileNamep[1] && 
! 			       fileNamep[0] == '\\')
          {
              int count = 0, i = 0;
  
              while (count < 4 && fileNamep[i]) {
                  tbuffer[i] = fileNamep[i];
!                 if ( tbuffer[i++] == '\\' )
                      count++;
              }
              if (fileNamep[i] == 0)
                  tbuffer[i++] = '\\';
--- 322,337 ----
              tbuffer[1] = ':';
              strcpy(tbuffer + 2, SMB_IOCTL_FILENAME);
          } else if (fileNamep[0] == fileNamep[1] && 
! 		   (fileNamep[0] == '\\' || fileNamep[0] == '/'))
          {
              int count = 0, i = 0;
  
              while (count < 4 && fileNamep[i]) {
                  tbuffer[i] = fileNamep[i];
!                 if ( tbuffer[i] == '\\' ||
! 		     tbuffer[i] == '/')
                      count++;
+ 		i++;
              }
              if (fileNamep[i] == 0)
                  tbuffer[i++] = '\\';
***************
*** 344,357 ****
                  tbuffer[1] = ':';
                  strcpy(tbuffer + 2, SMB_IOCTL_FILENAME);
              } else if (curdir[0] == curdir[1] &&
!                        curdir[0] == '\\') 
              {
                  int count = 0, i = 0;
  
                  while (count < 4 && curdir[i]) {
                      tbuffer[i] = curdir[i];
!                     if ( tbuffer[i++] == '\\' )
!                         count++;
                  }
                  if (tbuffer[i] == 0)
                      tbuffer[i++] = '\\';
--- 346,361 ----
                  tbuffer[1] = ':';
                  strcpy(tbuffer + 2, SMB_IOCTL_FILENAME);
              } else if (curdir[0] == curdir[1] &&
!                        (curdir[0] == '\\' || curdir[0] == '/')) 
              {
                  int count = 0, i = 0;
  
                  while (count < 4 && curdir[i]) {
                      tbuffer[i] = curdir[i];
! 		    if ( tbuffer[i] == '\\' ||
! 			 tbuffer[i] == '/')
! 			count++;
! 		    i++;
                  }
                  if (tbuffer[i] == 0)
                      tbuffer[i++] = '\\';
***************
*** 691,696 ****
--- 695,701 ----
      int pathHasDrive;
      int doSwitch;
      char newPath[3];
+     char *p;
  
      if (pathp[0] != 0 && pathp[1] == ':') {
  	/* there's a drive letter there */
***************
*** 701,707 ****
  	pathHasDrive = 0;
      }
  
!     if ( firstp[0] == '\\' && firstp[1] == '\\') {
          /* UNC path - strip off the server and sharename */
          int i, count;
          for ( i=2,count=2; count < 4 && firstp[i]; i++ ) {
--- 706,713 ----
  	pathHasDrive = 0;
      }
  
!     if ( firstp[0] == '\\' && firstp[1] == '\\' || 
! 	 firstp[0] == '/' && firstp[1] == '/') {
          /* UNC path - strip off the server and sharename */
          int i, count;
          for ( i=2,count=2; count < 4 && firstp[i]; i++ ) {
***************
*** 714,723 ****
--- 720,737 ----
          } else {
              strcpy(outPathp,&firstp[--i]);
          }
+ 	for (p=outPathp ;*p; p++) {
+ 	    if (*p == '/')
+ 		*p = '\\';
+ 	}
          return 0;
      } else if (firstp[0] == '\\' || firstp[0] == '/') {
          /* already an absolute pathname, just copy it back */
          strcpy(outPathp, firstp);
+ 	for (p=outPathp ;*p; p++) {
+ 	    if (*p == '/')
+ 		*p = '\\';
+ 	}
          return 0;
      }
  
***************
*** 747,753 ****
      GetCurrentDirectory(sizeof(tpath), tpath);
      if (tpath[1] == ':')
          strcpy(outPathp, tpath + 2);	/* skip drive letter */
!     else if ( tpath[0] == '\\' && tpath[1] == '\\') {
          /* UNC path - strip off the server and sharename */
          int i, count;
          for ( i=2,count=2; count < 4 && tpath[i]; i++ ) {
--- 761,768 ----
      GetCurrentDirectory(sizeof(tpath), tpath);
      if (tpath[1] == ':')
          strcpy(outPathp, tpath + 2);	/* skip drive letter */
!     else if ( tpath[0] == '\\' && tpath[1] == '\\'||
! 	      tpath[0] == '/' && tpath[1] == '/') {
          /* UNC path - strip off the server and sharename */
          int i, count;
          for ( i=2,count=2; count < 4 && tpath[i]; i++ ) {
***************
*** 778,783 ****
--- 793,802 ----
  	SetCurrentDirectory(origPath);
      }
  
+     for (p=outPathp ;*p; p++) {
+ 	if (*p == '/')
+ 	    *p = '\\';
+     }
      return 0;
  }
  
Index: openafs/src/volser/volprocs.c
diff -c openafs/src/volser/volprocs.c:1.34.2.3 openafs/src/volser/volprocs.c:1.34.2.4
*** openafs/src/volser/volprocs.c:1.34.2.3	Mon Dec 13 14:41:13 2004
--- openafs/src/volser/volprocs.c	Wed Aug 31 18:14:59 2005
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/volprocs.c,v 1.34.2.3 2004/12/13 19:41:13 shadow Exp $");
  
  #include <stdio.h>
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/volprocs.c,v 1.34.2.4 2005/08/31 22:14:59 shadow Exp $");
  
  #include <stdio.h>
  #include <sys/types.h>
***************
*** 2640,2646 ****
  
      code = VolSetIdsTypes(acid, atid, name, type, pId, cloneId, backupId);
      osi_auditU(acid, VS_SetIdTyEvent, code, AUD_LONG, atid, AUD_STR, name,
! 	       AUD_STR, type, AUD_LONG, pId, AUD_LONG, cloneId, AUD_LONG,
  	       backupId, AUD_END);
      return code;
  }
--- 2640,2646 ----
  
      code = VolSetIdsTypes(acid, atid, name, type, pId, cloneId, backupId);
      osi_auditU(acid, VS_SetIdTyEvent, code, AUD_LONG, atid, AUD_STR, name,
! 	       AUD_LONG, type, AUD_LONG, pId, AUD_LONG, cloneId, AUD_LONG,
  	       backupId, AUD_END);
      return code;
  }
