KFW_import_windows_lsa();
#endif /* USE_MS2MIT */
KFW_import_ccache_data();
- KFW_AFS_renew_expiring_credentials();
+ KFW_AFS_renew_expiring_tokens();
/* WIN32 NOTE: no way to get max chars */
if (!pcm_GetRootCellName(rootcell))
}
int
-KFW_AFS_renew_expiring_credentials(void)
+KFW_AFS_renew_expiring_tokens(void)
{
krb5_error_code code = 0;
krb5_context ctx = 0;
return 0;
if ( IsDebuggerPresent() ) {
- OutputDebugString("KFW_AFS_renew_expiring_credentials\n");
+ OutputDebugString("KFW_AFS_renew_expiring_tokens\n");
}
code = pkrb5_init_context(&ctx);
OutputDebugString("\n");
}
+#ifdef COMMENT
+ /* krb5_cc_remove_cred() is not implemented
+ * for a single cred
+ */
code = pkrb5_build_principal(ctx, &service, strlen(realm),
realm, "afs", cell, NULL);
if (!code) {
pkrb5_free_principal(ctx, creds.server);
}
}
+#endif /* COMMENT */
+
code = KFW_AFS_klog(ctx, cc, "afs", cell, (char *)realm, pLeash_get_default_lifetime());
if ( IsDebuggerPresent() ) {
char message[256];
char * cname, *sname;
pkrb5_unparse_name(ctx, increds.client, &cname);
pkrb5_unparse_name(ctx, increds.server, &sname);
- OutputDebugString("Getting credentials for \"");
+ OutputDebugString("Getting tickets for \"");
OutputDebugString(cname);
OutputDebugString("\" and service \"");
OutputDebugString(sname);
pkrb5_unparse_name(ctx, increds.client, &cname);
pkrb5_unparse_name(ctx, increds.server, &sname);
OutputDebugString("krb5_get_credentials() returned Service Principal Unknown\n");
- OutputDebugString("Trying again: getting credentials for \"");
+ OutputDebugString("Trying again: getting tickets for \"");
OutputDebugString(cname);
OutputDebugString("\" and service \"");
OutputDebugString(sname);
if (!rc && (now < atoken.endTime))
goto cleanup;
+
+ if ( IsDebuggerPresent() ) {
+ char message[256];
+ sprintf(message,"KFW_AFS_klog() returns: %d now = %ul endTime = %ul\n",
+ rc, now, atoken.endTime);
+ OutputDebugString(message);
+ }
} else {
SYSTEMTIME stNow;
FILETIME ftNow;
if (!rc && (llNow < llExpires))
goto cleanup;
+
+ if ( IsDebuggerPresent() ) {
+ char message[256];
+ sprintf(message,"KFW_AFS_klog() returns: %d now = %ul endTime = %ul\n",
+ rc, llNow, llExpires);
+ OutputDebugString(message);
+ }
}
serverReachable = 1;
}
#endif
- if ( !serverReachable )
+ if ( !serverReachable ) {
+ if ( IsDebuggerPresent() )
+ OutputDebugString("Server Unreachable\n");
goto cleanup;
+ }
+
+ if ( IsDebuggerPresent() )
+ OutputDebugString("Server Reachable\n");
if ( KFW_is_available() ) {
#ifdef USE_MS2MIT
KFW_import_windows_lsa();
#endif /* USE_MS2MIT */
- KFW_AFS_renew_expiring_credentials();
+ KFW_AFS_renew_expiring_tokens();
KFW_AFS_renew_token_for_cell(rootcell);
rc = pktc_GetToken(&aserver, &atoken, sizeof(atoken), &aclient);
#endif
NumOfAddrs = GetNumOfIpAddrs();
+
+ if ( IsDebuggerPresent() ) {
+ char message[256];
+ sprintf(message,"IPAddrChangeMonitor() NumOfAddrs: now %d was %d\n",
+ NumOfAddrs, prevNumOfAddrs);
+ OutputDebugString(message);
+ }
+
if ( NumOfAddrs != prevNumOfAddrs ) {
// Give AFS Client Service a chance to notice and die
// Or for network services to startup
}
BOOL fFoundUserName = FALSE;
- if (RegOpenKey (HKEY_LOCAL_MACHINE, TEXT("Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon"), &hk) == 0)
- {
- DWORD dwSize = sizeof(szUser);
- DWORD dwType = REG_SZ;
- if (RegQueryValueEx (hk, TEXT("DefaultUserName"), NULL, &dwType, (PBYTE)szUser, &dwSize) == 0)
- fFoundUserName = TRUE;
- RegCloseKey (hk);
- }
- if (!fFoundUserName)
- {
- if (RegOpenKey (HKEY_LOCAL_MACHINE, TEXT("Network\\Logon"), &hk) == 0)
- {
- DWORD dwSize = sizeof(szUser);
- DWORD dwType = REG_SZ;
- if (RegQueryValueEx (hk, TEXT("UserName"), NULL, &dwType, (PBYTE)szUser, &dwSize) == 0)
+ if (RegOpenKey (HKEY_LOCAL_MACHINE, TEXT("Software\\Microsoft\\Windows NT\\CurrentVersion\\Explorer"), &hk) == 0)
+ {
+ DWORD dwSize = sizeof(szUser);
+ DWORD dwType = REG_SZ;
+ if (RegQueryValueEx (hk, TEXT("Logon User Name"), NULL, &dwType, (PBYTE)szUser, &dwSize) == 0)
fFoundUserName = TRUE;
- RegCloseKey (hk);
- }
- }
+ RegCloseKey (hk);
+ }
+ if (!fFoundUserName )
+ {
+ if (RegOpenKey (HKEY_LOCAL_MACHINE, TEXT("Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon"), &hk) == 0)
+ {
+ DWORD dwSize = sizeof(szUser);
+ DWORD dwType = REG_SZ;
+ if (RegQueryValueEx (hk, TEXT("DefaultUserName"), NULL, &dwType, (PBYTE)szUser, &dwSize) == 0)
+ fFoundUserName = TRUE;
+ RegCloseKey (hk);
+ }
+ }
+ if (!fFoundUserName)
+ {
+ if (RegOpenKey (HKEY_LOCAL_MACHINE, TEXT("Network\\Logon"), &hk) == 0)
+ {
+ DWORD dwSize = sizeof(szUser);
+ DWORD dwType = REG_SZ;
+ if (RegQueryValueEx (hk, TEXT("UserName"), NULL, &dwType, (PBYTE)szUser, &dwSize) == 0)
+ fFoundUserName = TRUE;
+ RegCloseKey (hk);
+ }
+ }
TCHAR szSource[ cchRESOURCE ];
TCHAR szTarget[ cchRESOURCE ];
size_t retval = (size_t) -1;
lock_ObtainMutex(&g.expirationCheckLock);
if ( KFW_is_available() )
- KFW_AFS_renew_expiring_credentials();
+ KFW_AFS_renew_expiring_tokens();
lock_ObtainMutex(&g.credsLock);
for (size_t iCreds = 0; iCreds < g.cCreds; ++iCreds)
{