From 39e90a7299c8303cd14bc5c67fc8f24103c05a1f Mon Sep 17 00:00:00 2001 From: Olga Kornievskaia Date: Wed, 18 Jan 2012 11:52:31 -0500 Subject: [PATCH] bug fix in nfs41_FinalizeVNetRoot when we didn't create a mount, we don't have a security context to destroy. in vnetroot creation, initialize session to invalid_handle. if we fail to mount, then before deleting security context in nfs41_FinalizeVNetRoot check that session is not invalid_handle. --- sys/nfs41_driver.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c index 3529e9c..88d79ec 100644 --- a/sys/nfs41_driver.c +++ b/sys/nfs41_driver.c @@ -2739,6 +2739,8 @@ NTSTATUS nfs41_CreateVNetRoot( goto out; } + pVNetRootContext->session = INVALID_HANDLE_VALUE; + /* In order to cooperate with other network providers, we must * only claim paths of the form '\\server\nfs4\path' */ status = has_nfs_prefix(pSrvCall->pSrvCallName, pNetRoot->pNetRootName); @@ -3095,8 +3097,10 @@ NTSTATUS nfs41_FinalizeVNetRoot( pVNetRoot->pNetRoot->Type != NET_ROOT_WILD) status = STATUS_NOT_SUPPORTED; #ifdef STORE_MOUNT_SEC_CONTEXT - else + else if (pVNetRootContext->session != INVALID_HANDLE_VALUE) { + DbgP("nfs41_FinalizeVNetRoot: deleting security context\n"); SeDeleteClientSecurity(&pVNetRootContext->mount_sec_ctx); + } #endif DbgEx(); return status;