]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
DEVEL15-windows-nim-afs-linked-cells-20081107
authorJeffrey Altman <jaltman@secure-endpoints.com>
Fri, 7 Nov 2008 16:36:03 +0000 (16:36 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Fri, 7 Nov 2008 16:36:03 +0000 (16:36 +0000)
LICENSE MIT

add linked cell support to the NIM afs provider.

(cherry picked from commit fffc8d7016b3f659d111276a1657dad8acc8cf50)

src/WINNT/netidmgr_plugin/afsfuncs.c
src/WINNT/netidmgr_plugin/afsfuncs.h
src/WINNT/netidmgr_plugin/afsnewcreds.c

index c0b856c95f2882825b4abae839baa0c7f8a7eb16..a4e7137fd45e81ca1b9ffffc1e948858ceeb1f46 100644 (file)
@@ -728,7 +728,8 @@ afs_klog(khm_handle identity,
          char *realm,
          int LifeTime,
          afs_tk_method method,
-         time_t * tok_expiration) {
+         time_t * tok_expiration,
+         char *linkedCell) {
 
     long       rc;
     CREDENTIALS        creds;
@@ -785,6 +786,10 @@ afs_klog(khm_handle identity,
         return(rc);
     }
 
+    if (linkedCell && ak_cellconfig.linkedCell)
+        StringCbCopyA(linkedCell, MAXCELLCHARS, 
+                      ak_cellconfig.linkedCell);
+
     StringCbCopyA(realm_of_cell, sizeof(realm_of_cell), 
                   afs_realm_of_cell(&ak_cellconfig, FALSE));
 
index be55608e49901ec11b8d70c12af303da1fd051e5..f7ba42e8cfeed7f344c2cbba3bd7c1f0d36c8bc5 100644 (file)
@@ -50,8 +50,8 @@ afs_klog(khm_handle identity,
          char *realm,
          int LifeTime,
          afs_tk_method method,
-         time_t * tok_expiration /* OUT: expiration time of new
-                                    token */
+         time_t * tok_expiration,/* OUT: expiration time of new token */
+         char *linkedCell        /* OUT: name of linkedCell (if any) */
          );
 
 int
index c1f41316026f39035fd05425917915441d0003f7..16c03ee4163aae2f0284c2277e240c92351e0fb3 100644 (file)
@@ -2655,6 +2655,7 @@ afs_msg_newcred(khm_int32 msg_subtype,
                 int code;
                 char cell[MAXCELLCHARS];
                 char realm[MAXCELLCHARS];
+                char linkedCell[MAXCELLCHARS]="";
                 khm_handle ctoken;
                 FILETIME ft_old;
                 FILETIME ft_new;
@@ -2662,6 +2663,7 @@ afs_msg_newcred(khm_int32 msg_subtype,
                 khm_size cb;
                 khm_int32 method = AFS_TOKEN_AUTO;
                 khm_handle csp_cell = NULL;
+                BOOL bgetLinked = 0;
 
                 if (l->rows[i].flags &
                     (DLGROW_FLAG_DONE | DLGROW_FLAG_DELETED))
@@ -2709,16 +2711,20 @@ afs_msg_newcred(khm_int32 msg_subtype,
                     method = l->rows[i].method;
                 }
 
+              getLinked:
                 _report_cs3(KHERR_INFO,
                             L"Getting tokens for cell %1!S! with realm %2!S! using method %3!d!",
-                            _cstr(cell),
+                            _cstr(bgetLinked ? linkedCell: cell),
                             _cstr(realm),
                             _int32(method));
                 _resolve();
 
                 /* make the call */
-                code = afs_klog(ident, "", cell, realm, 0, 
-                                method, &new_exp);
+                code = afs_klog(ident, "", 
+                                bgetLinked ? linkedCell : cell, 
+                                realm, 0,
+                                method, &new_exp, 
+                                bgetLinked ? NULL :linkedCell);
 
                 _report_cs1(KHERR_INFO,
                             L"klog returns code %1!d!",
@@ -2769,6 +2775,11 @@ afs_msg_newcred(khm_int32 msg_subtype,
                             ident_renew_triggered = TRUE;
                         }
                     }
+
+                    if ( !bgetLinked && linkedCell[0] ) {
+                        bgetLinked = TRUE;
+                        goto getLinked;
+                    }
                 }
             }