Windows: cm_UpdateVolumeLocation !append exts to num vol names

cm_UpdateVolumeLocation will append ".readonly" to a volume
name if the base name cannot be located.  However, this should
not be done if the base name is numeric.

LICENSE MIT

Change-Id: Id61b8803eed51d124b612ffba8b185a4b4982c1d
Reviewed-on: http://gerrit.openafs.org/1695
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
This commit is contained in:
Jeffrey Altman 2010-04-05 13:19:49 -04:00 committed by Jeffrey Altman
parent 33010ef25e
commit 03bb2c9d40

View File

@ -268,11 +268,14 @@ long cm_UpdateVolumeLocation(struct cm_cell *cellp, cm_user_t *userp, cm_req_t *
} }
/* We can end up here with code == CM_ERROR_NOSUCHVOLUME if the base volume name /* We can end up here with code == CM_ERROR_NOSUCHVOLUME if the base volume name
* does not exist but there might exist a .readonly volume. If the base name * does not exist and is not a numeric string but there might exist a .readonly volume.
* doesn't exist we will not care about the .backup that might be left behind * If the base name doesn't exist we will not care about the .backup that might be left
* since there should be no method to access it. * behind since there should be no method to access it.
*/ */
if (code == CM_ERROR_NOSUCHVOLUME && volp->vol[RWVOL].ID == 0 && strlen(volp->namep) < (VL_MAXNAMELEN - 9)) { if (code == CM_ERROR_NOSUCHVOLUME &&
_atoi64(volp->namep) == 0 &&
volp->vol[RWVOL].ID == 0 &&
strlen(volp->namep) < (VL_MAXNAMELEN - 9)) {
char name[VL_MAXNAMELEN]; char name[VL_MAXNAMELEN];
snprintf(name, VL_MAXNAMELEN, "%s.readonly", volp->namep); snprintf(name, VL_MAXNAMELEN, "%s.readonly", volp->namep);