From: Jeffrey Altman Date: Mon, 12 Oct 2015 13:56:07 +0000 (-0400) Subject: Windows: CM_ERROR_INEXACT_MATCH is not a fatal error X-Git-Tag: openafs-stable-1_8_0pre1~217 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=c372bc92a3f78ac00aa69b2fb7a2050993b4fed8;hp=7e3289891d9032288f32b550ba6376f59f7e9a08 Windows: CM_ERROR_INEXACT_MATCH is not a fatal error cm_BPlusDirLookup() and cm_Lookup() can return CM_ERROR_INEXACT_MATCH which is not a fatal error. Instead it is an indication that the returned cm_scache object was not a case sensitive match. Do not fail the request and do not leak the cm_scache reference. Change-Id: Ieef3ce1ac96a8794859b5b9c530545d4fdd26bd5 Reviewed-on: http://gerrit.openafs.org/12057 Tested-by: BuildBot Reviewed-by: Jeffrey Altman --- diff --git a/src/WINNT/afsd/cm_ioctl.c b/src/WINNT/afsd/cm_ioctl.c index bc42626..c6230a4 100644 --- a/src/WINNT/afsd/cm_ioctl.c +++ b/src/WINNT/afsd/cm_ioctl.c @@ -1089,7 +1089,7 @@ cm_IoctlStatMountPoint(struct cm_ioctl *ioctlp, struct cm_user *userp, cm_scache cp = cm_ParseIoctlStringAlloc(ioctlp, NULL); code = cm_Lookup(dscp, cp[0] ? cp : L".", CM_FLAG_NOMOUNTCHASE, userp, reqp, &scp); - if (code) + if (code && code != CM_ERROR_INEXACT_MATCH) goto done_2; lock_ObtainWrite(&scp->rw); @@ -1146,7 +1146,7 @@ cm_IoctlDeleteMountPoint(struct cm_ioctl *ioctlp, struct cm_user *userp, cm_scac code = cm_Lookup(dscp, cp[0] ? cp : L".", CM_FLAG_NOMOUNTCHASE, userp, reqp, &scp); /* if something went wrong, bail out now */ - if (code) + if (code && code != CM_ERROR_INEXACT_MATCH) goto done3; lock_ObtainWrite(&scp->rw); @@ -2245,7 +2245,7 @@ cm_IoctlListlink(struct cm_ioctl *ioctlp, struct cm_user *userp, cm_scache_t *ds clientp = cm_Utf8ToClientStringAlloc(cp, -1, NULL); code = cm_Lookup(dscp, clientp[0] ? clientp : L".", CM_FLAG_NOMOUNTCHASE, userp, reqp, &scp); free(clientp); - if (code) + if (code && code != CM_ERROR_INEXACT_MATCH) return code; /* Check that it's a real symlink */ @@ -2314,7 +2314,7 @@ cm_IoctlIslink(struct cm_ioctl *ioctlp, struct cm_user *userp, cm_scache_t *dscp clientp = cm_Utf8ToClientStringAlloc(cp, -1, NULL); code = cm_Lookup(dscp, clientp[0] ? clientp : L".", CM_FLAG_NOMOUNTCHASE, userp, reqp, &scp); free(clientp); - if (code) + if (code && code != CM_ERROR_INEXACT_MATCH) return code; /* Check that it's a real symlink */ @@ -2352,7 +2352,7 @@ cm_IoctlDeletelink(struct cm_ioctl *ioctlp, struct cm_user *userp, cm_scache_t * code = cm_Lookup(dscp, clientp[0] ? clientp : L".", CM_FLAG_NOMOUNTCHASE, userp, reqp, &scp); /* if something went wrong, bail out now */ - if (code) + if (code && code != CM_ERROR_INEXACT_MATCH) goto done3; lock_ObtainWrite(&scp->rw); diff --git a/src/WINNT/afsrdr/user/RDRFunction.c b/src/WINNT/afsrdr/user/RDRFunction.c index eb4ab62..940deda 100644 --- a/src/WINNT/afsrdr/user/RDRFunction.c +++ b/src/WINNT/afsrdr/user/RDRFunction.c @@ -2309,7 +2309,7 @@ RDR_DeleteFileEntry( IN cm_user_t *userp, } code = cm_Lookup(dscp, FileName, 0, userp, &req, &scp); - if (code) { + if (code && code != CM_ERROR_INEXACT_MATCH) { smb_MapNTError(cm_MapRPCError(code, &req), &status, TRUE); (*ResultCB)->ResultStatus = status; (*ResultCB)->ResultBufferLength = 0; @@ -2597,7 +2597,7 @@ RDR_RenameFileEntry( IN cm_user_t *userp, cm_EndDirOp(&dirop); } - if (code != 0) { + if (code != 0 && code != CM_ERROR_INEXACT_MATCH) { osi_Log1(afsd_logp, "RDR_RenameFileEntry cm_BPlusDirLookup failed code 0x%x", code); (*ResultCB)->ResultStatus = STATUS_OBJECT_PATH_INVALID; @@ -2923,7 +2923,7 @@ RDR_HardLinkFileEntry( IN cm_user_t *userp, cm_EndDirOp(&dirop); } - if (code != 0) { + if (code != 0 && code != CM_ERROR_INEXACT_MATCH) { osi_Log1(afsd_logp, "RDR_HardLinkFileEntry cm_BPlusDirLookup failed code 0x%x", code); (*ResultCB)->ResultStatus = STATUS_OBJECT_PATH_INVALID;