From 99894f0a7070caca7c8e96af3d82cf2bfdfe2bb9 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Mon, 6 Jul 2015 01:39:41 -0400 Subject: [PATCH] Windows: NetrShareGetInfo do not return registry errors In NetrShareGetInfo() when registry api calls fail do not leak the error codes to the caller. Instead, set the error to CM_ERROR_NOSUCHPATH so that NERR_NetNameNotFound can be returned. Change-Id: I2c8f12573ca604385176ebb18d92ff2f7023a27e Reviewed-on: http://gerrit.openafs.org/11924 Tested-by: BuildBot Reviewed-by: Jeffrey Altman --- src/WINNT/afsd/rpc_srvsvc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/WINNT/afsd/rpc_srvsvc.c b/src/WINNT/afsd/rpc_srvsvc.c index 5a403ccb7b..2c8f462e40 100644 --- a/src/WINNT/afsd/rpc_srvsvc.c +++ b/src/WINNT/afsd/rpc_srvsvc.c @@ -795,7 +795,10 @@ NET_API_STATUS NetrShareGetInfo( if (allSubmount) { scp = dscp; cm_HoldSCache(scp); - } + code = 0; + } else { + code = CM_ERROR_NOSUCHPATH; + } } else { /* * Could be a Submount, a directory entry, or a cell name we @@ -830,7 +833,9 @@ NET_API_STATUS NetrShareGetInfo( code == CM_ERROR_BPLUS_NOMATCH) code = cm_NameI(dscp, pathstr, CM_FLAG_CASEFOLD | CM_FLAG_FOLLOW, userp, NULL, &req, &scp); - } + } else { + code = CM_ERROR_NOSUCHPATH; + } } }