windows-pioctl-path-charset-translation-20080205
[openafs.git] / src / WINNT / afsd / cm_ioctl.c
index 993caa8..16a480c 100644 (file)
@@ -220,10 +220,16 @@ long cm_ParseIoctlPath(smb_ioctl_t *ioctlp, cm_user_t *userp, cm_req_t *reqp,
      *    \\netbios-name\submount\path\.
      *    \\netbios-name\submount\path\file
      */
-    TranslateExtendedChars(relativePath);
+
+       /* We do not perform path name translation on the ioctl path data 
+        * because these paths were not translated by Windows through the
+        * file system API.  Therefore, they are not OEM characters but 
+        * whatever the display character set is.
+        */
+    // TranslateExtendedChars(relativePath);
 
     /* This is usually nothing, but for StatMountPoint it is the file name. */
-    TranslateExtendedChars(ioctlp->inDatap);
+    // TranslateExtendedChars(ioctlp->inDatap);
 
 #ifdef AFSIFS
     /* we have passed the whole path, including the afs prefix.
@@ -1574,8 +1580,6 @@ long cm_IoctlGetCell(struct smb_ioctl *ioctlp, struct cm_user *userp)
         return CM_ERROR_NOMORETOKENS;  /* mapped to EDOM */
 }
 
-extern long cm_AddCellProc(void *rockp, struct sockaddr_in *addrp, char *namep);
-
 long cm_IoctlNewCell(struct smb_ioctl *ioctlp, struct cm_user *userp)
 {
     /* NT cache manager will read cell information from CellServDB each time
@@ -1588,6 +1592,8 @@ long cm_IoctlNewCell(struct smb_ioctl *ioctlp, struct cm_user *userp)
      */  
   
     cm_cell_t *cp;
+    cm_cell_rock_t rock;
+
   
     cm_SkipIoctlPath(ioctlp);
     lock_ObtainWrite(&cm_cellLock);
@@ -1599,12 +1605,14 @@ long cm_IoctlNewCell(struct smb_ioctl *ioctlp, struct cm_user *userp)
         /* delete all previous server lists - cm_FreeServerList will ask for write on cm_ServerLock*/
         cm_FreeServerList(&cp->vlServersp, CM_FREESERVERLIST_DELETE);
         cp->vlServersp = NULL;
-        code = cm_SearchCellFile(cp->name, cp->name, cm_AddCellProc, cp);
+        rock.cellp = cp;
+        rock.flags = 0;
+        code = cm_SearchCellFile(cp->name, cp->name, cm_AddCellProc, &rock);
 #ifdef AFS_AFSDB_ENV
         if (code) {
             if (cm_dnsEnabled) {
                 int ttl;
-                code = cm_SearchCellByDNS(cp->name, cp->name, &ttl, cm_AddCellProc, cp);
+                code = cm_SearchCellByDNS(cp->name, cp->name, &ttl, cm_AddCellProc, &rock);
                 if ( code == 0 ) { /* got cell from DNS */
                     cp->flags |= CM_CELLFLAG_DNS;
                     cp->flags &= ~CM_CELLFLAG_VLSERVER_INVALID;