Index: openafs/src/JAVA/libjafs/File.c diff -c openafs/src/JAVA/libjafs/File.c:1.4 openafs/src/JAVA/libjafs/File.c:1.4.4.1 *** openafs/src/JAVA/libjafs/File.c:1.4 Fri Oct 14 22:12:24 2005 --- openafs/src/JAVA/libjafs/File.c Tue Apr 10 14:39:44 2007 *************** *** 168,174 **** return JNI_TRUE; /* not really an error */ } else { fprintf(stderr, "File::setAttributes(): uafs_statmountpoint failed " ! "for %s (%s)\n", dirName, error_message(errno)); return JNI_FALSE; } } --- 168,174 ---- return JNI_TRUE; /* not really an error */ } else { fprintf(stderr, "File::setAttributes(): uafs_statmountpoint failed " ! "for %s (%s)\n", dirName, afs_error_message(errno)); return JNI_FALSE; } } *************** *** 208,214 **** } fprintf(stderr, "File::setAttributes(): uafs_stat failed for %s (%s)\n", ! dirName, error_message(errno)); return JNI_FALSE; } } --- 208,214 ---- } fprintf(stderr, "File::setAttributes(): uafs_stat failed for %s (%s)\n", ! dirName, afs_error_message(errno)); return JNI_FALSE; } } *************** *** 427,433 **** dirp = uafs_opendir(dirName); if(dirp == NULL) { fprintf(stderr, "File::listNative(): uafs_opendir(%s) failed(%s)\n", ! dirName, error_message(errno)); setError(env, &obj, errno); //throwAFSSecurityException( env, errno ); return 0; --- 427,433 ---- dirp = uafs_opendir(dirName); if(dirp == NULL) { fprintf(stderr, "File::listNative(): uafs_opendir(%s) failed(%s)\n", ! dirName, afs_error_message(errno)); setError(env, &obj, errno); //throwAFSSecurityException( env, errno ); return 0; Index: openafs/src/WINNT/afsd/afsd_init.c diff -c openafs/src/WINNT/afsd/afsd_init.c:1.79.2.11 openafs/src/WINNT/afsd/afsd_init.c:1.79.2.12 *** openafs/src/WINNT/afsd/afsd_init.c:1.79.2.11 Wed Mar 7 13:14:05 2007 --- openafs/src/WINNT/afsd/afsd_init.c Mon Apr 16 20:06:25 2007 *************** *** 136,142 **** void afsi_start() { ! char wd[256]; char t[100], u[100], *p, *path; int zilch; DWORD code; --- 136,142 ---- void afsi_start() { ! char wd[MAX_PATH+1]; char t[100], u[100], *p, *path; int zilch; DWORD code; *************** *** 146,158 **** DWORD maxLogSize = 100 * 1024; afsi_file = INVALID_HANDLE_VALUE; ! code = GetEnvironmentVariable("TEMP", wd, sizeof(wd)); ! if ( code == 0 || code > sizeof(wd) ) ! { ! code = GetWindowsDirectory(wd, sizeof(wd)); ! if (code == 0) ! return; ! } StringCbCatA(wd, sizeof(wd), "\\afsd_init.log"); GetTimeFormat(LOCALE_SYSTEM_DEFAULT, 0, NULL, NULL, t, sizeof(t)); afsi_file = CreateFile(wd, GENERIC_WRITE, FILE_SHARE_READ, NULL, --- 146,155 ---- DWORD maxLogSize = 100 * 1024; afsi_file = INVALID_HANDLE_VALUE; ! code = GetTempPath(sizeof(wd)-15, wd); ! if ( code == 0 || code > (sizeof(wd)-15) ) ! return; /* unable to create a log */ ! StringCbCatA(wd, sizeof(wd), "\\afsd_init.log"); GetTimeFormat(LOCALE_SYSTEM_DEFAULT, 0, NULL, NULL, t, sizeof(t)); afsi_file = CreateFile(wd, GENERIC_WRITE, FILE_SHARE_READ, NULL, Index: openafs/src/WINNT/afsd/afskfw.c diff -c openafs/src/WINNT/afsd/afskfw.c:1.28.4.4 openafs/src/WINNT/afsd/afskfw.c:1.28.4.8 *** openafs/src/WINNT/afsd/afskfw.c:1.28.4.4 Tue Apr 3 10:50:40 2007 --- openafs/src/WINNT/afsd/afskfw.c Wed Apr 18 11:59:35 2007 *************** *** 871,879 **** int KFW_get_ccache(krb5_context alt_ctx, krb5_principal principal, krb5_ccache * cc) { ! krb5_context ctx; ! char * pname = 0; ! char * ccname = 0; krb5_error_code code; if (!pkrb5_init_context) --- 871,879 ---- int KFW_get_ccache(krb5_context alt_ctx, krb5_principal principal, krb5_ccache * cc) { ! krb5_context ctx = NULL; ! char * pname = NULL; ! char * ccname = NULL; krb5_error_code code; if (!pkrb5_init_context) *************** *** 916,924 **** void KFW_import_windows_lsa(void) { ! krb5_context ctx = 0; ! krb5_ccache cc = 0; ! krb5_principal princ = 0; char * pname = NULL; krb5_data * princ_realm; krb5_error_code code; --- 916,924 ---- void KFW_import_windows_lsa(void) { ! krb5_context ctx = NULL; ! krb5_ccache cc = NULL; ! krb5_principal princ = NULL; char * pname = NULL; krb5_data * princ_realm; krb5_error_code code; *************** *** 1017,1030 **** void KFW_import_ccache_data(void) { ! krb5_context ctx = 0; ! krb5_ccache cc = 0; ! krb5_principal principal = 0; krb5_creds creds; krb5_error_code code; krb5_error_code cc_code; krb5_cc_cursor cur; ! apiCB * cc_ctx = 0; struct _infoNC ** pNCi = NULL; int i, j, flags; --- 1017,1030 ---- void KFW_import_ccache_data(void) { ! krb5_context ctx = NULL; ! krb5_ccache cc = NULL; ! krb5_principal principal = NULL; krb5_creds creds; krb5_error_code code; krb5_error_code cc_code; krb5_cc_cursor cur; ! apiCB * cc_ctx = NULL; struct _infoNC ** pNCi = NULL; int i, j, flags; *************** *** 1214,1224 **** char * smbname, char ** reasonP ) { ! krb5_context ctx = 0; ! krb5_ccache cc = 0; ! char * realm = 0, * userrealm = 0; ! krb5_principal principal = 0; ! char * pname = 0; krb5_error_code code; char local_cell[MAXCELLCHARS+1]; char **cells = NULL; --- 1214,1224 ---- char * smbname, char ** reasonP ) { ! krb5_context ctx = NULL; ! krb5_ccache cc = NULL; ! char * realm = NULL, * userrealm = NULL; ! krb5_principal principal = NULL; ! char * pname = NULL; krb5_error_code code; char local_cell[MAXCELLCHARS+1]; char **cells = NULL; *************** *** 1366,1373 **** int KFW_AFS_destroy_tickets_for_cell(char * cell) { ! krb5_context ctx = 0; ! krb5_error_code code; int count; char ** principals = NULL; --- 1366,1373 ---- int KFW_AFS_destroy_tickets_for_cell(char * cell) { ! krb5_context ctx = NULL; ! krb5_error_code code; int count; char ** principals = NULL; *************** *** 1423,1441 **** } free(principals); } ! pkrb5_free_context(ctx); return 0; } int KFW_AFS_destroy_tickets_for_principal(char * user) { ! krb5_context ctx = 0; ! krb5_error_code code; int count; char ** cells = NULL; ! krb5_principal princ = 0; ! krb5_ccache cc = 0; if (!pkrb5_init_context) return 0; --- 1423,1442 ---- } free(principals); } ! if (ctx) ! pkrb5_free_context(ctx); return 0; } int KFW_AFS_destroy_tickets_for_principal(char * user) { ! krb5_context ctx = NULL; ! krb5_error_code code; int count; char ** cells = NULL; ! krb5_principal princ = NULL; ! krb5_ccache cc = NULL; if (!pkrb5_init_context) return 0; *************** *** 1447,1453 **** } code = pkrb5_init_context(&ctx); ! if (code) ctx = 0; code = pkrb5_parse_name(ctx, user, &princ); if (code) goto loop_cleanup; --- 1448,1454 ---- } code = pkrb5_init_context(&ctx); ! if (code) return 0; code = pkrb5_parse_name(ctx, user, &princ); if (code) goto loop_cleanup; *************** *** 1477,1492 **** free(cells); } ! pkrb5_free_context(ctx); return 0; } int KFW_AFS_renew_expiring_tokens(void) { ! krb5_error_code code = 0; ! krb5_context ctx = 0; ! krb5_ccache cc = 0; krb5_timestamp now; struct principal_ccache_data * pcc_next = princ_cc_data; int cell_count; --- 1478,1494 ---- free(cells); } ! if (ctx) ! pkrb5_free_context(ctx); return 0; } int KFW_AFS_renew_expiring_tokens(void) { ! krb5_error_code code = 0; ! krb5_context ctx = NULL; ! krb5_ccache cc = NULL; krb5_timestamp now; struct principal_ccache_data * pcc_next = princ_cc_data; int cell_count; *************** *** 1586,1593 **** BOOL KFW_AFS_renew_token_for_cell(char * cell) { ! krb5_error_code code = 0; ! krb5_context ctx = 0; int count; char ** principals = NULL; --- 1588,1595 ---- BOOL KFW_AFS_renew_token_for_cell(char * cell) { ! krb5_error_code code = 0; ! krb5_context ctx = NULL; int count; char ** principals = NULL; *************** *** 1701,1707 **** code = -1; // we did not renew the tokens cleanup: ! pkrb5_free_context(ctx); return (code ? FALSE : TRUE); } --- 1703,1710 ---- code = -1; // we did not renew the tokens cleanup: ! if (ctx) ! pkrb5_free_context(ctx); return (code ? FALSE : TRUE); } *************** *** 1727,1739 **** int KFW_renew(krb5_context alt_ctx, krb5_ccache alt_cc) { ! krb5_error_code code = 0; ! krb5_context ctx = 0; ! krb5_ccache cc = 0; ! krb5_principal me = 0; ! krb5_principal server = 0; ! krb5_creds my_creds; ! krb5_data *realm = 0; if (!pkrb5_init_context) return 0; --- 1730,1742 ---- int KFW_renew(krb5_context alt_ctx, krb5_ccache alt_cc) { ! krb5_error_code code = 0; ! krb5_context ctx = NULL; ! krb5_ccache cc = NULL; ! krb5_principal me = NULL; ! krb5_principal server = NULL; ! krb5_creds my_creds; ! krb5_data *realm = NULL; if (!pkrb5_init_context) return 0; *************** *** 1844,1855 **** DWORD publicIP ) { ! krb5_error_code code = 0; ! krb5_context ctx = 0; ! krb5_ccache cc = 0; ! krb5_principal me = 0; ! char* name = 0; ! krb5_creds my_creds; krb5_get_init_creds_opt options; krb5_address ** addrs = NULL; int i = 0, addr_count = 0; --- 1847,1858 ---- DWORD publicIP ) { ! krb5_error_code code = 0; ! krb5_context ctx = NULL; ! krb5_ccache cc = NULL; ! krb5_principal me = NULL; ! char* name = NULL; ! krb5_creds my_creds; krb5_get_init_creds_opt options; krb5_address ** addrs = NULL; int i = 0, addr_count = 0; *************** *** 2010,2017 **** int KFW_kdestroy(krb5_context alt_ctx, krb5_ccache alt_cc) { ! krb5_context ctx; ! krb5_ccache cc; krb5_error_code code; if (!pkrb5_init_context) --- 2013,2020 ---- int KFW_kdestroy(krb5_context alt_ctx, krb5_ccache alt_cc) { ! krb5_context ctx = NULL; ! krb5_ccache cc = NULL; krb5_error_code code; if (!pkrb5_init_context) *************** *** 2640,2652 **** DWORD CurrentState; char HostName[64]; BOOL try_krb5 = 0; ! krb5_context ctx = 0; ! krb5_ccache cc = 0; krb5_creds increds; ! krb5_creds * k5creds = 0; krb5_error_code code; ! krb5_principal client_principal = 0; ! krb5_data * k5data; int i, retry = 0; CurrentState = 0; --- 2643,2655 ---- DWORD CurrentState; char HostName[64]; BOOL try_krb5 = 0; ! krb5_context ctx = NULL; ! krb5_ccache cc = NULL; krb5_creds increds; ! krb5_creds * k5creds = NULL; krb5_error_code code; ! krb5_principal client_principal = NULL; ! krb5_data * k5data = NULL; int i, retry = 0; CurrentState = 0; *************** *** 3375,3387 **** BOOL KFW_probe_kdc(struct afsconf_cell * cellconfig) { ! krb5_context ctx = 0; ! krb5_ccache cc = 0; krb5_error_code code; krb5_data pwdata; ! const char * realm = 0; ! krb5_principal principal = 0; ! char * pname = 0; char password[PROBE_PASSWORD_LEN+1]; BOOL serverReachable = 0; --- 3378,3390 ---- BOOL KFW_probe_kdc(struct afsconf_cell * cellconfig) { ! krb5_context ctx = NULL; ! krb5_ccache cc = NULL; krb5_error_code code; krb5_data pwdata; ! const char * realm = NULL; ! krb5_principal principal = NULL; ! char * pname = NULL; char password[PROBE_PASSWORD_LEN+1]; BOOL serverReachable = 0; *************** *** 3452,3462 **** BOOL KFW_AFS_get_lsa_principal(char * szUser, DWORD *dwSize) { ! krb5_context ctx = 0; krb5_error_code code; ! krb5_ccache mslsa_ccache=0; ! krb5_principal princ = 0; ! char * pname = 0; BOOL success = 0; if (!KFW_is_available()) --- 3455,3465 ---- BOOL KFW_AFS_get_lsa_principal(char * szUser, DWORD *dwSize) { ! krb5_context ctx = NULL; krb5_error_code code; ! krb5_ccache mslsa_ccache=NULL; ! krb5_principal princ = NULL; ! char * pname = NULL; BOOL success = 0; if (!KFW_is_available()) *************** *** 3626,3636 **** char filename[MAX_PATH] = ""; DWORD count; char cachename[MAX_PATH + 8] = "FILE:"; ! krb5_context ctx = 0; krb5_error_code code; ! krb5_principal princ = 0; ! krb5_ccache cc = 0; ! krb5_ccache ncc = 0; if (!pkrb5_init_context || !user || !szLogonId) return; --- 3629,3639 ---- char filename[MAX_PATH] = ""; DWORD count; char cachename[MAX_PATH + 8] = "FILE:"; ! krb5_context ctx = NULL; krb5_error_code code; ! krb5_principal princ = NULL; ! krb5_ccache cc = NULL; ! krb5_ccache ncc = NULL; if (!pkrb5_init_context || !user || !szLogonId) return; *************** *** 3651,3657 **** DeleteFile(filename); code = pkrb5_init_context(&ctx); ! if (code) ctx = 0; code = pkrb5_parse_name(ctx, user, &princ); if (code) goto cleanup; --- 3654,3660 ---- DeleteFile(filename); code = pkrb5_init_context(&ctx); ! if (code) goto cleanup; code = pkrb5_parse_name(ctx, user, &princ); if (code) goto cleanup; *************** *** 3692,3702 **** KFW_AFS_copy_file_cache_to_default_cache(char * filename) { char cachename[MAX_PATH + 8] = "FILE:"; ! krb5_context ctx = 0; krb5_error_code code; ! krb5_principal princ = 0; ! krb5_ccache cc = 0; ! krb5_ccache ncc = 0; int retval = 1; if (!pkrb5_init_context || !filename) --- 3695,3705 ---- KFW_AFS_copy_file_cache_to_default_cache(char * filename) { char cachename[MAX_PATH + 8] = "FILE:"; ! krb5_context ctx = NULL; krb5_error_code code; ! krb5_principal princ = NULL; ! krb5_ccache cc = NULL; ! krb5_ccache ncc = NULL; int retval = 1; if (!pkrb5_init_context || !filename) *************** *** 3705,3714 **** if ( strlen(filename) + sizeof("FILE:") > sizeof(cachename) ) return 1; - strcat(cachename, filename); - code = pkrb5_init_context(&ctx); ! if (code) ctx = 0; code = pkrb5_cc_resolve(ctx, cachename, &cc); if (code) goto cleanup; --- 3708,3717 ---- if ( strlen(filename) + sizeof("FILE:") > sizeof(cachename) ) return 1; code = pkrb5_init_context(&ctx); ! if (code) return 1; ! ! strcat(cachename, filename); code = pkrb5_cc_resolve(ctx, cachename, &cc); if (code) goto cleanup; Index: openafs/src/WINNT/afsd/afslogon.c diff -c openafs/src/WINNT/afsd/afslogon.c:1.45.2.9 openafs/src/WINNT/afsd/afslogon.c:1.45.2.11 *** openafs/src/WINNT/afsd/afslogon.c:1.45.2.9 Tue Apr 3 00:33:20 2007 --- openafs/src/WINNT/afsd/afslogon.c Tue Apr 17 00:04:36 2007 *************** *** 45,53 **** return; 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 --- 45,55 ---- return; h = RegisterEventSource(NULL, AFS_LOGON_EVENT_NAME); ! if (h != INVALID_HANDLE_VALUE) { ! ptbuf[0] = a; ! ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 1008, NULL, 1, 0, (const char **)ptbuf, NULL); ! DeregisterEventSource(h); ! } } #define MAXBUF_ 512 *************** *** 60,72 **** return; h = RegisterEventSource(NULL, AFS_LOGON_EVENT_NAME); ! va_start(marker,b); ! StringCbVPrintf(buf, MAXBUF_+1,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); } static HANDLE hInitMutex = NULL; --- 62,76 ---- return; h = RegisterEventSource(NULL, AFS_LOGON_EVENT_NAME); ! if (h != INVALID_HANDLE_VALUE) { ! va_start(marker,b); ! StringCbVPrintf(buf, MAXBUF_+1,b,marker); ! buf[MAXBUF_] = '\0'; ! ptbuf[0] = buf; ! ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 1008, NULL, 1, 0, (const char **)ptbuf, NULL); ! DeregisterEventSource(h); ! va_end(marker); ! } } static HANDLE hInitMutex = NULL; *************** *** 315,335 **** if(hkDom) { \ dwSize = sizeof(v); \ rv = RegQueryValueEx(hkDom, n, 0, &dwType, (LPBYTE) &(v), &dwSize); \ ! if(rv == ERROR_SUCCESS) DebugEvent(#v " found in hkDom with type [%d]", dwType); \ } \ ! if(hkDoms && (rv != ERROR_SUCCESS || dwType != t)) { \ dwSize = sizeof(v); \ rv = RegQueryValueEx(hkDoms, n, 0, &dwType, (LPBYTE) &(v), &dwSize); \ ! if(rv == ERROR_SUCCESS) DebugEvent(#v " found in hkDoms with type [%d]", dwType); \ } \ ! if(hkNp && (rv != ERROR_SUCCESS || dwType != t)) { \ dwSize = sizeof(v); \ rv = RegQueryValueEx(hkNp, n, 0, &dwType, (LPBYTE) &(v), &dwSize); \ ! if(rv == ERROR_SUCCESS) DebugEvent(#v " found in hkNp with type [%d]", dwType); \ } \ ! if(rv != ERROR_SUCCESS || dwType != t) { \ v = d; \ ! DebugEvent(#v " being set to default"); \ } \ } while(0) --- 319,342 ---- if(hkDom) { \ dwSize = sizeof(v); \ rv = RegQueryValueEx(hkDom, n, 0, &dwType, (LPBYTE) &(v), &dwSize); \ ! if(rv == ERROR_SUCCESS || rv == ERROR_MORE_DATA) \ ! DebugEvent(#v " found in hkDom with type [%d]", dwType); \ } \ ! if(hkDoms && ((rv != ERROR_SUCCESS && rv != ERROR_MORE_DATA) || dwType != t)) { \ dwSize = sizeof(v); \ rv = RegQueryValueEx(hkDoms, n, 0, &dwType, (LPBYTE) &(v), &dwSize); \ ! if(rv == ERROR_SUCCESS || rv == ERROR_MORE_DATA) \ ! DebugEvent(#v " found in hkDoms with type [%d]", dwType); \ } \ ! if(hkNp && ((rv != ERROR_SUCCESS && rv != ERROR_MORE_DATA) || dwType != t)) { \ dwSize = sizeof(v); \ rv = RegQueryValueEx(hkNp, n, 0, &dwType, (LPBYTE) &(v), &dwSize); \ ! if(rv == ERROR_SUCCESS || rv == ERROR_MORE_DATA) \ ! DebugEvent(#v " found in hkNp with type [%d]", dwType); \ } \ ! if((rv != ERROR_SUCCESS && rv != ERROR_MORE_DATA) || dwType != t) { \ v = d; \ ! DebugEvent0(#v " being set to default"); \ } \ } while(0) *************** *** 398,404 **** hkDoms = NULL; } } else ! DebugEvent("Not opening domain key"); /* Each individual can either be specified on the domain key, the domains key or in the net provider key. They fail over in that order. If none is found, we just use the --- 405,411 ---- hkDoms = NULL; } } else ! DebugEvent0("Not opening domain key"); /* Each individual can either be specified on the domain key, the domains key or in the net provider key. They fail over in that order. If none is found, we just use the *************** *** 485,491 **** strlwr(opt->smbName); } ! DebugEvent("Looking up logon script"); /* Logon script */ /* First find out where the key is */ hkTemp = NULL; --- 492,498 ---- strlwr(opt->smbName); } ! DebugEvent0("Looking up logon script"); /* Logon script */ /* First find out where the key is */ hkTemp = NULL; *************** *** 495,514 **** rv = RegQueryValueExW(hkDom, REG_CLIENT_LOGON_SCRIPT_PARMW, 0, &dwType, NULL, &dwSize); if(rv == ERROR_SUCCESS && (dwType == REG_SZ || dwType == REG_EXPAND_SZ)) { hkTemp = hkDom; ! DebugEvent("Located logon script in hkDom"); } ! else if(hkDoms) rv = RegQueryValueExW(hkDoms, REG_CLIENT_LOGON_SCRIPT_PARMW, 0, &dwType, NULL, &dwSize); ! if(rv == ERROR_SUCCESS && !hkTemp && (dwType == REG_SZ || dwType == REG_EXPAND_SZ)) { ! hkTemp = hkDoms; ! DebugEvent("Located logon script in hkDoms"); ! } ! /* Note that the LogonScript in the NP key is only used if we are doing high security. */ ! else if(hkNp && ISHIGHSECURITY(opt->LogonOption)) ! rv = RegQueryValueExW(hkNp, REG_CLIENT_LOGON_SCRIPT_PARMW, 0, &dwType, NULL, &dwSize); ! if(rv == ERROR_SUCCESS && !hkTemp && (dwType == REG_SZ || dwType == REG_EXPAND_SZ)) { ! hkTemp = hkNp; ! DebugEvent("Located logon script in hkNp"); } if(hkTemp) { --- 502,523 ---- rv = RegQueryValueExW(hkDom, REG_CLIENT_LOGON_SCRIPT_PARMW, 0, &dwType, NULL, &dwSize); if(rv == ERROR_SUCCESS && (dwType == REG_SZ || dwType == REG_EXPAND_SZ)) { hkTemp = hkDom; ! DebugEvent0("Located logon script in hkDom"); } ! else if(hkDoms) { rv = RegQueryValueExW(hkDoms, REG_CLIENT_LOGON_SCRIPT_PARMW, 0, &dwType, NULL, &dwSize); ! if(rv == ERROR_SUCCESS && !hkTemp && (dwType == REG_SZ || dwType == REG_EXPAND_SZ)) { ! hkTemp = hkDoms; ! DebugEvent0("Located logon script in hkDoms"); ! } ! /* Note that the LogonScript in the NP key is only used if we are doing high security. */ ! else if(hkNp && ISHIGHSECURITY(opt->LogonOption)) { ! rv = RegQueryValueExW(hkNp, REG_CLIENT_LOGON_SCRIPT_PARMW, 0, &dwType, NULL, &dwSize); ! if(rv == ERROR_SUCCESS && !hkTemp && (dwType == REG_SZ || dwType == REG_EXPAND_SZ)) { ! hkTemp = hkNp; ! DebugEvent0("Located logon script in hkNp"); ! } ! } } if(hkTemp) { *************** *** 524,538 **** len ++; wuname = malloc(len * sizeof(WCHAR)); MultiByteToWideChar(CP_ACP,0,opt->smbName,-1,wuname,(int)(len*sizeof(WCHAR))); DebugEvent("Username is set for [%S]", wuname); /* dwSize still has the size of the required buffer in bytes. */ regscript = malloc(dwSize); rv = RegQueryValueExW(hkTemp, REG_CLIENT_LOGON_SCRIPT_PARMW, 0, &dwType, (LPBYTE) regscript, &dwSize); if(rv != ERROR_SUCCESS) {/* what the ..? */ ! DebugEvent("Can't look up logon script [%d]",rv); goto doneLogonScript; } --- 533,551 ---- len ++; wuname = malloc(len * sizeof(WCHAR)); + if (!wuname) + goto doneLogonScript; MultiByteToWideChar(CP_ACP,0,opt->smbName,-1,wuname,(int)(len*sizeof(WCHAR))); DebugEvent("Username is set for [%S]", wuname); /* dwSize still has the size of the required buffer in bytes. */ regscript = malloc(dwSize); + if (!regscript) + goto doneLogonScript; rv = RegQueryValueExW(hkTemp, REG_CLIENT_LOGON_SCRIPT_PARMW, 0, &dwType, (LPBYTE) regscript, &dwSize); if(rv != ERROR_SUCCESS) {/* what the ..? */ ! DebugEvent("Can't look up logon script rv [%d] size [%d] gle %d",rv, dwSize, GetLastError()); goto doneLogonScript; } *************** *** 543,554 **** dwSize += MAX_PATH * sizeof(WCHAR); /* make room for environment expansion. */ regexscript = malloc(dwSize); dwReq = ExpandEnvironmentStringsW(regscript, regexscript, dwSize / sizeof(WCHAR)); free(regscript); regscript = regexscript; regexscript = NULL; if(dwReq > (dwSize / sizeof(WCHAR))) { ! DebugEvent("Overflow while expanding environment strings."); goto doneLogonScript; } } --- 556,569 ---- dwSize += MAX_PATH * sizeof(WCHAR); /* make room for environment expansion. */ regexscript = malloc(dwSize); + if (!regexscript) + goto doneLogonScript; dwReq = ExpandEnvironmentStringsW(regscript, regexscript, dwSize / sizeof(WCHAR)); free(regscript); regscript = regexscript; regexscript = NULL; if(dwReq > (dwSize / sizeof(WCHAR))) { ! DebugEvent0("Overflow while expanding environment strings."); goto doneLogonScript; } } *************** *** 558,566 **** --- 573,585 ---- if(wcsstr(regscript, L"%s")) { dwSize += (DWORD)(len * sizeof(WCHAR)); /* make room for username expansion */ regexuscript = (WCHAR *) LocalAlloc(LMEM_FIXED, dwSize); + if (!regexuscript) + goto doneLogonScript; hr = StringCbPrintfW(regexuscript, dwSize, regscript, wuname); } else { regexuscript = (WCHAR *) LocalAlloc(LMEM_FIXED, dwSize); + if (!regexuscript) + goto doneLogonScript; hr = StringCbCopyW(regexuscript, dwSize, regscript); } *************** *** 577,621 **** if(regexscript) free(regexscript); } ! DebugEvent("Looking up TheseCells"); ! /* Logon script */ /* First find out where the key is */ hkTemp = NULL; rv = ~ERROR_SUCCESS; ! dwType = 0; if (hkDom) rv = RegQueryValueEx(hkDom, REG_CLIENT_THESE_CELLS_PARM, 0, &dwType, NULL, &dwSize); if (rv == ERROR_SUCCESS && dwType == REG_MULTI_SZ) { hkTemp = hkDom; ! DebugEvent("Located TheseCells in hkDom"); ! } else if (hkDoms) rv = RegQueryValueEx(hkDoms, REG_CLIENT_THESE_CELLS_PARM, 0, &dwType, NULL, &dwSize); ! if (rv == ERROR_SUCCESS && !hkTemp && dwType == REG_MULTI_SZ) { ! hkTemp = hkDoms; ! DebugEvent("Located TheseCells in hkDoms"); ! } else if (hkNp) ! rv = RegQueryValueEx(hkNp, REG_CLIENT_THESE_CELLS_PARM, 0, &dwType, NULL, &dwSize); ! if (rv == ERROR_SUCCESS && !hkTemp && dwType == REG_MULTI_SZ) { ! hkTemp = hkNp; ! DebugEvent("Located TheseCells in hkNp"); } if (hkTemp) { ! CHAR * thesecells; /* dwSize still has the size of the required buffer in bytes. */ ! thesecells = malloc(dwSize); ! rv = RegQueryValueEx(hkTemp, REG_CLIENT_THESE_CELLS_PARM, 0, &dwType, (LPBYTE) thesecells, &dwSize); if(rv != ERROR_SUCCESS) {/* what the ..? */ ! DebugEvent("Can't look up TheseCells [%d]",rv); goto doneTheseCells; } DebugEvent("Found TheseCells [%s]", thesecells); opt->theseCells = thesecells; doneTheseCells: ! ; } cleanup: --- 596,695 ---- if(regexscript) free(regexscript); } ! DebugEvent0("Looking up TheseCells"); ! /* TheseCells */ /* First find out where the key is */ hkTemp = NULL; rv = ~ERROR_SUCCESS; ! dwSize = 0; if (hkDom) rv = RegQueryValueEx(hkDom, REG_CLIENT_THESE_CELLS_PARM, 0, &dwType, NULL, &dwSize); if (rv == ERROR_SUCCESS && dwType == REG_MULTI_SZ) { hkTemp = hkDom; ! DebugEvent("Located TheseCells in hkDom size %d", dwSize); ! } else if (hkDoms) { rv = RegQueryValueEx(hkDoms, REG_CLIENT_THESE_CELLS_PARM, 0, &dwType, NULL, &dwSize); ! if (rv == ERROR_SUCCESS && !hkTemp && dwType == REG_MULTI_SZ) { ! hkTemp = hkDoms; ! DebugEvent("Located TheseCells in hkDoms size %d", dwSize); ! } else if (hkNp) { ! rv = RegQueryValueEx(hkNp, REG_CLIENT_THESE_CELLS_PARM, 0, &dwType, NULL, &dwSize); ! if (rv == ERROR_SUCCESS && !hkTemp && dwType == REG_MULTI_SZ) { ! hkTemp = hkNp; ! DebugEvent("Located TheseCells in hkNp size %d", dwSize); ! } ! } } if (hkTemp) { ! CHAR * thesecells = NULL; /* dwSize still has the size of the required buffer in bytes. */ ! thesecells = malloc(dwSize*2); ! if (!thesecells) ! goto doneTheseCells; ! dwSize *= 2; ! SetLastError(0); ! rv = RegQueryValueEx(hkTemp, REG_CLIENT_THESE_CELLS_PARM, 0, NULL, (LPBYTE) thesecells, &dwSize); if(rv != ERROR_SUCCESS) {/* what the ..? */ ! DebugEvent("Can't look up TheseCells rv [%d] size [%d] gle [%d]",rv, dwSize, GetLastError()); goto doneTheseCells; } DebugEvent("Found TheseCells [%s]", thesecells); opt->theseCells = thesecells; + thesecells = NULL; doneTheseCells: ! if (thesecells) free(thesecells); ! } ! ! DebugEvent0("Looking up Realm"); ! /* Realm */ ! /* First find out where the key is */ ! hkTemp = NULL; ! rv = ~ERROR_SUCCESS; ! dwSize = 0; ! if (hkDom) ! rv = RegQueryValueEx(hkDom, REG_CLIENT_REALM_PARM, 0, &dwType, NULL, &dwSize); ! if (rv == ERROR_SUCCESS && dwType == REG_SZ) { ! hkTemp = hkDom; ! DebugEvent("Located Realm in hkDom size %d", dwSize); ! } else if (hkDoms) { ! rv = RegQueryValueEx(hkDoms, REG_CLIENT_REALM_PARM, 0, &dwType, NULL, &dwSize); ! if (rv == ERROR_SUCCESS && !hkTemp && dwType == REG_SZ) { ! hkTemp = hkDoms; ! DebugEvent("Located Realm in hkDoms size %d", dwSize); ! } else if (hkNp) { ! rv = RegQueryValueEx(hkNp, REG_CLIENT_REALM_PARM, 0, &dwType, NULL, &dwSize); ! if (rv == ERROR_SUCCESS && !hkTemp && dwType == REG_SZ) { ! hkTemp = hkNp; ! DebugEvent("Located Realm in hkNp size %d", dwSize); ! } ! } ! } ! ! if (hkTemp) { ! CHAR * realm = NULL; ! ! /* dwSize still has the size of the required buffer in bytes. */ ! realm = malloc(dwSize*2); ! if (!realm) ! goto doneRealm; ! dwSize *=2; ! SetLastError(0); ! rv = RegQueryValueEx(hkTemp, REG_CLIENT_REALM_PARM, 0, NULL, (LPBYTE) realm, &dwSize); ! if(rv != ERROR_SUCCESS) {/* what the ..? */ ! DebugEvent("Can't look up Realm rv [%d] size [%d] gle [%d]",rv, dwSize, GetLastError()); ! goto doneRealm; ! } ! ! DebugEvent("Found Realm [%s]", realm); ! opt->realm = realm; ! realm = NULL; ! ! doneRealm: ! if (realm) free(realm); } cleanup: *************** *** 716,722 **** int sleepInterval; /* Are we interactive? */ ! interactive = (wcscmp(lpStationName, L"WinSta0") == 0); #ifdef DISABLE_NON_INTERACTIVE /* Do not do anything if the logon session is not interactive. */ --- 790,796 ---- int sleepInterval; /* Are we interactive? */ ! interactive = (wcsicmp(lpStationName, L"WinSta0") == 0); #ifdef DISABLE_NON_INTERACTIVE /* Do not do anything if the logon session is not interactive. */ *************** *** 743,750 **** /* MSV1_0_INTERACTIVE_LOGON and KERB_INTERACTIVE_LOGON are equivalent for * our purposes */ ! if ( wcscmp(lpAuthentInfoType,L"MSV1_0:Interactive") && ! wcscmp(lpAuthentInfoType,L"Kerberos:Interactive") ) { DebugEvent("Unsupported Authentication Info Type: %S", lpAuthentInfoType); --- 817,824 ---- /* MSV1_0_INTERACTIVE_LOGON and KERB_INTERACTIVE_LOGON are equivalent for * our purposes */ ! if ( wcsicmp(lpAuthentInfoType,L"MSV1_0:Interactive") && ! wcsicmp(lpAuthentInfoType,L"Kerberos:Interactive") ) { DebugEvent("Unsupported Authentication Info Type: %S", lpAuthentInfoType); *************** *** 795,801 **** /* Check for zero length password if integrated logon*/ if ( ISLOGONINTEGRATED(opt.LogonOption) ) { if ( password[0] == 0 ) { ! DebugEvent("Password is the empty string"); code = GT_PW_NULL; reason = "zero length password is illegal"; code=0; --- 869,875 ---- /* Check for zero length password if integrated logon*/ if ( ISLOGONINTEGRATED(opt.LogonOption) ) { if ( password[0] == 0 ) { ! DebugEvent0("Password is the empty string"); code = GT_PW_NULL; reason = "zero length password is illegal"; code=0; *************** *** 807,813 **** DebugEvent("About to call cm_GetRootCellName(%s)",cell); code = cm_GetRootCellName(cell); if (code < 0) { ! DebugEvent("Unable to obtain Root Cell"); code = KTC_NOCELL; reason = "unknown cell"; code=0; --- 881,887 ---- DebugEvent("About to call cm_GetRootCellName(%s)",cell); code = cm_GetRootCellName(cell); if (code < 0) { ! DebugEvent0("Unable to obtain Root Cell"); code = KTC_NOCELL; reason = "unknown cell"; code=0; *************** *** 819,825 **** cell right away because the client service may not have started yet. This call also sets the AD_REALM flag in opt.flags if applicable. */ if (ISREMOTE(opt.flags)) { ! DebugEvent("Is Remote"); GetAdHomePath(homePath,MAX_PATH,lpLogonId,&opt); } } --- 893,899 ---- cell right away because the client service may not have started yet. This call also sets the AD_REALM flag in opt.flags if applicable. */ if (ISREMOTE(opt.flags)) { ! DebugEvent0("Is Remote"); GetAdHomePath(homePath,MAX_PATH,lpLogonId,&opt); } } *************** *** 846,860 **** { if ( KFW_is_available() ) { SetEnvironmentVariable(DO_NOT_REGISTER_VARNAME, ""); ! code = KFW_AFS_get_cred(uname, cell, password, 0, opt.smbName, &reason); SetEnvironmentVariable(DO_NOT_REGISTER_VARNAME, NULL); - DebugEvent("KFW_AFS_get_cred uname=[%s] smbname=[%s] cell=[%s] code=[%d]", - uname,opt.smbName,cell,code); if (code == 0 && opt.theseCells) { char * principal, *p; size_t len, tlen; ! StringCchLength(cell, MAX_DOMAIN_LENGTH, &tlen); len = tlen; StringCchLength(uname, MAX_USERNAME_LENGTH, &tlen); len += tlen + 2; --- 920,957 ---- { if ( KFW_is_available() ) { SetEnvironmentVariable(DO_NOT_REGISTER_VARNAME, ""); ! if (opt.realm) { ! char * principal, *p; ! size_t len, tlen; ! ! StringCchLength(opt.realm, MAX_DOMAIN_LENGTH, &tlen); ! len = tlen; ! StringCchLength(uname, MAX_USERNAME_LENGTH, &tlen); ! len += tlen + 2; ! ! /* tlen is now the length of uname in characters */ ! principal = (char *)malloc(len * sizeof(char)); ! if ( principal ) { ! StringCchCopy(principal, len, uname); ! p = principal + tlen; ! *p++ = '@'; ! StringCchCopy(p, len - tlen -1, opt.realm); ! code = KFW_AFS_get_cred(principal, cell, password, 0, opt.smbName, &reason); ! DebugEvent("KFW_AFS_get_cred uname=[%s] smbname=[%s] cell=[%s] code=[%d]", ! principal,opt.smbName,cell,code); ! free(principal); ! } ! } else { ! code = KFW_AFS_get_cred(uname, cell, password, 0, opt.smbName, &reason); ! DebugEvent("KFW_AFS_get_cred uname=[%s] smbname=[%s] cell=[%s] code=[%d]", ! uname,opt.smbName,cell,code); ! } SetEnvironmentVariable(DO_NOT_REGISTER_VARNAME, NULL); if (code == 0 && opt.theseCells) { char * principal, *p; size_t len, tlen; ! StringCchLength(opt.realm ? opt.realm : cell, MAX_DOMAIN_LENGTH, &tlen); len = tlen; StringCchLength(uname, MAX_USERNAME_LENGTH, &tlen); len += tlen + 2; *************** *** 865,882 **** StringCchCopy(principal, len, uname); p = principal + tlen; *p++ = '@'; ! StringCchCopy(p, len - tlen - 1, cell); ! for ( ;*p; p++) { ! *p = toupper(*p); ! } ! p = opt.theseCells; while ( *p ) { ! SetEnvironmentVariable(DO_NOT_REGISTER_VARNAME, ""); ! code2 = KFW_AFS_get_cred(principal, p, 0, 0, opt.smbName, &reason); ! SetEnvironmentVariable(DO_NOT_REGISTER_VARNAME, NULL); ! DebugEvent("KFW_AFS_get_cred uname=[%s] smbname=[%s] cell=[%s] code=[%d]", ! principal,opt.smbName,p,code2); p += strlen(p) + 1; } free(principal); --- 962,984 ---- StringCchCopy(principal, len, uname); p = principal + tlen; *p++ = '@'; ! if (opt.realm) { ! StringCchCopy(p, len - tlen -1, opt.realm); ! } else { ! StringCchCopy(p, len - tlen - 1, cell); ! for ( ;*p; p++) { ! *p = toupper(*p); ! } ! } p = opt.theseCells; while ( *p ) { ! if ( stricmp(p, cell) ) { ! SetEnvironmentVariable(DO_NOT_REGISTER_VARNAME, ""); ! code2 = KFW_AFS_get_cred(principal, p, 0, 0, opt.smbName, &reason); ! SetEnvironmentVariable(DO_NOT_REGISTER_VARNAME, NULL); ! DebugEvent("KFW_AFS_get_cred uname=[%s] smbname=[%s] cell=[%s] code=[%d]", ! principal,opt.smbName,p,code2); ! } p += strlen(p) + 1; } free(principal); *************** *** 941,947 **** retryInterval -= sleepInterval; } } ! DebugEvent("while loop exited"); /* remove any kerberos 5 tickets currently held by the SYSTEM account * for this user --- 1043,1049 ---- retryInterval -= sleepInterval; } } ! DebugEvent0("while loop exited"); /* remove any kerberos 5 tickets currently held by the SYSTEM account * for this user *************** *** 986,991 **** --- 1088,1094 ---- if (opt.theseCells) free(opt.theseCells); if (opt.smbName) free(opt.smbName); + if (opt.realm) free(opt.realm); DebugEvent("AFS AfsLogon - Exit","Return Code[%x]",code); return code; *************** *** 1003,1009 **** BOOLEAN interactive; /* Are we interactive? */ ! interactive = (wcscmp(lpStationName, L"WinSta0") == 0); /* Do not do anything if the logon session is not interactive. */ if (!interactive) --- 1106,1112 ---- BOOLEAN interactive; /* Are we interactive? */ ! interactive = (wcsicmp(lpStationName, L"WinSta0") == 0); /* Do not do anything if the logon session is not interactive. */ if (!interactive) Index: openafs/src/WINNT/afsd/afslogon.h diff -c openafs/src/WINNT/afsd/afslogon.h:1.9.4.3 openafs/src/WINNT/afsd/afslogon.h:1.9.4.4 *** openafs/src/WINNT/afsd/afslogon.h:1.9.4.3 Tue Apr 3 10:50:40 2007 --- openafs/src/WINNT/afsd/afslogon.h Fri Apr 6 12:56:53 2007 *************** *** 45,50 **** --- 45,51 ---- #define REG_CLIENT_TRACE_OPTION_PARM "TraceOption" #define REG_CLIENT_LOGON_OPTION_PARM "LogonOptions" #define REG_CLIENT_LOGON_SCRIPT_PARMW L"LogonScript" + #define REG_CLIENT_REALM_PARM "Realm" #define REG_CLIENT_THESE_CELLS_PARM "TheseCells" #define REG_CLIENT_LOGOFF_TOKENS_PARM "LogoffPreserveTokens" #define DEFAULT_RETRY_INTERVAL 60 /* seconds*/ *************** *** 76,81 **** --- 77,83 ---- LPWSTR logonScript; DWORD flags; /* LOGON_FLAG_* */ char * theseCells; + char * realm; } LogonOptions_t; /* */ Index: openafs/src/WINNT/afsd/cklog.c diff -c openafs/src/WINNT/afsd/cklog.c:1.4 openafs/src/WINNT/afsd/cklog.c:1.4.4.1 *** openafs/src/WINNT/afsd/cklog.c:1.4 Sat Nov 5 01:47:46 2005 --- openafs/src/WINNT/afsd/cklog.c Tue Apr 10 14:39:48 2007 *************** *** 311,317 **** code = krb_write_ticket_file (realm); if (!Silent) { if (code) ! com_err (rn, code, "writing Kerberos ticket file"); else fprintf (stderr, "Wrote ticket file to /tmp\n"); } } --- 311,317 ---- code = krb_write_ticket_file (realm); if (!Silent) { if (code) ! afs_com_err (rn, code, "writing Kerberos ticket file"); else fprintf (stderr, "Wrote ticket file to /tmp\n"); } } Index: openafs/src/WINNT/afsd/cm_conn.c diff -c openafs/src/WINNT/afsd/cm_conn.c:1.49.2.12 openafs/src/WINNT/afsd/cm_conn.c:1.49.2.13 *** openafs/src/WINNT/afsd/cm_conn.c:1.49.2.12 Sat Mar 10 10:50:07 2007 --- openafs/src/WINNT/afsd/cm_conn.c Sat Apr 14 14:49:36 2007 *************** *** 642,649 **** #endif /* DJGPP */ if (serversp == NULL) { ! osi_Log1(afsd_logp, "cm_ConnByMServers returning 0x%x", CM_ERROR_NOSUCHVOLUME); ! return CM_ERROR_NOSUCHVOLUME; } *connpp = NULL; --- 642,649 ---- #endif /* DJGPP */ if (serversp == NULL) { ! osi_Log1(afsd_logp, "cm_ConnByMServers returning 0x%x", CM_ERROR_ALLDOWN); ! return CM_ERROR_ALLDOWN; } *connpp = NULL; Index: openafs/src/WINNT/afsd/cm_ioctl.c diff -c openafs/src/WINNT/afsd/cm_ioctl.c:1.73.2.11 openafs/src/WINNT/afsd/cm_ioctl.c:1.73.2.12 *** openafs/src/WINNT/afsd/cm_ioctl.c:1.73.2.11 Sat Mar 24 01:00:39 2007 --- openafs/src/WINNT/afsd/cm_ioctl.c Sat Apr 14 14:49:36 2007 *************** *** 2768,2770 **** --- 2768,2863 ---- return 0; } + + + static long + cm_CheckServersStatus(cm_serverRef_t *serversp) + { + long code = 0; + cm_serverRef_t *tsrp; + cm_server_t *tsp; + int someBusy = 0, someOffline = 0, allOffline = 1, allBusy = 1, allDown = 1; + + if (serversp == NULL) { + osi_Log1(afsd_logp, "cm_CheckServersStatus returning 0x%x", CM_ERROR_ALLDOWN); + return CM_ERROR_ALLDOWN; + } + + lock_ObtainRead(&cm_serverLock); + for (tsrp = serversp; tsrp; tsrp=tsrp->next) { + if (tsp = tsrp->server) { + cm_GetServerNoLock(tsp); + lock_ReleaseRead(&cm_serverLock); + if (!(tsp->flags & CM_SERVERFLAG_DOWN)) { + allDown = 0; + if (tsrp->status == busy) { + allOffline = 0; + someBusy = 1; + } else if (tsrp->status == offline) { + allBusy = 0; + someOffline = 1; + } else { + allOffline = 0; + allBusy = 0; + cm_PutServer(tsp); + goto done; + } + } + lock_ObtainRead(&cm_serverLock); + cm_PutServerNoLock(tsp); + } + } + lock_ReleaseRead(&cm_serverLock); + + if (allDown) + code = CM_ERROR_ALLDOWN; + else if (allBusy) + code = CM_ERROR_ALLBUSY; + else if (allOffline || (someBusy && someOffline)) + code = CM_ERROR_ALLOFFLINE; + + done: + osi_Log1(afsd_logp, "cm_CheckServersStatus returning 0x%x", code); + return code; + } + + + long cm_IoctlPathAvailability(struct smb_ioctl *ioctlp, struct cm_user *userp) + { + long code; + cm_scache_t *scp; + cm_cell_t *cellp; + cm_volume_t *tvp; + cm_serverRef_t **tsrpp; + unsigned long volume; + cm_req_t req; + + cm_InitReq(&req); + + code = cm_ParseIoctlPath(ioctlp, userp, &req, &scp); + if (code) + return code; + + volume = scp->fid.volume; + + cellp = cm_FindCellByID(scp->fid.cell); + + cm_ReleaseSCache(scp); + + if (!cellp) + return CM_ERROR_NOSUCHCELL; + + code = cm_GetVolumeByID(cellp, volume, userp, &req, &tvp); + if (code) + return code; + + lock_ObtainMutex(&tvp->mx); + tsrpp = cm_GetVolServers(tvp, volume); + code = cm_CheckServersStatus(*tsrpp); + cm_FreeServerList(tsrpp); + lock_ReleaseMutex(&tvp->mx); + cm_PutVolume(tvp); + return 0; + } + + Index: openafs/src/WINNT/afsd/cm_ioctl.h diff -c openafs/src/WINNT/afsd/cm_ioctl.h:1.14.2.1 openafs/src/WINNT/afsd/cm_ioctl.h:1.14.2.2 *** openafs/src/WINNT/afsd/cm_ioctl.h:1.14.2.1 Tue Jun 27 18:19:35 2006 --- openafs/src/WINNT/afsd/cm_ioctl.h Sat Apr 14 14:49:36 2007 *************** *** 164,169 **** --- 164,171 ---- extern long cm_IoctlUUIDControl(struct smb_ioctl * ioctlp, struct cm_user *userp); + extern long cm_IoctlPathAvailability(struct smb_ioctl * ioctlp, struct cm_user *userp); + #endif /* __CM_IOCTL_INTERFACES_ONLY__ */ #endif /* __CM_IOCTL_H_ENV__ */ Index: openafs/src/WINNT/afsd/fs.c diff -c openafs/src/WINNT/afsd/fs.c:1.32.4.6 openafs/src/WINNT/afsd/fs.c:1.32.4.8 *** openafs/src/WINNT/afsd/fs.c:1.32.4.6 Fri Mar 2 20:32:06 2007 --- openafs/src/WINNT/afsd/fs.c Sat Apr 14 14:49:36 2007 *************** *** 600,606 **** static int PrintStatus(VolumeStatus *status, char *name, char *motd, char *offmsg) { ! printf("Volume status for vid = %u named %s\n",status->Vid, name); if (*offmsg != 0) printf("Current offline message is %s\n",offmsg); if (*motd != 0) --- 600,606 ---- static int PrintStatus(VolumeStatus *status, char *name, char *motd, char *offmsg) { ! printf("Volume status for vid = %u named %s is\n",status->Vid, name); if (*offmsg != 0) printf("Current offline message is %s\n",offmsg); if (*motd != 0) *************** *** 611,617 **** else printf("unlimited\n"); printf("Current blocks used are %d\n",status->BlocksInUse); ! printf("The partition has %d blocks available out of %d\n\n", status->PartBlocksAvail, status->PartMaxBlocks); return 0; } --- 611,617 ---- else printf("unlimited\n"); printf("Current blocks used are %d\n",status->BlocksInUse); ! printf("The partition has %d blocks available out of %d\n", status->PartBlocksAvail, status->PartMaxBlocks); return 0; } *************** *** 1489,1494 **** --- 1489,1495 ---- struct cmd_item *ti; struct VolumeStatus *status; char *name, *offmsg, *motd; + long online_state; int error = 0; SetDotDefault(&as->parms[0].items); *************** *** 1525,1545 **** pr_SIdToName(owner[0], oname); printf("Owner %s (%u) Group %u\n", oname, owner[0], owner[1]); } ! blob.out = space; blob.out_size = MAXSIZE; code = pioctl(ti->data, VIOCGETVOLSTAT, &blob, 1); ! if (code) { ! Die(errno, ti->data); ! error = 1; ! continue; ! } ! status = (VolumeStatus *)space; ! name = (char *)status + sizeof(*status); ! offmsg = name + strlen(name) + 1; ! motd = offmsg + strlen(offmsg) + 1; ! PrintStatus(status, name, motd, offmsg); } return error; } --- 1526,1563 ---- pr_SIdToName(owner[0], oname); printf("Owner %s (%u) Group %u\n", oname, owner[0], owner[1]); } ! blob.out = space; blob.out_size = MAXSIZE; code = pioctl(ti->data, VIOCGETVOLSTAT, &blob, 1); ! if (code == 0) { ! status = (VolumeStatus *)space; ! name = (char *)status + sizeof(*status); ! offmsg = name + strlen(name) + 1; ! motd = offmsg + strlen(offmsg) + 1; ! PrintStatus(status, name, motd, offmsg); ! } else { ! Die(errno, ti->data); ! } ! online_state = pioctl(ti->data, VIOC_PATH_AVAILABILITY, &blob, 1); ! switch (online_state) { ! case 0: ! printf("Volume is online\n"); ! break; ! case CM_ERROR_ALLOFFLINE: ! printf("Volume offline\n"); ! break; ! case CM_ERROR_ALLDOWN: ! printf("All Volume servers are down\n"); ! break; ! case CM_ERROR_ALLBUSY: ! printf("All volume servers are busy\n"); ! break; ! default: ! Die(online_state, ti->data); ! } ! printf("\n"); } return error; } *************** *** 4645,4651 **** #ifdef WIN32 fprintf(stderr, ": code 0x%x\n", code); #else /* not WIN32 */ ! fprintf(stderr,": %s\n", error_message(code)); #endif /* not WIN32 */ } } /*Die*/ --- 4663,4669 ---- #ifdef WIN32 fprintf(stderr, ": code 0x%x\n", code); #else /* not WIN32 */ ! fprintf(stderr,": %s\n", afs_error_message(code)); #endif /* not WIN32 */ } } /*Die*/ Index: openafs/src/WINNT/afsd/smb_iocons.h diff -c openafs/src/WINNT/afsd/smb_iocons.h:1.10.4.2 openafs/src/WINNT/afsd/smb_iocons.h:1.10.4.3 *** openafs/src/WINNT/afsd/smb_iocons.h:1.10.4.2 Thu Jul 20 17:46:19 2006 --- openafs/src/WINNT/afsd/smb_iocons.h Sat Apr 14 14:49:36 2007 *************** *** 97,100 **** --- 97,101 ---- #define VIOC_RXSTAT_PROC 0x2e #define VIOC_RXSTAT_PEER 0x2f #define VIOC_UUIDCTL 0x30 + #define VIOC_PATH_AVAILABILITY 0x31 #endif /* __SMB_IOCONS_H_ENV_ */ Index: openafs/src/WINNT/afsd/smb_ioctl.c diff -c openafs/src/WINNT/afsd/smb_ioctl.c:1.25.2.3 openafs/src/WINNT/afsd/smb_ioctl.c:1.25.2.4 *** openafs/src/WINNT/afsd/smb_ioctl.c:1.25.2.3 Thu Jul 20 17:46:19 2006 --- openafs/src/WINNT/afsd/smb_ioctl.c Sat Apr 14 14:49:36 2007 *************** *** 84,89 **** --- 84,90 ---- smb_ioctlProcsp[VIOC_RXSTAT_PROC] = cm_IoctlRxStatProcess; smb_ioctlProcsp[VIOC_RXSTAT_PEER] = cm_IoctlRxStatPeer; smb_ioctlProcsp[VIOC_UUIDCTL] = cm_IoctlUUIDControl; + smb_ioctlProcsp[VIOC_PATH_AVAILABILITY] = cm_IoctlPathAvailability; } /* called to make a fid structure into an IOCTL fid structure */ Index: openafs/src/WINNT/afsd/symlink.c diff -c openafs/src/WINNT/afsd/symlink.c:1.8 openafs/src/WINNT/afsd/symlink.c:1.8.4.1 *** openafs/src/WINNT/afsd/symlink.c:1.8 Sat Nov 5 01:47:48 2005 --- openafs/src/WINNT/afsd/symlink.c Tue Apr 10 14:39:48 2007 *************** *** 652,658 **** #ifdef WIN32 fprintf(stderr, ": code 0x%x\n", code); #else /* not WIN32 */ ! fprintf(stderr,": %s\n", error_message(code)); #endif /* not WIN32 */ } } /*Die*/ --- 652,658 ---- #ifdef WIN32 fprintf(stderr, ": code 0x%x\n", code); #else /* not WIN32 */ ! fprintf(stderr,": %s\n", afs_error_message(code)); #endif /* not WIN32 */ } } /*Die*/ Index: openafs/src/WINNT/afsd/sample/token.c diff -c openafs/src/WINNT/afsd/sample/token.c:1.3 openafs/src/WINNT/afsd/sample/token.c:1.3.14.1 *** openafs/src/WINNT/afsd/sample/token.c:1.3 Fri Nov 21 02:59:45 2003 --- openafs/src/WINNT/afsd/sample/token.c Tue Apr 10 14:39:48 2007 *************** *** 276,282 **** code = krb_write_ticket_file (realm); if (!Silent) { if (code) ! com_err (rn, code, "writing Kerberos ticket file"); else fprintf (stderr, "Wrote ticket file to /tmp\n"); } } --- 276,282 ---- code = krb_write_ticket_file (realm); if (!Silent) { if (code) ! afs_com_err (rn, code, "writing Kerberos ticket file"); else fprintf (stderr, "Wrote ticket file to /tmp\n"); } } Index: openafs/src/WINNT/afsreg/test/regman.c diff -c openafs/src/WINNT/afsreg/test/regman.c:1.3 openafs/src/WINNT/afsreg/test/regman.c:1.3.20.1 *** openafs/src/WINNT/afsreg/test/regman.c:1.3 Tue Sep 18 00:26:55 2001 --- openafs/src/WINNT/afsreg/test/regman.c Tue Apr 10 14:39:49 2007 *************** *** 60,71 **** vpDev = as->parms[1].items->data; if (!vpt_PartitionNameValid(vpName)) { ! com_err(whoami, 0, "Partition name invalid"); return 1; } if (!vpt_DeviceNameValid(vpDev)) { ! com_err(whoami, 0, "Device name invalid"); return 1; } --- 60,71 ---- vpDev = as->parms[1].items->data; if (!vpt_PartitionNameValid(vpName)) { ! afs_com_err(whoami, 0, "Partition name invalid"); return 1; } if (!vpt_DeviceNameValid(vpDev)) { ! afs_com_err(whoami, 0, "Device name invalid"); return 1; } *************** *** 73,79 **** strcpy(vpentry.vp_dev, vpDev); if (vpt_AddEntry(&vpentry)) { ! com_err(whoami, 0, "Unable to create vice partition table entry"); return 1; } return 0; --- 73,79 ---- strcpy(vpentry.vp_dev, vpDev); if (vpt_AddEntry(&vpentry)) { ! afs_com_err(whoami, 0, "Unable to create vice partition table entry"); return 1; } return 0; *************** *** 86,97 **** vpName = as->parms[0].items->data; if (!vpt_PartitionNameValid(vpName)) { ! com_err(whoami, 0, "Partition name invalid"); return 1; } if (vpt_RemoveEntry(vpName) && errno != ENOENT) { ! com_err(whoami, 0, "Unable to remove vice partition table entry"); return 1; } return 0; --- 86,97 ---- vpName = as->parms[0].items->data; if (!vpt_PartitionNameValid(vpName)) { ! afs_com_err(whoami, 0, "Partition name invalid"); return 1; } if (vpt_RemoveEntry(vpName) && errno != ENOENT) { ! afs_com_err(whoami, 0, "Unable to remove vice partition table entry"); return 1; } return 0; *************** *** 103,109 **** char *buf; if (afssw_GetServerInstallDir(&buf)) { ! com_err(whoami, 0, "Failed reading AFS install dir entry (or does not exist)"); return 1; } --- 103,109 ---- char *buf; if (afssw_GetServerInstallDir(&buf)) { ! afs_com_err(whoami, 0, "Failed reading AFS install dir entry (or does not exist)"); return 1; } *************** *** 136,142 **** } if (status) { ! com_err(whoami, 0, "Unable to set AFS installation directory entry"); } return (status ? 1 : 0); --- 136,142 ---- } if (status) { ! afs_com_err(whoami, 0, "Unable to set AFS installation directory entry"); } return (status ? 1 : 0); *************** *** 157,163 **** char *dirBuf; if (afssw_GetServerInstallDir(&dirBuf)) { ! com_err(whoami, 0, "binary path not specified and AFS server installation directory not set"); return 1; } --- 157,163 ---- char *dirBuf; if (afssw_GetServerInstallDir(&dirBuf)) { ! afs_com_err(whoami, 0, "binary path not specified and AFS server installation directory not set"); return 1; } *************** *** 177,183 **** if (status == ERROR_ACCESS_DENIED) { reason = "(insufficient privilege)"; } ! com_err(whoami, 0, "unable to connect to the SCM %s", reason); return 1; } --- 177,183 ---- if (status == ERROR_ACCESS_DENIED) { reason = "(insufficient privilege)"; } ! afs_com_err(whoami, 0, "unable to connect to the SCM %s", reason); return 1; } *************** *** 202,208 **** if (status == ERROR_SERVICE_EXISTS || status == ERROR_DUP_NAME) { reason = "(service or display name already exists)"; } ! com_err(whoami, 0, "unable to create service %s", reason); CloseServiceHandle(scmHandle); return 1; } --- 202,208 ---- if (status == ERROR_SERVICE_EXISTS || status == ERROR_DUP_NAME) { reason = "(service or display name already exists)"; } ! afs_com_err(whoami, 0, "unable to create service %s", reason); CloseServiceHandle(scmHandle); return 1; } *************** *** 227,233 **** if (status == ERROR_ACCESS_DENIED) { reason = "(insufficient privilege)"; } ! com_err(whoami, 0, "unable to connect to the SCM %s", reason); return 1; } --- 227,233 ---- if (status == ERROR_ACCESS_DENIED) { reason = "(insufficient privilege)"; } ! afs_com_err(whoami, 0, "unable to connect to the SCM %s", reason); return 1; } *************** *** 238,244 **** DWORD status = GetLastError(); if (status != ERROR_SERVICE_DOES_NOT_EXIST) { ! com_err(whoami, 0, "unable to open service"); rc = 1; } CloseServiceHandle(scmHandle); --- 238,244 ---- DWORD status = GetLastError(); if (status != ERROR_SERVICE_DOES_NOT_EXIST) { ! afs_com_err(whoami, 0, "unable to open service"); rc = 1; } CloseServiceHandle(scmHandle); *************** *** 249,255 **** DWORD status = GetLastError(); if (status != ERROR_SERVICE_MARKED_FOR_DELETE) { ! com_err(whoami, 0, "service delete failed"); rc = 1; } } --- 249,255 ---- DWORD status = GetLastError(); if (status != ERROR_SERVICE_MARKED_FOR_DELETE) { ! afs_com_err(whoami, 0, "service delete failed"); rc = 1; } } Index: openafs/src/WINNT/aklog/NTMakefile diff -c openafs/src/WINNT/aklog/NTMakefile:1.4.4.1 openafs/src/WINNT/aklog/NTMakefile:1.4.4.2 *** openafs/src/WINNT/aklog/NTMakefile:1.4.4.1 Sun Jun 25 13:58:06 2006 --- openafs/src/WINNT/aklog/NTMakefile Tue Apr 10 14:39:49 2007 *************** *** 28,35 **** EXELIBS = \ $(DESTDIR)\lib\afs\afspioctl.lib \ ! $(DESTDIR)\lib\afsauthent.lib \ ! $(DESTDIR)\lib\afs\afskauth.lib !IF "$(CPU)" == "IA64" || "$(CPU)" == "AMD64" || "$(CPU)" == "ALPHA64" OTHERLIBS = \ --- 28,37 ---- EXELIBS = \ $(DESTDIR)\lib\afs\afspioctl.lib \ ! $(DESTDIR)\lib\afsauthent.lib \ ! $(DESTDIR)\lib\afs\afskauth.lib \ ! $(DESTDIR)\lib\afs\afscom_err.lib \ ! $(DESTDIR)\lib\afs\afsutil.lib !IF "$(CPU)" == "IA64" || "$(CPU)" == "AMD64" || "$(CPU)" == "ALPHA64" OTHERLIBS = \ Index: openafs/src/WINNT/aklog/aklog.c diff -c openafs/src/WINNT/aklog/aklog.c:1.14.4.2 openafs/src/WINNT/aklog/aklog.c:1.14.4.3 *** openafs/src/WINNT/aklog/aklog.c:1.14.4.2 Fri Feb 9 12:30:33 2007 --- openafs/src/WINNT/aklog/aklog.c Wed Apr 4 16:26:10 2007 *************** *** 183,188 **** --- 183,189 ---- { static char lastcell[MAXCELLCHARS+1] = { 0 }; static char confname[512] = { 0 }; + char username_copy[BUFSIZ]; afs_int32 viceId; /* AFS uid of user */ #ifdef ALLOW_REGISTER afs_int32 id; *************** *** 247,252 **** --- 248,254 ---- } #ifdef ALLOW_REGISTER } else if (strcmp(realm_of_user, realm_of_cell) != 0) { + int i; if (dflag) { printf("doing first-time registration of %s " "at %s\n", username, cell_to_use); *************** *** 255,260 **** --- 257,268 ---- strncpy(aclient->name, username, MAXKTCNAMELEN - 1); strcpy(aclient->instance, ""); strncpy(aclient->cell, c->realm, MAXKTCREALMLEN - 1); + + for ( i=0; aclient->cell[i]; i++ ) { + if ( islower(aclient->cell[i]) ) + aclient->cell[i] = toupper(aclient->cell[i]); + } + if ((*status = ktc_SetToken(aserver, atoken, aclient, 0))) { printf("%s: unable to obtain tokens for cell %s " "(status: %d).\n", progname, cell_to_use, status); *************** *** 274,280 **** return; } ! if ((*status = pr_CreateUser(username, &id))) { printf("%s: unable to create remote PTS " "user %s in cell %s (status: %d).\n", progname, username, cell_to_use, *status); --- 282,296 ---- return; } ! /* copy the name because pr_CreateUser lowercases the realm */ ! strncpy(username_copy, username, BUFSIZ); ! ! *status = pr_CreateUser(username, &id); ! ! /* and restore the name to the original state */ ! strncpy(username, username_copy, BUFSIZ); ! ! if (*status) { printf("%s: unable to create remote PTS " "user %s in cell %s (status: %d).\n", progname, username, cell_to_use, *status); *************** *** 282,288 **** printf("created cross-cell entry for %s (Id %d) at %s\n", username, viceId, cell_to_use); #ifdef AFS_ID_TO_NAME - strncpy(username_copy, username, BUFSIZ); snprintf (username, BUFSIZ, "%s (AFS ID %d)", username_copy, (int) viceId); #endif /* AFS_ID_TO_NAME */ } --- 298,303 ---- *************** *** 555,564 **** static int auth_to_cell(krb5_context context, char *cell, char *realm) { int status = AKLOG_SUCCESS; ! char username[BUFSIZ]; /* To hold client username structure */ ! char name[ANAME_SZ]; /* Name of afs key */ ! char instance[INST_SZ]; /* Instance of afs key */ char realm_of_user[REALM_SZ]; /* Kerberos realm of user */ char realm_of_cell[REALM_SZ]; /* Kerberos realm of cell */ char local_cell[MAXCELLCHARS+1]; --- 570,579 ---- static int auth_to_cell(krb5_context context, char *cell, char *realm) { int status = AKLOG_SUCCESS; ! char username[BUFSIZ]; /* To hold client username structure */ ! char name[ANAME_SZ]; /* Name of afs key */ ! char instance[INST_SZ]; /* Instance of afs key */ char realm_of_user[REALM_SZ]; /* Kerberos realm of user */ char realm_of_cell[REALM_SZ]; /* Kerberos realm of cell */ char local_cell[MAXCELLCHARS+1]; *************** *** 569,575 **** struct ktc_principal aserver; struct ktc_principal aclient; struct ktc_token atoken, btoken; ! /* try to avoid an expensive call to get_cellconfig */ if (cell && ll_string_check(&authedcells, cell)) --- 584,590 ---- struct ktc_principal aserver; struct ktc_principal aclient; struct ktc_token atoken, btoken; ! int i; /* try to avoid an expensive call to get_cellconfig */ if (cell && ll_string_check(&authedcells, cell)) *************** *** 806,811 **** --- 821,831 ---- } else strncpy(aclient.cell, c.realm, MAXKTCREALMLEN - 1); + for ( i=0; aclient.cell[i]; i++ ) { + if ( islower(aclient.cell[i]) ) + aclient.cell[i] = toupper(aclient.cell[i]); + } + if (dflag) printf("Getting tokens.\n"); if (status = ktc_SetToken(&aserver, &atoken, &aclient, 0)) Index: openafs/src/WINNT/aklog/asetkey.c diff -c openafs/src/WINNT/aklog/asetkey.c:1.1 openafs/src/WINNT/aklog/asetkey.c:1.1.6.1 *** openafs/src/WINNT/aklog/asetkey.c:1.1 Sun Jun 12 07:25:13 2005 --- openafs/src/WINNT/aklog/asetkey.c Tue Apr 10 14:39:49 2007 *************** *** 1,5 **** /* ! * $Id: asetkey.c,v 1.1 2005/06/12 11:25:13 jaltman Exp $ * * asetkey - Manipulates an AFS KeyFile * --- 1,5 ---- /* ! * $Id: asetkey.c,v 1.1.6.1 2007/04/10 18:39:49 shadow Exp $ * * asetkey - Manipulates an AFS KeyFile * *************** *** 17,22 **** --- 17,23 ---- #ifndef PRE_AFS35 #include #endif /* !PRE_AFS35 */ + #include int main(int argc, char **argv) *************** *** 61,73 **** kvno = atoi(argv[2]); retval = krb5_parse_name(context, argv[4], &principal); if (retval != 0) { ! com_err(argv[0], retval, "while parsing AFS principal"); exit(1); } retval = krb5_kt_read_service_key(context, argv[3], principal, kvno, ENCTYPE_DES_CBC_CRC, &key); if (retval != 0) { ! com_err(argv[0], retval, "while extracting AFS service key"); exit(1); } --- 62,74 ---- kvno = atoi(argv[2]); retval = krb5_parse_name(context, argv[4], &principal); if (retval != 0) { ! afs_com_err(argv[0], retval, "while parsing AFS principal"); exit(1); } retval = krb5_kt_read_service_key(context, argv[3], principal, kvno, ENCTYPE_DES_CBC_CRC, &key); if (retval != 0) { ! afs_com_err(argv[0], retval, "while extracting AFS service key"); exit(1); } Index: openafs/src/WINNT/doc/install/Documentation/en_US/html/index.htm diff -c openafs/src/WINNT/doc/install/Documentation/en_US/html/index.htm:1.5.4.12 openafs/src/WINNT/doc/install/Documentation/en_US/html/index.htm:1.5.4.13 *** openafs/src/WINNT/doc/install/Documentation/en_US/html/index.htm:1.5.4.12 Tue Apr 3 09:15:04 2007 --- openafs/src/WINNT/doc/install/Documentation/en_US/html/index.htm Wed Apr 18 12:03:12 2007 *************** *** 198,204 ****

OpenAFS for Windows

!

Version 1.5.18

 

--- 198,204 ----

OpenAFS for Windows

!

Version 1.5.19

 

Index: openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/logo.htm diff -c openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/logo.htm:1.1.6.13 openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/logo.htm:1.1.6.14 *** openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/logo.htm:1.1.6.13 Tue Apr 3 09:15:08 2007 --- openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/logo.htm Wed Apr 18 12:03:22 2007 *************** *** 18,24 **** .shape {behavior:url(#default#VML);} ! OpenAFS for Windows 1.5.18 Release Notes ! OpenAFS for Windows 1.5.19 Release Notes ! OpenAFS for Windows 1.5.18 Release Notes ! OpenAFS for Windows 1.5.19 Release Notes !

OpenAFS for Windows 1.5.18
Release Notes

The Andrew File System (AFS) is a location-independent --- 583,589 ----

!

OpenAFS for Windows 1.5.19
Release Notes

The Andrew File System (AFS) is a location-independent Index: openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/toc.htm diff -c openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/toc.htm:1.2.6.11 openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/toc.htm:1.2.6.12 *** openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/toc.htm:1.2.6.11 Tue Apr 3 09:15:09 2007 --- openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/toc.htm Wed Apr 18 12:03:22 2007 *************** *** 10,16 **** ! OpenAFS for Windows 1.5.18 Table of Contents