Windows: Move Authenticated field to CommResultCB
authorJeffrey Altman <jaltman@your-file-system.com>
Mon, 11 Feb 2013 01:05:49 +0000 (20:05 -0500)
committerJeffrey Altman <jaltman@your-file-system.com>
Tue, 12 Feb 2013 04:21:12 +0000 (20:21 -0800)
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 <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

src/WINNT/afsrdr/common/AFSUserStructs.h
src/WINNT/afsrdr/user/RDRFunction.c
src/WINNT/afsrdr/user/RDRInit.cpp

index 1ecc74b..658fbae 100644 (file)
@@ -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
index fbf705f..2b1a721 100644 (file)
@@ -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);
index d481a78..ad68376 100644 (file)
@@ -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 <WINNT/afsreg.h>
 #include <afs/cm_config.h>
 #include <afs/cm_error.h>
+#include <afs/cm_nls.h>
+#include <afs/cm_user.h>
 }
 #include <RDRPrototypes.h>
 
@@ -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) {