From 351cefe9b60032fe77aa09c0803ef051fb5b4665 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Sun, 10 Feb 2013 20:05:49 -0500 Subject: [PATCH] Windows: Move Authenticated field to CommResultCB Add the Authenticated state of the request to the CommResultCB so the redirector knows the state of all requests. Change-Id: I854735c7fbda958a12fa79232b584b4d14dd8569 Reviewed-on: http://gerrit.openafs.org/9091 Tested-by: BuildBot Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- src/WINNT/afsrdr/common/AFSUserStructs.h | 16 +++++++--------- src/WINNT/afsrdr/user/RDRFunction.c | 2 -- src/WINNT/afsrdr/user/RDRInit.cpp | 9 ++++++++- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/WINNT/afsrdr/common/AFSUserStructs.h b/src/WINNT/afsrdr/common/AFSUserStructs.h index 1ecc74bcc..658fbaedd 100644 --- a/src/WINNT/afsrdr/common/AFSUserStructs.h +++ b/src/WINNT/afsrdr/common/AFSUserStructs.h @@ -59,7 +59,7 @@ typedef struct _AFS_FILE_ID typedef struct _AFS_COMM_REQUEST_BLOCK { - AFSFileID FileId; /* Initialize unused elements to 0 */ + AFSFileID FileId; /* Initialize unused elements to 0 */ ULONG RequestType; @@ -67,17 +67,17 @@ typedef struct _AFS_COMM_REQUEST_BLOCK ULONG RequestFlags; /* AFS_REQUEST_FLAG_xxxx */ - ULONG NameLength; // Length of the name in bytes + ULONG NameLength; /* Length of the name in bytes */ - ULONG DataOffset; // This offset is from the end of the structure, including the name + ULONG DataOffset; /* This offset is from the end of the structure, including the name */ ULONG DataLength; - GUID AuthGroup; // Length: sizeof(GUID) */ + GUID AuthGroup; /* Length: sizeof(GUID) */ ULONG ResultBufferLength; /* Do not exceed this length in response */ - LONG QueueCount; // Current outstanding requests in the queue + LONG QueueCount; /* Current outstanding requests in the queue */ WCHAR Name[ 1]; @@ -95,9 +95,9 @@ typedef struct _AFS_COMM_RESULT_BLOCK ULONG ResultStatus; /* NTSTATUS_xxx */ - ULONG ResultBufferLength; /* Not to exceed AFSCommRequest ResultBufferLength */ + ULONG ResultBufferLength; /* Not to exceed AFSCommRequest ResultBufferLength */ - ULONG Reserved; /* To ease Quad Alignment */ + ULONG Authenticated; /* Tokens or No? */ char ResultData[ 1]; @@ -345,8 +345,6 @@ typedef struct _AFS_FILE_OPEN_RESULT_CB ULONG FileAccess; - ULONG Authenticated; - } AFSFileOpenResultCB; typedef struct _AFS_FILE_ACCESS_RELEASE_CB diff --git a/src/WINNT/afsrdr/user/RDRFunction.c b/src/WINNT/afsrdr/user/RDRFunction.c index fbf705fc2..2b1a721c0 100644 --- a/src/WINNT/afsrdr/user/RDRFunction.c +++ b/src/WINNT/afsrdr/user/RDRFunction.c @@ -3086,8 +3086,6 @@ RDR_OpenFileEntry( IN cm_user_t *userp, { int count = 0; - pResultCB->Authenticated = cm_HaveToken(userp, scp->fid.cell); - do { if (count++ > 0) { Sleep(350); diff --git a/src/WINNT/afsrdr/user/RDRInit.cpp b/src/WINNT/afsrdr/user/RDRInit.cpp index d481a781e..ad68376db 100644 --- a/src/WINNT/afsrdr/user/RDRInit.cpp +++ b/src/WINNT/afsrdr/user/RDRInit.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2008 Secure Endpoints, Inc. - * Copyright (c) 2009-2011 Your File System, Inc. + * Copyright (c) 2009-2013 Your File System, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -68,6 +68,8 @@ extern osi_log_t *afsd_logp; #include #include #include +#include +#include } #include @@ -1320,6 +1322,11 @@ RDR_ProcessRequest( AFSCommRequest *RequestBuffer) break; } + if (userp) { + pResultCB->Authenticated = cm_HaveToken( userp, + RequestBuffer->FileId.Cell); + } + if( BooleanFlagOn( RequestBuffer->RequestFlags, AFS_REQUEST_FLAG_SYNCHRONOUS)) { if (pResultCB == NULL) { -- 2.39.5