]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
DEVEL15-windows-fs-mkmount-20080811
authorJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 12 Aug 2008 00:56:14 +0000 (00:56 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 12 Aug 2008 00:56:14 +0000 (00:56 +0000)
LICENSE MIT

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

(cherry picked from commit 1f6c7ca14a10ec476dc6720c264a004bc2c9d955)

src/WINNT/afsd/cm_ioctl.c

index e42d1176eaf69b14beb7990741371725c31c49a4..d4645711522bc7a5e5f84b6d9d9e5ac13809d067 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,