windows-fs-mkmount-20080811
authorJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 12 Aug 2008 00:54:48 +0000 (00:54 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 12 Aug 2008 00:54:48 +0000 (00:54 +0000)
LICENSE MIT

fix volume name validity test.  strip trailing '.' from volume name

src/WINNT/afsd/cm_ioctl.c

index 5e7cfbd..531a203 100644 (file)
@@ -1766,6 +1766,7 @@ cm_IoctlCreateMountPoint(struct cm_ioctl *ioctlp, struct cm_user *userp, cm_scac
     clientchar_t *cell = NULL;
     cm_volume_t *volp = NULL;
     cm_cell_t *cellp = NULL;
+    size_t len;
 
    /* 
      * The fs command allows the user to specify partial cell names on NT.  These must
@@ -1802,6 +1803,11 @@ cm_IoctlCreateMountPoint(struct cm_ioctl *ioctlp, struct cm_user *userp, cm_scac
         cellp = cm_FindCellByID(dscp->fid.cell, CM_FLAG_NOPROBE);
     }
 
+    /* remove the trailing dot if it is present */
+    len = strlen(fsvolume);
+    if (len > 1 && fsvolume[len-1] == '.')
+        fsvolume[len-1] = '\0';
+
     /* validate the target info */
     if (cm_VolNameIsID(fsvolume)) {
         code = cm_FindVolumeByID(cellp, atoi(fsvolume), userp, reqp,