return success;
}
-#define AFS_LOGON_EVENT_NAME TEXT("AFS Logon")
-
-static void DebugEvent0(char *a)
-{
- HANDLE h; char *ptbuf[1];
- h = RegisterEventSource(NULL, AFS_LOGON_EVENT_NAME);
- ptbuf[0] = a;
- ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, (const char **)ptbuf, NULL);
- DeregisterEventSource(h);
-}
-
-#define MAXBUF_ 512
-static void DebugEvent(char *b,...)
-{
- HANDLE h; char *ptbuf[1],buf[MAXBUF_+1];
- va_list marker;
- h = RegisterEventSource(NULL, AFS_LOGON_EVENT_NAME);
- va_start(marker,b);
- vsprintf(buf, b, marker);
- buf[MAXBUF_] = '\0';
- ptbuf[0] = buf;
- ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, (const char **)ptbuf, NULL);
- DeregisterEventSource(h);
- va_end(marker);
-}
-
-
void
KFW_AFS_copy_cache_to_system_file(char * user, char * szLogonId)
{
strcat(cachename, filename);
- DebugEvent("Copy2File %s", filename);
-
DeleteFile(filename);
code = pkrb5_init_context(&ctx);
code = pkrb5_cc_initialize(ctx, ncc, princ);
if (code) goto cleanup;
- DebugEvent0("Copy2File copying");
-
code = pkrb5_cc_copy_creds(ctx,cc,ncc);
- DebugEvent("Copy2File copy_creds=%d", code);
-
cleanup:
if ( cc ) {
pkrb5_cc_close(ctx, cc);
strcat(cachename, filename);
- DebugEvent("Copy2Cache %s", cachename);
-
code = pkrb5_init_context(&ctx);
if (code) ctx = 0;
code = pkrb5_cc_resolve(ctx, cachename, &cc);
if (code) goto cleanup;
- DebugEvent("Copy2Cache resolve=%d", code);
-
code = pkrb5_cc_get_principal(ctx, cc, &princ);
code = pkrb5_cc_default(ctx, &ncc);
- DebugEvent("Copy2Cache default=%d", code);
-
if (!code) {
code = pkrb5_cc_initialize(ctx, ncc, princ);
- DebugEvent("Copy2Cache initialize=%d", code);
- code = pkrb5_cc_copy_creds(ctx,cc,ncc);
- DebugEvent("Copy2Cache copy_creds=%d", code);
+ if (!code)
+ code = pkrb5_cc_copy_creds(ctx,cc,ncc);
}
if ( ncc ) {
pkrb5_cc_close(ctx, ncc);
MSV1_0_INTERACTIVE_LOGON *IL;
- DWORD code;
+ DWORD code, code2;
int pw_exp;
char *reason;
p = opt.theseCells;
while ( *p ) {
- code = KFW_AFS_get_cred(principal, p, 0, 0, opt.smbName, &reason);
+ code2 = KFW_AFS_get_cred(principal, p, 0, 0, opt.smbName, &reason);
DebugEvent("KFW_AFS_get_cred uname=[%s] smbname=[%s] cell=[%s] code=[%d]",
- principal,opt.smbName,p,code);
+ principal,opt.smbName,p,code2);
p += strlen(p) + 1;
}