From e85bce5a6355b88e79bc89213b43de1b534aff79 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Tue, 12 Aug 2008 00:56:14 +0000 Subject: [PATCH] DEVEL15-windows-fs-mkmount-20080811 LICENSE MIT fix volume name validity test. strip trailing '.' from volume name (cherry picked from commit 1f6c7ca14a10ec476dc6720c264a004bc2c9d955) --- src/WINNT/afsd/cm_ioctl.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/WINNT/afsd/cm_ioctl.c b/src/WINNT/afsd/cm_ioctl.c index e42d1176e..d46457115 100644 --- a/src/WINNT/afsd/cm_ioctl.c +++ b/src/WINNT/afsd/cm_ioctl.c @@ -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, -- 2.39.5