Index: openafs/src/NTMakefile
diff -c openafs/src/NTMakefile:1.27.2.5 openafs/src/NTMakefile:1.27.2.7
*** openafs/src/NTMakefile:1.27.2.5 Wed Oct 10 12:06:30 2007
--- openafs/src/NTMakefile Fri Feb 1 21:48:12 2008
***************
*** 409,415 ****
$(NTMAKE)
$(CD) ..\..
! libadmin: tbutc
echo ***** $@
$(DOCD) $(SRC)\$@
$(CD) $(SRC)\$@
--- 409,443 ----
$(NTMAKE)
$(CD) ..\..
! talocale: tbutc
! echo ***** $@
! $(DOCD) $(SRC)\WINNT\$@
! $(CD) $(SRC)\WINNT\$@
! $(NTMAKE)
! $(CD) ..\..\..
!
! license: talocale
! echo ***** $@
! $(DOCD) $(SRC)\WINNT\$@
! $(CD) $(SRC)\WINNT\$@
! $(NTMAKE)
! $(CD) ..\..\..
!
! client_osi: license
! echo ***** $@
! $(DOCD) $(SRC)\WINNT\$@
! $(CD) $(SRC)\WINNT\$@
! $(NTMAKE)
! $(CD) ..\..\..
!
! afsd: client_osi
! echo ***** $@
! $(DOCD) $(SRC)\WINNT\$@
! $(CD) $(SRC)\WINNT\$@
! $(NTMAKE)
! $(CD) ..\..\..
!
! libadmin: afsd
echo ***** $@
$(DOCD) $(SRC)\$@
$(CD) $(SRC)\$@
***************
*** 472,506 ****
$(NTMAKE)
$(CD) ..\..\..
! talocale: admintest
! echo ***** $@
! $(DOCD) $(SRC)\WINNT\$@
! $(CD) $(SRC)\WINNT\$@
! $(NTMAKE)
! $(CD) ..\..\..
!
! license: talocale
! echo ***** $@
! $(DOCD) $(SRC)\WINNT\$@
! $(CD) $(SRC)\WINNT\$@
! $(NTMAKE)
! $(CD) ..\..\..
!
! client_osi: license
! echo ***** $@
! $(DOCD) $(SRC)\WINNT\$@
! $(CD) $(SRC)\WINNT\$@
! $(NTMAKE)
! $(CD) ..\..\..
!
! afsd: client_osi
! echo ***** $@
! $(DOCD) $(SRC)\WINNT\$@
! $(CD) $(SRC)\WINNT\$@
! $(NTMAKE)
! $(CD) ..\..\..
!
! afsadmsvr: afsd
echo ***** $@
$(DOCD) $(SRC)\WINNT\$@
$(CD) $(SRC)\WINNT\$@
--- 500,506 ----
$(NTMAKE)
$(CD) ..\..\..
! afsadmsvr: admintest
echo ***** $@
$(DOCD) $(SRC)\WINNT\$@
$(CD) $(SRC)\WINNT\$@
Index: openafs/src/WINNT/afsd/NTMakefile
diff -c openafs/src/WINNT/afsd/NTMakefile:1.46.2.6 openafs/src/WINNT/afsd/NTMakefile:1.46.2.9
*** openafs/src/WINNT/afsd/NTMakefile:1.46.2.6 Thu Aug 23 23:21:49 2007
--- openafs/src/WINNT/afsd/NTMakefile Fri Feb 8 21:32:19 2008
***************
*** 190,196 ****
$(DESTDIR)\lib\afs\afsreg.lib
$(CONF_DLLFILE): $(CONFOBJS) $(OUT)\libafsconf.res $(CONF_DLLLIBS)
! $(DLLGUILINK) -def:libafsconf.def dnsapi.lib mpr.lib
$(_VC_MANIFEST_EMBED_DLL)
$(DLLPREP)
$(COPY) $*.lib $(ILIBDIR)
--- 190,196 ----
$(DESTDIR)\lib\afs\afsreg.lib
$(CONF_DLLFILE): $(CONFOBJS) $(OUT)\libafsconf.res $(CONF_DLLLIBS)
! $(DLLGUILINK) -def:libafsconf.def dnsapi.lib mpr.lib shell32.lib
$(_VC_MANIFEST_EMBED_DLL)
$(DLLPREP)
$(COPY) $*.lib $(ILIBDIR)
***************
*** 250,256 ****
adsiid.lib \
activeds.lib \
user32.lib \
! userenv.lib
$(LOGON_DLLFILE): $(LOGON_DLLOBJS) $(LOGON_DLLLIBS)
$(DLLGUILINK) $(LOGONLINKFLAGS) -def:afslogon.def $(LOGON_DLLSDKLIBS)
--- 250,257 ----
adsiid.lib \
activeds.lib \
user32.lib \
! userenv.lib \
! shell32.lib
$(LOGON_DLLFILE): $(LOGON_DLLOBJS) $(LOGON_DLLLIBS)
$(DLLGUILINK) $(LOGONLINKFLAGS) -def:afslogon.def $(LOGON_DLLSDKLIBS)
***************
*** 358,382 ****
# klog.exe
$(EXEDIR)\klog.exe: $(OUT)\cklog.obj $(OUT)\klog.res $(EXELIBS)
! $(EXECONLINK) dnsapi.lib mpr.lib iphlpapi.lib
$(_VC_MANIFEST_EMBED_EXE)
$(EXEPREP)
# tokens.exe
$(EXEDIR)\tokens.exe: $(OUT)\ctokens.obj $(OUT)\tokens.res $(EXELIBS)
! $(EXECONLINK) dnsapi.lib mpr.lib iphlpapi.lib
$(_VC_MANIFEST_EMBED_EXE)
$(EXEPREP)
# unlog.exe
$(EXEDIR)\unlog.exe: $(OUT)\cunlog.obj $(OUT)\unlog.res $(EXELIBS)
! $(EXECONLINK) dnsapi.lib mpr.lib iphlpapi.lib
$(_VC_MANIFEST_EMBED_EXE)
$(EXEPREP)
# afscpcc.exe
$(EXEDIR)\afscpcc.exe: $(OUT)\afscpcc.obj $(OUT)\afscpcc.res $(LOGON_DLLLIBS)
! $(EXECONLINK) dnsapi.lib mpr.lib iphlpapi.lib userenv.lib
$(_VC_MANIFEST_EMBED_EXE)
$(EXEPREP)
--- 359,383 ----
# klog.exe
$(EXEDIR)\klog.exe: $(OUT)\cklog.obj $(OUT)\klog.res $(EXELIBS)
! $(EXECONLINK) dnsapi.lib mpr.lib iphlpapi.lib shell32.lib
$(_VC_MANIFEST_EMBED_EXE)
$(EXEPREP)
# tokens.exe
$(EXEDIR)\tokens.exe: $(OUT)\ctokens.obj $(OUT)\tokens.res $(EXELIBS)
! $(EXECONLINK) dnsapi.lib mpr.lib iphlpapi.lib shell32.lib
$(_VC_MANIFEST_EMBED_EXE)
$(EXEPREP)
# unlog.exe
$(EXEDIR)\unlog.exe: $(OUT)\cunlog.obj $(OUT)\unlog.res $(EXELIBS)
! $(EXECONLINK) dnsapi.lib mpr.lib iphlpapi.lib shell32.lib
$(_VC_MANIFEST_EMBED_EXE)
$(EXEPREP)
# afscpcc.exe
$(EXEDIR)\afscpcc.exe: $(OUT)\afscpcc.obj $(OUT)\afscpcc.res $(LOGON_DLLLIBS)
! $(EXECONLINK) dnsapi.lib mpr.lib iphlpapi.lib shell32.lib userenv.lib
$(_VC_MANIFEST_EMBED_EXE)
$(EXEPREP)
***************
*** 396,412 ****
secur32.lib \
ole32.lib \
oleaut32.lib \
! iphlpapi.lib
AFSD_EXELIBS =\
$(DESTDIR)\lib\libosi.lib \
- $(DESTDIR)\lib\afsrpc.lib \
- $(DESTDIR)\lib\afsauthent.lib \
$(DESTDIR)\lib\afs\mtafsvldb.lib \
$(DESTDIR)\lib\afs\mtafsint.lib \
$(DESTDIR)\lib\libafsconf.lib \
$(DESTDIR)\lib\afs\afsreg.lib \
- $(DESTDIR)\lib\afs\afsutil.lib \
$(DESTDIR)\lib\afspthread.lib \
$(LANAHELPERLIB)
--- 397,413 ----
secur32.lib \
ole32.lib \
oleaut32.lib \
! iphlpapi.lib shell32.lib
AFSD_EXELIBS =\
$(DESTDIR)\lib\libosi.lib \
$(DESTDIR)\lib\afs\mtafsvldb.lib \
$(DESTDIR)\lib\afs\mtafsint.lib \
+ $(DESTDIR)\lib\afsrpc.lib \
+ $(DESTDIR)\lib\afs\afsutil.lib \
+ $(DESTDIR)\lib\afsauthent.lib \
$(DESTDIR)\lib\libafsconf.lib \
$(DESTDIR)\lib\afs\afsreg.lib \
$(DESTDIR)\lib\afspthread.lib \
$(LANAHELPERLIB)
***************
*** 423,446 ****
# fs.exe
$(EXEDIR)\fs.exe: $(FSOBJS) $(OUT)\fs.res $(EXELIBS)
! $(EXECONLINK) dnsapi.lib mpr.lib iphlpapi.lib
$(_VC_MANIFEST_EMBED_EXE)
$(EXEPREP)
# cmdebug.exe
$(EXEDIR)\cmdebug.exe: $(CMDBGOBJS) $(OUT)\cmdebug.res $(EXELIBS2)
! $(EXECONLINK) $(EXELIBS2) dnsapi.lib mpr.lib iphlpapi.lib rpcrt4.lib
$(_VC_MANIFEST_EMBED_EXE)
$(EXEPREP)
# symlink.exe
$(EXEDIR)\symlink.exe: $(SLOBJS) $(OUT)\symlink.res $(EXELIBS)
! $(EXECONLINK) dnsapi.lib mpr.lib iphlpapi.lib
$(_VC_MANIFEST_EMBED_EXE)
$(EXEPREP)
# afsshare.exe
! $(EXEDIR)\afsshare.exe: $(OUT)\afsshare.obj $(OUT)\afsshare.res
$(EXECONLINK)
$(_VC_MANIFEST_EMBED_EXE)
$(EXEPREP)
--- 424,447 ----
# fs.exe
$(EXEDIR)\fs.exe: $(FSOBJS) $(OUT)\fs.res $(EXELIBS)
! $(EXECONLINK) dnsapi.lib mpr.lib iphlpapi.lib shell32.lib
$(_VC_MANIFEST_EMBED_EXE)
$(EXEPREP)
# cmdebug.exe
$(EXEDIR)\cmdebug.exe: $(CMDBGOBJS) $(OUT)\cmdebug.res $(EXELIBS2)
! $(EXECONLINK) $(EXELIBS2) dnsapi.lib mpr.lib iphlpapi.lib shell32.lib rpcrt4.lib
$(_VC_MANIFEST_EMBED_EXE)
$(EXEPREP)
# symlink.exe
$(EXEDIR)\symlink.exe: $(SLOBJS) $(OUT)\symlink.res $(EXELIBS)
! $(EXECONLINK) dnsapi.lib mpr.lib iphlpapi.lib shell32.lib
$(_VC_MANIFEST_EMBED_EXE)
$(EXEPREP)
# afsshare.exe
! $(EXEDIR)\afsshare.exe: $(OUT)\afsshare.obj $(OUT)\afsshare.res $(EXELIBS)
$(EXECONLINK)
$(_VC_MANIFEST_EMBED_EXE)
$(EXEPREP)
Index: openafs/src/WINNT/afsd/afsd_init.c
diff -c openafs/src/WINNT/afsd/afsd_init.c:1.79.2.23 openafs/src/WINNT/afsd/afsd_init.c:1.79.2.27
*** openafs/src/WINNT/afsd/afsd_init.c:1.79.2.23 Mon Dec 24 00:24:14 2007
--- openafs/src/WINNT/afsd/afsd_init.c Fri Feb 1 16:39:40 2008
***************
*** 465,471 ****
}
else /* add a new server without a cell */
{
! tsp = cm_NewServer(&saddr, CM_SERVER_VLDB, NULL); /* refcount = 1 */
tsp->ipRank = (USHORT)dwRank;
}
}
--- 465,471 ----
}
else /* add a new server without a cell */
{
! tsp = cm_NewServer(&saddr, CM_SERVER_VLDB, NULL, CM_FLAG_NOPROBE); /* refcount = 1 */
tsp->ipRank = (USHORT)dwRank;
}
}
***************
*** 535,541 ****
}
else /* add a new server without a cell */
{
! tsp = cm_NewServer(&saddr, CM_SERVER_FILE, NULL); /* refcount = 1 */
tsp->ipRank = (USHORT)dwRank;
}
}
--- 535,541 ----
}
else /* add a new server without a cell */
{
! tsp = cm_NewServer(&saddr, CM_SERVER_FILE, NULL, CM_FLAG_NOPROBE); /* refcount = 1 */
tsp->ipRank = (USHORT)dwRank;
}
}
***************
*** 1270,1276 ****
code, cm_freelanceEnabled, (code ? "" : rootCellName));
if (code != 0 && !cm_freelanceEnabled)
{
! *reasonP = "can't find root cell name in CellServDB";
return -1;
}
else if (cm_freelanceEnabled)
--- 1270,1276 ----
code, cm_freelanceEnabled, (code ? "" : rootCellName));
if (code != 0 && !cm_freelanceEnabled)
{
! *reasonP = "can't find root cell name in " AFS_CELLSERVDB;
return -1;
}
else if (cm_freelanceEnabled)
***************
*** 1282,1288 ****
afsi_log("cm_GetCell addr %x", PtrToUlong(cm_data.rootCellp));
if (cm_data.rootCellp == NULL)
{
! *reasonP = "can't find root cell in afsdcell.ini";
return -1;
}
}
--- 1282,1288 ----
afsi_log("cm_GetCell addr %x", PtrToUlong(cm_data.rootCellp));
if (cm_data.rootCellp == NULL)
{
! *reasonP = "can't find root cell in " AFS_CELLSERVDB;
return -1;
}
}
Index: openafs/src/WINNT/afsd/afsd_service.c
diff -c openafs/src/WINNT/afsd/afsd_service.c:1.52.4.21 openafs/src/WINNT/afsd/afsd_service.c:1.52.4.23
*** openafs/src/WINNT/afsd/afsd_service.c:1.52.4.21 Sun Jan 6 01:26:04 2008
--- openafs/src/WINNT/afsd/afsd_service.c Sat Feb 2 17:27:11 2008
***************
*** 344,350 ****
powerStateSuspended = 1;
if (osVersion.dwMajorVersion >= 6) {
cm_SuspendSCache();
! smb_StopListeners();
}
dwRet = NO_ERROR;
break;
--- 344,350 ----
powerStateSuspended = 1;
if (osVersion.dwMajorVersion >= 6) {
cm_SuspendSCache();
! smb_StopListeners(0);
}
dwRet = NO_ERROR;
break;
***************
*** 353,366 ****
powerStateSuspended = 1;
if (osVersion.dwMajorVersion >= 6) {
cm_SuspendSCache();
! smb_StopListeners();
}
dwRet = NO_ERROR;
break;
case PBT_APMRESUMECRITICAL:
afsi_log("SERVICE_CONTROL_APMRESUMECRITICAL");
if (osVersion.dwMajorVersion >= 6)
! smb_RestartListeners();
dwRet = NO_ERROR;
break;
case PBT_APMRESUMESUSPEND:
--- 353,366 ----
powerStateSuspended = 1;
if (osVersion.dwMajorVersion >= 6) {
cm_SuspendSCache();
! smb_StopListeners(0);
}
dwRet = NO_ERROR;
break;
case PBT_APMRESUMECRITICAL:
afsi_log("SERVICE_CONTROL_APMRESUMECRITICAL");
if (osVersion.dwMajorVersion >= 6)
! smb_RestartListeners(0);
dwRet = NO_ERROR;
break;
case PBT_APMRESUMESUSPEND:
***************
*** 393,400 ****
/* This is the message delivered once all devices are up */
afsi_log("SERVICE_CONTROL_APMRESUMEAUTOMATIC");
powerStateSuspended = 0;
! if (osVersion.dwMajorVersion >= 6)
! smb_RestartListeners();
dwRet = NO_ERROR;
break;
default:
--- 393,401 ----
/* This is the message delivered once all devices are up */
afsi_log("SERVICE_CONTROL_APMRESUMEAUTOMATIC");
powerStateSuspended = 0;
! if (osVersion.dwMajorVersion >= 6) {
! smb_SetLanAdapterChangeDetected();
! }
dwRet = NO_ERROR;
break;
default:
***************
*** 441,447 ****
dwResult = RegOpenKeyEx(HKEY_LOCAL_MACHINE, szKeyName, 0, KEY_QUERY_VALUE, &hKey);
if (dwResult != ERROR_SUCCESS)
! return;
while (dwIndex < MAX_DRIVES) {
dwDriveSize = sizeof(szDriveToMapTo);
--- 442,448 ----
dwResult = RegOpenKeyEx(HKEY_LOCAL_MACHINE, szKeyName, 0, KEY_QUERY_VALUE, &hKey);
if (dwResult != ERROR_SUCCESS)
! return 0;
while (dwIndex < MAX_DRIVES) {
dwDriveSize = sizeof(szDriveToMapTo);
Index: openafs/src/WINNT/afsd/afskfw.c
diff -c openafs/src/WINNT/afsd/afskfw.c:1.28.4.12 openafs/src/WINNT/afsd/afskfw.c:1.28.4.15
*** openafs/src/WINNT/afsd/afskfw.c:1.28.4.12 Thu Oct 18 01:21:35 2007
--- openafs/src/WINNT/afsd/afskfw.c Fri Feb 8 21:32:19 2008
***************
*** 497,502 ****
--- 497,530 ----
FreeLibrary(hKrb5);
}
+ typedef BOOL (WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL);
+ static int IsWow64()
+ {
+ static int init = TRUE;
+ static int bIsWow64 = FALSE;
+
+ if (init) {
+ HMODULE hModule;
+ LPFN_ISWOW64PROCESS fnIsWow64Process = NULL;
+
+ hModule = GetModuleHandle(TEXT("kernel32"));
+ if (hModule) {
+ fnIsWow64Process = (LPFN_ISWOW64PROCESS)GetProcAddress(hModule, "IsWow64Process");
+
+ if (NULL != fnIsWow64Process)
+ {
+ if (!fnIsWow64Process(GetCurrentProcess(),&bIsWow64))
+ {
+ // on error, assume FALSE.
+ // in other words, do nothing.
+ }
+ }
+ FreeLibrary(hModule);
+ }
+ init = FALSE;
+ }
+ return bIsWow64;
+ }
int
KFW_accept_dotted_usernames(void)
***************
*** 506,512 ****
DWORD value = 1;
code = RegOpenKeyEx(HKEY_CURRENT_USER, AFSREG_USER_OPENAFS_SUBKEY,
! 0, KEY_QUERY_VALUE, &parmKey);
if (code == ERROR_SUCCESS) {
len = sizeof(value);
code = RegQueryValueEx(parmKey, "AcceptDottedPrincipalNames", NULL, NULL,
--- 534,540 ----
DWORD value = 1;
code = RegOpenKeyEx(HKEY_CURRENT_USER, AFSREG_USER_OPENAFS_SUBKEY,
! 0, (IsWow64()?KEY_WOW64_64KEY:0)|KEY_QUERY_VALUE, &parmKey);
if (code == ERROR_SUCCESS) {
len = sizeof(value);
code = RegQueryValueEx(parmKey, "AcceptDottedPrincipalNames", NULL, NULL,
***************
*** 515,521 ****
}
if (code != ERROR_SUCCESS) {
code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSREG_CLT_OPENAFS_SUBKEY,
! 0, KEY_QUERY_VALUE, &parmKey);
if (code == ERROR_SUCCESS) {
len = sizeof(value);
code = RegQueryValueEx(parmKey, "AcceptDottedPrincipalNames", NULL, NULL,
--- 543,549 ----
}
if (code != ERROR_SUCCESS) {
code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSREG_CLT_OPENAFS_SUBKEY,
! 0, (IsWow64()?KEY_WOW64_64KEY:0)|KEY_QUERY_VALUE, &parmKey);
if (code == ERROR_SUCCESS) {
len = sizeof(value);
code = RegQueryValueEx(parmKey, "AcceptDottedPrincipalNames", NULL, NULL,
***************
*** 535,541 ****
DWORD use524 = 0;
code = RegOpenKeyEx(HKEY_CURRENT_USER, AFSREG_USER_OPENAFS_SUBKEY,
! 0, KEY_QUERY_VALUE, &parmKey);
if (code == ERROR_SUCCESS) {
len = sizeof(use524);
code = RegQueryValueEx(parmKey, "Use524", NULL, NULL,
--- 563,569 ----
DWORD use524 = 0;
code = RegOpenKeyEx(HKEY_CURRENT_USER, AFSREG_USER_OPENAFS_SUBKEY,
! 0, (IsWow64()?KEY_WOW64_64KEY:0)|KEY_QUERY_VALUE, &parmKey);
if (code == ERROR_SUCCESS) {
len = sizeof(use524);
code = RegQueryValueEx(parmKey, "Use524", NULL, NULL,
***************
*** 544,550 ****
}
if (code != ERROR_SUCCESS) {
code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSREG_CLT_OPENAFS_SUBKEY,
! 0, KEY_QUERY_VALUE, &parmKey);
if (code == ERROR_SUCCESS) {
len = sizeof(use524);
code = RegQueryValueEx(parmKey, "Use524", NULL, NULL,
--- 572,578 ----
}
if (code != ERROR_SUCCESS) {
code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSREG_CLT_OPENAFS_SUBKEY,
! 0, (IsWow64()?KEY_WOW64_64KEY:0)|KEY_QUERY_VALUE, &parmKey);
if (code == ERROR_SUCCESS) {
len = sizeof(use524);
code = RegQueryValueEx(parmKey, "Use524", NULL, NULL,
***************
*** 563,569 ****
DWORD enableKFW = 1;
code = RegOpenKeyEx(HKEY_CURRENT_USER, AFSREG_USER_OPENAFS_SUBKEY,
! 0, KEY_QUERY_VALUE, &parmKey);
if (code == ERROR_SUCCESS) {
len = sizeof(enableKFW);
code = RegQueryValueEx(parmKey, "EnableKFW", NULL, NULL,
--- 591,597 ----
DWORD enableKFW = 1;
code = RegOpenKeyEx(HKEY_CURRENT_USER, AFSREG_USER_OPENAFS_SUBKEY,
! 0, (IsWow64()?KEY_WOW64_64KEY:0)|KEY_QUERY_VALUE, &parmKey);
if (code == ERROR_SUCCESS) {
len = sizeof(enableKFW);
code = RegQueryValueEx(parmKey, "EnableKFW", NULL, NULL,
***************
*** 573,579 ****
if (code != ERROR_SUCCESS) {
code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSREG_CLT_OPENAFS_SUBKEY,
! 0, KEY_QUERY_VALUE, &parmKey);
if (code == ERROR_SUCCESS) {
len = sizeof(enableKFW);
code = RegQueryValueEx(parmKey, "EnableKFW", NULL, NULL,
--- 601,607 ----
if (code != ERROR_SUCCESS) {
code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSREG_CLT_OPENAFS_SUBKEY,
! 0, (IsWow64()?KEY_WOW64_64KEY:0)|KEY_QUERY_VALUE, &parmKey);
if (code == ERROR_SUCCESS) {
len = sizeof(enableKFW);
code = RegQueryValueEx(parmKey, "EnableKFW", NULL, NULL,
***************
*** 657,662 ****
--- 685,691 ----
krb5_principal principal = 0;
char * pname = NULL;
const char * ccname = NULL;
+ const char * cctype = NULL;
krb5_error_code code = 0;
krb5_error_code cc_code = 0;
krb5_cc_cursor cur;
***************
*** 676,681 ****
--- 705,713 ----
ccname = pkrb5_cc_get_name(ctx, cc);
if (!ccname) goto cleanup;
+ cctype = pkrb5_cc_get_type(ctx, cc);
+ if (!cctype) goto cleanup;
+
// Search the existing list to see if we have a match
if ( next ) {
for ( ; next ; next = next->next ) {
***************
*** 690,696 ****
next->next = princ_cc_data;
princ_cc_data = next;
next->principal = _strdup(pname);
! next->ccache_name = _strdup(ccname);
next->from_lsa = lsa;
next->expired = 1;
next->expiration_time = 0;
--- 722,730 ----
next->next = princ_cc_data;
princ_cc_data = next;
next->principal = _strdup(pname);
! next->ccache_name = malloc(strlen(ccname) + strlen(cctype) + 2);
! if (next->ccache_name)
! sprintf(next->ccache_name, "%s:%s", cctype, ccname);
next->from_lsa = lsa;
next->expired = 1;
next->expiration_time = 0;
***************
*** 2618,2624 ****
struct ktc_token *atoken)
{
static char lastcell[MAXCELLCHARS+1] = { 0 };
! static char confname[512] = { 0 };
#ifdef AFS_ID_TO_NAME
char username_copy[BUFSIZ];
#endif /* AFS_ID_TO_NAME */
--- 2652,2658 ----
struct ktc_token *atoken)
{
static char lastcell[MAXCELLCHARS+1] = { 0 };
! static char confdir[512] = { 0 };
#ifdef AFS_ID_TO_NAME
char username_copy[BUFSIZ];
#endif /* AFS_ID_TO_NAME */
***************
*** 2628,2641 ****
afs_int32 id;
#endif /* ALLOW_REGISTER */
! if (confname[0] == '\0') {
! strncpy(confname, AFSDIR_CLIENT_ETC_DIRPATH, sizeof(confname));
! confname[sizeof(confname) - 2] = '\0';
! }
strcpy(lastcell, aserver->cell);
! if (!pr_Initialize (0, confname, aserver->cell)) {
char sname[PR_MAXNAMELEN];
strncpy(sname, username, PR_MAXNAMELEN);
sname[PR_MAXNAMELEN-1] = '\0';
--- 2662,2673 ----
afs_int32 id;
#endif /* ALLOW_REGISTER */
! if (confdir[0] == '\0')
! cm_GetConfigDir(confdir, sizeof(confdir));
strcpy(lastcell, aserver->cell);
! if (!pr_Initialize (0, confdir, aserver->cell)) {
char sname[PR_MAXNAMELEN];
strncpy(sname, username, PR_MAXNAMELEN);
sname[PR_MAXNAMELEN-1] = '\0';
***************
*** 2678,2684 ****
strncpy(aclient->cell, realm_of_user, MAXKTCREALMLEN - 1);
if (status = ktc_SetToken(aserver, atoken, aclient, 0))
return status;
! if (status = pr_Initialize(1L, confname, aserver->cell))
return status;
status = pr_CreateUser(username, &id);
pr_End();
--- 2710,2716 ----
strncpy(aclient->cell, realm_of_user, MAXKTCREALMLEN - 1);
if (status = ktc_SetToken(aserver, atoken, aclient, 0))
return status;
! if (status = pr_Initialize(1L, confdir, aserver->cell))
return status;
status = pr_CreateUser(username, &id);
pr_End();
Index: openafs/src/WINNT/afsd/afskfw.h
diff -c openafs/src/WINNT/afsd/afskfw.h:1.4.4.2 openafs/src/WINNT/afsd/afskfw.h:1.4.4.3
*** openafs/src/WINNT/afsd/afskfw.h:1.4.4.2 Mon Jul 24 10:13:17 2006
--- openafs/src/WINNT/afsd/afskfw.h Fri Feb 1 16:39:41 2008
***************
*** 37,42 ****
--- 37,43 ----
#include
#include
#include
+ #include
#include
#define MAXCELLCHARS 64
Index: openafs/src/WINNT/afsd/afslogon.c
diff -c openafs/src/WINNT/afsd/afslogon.c:1.45.2.12 openafs/src/WINNT/afsd/afslogon.c:1.45.2.13
*** openafs/src/WINNT/afsd/afslogon.c:1.45.2.12 Tue Dec 11 23:25:38 2007
--- openafs/src/WINNT/afsd/afslogon.c Mon Jan 28 14:51:20 2008
***************
*** 29,34 ****
--- 29,39 ----
#include "afskfw.h"
#include "lanahelper.h"
+ /* Allocated in Windows Driver Kit */
+ #ifndef WNNC_NET_OPENAFS
+ #define WNNC_NET_OPENAFS 0x00390000
+ #endif
+
#include
DWORD TraceOption = 0;
***************
*** 217,223 ****
switch (index) {
case WNNC_NET_TYPE:
/* Don't have our own type; use somebody else's. */
! return WNNC_NET_SUN_PC_NFS;
case WNNC_START:
/* Say we are already started, even though we might wait after we receive NPLogonNotify */
--- 222,228 ----
switch (index) {
case WNNC_NET_TYPE:
/* Don't have our own type; use somebody else's. */
! return WNNC_NET_OPENAFS;
case WNNC_START:
/* Say we are already started, even though we might wait after we receive NPLogonNotify */
Index: openafs/src/WINNT/afsd/afsshare.c
diff -c openafs/src/WINNT/afsd/afsshare.c:1.8 openafs/src/WINNT/afsd/afsshare.c:1.8.4.1
*** openafs/src/WINNT/afsd/afsshare.c:1.8 Sat Nov 5 01:47:46 2005
--- openafs/src/WINNT/afsd/afsshare.c Fri Feb 8 21:32:19 2008
***************
*** 32,38 ****
0,
NULL,
REG_OPTION_NON_VOLATILE,
! KEY_READ|KEY_WRITE,
NULL,
&hkSubmounts,
NULL) == ERROR_SUCCESS)
--- 32,38 ----
0,
NULL,
REG_OPTION_NON_VOLATILE,
! (IsWow64()?KEY_WOW64_64KEY:0)|KEY_READ|KEY_WRITE,
NULL,
&hkSubmounts,
NULL) == ERROR_SUCCESS)
***************
*** 50,56 ****
0,
NULL,
REG_OPTION_NON_VOLATILE,
! KEY_READ,
NULL,
&hkParameters,
NULL) == ERROR_SUCCESS)
--- 50,56 ----
0,
NULL,
REG_OPTION_NON_VOLATILE,
! (IsWow64()?KEY_WOW64_64KEY:0)|KEY_READ,
NULL,
&hkParameters,
NULL) == ERROR_SUCCESS)
Index: openafs/src/WINNT/afsd/cm.h
diff -c openafs/src/WINNT/afsd/cm.h:1.17.2.7 openafs/src/WINNT/afsd/cm.h:1.17.2.11
*** openafs/src/WINNT/afsd/cm.h:1.17.2.7 Sat Dec 22 23:52:58 2007
--- openafs/src/WINNT/afsd/cm.h Fri Feb 8 21:32:19 2008
***************
*** 14,238 ****
#define AFS_PTHREAD_ENV 1
#endif
#include
- #ifdef DJGPP /* we need these for vldbentry decl., etc. */
#include
#include
- #endif /* DJGPP */
-
- /* from .xg file */
- /* FIXME: these were "long" but Windows NT wants "int" */
- int VL_GetEntryByID(struct rx_connection *, afs_int32, afs_int32, struct vldbentry *);
- int VL_GetEntryByNameO(struct rx_connection *, char *, struct vldbentry *);
- int VL_ProbeServer(struct rx_connection *);
- int VL_GetEntryBYIDN(struct rx_connection *, afs_int32, afs_int32, struct nvldbentry *);
- int VL_GetEntryByNameN(struct rx_connection *, char *, struct nvldbentry *);
-
- /* from .xg file */
- int StartRXAFS_FetchData (struct rx_call *,
- struct AFSFid *Fid,
- afs_int32 Pos,
- afs_int32 Length);
- int EndRXAFS_FetchData (struct rx_call *,
- struct AFSFetchStatus *OutStatus,
- struct AFSCallBack *CallBack,
- struct AFSVolSync *Sync);
-
- int RXAFS_FetchACL(struct rx_connection *,
- struct AFSFid *Fid,
- struct AFSOpaque *AccessList,
- struct AFSFetchStatus *OutStatus,
- struct AFSVolSync *Sync);
-
- int RXAFS_FetchStatus (struct rx_connection *,
- struct AFSFid *Fid,
- struct AFSFetchStatus *OutStatus,
- struct AFSCallBack *CallBack,
- struct AFSVolSync *Sync);
-
- int StartRXAFS_StoreData (struct rx_call *,
- struct AFSFid *Fid,
- struct AFSStoreStatus *InStatus,
- afs_uint32 Pos,
- afs_uint32 Length,
- afs_uint32 FileLength);
-
- int EndRXAFS_StoreData(struct rx_call *,
- struct AFSFetchStatus *OutStatus,
- struct AFSVolSync *Sync);
-
- int StartRXAFS_FetchData64(struct rx_call *z_call,
- struct AFSFid * Fid,
- afs_int64 Pos,
- afs_int64 Length);
-
- int EndRXAFS_FetchData64(struct rx_call *z_call,
- struct AFSFetchStatus * OutStatus,
- struct AFSCallBack * CallBack,
- struct AFSVolSync * Sync);
-
- afs_int32 SRXAFS_FetchData64(struct rx_call *z_call,
- struct AFSFid * Fid,
- afs_int64 Pos,
- afs_int64 Length,
- struct AFSFetchStatus * OutStatus,
- struct AFSCallBack * CallBack,
- struct AFSVolSync * Sync);
-
- int StartRXAFS_StoreData64(struct rx_call *z_call,
- struct AFSFid * Fid,
- struct AFSStoreStatus * InStatus,
- afs_uint64 Pos,
- afs_uint64 Length,
- afs_uint64 FileLength);
-
- int EndRXAFS_StoreData64(struct rx_call *z_call,
- struct AFSFetchStatus * OutStatus,
- struct AFSVolSync * Sync);
-
- afs_int32 SRXAFS_StoreData64(struct rx_call *z_call,
- struct AFSFid * Fid,
- struct AFSStoreStatus * InStatus,
- afs_uint64 Pos,
- afs_uint64 Length,
- afs_uint64 FileLength,
- struct AFSFetchStatus * OutStatus,
- struct AFSVolSync * Sync);
-
- int RXAFS_StoreACL (struct rx_connection *,
- struct AFSFid *Fid,
- struct AFSOpaque *AccessList,
- struct AFSFetchStatus *OutStatus,
- struct AFSVolSync *Sync);
-
- int RXAFS_StoreStatus(struct rx_connection *,
- struct AFSFid *Fid,
- struct AFSStoreStatus *InStatus,
- struct AFSFetchStatus *OutStatus,
- struct AFSVolSync *Sync);
-
- int RXAFS_RemoveFile (struct rx_connection *,
- struct AFSFid *DirFid,
- char *namep,
- struct AFSFetchStatus *OutStatus,
- struct AFSVolSync *Sync);
-
- int RXAFS_CreateFile (struct rx_connection *,
- struct AFSFid *DirFid,
- char *Name,
- struct AFSStoreStatus *InStatus,
- struct AFSFid *OutFid,
- struct AFSFetchStatus *OutFidStatus,
- struct AFSFetchStatus *OutDirStatus,
- struct AFSCallBack *CallBack,
- struct AFSVolSync *Sync);
-
- int RXAFS_Rename (struct rx_connection *,
- struct AFSFid *OldDirFid,
- char *OldName,
- struct AFSFid *NewDirFid,
- char *NewName,
- struct AFSFetchStatus *OutOldDirStatus,
- struct AFSFetchStatus *OutNewDirStatus,
- struct AFSVolSync *Sync);
-
- int RXAFS_Symlink (struct rx_connection *,
- struct AFSFid *DirFid,
- char *name,
- char *LinkContents,
- struct AFSStoreStatus *InStatus,
- struct AFSFid *OutFid,
- struct AFSFetchStatus *OutFidStatus,
- struct AFSFetchStatus *OutDirStatus,
- struct AFSVolSync *Sync);
-
- int RXAFS_Link (struct rx_connection *,
- struct AFSFid *DirFid,
- char *Name,
- struct AFSFid *ExistingFid,
- struct AFSFetchStatus *OutFidStatus,
- struct AFSFetchStatus *OutDirStatus,
- struct AFSVolSync *Sync);
-
- int RXAFS_MakeDir (struct rx_connection *,
- struct AFSFid *DirFid,
- char *name,
- struct AFSStoreStatus *InStatus,
- struct AFSFid *OutFid,
- struct AFSFetchStatus *OutFidStatus,
- struct AFSFetchStatus *OutDirStatus,
- struct AFSCallBack *CallBack,
- struct AFSVolSync *Sync);
-
- int RXAFS_RemoveDir (struct rx_connection *,
- struct AFSFid *DirFid,
- char *Name,
- struct AFSFetchStatus *OutDirStatus,
- struct AFSVolSync *Sync);
-
- int RXAFS_GetStatistics (struct rx_connection *,
- struct ViceStatistics *Statistics);
-
- int RXAFS_GiveUpCallBacks (struct rx_connection *,
- struct AFSCBFids *Fids_Array,
- struct AFSCBs *CallBacks_Array);
-
- int RXAFS_GetVolumeInfo (struct rx_connection *,
- char *VolumeName,
- struct VolumeInfo *Volumeinfo);
-
- int RXAFS_GetVolumeStatus (struct rx_connection *,
- afs_int32 Volumeid,
- struct AFSFetchVolumeStatus *Volumestatus,
- char **name,
- char **offlineMsg,
- char **motd);
-
- int RXAFS_SetVolumeStatus (struct rx_connection *,
- afs_int32 Volumeid,
- struct AFSStoreVolumeStatus *Volumestatus,
- char *name,
- char *olm,
- char *motd);
-
- int RXAFS_GetRootVolume (struct rx_connection *,
- char **VolumeName);
-
- int RXAFS_CheckToken (struct rx_connection *,
- afs_int32 ViceId,
- struct AFSOpaque *token);
-
- int RXAFS_GetTime (struct rx_connection *,
- afs_uint32 *Seconds,
- afs_uint32 *USeconds);
-
- int RXAFS_BulkStatus (struct rx_connection *,
- struct AFSCBFids *FidsArray,
- struct AFSBulkStats *StatArray,
- struct AFSCBs *CBArray,
- struct AFSVolSync *Sync);
-
- int RXAFS_SetLock (struct rx_connection *,
- struct AFSFid *Fid,
- int Type,
- struct AFSVolSync *Sync);
-
- int RXAFS_ExtendLock (struct rx_connection *,
- struct AFSFid *Fid,
- struct AFSVolSync *Sync);
-
- int RXAFS_ReleaseLock (struct rx_connection *,
- struct AFSFid *Fid,
- struct AFSVolSync *Sync);
-
- /* This interface is to supported the AFS/DFS Protocol Translator */
- int RXAFS_Lookup (struct rx_connection *,
- struct AFSFid *DirFid,
- char *Name,
- struct AFSFid *OutFid,
- struct AFSFetchStatus *OutFidStatus,
- struct AFSFetchStatus *OutDirStatus,
- struct AFSCallBack *CallBack,
- struct AFSVolSync *Sync);
#define CM_DEFAULT_CALLBACKPORT 7001
--- 14,21 ----
***************
*** 245,250 ****
--- 28,35 ----
#define CM_FLAG_NOMOUNTCHASE 0x20 /* don't follow mount points */
#define CM_FLAG_DIRSEARCH 0x40 /* for directory search */
#define CM_FLAG_CHECKPATH 0x80 /* Path instead of File */
+ #define CM_FLAG_NOPROBE 0x100 /* For use with cm_GetCellxxx - do not probe server status */
+ #define CM_FLAG_DFS_REFERRAL 0x200 /* The request is a DFS Referral - the last char of the lookup name may be missing */
/* error codes */
#define CM_ERROR_BASE 0x66543200
***************
*** 304,309 ****
--- 89,95 ----
#define CM_ERROR_INEXACT_MATCH (CM_ERROR_BASE+54)
#define CM_ERROR_BPLUS_NOMATCH (CM_ERROR_BASE+55)
#define CM_ERROR_EAS_NOT_SUPPORTED (CM_ERROR_BASE+56)
+ #define CM_ERROR_RANGE_NOT_LOCKED (CM_ERROR_BASE+57)
/* Used by cm_FollowMountPoint and cm_GetVolumeByName */
#define RWVOL 0
Index: openafs/src/WINNT/afsd/cm_aclent.c
diff -c openafs/src/WINNT/afsd/cm_aclent.c:1.14.2.2 openafs/src/WINNT/afsd/cm_aclent.c:1.14.2.3
*** openafs/src/WINNT/afsd/cm_aclent.c:1.14.2.2 Thu Oct 25 00:49:00 2007
--- openafs/src/WINNT/afsd/cm_aclent.c Tue Feb 5 12:11:45 2008
***************
*** 80,86 ****
for (aclp = scp->randomACLp; aclp; aclp = aclp->nextp) {
if (aclp->userp == userp) {
! if (aclp->tgtLifetime && aclp->tgtLifetime <= osi_Time()) {
/* ticket expired */
osi_QRemoveHT((osi_queue_t **) &cm_data.aclLRUp, (osi_queue_t **) &cm_data.aclLRUEndp, &aclp->q);
CleanupACLEnt(aclp);
--- 80,86 ----
for (aclp = scp->randomACLp; aclp; aclp = aclp->nextp) {
if (aclp->userp == userp) {
! if (aclp->tgtLifetime && aclp->tgtLifetime <= time(NULL)) {
/* ticket expired */
osi_QRemoveHT((osi_queue_t **) &cm_data.aclLRUp, (osi_queue_t **) &cm_data.aclLRUEndp, &aclp->q);
CleanupACLEnt(aclp);
Index: openafs/src/WINNT/afsd/cm_aclent.h
diff -c openafs/src/WINNT/afsd/cm_aclent.h:1.6 openafs/src/WINNT/afsd/cm_aclent.h:1.6.2.1
*** openafs/src/WINNT/afsd/cm_aclent.h:1.6 Sat Apr 22 15:44:28 2006
--- openafs/src/WINNT/afsd/cm_aclent.h Tue Feb 5 12:11:45 2008
***************
*** 26,32 ****
struct cm_scache *backp; /* back ptr to vnode */
struct cm_user *userp; /* user whose access is cached */
afs_uint32 randomAccess; /* watch for more rights in acl.h */
! unsigned long tgtLifetime; /* time this expires */
} cm_aclent_t;
extern osi_rwlock_t cm_aclLock;
--- 26,32 ----
struct cm_scache *backp; /* back ptr to vnode */
struct cm_user *userp; /* user whose access is cached */
afs_uint32 randomAccess; /* watch for more rights in acl.h */
! afs_uint32 tgtLifetime; /* time this expires */
} cm_aclent_t;
extern osi_rwlock_t cm_aclLock;
Index: openafs/src/WINNT/afsd/cm_callback.c
diff -c openafs/src/WINNT/afsd/cm_callback.c:1.41.4.28 openafs/src/WINNT/afsd/cm_callback.c:1.41.4.33
*** openafs/src/WINNT/afsd/cm_callback.c:1.41.4.28 Wed Dec 26 11:22:19 2007
--- openafs/src/WINNT/afsd/cm_callback.c Thu Feb 7 16:21:20 2008
***************
*** 361,368 ****
cm_server_t *tsp = NULL;
cm_cell_t* cellp = NULL;
MUTEX_ENTER(&callp->lock);
!
if ((connp = rx_ConnectionOf(callp)) && (peerp = rx_PeerOf(connp))) {
host = rx_HostOf(peerp);
port = rx_PortOf(peerp);
--- 361,369 ----
cm_server_t *tsp = NULL;
cm_cell_t* cellp = NULL;
+ #ifdef HOLD_CALL_MUTEX
MUTEX_ENTER(&callp->lock);
! #endif
if ((connp = rx_ConnectionOf(callp)) && (peerp = rx_PeerOf(connp))) {
host = rx_HostOf(peerp);
port = rx_PortOf(peerp);
***************
*** 371,377 ****
if (tsp)
cellp = tsp->cellp;
! if (cellp)
osi_Log2(afsd_logp, "SRXAFSCB_CallBack from host 0x%x port %d",
ntohl(host),
ntohs(port));
--- 372,378 ----
if (tsp)
cellp = tsp->cellp;
! if (!cellp)
osi_Log2(afsd_logp, "SRXAFSCB_CallBack from host 0x%x port %d",
ntohl(host),
ntohs(port));
***************
*** 395,402 ****
else
cm_RevokeCallback(callp, cellp, tfidp);
}
!
MUTEX_EXIT(&callp->lock);
return 0;
}
--- 396,404 ----
else
cm_RevokeCallback(callp, cellp, tfidp);
}
! #ifdef HOLD_CALL_MUTEX
MUTEX_EXIT(&callp->lock);
+ #endif
return 0;
}
***************
*** 436,443 ****
unsigned long host = 0;
unsigned short port = 0;
MUTEX_ENTER(&callp->lock);
!
if ((connp = rx_ConnectionOf(callp)) && (peerp = rx_PeerOf(connp))) {
host = rx_HostOf(peerp);
port = rx_PortOf(peerp);
--- 438,446 ----
unsigned long host = 0;
unsigned short port = 0;
+ #ifdef HOLD_CALL_MUTEX
MUTEX_ENTER(&callp->lock);
! #endif
if ((connp = rx_ConnectionOf(callp)) && (peerp = rx_PeerOf(connp))) {
host = rx_HostOf(peerp);
port = rx_PortOf(peerp);
***************
*** 518,524 ****
--- 521,529 ----
cm_PutServer(tsp);
}
}
+ #ifdef HOLD_CALL_MUTEX
MUTEX_EXIT(&callp->lock);
+ #endif
return 0;
}
***************
*** 550,557 ****
unsigned long host = 0;
unsigned short port = 0;
MUTEX_ENTER(&callp->lock);
!
if ((connp = rx_ConnectionOf(callp)) && (peerp = rx_PeerOf(connp))) {
host = rx_HostOf(peerp);
port = rx_PortOf(peerp);
--- 555,563 ----
unsigned long host = 0;
unsigned short port = 0;
+ #ifdef HOLD_CALL_MUTEX
MUTEX_ENTER(&callp->lock);
! #endif
if ((connp = rx_ConnectionOf(callp)) && (peerp = rx_PeerOf(connp))) {
host = rx_HostOf(peerp);
port = rx_PortOf(peerp);
***************
*** 561,567 ****
--- 567,575 ----
ntohl(host),
ntohs(port));
+ #ifdef HOLD_CALL_MUTEX
MUTEX_EXIT(&callp->lock);
+ #endif
return 0;
}
***************
*** 656,663 ****
unsigned long host = 0;
unsigned short port = 0;
MUTEX_ENTER(&callp->lock);
!
if ((connp = rx_ConnectionOf(callp)) && (peerp = rx_PeerOf(connp))) {
host = rx_HostOf(peerp);
port = rx_PortOf(peerp);
--- 664,672 ----
unsigned long host = 0;
unsigned short port = 0;
+ #ifdef HOLD_CALL_MUTEX
MUTEX_ENTER(&callp->lock);
! #endif
if ((connp = rx_ConnectionOf(callp)) && (peerp = rx_PeerOf(connp))) {
host = rx_HostOf(peerp);
port = rx_PortOf(peerp);
***************
*** 700,706 ****
--- 709,717 ----
code = 0;
}
+ #ifdef HOLD_CALL_MUTEX
MUTEX_EXIT(&callp->lock);
+ #endif
return code;
}
***************
*** 716,723 ****
unsigned long host = 0;
unsigned short port = 0;
MUTEX_ENTER(&callp->lock);
!
if ((connp = rx_ConnectionOf(callp)) && (peerp = rx_PeerOf(connp))) {
host = rx_HostOf(peerp);
port = rx_PortOf(peerp);
--- 727,735 ----
unsigned long host = 0;
unsigned short port = 0;
+ #ifdef HOLD_CALL_MUTEX
MUTEX_ENTER(&callp->lock);
! #endif
if ((connp = rx_ConnectionOf(callp)) && (peerp = rx_PeerOf(connp))) {
host = rx_HostOf(peerp);
port = rx_PortOf(peerp);
***************
*** 809,815 ****
--- 821,829 ----
fcnDone:
lock_ReleaseRead(&cm_scacheLock);
+ #ifdef HOLD_CALL_MUTEX
MUTEX_EXIT(&callp->lock);
+ #endif
return (code);
}
***************
*** 825,832 ****
unsigned long host = 0;
unsigned short port = 0;
MUTEX_ENTER(&callp->lock);
!
if ((connp = rx_ConnectionOf(callp)) && (peerp = rx_PeerOf(connp))) {
host = rx_HostOf(peerp);
port = rx_PortOf(peerp);
--- 839,847 ----
unsigned long host = 0;
unsigned short port = 0;
+ #ifdef HOLD_CALL_MUTEX
MUTEX_ENTER(&callp->lock);
! #endif
if ((connp = rx_ConnectionOf(callp)) && (peerp = rx_PeerOf(connp))) {
host = rx_HostOf(peerp);
port = rx_PortOf(peerp);
***************
*** 923,929 ****
--- 938,946 ----
fcnDone:
lock_ReleaseRead(&cm_scacheLock);
+ #ifdef HOLD_CALL_MUTEX
MUTEX_EXIT(&callp->lock);
+ #endif
return (code);
}
***************
*** 936,943 ****
unsigned long host = 0;
unsigned short port = 0;
MUTEX_ENTER(&callp->lock);
!
if ((connp = rx_ConnectionOf(callp)) && (peerp = rx_PeerOf(connp))) {
host = rx_HostOf(peerp);
port = rx_PortOf(peerp);
--- 953,961 ----
unsigned long host = 0;
unsigned short port = 0;
+ #ifdef HOLD_CALL_MUTEX
MUTEX_ENTER(&callp->lock);
! #endif
if ((connp = rx_ConnectionOf(callp)) && (peerp = rx_PeerOf(connp))) {
host = rx_HostOf(peerp);
port = rx_PortOf(peerp);
***************
*** 947,953 ****
--- 965,973 ----
ntohl(host), ntohs(port));
*vp = -1;
+ #ifdef HOLD_CALL_MUTEX
MUTEX_EXIT(&callp->lock);
+ #endif
return RXGEN_OPCODE;
}
***************
*** 961,968 ****
unsigned long host = 0;
unsigned short port = 0;
MUTEX_ENTER(&callp->lock);
!
if ((connp = rx_ConnectionOf(callp)) && (peerp = rx_PeerOf(connp))) {
host = rx_HostOf(peerp);
port = rx_PortOf(peerp);
--- 981,989 ----
unsigned long host = 0;
unsigned short port = 0;
+ #ifdef HOLD_CALL_MUTEX
MUTEX_ENTER(&callp->lock);
! #endif
if ((connp = rx_ConnectionOf(callp)) && (peerp = rx_PeerOf(connp))) {
host = rx_HostOf(peerp);
port = rx_PortOf(peerp);
***************
*** 971,977 ****
--- 992,1000 ----
osi_Log2(afsd_logp, "SRXAFSCB_GetXStats from host 0x%x port %d - not implemented",
ntohl(host), ntohs(port));
+ #ifdef HOLD_CALL_MUTEX
MUTEX_EXIT(&callp->lock);
+ #endif
return RXGEN_OPCODE;
}
***************
*** 999,1006 ****
unsigned long host = 0;
unsigned short port = 0;
MUTEX_ENTER(&callp->lock);
!
if ((connp = rx_ConnectionOf(callp)) && (peerp = rx_PeerOf(connp))) {
host = rx_HostOf(peerp);
port = rx_PortOf(peerp);
--- 1022,1030 ----
unsigned long host = 0;
unsigned short port = 0;
+ #ifdef HOLD_CALL_MUTEX
MUTEX_ENTER(&callp->lock);
! #endif
if ((connp = rx_ConnectionOf(callp)) && (peerp = rx_PeerOf(connp))) {
host = rx_HostOf(peerp);
port = rx_PortOf(peerp);
***************
*** 1026,1032 ****
--- 1050,1058 ----
cm_NetMtu[i] : rx_mtu;
}
+ #ifdef HOLD_CALL_MUTEX
MUTEX_EXIT(&callp->lock);
+ #endif
return 0;
}
***************
*** 1036,1042 ****
char *p = NULL;
if (UuidToString((UUID *)serverUuid, &p) == RPC_S_OK) {
! osi_Log1(afsd_logp, "SRXAFSCB_InitCallBackState3 %s ->",p);
RpcStringFree(&p);
} else
osi_Log0(afsd_logp, "SRXAFSCB_InitCallBackState3 - no server Uuid ->");
--- 1062,1068 ----
char *p = NULL;
if (UuidToString((UUID *)serverUuid, &p) == RPC_S_OK) {
! osi_Log1(afsd_logp, "SRXAFSCB_InitCallBackState3 %s ->",osi_LogSaveString(afsd_logp,p));
RpcStringFree(&p);
} else
osi_Log0(afsd_logp, "SRXAFSCB_InitCallBackState3 - no server Uuid ->");
***************
*** 1055,1062 ****
char *p,*q;
int code = 0;
MUTEX_ENTER(&callp->lock);
!
if ((connp = rx_ConnectionOf(callp)) && (peerp = rx_PeerOf(connp))) {
host = rx_HostOf(peerp);
port = rx_PortOf(peerp);
--- 1081,1089 ----
char *p,*q;
int code = 0;
+ #ifdef HOLD_CALL_MUTEX
MUTEX_ENTER(&callp->lock);
! #endif
if ((connp = rx_ConnectionOf(callp)) && (peerp = rx_PeerOf(connp))) {
host = rx_HostOf(peerp);
port = rx_PortOf(peerp);
***************
*** 1079,1118 ****
ntohl(host),
ntohs(port));
MUTEX_EXIT(&callp->lock);
return code;
}
/* debug interface */
! int
! SRXAFSCB_GetCellByNum(struct rx_call *callp, afs_int32 a_cellnum,
! char **a_name, serverList *a_hosts)
{
afs_int32 sn;
cm_cell_t * cellp;
cm_serverRef_t * serverRefp;
- struct rx_connection *connp;
- struct rx_peer *peerp;
- unsigned long host = 0;
- unsigned short port = 0;
! MUTEX_ENTER(&callp->lock);
!
! if ((connp = rx_ConnectionOf(callp)) && (peerp = rx_PeerOf(connp))) {
! host = rx_HostOf(peerp);
! port = rx_PortOf(peerp);
! }
!
! osi_Log3(afsd_logp, "SRXAFSCB_GetCellByNum(%d) from host 0x%x port %d",
! a_cellnum, ntohl(host), ntohs(port));
!
! a_hosts->serverList_val = 0;
! a_hosts->serverList_len = 0;
!
! cellp = cm_FindCellByID(a_cellnum);
if (!cellp) {
*a_name = strdup("");
- MUTEX_EXIT(&callp->lock);
return 0;
}
--- 1106,1128 ----
ntohl(host),
ntohs(port));
+ #ifdef HOLD_CALL_MUTEX
MUTEX_EXIT(&callp->lock);
+ #endif
return code;
}
/* debug interface */
! static int
! GetCellCommon(afs_int32 a_cellnum, char **a_name, serverList *a_hosts)
{
afs_int32 sn;
cm_cell_t * cellp;
cm_serverRef_t * serverRefp;
! cellp = cm_FindCellByID(a_cellnum, CM_FLAG_NOPROBE);
if (!cellp) {
*a_name = strdup("");
return 0;
}
***************
*** 1134,1145 ****
}
lock_ReleaseRead(&cm_serverLock);
- MUTEX_EXIT(&callp->lock);
return 0;
}
/* debug interface */
int
SRXAFSCB_TellMeAboutYourself( struct rx_call *callp,
struct interfaceAddr *addr,
Capabilities * capabilities)
--- 1144,1188 ----
}
lock_ReleaseRead(&cm_serverLock);
return 0;
}
/* debug interface */
int
+ SRXAFSCB_GetCellByNum(struct rx_call *callp, afs_int32 a_cellnum,
+ char **a_name, serverList *a_hosts)
+ {
+ struct rx_connection *connp;
+ struct rx_peer *peerp;
+ unsigned long host = 0;
+ unsigned short port = 0;
+ int rc;
+
+ #ifdef HOLD_CALL_MUTEX
+ MUTEX_ENTER(&callp->lock);
+ #endif
+ if ((connp = rx_ConnectionOf(callp)) && (peerp = rx_PeerOf(connp))) {
+ host = rx_HostOf(peerp);
+ port = rx_PortOf(peerp);
+ }
+
+ osi_Log3(afsd_logp, "SRXAFSCB_GetCellByNum(%d) from host 0x%x port %d",
+ a_cellnum, ntohl(host), ntohs(port));
+
+ a_hosts->serverList_val = 0;
+ a_hosts->serverList_len = 0;
+
+
+ rc = GetCellCommon(a_cellnum, a_name, a_hosts);
+
+ #ifdef HOLD_CALL_MUTEX
+ MUTEX_EXIT(&callp->lock);
+ #endif
+ return rc;
+ }
+
+ /* debug interface */
+ int
SRXAFSCB_TellMeAboutYourself( struct rx_call *callp,
struct interfaceAddr *addr,
Capabilities * capabilities)
***************
*** 1158,1165 ****
unsigned long host = 0;
unsigned short port = 0;
MUTEX_ENTER(&callp->lock);
!
if ((connp = rx_ConnectionOf(callp)) && (peerp = rx_PeerOf(connp))) {
host = rx_HostOf(peerp);
port = rx_PortOf(peerp);
--- 1201,1209 ----
unsigned long host = 0;
unsigned short port = 0;
+ #ifdef HOLD_CALL_MUTEX
MUTEX_ENTER(&callp->lock);
! #endif
if ((connp = rx_ConnectionOf(callp)) && (peerp = rx_PeerOf(connp))) {
host = rx_HostOf(peerp);
port = rx_PortOf(peerp);
***************
*** 1191,1197 ****
--- 1235,1243 ----
capabilities->Capabilities_len = dataBytes / sizeof(afs_int32);
capabilities->Capabilities_val = dataBuffP;
+ #ifdef HOLD_CALL_MUTEX
MUTEX_EXIT(&callp->lock);
+ #endif
return 0;
}
***************
*** 1228,1235 ****
unsigned long host = 0;
unsigned short port = 0;
MUTEX_ENTER(&callp->lock);
!
if ((connp = rx_ConnectionOf(callp)) && (peerp = rx_PeerOf(connp))) {
host = rx_HostOf(peerp);
port = rx_PortOf(peerp);
--- 1274,1282 ----
unsigned long host = 0;
unsigned short port = 0;
+ #ifdef HOLD_CALL_MUTEX
MUTEX_ENTER(&callp->lock);
! #endif
if ((connp = rx_ConnectionOf(callp)) && (peerp = rx_PeerOf(connp))) {
host = rx_HostOf(peerp);
port = rx_PortOf(peerp);
***************
*** 1242,1248 ****
--- 1289,1297 ----
*a_srvr_addr = 0xffffffff;
*a_srvr_rank = 0xffffffff;
+ #ifdef HOLD_CALL_MUTEX
MUTEX_EXIT(&callp->lock);
+ #endif
return 0;
}
***************
*** 1271,1284 ****
int SRXAFSCB_GetCellServDB(struct rx_call *callp, afs_int32 index, char **a_name,
serverList *a_hosts)
{
- char *t_name;
struct rx_connection *connp;
struct rx_peer *peerp;
unsigned long host = 0;
unsigned short port = 0;
MUTEX_ENTER(&callp->lock);
!
if ((connp = rx_ConnectionOf(callp)) && (peerp = rx_PeerOf(connp))) {
host = rx_HostOf(peerp);
port = rx_PortOf(peerp);
--- 1320,1334 ----
int SRXAFSCB_GetCellServDB(struct rx_call *callp, afs_int32 index, char **a_name,
serverList *a_hosts)
{
struct rx_connection *connp;
struct rx_peer *peerp;
unsigned long host = 0;
unsigned short port = 0;
+ int rc;
+ #ifdef HOLD_CALL_MUTEX
MUTEX_ENTER(&callp->lock);
! #endif
if ((connp = rx_ConnectionOf(callp)) && (peerp = rx_PeerOf(connp))) {
host = rx_HostOf(peerp);
port = rx_PortOf(peerp);
***************
*** 1287,1298 ****
osi_Log2(afsd_logp, "SRXAFSCB_GetCellServDB from host 0x%x port %d - not implemented",
ntohl(host), ntohs(port));
! t_name = (char *)malloc(AFSNAMEMAX);
! t_name[0] = '\0';
! *a_name = t_name;
! a_hosts->serverList_len = 0;
!
! MUTEX_EXIT(&callp->lock);
return 0;
}
--- 1337,1350 ----
osi_Log2(afsd_logp, "SRXAFSCB_GetCellServDB from host 0x%x port %d - not implemented",
ntohl(host), ntohs(port));
! #ifdef AFS_FREELANCE_CLIENT
! if (cm_freelanceEnabled && index == 0) {
! rc = GetCellCommon(AFS_FAKE_ROOT_CELL_ID, a_name, a_hosts);
! } else
! #endif
! {
! rc = GetCellCommon(index+1, a_name, a_hosts);
! }
return 0;
}
***************
*** 1324,1331 ****
unsigned long host = 0;
unsigned short port = 0;
MUTEX_ENTER(&callp->lock);
!
if ((connp = rx_ConnectionOf(callp)) && (peerp = rx_PeerOf(connp))) {
host = rx_HostOf(peerp);
port = rx_PortOf(peerp);
--- 1376,1384 ----
unsigned long host = 0;
unsigned short port = 0;
+ #ifdef HOLD_CALL_MUTEX
MUTEX_ENTER(&callp->lock);
! #endif
if ((connp = rx_ConnectionOf(callp)) && (peerp = rx_PeerOf(connp))) {
host = rx_HostOf(peerp);
port = rx_PortOf(peerp);
***************
*** 1343,1349 ****
--- 1396,1404 ----
}
*a_name = t_name;
+ #ifdef HOLD_CALL_MUTEX
MUTEX_EXIT(&callp->lock);
+ #endif
return 0;
}
***************
*** 1423,1430 ****
unsigned long host = 0;
unsigned short port = 0;
MUTEX_ENTER(&callp->lock);
!
if ((connp = rx_ConnectionOf(callp)) && (peerp = rx_PeerOf(connp))) {
host = rx_HostOf(peerp);
port = rx_PortOf(peerp);
--- 1478,1486 ----
unsigned long host = 0;
unsigned short port = 0;
+ #ifdef HOLD_CALL_MUTEX
MUTEX_ENTER(&callp->lock);
! #endif
if ((connp = rx_ConnectionOf(callp)) && (peerp = rx_PeerOf(connp))) {
host = rx_HostOf(peerp);
port = rx_PortOf(peerp);
***************
*** 1452,1458 ****
--- 1508,1516 ----
config->cacheConfig_val = t_config;
config->cacheConfig_len = (*configCount)/sizeof(afs_uint32);
+ #ifdef HOLD_CALL_MUTEX
MUTEX_EXIT(&callp->lock);
+ #endif
return 0;
}
***************
*** 1874,1881 ****
lock_ReleaseMutex(&scp->mx);
cm_CallbackNotifyChange(scp);
- cm_ReleaseSCacheNoLock(scp);
lock_ObtainWrite(&cm_scacheLock);
}
}
}
--- 1932,1939 ----
lock_ReleaseMutex(&scp->mx);
cm_CallbackNotifyChange(scp);
lock_ObtainWrite(&cm_scacheLock);
+ cm_ReleaseSCacheNoLock(scp);
}
}
}
***************
*** 1911,1919 ****
lock_ObtainMutex(&tsp->mx);
if (!(tsp->flags & CM_SERVERFLAG_DOWN)) {
tsp->flags |= CM_SERVERFLAG_DOWN;
! tsp->downTime = osi_Time();
}
cm_ForceNewConnections(tsp);
/* Now update the volume status */
for (tsrvp = tsp->vols; tsrvp; tsrvp = tsrvp->nextp) {
for (i=0; imx);
if (!(tsp->flags & CM_SERVERFLAG_DOWN)) {
tsp->flags |= CM_SERVERFLAG_DOWN;
! tsp->downTime = time(NULL);
}
cm_ForceNewConnections(tsp);
+
/* Now update the volume status */
for (tsrvp = tsp->vols; tsrvp; tsrvp = tsrvp->nextp) {
for (i=0; icellp, tsrvp->ids[i], cm_rootUserp,
! &req, CM_GETVOL_FLAG_NO_LRU_UPDATE, &volp);
if (code == 0) {
cm_UpdateVolumeStatus(volp, tsrvp->ids[i]);
cm_PutVolume(volp);
--- 1982,1988 ----
cm_InitReq(&req);
code = cm_GetVolumeByID(tsp->cellp, tsrvp->ids[i], cm_rootUserp,
! &req, CM_GETVOL_FLAG_NO_LRU_UPDATE | CM_GETVOL_FLAG_NO_RESET, &volp);
if (code == 0) {
cm_UpdateVolumeStatus(volp, tsrvp->ids[i]);
cm_PutVolume(volp);
Index: openafs/src/WINNT/afsd/cm_cell.c
diff -c openafs/src/WINNT/afsd/cm_cell.c:1.23.2.9 openafs/src/WINNT/afsd/cm_cell.c:1.23.2.12
*** openafs/src/WINNT/afsd/cm_cell.c:1.23.2.9 Fri Dec 28 02:13:15 2007
--- openafs/src/WINNT/afsd/cm_cell.c Fri Feb 1 16:39:41 2008
***************
*** 35,42 ****
cm_server_t *tsp;
cm_serverRef_t *tsrp;
cm_cell_t *cellp;
! cellp = rockp;
/* if this server was previously created by fs setserverprefs */
if ( tsp = cm_FindServer(addrp, CM_SERVER_VLDB))
--- 35,45 ----
cm_server_t *tsp;
cm_serverRef_t *tsrp;
cm_cell_t *cellp;
+ cm_cell_rock_t *cellrockp = (cm_cell_rock_t *)rockp;
+ afs_uint32 probe;
! cellp = cellrockp->cellp;
! probe = !(cellrockp->flags & CM_FLAG_NOPROBE);
/* if this server was previously created by fs setserverprefs */
if ( tsp = cm_FindServer(addrp, CM_SERVER_VLDB))
***************
*** 51,57 ****
}
}
else
! tsp = cm_NewServer(addrp, CM_SERVER_VLDB, cellp);
/* Insert the vlserver into a sorted list, sorted by server rank */
tsrp = cm_NewServerRef(tsp, 0);
--- 54,60 ----
}
}
else
! tsp = cm_NewServer(addrp, CM_SERVER_VLDB, cellp, probe ? 0 : CM_FLAG_NOPROBE);
/* Insert the vlserver into a sorted list, sorted by server rank */
tsrp = cm_NewServerRef(tsp, 0);
***************
*** 68,76 ****
* and check to make sure we have a valid set of volume servers
* this function must be called with a Write Lock on cm_cellLock
*/
! cm_cell_t *cm_UpdateCell(cm_cell_t * cp)
{
long code = 0;
if (cp == NULL)
return NULL;
--- 71,80 ----
* and check to make sure we have a valid set of volume servers
* this function must be called with a Write Lock on cm_cellLock
*/
! static cm_cell_t *cm_UpdateCell(cm_cell_t * cp, afs_uint32 flags)
{
long code = 0;
+ cm_cell_rock_t rock;
if (cp == NULL)
return NULL;
***************
*** 92,104 ****
cp->vlServersp = NULL;
}
! code = cm_SearchCellFile(cp->name, NULL, cm_AddCellProc, cp);
#ifdef AFS_AFSDB_ENV
if (code) {
if (cm_dnsEnabled) {
int ttl;
! code = cm_SearchCellByDNS(cp->name, NULL, &ttl, cm_AddCellProc, cp);
if (code == 0) { /* got cell from DNS */
cp->flags |= CM_CELLFLAG_DNS;
cp->flags &= ~CM_CELLFLAG_VLSERVER_INVALID;
--- 96,110 ----
cp->vlServersp = NULL;
}
! rock.cellp = cp;
! rock.flags = flags;
! code = cm_SearchCellFile(cp->name, NULL, cm_AddCellProc, &rock);
#ifdef AFS_AFSDB_ENV
if (code) {
if (cm_dnsEnabled) {
int ttl;
! code = cm_SearchCellByDNS(cp->name, NULL, &ttl, cm_AddCellProc, &rock);
if (code == 0) { /* got cell from DNS */
cp->flags |= CM_CELLFLAG_DNS;
cp->flags &= ~CM_CELLFLAG_VLSERVER_INVALID;
***************
*** 123,129 ****
return code ? NULL : cp;
}
! /* load up a cell structure from the cell database, afsdcell.ini */
cm_cell_t *cm_GetCell(char *namep, afs_uint32 flags)
{
return cm_GetCell_Gen(namep, NULL, flags);
--- 129,135 ----
return code ? NULL : cp;
}
! /* load up a cell structure from the cell database, AFS_CELLSERVDB */
cm_cell_t *cm_GetCell(char *namep, afs_uint32 flags)
{
return cm_GetCell_Gen(namep, NULL, flags);
***************
*** 136,141 ****
--- 142,148 ----
char fullname[200]="";
int hasWriteLock = 0;
afs_uint32 hash;
+ cm_cell_rock_t rock;
if (!strcmp(namep,SMB_IOCTL_FILENAME_NOSLASH))
return NULL;
***************
*** 162,168 ****
lock_ReleaseRead(&cm_cellLock);
if (cp) {
! cm_UpdateCell(cp);
} else if (flags & CM_FLAG_CREATE) {
lock_ObtainWrite(&cm_cellLock);
hasWriteLock = 1;
--- 169,175 ----
lock_ReleaseRead(&cm_cellLock);
if (cp) {
! cm_UpdateCell(cp, flags);
} else if (flags & CM_FLAG_CREATE) {
lock_ObtainWrite(&cm_cellLock);
hasWriteLock = 1;
***************
*** 200,206 ****
memset(cp, 0, sizeof(cm_cell_t));
cp->magic = CM_CELL_MAGIC;
! code = cm_SearchCellFile(namep, fullname, cm_AddCellProc, cp);
if (code) {
osi_Log3(afsd_logp,"in cm_GetCell_gen cm_SearchCellFile(%s) returns code= %d fullname= %s",
osi_LogSaveString(afsd_logp,namep), code, osi_LogSaveString(afsd_logp,fullname));
--- 207,215 ----
memset(cp, 0, sizeof(cm_cell_t));
cp->magic = CM_CELL_MAGIC;
! rock.cellp = cp;
! rock.flags = flags;
! code = cm_SearchCellFile(namep, fullname, cm_AddCellProc, &rock);
if (code) {
osi_Log3(afsd_logp,"in cm_GetCell_gen cm_SearchCellFile(%s) returns code= %d fullname= %s",
osi_LogSaveString(afsd_logp,namep), code, osi_LogSaveString(afsd_logp,fullname));
***************
*** 209,215 ****
if (cm_dnsEnabled) {
int ttl;
! code = cm_SearchCellByDNS(namep, fullname, &ttl, cm_AddCellProc, cp);
if ( code ) {
osi_Log3(afsd_logp,"in cm_GetCell_gen cm_SearchCellByDNS(%s) returns code= %d fullname= %s",
osi_LogSaveString(afsd_logp,namep), code, osi_LogSaveString(afsd_logp,fullname));
--- 218,224 ----
if (cm_dnsEnabled) {
int ttl;
! code = cm_SearchCellByDNS(namep, fullname, &ttl, cm_AddCellProc, &rock);
if ( code ) {
osi_Log3(afsd_logp,"in cm_GetCell_gen cm_SearchCellByDNS(%s) returns code= %d fullname= %s",
osi_LogSaveString(afsd_logp,namep), code, osi_LogSaveString(afsd_logp,fullname));
***************
*** 288,294 ****
return cp;
}
! cm_cell_t *cm_FindCellByID(afs_int32 cellID)
{
cm_cell_t *cp;
afs_uint32 hash;
--- 297,303 ----
return cp;
}
! cm_cell_t *cm_FindCellByID(afs_int32 cellID, afs_uint32 flags)
{
cm_cell_t *cp;
afs_uint32 hash;
***************
*** 304,310 ****
lock_ReleaseRead(&cm_cellLock);
if (cp)
! cm_UpdateCell(cp);
return cp;
}
--- 313,319 ----
lock_ReleaseRead(&cm_cellLock);
if (cp)
! cm_UpdateCell(cp, flags);
return cp;
}
Index: openafs/src/WINNT/afsd/cm_cell.h
diff -c openafs/src/WINNT/afsd/cm_cell.h:1.7.6.5 openafs/src/WINNT/afsd/cm_cell.h:1.7.6.7
*** openafs/src/WINNT/afsd/cm_cell.h:1.7.6.5 Wed Jun 27 20:34:26 2007
--- openafs/src/WINNT/afsd/cm_cell.h Thu Jan 31 00:49:00 2008
***************
*** 36,41 ****
--- 36,47 ----
#define CM_CELLFLAG_IN_NAMEHASH 0x10
#define CM_CELLFLAG_IN_IDHASH 0x20
+ typedef struct cm_cell_rock {
+ cm_cell_t * cellp;
+ afs_uint32 flags;
+ } cm_cell_rock_t;
+
+
#define CM_CELL_NAME_HASH(name) (SDBMHash(name) % cm_data.cellHashTableSize)
#define CM_CELL_ID_HASH(id) ((unsigned long) id % cm_data.cellHashTableSize)
***************
*** 50,56 ****
extern cm_cell_t *cm_GetCell_Gen(char *namep, char *newnamep, afs_uint32 flags);
! extern cm_cell_t *cm_FindCellByID(afs_int32 cellID);
extern void cm_ChangeRankCellVLServer(cm_server_t *tsp);
--- 56,62 ----
extern cm_cell_t *cm_GetCell_Gen(char *namep, char *newnamep, afs_uint32 flags);
! extern cm_cell_t *cm_FindCellByID(afs_int32 cellID, afs_uint32 flags);
extern void cm_ChangeRankCellVLServer(cm_server_t *tsp);
***************
*** 64,67 ****
--- 70,75 ----
extern void cm_AddCellToIDHashTable(cm_cell_t * cellp);
+ extern long cm_AddCellProc(void *rockp, struct sockaddr_in *addrp, char *namep);
+
#endif /* __CELL_H_ENV_ */
Index: openafs/src/WINNT/afsd/cm_config.c
diff -c openafs/src/WINNT/afsd/cm_config.c:1.26.4.1 openafs/src/WINNT/afsd/cm_config.c:1.26.4.3
*** openafs/src/WINNT/afsd/cm_config.c:1.26.4.1 Wed Jun 27 20:34:26 2007
--- openafs/src/WINNT/afsd/cm_config.c Fri Feb 1 21:48:13 2008
***************
*** 7,19 ****
* directory or online at http://www.openafs.org/dl/license10.html
*/
- #ifndef DJGPP
#include
#include
- #else
- #include
- #include
- #endif /* !DJGPP */
#include
#include
#include
--- 7,14 ----
***************
*** 31,57 ****
#include
#endif
-
-
- /* TODO: these should be pulled in from dirpath.h */
- #if !defined(DJGPP) && !defined(AFS_WIN95_ENV)
- #define AFS_THISCELL "ThisCell"
- #endif
- #define AFS_CELLSERVDB_UNIX "CellServDB"
- #define AFS_CELLSERVDB_NT "afsdcell.ini"
- #ifndef AFSDIR_CLIENT_ETC_DIRPATH
- #define AFSDIR_CLIENT_ETC_DIRPATH "c:/afs"
- #endif
- #if defined(DJGPP) || defined(AFS_WIN95_ENV)
- #define AFS_CELLSERVDB AFS_CELLSERVDB_UNIX
- #ifdef DJGPP
- extern char cm_confDir[];
- extern int errno;
- #endif /* DJGPP */
- #else
- #define AFS_CELLSERVDB AFS_CELLSERVDB_UNIX
- #endif /* DJGPP || WIN95 */
-
static long cm_ParsePair(char *lineBufferp, char *leftp, char *rightp)
{
char *tp;
--- 26,31 ----
***************
*** 152,195 ****
int foundCell = 0;
long code;
int tracking = 1, partial = 0;
- #if defined(DJGPP) || defined(AFS_WIN95_ENV)
- char *afsconf_path;
- DWORD dwSize;
- #endif
if ( IsWindowsModule(cellNamep) )
return -3;
! cm_GetCellServDB(wdir);
tfilep = fopen(wdir, "r");
! #if defined(DJGPP) || defined(AFS_WIN95_ENV)
! if (!tfilep) {
! /* If we are using DJGPP client, cellservdb will be in afsconf dir. */
! /* If we are in Win95 here, we are linking with klog etc. and are
! using DJGPP client even though DJGPP is not defined. So we still
! need to check AFSCONF for location. */
! dwSize = GetEnvironmentVariable("AFSCONF", NULL, 0);
! afsconf_path = malloc(dwSize);
! dwSize = GetEnvironmentVariable("AFSCONF", afsconf_path, dwSize);
! if (!afsconf_path)
! strcpy(wdir, AFSDIR_CLIENT_ETC_DIRPATH);
! else {
! strcpy(wdir, afsconf_path);
! free(afsconf_path);
! }
! strcat(wdir, "/");
! strcat(wdir, AFS_CELLSERVDB);
! /*fprintf(stderr, "opening cellservdb file %s\n", wdir);*/
! tfilep = fopen(wdir, "r");
! if (!tfilep)
! return -2;
! }
! #else
! /* If we are NT or higher, we don't do DJGPP, So just fail */
! if ( !tfilep )
return -2;
- #endif
bestp = fopen(wdir, "r");
--- 126,140 ----
int foundCell = 0;
long code;
int tracking = 1, partial = 0;
if ( IsWindowsModule(cellNamep) )
return -3;
! cm_GetCellServDB(wdir, sizeof(wdir));
tfilep = fopen(wdir, "r");
! if (!tfilep)
return -2;
bestp = fopen(wdir, "r");
***************
*** 273,279 ****
else inRightCell = 0;
}
else {
- #if !defined(DJGPP) && !defined(AFS_WIN95_ENV)
valuep = strchr(lineBuffer, '#');
if (valuep == NULL) {
fclose(tfilep);
--- 218,223 ----
***************
*** 289,297 ****
while (valuep[strlen(valuep) - 1] == ' ' || valuep[strlen(valuep) - 1] == '\t')
valuep[strlen(valuep) - 1] = '\0';
- #endif /* !DJGPP */
if (inRightCell) {
- #if !defined(DJGPP) && !defined(AFS_WIN95_ENV)
/* add the server to the VLDB list */
WSASetLastError(0);
thp = gethostbyname(valuep);
--- 233,239 ----
***************
*** 308,316 ****
(*procp)(rockp, &vlSockAddr, valuep);
foundCell = 1;
}
- #else
- thp = 0;
- #endif /* !DJGPP */
if (!thp) {
long ip_addr;
int c1, c2, c3, c4;
--- 250,255 ----
***************
*** 379,527 ****
#endif /* AFS_AFSDB_ENV */
}
! #if !defined(DJGPP) && !defined(AFS_WIN95_ENV)
! /* look up the CellServDBDir's name in the Registry
! * or use the Client Dirpath value to produce a CellServDB
! * filename
*/
! long cm_GetCellServDB(char *cellNamep)
{
- #if !defined(DJGPP)
- DWORD code, dummyLen;
- HKEY parmKey;
int tlen;
!
! code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSREG_CLT_OPENAFS_SUBKEY,
! 0, KEY_QUERY_VALUE, &parmKey);
! if (code != ERROR_SUCCESS)
! goto dirpath;
!
! dummyLen = 256;
! code = RegQueryValueEx(parmKey, "CellServDBDir", NULL, NULL,
! cellNamep, &dummyLen);
! RegCloseKey (parmKey);
!
! dirpath:
! if (code != ERROR_SUCCESS || cellNamep[0] == 0)
! strcpy(cellNamep, AFSDIR_CLIENT_ETC_DIRPATH);
/* add trailing backslash, if required */
tlen = (int)strlen(cellNamep);
! if (cellNamep[tlen-1] != '\\')
! strcat(cellNamep, "\\");
! #else
! strcpy(cellNamep, cm_confDir);
! strcat(cellNamep,"/");
! #endif /* !DJGPP */
! strcat(cellNamep, AFS_CELLSERVDB);
! return 0;
}
/* look up the root cell's name in the Registry */
long cm_GetRootCellName(char *cellNamep)
{
! DWORD code, dummyLen;
! HKEY parmKey;
! code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSREG_CLT_SVC_PARAM_SUBKEY,
! 0, KEY_QUERY_VALUE, &parmKey);
! if (code != ERROR_SUCCESS)
! return -1;
! dummyLen = 256;
! code = RegQueryValueEx(parmKey, "Cell", NULL, NULL,
cellNamep, &dummyLen);
! RegCloseKey (parmKey);
! if (code != ERROR_SUCCESS || cellNamep[0] == 0)
! return -1;
!
! return 0;
! }
! #else
! /* look up the root cell's name in the THISCELL file */
! long cm_GetRootCellName(char *cellNamep)
! {
! FILE *thisCell;
! char thisCellPath[256];
! char *newline;
! DWORD dwSize;
!
! #ifdef DJGPP
! strcpy(thisCellPath, cm_confDir);
! #else
! /* Win 95 */
! char *afsconf_path;
! dwSize = GetEnvironmentVariable("AFSCONF", NULL, 0);
! afsconf_path = malloc(dwSize);
! dwSize = GetEnvironmentVariable("AFSCONF", afsconf_path, dwSize);
! if (!afsconf_path)
! strcpy(thisCellPath, AFSDIR_CLIENT_ETC_DIRPATH);
! else {
! strcpy(thisCellPath, afsconf_path);
! free(afsconf_path);
! }
! #endif
! strcat(thisCellPath,"/");
!
! strcat(thisCellPath, AFS_THISCELL);
! thisCell = fopen(thisCellPath, "r");
! if (thisCell == NULL)
! return -1;
!
! fgets(cellNamep, 256, thisCell);
! fclose(thisCell);
!
! newline = strrchr(cellNamep,'\n');
! if (newline) *newline = '\0';
! newline = strrchr(cellNamep,'\r');
! if (newline) *newline = '\0';
! return 0;
}
- #endif /* !DJGPP */
cm_configFile_t *cm_CommonOpen(char *namep, char *rwp)
{
char wdir[256];
- long tlen;
FILE *tfilep;
! #if !defined(DJGPP) && !defined(AFS_WIN95_ENV)
! strcpy(wdir, AFSDIR_CLIENT_ETC_DIRPATH);
!
! /* add trailing backslash, if required */
! tlen = (long)(strlen(wdir));
! if (wdir[tlen-1] != '\\') strcat(wdir, "\\");
! #else
! #ifdef DJGPP
! strcpy(wdir,cm_confDir);
! #else
! DWORD dwSize;
! char *afsconf_path;
!
! dwSize = GetEnvironmentVariable("AFSCONF", NULL, 0);
! afsconf_path = malloc(dwSize);
! dwSize = GetEnvironmentVariable("AFSCONF", afsconf_path, dwSize);
!
! if (!afsconf_path)
! strcpy(wdir, AFSDIR_CLIENT_ETC_DIRPATH);
! else {
! strcpy(wdir, afsconf_path);
! free(afsconf_path);
! }
! #endif /* !DJGPP */
! strcat(wdir,"/");
! #endif /* DJGPP || WIN95 */
! strcat(wdir, namep);
tfilep = fopen(wdir, rwp);
return ((cm_configFile_t *) tfilep);
}
- #ifndef DJGPP
long cm_WriteConfigString(char *labelp, char *valuep)
{
DWORD code, dummyDisp;
--- 318,381 ----
#endif /* AFS_AFSDB_ENV */
}
! /* use cm_GetConfigDir() plus AFS_CELLSERVDB to
! * generate the fully qualified name of the CellServDB
! * file.
*/
! long cm_GetCellServDB(char *cellNamep, afs_uint32 len)
{
int tlen;
!
! cm_GetConfigDir(cellNamep, len);
/* add trailing backslash, if required */
tlen = (int)strlen(cellNamep);
! if (cellNamep[tlen-1] != '\\') {
! strncat(cellNamep, "\\", len);
! cellNamep[len-1] = '\0';
! }
! strncat(cellNamep, AFS_CELLSERVDB, len);
! cellNamep[len-1] = '\0';
! return 0;
}
/* look up the root cell's name in the Registry */
long cm_GetRootCellName(char *cellNamep)
{
! DWORD code, dummyLen;
! HKEY parmKey;
! code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSREG_CLT_SVC_PARAM_SUBKEY,
! 0, KEY_QUERY_VALUE, &parmKey);
! if (code != ERROR_SUCCESS)
! return -1;
! dummyLen = 256;
! code = RegQueryValueEx(parmKey, "Cell", NULL, NULL,
cellNamep, &dummyLen);
! RegCloseKey (parmKey);
! if (code != ERROR_SUCCESS || cellNamep[0] == 0)
! return -1;
! return 0;
}
cm_configFile_t *cm_CommonOpen(char *namep, char *rwp)
{
char wdir[256];
FILE *tfilep;
! cm_GetConfigDir(wdir, sizeof(wdir));
! strncat(wdir, namep, sizeof(wdir));
! wdir[sizeof(wdir)-1] = '\0';
tfilep = fopen(wdir, rwp);
return ((cm_configFile_t *) tfilep);
}
long cm_WriteConfigString(char *labelp, char *valuep)
{
DWORD code, dummyDisp;
***************
*** 541,707 ****
return (long)0;
}
- #endif /* !DJGPP */
- #ifndef DJGPP
long cm_WriteConfigInt(char *labelp, long value)
{
! DWORD code, dummyDisp;
! HKEY parmKey;
! code = RegCreateKeyEx(HKEY_LOCAL_MACHINE, AFSREG_CLT_SVC_PARAM_SUBKEY,
! 0, "container", 0, KEY_SET_VALUE, NULL,
! &parmKey, &dummyDisp);
! if (code != ERROR_SUCCESS)
! return -1;
!
! code = RegSetValueEx(parmKey, labelp, 0, REG_DWORD,
! (LPBYTE)&value, sizeof(value));
! RegCloseKey (parmKey);
! if (code != ERROR_SUCCESS)
! return -1;
! return 0;
}
- #endif /* !DJGPP */
cm_configFile_t *cm_OpenCellFile(void)
{
! cm_configFile_t *cfp;
! cfp = cm_CommonOpen("afsdcel2.ini", "w");
! return cfp;
}
long cm_AppendPrunedCellList(cm_configFile_t *ofp, char *cellNamep)
{
! cm_configFile_t *tfilep; /* input file */
! char *tp;
! char lineBuffer[256];
! char *valuep;
! int inRightCell;
! int foundCell;
!
! tfilep = cm_CommonOpen(AFS_CELLSERVDB, "r");
! if (!tfilep) return -1;
!
! foundCell = 0;
!
! /* have we seen the cell line for the guy we're looking for? */
! inRightCell = 0;
! while (1) {
! tp = fgets(lineBuffer, sizeof(lineBuffer), (FILE *)tfilep);
! if (tp == NULL) {
! if (feof((FILE *)tfilep)) {
! /* hit EOF */
! fclose((FILE *)tfilep);
! return 0;
! }
! }
!
! /* turn trailing cr or lf into null */
! tp = strchr(lineBuffer, '\r');
! if (tp) *tp = 0;
! tp = strchr(lineBuffer, '\n');
! if (tp) *tp = 0;
! /* skip blank lines */
! if (lineBuffer[0] == 0) {
! fprintf((FILE *)ofp, "%s\n", lineBuffer);
! continue;
! }
! if (lineBuffer[0] == '>') {
! /* trim off at white space or '#' chars */
! tp = strchr(lineBuffer, ' ');
! if (tp) *tp = 0;
! tp = strchr(lineBuffer, '\t');
! if (tp) *tp = 0;
! tp = strchr(lineBuffer, '#');
! if (tp) *tp = 0;
!
! /* now see if this is the right cell */
! if (strcmp(lineBuffer+1, cellNamep) == 0) {
! /* found the cell we're looking for */
! inRightCell = 1;
! }
! else {
! inRightCell = 0;
! fprintf((FILE *)ofp, "%s\n", lineBuffer);
! }
! }
! else {
! valuep = strchr(lineBuffer, '#');
! if (valuep == NULL) return -2;
! valuep++; /* skip the "#" */
! if (!inRightCell) {
! fprintf((FILE *)ofp, "%s\n", lineBuffer);
! }
! } /* a vldb line */
! } /* while loop processing all lines */
! }
long cm_AppendNewCell(cm_configFile_t *filep, char *cellNamep)
{
! fprintf((FILE *)filep, ">%s\n", cellNamep);
! return 0;
}
long cm_AppendNewCellLine(cm_configFile_t *filep, char *linep)
{
! fprintf((FILE *)filep, "%s\n", linep);
! return 0;
}
long cm_CloseCellFile(cm_configFile_t *filep)
{
! char wdir[256];
! char sdir[256];
long code;
long closeCode;
! int tlen;
! #ifdef AFS_WIN95_ENV
! char *afsconf_path;
! DWORD dwSize;
! #endif
! closeCode = fclose((FILE *)filep);
!
! #if !defined(DJGPP) && !defined(AFS_WIN95_ENV)
! strcpy(wdir, AFSDIR_CLIENT_ETC_DIRPATH);
!
! /* add trailing backslash, if required */
! tlen = (int)strlen(wdir);
! if (wdir[tlen-1] != '\\') strcat(wdir, "\\");
! #else
! #ifdef DJGPP
! strcpy(wdir,cm_confDir);
! #else
! dwSize = GetEnvironmentVariable("AFSCONF", NULL, 0);
! afsconf_path = malloc(dwSize);
! dwSize = GetEnvironmentVariable("AFSCONF", afsconf_path, dwSize);
! if (!afsconf_path)
! strcpy(wdir, AFSDIR_CLIENT_ETC_DIRPATH);
! else {
! strcpy(wdir, afsconf_path);
! free(afsconf_path);
! }
! #endif /* !DJGPP */
! strcat(wdir,"/");
! #endif /* DJGPP || WIN95 */
strcpy(sdir, wdir);
! if (closeCode != 0) {
! /* something went wrong, preserve original database */
! strcat(wdir, "afsdcel2.ini");
unlink(wdir);
return closeCode;
}
! strcat(wdir, AFS_CELLSERVDB);
! strcat(sdir, "afsdcel2.ini"); /* new file */
! unlink(wdir); /* delete old file */
code = rename(sdir, wdir); /* do the rename */
--- 395,535 ----
return (long)0;
}
long cm_WriteConfigInt(char *labelp, long value)
{
! DWORD code, dummyDisp;
! HKEY parmKey;
! code = RegCreateKeyEx(HKEY_LOCAL_MACHINE, AFSREG_CLT_SVC_PARAM_SUBKEY,
! 0, "container", 0, KEY_SET_VALUE, NULL,
! &parmKey, &dummyDisp);
! if (code != ERROR_SUCCESS)
! return -1;
! code = RegSetValueEx(parmKey, labelp, 0, REG_DWORD,
! (LPBYTE)&value, sizeof(value));
! RegCloseKey (parmKey);
! if (code != ERROR_SUCCESS)
! return -1;
!
! return 0;
}
cm_configFile_t *cm_OpenCellFile(void)
{
! cm_configFile_t *cfp;
! cfp = cm_CommonOpen(AFS_CELLSERVDB ".new", "w");
! return cfp;
}
long cm_AppendPrunedCellList(cm_configFile_t *ofp, char *cellNamep)
{
! cm_configFile_t *tfilep; /* input file */
! char *tp;
! char lineBuffer[256];
! char *valuep;
! int inRightCell;
! int foundCell;
!
! tfilep = cm_CommonOpen(AFS_CELLSERVDB, "r");
! if (!tfilep)
! return -1;
!
! foundCell = 0;
!
! /* have we seen the cell line for the guy we're looking for? */
! inRightCell = 0;
! while (1) {
! tp = fgets(lineBuffer, sizeof(lineBuffer), (FILE *)tfilep);
! if (tp == NULL) {
! if (feof((FILE *)tfilep)) {
! /* hit EOF */
! fclose((FILE *)tfilep);
! return 0;
! }
! }
!
! /* turn trailing cr or lf into null */
! tp = strchr(lineBuffer, '\r');
! if (tp) *tp = 0;
! tp = strchr(lineBuffer, '\n');
! if (tp) *tp = 0;
! /* skip blank lines */
! if (lineBuffer[0] == 0) {
! fprintf((FILE *)ofp, "%s\n", lineBuffer);
! continue;
! }
! if (lineBuffer[0] == '>') {
! /* trim off at white space or '#' chars */
! tp = strchr(lineBuffer, ' ');
! if (tp) *tp = 0;
! tp = strchr(lineBuffer, '\t');
! if (tp) *tp = 0;
! tp = strchr(lineBuffer, '#');
! if (tp) *tp = 0;
!
! /* now see if this is the right cell */
! if (strcmp(lineBuffer+1, cellNamep) == 0) {
! /* found the cell we're looking for */
! inRightCell = 1;
! }
! else {
! inRightCell = 0;
! fprintf((FILE *)ofp, "%s\n", lineBuffer);
! }
! }
! else {
! valuep = strchr(lineBuffer, '#');
! if (valuep == NULL) return -2;
! valuep++; /* skip the "#" */
! if (!inRightCell) {
! fprintf((FILE *)ofp, "%s\n", lineBuffer);
! }
! } /* a vldb line */
! } /* while loop processing all lines */
! }
long cm_AppendNewCell(cm_configFile_t *filep, char *cellNamep)
{
! fprintf((FILE *)filep, ">%s\n", cellNamep);
! return 0;
}
long cm_AppendNewCellLine(cm_configFile_t *filep, char *linep)
{
! fprintf((FILE *)filep, "%s\n", linep);
! return 0;
}
long cm_CloseCellFile(cm_configFile_t *filep)
{
! char wdir[260];
! char sdir[260];
long code;
long closeCode;
! closeCode = fclose((FILE *)filep);
+ cm_GetConfigDir(wdir, sizeof(wdir));
strcpy(sdir, wdir);
! if (closeCode != 0) {
! /* something went wrong, preserve original database */
! strncat(wdir, AFS_CELLSERVDB ".new", sizeof(wdir));
! wdir[sizeof(wdir)-1] = '\0';
unlink(wdir);
return closeCode;
}
! strncat(wdir, AFS_CELLSERVDB, sizeof(wdir));
! wdir[sizeof(wdir)-1] = '\0';
! strncat(sdir, AFS_CELLSERVDB ".new", sizeof(sdir));/* new file */
! sdir[sizeof(sdir)-1] = '\0';
! unlink(sdir); /* delete old file */
code = rename(sdir, wdir); /* do the rename */
***************
*** 711,746 ****
return code;
}
! void cm_GetConfigDir(char *dir)
{
! char wdir[256];
! int tlen;
! #ifdef AFS_WIN95_ENV
! char *afsconf_path;
! DWORD dwSize;
! #endif
! #if !defined(DJGPP) && !defined(AFS_WIN95_ENV)
! strcpy(wdir, AFSDIR_CLIENT_ETC_DIRPATH);
!
! /* add trailing backslash, if required */
! tlen = (int)strlen(wdir);
! if (wdir[tlen-1] != '\\') strcat(wdir, "\\");
! #else
! #ifdef DJGPP
! strcpy(wdir,cm_confDir);
! #else
! dwSize = GetEnvironmentVariable("AFSCONF", NULL, 0);
! afsconf_path = malloc(dwSize);
! dwSize = GetEnvironmentVariable("AFSCONF", afsconf_path, dwSize);
! if (!afsconf_path)
! strcpy(wdir, AFSDIR_CLIENT_ETC_DIRPATH);
! else {
! strcpy(wdir, afsconf_path);
! free(afsconf_path);
}
- #endif /* !DJGPP */
- strcat(wdir,"\\");
- #endif /* DJGPP || WIN95 */
- strcpy(dir, wdir);
}
--- 539,553 ----
return code;
}
! void cm_GetConfigDir(char *dir, afs_uint32 len)
{
! char * dirp = NULL;
! if (!afssw_GetClientCellServDBDir(&dirp)) {
! strncpy(dir, dirp, len);
! dir[len-1] = '\0';
! free(dirp);
! } else {
! dir[0] = '\0';
}
}
Index: openafs/src/WINNT/afsd/cm_config.h
diff -c openafs/src/WINNT/afsd/cm_config.h:1.8.6.3 openafs/src/WINNT/afsd/cm_config.h:1.8.6.4
*** openafs/src/WINNT/afsd/cm_config.h:1.8.6.3 Fri Dec 28 02:09:11 2007
--- openafs/src/WINNT/afsd/cm_config.h Fri Feb 1 16:39:41 2008
***************
*** 21,29 ****
#ifndef __CM_CONFIG_INTERFACES_ONLY__
#include
- #ifdef DJGPP
- #include
- #endif /* DJGPP */
typedef FILE cm_configFile_t;
--- 21,26 ----
***************
*** 51,59 ****
extern long cm_CloseCellFile(cm_configFile_t *filep);
! extern long cm_GetCellServDB(char *cellNamep);
! extern void cm_GetConfigDir(char *dir);
#endif /* __CM_CONFIG_INTERFACES_ONLY__ */
--- 48,61 ----
extern long cm_CloseCellFile(cm_configFile_t *filep);
! extern long cm_GetCellServDB(char *cellNamep, afs_uint32 len);
! extern void cm_GetConfigDir(char *dir, afs_uint32 len);
!
! /* TODO: these should be pulled in from dirpath.h */
! #define AFS_THISCELL "ThisCell"
! #define AFS_CELLSERVDB_UNIX "CellServDB"
! #define AFS_CELLSERVDB AFS_CELLSERVDB_UNIX
#endif /* __CM_CONFIG_INTERFACES_ONLY__ */
Index: openafs/src/WINNT/afsd/cm_conn.c
diff -c openafs/src/WINNT/afsd/cm_conn.c:1.49.2.25 openafs/src/WINNT/afsd/cm_conn.c:1.49.2.30
*** openafs/src/WINNT/afsd/cm_conn.c:1.49.2.25 Wed Nov 14 12:19:41 2007
--- openafs/src/WINNT/afsd/cm_conn.c Thu Feb 7 09:48:53 2008
***************
*** 122,128 ****
return CM_ERROR_INVAL;
}
! cellp = cm_FindCellByID(fidp->cell);
if (!cellp)
return CM_ERROR_NOSUCHCELL;
--- 122,128 ----
return CM_ERROR_INVAL;
}
! cellp = cm_FindCellByID(fidp->cell, 0);
if (!cellp)
return CM_ERROR_NOSUCHCELL;
***************
*** 226,232 ****
}
}
if (cellp == NULL && fidp) {
! cellp = cm_FindCellByID(fidp->cell);
}
}
--- 226,232 ----
}
}
if (cellp == NULL && fidp) {
! cellp = cm_FindCellByID(fidp->cell, 0);
}
}
***************
*** 278,286 ****
* background daemon thread as they become available
*/
if (timeLeft > 7 && fidp) {
- cm_volume_t *volp;
- cm_vol_state_t *statep;
-
thrd_Sleep(5000);
code = cm_GetVolumeByID(cellp, fidp->volume, userp, reqp,
--- 278,283 ----
***************
*** 394,410 ****
else if (fidp->volume == volp->bk.ID)
statep = &volp->bk;
}
-
- cm_PutVolume(volp);
}
break;
}
}
lock_ReleaseWrite(&cm_serverLock);
! if (statep)
cm_UpdateVolumeStatus(volp, statep->ID);
!
if (free_svr_list) {
cm_FreeServerList(&serversp, 0);
*serverspp = serversp;
--- 391,407 ----
else if (fidp->volume == volp->bk.ID)
statep = &volp->bk;
}
}
break;
}
}
lock_ReleaseWrite(&cm_serverLock);
! if (statep) {
cm_UpdateVolumeStatus(volp, statep->ID);
! cm_PutVolume(volp);
! }
!
if (free_svr_list) {
cm_FreeServerList(&serversp, 0);
*serverspp = serversp;
***************
*** 480,497 ****
free_svr_list = 1;
}
}
for (tsrp = serversp; tsrp; tsrp=tsrp->next) {
if (tsrp->server == serverp) {
/* REDIRECT */
! if (errorCode == VNOVOL || errorCode == VMOVED) {
tsrp->status = srv_deleted;
! if (fidp) {
! cm_ForceUpdateVolume(fidp, userp, reqp);
! }
! } else
tsrp->status = srv_offline;
}
}
if (free_svr_list) {
cm_FreeServerList(&serversp, 0);
*serverspp = serversp;
--- 477,517 ----
free_svr_list = 1;
}
}
+ lock_ObtainWrite(&cm_serverLock);
for (tsrp = serversp; tsrp; tsrp=tsrp->next) {
if (tsrp->server == serverp) {
/* REDIRECT */
! if (errorCode == VMOVED) {
tsrp->status = srv_deleted;
! } else {
tsrp->status = srv_offline;
+ }
+
+ if (fidp) { /* File Server query */
+ code = cm_GetVolumeByID(cellp, fidp->volume, userp, reqp,
+ CM_GETVOL_FLAG_NO_LRU_UPDATE,
+ &volp);
+ if (code == 0) {
+ if (fidp->volume == volp->rw.ID)
+ statep = &volp->rw;
+ else if (fidp->volume == volp->ro.ID)
+ statep = &volp->ro;
+ else if (fidp->volume == volp->bk.ID)
+ statep = &volp->bk;
+ }
+ }
}
}
+ lock_ReleaseWrite(&cm_serverLock);
+
+ if (fidp && errorCode == VMOVED)
+ cm_ForceUpdateVolume(fidp, userp, reqp);
+
+ if (statep) {
+ cm_UpdateVolumeStatus(volp, statep->ID);
+ cm_PutVolume(volp);
+ }
+
if (free_svr_list) {
cm_FreeServerList(&serversp, 0);
*serverspp = serversp;
***************
*** 563,569 ****
if (reqp->flags & CM_REQ_NEW_CONN_FORCED) {
if (!(serverp->flags & CM_SERVERFLAG_DOWN)) {
serverp->flags |= CM_SERVERFLAG_DOWN;
! serverp->downTime = osi_Time();
}
} else {
reqp->flags |= CM_REQ_NEW_CONN_FORCED;
--- 583,589 ----
if (reqp->flags & CM_REQ_NEW_CONN_FORCED) {
if (!(serverp->flags & CM_SERVERFLAG_DOWN)) {
serverp->flags |= CM_SERVERFLAG_DOWN;
! serverp->downTime = time(NULL);
}
} else {
reqp->flags |= CM_REQ_NEW_CONN_FORCED;
Index: openafs/src/WINNT/afsd/cm_daemon.c
diff -c openafs/src/WINNT/afsd/cm_daemon.c:1.16.4.22 openafs/src/WINNT/afsd/cm_daemon.c:1.16.4.25
*** openafs/src/WINNT/afsd/cm_daemon.c:1.16.4.22 Sat Jan 5 12:56:29 2008
--- openafs/src/WINNT/afsd/cm_daemon.c Thu Jan 10 18:00:41 2008
***************
*** 50,55 ****
--- 50,56 ----
static int daemon_ShutdownFlag = 0;
static int cm_nDaemons = 0;
+ static time_t lastIPAddrChange = 0;
static EVENT_HANDLE cm_Daemon_ShutdownEvent = NULL;
static EVENT_HANDLE cm_IPAddrDaemon_ShutdownEvent = NULL;
***************
*** 74,90 ****
thrd_SetEvent(cm_IPAddrDaemon_ShutdownEvent);
Result = NotifyAddrChange(NULL,NULL);
if (Result == NO_ERROR && daemon_ShutdownFlag == 0) {
! smb_LanAdapterChange();
thrd_ResetEvent(cm_IPAddrDaemon_ShutdownEvent);
- Sleep(2500);
- if (daemon_ShutdownFlag == 0) {
- osi_Log0(afsd_logp, "cm_IpAddrDaemon CheckDownServers");
- cm_CheckServers(CM_FLAG_CHECKVLDBSERVERS | CM_FLAG_CHECKUPSERVERS | CM_FLAG_CHECKDOWNSERVERS, NULL);
- cm_ForceNewConnectionsAllServers();
- cm_CheckServers(CM_FLAG_CHECKFILESERVERS | CM_FLAG_CHECKUPSERVERS | CM_FLAG_CHECKDOWNSERVERS, NULL);
- smb_CheckVCs();
- cm_VolStatus_Network_Addr_Change();
- }
}
}
--- 75,83 ----
thrd_SetEvent(cm_IPAddrDaemon_ShutdownEvent);
Result = NotifyAddrChange(NULL,NULL);
if (Result == NO_ERROR && daemon_ShutdownFlag == 0) {
! lastIPAddrChange = osi_Time();
! smb_SetLanAdapterChangeDetected();
thrd_ResetEvent(cm_IPAddrDaemon_ShutdownEvent);
}
}
***************
*** 355,360 ****
--- 348,354 ----
HMODULE hHookDll;
char * name = "cm_Daemon_ShutdownEvent";
int configureFirewall = IsWindowsFirewallPresent();
+ int bAddrChangeCheck = 0;
cm_Daemon_ShutdownEvent = thrd_CreateEvent(NULL, FALSE, FALSE, name);
if ( GetLastError() == ERROR_ALREADY_EXISTS )
***************
*** 401,407 ****
/* check to see if the listener threads halted due to network
* disconnect or other issues. If so, attempt to restart them.
*/
! smb_RestartListeners();
if (daemon_ShutdownFlag == 1)
break;
--- 395,401 ----
/* check to see if the listener threads halted due to network
* disconnect or other issues. If so, attempt to restart them.
*/
! smb_RestartListeners(0);
if (daemon_ShutdownFlag == 1)
break;
***************
*** 429,437 ****
/* find out what time it is */
now = osi_Time();
/* check down servers */
! if (now > lastDownServerCheck + cm_daemonCheckDownInterval &&
daemon_ShutdownFlag == 0) {
lastDownServerCheck = now;
osi_Log0(afsd_logp, "cm_Daemon CheckDownServers");
--- 423,440 ----
/* find out what time it is */
now = osi_Time();
+
+ /* Determine whether an address change took place that we need to respond to */
+ if (bAddrChangeCheck)
+ bAddrChangeCheck = 0;
+
+ if (lastIPAddrChange != 0 && lastIPAddrChange + 2500 < now) {
+ bAddrChangeCheck = 1;
+ lastIPAddrChange = 0;
+ }
/* check down servers */
! if ((bAddrChangeCheck || now > lastDownServerCheck + cm_daemonCheckDownInterval) &&
daemon_ShutdownFlag == 0) {
lastDownServerCheck = now;
osi_Log0(afsd_logp, "cm_Daemon CheckDownServers");
***************
*** 441,448 ****
now = osi_Time();
}
/* check up servers */
! if (now > lastUpServerCheck + cm_daemonCheckUpInterval &&
daemon_ShutdownFlag == 0) {
lastUpServerCheck = now;
osi_Log0(afsd_logp, "cm_Daemon CheckUpServers");
--- 444,454 ----
now = osi_Time();
}
+ if (bAddrChangeCheck)
+ cm_ForceNewConnectionsAllServers();
+
/* check up servers */
! if ((bAddrChangeCheck || now > lastUpServerCheck + cm_daemonCheckUpInterval) &&
daemon_ShutdownFlag == 0) {
lastUpServerCheck = now;
osi_Log0(afsd_logp, "cm_Daemon CheckUpServers");
***************
*** 452,457 ****
--- 458,468 ----
now = osi_Time();
}
+ if (bAddrChangeCheck) {
+ smb_CheckVCs();
+ cm_VolStatus_Network_Addr_Change();
+ }
+
if (now > lastVolCheck + cm_daemonCheckVolInterval &&
daemon_ShutdownFlag == 0) {
lastVolCheck = now;
***************
*** 471,477 ****
now = osi_Time();
}
! if (now > lastBusyVolCheck + cm_daemonCheckOfflineVolInterval &&
daemon_ShutdownFlag == 0) {
lastVolCheck = now;
cm_CheckOfflineVolumes();
--- 482,488 ----
now = osi_Time();
}
! if ((bAddrChangeCheck || now > lastBusyVolCheck + cm_daemonCheckOfflineVolInterval) &&
daemon_ShutdownFlag == 0) {
lastVolCheck = now;
cm_CheckOfflineVolumes();
***************
*** 529,535 ****
if (daemon_ShutdownFlag == 1) {
break;
}
! thrd_Sleep(30 * 1000); /* sleep 30 seconds */
}
thrd_SetEvent(cm_Daemon_ShutdownEvent);
}
--- 540,546 ----
if (daemon_ShutdownFlag == 1) {
break;
}
! thrd_Sleep(10000); /* sleep 10 seconds */
}
thrd_SetEvent(cm_Daemon_ShutdownEvent);
}
Index: openafs/src/WINNT/afsd/cm_freelance.c
diff -c openafs/src/WINNT/afsd/cm_freelance.c:1.33.2.4 openafs/src/WINNT/afsd/cm_freelance.c:1.33.2.6
*** openafs/src/WINNT/afsd/cm_freelance.c:1.33.2.4 Sun Nov 4 19:24:46 2007
--- openafs/src/WINNT/afsd/cm_freelance.c Fri Feb 1 16:39:41 2008
***************
*** 477,483 ****
char line[512];
char*t, *t2;
cm_localMountPoint_t* aLocalMountPoint;
! char hdir[120];
long code;
char rootCellName[256];
#if !defined(DJGPP)
--- 477,483 ----
char line[512];
char*t, *t2;
cm_localMountPoint_t* aLocalMountPoint;
! char hdir[260];
long code;
char rootCellName[256];
#if !defined(DJGPP)
***************
*** 686,692 ****
/* What follows is the old code to read freelance mount points
* out of a text file modified to copy the data into the registry
*/
! cm_GetConfigDir(hdir);
strcat(hdir, AFS_FREELANCE_INI);
// open the ini file for reading
fp = fopen(hdir, "r");
--- 686,692 ----
/* What follows is the old code to read freelance mount points
* out of a text file modified to copy the data into the registry
*/
! cm_GetConfigDir(hdir, sizeof(hdir));
strcat(hdir, AFS_FREELANCE_INI);
// open the ini file for reading
fp = fopen(hdir, "r");
***************
*** 821,827 ****
}
#if !defined(DJGPP)
! long cm_FreelanceMountPointExists(char * filename)
{
char* cp;
char line[512];
--- 821,827 ----
}
#if !defined(DJGPP)
! long cm_FreelanceMountPointExists(char * filename, int prefix_ok)
{
char* cp;
char line[512];
***************
*** 889,894 ****
--- 889,899 ----
found = 1;
break;
}
+
+ if (prefix_ok && strlen(shortname) - strlen(filename) == 1 && !strncmp(shortname, filename, strlen(filename))) {
+ found = 1;
+ break;
+ }
}
RegCloseKey(hkFreelance);
}
***************
*** 898,904 ****
return found;
}
! long cm_FreelanceSymlinkExists(char * filename)
{
char* cp;
char line[512];
--- 903,909 ----
return found;
}
! long cm_FreelanceSymlinkExists(char * filename, int prefix_ok)
{
char* cp;
char line[512];
***************
*** 946,951 ****
--- 951,961 ----
found = 1;
break;
}
+
+ if (prefix_ok && strlen(shortname) - strlen(filename) == 1 && !strncmp(shortname, filename, strlen(filename))) {
+ found = 1;
+ break;
+ }
}
for ( dwIndex = 0; dwIndex < dwSymlinks; dwIndex++ ) {
TCHAR szValueName[16];
***************
*** 975,981 ****
long cm_FreelanceAddMount(char *filename, char *cellname, char *volume, int rw, cm_fid_t *fidp)
{
FILE *fp;
! char hfile[120];
char line[512];
char fullname[200];
int n;
--- 985,991 ----
long cm_FreelanceAddMount(char *filename, char *cellname, char *volume, int rw, cm_fid_t *fidp)
{
FILE *fp;
! char hfile[260];
char line[512];
char fullname[200];
int n;
***************
*** 1009,1016 ****
}
#if !defined(DJGPP)
! if ( cm_FreelanceMountPointExists(filename) ||
! cm_FreelanceSymlinkExists(filename) )
return -1;
#endif
--- 1019,1026 ----
}
#if !defined(DJGPP)
! if ( cm_FreelanceMountPointExists(filename, 0) ||
! cm_FreelanceSymlinkExists(filename, 0) )
return -1;
#endif
***************
*** 1076,1082 ****
} else
#endif
{
! cm_GetConfigDir(hfile);
strcat(hfile, AFS_FREELANCE_INI);
fp = fopen(hfile, "r+");
if (!fp)
--- 1086,1092 ----
} else
#endif
{
! cm_GetConfigDir(hfile, sizeof(hfile));
strcat(hfile, AFS_FREELANCE_INI);
fp = fopen(hfile, "r+");
if (!fp)
***************
*** 1110,1116 ****
char* cp;
char line[512];
char shortname[200];
! char hfile[120], hfile2[120];
FILE *fp1, *fp2;
int found=0;
#if !defined(DJGPP)
--- 1120,1126 ----
char* cp;
char line[512];
char shortname[200];
! char hfile[260], hfile2[260];
FILE *fp1, *fp2;
int found=0;
#if !defined(DJGPP)
***************
*** 1165,1171 ****
} else
#endif
{
! cm_GetConfigDir(hfile);
strcat(hfile, AFS_FREELANCE_INI);
strcpy(hfile2, hfile);
strcat(hfile2, "2");
--- 1175,1181 ----
} else
#endif
{
! cm_GetConfigDir(hfile, sizeof(hfile));
strcat(hfile, AFS_FREELANCE_INI);
strcpy(hfile2, hfile);
strcat(hfile2, "2");
***************
*** 1246,1253 ****
}
#if !defined(DJGPP)
! if ( cm_FreelanceMountPointExists(filename) ||
! cm_FreelanceSymlinkExists(filename) )
return CM_ERROR_EXISTS;
#endif
--- 1256,1263 ----
}
#if !defined(DJGPP)
! if ( cm_FreelanceMountPointExists(filename, 0) ||
! cm_FreelanceSymlinkExists(filename, 0) )
return CM_ERROR_EXISTS;
#endif
Index: openafs/src/WINNT/afsd/cm_freelance.h
diff -c openafs/src/WINNT/afsd/cm_freelance.h:1.12.6.1 openafs/src/WINNT/afsd/cm_freelance.h:1.12.6.2
*** openafs/src/WINNT/afsd/cm_freelance.h:1.12.6.1 Sat Dec 22 22:39:59 2007
--- openafs/src/WINNT/afsd/cm_freelance.h Mon Jan 28 02:23:35 2008
***************
*** 19,24 ****
--- 19,26 ----
extern long cm_FreelanceAddMount(char *filename, char *cellname, char *volume, int rw, cm_fid_t *fidp);
extern long cm_FreelanceRemoveSymlink(char *toremove);
extern long cm_FreelanceAddSymlink(char *filename, char *destination, cm_fid_t *fidp);
+ extern long cm_FreelanceMountPointExists(char * filename, int prefix_ok);
+ extern long cm_FreelanceSymlinkExists(char * filename, int prefix_ok);
extern int cm_clearLocalMountPointChange();
extern int cm_FakeRootFid(cm_fid_t *fidp);
Index: openafs/src/WINNT/afsd/cm_ioctl.c
diff -c openafs/src/WINNT/afsd/cm_ioctl.c:1.73.2.29 openafs/src/WINNT/afsd/cm_ioctl.c:1.73.2.35
*** openafs/src/WINNT/afsd/cm_ioctl.c:1.73.2.29 Fri Jan 4 02:58:40 2008
--- openafs/src/WINNT/afsd/cm_ioctl.c Tue Feb 5 15:49:30 2008
***************
*** 211,218 ****
/* parse the passed-in file name and do a namei on it. If we fail,
* return an error code, otherwise return the vnode located in *scpp.
*/
long cm_ParseIoctlPath(smb_ioctl_t *ioctlp, cm_user_t *userp, cm_req_t *reqp,
! cm_scache_t **scpp)
{
long code;
#ifndef AFSIFS
--- 211,220 ----
/* parse the passed-in file name and do a namei on it. If we fail,
* return an error code, otherwise return the vnode located in *scpp.
*/
+ #define CM_PARSE_FLAG_LITERAL 1
+
long cm_ParseIoctlPath(smb_ioctl_t *ioctlp, cm_user_t *userp, cm_req_t *reqp,
! cm_scache_t **scpp, afs_uint32 flags)
{
long code;
#ifndef AFSIFS
***************
*** 221,227 ****
#endif
char * relativePath;
char * lastComponent = NULL;
! afs_uint32 follow = 0;
relativePath = ioctlp->inDatap;
/* setup the next data value for the caller to use */
--- 223,229 ----
#endif
char * relativePath;
char * lastComponent = NULL;
! afs_uint32 follow = (flags & CM_PARSE_FLAG_LITERAL ? CM_FLAG_NOMOUNTCHASE : CM_FLAG_FOLLOW);
relativePath = ioctlp->inDatap;
/* setup the next data value for the caller to use */
***************
*** 236,245 ****
* \\netbios-name\submount\path\.
* \\netbios-name\submount\path\file
*/
! TranslateExtendedChars(relativePath);
/* This is usually nothing, but for StatMountPoint it is the file name. */
! TranslateExtendedChars(ioctlp->inDatap);
#ifdef AFSIFS
/* we have passed the whole path, including the afs prefix.
--- 238,253 ----
* \\netbios-name\submount\path\.
* \\netbios-name\submount\path\file
*/
!
! /* We do not perform path name translation on the ioctl path data
! * because these paths were not translated by Windows through the
! * file system API. Therefore, they are not OEM characters but
! * whatever the display character set is.
! */
! // TranslateExtendedChars(relativePath);
/* This is usually nothing, but for StatMountPoint it is the file name. */
! // TranslateExtendedChars(ioctlp->inDatap);
#ifdef AFSIFS
/* we have passed the whole path, including the afs prefix.
***************
*** 247,253 ****
and it returns the correct (full) path. therefore, there is
no drive letter, and the path is absolute. */
code = cm_NameI(cm_data.rootSCachep, relativePath,
! CM_FLAG_CASEFOLD | follow,
userp, "", reqp, scpp);
if (code) {
--- 255,261 ----
and it returns the correct (full) path. therefore, there is
no drive letter, and the path is absolute. */
code = cm_NameI(cm_data.rootSCachep, relativePath,
! CM_FLAG_CASEFOLD,
userp, "", reqp, scpp);
if (code) {
***************
*** 300,306 ****
code = cm_NameI(substRootp, p, CM_FLAG_CASEFOLD | CM_FLAG_FOLLOW,
userp, NULL, reqp, &iscp);
if (code == 0)
! code = cm_NameI(iscp, lastComponent, CM_FLAG_CASEFOLD | CM_FLAG_NOMOUNTCHASE,
userp, NULL, reqp, scpp);
if (iscp)
cm_ReleaseSCache(iscp);
--- 308,314 ----
code = cm_NameI(substRootp, p, CM_FLAG_CASEFOLD | CM_FLAG_FOLLOW,
userp, NULL, reqp, &iscp);
if (code == 0)
! code = cm_NameI(iscp, lastComponent, CM_FLAG_CASEFOLD | follow,
userp, NULL, reqp, scpp);
if (iscp)
cm_ReleaseSCache(iscp);
***************
*** 347,353 ****
code = cm_NameI(substRootp, p, CM_FLAG_CASEFOLD | CM_FLAG_FOLLOW,
userp, NULL, reqp, &iscp);
if (code == 0)
! code = cm_NameI(iscp, lastComponent, CM_FLAG_CASEFOLD | CM_FLAG_NOMOUNTCHASE,
userp, NULL, reqp, scpp);
if (iscp)
cm_ReleaseSCache(iscp);
--- 355,361 ----
code = cm_NameI(substRootp, p, CM_FLAG_CASEFOLD | CM_FLAG_FOLLOW,
userp, NULL, reqp, &iscp);
if (code == 0)
! code = cm_NameI(iscp, lastComponent, CM_FLAG_CASEFOLD | follow,
userp, NULL, reqp, scpp);
if (iscp)
cm_ReleaseSCache(iscp);
***************
*** 379,390 ****
code = cm_NameI(substRootp, relativePath, CM_FLAG_CASEFOLD | CM_FLAG_FOLLOW,
userp, NULL, reqp, &iscp);
if (code == 0)
! code = cm_NameI(iscp, lastComponent, CM_FLAG_CASEFOLD | CM_FLAG_NOMOUNTCHASE,
userp, NULL, reqp, scpp);
if (iscp)
cm_ReleaseSCache(iscp);
} else {
! code = cm_NameI(substRootp, relativePath, CM_FLAG_CASEFOLD,
userp, NULL, reqp, scpp);
}
if (code) {
--- 387,398 ----
code = cm_NameI(substRootp, relativePath, CM_FLAG_CASEFOLD | CM_FLAG_FOLLOW,
userp, NULL, reqp, &iscp);
if (code == 0)
! code = cm_NameI(iscp, lastComponent, CM_FLAG_CASEFOLD | follow,
userp, NULL, reqp, scpp);
if (iscp)
cm_ReleaseSCache(iscp);
} else {
! code = cm_NameI(substRootp, relativePath, CM_FLAG_CASEFOLD | follow,
userp, NULL, reqp, scpp);
}
if (code) {
***************
*** 405,416 ****
void cm_SkipIoctlPath(smb_ioctl_t *ioctlp)
{
! long temp;
! temp = (long) strlen(ioctlp->inDatap) + 1;
ioctlp->inDatap += temp;
}
/* format the specified path to look like "/afs//usr", by
* adding "/afs" (if necessary) in front, changing any \'s to /'s, and
--- 413,454 ----
void cm_SkipIoctlPath(smb_ioctl_t *ioctlp)
{
! size_t temp;
! temp = strlen(ioctlp->inDatap) + 1;
ioctlp->inDatap += temp;
}
+ /*
+ * Must be called before cm_ParseIoctlPath or cm_SkipIoctlPath
+ */
+ static cm_ioctlQueryOptions_t *
+ cm_IoctlGetQueryOptions(struct smb_ioctl *ioctlp, struct cm_user *userp)
+ {
+ afs_uint32 pathlen = strlen(ioctlp->inDatap) + 1;
+ char *p = ioctlp->inDatap + pathlen;
+ cm_ioctlQueryOptions_t * optionsp = NULL;
+
+ if (ioctlp->inCopied > p - ioctlp->inAllocp) {
+ optionsp = (cm_ioctlQueryOptions_t *)p;
+ if (optionsp->size < 12 /* minimum size of struct */)
+ optionsp = NULL;
+ }
+
+ return optionsp;
+ }
+
+ /*
+ * Must be called after cm_ParseIoctlPath or cm_SkipIoctlPath
+ * or any other time that ioctlp->inDatap points at the
+ * cm_ioctlQueryOptions_t object.
+ */
+ static void
+ cm_IoctlSkipQueryOptions(struct smb_ioctl *ioctlp, struct cm_user *userp)
+ {
+ cm_ioctlQueryOptions_t * optionsp = (cm_ioctlQueryOptions_t *)ioctlp->inDatap;
+ ioctlp->inDatap += optionsp->size;
+ }
/* format the specified path to look like "/afs//usr", by
* adding "/afs" (if necessary) in front, changing any \'s to /'s, and
***************
*** 576,586 ****
int tlen;
cm_req_t req;
struct rx_connection * callp;
cm_InitReq(&req);
! code = cm_ParseIoctlPath(ioctlp, userp, &req, &scp);
! if (code) return code;
/* now make the get acl call */
#ifdef AFS_FREELANCE_CLIENT
--- 614,637 ----
int tlen;
cm_req_t req;
struct rx_connection * callp;
+ cm_ioctlQueryOptions_t *optionsp;
+ afs_uint32 flags = 0;
cm_InitReq(&req);
! optionsp = cm_IoctlGetQueryOptions(ioctlp, userp);
! if (optionsp && CM_IOCTL_QOPTS_HAVE_LITERAL(optionsp))
! flags |= (optionsp->literal ? CM_PARSE_FLAG_LITERAL : 0);
!
! if (optionsp && CM_IOCTL_QOPTS_HAVE_FID(optionsp)) {
! cm_SkipIoctlPath(ioctlp);
!
! code = cm_GetSCache(&optionsp->fid, &scp, userp, &req);
! } else {
! code = cm_ParseIoctlPath(ioctlp, userp, &req, &scp, flags);
! }
! if (code)
! return code;
/* now make the get acl call */
#ifdef AFS_FREELANCE_CLIENT
***************
*** 623,633 ****
cm_scache_t *scp;
cm_cell_t *cellp;
cm_req_t req;
cm_InitReq(&req);
! code = cm_ParseIoctlPath(ioctlp, userp, &req, &scp);
! if (code) return code;
#ifdef AFS_FREELANCE_CLIENT
if ( cm_freelanceEnabled &&
--- 674,696 ----
cm_scache_t *scp;
cm_cell_t *cellp;
cm_req_t req;
+ cm_ioctlQueryOptions_t *optionsp;
+ afs_uint32 flags = 0;
cm_InitReq(&req);
! optionsp = cm_IoctlGetQueryOptions(ioctlp, userp);
! if (optionsp && CM_IOCTL_QOPTS_HAVE_LITERAL(optionsp))
! flags |= (optionsp->literal ? CM_PARSE_FLAG_LITERAL : 0);
!
! if (optionsp && CM_IOCTL_QOPTS_HAVE_FID(optionsp)) {
! cm_SkipIoctlPath(ioctlp);
! code = cm_GetSCache(&optionsp->fid, &scp, userp, &req);
! } else {
! code = cm_ParseIoctlPath(ioctlp, userp, &req, &scp, flags);
! }
! if (code)
! return code;
#ifdef AFS_FREELANCE_CLIENT
if ( cm_freelanceEnabled &&
***************
*** 640,646 ****
} else
#endif /* AFS_FREELANCE_CLIENT */
{
! cellp = cm_FindCellByID(scp->fid.cell);
if (cellp) {
StringCbCopyA(ioctlp->outDatap, SMB_IOCTL_MAXDATA - (ioctlp->outDatap - ioctlp->outAllocp), cellp->name);
ioctlp->outDatap += strlen(ioctlp->outDatap) + 1;
--- 703,709 ----
} else
#endif /* AFS_FREELANCE_CLIENT */
{
! cellp = cm_FindCellByID(scp->fid.cell, CM_FLAG_NOPROBE);
if (cellp) {
StringCbCopyA(ioctlp->outDatap, SMB_IOCTL_MAXDATA - (ioctlp->outDatap - ioctlp->outAllocp), cellp->name);
ioctlp->outDatap += strlen(ioctlp->outDatap) + 1;
***************
*** 668,674 ****
cm_InitReq(&req);
! code = cm_ParseIoctlPath(ioctlp, userp, &req, &scp);
if (code) return code;
#ifdef AFS_FREELANCE_CLIENT
--- 731,737 ----
cm_InitReq(&req);
! code = cm_ParseIoctlPath(ioctlp, userp, &req, &scp, 0);
if (code) return code;
#ifdef AFS_FREELANCE_CLIENT
***************
*** 715,720 ****
--- 778,785 ----
cm_InitReq(&req);
+ cm_SkipIoctlPath(ioctlp); /* we don't care about the path */
+
lock_ObtainWrite(&cm_scacheLock);
for (i=0; inextp) {
***************
*** 739,750 ****
unsigned long volume;
unsigned long cell;
cm_req_t req;
cm_InitReq(&req);
! code = cm_ParseIoctlPath(ioctlp, userp, &req, &scp);
! if (code) return code;
!
#ifdef AFS_FREELANCE_CLIENT
if ( scp->fid.cell == AFS_FAKE_ROOT_CELL_ID && scp->fid.volume == AFS_FAKE_ROOT_VOL_ID ) {
code = CM_ERROR_NOACCESS;
--- 804,827 ----
unsigned long volume;
unsigned long cell;
cm_req_t req;
+ cm_ioctlQueryOptions_t *optionsp;
+ afs_uint32 flags = 0;
cm_InitReq(&req);
! optionsp = cm_IoctlGetQueryOptions(ioctlp, userp);
! if (optionsp && CM_IOCTL_QOPTS_HAVE_LITERAL(optionsp))
! flags |= (optionsp->literal ? CM_PARSE_FLAG_LITERAL : 0);
!
! if (optionsp && CM_IOCTL_QOPTS_HAVE_FID(optionsp)) {
! cm_SkipIoctlPath(ioctlp);
! code = cm_GetSCache(&optionsp->fid, &scp, userp, &req);
! } else {
! code = cm_ParseIoctlPath(ioctlp, userp, &req, &scp, flags);
! }
! if (code)
! return code;
!
#ifdef AFS_FREELANCE_CLIENT
if ( scp->fid.cell == AFS_FAKE_ROOT_CELL_ID && scp->fid.volume == AFS_FAKE_ROOT_VOL_ID ) {
code = CM_ERROR_NOACCESS;
***************
*** 765,776 ****
long code;
cm_scache_t *scp;
cm_req_t req;
cm_InitReq(&req);
! code = cm_ParseIoctlPath(ioctlp, userp, &req, &scp);
! if (code) return code;
!
#ifdef AFS_FREELANCE_CLIENT
if ( scp->fid.cell == AFS_FAKE_ROOT_CELL_ID && scp->fid.volume == AFS_FAKE_ROOT_VOL_ID ) {
code = CM_ERROR_NOACCESS;
--- 842,865 ----
long code;
cm_scache_t *scp;
cm_req_t req;
+ cm_ioctlQueryOptions_t *optionsp;
+ afs_uint32 flags = 0;
cm_InitReq(&req);
! optionsp = cm_IoctlGetQueryOptions(ioctlp, userp);
! if (optionsp && CM_IOCTL_QOPTS_HAVE_LITERAL(optionsp))
! flags |= (optionsp->literal ? CM_PARSE_FLAG_LITERAL : 0);
!
! if (optionsp && CM_IOCTL_QOPTS_HAVE_FID(optionsp)) {
! cm_SkipIoctlPath(ioctlp);
! code = cm_GetSCache(&optionsp->fid, &scp, userp, &req);
! } else {
! code = cm_ParseIoctlPath(ioctlp, userp, &req, &scp, flags);
! }
! if (code)
! return code;
!
#ifdef AFS_FREELANCE_CLIENT
if ( scp->fid.cell == AFS_FAKE_ROOT_CELL_ID && scp->fid.volume == AFS_FAKE_ROOT_VOL_ID ) {
code = CM_ERROR_NOACCESS;
***************
*** 802,808 ****
cm_InitReq(&req);
! code = cm_ParseIoctlPath(ioctlp, userp, &req, &scp);
if (code) return code;
#ifdef AFS_FREELANCE_CLIENT
--- 891,897 ----
cm_InitReq(&req);
! code = cm_ParseIoctlPath(ioctlp, userp, &req, &scp, 0);
if (code) return code;
#ifdef AFS_FREELANCE_CLIENT
***************
*** 811,817 ****
} else
#endif
{
! cellp = cm_FindCellByID(scp->fid.cell);
osi_assertx(cellp, "null cm_cell_t");
if (scp->flags & CM_SCACHEFLAG_RO) {
--- 900,906 ----
} else
#endif
{
! cellp = cm_FindCellByID(scp->fid.cell, 0);
osi_assertx(cellp, "null cm_cell_t");
if (scp->flags & CM_SCACHEFLAG_RO) {
***************
*** 900,910 ****
char *MOTD;
cm_req_t req;
struct rx_connection * callp;
cm_InitReq(&req);
! code = cm_ParseIoctlPath(ioctlp, userp, &req, &scp);
! if (code) return code;
#ifdef AFS_FREELANCE_CLIENT
if ( scp->fid.cell == AFS_FAKE_ROOT_CELL_ID && scp->fid.volume == AFS_FAKE_ROOT_VOL_ID ) {
--- 989,1011 ----
char *MOTD;
cm_req_t req;
struct rx_connection * callp;
+ cm_ioctlQueryOptions_t *optionsp;
+ afs_uint32 flags = 0;
cm_InitReq(&req);
! optionsp = cm_IoctlGetQueryOptions(ioctlp, userp);
! if (optionsp && CM_IOCTL_QOPTS_HAVE_LITERAL(optionsp))
! flags |= (optionsp->literal ? CM_PARSE_FLAG_LITERAL : 0);
!
! if (optionsp && CM_IOCTL_QOPTS_HAVE_FID(optionsp)) {
! cm_SkipIoctlPath(ioctlp);
! code = cm_GetSCache(&optionsp->fid, &scp, userp, &req);
! } else {
! code = cm_ParseIoctlPath(ioctlp, userp, &req, &scp, flags);
! }
! if (code)
! return code;
#ifdef AFS_FREELANCE_CLIENT
if ( scp->fid.cell == AFS_FAKE_ROOT_CELL_ID && scp->fid.volume == AFS_FAKE_ROOT_VOL_ID ) {
***************
*** 963,975 ****
register char *cp;
cm_fid_t fid;
cm_req_t req;
cm_InitReq(&req);
! code = cm_ParseIoctlPath(ioctlp, userp, &req, &scp);
if (code) return code;
memset(&fid, 0, sizeof(cm_fid_t));
fid.volume = scp->fid.volume;
fid.vnode = scp->fid.vnode;
fid.unique = scp->fid.unique;
--- 1064,1083 ----
register char *cp;
cm_fid_t fid;
cm_req_t req;
+ cm_ioctlQueryOptions_t * optionsp;
+ afs_uint32 flags = 0;
cm_InitReq(&req);
! optionsp = cm_IoctlGetQueryOptions(ioctlp, userp);
! if (optionsp && CM_IOCTL_QOPTS_HAVE_LITERAL(optionsp))
! flags |= (optionsp->literal ? CM_PARSE_FLAG_LITERAL : 0);
!
! code = cm_ParseIoctlPath(ioctlp, userp, &req, &scp, flags);
if (code) return code;
memset(&fid, 0, sizeof(cm_fid_t));
+ fid.cell = scp->fid.cell;
fid.volume = scp->fid.volume;
fid.vnode = scp->fid.vnode;
fid.unique = scp->fid.unique;
***************
*** 987,1003 ****
return 0;
}
long cm_IoctlGetOwner(struct smb_ioctl *ioctlp, struct cm_user *userp)
{
cm_scache_t *scp;
register long code;
register char *cp;
cm_req_t req;
cm_InitReq(&req);
! code = cm_ParseIoctlPath(ioctlp, userp, &req, &scp);
! if (code) return code;
/* Copy all this junk into msg->im_data, keeping track of the lengths. */
cp = ioctlp->outDatap;
--- 1095,1162 ----
return 0;
}
+ long cm_IoctlGetFileType(struct smb_ioctl *ioctlp, struct cm_user *userp)
+ {
+ cm_scache_t *scp;
+ register long code;
+ register char *cp;
+ afs_uint32 fileType = 0;
+ cm_req_t req;
+ cm_ioctlQueryOptions_t * optionsp;
+ afs_uint32 flags = 0;
+
+ cm_InitReq(&req);
+
+ optionsp = cm_IoctlGetQueryOptions(ioctlp, userp);
+ if (optionsp && CM_IOCTL_QOPTS_HAVE_LITERAL(optionsp))
+ flags |= (optionsp->literal ? CM_PARSE_FLAG_LITERAL : 0);
+
+ if (optionsp && CM_IOCTL_QOPTS_HAVE_FID(optionsp)) {
+ cm_SkipIoctlPath(ioctlp);
+ code = cm_GetSCache(&optionsp->fid, &scp, userp, &req);
+ } else {
+ code = cm_ParseIoctlPath(ioctlp, userp, &req, &scp, flags);
+ }
+ if (code)
+ return code;
+
+ fileType = scp->fileType;
+ cm_ReleaseSCache(scp);
+
+ /* Copy all this junk into msg->im_data, keeping track of the lengths. */
+ cp = ioctlp->outDatap;
+ memcpy(cp, (char *)&fileType, sizeof(fileType));
+ cp += sizeof(fileType);
+
+ /* return new size */
+ ioctlp->outDatap = cp;
+
+ return 0;
+ }
+
long cm_IoctlGetOwner(struct smb_ioctl *ioctlp, struct cm_user *userp)
{
cm_scache_t *scp;
register long code;
register char *cp;
cm_req_t req;
+ cm_ioctlQueryOptions_t *optionsp;
+ afs_uint32 flags = 0;
cm_InitReq(&req);
! optionsp = cm_IoctlGetQueryOptions(ioctlp, userp);
! if (optionsp && CM_IOCTL_QOPTS_HAVE_LITERAL(optionsp))
! flags |= (optionsp->literal ? CM_PARSE_FLAG_LITERAL : 0);
!
! if (optionsp && CM_IOCTL_QOPTS_HAVE_FID(optionsp)) {
! cm_SkipIoctlPath(ioctlp);
! code = cm_GetSCache(&optionsp->fid, &scp, userp, &req);
! } else {
! code = cm_ParseIoctlPath(ioctlp, userp, &req, &scp, flags);
! }
! if (code)
! return code;
/* Copy all this junk into msg->im_data, keeping track of the lengths. */
cp = ioctlp->outDatap;
***************
*** 1025,1070 ****
unsigned long volume;
char *cp;
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, CM_GETVOL_FLAG_CREATE, &tvp);
! if (code)
! return code;
! cp = ioctlp->outDatap;
! lock_ObtainMutex(&tvp->mx);
! tsrpp = cm_GetVolServers(tvp, volume);
! lock_ObtainRead(&cm_serverLock);
! for (current = *tsrpp; current; current = current->next) {
! tsp = current->server;
! memcpy(cp, (char *)&tsp->addr.sin_addr.s_addr, sizeof(long));
! cp += sizeof(long);
! }
! lock_ReleaseRead(&cm_serverLock);
! cm_FreeServerList(tsrpp, 0);
! lock_ReleaseMutex(&tvp->mx);
! /* still room for terminating NULL, add it on */
! volume = 0; /* reuse vbl */
! memcpy(cp, (char *)&volume, sizeof(long));
! cp += sizeof(long);
! ioctlp->outDatap = cp;
! cm_PutVolume(tvp);
return 0;
}
--- 1184,1265 ----
unsigned long volume;
char *cp;
cm_req_t req;
+ cm_ioctlQueryOptions_t *optionsp;
+ afs_uint32 flags = 0;
cm_InitReq(&req);
! optionsp = cm_IoctlGetQueryOptions(ioctlp, userp);
! if (optionsp && CM_IOCTL_QOPTS_HAVE_LITERAL(optionsp))
! flags |= (optionsp->literal ? CM_PARSE_FLAG_LITERAL : 0);
!
! if (optionsp && CM_IOCTL_QOPTS_HAVE_FID(optionsp)) {
! cm_SkipIoctlPath(ioctlp);
! code = cm_GetSCache(&optionsp->fid, &scp, userp, &req);
! } else {
! code = cm_ParseIoctlPath(ioctlp, userp, &req, &scp, flags);
! }
! if (code)
! return code;
!
volume = scp->fid.volume;
! cellp = cm_FindCellByID(scp->fid.cell, 0);
cm_ReleaseSCache(scp);
if (!cellp)
return CM_ERROR_NOSUCHCELL;
! #ifdef AFS_FREELANCE_CLIENT
! if ( cellp->cellID == AFS_FAKE_ROOT_CELL_ID) {
! struct in_addr addr;
!
! addr.s_net = 127;
! addr.s_host = 0;
! addr.s_lh = 0;
! addr.s_impno = 1;
!
! cp = ioctlp->outDatap;
!
! memcpy(cp, (char *)&addr, sizeof(addr));
! cp += sizeof(addr);
!
! /* still room for terminating NULL, add it on */
! addr.s_addr = 0;
! memcpy(cp, (char *)&addr, sizeof(addr));
! cp += sizeof(addr);
!
! ioctlp->outDatap = cp;
! } else
! #endif
! {
! code = cm_GetVolumeByID(cellp, volume, userp, &req, CM_GETVOL_FLAG_CREATE, &tvp);
! if (code)
! return code;
! cp = ioctlp->outDatap;
! lock_ObtainMutex(&tvp->mx);
! tsrpp = cm_GetVolServers(tvp, volume);
! lock_ObtainRead(&cm_serverLock);
! for (current = *tsrpp; current; current = current->next) {
! tsp = current->server;
! memcpy(cp, (char *)&tsp->addr.sin_addr.s_addr, sizeof(long));
! cp += sizeof(long);
! }
! lock_ReleaseRead(&cm_serverLock);
! cm_FreeServerList(tsrpp, 0);
! lock_ReleaseMutex(&tvp->mx);
! /* still room for terminating NULL, add it on */
! volume = 0; /* reuse vbl */
! memcpy(cp, (char *)&volume, sizeof(long));
! cp += sizeof(long);
! ioctlp->outDatap = cp;
! cm_PutVolume(tvp);
! }
return 0;
}
***************
*** 1078,1084 ****
cm_InitReq(&req);
! code = cm_ParseIoctlPath(ioctlp, userp, &req, &dscp);
if (code) return code;
cp = ioctlp->inDatap;
--- 1273,1279 ----
cm_InitReq(&req);
! code = cm_ParseIoctlPath(ioctlp, userp, &req, &dscp, 0);
if (code) return code;
cp = ioctlp->inDatap;
***************
*** 1119,1125 ****
cm_InitReq(&req);
! code = cm_ParseIoctlPath(ioctlp, userp, &req, &dscp);
if (code) return code;
cp = ioctlp->inDatap;
--- 1314,1320 ----
cm_InitReq(&req);
! code = cm_ParseIoctlPath(ioctlp, userp, &req, &dscp, 0);
if (code) return code;
cp = ioctlp->inDatap;
***************
*** 1214,1227 ****
*/
if (haveCell) {
/* have cell name, too */
! cellp = cm_GetCell(cp, 0);
if (!cellp)
return CM_ERROR_NOSUCHCELL;
}
else cellp = (cm_cell_t *) 0;
if (!cellp && (temp & 2)) {
/* use local cell */
! cellp = cm_FindCellByID(1);
}
if (!(temp & 1)) { /* if not fast, call server checker routine */
/* check down servers */
--- 1409,1422 ----
*/
if (haveCell) {
/* have cell name, too */
! cellp = cm_GetCell(cp, (temp & 1) ? CM_FLAG_NOPROBE : 0);
if (!cellp)
return CM_ERROR_NOSUCHCELL;
}
else cellp = (cm_cell_t *) 0;
if (!cellp && (temp & 2)) {
/* use local cell */
! cellp = cm_FindCellByID(1, 0);
}
if (!(temp & 1)) { /* if not fast, call server checker routine */
/* check down servers */
***************
*** 1403,1410 ****
return CM_ERROR_NOMORETOKENS; /* mapped to EDOM */
}
- extern long cm_AddCellProc(void *rockp, struct sockaddr_in *addrp, char *namep);
-
long cm_IoctlNewCell(struct smb_ioctl *ioctlp, struct cm_user *userp)
{
/* NT cache manager will read cell information from CellServDB each time
--- 1598,1603 ----
***************
*** 1417,1422 ****
--- 1610,1617 ----
*/
cm_cell_t *cp;
+ cm_cell_rock_t rock;
+
cm_SkipIoctlPath(ioctlp);
lock_ObtainWrite(&cm_cellLock);
***************
*** 1428,1439 ****
/* delete all previous server lists - cm_FreeServerList will ask for write on cm_ServerLock*/
cm_FreeServerList(&cp->vlServersp, CM_FREESERVERLIST_DELETE);
cp->vlServersp = NULL;
! code = cm_SearchCellFile(cp->name, cp->name, cm_AddCellProc, cp);
#ifdef AFS_AFSDB_ENV
if (code) {
if (cm_dnsEnabled) {
int ttl;
! code = cm_SearchCellByDNS(cp->name, cp->name, &ttl, cm_AddCellProc, cp);
if ( code == 0 ) { /* got cell from DNS */
cp->flags |= CM_CELLFLAG_DNS;
cp->flags &= ~CM_CELLFLAG_VLSERVER_INVALID;
--- 1623,1636 ----
/* delete all previous server lists - cm_FreeServerList will ask for write on cm_ServerLock*/
cm_FreeServerList(&cp->vlServersp, CM_FREESERVERLIST_DELETE);
cp->vlServersp = NULL;
! rock.cellp = cp;
! rock.flags = 0;
! code = cm_SearchCellFile(cp->name, cp->name, cm_AddCellProc, &rock);
#ifdef AFS_AFSDB_ENV
if (code) {
if (cm_dnsEnabled) {
int ttl;
! code = cm_SearchCellByDNS(cp->name, cp->name, &ttl, cm_AddCellProc, &rock);
if ( code == 0 ) { /* got cell from DNS */
cp->flags |= CM_CELLFLAG_DNS;
cp->flags &= ~CM_CELLFLAG_VLSERVER_INVALID;
***************
*** 1666,1672 ****
}
else /* add a new server without a cell */
{
! tsp = cm_NewServer(&tmp, type, NULL); /* refcount = 1 */
tsp->ipRank = rank;
}
lock_ObtainMutex(&tsp->mx);
--- 1863,1869 ----
}
else /* add a new server without a cell */
{
! tsp = cm_NewServer(&tmp, type, NULL, CM_FLAG_NOPROBE); /* refcount = 1 */
tsp->ipRank = rank;
}
lock_ObtainMutex(&tsp->mx);
***************
*** 1885,1891 ****
cm_InitReq(&req);
! code = cm_ParseIoctlPath(ioctlp, userp, &req, &dscp);
if (code) return code;
cp = ioctlp->inDatap;
--- 2082,2088 ----
cm_InitReq(&req);
! code = cm_ParseIoctlPath(ioctlp, userp, &req, &dscp, 0);
if (code) return code;
cp = ioctlp->inDatap;
***************
*** 1943,1949 ****
cm_InitReq(&req);
! code = cm_ParseIoctlPath(ioctlp, userp, &req, &dscp);
if (code) return code;
cp = ioctlp->inDatap;
--- 2140,2146 ----
cm_InitReq(&req);
! code = cm_ParseIoctlPath(ioctlp, userp, &req, &dscp, 0);
if (code) return code;
cp = ioctlp->inDatap;
***************
*** 1972,1978 ****
cm_InitReq(&req);
! code = cm_ParseIoctlPath(ioctlp, userp, &req, &dscp);
if (code) return code;
cp = ioctlp->inDatap;
--- 2169,2175 ----
cm_InitReq(&req);
! code = cm_ParseIoctlPath(ioctlp, userp, &req, &dscp, 0);
if (code) return code;
cp = ioctlp->inDatap;
***************
*** 2164,2170 ****
tp += sizeof(int);
/* cell name */
! cellp = cm_GetCell(tp, CM_FLAG_CREATE);
if (!cellp)
return CM_ERROR_NOSUCHCELL;
tp += strlen(tp) + 1;
--- 2361,2367 ----
tp += sizeof(int);
/* cell name */
! cellp = cm_GetCell(tp, CM_FLAG_CREATE | CM_FLAG_NOPROBE);
if (!cellp)
return CM_ERROR_NOSUCHCELL;
tp += strlen(tp) + 1;
***************
*** 2934,2943 ****
cm_vol_state_t *statep;
afs_uint32 volume;
cm_req_t req;
cm_InitReq(&req);
! code = cm_ParseIoctlPath(ioctlp, userp, &req, &scp);
if (code)
return code;
--- 3131,3151 ----
cm_vol_state_t *statep;
afs_uint32 volume;
cm_req_t req;
+ cm_ioctlQueryOptions_t *optionsp;
+ afs_uint32 flags = 0;
cm_InitReq(&req);
! optionsp = cm_IoctlGetQueryOptions(ioctlp, userp);
! if (optionsp && CM_IOCTL_QOPTS_HAVE_LITERAL(optionsp))
! flags |= (optionsp->literal ? CM_PARSE_FLAG_LITERAL : 0);
!
! if (optionsp && CM_IOCTL_QOPTS_HAVE_FID(optionsp)) {
! cm_SkipIoctlPath(ioctlp);
! code = cm_GetSCache(&optionsp->fid, &scp, userp, &req);
! } else {
! code = cm_ParseIoctlPath(ioctlp, userp, &req, &scp, flags);
! }
if (code)
return code;
***************
*** 2950,2956 ****
{
volume = scp->fid.volume;
! cellp = cm_FindCellByID(scp->fid.cell);
cm_ReleaseSCache(scp);
--- 3158,3164 ----
{
volume = scp->fid.volume;
! cellp = cm_FindCellByID(scp->fid.cell, 0);
cm_ReleaseSCache(scp);
***************
*** 3042,3048 ****
}
if (testp->fid.cell > 0) {
! cellp = cm_FindCellByID(testp->fid.cell);
}
if (!cellp)
--- 3250,3256 ----
}
if (testp->fid.cell > 0) {
! cellp = cm_FindCellByID(testp->fid.cell, 0);
}
if (!cellp)
Index: openafs/src/WINNT/afsd/cm_ioctl.h
diff -c openafs/src/WINNT/afsd/cm_ioctl.h:1.14.2.4 openafs/src/WINNT/afsd/cm_ioctl.h:1.14.2.5
*** openafs/src/WINNT/afsd/cm_ioctl.h:1.14.2.4 Fri Jan 4 02:58:40 2008
--- openafs/src/WINNT/afsd/cm_ioctl.h Tue Jan 15 22:19:52 2008
***************
*** 13,18 ****
--- 13,25 ----
#ifndef __CM_IOCTL_INTERFACES_ONLY__
#include "smb.h"
#include "cm_user.h"
+ #else
+ typedef struct cm_fid {
+ unsigned long cell;
+ unsigned long volume;
+ unsigned long vnode;
+ unsigned long unique;
+ } cm_fid_t;
#endif /* __CM_IOCTL_INTERFACES_ONLY__ */
/* the following four structures are used for fs get/set serverprefs command*/
***************
*** 45,50 ****
--- 52,98 ----
afs_uint64 parms[CM_IOCTLCACHEPARMS];
} cm_cacheParms_t;
+ /*
+ * The cm_IoctlQueryOptions structure is designed to be extendible.
+ * None of the fields are required but when specified
+ * by the client and understood by the server will be
+ * used to more precisely specify the desired data.
+ *
+ * size must be set to the size of the structure
+ * sent by the client including any variable length
+ * data appended to the end of the static structure.
+ *
+ * field_flags are used to determine which fields have
+ * been filled in and should be used.
+ *
+ * variable length data can be specified with fields
+ * that include offsets to data appended to the
+ * structure.
+ *
+ * when adding new fields you must:
+ * - add the field
+ * - define a CM_IOCTL_QOPTS_FIELD_xxx bit flag
+ * - define a CM_IOCTL_QOPTS_HAVE_xxx macro
+ *
+ * It is critical that flags be consistent across all
+ * implementations of the pioctl interface for a given
+ * platform. This should be considered a public
+ * interface used by third party application developers.
+ */
+
+ typedef struct cm_IoctlQueryOptions {
+ afs_uint32 size;
+ afs_uint32 field_flags;
+ afs_uint32 literal;
+ cm_fid_t fid;
+ } cm_ioctlQueryOptions_t;
+
+ /* field flags - */
+ #define CM_IOCTL_QOPTS_FIELD_LITERAL 1
+ #define CM_IOCTL_QOPTS_FIELD_FID 2
+
+ #define CM_IOCTL_QOPTS_HAVE_LITERAL(p) (p->size >= 12 && (p->field_flags & CM_IOCTL_QOPTS_FIELD_LITERAL))
+ #define CM_IOCTL_QOPTS_HAVE_FID(p) (p->size >= 28 && (p->field_flags & CM_IOCTL_QOPTS_FIELD_FID))
#define MAXNUMSYSNAMES 16 /* max that current constants allow */
#define MAXSYSNAME 128 /* max sysname (i.e. @sys) size */
***************
*** 171,176 ****
--- 219,226 ----
extern long cm_IoctlPathAvailability(struct smb_ioctl * ioctlp, struct cm_user *userp);
+ extern long cm_IoctlGetFileType(smb_ioctl_t *ioctlp, cm_user_t *userp);
+
extern long cm_IoctlVolStatTest(struct smb_ioctl *ioctlp, struct cm_user *userp);
#endif /* __CM_IOCTL_INTERFACES_ONLY__ */
Index: openafs/src/WINNT/afsd/cm_scache.c
diff -c openafs/src/WINNT/afsd/cm_scache.c:1.35.2.54 openafs/src/WINNT/afsd/cm_scache.c:1.35.2.56
*** openafs/src/WINNT/afsd/cm_scache.c:1.35.2.54 Fri Dec 28 10:47:43 2007
--- openafs/src/WINNT/afsd/cm_scache.c Thu Feb 7 20:21:46 2008
***************
*** 774,780 ****
/* otherwise, we need to find the volume */
if (!cm_freelanceEnabled || !isRoot) {
lock_ReleaseWrite(&cm_scacheLock); /* for perf. reasons */
! cellp = cm_FindCellByID(fidp->cell);
if (!cellp)
return CM_ERROR_NOSUCHCELL;
--- 774,780 ----
/* otherwise, we need to find the volume */
if (!cm_freelanceEnabled || !isRoot) {
lock_ReleaseWrite(&cm_scacheLock); /* for perf. reasons */
! cellp = cm_FindCellByID(fidp->cell, 0);
if (!cellp)
return CM_ERROR_NOSUCHCELL;
***************
*** 879,885 ****
cm_fid_t parent_fid;
cm_scache_t * pscp = NULL;
! lock_ObtainRead(&cm_scacheLock);
parent_fid = scp->fid;
parent_fid.vnode = scp->parentVnode;
parent_fid.unique = scp->parentUnique;
--- 879,885 ----
cm_fid_t parent_fid;
cm_scache_t * pscp = NULL;
! lock_ObtainWrite(&cm_scacheLock);
parent_fid = scp->fid;
parent_fid.vnode = scp->parentVnode;
parent_fid.unique = scp->parentUnique;
***************
*** 894,900 ****
}
}
! lock_ReleaseRead(&cm_scacheLock);
return pscp;
}
--- 894,900 ----
}
}
! lock_ReleaseWrite(&cm_scacheLock);
return pscp;
}
***************
*** 1546,1552 ****
if (!(flags & CM_MERGEFLAG_FORCE) && dataVersion < scp->dataVersion) {
struct cm_cell *cellp;
! cellp = cm_FindCellByID(scp->fid.cell);
if (scp->cbServerp) {
struct cm_volume *volp = NULL;
--- 1546,1552 ----
if (!(flags & CM_MERGEFLAG_FORCE) && dataVersion < scp->dataVersion) {
struct cm_cell *cellp;
! cellp = cm_FindCellByID(scp->fid.cell, 0);
if (scp->cbServerp) {
struct cm_volume *volp = NULL;
***************
*** 1731,1736 ****
--- 1731,1737 ----
#endif
{
osi_assertx(scp != NULL, "null cm_scache_t");
+ lock_AssertWrite(&cm_scacheLock);
scp->refCount++;
#ifdef DEBUG_REFCOUNT
osi_Log2(afsd_logp,"cm_HoldSCacheNoLock scp 0x%p ref %d",scp, scp->refCount);
***************
*** 1761,1766 ****
--- 1762,1768 ----
#endif
{
osi_assertx(scp != NULL, "null cm_scache_t");
+ lock_AssertWrite(&cm_scacheLock);
if (scp->refCount == 0)
osi_Log1(afsd_logp,"cm_ReleaseSCacheNoLock about to panic scp 0x%x",scp);
osi_assertx(scp->refCount-- >= 0, "cm_scache_t refCount 0");
Index: openafs/src/WINNT/afsd/cm_server.c
diff -c openafs/src/WINNT/afsd/cm_server.c:1.25.2.17 openafs/src/WINNT/afsd/cm_server.c:1.25.2.24
*** openafs/src/WINNT/afsd/cm_server.c:1.25.2.17 Sun Jan 6 18:12:59 2008
--- openafs/src/WINNT/afsd/cm_server.c Thu Feb 7 15:29:19 2008
***************
*** 29,34 ****
--- 29,36 ----
osi_rwlock_t cm_serverLock;
cm_server_t *cm_allServersp;
+ afs_uint32 cm_numFileServers = 0;
+ afs_uint32 cm_numVldbServers = 0;
void
cm_ForceNewConnectionsAllServers(void)
***************
*** 154,160 ****
/* mark server as down */
if (!(tsp->flags & CM_SERVERFLAG_DOWN)) {
tsp->flags |= CM_SERVERFLAG_DOWN;
! tsp->downTime = osi_Time();
}
if (code != VRESTARTING)
cm_ForceNewConnections(tsp);
--- 156,162 ----
/* mark server as down */
if (!(tsp->flags & CM_SERVERFLAG_DOWN)) {
tsp->flags |= CM_SERVERFLAG_DOWN;
! tsp->downTime = time(NULL);
}
if (code != VRESTARTING)
cm_ForceNewConnections(tsp);
***************
*** 175,182 ****
--- 177,186 ----
if (tsrvp->ids[i] != 0) {
cm_InitReq(&req);
+ lock_ReleaseMutex(&tsp->mx);
code = cm_GetVolumeByID(tsp->cellp, tsrvp->ids[i], cm_rootUserp,
&req, CM_GETVOL_FLAG_NO_LRU_UPDATE, &volp);
+ lock_ObtainMutex(&tsp->mx);
if (code == 0) {
cm_UpdateVolumeStatus(volp, tsrvp->ids[i]);
cm_PutVolume(volp);
***************
*** 194,201 ****
lock_ReleaseMutex(&tsp->mx);
}
!
! void cm_CheckServers(long flags, cm_cell_t *cellp)
{
/* ping all file servers, up or down, with unauthenticated connection,
* to find out whether we have all our callbacks from the server still.
--- 198,206 ----
lock_ReleaseMutex(&tsp->mx);
}
! #define MULTI_CHECKSERVERS 1
! #ifndef MULTI_CHECKSERVERS
! void cm_CheckServers(afs_uint32 flags, cm_cell_t *cellp)
{
/* ping all file servers, up or down, with unauthenticated connection,
* to find out whether we have all our callbacks from the server still.
***************
*** 249,254 ****
--- 254,758 ----
}
lock_ReleaseWrite(&cm_serverLock);
}
+ #else /* MULTI_CHECKSERVERS */
+ void cm_CheckServers(afs_uint32 flags, cm_cell_t *cellp)
+ {
+ /*
+ * The goal of this function is to probe simultaneously
+ * probe all of the up/down servers (vldb/file) as
+ * specified by flags in the minimum number of RPCs.
+ * Effectively that means use one multi_RXAFS_GetCapabilities()
+ * followed by possibly one multi_RXAFS_GetTime() and
+ * one multi_VL_ProbeServer().
+ *
+ * To make this work we must construct the list of vldb
+ * and file servers that are to be probed as well as the
+ * associated data structures.
+ */
+
+ int srvAddrCount = 0;
+ struct srvAddr **addrs = NULL;
+ cm_conn_t **conns = NULL;
+ struct rx_connection **rxconns = NULL;
+ cm_req_t req;
+ afs_int32 i, j, nconns = 0;
+ afs_int32 *conntimer, *results;
+ Capabilities *caps = NULL;
+ cm_server_t ** serversp, *tsp;
+ afs_uint32 isDown, wasDown;
+ afs_uint32 code;
+ time_t start, end, *deltas;
+ afs_int32 secs;
+ afs_int32 usecs;
+ char hoststr[16];
+
+ cm_InitReq(&req);
+
+ j = max(cm_numFileServers,cm_numVldbServers);
+ conns = (cm_conn_t **)malloc(j * sizeof(cm_conn_t *));
+ rxconns = (struct rx_connection **)malloc(j * sizeof(struct rx_connection *));
+ conntimer = (afs_int32 *)malloc(j * sizeof (afs_int32));
+ deltas = (time_t *)malloc(j * sizeof (time_t));
+ results = (afs_int32 *)malloc(j * sizeof (afs_int32));
+ serversp = (cm_server_t **)malloc(j * sizeof(cm_server_t *));
+ caps = (Capabilities *)malloc(j * sizeof(Capabilities));
+
+ memset(caps, 0, j * sizeof(Capabilities));
+
+ if ((flags & CM_FLAG_CHECKFILESERVERS) ||
+ !(flags & (CM_FLAG_CHECKFILESERVERS|CM_FLAG_CHECKVLDBSERVERS)))
+ {
+ lock_ObtainWrite(&cm_serverLock);
+ nconns = 0;
+ for (nconns=0, tsp = cm_allServersp; tsp; tsp = tsp->allNextp) {
+ if (tsp->type != CM_SERVER_FILE ||
+ tsp->cellp == NULL || /* SetPref only */
+ cellp && cellp != tsp->cellp)
+ continue;
+
+ cm_GetServerNoLock(tsp);
+ lock_ReleaseWrite(&cm_serverLock);
+
+ lock_ObtainMutex(&tsp->mx);
+ isDown = tsp->flags & CM_SERVERFLAG_DOWN;
+
+ if ((tsp->flags & CM_SERVERFLAG_PINGING) ||
+ !((isDown && (flags & CM_FLAG_CHECKDOWNSERVERS)) ||
+ (!isDown && (flags & CM_FLAG_CHECKUPSERVERS)))) {
+ lock_ReleaseMutex(&tsp->mx);
+ lock_ObtainWrite(&cm_serverLock);
+ continue;
+ }
+
+ tsp->flags |= CM_SERVERFLAG_PINGING;
+ lock_ReleaseMutex(&tsp->mx);
+
+ serversp[nconns] = tsp;
+ code = cm_ConnByServer(tsp, cm_rootUserp, &conns[nconns]);
+ if (code) {
+ lock_ObtainWrite(&cm_serverLock);
+ cm_PutServerNoLock(tsp);
+ continue;
+ }
+ lock_ObtainWrite(&cm_serverLock);
+ rxconns[nconns] = cm_GetRxConn(conns[nconns]);
+ if (conntimer[nconns] = (isDown ? 1 : 0))
+ rx_SetConnDeadTime(rxconns[nconns], 10);
+
+ nconns++;
+ }
+ lock_ReleaseWrite(&cm_serverLock);
+
+ /* Perform the multi call */
+ start = time(NULL);
+ multi_Rx(rxconns,nconns)
+ {
+ multi_RXAFS_GetCapabilities(&caps[multi_i]);
+ results[multi_i]=multi_error;
+ } multi_End;
+
+
+ /* Process results of servers that support RXAFS_GetCapabilities */
+ for (i=0; imx);
+ wasDown = tsp->flags & CM_SERVERFLAG_DOWN;
+
+ if (results[i] >= 0) {
+ /* mark server as up */
+ tsp->flags &= ~CM_SERVERFLAG_DOWN;
+ tsp->downTime = 0;
+
+ /* we currently handle 32-bits of capabilities */
+ if (caps[i].Capabilities_len > 0) {
+ tsp->capabilities = caps[i].Capabilities_val[0];
+ free(caps[i].Capabilities_val);
+ caps[i].Capabilities_len = 0;
+ caps[i].Capabilities_val = 0;
+ } else {
+ tsp->capabilities = 0;
+ }
+
+ afs_inet_ntoa_r(tsp->addr.sin_addr.S_un.S_addr, hoststr);
+ osi_Log3(afsd_logp, "cm_MultiPingServer server %s (%s) is up with caps 0x%x",
+ osi_LogSaveString(afsd_logp, hoststr),
+ tsp->type == CM_SERVER_VLDB ? "vldb" : "file",
+ tsp->capabilities);
+
+ /* Now update the volume status if necessary */
+ if (wasDown) {
+ cm_server_vols_t * tsrvp;
+ cm_volume_t * volp;
+ int i;
+
+ for (tsrvp = tsp->vols; tsrvp; tsrvp = tsrvp->nextp) {
+ for (i=0; iids[i] != 0) {
+ cm_InitReq(&req);
+
+ lock_ReleaseMutex(&tsp->mx);
+ code = cm_GetVolumeByID(tsp->cellp, tsrvp->ids[i], cm_rootUserp,
+ &req, CM_GETVOL_FLAG_NO_LRU_UPDATE, &volp);
+ lock_ObtainMutex(&tsp->mx);
+ if (code == 0) {
+ cm_UpdateVolumeStatus(volp, tsrvp->ids[i]);
+ cm_PutVolume(volp);
+ }
+ }
+ }
+ }
+ }
+ } else {
+ /* mark server as down */
+ if (!(tsp->flags & CM_SERVERFLAG_DOWN)) {
+ tsp->flags |= CM_SERVERFLAG_DOWN;
+ tsp->downTime = time(NULL);
+ }
+ if (code != VRESTARTING)
+ cm_ForceNewConnections(tsp);
+
+ afs_inet_ntoa_r(tsp->addr.sin_addr.S_un.S_addr, hoststr);
+ osi_Log3(afsd_logp, "cm_MultiPingServer server %s (%s) is down with caps 0x%x",
+ osi_LogSaveString(afsd_logp, hoststr),
+ tsp->type == CM_SERVER_VLDB ? "vldb" : "file",
+ tsp->capabilities);
+
+ /* Now update the volume status if necessary */
+ if (!wasDown) {
+ cm_server_vols_t * tsrvp;
+ cm_volume_t * volp;
+ int i;
+
+ for (tsrvp = tsp->vols; tsrvp; tsrvp = tsrvp->nextp) {
+ for (i=0; iids[i] != 0) {
+ cm_InitReq(&req);
+
+ lock_ReleaseMutex(&tsp->mx);
+ code = cm_GetVolumeByID(tsp->cellp, tsrvp->ids[i], cm_rootUserp,
+ &req, CM_GETVOL_FLAG_NO_LRU_UPDATE, &volp);
+ lock_ObtainMutex(&tsp->mx);
+ if (code == 0) {
+ cm_UpdateVolumeStatus(volp, tsrvp->ids[i]);
+ cm_PutVolume(volp);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (tsp->waitCount == 0)
+ tsp->flags &= ~CM_SERVERFLAG_PINGING;
+ else
+ osi_Wakeup((LONG_PTR)tsp);
+
+ lock_ReleaseMutex(&tsp->mx);
+
+ cm_PutServer(tsp);
+ }
+
+ /*
+ * At this point we have handled any responses that did not indicate
+ * that RXAFS_GetCapabilities is not supported.
+ */
+ for ( i=0, j=0; imx);
+ wasDown = tsp->flags & CM_SERVERFLAG_DOWN;
+
+ if (results[i] >= 0) {
+ /* mark server as up */
+ tsp->flags &= ~CM_SERVERFLAG_DOWN;
+ tsp->downTime = 0;
+ tsp->capabilities = 0;
+
+ afs_inet_ntoa_r(tsp->addr.sin_addr.S_un.S_addr, hoststr);
+ osi_Log3(afsd_logp, "cm_MultiPingServer server %s (%s) is up with caps 0x%x",
+ osi_LogSaveString(afsd_logp, hoststr),
+ tsp->type == CM_SERVER_VLDB ? "vldb" : "file",
+ tsp->capabilities);
+
+ /* Now update the volume status if necessary */
+ if (wasDown) {
+ cm_server_vols_t * tsrvp;
+ cm_volume_t * volp;
+ int i;
+
+ for (tsrvp = tsp->vols; tsrvp; tsrvp = tsrvp->nextp) {
+ for (i=0; iids[i] != 0) {
+ cm_InitReq(&req);
+
+ lock_ReleaseMutex(&tsp->mx);
+ code = cm_GetVolumeByID(tsp->cellp, tsrvp->ids[i], cm_rootUserp,
+ &req, CM_GETVOL_FLAG_NO_LRU_UPDATE, &volp);
+ lock_ObtainMutex(&tsp->mx);
+ if (code == 0) {
+ cm_UpdateVolumeStatus(volp, tsrvp->ids[i]);
+ cm_PutVolume(volp);
+ }
+ }
+ }
+ }
+ }
+ } else {
+ /* mark server as down */
+ if (!(tsp->flags & CM_SERVERFLAG_DOWN)) {
+ tsp->flags |= CM_SERVERFLAG_DOWN;
+ tsp->downTime = time(NULL);
+ }
+ if (code != VRESTARTING)
+ cm_ForceNewConnections(tsp);
+
+ afs_inet_ntoa_r(tsp->addr.sin_addr.S_un.S_addr, hoststr);
+ osi_Log3(afsd_logp, "cm_MultiPingServer server %s (%s) is down with caps 0x%x",
+ osi_LogSaveString(afsd_logp, hoststr),
+ tsp->type == CM_SERVER_VLDB ? "vldb" : "file",
+ tsp->capabilities);
+
+ /* Now update the volume status if necessary */
+ if (!wasDown) {
+ cm_server_vols_t * tsrvp;
+ cm_volume_t * volp;
+ int i;
+
+ for (tsrvp = tsp->vols; tsrvp; tsrvp = tsrvp->nextp) {
+ for (i=0; iids[i] != 0) {
+ cm_InitReq(&req);
+
+ lock_ReleaseMutex(&tsp->mx);
+ code = cm_GetVolumeByID(tsp->cellp, tsrvp->ids[i], cm_rootUserp,
+ &req, CM_GETVOL_FLAG_NO_LRU_UPDATE, &volp);
+ lock_ObtainMutex(&tsp->mx);
+ if (code == 0) {
+ cm_UpdateVolumeStatus(volp, tsrvp->ids[i]);
+ cm_PutVolume(volp);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (tsp->waitCount == 0)
+ tsp->flags &= ~CM_SERVERFLAG_PINGING;
+ else
+ osi_Wakeup((LONG_PTR)tsp);
+
+ lock_ReleaseMutex(&tsp->mx);
+
+ cm_PutServer(tsp);
+ }
+ }
+
+ if ((flags & CM_FLAG_CHECKVLDBSERVERS) ||
+ !(flags & (CM_FLAG_CHECKFILESERVERS|CM_FLAG_CHECKVLDBSERVERS)))
+ {
+ lock_ObtainWrite(&cm_serverLock);
+ nconns = 0;
+ for (nconns=0, tsp = cm_allServersp; tsp; tsp = tsp->allNextp) {
+ if (tsp->type != CM_SERVER_VLDB ||
+ tsp->cellp == NULL || /* SetPref only */
+ cellp && cellp != tsp->cellp)
+ continue;
+
+ cm_GetServerNoLock(tsp);
+ lock_ReleaseWrite(&cm_serverLock);
+
+ lock_ObtainMutex(&tsp->mx);
+ isDown = tsp->flags & CM_SERVERFLAG_DOWN;
+
+ if ((tsp->flags & CM_SERVERFLAG_PINGING) ||
+ !((isDown && (flags & CM_FLAG_CHECKDOWNSERVERS)) ||
+ (!isDown && (flags & CM_FLAG_CHECKUPSERVERS)))) {
+ lock_ReleaseMutex(&tsp->mx);
+ lock_ObtainWrite(&cm_serverLock);
+ continue;
+ }
+
+ tsp->flags |= CM_SERVERFLAG_PINGING;
+ lock_ReleaseMutex(&tsp->mx);
+
+ serversp[nconns] = tsp;
+ code = cm_ConnByServer(tsp, cm_rootUserp, &conns[nconns]);
+ if (code) {
+ lock_ObtainWrite(&cm_serverLock);
+ cm_PutServerNoLock(tsp);
+ continue;
+ }
+ lock_ObtainWrite(&cm_serverLock);
+ rxconns[nconns] = cm_GetRxConn(conns[nconns]);
+ conntimer[nconns] = (isDown ? 1 : 0);
+ if (isDown)
+ rx_SetConnDeadTime(rxconns[nconns], 10);
+
+ nconns++;
+ }
+ lock_ReleaseWrite(&cm_serverLock);
+
+ /* Perform the multi call */
+ start = time(NULL);
+ multi_Rx(rxconns,nconns)
+ {
+ multi_VL_ProbeServer();
+ results[multi_i]=multi_error;
+ } multi_End;
+
+
+ /* Process results of servers that support RXAFS_GetCapabilities */
+ for (i=0; imx);
+ wasDown = tsp->flags & CM_SERVERFLAG_DOWN;
+
+ if (results[i] >= 0) {
+ /* mark server as up */
+ tsp->flags &= ~CM_SERVERFLAG_DOWN;
+ tsp->downTime = 0;
+ tsp->capabilities = 0;
+
+ afs_inet_ntoa_r(tsp->addr.sin_addr.S_un.S_addr, hoststr);
+ osi_Log3(afsd_logp, "cm_MultiPingServer server %s (%s) is up with caps 0x%x",
+ osi_LogSaveString(afsd_logp, hoststr),
+ tsp->type == CM_SERVER_VLDB ? "vldb" : "file",
+ tsp->capabilities);
+
+ /* Now update the volume status if necessary */
+ if (wasDown) {
+ cm_server_vols_t * tsrvp;
+ cm_volume_t * volp;
+ int i;
+
+ for (tsrvp = tsp->vols; tsrvp; tsrvp = tsrvp->nextp) {
+ for (i=0; iids[i] != 0) {
+ cm_InitReq(&req);
+
+ lock_ReleaseMutex(&tsp->mx);
+ code = cm_GetVolumeByID(tsp->cellp, tsrvp->ids[i], cm_rootUserp,
+ &req, CM_GETVOL_FLAG_NO_LRU_UPDATE, &volp);
+ lock_ObtainMutex(&tsp->mx);
+ if (code == 0) {
+ cm_UpdateVolumeStatus(volp, tsrvp->ids[i]);
+ cm_PutVolume(volp);
+ }
+ }
+ }
+ }
+ }
+ } else {
+ /* mark server as down */
+ if (!(tsp->flags & CM_SERVERFLAG_DOWN)) {
+ tsp->flags |= CM_SERVERFLAG_DOWN;
+ tsp->downTime = time(NULL);
+ }
+ if (code != VRESTARTING)
+ cm_ForceNewConnections(tsp);
+
+ afs_inet_ntoa_r(tsp->addr.sin_addr.S_un.S_addr, hoststr);
+ osi_Log3(afsd_logp, "cm_MultiPingServer server %s (%s) is down with caps 0x%x",
+ osi_LogSaveString(afsd_logp, hoststr),
+ tsp->type == CM_SERVER_VLDB ? "vldb" : "file",
+ tsp->capabilities);
+
+ /* Now update the volume status if necessary */
+ if (!wasDown) {
+ cm_server_vols_t * tsrvp;
+ cm_volume_t * volp;
+ int i;
+
+ for (tsrvp = tsp->vols; tsrvp; tsrvp = tsrvp->nextp) {
+ for (i=0; iids[i] != 0) {
+ cm_InitReq(&req);
+
+ lock_ReleaseMutex(&tsp->mx);
+ code = cm_GetVolumeByID(tsp->cellp, tsrvp->ids[i], cm_rootUserp,
+ &req, CM_GETVOL_FLAG_NO_LRU_UPDATE, &volp);
+ lock_ObtainMutex(&tsp->mx);
+ if (code == 0) {
+ cm_UpdateVolumeStatus(volp, tsrvp->ids[i]);
+ cm_PutVolume(volp);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (tsp->waitCount == 0)
+ tsp->flags &= ~CM_SERVERFLAG_PINGING;
+ else
+ osi_Wakeup((LONG_PTR)tsp);
+
+ lock_ReleaseMutex(&tsp->mx);
+
+ cm_PutServer(tsp);
+ }
+ }
+
+ free(conns);
+ free(rxconns);
+ free(conntimer);
+ free(deltas);
+ free(results);
+ free(caps);
+ }
+ #endif /* MULTI_CHECKSERVERS */
void cm_InitServer(void)
{
***************
*** 363,369 ****
} /* and of for loop */
}
! cm_server_t *cm_NewServer(struct sockaddr_in *socketp, int type, cm_cell_t *cellp) {
cm_server_t *tsp;
osi_assertx(socketp->sin_family == AF_INET, "unexpected socket family");
--- 867,873 ----
} /* and of for loop */
}
! cm_server_t *cm_NewServer(struct sockaddr_in *socketp, int type, cm_cell_t *cellp, afs_uint32 flags) {
cm_server_t *tsp;
osi_assertx(socketp->sin_family == AF_INET, "unexpected socket family");
***************
*** 376,391 ****
tsp->refCount = 1;
lock_InitializeMutex(&tsp->mx, "cm_server_t mutex");
tsp->addr = *socketp;
- tsp->flags = CM_SERVERFLAG_DOWN; /* assume down; ping will mark up if available */
cm_SetServerPrefs(tsp);
lock_ObtainWrite(&cm_serverLock); /* get server lock */
tsp->allNextp = cm_allServersp;
cm_allServersp = tsp;
lock_ReleaseWrite(&cm_serverLock); /* release server lock */
! cm_PingServer(tsp); /* Obtain Capabilities and check up/down state */
}
return tsp;
}
--- 880,907 ----
tsp->refCount = 1;
lock_InitializeMutex(&tsp->mx, "cm_server_t mutex");
tsp->addr = *socketp;
cm_SetServerPrefs(tsp);
lock_ObtainWrite(&cm_serverLock); /* get server lock */
tsp->allNextp = cm_allServersp;
cm_allServersp = tsp;
+
+ switch (type) {
+ case CM_SERVER_VLDB:
+ cm_numVldbServers++;
+ break;
+ case CM_SERVER_FILE:
+ cm_numFileServers++;
+ break;
+ }
+
lock_ReleaseWrite(&cm_serverLock); /* release server lock */
! if ( !(flags & CM_FLAG_NOPROBE) ) {
! tsp->flags = CM_SERVERFLAG_DOWN; /* assume down; ping will mark up if available */
! cm_PingServer(tsp); /* Obtain Capabilities and check up/down state */
! }
}
return tsp;
}
***************
*** 659,664 ****
--- 1175,1189 ----
cm_GCConnections(serverp); /* connsp */
if (!(serverp->flags & CM_SERVERFLAG_PREF_SET)) {
+ switch (serverp->type) {
+ case CM_SERVER_VLDB:
+ cm_numVldbServers--;
+ break;
+ case CM_SERVER_FILE:
+ cm_numFileServers--;
+ break;
+ }
+
lock_FinalizeMutex(&serverp->mx);
if ( cm_allServersp == serverp )
cm_allServersp = serverp->allNextp;
Index: openafs/src/WINNT/afsd/cm_server.h
diff -c openafs/src/WINNT/afsd/cm_server.h:1.13.2.9 openafs/src/WINNT/afsd/cm_server.h:1.13.2.11
*** openafs/src/WINNT/afsd/cm_server.h:1.13.2.9 Thu Aug 2 16:46:12 2007
--- openafs/src/WINNT/afsd/cm_server.h Tue Feb 5 12:38:02 2008
***************
*** 82,88 ****
#define CM_MAXINTERFACE_ADDR 16
extern cm_server_t *cm_NewServer(struct sockaddr_in *addrp, int type,
! struct cm_cell *cellp);
extern cm_serverRef_t *cm_NewServerRef(struct cm_server *serverp, afs_uint32 volID);
--- 82,88 ----
#define CM_MAXINTERFACE_ADDR 16
extern cm_server_t *cm_NewServer(struct sockaddr_in *addrp, int type,
! struct cm_cell *cellp, afs_uint32 flags);
extern cm_serverRef_t *cm_NewServerRef(struct cm_server *serverp, afs_uint32 volID);
***************
*** 102,108 ****
extern void cm_InitServer(void);
! extern void cm_CheckServers(long flags, struct cm_cell *cellp);
extern cm_server_t *cm_allServersp;
--- 102,108 ----
extern void cm_InitServer(void);
! extern void cm_CheckServers(afs_uint32 flags, struct cm_cell *cellp);
extern cm_server_t *cm_allServersp;
Index: openafs/src/WINNT/afsd/cm_utils.c
diff -c openafs/src/WINNT/afsd/cm_utils.c:1.11.4.6 openafs/src/WINNT/afsd/cm_utils.c:1.11.4.7
*** openafs/src/WINNT/afsd/cm_utils.c:1.11.4.6 Wed Oct 31 11:36:02 2007
--- openafs/src/WINNT/afsd/cm_utils.c Thu Jan 31 02:31:56 2008
***************
*** 239,264 ****
if (error < 0)
error = CM_ERROR_TIMEDOUT;
! else if (error == 30)
error = CM_ERROR_READONLY;
! else if (error == 13)
error = CM_ERROR_NOACCESS;
! else if (error == 18)
error = CM_ERROR_CROSSDEVLINK;
! else if (error == 17)
error = CM_ERROR_EXISTS;
! else if (error == 20)
error = CM_ERROR_NOTDIR;
! else if (error == 2) /* ENOENT */
error = CM_ERROR_NOSUCHFILE;
! else if (error == 11 /* EAGAIN, most servers */
|| error == 35 /* EAGAIN, Digital UNIX */
|| error == WSAEWOULDBLOCK)
error = CM_ERROR_WOULDBLOCK;
else if (error == VDISKFULL
! || error == 28) /* ENOSPC */
error = CM_ERROR_SPACE;
else if (error == VOVERQUOTA
|| error == 49 /* EDQUOT on Solaris */
|| error == 88 /* EDQUOT on AIX */
|| error == 69 /* EDQUOT on Digital UNIX and HPUX */
--- 239,265 ----
if (error < 0)
error = CM_ERROR_TIMEDOUT;
! else if (error == EROFS)
error = CM_ERROR_READONLY;
! else if (error == EACCES)
error = CM_ERROR_NOACCESS;
! else if (error == EXDEV)
error = CM_ERROR_CROSSDEVLINK;
! else if (error == EEXIST)
error = CM_ERROR_EXISTS;
! else if (error == ENOTDIR)
error = CM_ERROR_NOTDIR;
! else if (error == ENOENT)
error = CM_ERROR_NOSUCHFILE;
! else if (error == EAGAIN
|| error == 35 /* EAGAIN, Digital UNIX */
|| error == WSAEWOULDBLOCK)
error = CM_ERROR_WOULDBLOCK;
else if (error == VDISKFULL
! || error == ENOSPC)
error = CM_ERROR_SPACE;
else if (error == VOVERQUOTA
+ || error == EDQUOT
|| error == 49 /* EDQUOT on Solaris */
|| error == 88 /* EDQUOT on AIX */
|| error == 69 /* EDQUOT on Digital UNIX and HPUX */
***************
*** 267,273 ****
error = CM_ERROR_QUOTA;
else if (error == VNOVNODE)
error = CM_ERROR_BADFD;
! else if (error == 21)
return CM_ERROR_ISDIR;
return error;
}
--- 268,274 ----
error = CM_ERROR_QUOTA;
else if (error == VNOVNODE)
error = CM_ERROR_BADFD;
! else if (error == EISDIR)
return CM_ERROR_ISDIR;
return error;
}
***************
*** 292,306 ****
if (error < 0)
error = CM_ERROR_TIMEDOUT;
! else if (error == 30)
error = CM_ERROR_READONLY;
! else if (error == 20)
error = CM_ERROR_NOTDIR;
! else if (error == 13)
error = CM_ERROR_NOACCESS;
! else if (error == 2)
error = CM_ERROR_NOSUCHFILE;
! else if (error == 17 /* AIX */
|| error == 66 /* SunOS 4, Digital UNIX */
|| error == 93 /* Solaris 2, IRIX */
|| error == 247) /* HP/UX */
--- 293,308 ----
if (error < 0)
error = CM_ERROR_TIMEDOUT;
! else if (error == EROFS)
error = CM_ERROR_READONLY;
! else if (error == ENOTDIR)
error = CM_ERROR_NOTDIR;
! else if (error == EACCES)
error = CM_ERROR_NOACCESS;
! else if (error == ENOENT)
error = CM_ERROR_NOSUCHFILE;
! else if (error == ENOTEMPTY
! || error == 17 /* AIX */
|| error == 66 /* SunOS 4, Digital UNIX */
|| error == 93 /* Solaris 2, IRIX */
|| error == 247) /* HP/UX */
Index: openafs/src/WINNT/afsd/cm_vnodeops.c
diff -c openafs/src/WINNT/afsd/cm_vnodeops.c:1.69.2.50 openafs/src/WINNT/afsd/cm_vnodeops.c:1.69.2.56
*** openafs/src/WINNT/afsd/cm_vnodeops.c:1.69.2.50 Sat Jan 5 17:20:30 2008
--- openafs/src/WINNT/afsd/cm_vnodeops.c Sun Feb 10 19:18:32 2008
***************
*** 1086,1092 ****
/* normal mt pt */
strcpy(volNamep, mpNamep+1);
! cellp = cm_FindCellByID(scp->fid.cell);
}
if (!cellp) {
--- 1086,1092 ----
/* normal mt pt */
strcpy(volNamep, mpNamep+1);
! cellp = cm_FindCellByID(scp->fid.cell, 0);
}
if (!cellp) {
***************
*** 1284,1310 ****
else
return CM_ERROR_NOSUCHFILE;
}
! else { /* nonexistent dir on freelance root, so add it */
char fullname[200] = ".";
int found = 0;
osi_Log1(afsd_logp,"cm_Lookup adding mount for non-existent directory: %s",
osi_LogSaveString(afsd_logp,namep));
if (namep[0] == '.') {
if (cm_GetCell_Gen(&namep[1], &fullname[1], CM_FLAG_CREATE)) {
found = 1;
! if ( stricmp(&namep[1], &fullname[1]) )
code = cm_FreelanceAddSymlink(namep, fullname, &rock.fid);
- else
- code = cm_FreelanceAddMount(namep, &fullname[1], "root.cell.", 1, &rock.fid);
}
} else {
if (cm_GetCell_Gen(namep, fullname, CM_FLAG_CREATE)) {
found = 1;
! if ( stricmp(namep, fullname) )
code = cm_FreelanceAddSymlink(namep, fullname, &rock.fid);
- else
- code = cm_FreelanceAddMount(namep, fullname, "root.cell.", 0, &rock.fid);
}
}
if (!found || code < 0) { /* add mount point failed, so give up */
--- 1284,1324 ----
else
return CM_ERROR_NOSUCHFILE;
}
! else if (!strchr(namep, '#') && !strchr(namep, '%') &&
! strcmp(namep, "srvsvc") && strcmp(namep, "wkssvc")) {
! /* nonexistent dir on freelance root, so add it */
char fullname[200] = ".";
int found = 0;
osi_Log1(afsd_logp,"cm_Lookup adding mount for non-existent directory: %s",
osi_LogSaveString(afsd_logp,namep));
+
+ /*
+ * There is an ugly behavior where a share name "foo" will be searched
+ * for as "fo". If the searched for name differs by an already existing
+ * symlink or mount point in the Freelance directory, do not add the
+ * new value automatically.
+ */
+
if (namep[0] == '.') {
if (cm_GetCell_Gen(&namep[1], &fullname[1], CM_FLAG_CREATE)) {
found = 1;
! if (!cm_FreelanceMountPointExists(fullname, 0))
! code = cm_FreelanceAddMount(fullname, &fullname[1], "root.cell.", 1, &rock.fid);
! if ( stricmp(&namep[1], &fullname[1]) &&
! !cm_FreelanceMountPointExists(namep, flags & CM_FLAG_DFS_REFERRAL ? 1 : 0) &&
! !cm_FreelanceSymlinkExists(namep, flags & CM_FLAG_DFS_REFERRAL ? 1 : 0))
code = cm_FreelanceAddSymlink(namep, fullname, &rock.fid);
}
} else {
if (cm_GetCell_Gen(namep, fullname, CM_FLAG_CREATE)) {
found = 1;
! if (!cm_FreelanceMountPointExists(fullname, 0))
! code = cm_FreelanceAddMount(fullname, fullname, "root.cell.", 0, &rock.fid);
! if ( stricmp(namep, fullname) &&
! !cm_FreelanceMountPointExists(namep, flags & CM_FLAG_DFS_REFERRAL ? 1 : 0) &&
! !cm_FreelanceSymlinkExists(namep, flags & CM_FLAG_DFS_REFERRAL ? 1 : 0))
code = cm_FreelanceAddSymlink(namep, fullname, &rock.fid);
}
}
if (!found || code < 0) { /* add mount point failed, so give up */
***************
*** 1939,1944 ****
--- 1953,1959 ----
if (!cm_FidCmp(&nscp->fid, &fids[i]))
break;
}
+ fid_count = i+1;
} else {
/* add the new fid to the list */
for ( i=0; icellp )
--- 451,457 ----
tsp = cm_FindServer(&tsockAddr, CM_SERVER_FILE);
if (!tsp)
tsp = cm_NewServer(&tsockAddr, CM_SERVER_FILE,
! cellp, 0);
/* if this server was created by fs setserverprefs */
if ( !tsp->cellp )
***************
*** 617,641 ****
/* return it held */
if (volp) {
! lock_ObtainMutex(&volp->mx);
! code = 0;
! if (volp->flags & CM_VOLUMEFLAG_RESET) {
! code = cm_UpdateVolume(cellp, userp, reqp, volp);
! if (code == 0)
! volp->flags &= ~CM_VOLUMEFLAG_RESET;
! }
! lock_ReleaseMutex(&volp->mx);
! if (code == 0) {
! *outVolpp = volp;
!
! lock_ObtainWrite(&cm_volumeLock);
! cm_AdjustVolumeLRU(volp);
! lock_ReleaseWrite(&cm_volumeLock);
} else
! cm_PutVolume(volp);
! return code;
}
/* otherwise, we didn't find it so consult the VLDB */
--- 617,643 ----
/* return it held */
if (volp) {
! lock_ObtainMutex(&volp->mx);
! code = 0;
! if ((volp->flags & CM_VOLUMEFLAG_RESET) && !(flags & CM_GETVOL_FLAG_NO_RESET)) {
! code = cm_UpdateVolume(cellp, userp, reqp, volp);
! if (code == 0)
! volp->flags &= ~CM_VOLUMEFLAG_RESET;
! }
! lock_ReleaseMutex(&volp->mx);
! if (code == 0) {
! *outVolpp = volp;
!
! if (!(flags & CM_GETVOL_FLAG_NO_LRU_UPDATE)) {
! lock_ObtainWrite(&cm_volumeLock);
! cm_AdjustVolumeLRU(volp);
! lock_ReleaseWrite(&cm_volumeLock);
! }
} else
! cm_PutVolume(volp);
! return code;
}
/* otherwise, we didn't find it so consult the VLDB */
***************
*** 784,793 ****
}
/* if we get here we are holding the mutex */
! if (volp->flags & CM_VOLUMEFLAG_RESET) {
! code = cm_UpdateVolume(cellp, userp, reqp, volp);
! if (code == 0)
! volp->flags &= ~CM_VOLUMEFLAG_RESET;
}
lock_ReleaseMutex(&volp->mx);
--- 786,795 ----
}
/* if we get here we are holding the mutex */
! if ((volp->flags & CM_VOLUMEFLAG_RESET) && !(flags & CM_GETVOL_FLAG_NO_RESET)) {
! code = cm_UpdateVolume(cellp, userp, reqp, volp);
! if (code == 0)
! volp->flags &= ~CM_VOLUMEFLAG_RESET;
}
lock_ReleaseMutex(&volp->mx);
***************
*** 796,808 ****
code = CM_ERROR_NOSUCHVOLUME;
if (code == 0) {
! *outVolpp = volp;
!
! lock_ObtainWrite(&cm_volumeLock);
! cm_AdjustVolumeLRU(volp);
! lock_ReleaseWrite(&cm_volumeLock);
} else
! cm_PutVolume(volp);
return code;
}
--- 798,812 ----
code = CM_ERROR_NOSUCHVOLUME;
if (code == 0) {
! *outVolpp = volp;
!
! if (!(flags & CM_GETVOL_FLAG_NO_LRU_UPDATE)) {
! lock_ObtainWrite(&cm_volumeLock);
! cm_AdjustVolumeLRU(volp);
! lock_ReleaseWrite(&cm_volumeLock);
! }
} else
! cm_PutVolume(volp);
return code;
}
***************
*** 818,824 ****
if (!fidp) return;
! cellp = cm_FindCellByID(fidp->cell);
if (!cellp) return;
/* search for the volume */
--- 822,828 ----
if (!fidp) return;
! cellp = cm_FindCellByID(fidp->cell, 0);
if (!cellp) return;
/* search for the volume */
***************
*** 1018,1023 ****
--- 1022,1028 ----
serversp->status = srv_not_busy;
}
+ lock_ReleaseMutex(&volp->mx);
do {
code = cm_ConnFromVolume(volp, volp->rw.ID, cm_rootUserp, &req, &connp);
if (code)
***************
*** 1031,1036 ****
--- 1036,1042 ----
} while (cm_Analyze(connp, cm_rootUserp, &req, NULL, NULL, NULL, NULL, code));
code = cm_MapRPCError(code, &req);
+ lock_ObtainMutex(&volp->mx);
if (code == 0 && volStat.Online) {
cm_VolumeStatusNotification(volp, volp->rw.ID, volp->rw.state, vl_online);
volp->rw.state = vl_online;
***************
*** 1051,1056 ****
--- 1057,1063 ----
serversp->status = srv_not_busy;
}
+ lock_ReleaseMutex(&volp->mx);
do {
code = cm_ConnFromVolume(volp, volp->ro.ID, cm_rootUserp, &req, &connp);
if (code)
***************
*** 1064,1069 ****
--- 1071,1077 ----
} while (cm_Analyze(connp, cm_rootUserp, &req, NULL, NULL, NULL, NULL, code));
code = cm_MapRPCError(code, &req);
+ lock_ObtainMutex(&volp->mx);
if (code == 0 && volStat.Online) {
cm_VolumeStatusNotification(volp, volp->ro.ID, volp->ro.state, vl_online);
volp->ro.state = vl_online;
***************
*** 1084,1089 ****
--- 1092,1098 ----
serversp->status = srv_not_busy;
}
+ lock_ReleaseMutex(&volp->mx);
do {
code = cm_ConnFromVolume(volp, volp->bk.ID, cm_rootUserp, &req, &connp);
if (code)
***************
*** 1097,1102 ****
--- 1106,1112 ----
} while (cm_Analyze(connp, cm_rootUserp, &req, NULL, NULL, NULL, NULL, code));
code = cm_MapRPCError(code, &req);
+ lock_ObtainMutex(&volp->mx);
if (code == 0 && volStat.Online) {
cm_VolumeStatusNotification(volp, volp->bk.ID, volp->bk.state, vl_online);
volp->bk.state = vl_online;
Index: openafs/src/WINNT/afsd/cm_volume.h
diff -c openafs/src/WINNT/afsd/cm_volume.h:1.5.6.7 openafs/src/WINNT/afsd/cm_volume.h:1.5.6.8
*** openafs/src/WINNT/afsd/cm_volume.h:1.5.6.7 Thu Nov 29 11:11:44 2007
--- openafs/src/WINNT/afsd/cm_volume.h Thu Jan 24 10:31:13 2008
***************
*** 62,67 ****
--- 62,68 ----
#define CM_GETVOL_FLAG_CREATE 1
#define CM_GETVOL_FLAG_NO_LRU_UPDATE 2
+ #define CM_GETVOL_FLAG_NO_RESET 4
/* hash define. Must not include the cell, since the callback revocation code
* doesn't necessarily know the cell in the case of a multihomed server
Index: openafs/src/WINNT/afsd/fs.c
diff -c openafs/src/WINNT/afsd/fs.c:1.32.4.16 openafs/src/WINNT/afsd/fs.c:1.32.4.19
*** openafs/src/WINNT/afsd/fs.c:1.32.4.16 Fri Jan 4 02:58:40 2008
--- openafs/src/WINNT/afsd/fs.c Fri Feb 8 21:32:19 2008
***************
*** 702,708 ****
DWORD enabled = 0;
code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSREG_CLT_SVC_PARAM_SUBKEY,
! 0, KEY_QUERY_VALUE, &parmKey);
if (code == ERROR_SUCCESS) {
dummyLen = sizeof(cm_freelanceEnabled);
code = RegQueryValueEx(parmKey, "FreelanceClient", NULL, NULL,
--- 702,708 ----
DWORD enabled = 0;
code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSREG_CLT_SVC_PARAM_SUBKEY,
! 0, (IsWow64()?KEY_WOW64_64KEY:0)|KEY_QUERY_VALUE, &parmKey);
if (code == ERROR_SUCCESS) {
dummyLen = sizeof(cm_freelanceEnabled);
code = RegQueryValueEx(parmKey, "FreelanceClient", NULL, NULL,
***************
*** 721,727 ****
DWORD enabled = 0;
code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSREG_CLT_SVC_PARAM_SUBKEY,
! 0, KEY_QUERY_VALUE, &parmKey);
if (code == ERROR_SUCCESS) {
dummyLen = sizeof(buffer);
code = RegQueryValueEx(parmKey, "NetbiosName", NULL, NULL,
--- 721,727 ----
DWORD enabled = 0;
code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSREG_CLT_SVC_PARAM_SUBKEY,
! 0, (IsWow64()?KEY_WOW64_64KEY:0)|KEY_QUERY_VALUE, &parmKey);
if (code == ERROR_SUCCESS) {
dummyLen = sizeof(buffer);
code = RegQueryValueEx(parmKey, "NetbiosName", NULL, NULL,
***************
*** 1112,1117 ****
--- 1112,1118 ----
afs_int32 tc, code, id;
char *nm;
char cell[MAXCELLCHARS];
+ char confDir[257];
for ( nm = aname; tc = *nm; nm++) {
/* all must be '-' or digit to be bad */
***************
*** 1124,1130 ****
if (code)
return 0;
! pr_Initialize(1, AFSDIR_CLIENT_ETC_DIRPATH, cell);
code = pr_SNameToId(aname, &id);
pr_End();
--- 1125,1133 ----
if (code)
return 0;
! cm_GetConfigDir(confDir, sizeof(confDir));
!
! pr_Initialize(1, confDir, cell);
code = pr_SNameToId(aname, &id);
pr_End();
***************
*** 1374,1384 ****
afs_int32 code;
struct ViceIoctl blob;
struct cmd_item *ti;
-
int error = 0;
for(ti=as->parms[0].items; ti; ti=ti->next) {
! blob.in_size = blob.out_size = 0;
code = pioctl(ti->data, VIOCFLUSH, &blob, 0);
if (code) {
if (errno == EMFILE) {
--- 1377,1399 ----
afs_int32 code;
struct ViceIoctl blob;
struct cmd_item *ti;
int error = 0;
+ int literal = 0;
+ cm_ioctlQueryOptions_t options;
+ if (as->parms[1].items)
+ literal = 1;
+
for(ti=as->parms[0].items; ti; ti=ti->next) {
! /* once per file */
! memset(&options, 0, sizeof(options));
! options.size = sizeof(options);
! options.field_flags |= CM_IOCTL_QOPTS_FIELD_LITERAL;
! options.literal = literal;
! blob.in_size = options.size; /* no variable length data */
! blob.in = &options;
!
! blob.out_size = 0;
code = pioctl(ti->data, VIOCFLUSH, &blob, 0);
if (code) {
if (errno == EMFILE) {
***************
*** 1470,1485 ****
return error;
}
! #ifndef WIN32
! /*
! * Why is VenusFid declared in the kernel-only section of afs.h,
! * if it's the exported interface of the (UNIX) cache manager?
! */
! struct VenusFid {
! afs_int32 Cell;
! AFSFid Fid;
! };
! #endif /* WIN32 */
static int
ExamineCmd(struct cmd_syndesc *as, void *arock)
--- 1485,1515 ----
return error;
}
! /* values match cache manager File Types */
! static char *
! filetypestr(afs_uint32 type)
! {
! char * s = "Object";
!
! switch (type) {
! case 1: /* file */
! s = "File";
! break;
! case 2:
! s = "Directory";
! break;
! case 3:
! s = "Symlink";
! break;
! case 4:
! s = "Mountpoint";
! break;
! case 5:
! s = "DfsLink";
! break;
! }
! return s;
! }
static int
ExamineCmd(struct cmd_syndesc *as, void *arock)
***************
*** 1490,1527 ****
struct VolumeStatus *status;
char *name, *offmsg, *motd;
int error = 0;
!
SetDotDefault(&as->parms[0].items);
for(ti=as->parms[0].items; ti; ti=ti->next) {
cm_fid_t fid;
afs_uint32 owner[2];
char cell[MAXCELLCHARS];
! code = GetCell(ti->data, cell);
! if (code) {
! Die(errno, ti->data);
! error = 1;
! continue;
! }
!
! /* once per file */
! blob.in_size = 0;
blob.out_size = sizeof(cm_fid_t);
blob.out = (char *) &fid;
if (0 == pioctl(ti->data, VIOCGETFID, &blob, 1)) {
! printf("File %s (%u.%u.%u) contained in cell %s\n",
! ti->data, fid.volume, fid.vnode, fid.unique,
! cell);
}
blob.out_size = 2 * sizeof(afs_uint32);
blob.out = (char *) &owner;
if (0 == pioctl(ti->data, VIOCGETOWNER, &blob, 1)) {
char oname[PR_MAXNAMELEN] = "(unknown)";
/* Go to the PRDB and see if this all number username is valid */
! pr_Initialize(1, AFSDIR_CLIENT_ETC_DIRPATH, cell);
pr_SIdToName(owner[0], oname);
printf("Owner %s (%u) Group %u\n", oname, owner[0], owner[1]);
}
--- 1520,1583 ----
struct VolumeStatus *status;
char *name, *offmsg, *motd;
int error = 0;
! int literal = 0;
! cm_ioctlQueryOptions_t options;
!
! if (as->parms[1].items)
! literal = 1;
!
SetDotDefault(&as->parms[0].items);
for(ti=as->parms[0].items; ti; ti=ti->next) {
cm_fid_t fid;
+ afs_uint32 filetype;
afs_uint32 owner[2];
char cell[MAXCELLCHARS];
! /* once per file */
! memset(&fid, 0, sizeof(fid));
! memset(&options, 0, sizeof(options));
! filetype = 0;
! options.size = sizeof(options);
! options.field_flags |= CM_IOCTL_QOPTS_FIELD_LITERAL;
! options.literal = literal;
! blob.in_size = options.size; /* no variable length data */
! blob.in = &options;
blob.out_size = sizeof(cm_fid_t);
blob.out = (char *) &fid;
if (0 == pioctl(ti->data, VIOCGETFID, &blob, 1)) {
! options.field_flags |= CM_IOCTL_QOPTS_FIELD_FID;
! options.fid = fid;
! } else {
! Die(errno, ti->data);
! error = 1;
! continue;
}
+ blob.out_size = sizeof(filetype);
+ blob.out = &filetype;
+
+ code = pioctl(ti->data, VIOC_GETFILETYPE, &blob, 1);
+
+ blob.out_size = MAXCELLCHARS;
+ blob.out = cell;
+
+ code = pioctl(ti->data, VIOC_FILE_CELL_NAME, &blob, 1);
+ printf("%s %s (%u.%u.%u) contained in cell %s\n",
+ filetypestr(filetype),
+ ti->data, fid.volume, fid.vnode, fid.unique,
+ code ? "unknown-cell" : cell);
+
blob.out_size = 2 * sizeof(afs_uint32);
blob.out = (char *) &owner;
if (0 == pioctl(ti->data, VIOCGETOWNER, &blob, 1)) {
char oname[PR_MAXNAMELEN] = "(unknown)";
+ char confDir[257];
/* Go to the PRDB and see if this all number username is valid */
! cm_GetConfigDir(confDir, sizeof(confDir));
!
! pr_Initialize(1, confDir, cell);
pr_SIdToName(owner[0], oname);
printf("Owner %s (%u) Group %u\n", oname, owner[0], owner[1]);
}
***************
*** 1606,1617 ****
afs_int32 *hosts;
char *tp;
int error = 0;
SetDotDefault(&as->parms[0].items);
for(ti=as->parms[0].items; ti; ti=ti->next) {
! /* once per file */
! blob.out_size = MAXSIZE;
! blob.in_size = 0;
blob.out = space;
memset(space, 0, sizeof(space));
code = pioctl(ti->data, VIOCWHEREIS, &blob, 1);
--- 1662,1705 ----
afs_int32 *hosts;
char *tp;
int error = 0;
+ int literal = 0;
+ cm_ioctlQueryOptions_t options;
+
+ if (as->parms[1].items)
+ literal = 1;
SetDotDefault(&as->parms[0].items);
for(ti=as->parms[0].items; ti; ti=ti->next) {
! cm_fid_t fid;
! afs_uint32 filetype;
!
! /* once per file */
! memset(&fid, 0, sizeof(fid));
! memset(&options, 0, sizeof(options));
! filetype = 0;
! options.size = sizeof(options);
! options.field_flags |= CM_IOCTL_QOPTS_FIELD_LITERAL;
! options.literal = literal;
! blob.in_size = options.size; /* no variable length data */
! blob.in = &options;
!
! blob.out_size = sizeof(cm_fid_t);
! blob.out = (char *) &fid;
! if (0 == pioctl(ti->data, VIOCGETFID, &blob, 1)) {
! options.field_flags |= CM_IOCTL_QOPTS_FIELD_FID;
! options.fid = fid;
! } else {
! Die(errno, ti->data);
! error = 1;
! continue;
! }
!
! blob.out_size = sizeof(filetype);
! blob.out = &filetype;
!
! code = pioctl(ti->data, VIOC_GETFILETYPE, &blob, 1);
!
! blob.out_size = MAXSIZE;
blob.out = space;
memset(space, 0, sizeof(space));
code = pioctl(ti->data, VIOCWHEREIS, &blob, 1);
***************
*** 1621,1627 ****
continue;
}
hosts = (afs_int32 *) space;
! printf("File %s is on host%s ", ti->data,
(hosts[0] && !hosts[1]) ? "": "s");
for(j=0; jdata,
(hosts[0] && !hosts[1]) ? "": "s");
for(j=0; jparms[0].items);
for(ti=as->parms[0].items; ti; ti=ti->next) {
! code = GetCell(ti->data, cell);
if (code) {
if (errno == ENOENT)
fprintf(stderr,"%s: no such cell as '%s'\n", pn, ti->data);
--- 2665,2714 ----
{
afs_int32 code;
struct cmd_item *ti;
+ struct ViceIoctl blob;
int error = 0;
! int literal = 0;
! cm_ioctlQueryOptions_t options;
!
! if (as->parms[1].items)
! literal = 1;
SetDotDefault(&as->parms[0].items);
for(ti=as->parms[0].items; ti; ti=ti->next) {
! cm_fid_t fid;
! afs_uint32 filetype;
! char cell[MAXCELLCHARS];
!
! /* once per file */
! memset(&fid, 0, sizeof(fid));
! memset(&options, 0, sizeof(options));
! filetype = 0;
! options.size = sizeof(options);
! options.field_flags |= CM_IOCTL_QOPTS_FIELD_LITERAL;
! options.literal = literal;
! blob.in_size = options.size; /* no variable length data */
! blob.in = &options;
!
! blob.out_size = sizeof(cm_fid_t);
! blob.out = (char *) &fid;
! if (0 == pioctl(ti->data, VIOCGETFID, &blob, 1)) {
! options.field_flags |= CM_IOCTL_QOPTS_FIELD_FID;
! options.fid = fid;
! } else {
! Die(errno, ti->data);
! error = 1;
! continue;
! }
!
! blob.out_size = sizeof(filetype);
! blob.out = &filetype;
!
! code = pioctl(ti->data, VIOC_GETFILETYPE, &blob, 1);
!
! blob.out_size = MAXCELLCHARS;
! blob.out = cell;
!
! code = pioctl(ti->data, VIOC_FILE_CELL_NAME, &blob, 1);
if (code) {
if (errno == ENOENT)
fprintf(stderr,"%s: no such cell as '%s'\n", pn, ti->data);
***************
*** 2589,2595 ****
error = 1;
continue;
}
! printf("File %s lives in cell '%s'\n", ti->data, cell);
}
return error;
}
--- 2717,2725 ----
error = 1;
continue;
}
! printf("%s %s lives in cell '%s'\n",
! filetypestr(filetype),
! ti->data, cell);
}
return error;
}
***************
*** 2625,2630 ****
--- 2755,2761 ----
}
*/
+ #ifndef AFS_NT40_ENV
static int
MonitorCmd(struct cmd_syndesc *as, void *arock)
{
***************
*** 2684,2689 ****
--- 2815,2821 ----
}
return 0;
}
+ #endif /* AFS_NT40_ENV */
static int
SysNameCmd(struct cmd_syndesc *as, void *arock)
***************
*** 2755,2760 ****
--- 2887,2893 ----
return 0;
}
+ #ifndef AFS_NT40_ENV
static char *exported_types[] = {"null", "nfs", ""};
static int ExportAfsCmd(struct cmd_syndesc *as, void *arock)
{
***************
*** 2856,2862 ****
}
return 0;
}
!
static int
GetCellCmd(struct cmd_syndesc *as, void *arock)
--- 2989,2995 ----
}
return 0;
}
! #endif
static int
GetCellCmd(struct cmd_syndesc *as, void *arock)
***************
*** 2968,3012 ****
return error;
}
- #ifdef WIN32
static int
GetCellName(char *cellNamep, struct afsconf_cell *infop)
{
strcpy(infop->name, cellNamep);
return 0;
}
- #else
- static int
- GetCellName(char *cellName, struct afsconf_cell *info)
- {
- struct afsconf_dir *tdir;
- int code;
-
- tdir = afsconf_Open(AFSDIR_CLIENT_ETC_CLIENTNAME);
- if (!tdir) {
- fprintf(stderr,
- "Could not process files in configuration directory (%s).\n",
- AFSDIR_CLIENT_ETC_CLIENTNAME);
- return -1;
- }
-
- code = afsconf_GetCellInfo(tdir, cellName, AFSCONF_VLDBSERVICE, info);
- if (code) {
- fprintf(stderr,"fs: cell %s not in %s/CellServDB\n", cellName,
- AFSDIR_CLIENT_ETC_CLIENTNAME);
- return code;
- }
-
- return 0;
- }
- #endif /* not WIN32 */
static int
VLDBInit(int noAuthFlag, struct afsconf_cell *info)
{
afs_int32 code;
! code = ugen_ClientInit(noAuthFlag, AFSDIR_CLIENT_ETC_DIRPATH,
info->name, 0, &uclient,
NULL, pn, rxkad_clear,
VLDB_MAXSERVERS, AFSCONF_VLDBSERVICE, 50,
--- 3101,3122 ----
return error;
}
static int
GetCellName(char *cellNamep, struct afsconf_cell *infop)
{
strcpy(infop->name, cellNamep);
return 0;
}
static int
VLDBInit(int noAuthFlag, struct afsconf_cell *info)
{
afs_int32 code;
+ char confDir[257];
+
+ cm_GetConfigDir(confDir, sizeof(confDir));
! code = ugen_ClientInit(noAuthFlag, confDir,
info->name, 0, &uclient,
NULL, pn, rxkad_clear,
VLDB_MAXSERVERS, AFSCONF_VLDBSERVICE, 50,
***************
*** 3926,3932 ****
0,
"AFS",
REG_OPTION_NON_VOLATILE,
! KEY_WRITE,
NULL,
&hkCSCPolicy,
NULL );
--- 4036,4042 ----
0,
"AFS",
REG_OPTION_NON_VOLATILE,
! (IsWow64()?KEY_WOW64_64KEY:0)|KEY_WRITE,
NULL,
&hkCSCPolicy,
NULL );
***************
*** 3974,3980 ****
0,
"AFS",
REG_OPTION_NON_VOLATILE,
! KEY_READ|KEY_QUERY_VALUE,
NULL,
&hkCSCPolicy,
NULL );
--- 4084,4090 ----
0,
"AFS",
REG_OPTION_NON_VOLATILE,
! (IsWow64()?KEY_WOW64_64KEY:0)|KEY_READ|KEY_QUERY_VALUE,
NULL,
&hkCSCPolicy,
NULL );
***************
*** 4486,4491 ****
--- 4596,4602 ----
ts = cmd_CreateSyntax("flush", FlushCmd, NULL, "flush file from cache");
cmd_AddParm(ts, "-path", CMD_LIST, CMD_OPTIONAL, "dir/file path");
+ cmd_AddParm(ts, "-literal", CMD_FLAG, CMD_OPTIONAL, "literal evaluation of mountpoints and symlinks");
#ifndef WIN32
ts = cmd_CreateSyntax("flushmount", FlushMountCmd, NULL,
***************
*** 4508,4513 ****
--- 4619,4625 ----
ts = cmd_CreateSyntax("examine", ExamineCmd, NULL, "display file/volume status");
cmd_AddParm(ts, "-path", CMD_LIST, CMD_OPTIONAL, "dir/file path");
+ cmd_AddParm(ts, "-literal", CMD_FLAG, CMD_OPTIONAL, "literal evaluation of mountpoints and symlinks");
cmd_CreateAlias(ts, "lv");
cmd_CreateAlias(ts, "listvol");
***************
*** 4597,4605 ****
--- 4709,4719 ----
ts = cmd_CreateSyntax("whichcell", WhichCellCmd, NULL, "list file's cell");
cmd_AddParm(ts, "-path", CMD_LIST, CMD_OPTIONAL, "dir/file path");
+ cmd_AddParm(ts, "-literal", CMD_FLAG, CMD_OPTIONAL, "literal evaluation of mountpoints and symlinks");
ts = cmd_CreateSyntax("whereis", WhereIsCmd, NULL, "list file's location");
cmd_AddParm(ts, "-path", CMD_LIST, CMD_OPTIONAL, "dir/file path");
+ cmd_AddParm(ts, "-literal", CMD_FLAG, CMD_OPTIONAL, "literal evaluation of mountpoints and symlinks");
ts = cmd_CreateSyntax("wscell", WSCellCmd, NULL, "list workstation's cell");
***************
*** 4607,4617 ****
ts = cmd_CreateSyntax("primarycell", PrimaryCellCmd, 0, "obsolete (listed primary cell)");
*/
ts = cmd_CreateSyntax("monitor", MonitorCmd, NULL, "set cache monitor host address");
cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_OPTIONAL, "host name or 'off'");
cmd_CreateAlias(ts, "mariner");
!
!
ts = cmd_CreateSyntax("getcellstatus", GetCellCmd, NULL, "get cell status");
cmd_AddParm(ts, "-cell", CMD_LIST, 0, "cell name");
--- 4721,4732 ----
ts = cmd_CreateSyntax("primarycell", PrimaryCellCmd, 0, "obsolete (listed primary cell)");
*/
+ #ifndef AFS_NT40_ENV
ts = cmd_CreateSyntax("monitor", MonitorCmd, NULL, "set cache monitor host address");
cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_OPTIONAL, "host name or 'off'");
cmd_CreateAlias(ts, "mariner");
! #endif
!
ts = cmd_CreateSyntax("getcellstatus", GetCellCmd, NULL, "get cell status");
cmd_AddParm(ts, "-cell", CMD_LIST, 0, "cell name");
***************
*** 4628,4640 ****
ts = cmd_CreateSyntax("sysname", SysNameCmd, NULL, "get/set sysname (i.e. @sys) value");
cmd_AddParm(ts, "-newsys", CMD_LIST, CMD_OPTIONAL, "new sysname");
ts = cmd_CreateSyntax("exportafs", ExportAfsCmd, NULL, "enable/disable translators to AFS");
cmd_AddParm(ts, "-type", CMD_SINGLE, 0, "exporter name");
cmd_AddParm(ts, "-start", CMD_SINGLE, CMD_OPTIONAL, "start/stop translator ('on' or 'off')");
cmd_AddParm(ts, "-convert", CMD_SINGLE, CMD_OPTIONAL, "convert from afs to unix mode ('on or 'off')");
cmd_AddParm(ts, "-uidcheck", CMD_SINGLE, CMD_OPTIONAL, "run on strict 'uid check' mode ('on' or 'off')");
cmd_AddParm(ts, "-submounts", CMD_SINGLE, CMD_OPTIONAL, "allow nfs mounts to subdirs of /afs/.. ('on' or 'off')");
!
ts = cmd_CreateSyntax("storebehind", StoreBehindCmd, NULL,
"store to server after file close");
--- 4743,4756 ----
ts = cmd_CreateSyntax("sysname", SysNameCmd, NULL, "get/set sysname (i.e. @sys) value");
cmd_AddParm(ts, "-newsys", CMD_LIST, CMD_OPTIONAL, "new sysname");
+ #ifndef AFS_NT40_ENV
ts = cmd_CreateSyntax("exportafs", ExportAfsCmd, NULL, "enable/disable translators to AFS");
cmd_AddParm(ts, "-type", CMD_SINGLE, 0, "exporter name");
cmd_AddParm(ts, "-start", CMD_SINGLE, CMD_OPTIONAL, "start/stop translator ('on' or 'off')");
cmd_AddParm(ts, "-convert", CMD_SINGLE, CMD_OPTIONAL, "convert from afs to unix mode ('on or 'off')");
cmd_AddParm(ts, "-uidcheck", CMD_SINGLE, CMD_OPTIONAL, "run on strict 'uid check' mode ('on' or 'off')");
cmd_AddParm(ts, "-submounts", CMD_SINGLE, CMD_OPTIONAL, "allow nfs mounts to subdirs of /afs/.. ('on' or 'off')");
! #endif
ts = cmd_CreateSyntax("storebehind", StoreBehindCmd, NULL,
"store to server after file close");
Index: openafs/src/WINNT/afsd/fs_utils.c
diff -c openafs/src/WINNT/afsd/fs_utils.c:1.10.2.2 openafs/src/WINNT/afsd/fs_utils.c:1.10.2.4
*** openafs/src/WINNT/afsd/fs_utils.c:1.10.2.2 Sun Aug 19 20:07:59 2007
--- openafs/src/WINNT/afsd/fs_utils.c Fri Feb 8 21:32:19 2008
***************
*** 175,181 ****
/* compute the # itself */
while(tc = *as) {
! if (!ismeta(tc, base)) return -1;
total *= base;
total += getmeta(tc);
as++;
--- 175,181 ----
/* compute the # itself */
while(tc = *as) {
! if (!ismeta(base, tc)) return -1;
total *= base;
total += getmeta(tc);
as++;
***************
*** 197,203 ****
char *pmount=mountRoot;
DWORD len=sizeof(mountRoot)-1;
printf("int mountroot \n");
! if ((RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSREG_CLT_SVC_PARAM_SUBKEY, 0, KEY_QUERY_VALUE, &parmKey)!= ERROR_SUCCESS)
|| (RegQueryValueEx(parmKey, "Mountroot", NULL, NULL,(LPBYTE)(mountRoot), &len)!= ERROR_SUCCESS)
|| (len==sizeof(mountRoot)-1)
)
--- 197,204 ----
char *pmount=mountRoot;
DWORD len=sizeof(mountRoot)-1;
printf("int mountroot \n");
! if ((RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSREG_CLT_SVC_PARAM_SUBKEY, 0,
! (IsWow64()?KEY_WOW64_64KEY:0)|KEY_QUERY_VALUE, &parmKey)!= ERROR_SUCCESS)
|| (RegQueryValueEx(parmKey, "Mountroot", NULL, NULL,(LPBYTE)(mountRoot), &len)!= ERROR_SUCCESS)
|| (len==sizeof(mountRoot)-1)
)
***************
*** 215,218 ****
strcpy(cm_back_slash_mount_root+1,pmount);
cm_back_slash_mount_root[0]='\\';
}
-
--- 216,218 ----
Index: openafs/src/WINNT/afsd/lanahelper.cpp
diff -c openafs/src/WINNT/afsd/lanahelper.cpp:1.12.2.5 openafs/src/WINNT/afsd/lanahelper.cpp:1.12.2.6
*** openafs/src/WINNT/afsd/lanahelper.cpp:1.12.2.5 Mon Oct 1 16:03:44 2007
--- openafs/src/WINNT/afsd/lanahelper.cpp Mon Jan 28 19:21:52 2008
***************
*** 572,579 ****
rv = RegQueryValueEx(hkConfig, szNetbiosNameValue, NULL, NULL, (LPBYTE) ®NbName, &dummyLen);
if(rv != ERROR_SUCCESS)
strcpy(regNbName, "AFS");
! else
! regNbName[15] = 0;
RegCloseKey(hkConfig);
} else {
--- 572,581 ----
rv = RegQueryValueEx(hkConfig, szNetbiosNameValue, NULL, NULL, (LPBYTE) ®NbName, &dummyLen);
if(rv != ERROR_SUCCESS)
strcpy(regNbName, "AFS");
! else {
! /* Max Suffix Length is 6 */
! regNbName[6] = 0;
! }
RegCloseKey(hkConfig);
} else {
***************
*** 617,642 ****
if(regNbName[0] &&
(regLana >=0 && lana_IsLoopback((lana_number_t) regLana,FALSE)))
{
! strncpy(nbName,regNbName,15);
! nbName[16] = 0;
strupr(nbName);
} else {
- char * dot;
-
if(flags & LANA_NETBIOS_NAME_SUFFIX) {
! strcpy(nbName,"-AFS");
} else {
dummyLen = sizeof(hostname);
// assume we are not a cluster.
rv = GetComputerName(hostname, &dummyLen);
if(!SUCCEEDED(rv)) { // should not happen, but...
return rv;
}
! strncpy(nbName, hostname, 11);
! nbName[11] = 0;
if(dot = strchr(nbName,'.'))
*dot = 0;
! strcat(nbName,"-AFS");
}
}
--- 619,648 ----
if(regNbName[0] &&
(regLana >=0 && lana_IsLoopback((lana_number_t) regLana,FALSE)))
{
! strncpy(nbName,regNbName,14);
! nbName[14] = 0;
strupr(nbName);
} else {
if(flags & LANA_NETBIOS_NAME_SUFFIX) {
! _snprintf(nbName, MAX_NB_NAME_LENGTH, "-%s", regNbName);
! nbName[14] = 0;
} else {
+ char * dot;
+
dummyLen = sizeof(hostname);
// assume we are not a cluster.
rv = GetComputerName(hostname, &dummyLen);
if(!SUCCEEDED(rv)) { // should not happen, but...
return rv;
}
! strncpy(nbName, hostname, MAX_NB_NAME_LENGTH);
! nbName[MAX_NB_NAME_LENGTH-1] = 0;
! nbName[MAX_NB_NAME_LENGTH-strlen(regNbName)-2] = 0;
if(dot = strchr(nbName,'.'))
*dot = 0;
! strncat(nbName, "-", MAX_NB_NAME_LENGTH);
! strncat(nbName, regNbName, MAX_NB_NAME_LENGTH);
! nbName[MAX_NB_NAME_LENGTH-1] = 0;
}
}
Index: openafs/src/WINNT/afsd/lanahelper.h
diff -c openafs/src/WINNT/afsd/lanahelper.h:1.5.6.1 openafs/src/WINNT/afsd/lanahelper.h:1.5.6.3
*** openafs/src/WINNT/afsd/lanahelper.h:1.5.6.1 Sat Oct 21 16:47:48 2006
--- openafs/src/WINNT/afsd/lanahelper.h Mon Jan 28 19:21:52 2008
***************
*** 35,42 ****
typedef BYTE lana_number_t;
- #define LANA_INVALID 0xff
-
struct LANAINFO
{
lana_number_t lana_number;
--- 35,40 ----
***************
*** 44,50 ****
};
#define LANA_INVALID 0xff
! #define MAX_NB_NAME_LENGTH 17
#define LANA_NETBIOS_NAME_SUFFIX 1
#define LANA_NETBIOS_NAME_FULL 0
--- 42,48 ----
};
#define LANA_INVALID 0xff
! #define MAX_NB_NAME_LENGTH 16
#define LANA_NETBIOS_NAME_SUFFIX 1
#define LANA_NETBIOS_NAME_FULL 0
Index: openafs/src/WINNT/afsd/libafsconf.def
diff -c openafs/src/WINNT/afsd/libafsconf.def:1.4 openafs/src/WINNT/afsd/libafsconf.def:1.4.6.1
*** openafs/src/WINNT/afsd/libafsconf.def:1.4 Fri Mar 11 00:33:23 2005
--- openafs/src/WINNT/afsd/libafsconf.def Fri Feb 1 16:39:41 2008
***************
*** 23,26 ****
cm_GetConfigDir @16
afs_uuid_create @17
afs_uuid_equal @18
!
\ No newline at end of file
--- 23,26 ----
cm_GetConfigDir @16
afs_uuid_create @17
afs_uuid_equal @18
! cm_GetCellServDB @19
Index: openafs/src/WINNT/afsd/smb.c
diff -c openafs/src/WINNT/afsd/smb.c:1.118.2.50 openafs/src/WINNT/afsd/smb.c:1.118.2.58
*** openafs/src/WINNT/afsd/smb.c:1.118.2.50 Sun Jan 6 01:26:06 2008
--- openafs/src/WINNT/afsd/smb.c Fri Feb 8 21:32:19 2008
***************
*** 64,72 ****
osi_rwlock_t smb_globalLock;
osi_rwlock_t smb_rctLock;
osi_mutex_t smb_ListenerLock;
! char smb_LANadapter = -1;
unsigned char smb_sharename[NCBNAMSZ+1] = {0};
BOOL isGateway = FALSE;
--- 64,74 ----
osi_rwlock_t smb_globalLock;
osi_rwlock_t smb_rctLock;
osi_mutex_t smb_ListenerLock;
+ osi_mutex_t smb_StartedLock;
! unsigned char smb_LANadapter = LANA_INVALID;
unsigned char smb_sharename[NCBNAMSZ+1] = {0};
+ int smb_LanAdapterChangeDetected = 0;
BOOL isGateway = FALSE;
***************
*** 96,101 ****
--- 98,104 ----
EVENT_HANDLE **NCBreturns;
EVENT_HANDLE **NCBShutdown;
EVENT_HANDLE *smb_ServerShutdown;
+ EVENT_HANDLE ListenerShutdown[256];
DWORD NCBsessions[NCB_MAX];
NCB *NCBs[NCB_MAX];
struct smb_packet *bufs[NCB_MAX];
***************
*** 106,112 ****
int lanas[SESSION_MAX];
BOOL dead_sessions[SESSION_MAX];
LANA_ENUM lana_list;
-
/* for raw I/O */
osi_mutex_t smb_RawBufLock;
#ifdef DJGPP
--- 109,114 ----
***************
*** 180,186 ****
/* forward decl */
void smb_DispatchPacket(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp,
NCB *ncbp, raw_write_cont_t *rwcp);
! int smb_NetbiosInit(void);
#ifdef DJGPP
#ifndef AFS_WIN95_ENV
DWORD smb_ServerExceptionFilter(void);
--- 182,188 ----
/* forward decl */
void smb_DispatchPacket(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp,
NCB *ncbp, raw_write_cont_t *rwcp);
! int smb_NetbiosInit(int);
#ifdef DJGPP
#ifndef AFS_WIN95_ENV
DWORD smb_ServerExceptionFilter(void);
***************
*** 2824,2834 ****
NTStatus = 0xC09820FBL; /* SMB use standard */
}
else if (code == CM_ERROR_QUOTA) {
- #ifdef COMMENT
NTStatus = 0xC0000044L; /* Quota exceeded */
- #else
- NTStatus = 0xC000007FL; /* Disk full */
- #endif
}
else if (code == CM_ERROR_SPACE) {
NTStatus = 0xC000007FL; /* Disk full */
--- 2826,2832 ----
***************
*** 2887,2893 ****
}
else if (code == CM_ERROR_BAD_LEVEL) {
NTStatus = 0xC0000148L; /* Invalid Level */
! } else {
NTStatus = 0xC0982001L; /* SMB non-specific error */
}
--- 2885,2895 ----
}
else if (code == CM_ERROR_BAD_LEVEL) {
NTStatus = 0xC0000148L; /* Invalid Level */
! }
! else if (code == CM_ERROR_RANGE_NOT_LOCKED) {
! NTStatus = 0xC000007EL; /* Range Not Locked */
! }
! else {
NTStatus = 0xC0982001L; /* SMB non-specific error */
}
***************
*** 8451,8456 ****
--- 8453,8464 ----
time_t now;
#endif /* DJGPP */
INT_PTR lana = (INT_PTR) parmp;
+ char eventName[MAX_PATH];
+
+ sprintf(eventName,"smb_Listener_lana_%d", (char)lana);
+ ListenerShutdown[lana] = thrd_CreateEvent(NULL, FALSE, FALSE, eventName);
+ if ( GetLastError() == ERROR_ALREADY_EXISTS )
+ thrd_ResetEvent(ListenerShutdown[lana]);
ncbp = GetNCB();
#ifdef DJGPP
***************
*** 8484,8510 ****
#else /* DJGPP */
code = Netbios(ncbp, dos_ncb);
#endif
! if (code == NRC_BRIDGE) {
int lanaRemaining = 0;
! if (smb_ListenerState == SMB_LISTENER_STOPPED || smbShutdownFlag == 1) {
! #ifndef DJGPP
! ExitThread(1);
! #else
! thrd_Exit(1);
! #endif
}
! osi_Log2(smb_logp,
! "NCBLISTEN lana=%d failed with NRC_BRIDGE. Listener thread exiting.",
! ncbp->ncb_lana_num, code);
for (i = 0; i < lana_list.length; i++) {
! if (lana_list.lana[i] == ncbp->ncb_lana_num) {
! smb_StopListener(ncbp, lana_list.lana[i]);
! lana_list.lana[i] = 255;
}
! if (lana_list.lana[i] != 255)
lanaRemaining++;
}
--- 8492,8527 ----
#else /* DJGPP */
code = Netbios(ncbp, dos_ncb);
#endif
! if (code == NRC_NAMERR) {
! /* An smb shutdown or Vista resume must have taken place */
! osi_Log2(smb_logp,
! "NCBLISTEN lana=%d failed with NRC_NAMERR.",
! ncbp->ncb_lana_num, code);
!
! if (lock_TryMutex(&smb_StartedLock)) {
! lana_list.lana[i] = LANA_INVALID;
! lock_ReleaseMutex(&smb_StartedLock);
! }
! break;
! } else if (code == NRC_BRIDGE || code != 0) {
int lanaRemaining = 0;
! while (!lock_TryMutex(&smb_StartedLock)) {
! if (smb_ListenerState == SMB_LISTENER_STOPPED || smbShutdownFlag == 1)
! goto exit_thread;
! Sleep(50);
}
! osi_Log2(smb_logp,
! "NCBLISTEN lana=%d failed with %s. Listener thread exiting.",
! ncbp->ncb_lana_num, ncb_error_string(code));
for (i = 0; i < lana_list.length; i++) {
! if (lana_list.lana[i] == lana) {
! smb_StopListener(ncbp, lana_list.lana[i], FALSE);
! lana_list.lana[i] = LANA_INVALID;
}
! if (lana_list.lana[i] != LANA_INVALID)
lanaRemaining++;
}
***************
*** 8515,8550 ****
#endif
);
smb_ListenerState = SMB_LISTENER_STOPPED;
! smb_LANadapter = -1;
lana_list.length = 0;
}
! FreeNCB(ncbp);
! return;
! } else if (code != 0) {
#ifndef DJGPP
char tbuffer[AFSPATHMAX];
#endif
/* terminate silently if shutdown flag is set */
! if (smb_ListenerState == SMB_LISTENER_STOPPED || smbShutdownFlag == 1) {
! #ifndef DJGPP
! ExitThread(1);
! #else
! thrd_Exit(1);
! #endif
}
! osi_Log2(smb_logp,
! "NCBLISTEN lana=%d failed with code %d",
! ncbp->ncb_lana_num, code);
osi_Log0(smb_logp,
"Client exiting due to network failure. Please restart client.\n");
#ifndef DJGPP
sprintf(tbuffer,
"Client exiting due to network failure. Please restart client.\n"
! "NCBLISTEN lana=%d failed with code %d",
! ncbp->ncb_lana_num, code);
if (showErrors)
code = (*smb_MBfunc)(NULL, tbuffer, "AFS Client Service: Fatal Error",
MB_OK|MB_SERVICE_NOTIFICATION);
--- 8532,8567 ----
#endif
);
smb_ListenerState = SMB_LISTENER_STOPPED;
! smb_LANadapter = LANA_INVALID;
lana_list.length = 0;
}
! lock_ReleaseMutex(&smb_StartedLock);
! break;
! }
! #if 0
! else if (code != 0) {
#ifndef DJGPP
char tbuffer[AFSPATHMAX];
#endif
/* terminate silently if shutdown flag is set */
! while (!lock_TryMutex(&smb_StartedLock)) {
! if (smb_ListenerState == SMB_LISTENER_STOPPED || smbShutdownFlag == 1)
! goto exit_thread;
! Sleep(50);
}
! osi_Log3(smb_logp,
! "NCBLISTEN lana=%d failed with code %d [%s]",
! ncbp->ncb_lana_num, code, ncb_error_string(code));
osi_Log0(smb_logp,
"Client exiting due to network failure. Please restart client.\n");
#ifndef DJGPP
sprintf(tbuffer,
"Client exiting due to network failure. Please restart client.\n"
! "NCBLISTEN lana=%d failed with code %d [%s]",
! ncbp->ncb_lana_num, code, ncb_error_string(code));
if (showErrors)
code = (*smb_MBfunc)(NULL, tbuffer, "AFS Client Service: Fatal Error",
MB_OK|MB_SERVICE_NOTIFICATION);
***************
*** 8557,8563 ****
--- 8574,8584 ----
fprintf(stderr, "Please restart client.\n");
afs_exit(AFS_EXITCODE_NETWORK_FAILURE);
#endif /* !DJGPP */
+
+ lock_ReleaseMutex(&smb_StartedLock);
+ break;
}
+ #endif /* 0 */
/* check for remote conns */
/* first get remote name and insert null terminator */
***************
*** 8751,8784 ****
lock_ReleaseMutex(&smb_ListenerLock);
} /* dispatch while loop */
FreeNCB(ncbp);
}
! void smb_LanAdapterChange(void) {
lana_number_t lanaNum;
BOOL bGateway;
char NetbiosName[MAX_NB_NAME_LENGTH] = "";
int change = 0;
if (!powerStateSuspended &&
SUCCEEDED(lana_GetUncServerNameEx(NetbiosName, &lanaNum, &bGateway,
! LANA_NETBIOS_NAME_FULL))) {
! if (smb_LANadapter != lanaNum ||
! isGateway != bGateway ||
! strcmp(cm_NetbiosName, NetbiosName))
change = 1;
}
if (change) {
afsi_log("Lan Adapter Change detected");
! smb_StopListeners();
! smb_RestartListeners();
}
}
/* initialize Netbios */
! int smb_NetbiosInit(void)
{
NCB *ncbp;
#ifdef DJGPP
--- 8772,8869 ----
lock_ReleaseMutex(&smb_ListenerLock);
} /* dispatch while loop */
+ exit_thread:
FreeNCB(ncbp);
+ thrd_SetEvent(ListenerShutdown[lana]);
+ return;
+ }
+
+ static void
+ smb_LanAdapterChangeThread(void *param)
+ {
+ /*
+ * Give the IPAddrDaemon thread a chance
+ * to block before we trigger.
+ */
+ Sleep(30000);
+ smb_LanAdapterChange(0);
}
+ void smb_SetLanAdapterChangeDetected(void)
+ {
+ int lpid;
+ thread_t phandle;
+
+ lock_ObtainMutex(&smb_StartedLock);
! if (!powerStateSuspended) {
! phandle = thrd_Create(NULL, 65536, (ThreadFunc) smb_LanAdapterChangeThread,
! NULL, 0, &lpid, "smb_LanAdapterChange");
! osi_assertx(phandle != NULL, "smb_LanAdapterChangeThread thread creation failure");
! thrd_CloseHandle(phandle);
! }
!
! smb_LanAdapterChangeDetected = 1;
! lock_ReleaseMutex(&smb_StartedLock);
! }
!
! void smb_LanAdapterChange(int locked) {
lana_number_t lanaNum;
BOOL bGateway;
char NetbiosName[MAX_NB_NAME_LENGTH] = "";
int change = 0;
+ LANA_ENUM temp_list;
+ long code;
+ int i;
+
+
+ afsi_log("smb_LanAdapterChange");
+
+ if (!locked)
+ lock_ObtainMutex(&smb_StartedLock);
+
+ smb_LanAdapterChangeDetected = 0;
if (!powerStateSuspended &&
SUCCEEDED(lana_GetUncServerNameEx(NetbiosName, &lanaNum, &bGateway,
! LANA_NETBIOS_NAME_FULL)) &&
! lanaNum != LANA_INVALID && smb_LANadapter != lanaNum) {
! if ( isGateway != bGateway ||
! strcmp(cm_NetbiosName, NetbiosName) ) {
change = 1;
+ } else {
+ NCB *ncbp = GetNCB();
+ ncbp->ncb_command = NCBENUM;
+ ncbp->ncb_buffer = (PUCHAR)&temp_list;
+ ncbp->ncb_length = sizeof(temp_list);
+ code = Netbios(ncbp);
+ if (code == 0) {
+ if (temp_list.length != lana_list.length)
+ change = 1;
+ else {
+ for (i=0; incb_command = NCBENUM;
ncbp->ncb_buffer = (PUCHAR)&lana_list;
ncbp->ncb_length = sizeof(lana_list);
--- 8922,8928 ----
#ifndef DJGPP
! if (smb_LANadapter == LANA_INVALID) {
ncbp->ncb_command = NCBENUM;
ncbp->ncb_buffer = (PUCHAR)&lana_list;
ncbp->ncb_length = sizeof(lana_list);
***************
*** 8855,8861 ****
code = ncbp->ncb_retcode;
if (code != 0) {
afsi_log("Netbios NCBRESET lana %d error code %d", lana_list.lana[i], code);
! lana_list.lana[i] = 255; /* invalid lana */
} else {
afsi_log("Netbios NCBRESET lana %d succeeded", lana_list.lana[i]);
}
--- 8950,8956 ----
code = ncbp->ncb_retcode;
if (code != 0) {
afsi_log("Netbios NCBRESET lana %d error code %d", lana_list.lana[i], code);
! lana_list.lana[i] = LANA_INVALID; /* invalid lana */
} else {
afsi_log("Netbios NCBRESET lana %d succeeded", lana_list.lana[i]);
}
***************
*** 8863,8869 ****
#else
/* for DJGPP, there is no NCBENUM and NCBRESET is a real reset. so
we will just fake the LANA list */
! if (smb_LANadapter == -1) {
for (i = 0; i < 8; i++)
lana_list.lana[i] = i;
lana_list.length = 8;
--- 8958,8964 ----
#else
/* for DJGPP, there is no NCBENUM and NCBRESET is a real reset. so
we will just fake the LANA list */
! if (smb_LANadapter == LANA_INVALID) {
for (i = 0; i < 8; i++)
lana_list.lana[i] = i;
lana_list.length = 8;
***************
*** 8917,8923 ****
else {
afsi_log("Netbios NCBADDNAME lana %d error code %d", lana, code);
if (code == NRC_BRIDGE) { /* invalid LANA num */
! lana_list.lana[l] = 255;
continue;
}
else if (code == NRC_DUPNAME) {
--- 9012,9018 ----
else {
afsi_log("Netbios NCBADDNAME lana %d error code %d", lana, code);
if (code == NRC_BRIDGE) { /* invalid LANA num */
! lana_list.lana[l] = LANA_INVALID;
continue;
}
else if (code == NRC_DUPNAME) {
***************
*** 8937,8943 ****
afsi_log("Netbios NCBDELNAME lana %d error code %d\n", lana, code);
}
if (code != 0 || delname_tried) {
! lana_list.lana[l] = 255;
}
else if (code == 0) {
if (!delname_tried) {
--- 9032,9038 ----
afsi_log("Netbios NCBDELNAME lana %d error code %d\n", lana, code);
}
if (code != 0 || delname_tried) {
! lana_list.lana[l] = LANA_INVALID;
}
else if (code == 0) {
if (!delname_tried) {
***************
*** 8949,8958 ****
}
else {
afsi_log("Netbios NCBADDNAME lana %d error code %d", lana, code);
! lana_list.lana[l] = 255; /* invalid lana */
}
}
if (code == 0) {
lana_found = 1; /* at least one worked */
#ifdef DJGPP
break;
--- 9044,9054 ----
}
else {
afsi_log("Netbios NCBADDNAME lana %d error code %d", lana, code);
! lana_list.lana[l] = LANA_INVALID; /* invalid lana */
}
}
if (code == 0) {
+ smb_LANadapter = lana;
lana_found = 1; /* at least one worked */
#ifdef DJGPP
break;
***************
*** 8964,8970 ****
if (!lana_found) {
afsi_log("No valid LANA numbers found!");
lana_list.length = 0;
! smb_LANadapter = -1;
smb_ListenerState = SMB_LISTENER_STOPPED;
cm_VolStatus_Network_Stopped(cm_NetbiosName
#ifdef _WIN64
--- 9060,9066 ----
if (!lana_found) {
afsi_log("No valid LANA numbers found!");
lana_list.length = 0;
! smb_LANadapter = LANA_INVALID;
smb_ListenerState = SMB_LISTENER_STOPPED;
cm_VolStatus_Network_Stopped(cm_NetbiosName
#ifdef _WIN64
***************
*** 8976,8993 ****
/* we're done with the NCB now */
FreeNCB(ncbp);
! return ((lana_list.length > 0 && smb_LANadapter != -1) ? 1 : 0);
}
! void smb_StartListeners()
{
int i;
int lpid;
thread_t phandle;
! if (smb_ListenerState == SMB_LISTENER_STARTED)
return;
!
smb_ListenerState = SMB_LISTENER_STARTED;
cm_VolStatus_Network_Started(cm_NetbiosName
#ifdef _WIN64
--- 9072,9103 ----
/* we're done with the NCB now */
FreeNCB(ncbp);
! afsi_log("smb_NetbiosInit smb_LANadapter=%d",smb_LANadapter);
! if (lana_list.length > 0)
! osi_assert(smb_LANadapter != LANA_INVALID);
!
! if (!locked)
! lock_ReleaseMutex(&smb_StartedLock);
!
! return (lana_list.length > 0 ? 1 : 0);
}
! void smb_StartListeners(int locked)
{
int i;
int lpid;
thread_t phandle;
! if (!locked)
! lock_ObtainMutex(&smb_StartedLock);
!
! if (smb_ListenerState == SMB_LISTENER_STARTED) {
! if (!locked)
! lock_ReleaseMutex(&smb_StartedLock);
return;
! }
!
! afsi_log("smb_StartListeners");
smb_ListenerState = SMB_LISTENER_STARTED;
cm_VolStatus_Network_Started(cm_NetbiosName
#ifdef _WIN64
***************
*** 8996,9023 ****
);
for (i = 0; i < lana_list.length; i++) {
! if (lana_list.lana[i] == 255)
continue;
phandle = thrd_Create(NULL, 65536, (ThreadFunc) smb_Listener,
(void*)lana_list.lana[i], 0, &lpid, "smb_Listener");
osi_assertx(phandle != NULL, "smb_Listener thread creation failure");
thrd_CloseHandle(phandle);
}
}
! void smb_RestartListeners()
{
! if (!powerStateSuspended) {
if (smb_ListenerState == SMB_LISTENER_STOPPED) {
! if (smb_NetbiosInit())
! smb_StartListeners();
! }
! if (smb_LANadapter == -1)
! smb_LanAdapterChange();
}
}
! void smb_StopListener(NCB *ncbp, int lana)
{
long code;
--- 9106,9143 ----
);
for (i = 0; i < lana_list.length; i++) {
! if (lana_list.lana[i] == LANA_INVALID)
continue;
phandle = thrd_Create(NULL, 65536, (ThreadFunc) smb_Listener,
(void*)lana_list.lana[i], 0, &lpid, "smb_Listener");
osi_assertx(phandle != NULL, "smb_Listener thread creation failure");
thrd_CloseHandle(phandle);
}
+ if (!locked)
+ lock_ReleaseMutex(&smb_StartedLock);
}
! void smb_RestartListeners(int locked)
{
! if (!locked)
! lock_ObtainMutex(&smb_StartedLock);
!
! if (powerStateSuspended)
! afsi_log("smb_RestartListeners called while suspended");
!
! if (!powerStateSuspended && smb_ListenerState != SMB_LISTENER_UNINITIALIZED) {
if (smb_ListenerState == SMB_LISTENER_STOPPED) {
! if (smb_NetbiosInit(1))
! smb_StartListeners(1);
! } else if (smb_LanAdapterChangeDetected) {
! smb_LanAdapterChange(1);
! }
}
+ if (!locked)
+ lock_ReleaseMutex(&smb_StartedLock);
}
! void smb_StopListener(NCB *ncbp, int lana, int wait)
{
long code;
***************
*** 9043,9058 ****
} else {
afsi_log("Netbios NCBRESET lana %d succeeded", lana);
}
}
! void smb_StopListeners(void)
{
NCB *ncbp;
int lana, l;
! if (smb_ListenerState == SMB_LISTENER_STOPPED)
return;
smb_ListenerState = SMB_LISTENER_STOPPED;
cm_VolStatus_Network_Stopped(cm_NetbiosName
#ifdef _WIN64
--- 9163,9188 ----
} else {
afsi_log("Netbios NCBRESET lana %d succeeded", lana);
}
+
+ if (wait)
+ thrd_WaitForSingleObject_Event(ListenerShutdown[lana], INFINITE);
}
! void smb_StopListeners(int locked)
{
NCB *ncbp;
int lana, l;
! if (!locked)
! lock_ObtainMutex(&smb_StartedLock);
!
! if (smb_ListenerState == SMB_LISTENER_STOPPED) {
! if (!locked)
! lock_ReleaseMutex(&smb_StartedLock);
return;
+ }
+ afsi_log("smb_StopListeners");
smb_ListenerState = SMB_LISTENER_STOPPED;
cm_VolStatus_Network_Stopped(cm_NetbiosName
#ifdef _WIN64
***************
*** 9066,9084 ****
for (l = 0; l < lana_list.length; l++) {
lana = lana_list.lana[l];
! if (lana != 255) {
! smb_StopListener(ncbp, lana);
/* mark the adapter invalid */
! lana_list.lana[l] = 255; /* invalid lana */
}
}
/* force a re-evaluation of the network adapters */
lana_list.length = 0;
! smb_LANadapter = -1;
FreeNCB(ncbp);
! Sleep(1000); /* give the listener threads a chance to exit */
}
void smb_Init(osi_log_t *logp, int useV3,
--- 9196,9215 ----
for (l = 0; l < lana_list.length; l++) {
lana = lana_list.lana[l];
! if (lana != LANA_INVALID) {
! smb_StopListener(ncbp, lana, TRUE);
/* mark the adapter invalid */
! lana_list.lana[l] = LANA_INVALID; /* invalid lana */
}
}
/* force a re-evaluation of the network adapters */
lana_list.length = 0;
! smb_LANadapter = LANA_INVALID;
FreeNCB(ncbp);
! if (!locked)
! lock_ReleaseMutex(&smb_StartedLock);
}
void smb_Init(osi_log_t *logp, int useV3,
***************
*** 9099,9104 ****
--- 9230,9236 ----
#endif /* DJGPP */
EVENT_HANDLE retHandle;
char eventName[MAX_PATH];
+ int startListeners = 0;
smb_TlsRequestSlot = TlsAlloc();
***************
*** 9138,9143 ****
--- 9270,9276 ----
lock_InitializeMutex(&smb_RawBufLock, "smb raw buffer lock");
lock_InitializeMutex(&smb_ListenerLock, "smb listener lock");
+ lock_InitializeMutex(&smb_StartedLock, "smb started lock");
/* 4 Raw I/O buffers */
#ifndef DJGPP
***************
*** 9186,9192 ****
smb_ncbFreeListp = NULL;
smb_packetFreeListp = NULL;
! smb_NetbiosInit();
/* Initialize listener and server structures */
numVCs = 0;
--- 9319,9326 ----
smb_ncbFreeListp = NULL;
smb_packetFreeListp = NULL;
! lock_ObtainMutex(&smb_StartedLock);
! startListeners = smb_NetbiosInit(1);
/* Initialize listener and server structures */
numVCs = 0;
***************
*** 9453,9460 ****
}
/* Start listeners, waiters, servers, and daemons */
!
! smb_StartListeners();
#ifndef DJGPP
phandle = thrd_Create(NULL, 65536, (ThreadFunc) smb_ClientWaiter,
--- 9587,9594 ----
}
/* Start listeners, waiters, servers, and daemons */
! if (startListeners)
! smb_StartListeners(1);
#ifndef DJGPP
phandle = thrd_Create(NULL, 65536, (ThreadFunc) smb_ClientWaiter,
***************
*** 9489,9494 ****
--- 9623,9629 ----
smb_ListShares();
#endif
+ lock_ReleaseMutex(&smb_StartedLock);
return;
}
***************
*** 9558,9564 ****
/* Delete Netbios name */
memset((char *)ncbp, 0, sizeof(NCB));
for (i = 0; i < lana_list.length; i++) {
! if (lana_list.lana[i] == 255) continue;
ncbp->ncb_command = NCBDELNAME;
ncbp->ncb_lana_num = lana_list.lana[i];
memcpy(ncbp->ncb_name,smb_sharename,NCBNAMSZ);
--- 9693,9699 ----
/* Delete Netbios name */
memset((char *)ncbp, 0, sizeof(NCB));
for (i = 0; i < lana_list.length; i++) {
! if (lana_list.lana[i] == LANA_INVALID) continue;
ncbp->ncb_command = NCBDELNAME;
ncbp->ncb_lana_num = lana_list.lana[i];
memcpy(ncbp->ncb_name,smb_sharename,NCBNAMSZ);
***************
*** 9781,9785 ****
long smb_IsNetworkStarted(void)
{
! return (smb_ListenerState == SMB_LISTENER_STARTED && smbShutdownFlag == 0);
}
--- 9916,9924 ----
long smb_IsNetworkStarted(void)
{
! long rc;
! lock_ObtainWrite(&smb_globalLock);
! rc = (smb_ListenerState == SMB_LISTENER_STARTED && smbShutdownFlag == 0);
! lock_ReleaseWrite(&smb_globalLock);
! return rc;
}
Index: openafs/src/WINNT/afsd/smb.h
diff -c openafs/src/WINNT/afsd/smb.h:1.41.2.21 openafs/src/WINNT/afsd/smb.h:1.41.2.23
*** openafs/src/WINNT/afsd/smb.h:1.41.2.21 Sat Jan 5 12:56:30 2008
--- openafs/src/WINNT/afsd/smb.h Thu Jan 10 18:00:41 2008
***************
*** 755,765 ****
extern void smb_UpdateServerPriority(void);
extern void smb_SetRequestStartTime(void);
extern void smb_ResetServerPriority(void);
! extern void smb_RestartListeners(void);
! extern void smb_StopListeners(void);
! extern void smb_StopListener(NCB *ncbp, int lana);
extern long smb_IsNetworkStarted(void);
! extern void smb_LanAdapterChange(void);
#define SMB_LISTENER_UNINITIALIZED -1
#define SMB_LISTENER_STOPPED 0
--- 755,767 ----
extern void smb_UpdateServerPriority(void);
extern void smb_SetRequestStartTime(void);
extern void smb_ResetServerPriority(void);
! extern void smb_RestartListeners(int);
! extern void smb_StopListeners(int);
! extern void smb_StopListener(NCB *ncbp, int lana, int wait);
extern long smb_IsNetworkStarted(void);
! extern void smb_LanAdapterChange(int);
! extern void smb_SetLanAdapterChangeDetected(void);
!
#define SMB_LISTENER_UNINITIALIZED -1
#define SMB_LISTENER_STOPPED 0
Index: openafs/src/WINNT/afsd/smb3.c
diff -c openafs/src/WINNT/afsd/smb3.c:1.95.2.49 openafs/src/WINNT/afsd/smb3.c:1.95.2.51
*** openafs/src/WINNT/afsd/smb3.c:1.95.2.49 Sat Dec 22 23:52:58 2007
--- openafs/src/WINNT/afsd/smb3.c Mon Jan 28 02:23:35 2008
***************
*** 170,176 ****
for (i=0;i32 && k<127)?k:'.';
}
if(i) {
! osi_Log0(smb_logp, osi_LogSaveString(smb_logp, buf));
strcat(buf,"\r\n");
OutputDebugString(buf);
}
--- 191,197 ----
buf[j] = (k>32 && k<127)?k:'.';
}
if(i) {
! osi_Log1(smb_logp, "%s", osi_LogSaveString(smb_logp, buf));
strcat(buf,"\r\n");
OutputDebugString(buf);
}
***************
*** 3640,3648 ****
/*
* We have a requested path. Check to see if it is something
* we know about.
*/
code = cm_NameI(cm_data.rootSCachep, &requestFileName[nbnLen+2],
! CM_FLAG_FOLLOW | CM_FLAG_CASEFOLD,
userp, NULL, &req, &scp);
if (code == 0) {
/* Yes it is. */
--- 3640,3652 ----
/*
* We have a requested path. Check to see if it is something
* we know about.
+ *
+ * But be careful because the name that we might be searching
+ * for might be a known name with the final character stripped
+ * off. If we
*/
code = cm_NameI(cm_data.rootSCachep, &requestFileName[nbnLen+2],
! CM_FLAG_FOLLOW | CM_FLAG_CASEFOLD | CM_FLAG_DFS_REFERRAL,
userp, NULL, &req, &scp);
if (code == 0) {
/* Yes it is. */
Index: openafs/src/WINNT/afsd/smb_iocons.h
diff -c openafs/src/WINNT/afsd/smb_iocons.h:1.10.4.5 openafs/src/WINNT/afsd/smb_iocons.h:1.10.4.6
*** openafs/src/WINNT/afsd/smb_iocons.h:1.10.4.5 Fri Jan 4 02:58:40 2008
--- openafs/src/WINNT/afsd/smb_iocons.h Tue Jan 15 22:19:52 2008
***************
*** 93,98 ****
--- 93,99 ----
#define VIOC_RXSTAT_PEER 0x2f
#define VIOC_UUIDCTL 0x30
#define VIOC_PATH_AVAILABILITY 0x31
+ #define VIOC_GETFILETYPE 0x32
#define VIOC_VOLSTAT_TEST 0x3F
/* Not to exceed SMB_IOCTL_MAXPROCS from smb_ioctl.h */
Index: openafs/src/WINNT/afsd/smb_ioctl.c
diff -c openafs/src/WINNT/afsd/smb_ioctl.c:1.25.2.7 openafs/src/WINNT/afsd/smb_ioctl.c:1.25.2.8
*** openafs/src/WINNT/afsd/smb_ioctl.c:1.25.2.7 Fri Jan 4 02:58:40 2008
--- openafs/src/WINNT/afsd/smb_ioctl.c Tue Jan 15 22:19:52 2008
***************
*** 85,90 ****
--- 85,91 ----
smb_ioctlProcsp[VIOC_RXSTAT_PEER] = cm_IoctlRxStatPeer;
smb_ioctlProcsp[VIOC_UUIDCTL] = cm_IoctlUUIDControl;
smb_ioctlProcsp[VIOC_PATH_AVAILABILITY] = cm_IoctlPathAvailability;
+ smb_ioctlProcsp[VIOC_GETFILETYPE] = cm_IoctlGetFileType;
smb_ioctlProcsp[VIOC_VOLSTAT_TEST] = cm_IoctlVolStatTest;
}
Index: openafs/src/WINNT/afsd/symlink.c
diff -c openafs/src/WINNT/afsd/symlink.c:1.8.4.4 openafs/src/WINNT/afsd/symlink.c:1.8.4.5
*** openafs/src/WINNT/afsd/symlink.c:1.8.4.4 Wed Oct 31 00:09:17 2007
--- openafs/src/WINNT/afsd/symlink.c Fri Feb 8 21:32:20 2008
***************
*** 101,107 ****
DWORD enabled = 0;
code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSREG_CLT_SVC_PARAM_SUBKEY,
! 0, KEY_QUERY_VALUE, &parmKey);
if (code == ERROR_SUCCESS) {
dummyLen = sizeof(buffer);
code = RegQueryValueEx(parmKey, "NetbiosName", NULL, NULL,
--- 101,107 ----
DWORD enabled = 0;
code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSREG_CLT_SVC_PARAM_SUBKEY,
! 0, (IsWow64()?KEY_WOW64_64KEY:0)|KEY_QUERY_VALUE, &parmKey);
if (code == ERROR_SUCCESS) {
dummyLen = sizeof(buffer);
code = RegQueryValueEx(parmKey, "NetbiosName", NULL, NULL,
Index: openafs/src/WINNT/afsreg/afsreg.c
diff -c openafs/src/WINNT/afsreg/afsreg.c:1.2 openafs/src/WINNT/afsreg/afsreg.c:1.2.32.1
*** openafs/src/WINNT/afsreg/afsreg.c:1.2 Sat Nov 4 05:01:47 2000
--- openafs/src/WINNT/afsreg/afsreg.c Fri Feb 8 21:32:22 2008
***************
*** 29,34 ****
--- 29,63 ----
static long CopySubkeys(const char *srcName, HKEY srcKey,
const char *dupName, HKEY dupKey);
+ typedef BOOL (WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL);
+ int IsWow64(void)
+ {
+ static int init = TRUE;
+ static int bIsWow64 = FALSE;
+
+ if (init) {
+ HMODULE hModule;
+ LPFN_ISWOW64PROCESS fnIsWow64Process = NULL;
+
+ hModule = GetModuleHandle(TEXT("kernel32"));
+ if (hModule) {
+ fnIsWow64Process = (LPFN_ISWOW64PROCESS)GetProcAddress(hModule, "IsWow64Process");
+
+ if (NULL != fnIsWow64Process)
+ {
+ if (!fnIsWow64Process(GetCurrentProcess(),&bIsWow64))
+ {
+ // on error, assume FALSE.
+ // in other words, do nothing.
+ }
+ }
+ FreeLibrary(hModule);
+ }
+ init = FALSE;
+ }
+ return bIsWow64;
+ }
+
/* ----------------------- exported functions ----------------------- */
***************
*** 86,94 ****
if (create) {
status = RegCreateKeyEx(key, subKeyName,
(DWORD)0, "AFS", REG_OPTION_NON_VOLATILE,
! mode, NULL, resultKeyP, &keyDisp);
} else {
! status = RegOpenKeyEx(key, subKeyName, (DWORD)0, mode, resultKeyP);
}
if (resultKeyDispP) {
--- 115,123 ----
if (create) {
status = RegCreateKeyEx(key, subKeyName,
(DWORD)0, "AFS", REG_OPTION_NON_VOLATILE,
! (IsWow64()?KEY_WOW64_64KEY:0)|mode, NULL, resultKeyP, &keyDisp);
} else {
! status = RegOpenKeyEx(key, subKeyName, (DWORD)0, (IsWow64()?KEY_WOW64_64KEY:0)|mode, resultKeyP);
}
if (resultKeyDispP) {
***************
*** 240,246 ****
/* determine if delete failed due to subkeys */
HKEY subKey;
! status = RegOpenKeyEx(key, subKeyName, 0, KEY_ALL_ACCESS, &subKey);
if (status == ERROR_SUCCESS) {
char *keyEnum;
--- 269,275 ----
/* determine if delete failed due to subkeys */
HKEY subKey;
! status = RegOpenKeyEx(key, subKeyName, 0, (IsWow64()?KEY_WOW64_64KEY:0)|KEY_ALL_ACCESS, &subKey);
if (status == ERROR_SUCCESS) {
char *keyEnum;
Index: openafs/src/WINNT/afsreg/afsreg.h
diff -c openafs/src/WINNT/afsreg/afsreg.h:1.6.4.1 openafs/src/WINNT/afsreg/afsreg.h:1.6.4.2
*** openafs/src/WINNT/afsreg/afsreg.h:1.6.4.1 Sun Jun 25 22:25:49 2006
--- openafs/src/WINNT/afsreg/afsreg.h Fri Feb 8 21:32:22 2008
***************
*** 234,239 ****
--- 234,242 ----
RegDupKeyAlt(const char *sourceKey,
const char *targetKey);
+ extern int
+ IsWow64(void);
+
#ifdef __cplusplus
};
#endif
Index: openafs/src/WINNT/afsreg/afssw.c
diff -c openafs/src/WINNT/afsreg/afssw.c:1.4.4.1 openafs/src/WINNT/afsreg/afssw.c:1.4.4.3
*** openafs/src/WINNT/afsreg/afssw.c:1.4.4.1 Sun Jun 25 22:25:49 2006
--- openafs/src/WINNT/afsreg/afssw.c Sat Feb 2 08:43:23 2008
***************
*** 11,16 ****
--- 11,17 ----
#include
#include
+ #include
#include
#include
#include
***************
*** 77,85 ****
int
afssw_GetClientCellServDBDir(char **bufPP) /* [out] data buffer */
{
! return StringDataRead(AFSREG_CLT_OPENAFS_KEY,
AFSREG_CLT_OPENAFS_CELLSERVDB_DIR_VALUE,
! bufPP);
}
--- 78,146 ----
int
afssw_GetClientCellServDBDir(char **bufPP) /* [out] data buffer */
{
! char wdir[512];
! int tlen;
! char *path = NULL;
! DWORD cbPath;
!
! cbPath = GetEnvironmentVariable("AFSCONF", NULL, 0);
! if (cbPath) {
! cbPath += 2;
! path = malloc(cbPath);
! }
! if (path) {
! GetEnvironmentVariable("AFSCONF", path, cbPath);
! tlen = (int)strlen(path);
! if (path[tlen-1] != '\\') {
! strncat(path, "\\", cbPath);
! path[cbPath-1] = '\0';
! }
! *bufPP = path;
! return 0;
! }
!
! if (!StringDataRead(AFSREG_CLT_OPENAFS_KEY,
AFSREG_CLT_OPENAFS_CELLSERVDB_DIR_VALUE,
! &path)) {
! tlen = (int)strlen(path);
! if (path[tlen-1] != '\\') {
! strncat(path, "\\", cbPath);
! path[cbPath-1] = '\0';
! }
! *bufPP = path;
! return 0;
! }
!
! /*
! * Try to find the All Users\Application Data\OpenAFS\Client directory.
! * If it exists and it contains a CellServDB file, return that.
! * Otherwise, return the Install Directory for backward compatibility.
! */
! if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_COMMON_APPDATA, NULL,
! SHGFP_TYPE_CURRENT, wdir)))
! { HANDLE fh;
!
! tlen = (int)strlen(wdir);
! if (wdir[tlen-1] != '\\') {
! strncat(wdir, "\\", sizeof(wdir));
! wdir[sizeof(wdir)-1] = '\0';
! tlen++;
! }
! strncat(wdir, "OpenAFS\\Client\\CellServDB", sizeof(wdir));
! wdir[sizeof(wdir)-1] = '\0';
!
! fh = CreateFile(wdir, GENERIC_READ, FILE_SHARE_READ, NULL,
! OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
! if (fh != INVALID_HANDLE_VALUE) {
! CloseHandle(fh);
! tlen += (int)strlen("OpenAFS\\Client\\");
! wdir[tlen] = '\0';
! *bufPP = strdup(wdir);
! return 0;
! }
! }
!
! return afssw_GetClientInstallDir(bufPP);
}
Index: openafs/src/WINNT/afsreg/afssw.h
diff -c openafs/src/WINNT/afsreg/afssw.h:1.3 openafs/src/WINNT/afsreg/afssw.h:1.3.14.1
*** openafs/src/WINNT/afsreg/afssw.h:1.3 Wed Jul 21 10:06:13 2004
--- openafs/src/WINNT/afsreg/afssw.h Fri Feb 1 21:48:13 2008
***************
*** 23,31 ****
afssw_GetClientCellServDBDir(char **bufPP);
extern int
- afssw_GetClientCellDir(char **bufPP);
-
- extern int
afssw_GetClientCellName(char **bufPP);
extern int
--- 23,28 ----
Index: openafs/src/WINNT/bosctlsvc/NTMakefile
diff -c openafs/src/WINNT/bosctlsvc/NTMakefile:1.6 openafs/src/WINNT/bosctlsvc/NTMakefile:1.6.4.1
*** openafs/src/WINNT/bosctlsvc/NTMakefile:1.6 Sun Nov 20 20:56:16 2005
--- openafs/src/WINNT/bosctlsvc/NTMakefile Sat Feb 2 08:43:23 2008
***************
*** 27,33 ****
EXESDKLIBS=\
ole32.lib \
! oleaut32.lib
$(EXEFILE): $(EXEOBJS) $(EXELIBS)
$(EXECONLINK) $(EXESDKLIBS)
--- 27,34 ----
EXESDKLIBS=\
ole32.lib \
! oleaut32.lib \
! shell32.lib
$(EXEFILE): $(EXEOBJS) $(EXELIBS)
$(EXECONLINK) $(EXESDKLIBS)
Index: openafs/src/WINNT/client_config/cellservdb.c
diff -c openafs/src/WINNT/client_config/cellservdb.c:1.5 openafs/src/WINNT/client_config/cellservdb.c:1.5.6.1
*** openafs/src/WINNT/client_config/cellservdb.c:1.5 Fri Mar 11 00:34:33 2005
--- openafs/src/WINNT/client_config/cellservdb.c Fri Feb 1 19:24:49 2008
***************
*** 15,28 ****
#include
#include
#include "cellservdb.h"
- #ifdef AFS_NT40_ENV
#include
#include
- #else
- #include
- #endif
- #include
/*
* PROTOTYPES _________________________________________________________________
--- 15,24 ----
#include
#include
#include "cellservdb.h"
+ #include
#include
#include
/*
* PROTOTYPES _________________________________________________________________
***************
*** 66,103 ****
void CSDB_GetFileName (char *pszFilename)
{
! #ifdef AFS_NT40_ENV
! /* Find the appropriate CellServDB */
! char * clientdir = 0;
! DWORD code, dummyLen;
! HKEY parmKey;
! int tlen;
!
! code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSREG_CLT_OPENAFS_SUBKEY,
! 0, KEY_QUERY_VALUE, &parmKey);
! if (code != ERROR_SUCCESS)
! goto dirpath;
!
! dummyLen = MAX_CSDB_PATH;
! code = RegQueryValueEx(parmKey, "CellServDBDir", NULL, NULL,
! pszFilename, &dummyLen);
! RegCloseKey (parmKey);
!
! dirpath:
! if (code != ERROR_SUCCESS || pszFilename[0] == 0) {
! afssw_GetClientInstallDir(&clientdir);
! if (clientdir) {
! strncpy(pszFilename, clientdir, MAX_CSDB_PATH);
! pszFilename[MAX_CSDB_PATH - 1] = '\0';
! }
! }
! if (pszFilename[ strlen(pszFilename)-1 ] != '\\')
! strcat (pszFilename, "\\");
!
! strcat (pszFilename, "CellServDB");
! #else
! strcpy (pszFilename, "/usr/vice/etc/CellServDB");
! #endif
}
--- 62,68 ----
void CSDB_GetFileName (char *pszFilename)
{
! cm_GetCellServDB(pszFilename, MAX_CSDB_PATH);
}
***************
*** 191,201 ****
{
for (pLine = pCellServDB->pFirst; pLine; pLine = pLine->pNext)
{
- #ifdef AFS_NT40_ENV
sprintf (szLine, "%s\r\n", pLine->szLine);
- #else
- sprintf (szLine, "%s\n", pLine->szLine);
- #endif
fwrite (szLine, 1, strlen(szLine), pFile);
}
--- 156,162 ----
Index: openafs/src/WINNT/client_creds/NTMakefile
diff -c openafs/src/WINNT/client_creds/NTMakefile:1.16.4.3 openafs/src/WINNT/client_creds/NTMakefile:1.16.4.4
*** openafs/src/WINNT/client_creds/NTMakefile:1.16.4.3 Tue Dec 12 19:26:36 2006
--- openafs/src/WINNT/client_creds/NTMakefile Fri Feb 8 21:32:23 2008
***************
*** 66,71 ****
--- 66,72 ----
$(DESTDIR)\lib\afsdes.lib \
$(DESTDIR)\lib\afsauthent.lib \
$(DESTDIR)\lib\libafsconf.lib \
+ $(DESTDIR)\lib\afs\afsreg.lib \
$(DESTDIR)\lib\afskfw.lib
############################################################################
Index: openafs/src/WINNT/client_creds/advtab.cpp
diff -c openafs/src/WINNT/client_creds/advtab.cpp:1.9 openafs/src/WINNT/client_creds/advtab.cpp:1.9.4.1
*** openafs/src/WINNT/client_creds/advtab.cpp:1.9 Sat Nov 5 01:47:53 2005
--- openafs/src/WINNT/client_creds/advtab.cpp Fri Feb 8 21:32:23 2008
***************
*** 295,301 ****
g.fStartup = IsDlgButtonChecked (hDlg, IDC_STARTUP);
HKEY hk;
! if (RegCreateKey (HKEY_LOCAL_MACHINE, TEXT(AFSREG_CLT_SVC_PARAM_SUBKEY), &hk) == 0)
{
DWORD dwSize = sizeof(g.fStartup);
DWORD dwType = REG_DWORD;
--- 295,302 ----
g.fStartup = IsDlgButtonChecked (hDlg, IDC_STARTUP);
HKEY hk;
! if (RegCreateKeyEx (HKEY_LOCAL_MACHINE, TEXT(AFSREG_CLT_SVC_PARAM_SUBKEY), 0, NULL, 0,
! (IsWow64()?KEY_WOW64_64KEY:0)|KEY_WRITE, NULL, &hk, NULL) == 0)
{
DWORD dwSize = sizeof(g.fStartup);
DWORD dwType = REG_DWORD;
Index: openafs/src/WINNT/client_creds/creds.cpp
diff -c openafs/src/WINNT/client_creds/creds.cpp:1.14 openafs/src/WINNT/client_creds/creds.cpp:1.14.4.1
*** openafs/src/WINNT/client_creds/creds.cpp:1.14 Wed Jul 6 20:23:29 2005
--- openafs/src/WINNT/client_creds/creds.cpp Fri Feb 8 21:32:23 2008
***************
*** 155,161 ****
{
*pszGateway = TEXT('\0');
HKEY hk;
! if (RegOpenKey (HKEY_LOCAL_MACHINE, TEXT(AFSREG_CLT_SVC_PARAM_SUBKEY), &hk) == 0)
{
DWORD dwSize = MAX_PATH;
DWORD dwType = REG_SZ;
--- 155,162 ----
{
*pszGateway = TEXT('\0');
HKEY hk;
! if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, TEXT(AFSREG_CLT_SVC_PARAM_SUBKEY), 0,
! (IsWow64()?KEY_WOW64_64KEY:0)|KEY_QUERY_VALUE, &hk) == 0)
{
DWORD dwSize = MAX_PATH;
DWORD dwType = REG_SZ;
***************
*** 237,243 ****
{
rc = TRUE;
}
! else if (RegOpenKey (HKEY_LOCAL_MACHINE, TEXT(AFSREG_CLT_SVC_PARAM_SUBKEY), &hk) == 0)
{
TCHAR szCell[ MAX_PATH ];
DWORD dwSize = sizeof(szCell);
--- 238,245 ----
{
rc = TRUE;
}
! else if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, TEXT(AFSREG_CLT_SVC_PARAM_SUBKEY), 0,
! (IsWow64()?KEY_WOW64_64KEY:0)|KEY_QUERY_VALUE, &hk) == 0)
{
TCHAR szCell[ MAX_PATH ];
DWORD dwSize = sizeof(szCell);
***************
*** 451,457 ****
int rc;
HKEY hk;
! if (RegOpenKey (HKEY_CURRENT_USER, TEXT(AFSREG_USER_OPENAFS_SUBKEY), &hk) == 0)
{
DWORD dwSize = sizeof(szCellA);
DWORD dwType = REG_SZ;
--- 453,460 ----
int rc;
HKEY hk;
! if (RegOpenKeyEx (HKEY_CURRENT_USER, TEXT(AFSREG_USER_OPENAFS_SUBKEY), 0,
! (IsWow64()?KEY_WOW64_64KEY:0)|KEY_QUERY_VALUE, &hk) == 0)
{
DWORD dwSize = sizeof(szCellA);
DWORD dwType = REG_SZ;
Index: openafs/src/WINNT/client_creds/main.cpp
diff -c openafs/src/WINNT/client_creds/main.cpp:1.16 openafs/src/WINNT/client_creds/main.cpp:1.16.4.1
*** openafs/src/WINNT/client_creds/main.cpp:1.16 Mon Nov 21 19:36:35 2005
--- openafs/src/WINNT/client_creds/main.cpp Fri Feb 8 21:32:23 2008
***************
*** 178,184 ****
if (fInstall)
{
HKEY hk;
! if (RegCreateKey (HKEY_CURRENT_USER, AFSREG_USER_OPENAFS_SUBKEY, &hk) == 0)
{
DWORD dwSize = sizeof(g.fStartup);
DWORD dwType = REG_DWORD;
--- 178,185 ----
if (fInstall)
{
HKEY hk;
! if (RegCreateKeyEx (HKEY_CURRENT_USER, AFSREG_USER_OPENAFS_SUBKEY, 0, NULL, 0,
! (IsWow64()?KEY_WOW64_64KEY:0)|KEY_WRITE, NULL, &hk, NULL) == 0)
{
DWORD dwSize = sizeof(g.fStartup);
DWORD dwType = REG_DWORD;
***************
*** 213,226 ****
return FALSE;
HKEY hk;
! if (RegOpenKey (HKEY_CURRENT_USER, AFSREG_USER_OPENAFS_SUBKEY, &hk) == 0)
{
DWORD dwSize = sizeof(g.fStartup);
DWORD dwType = REG_DWORD;
RegQueryValueEx (hk, TEXT("ShowTrayIcon"), NULL, &dwType, (PBYTE)&g.fStartup, &dwSize);
RegCloseKey (hk);
}
! else if (RegOpenKey (HKEY_LOCAL_MACHINE, AFSREG_CLT_OPENAFS_SUBKEY, &hk) == 0)
{
DWORD dwSize = sizeof(g.fStartup);
DWORD dwType = REG_DWORD;
--- 214,229 ----
return FALSE;
HKEY hk;
! if (RegOpenKeyEx (HKEY_CURRENT_USER, AFSREG_USER_OPENAFS_SUBKEY, 0,
! (IsWow64()?KEY_WOW64_64KEY:0)|KEY_QUERY_VALUE, &hk) == 0)
{
DWORD dwSize = sizeof(g.fStartup);
DWORD dwType = REG_DWORD;
RegQueryValueEx (hk, TEXT("ShowTrayIcon"), NULL, &dwType, (PBYTE)&g.fStartup, &dwSize);
RegCloseKey (hk);
}
! else if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, AFSREG_CLT_OPENAFS_SUBKEY, 0,
! (IsWow64()?KEY_WOW64_64KEY:0)|KEY_QUERY_VALUE, &hk) == 0)
{
DWORD dwSize = sizeof(g.fStartup);
DWORD dwType = REG_DWORD;
***************
*** 399,405 ****
BOOL fInstalled = FALSE;
HKEY hk;
! if (RegOpenKey (HKEY_LOCAL_MACHINE, AFSREG_SVR_SVC_SUBKEY, &hk) == 0)
{
fInstalled = TRUE;
RegCloseKey (hk);
--- 402,409 ----
BOOL fInstalled = FALSE;
HKEY hk;
! if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, AFSREG_SVR_SVC_SUBKEY, 0,
! (IsWow64()?KEY_WOW64_64KEY:0)|KEY_QUERY_VALUE, &hk) == 0)
{
fInstalled = TRUE;
RegCloseKey (hk);
Index: openafs/src/WINNT/client_creds/misc.cpp
diff -c openafs/src/WINNT/client_creds/misc.cpp:1.4 openafs/src/WINNT/client_creds/misc.cpp:1.4.6.1
*** openafs/src/WINNT/client_creds/misc.cpp:1.4 Fri Mar 11 00:35:09 2005
--- openafs/src/WINNT/client_creds/misc.cpp Fri Feb 8 21:32:23 2008
***************
*** 57,63 ****
g.aCreds[ iCreds ].fRemind = TRUE;
HKEY hk;
! if (RegOpenKey (HKEY_CURRENT_USER, AFSREG_USER_OPENAFS_SUBKEY "\\Reminders", &hk) == 0)
{
DWORD dwValue = 1;
DWORD dwSize = sizeof(dwValue);
--- 57,64 ----
g.aCreds[ iCreds ].fRemind = TRUE;
HKEY hk;
! if (RegOpenKeyEx (HKEY_CURRENT_USER, AFSREG_USER_OPENAFS_SUBKEY "\\Reminders", 0,
! (IsWow64()?KEY_WOW64_64KEY:0)|KEY_QUERY_VALUE, &hk) == 0)
{
DWORD dwValue = 1;
DWORD dwSize = sizeof(dwValue);
***************
*** 72,78 ****
void SaveRemind (size_t iCreds)
{
HKEY hk;
! if (RegCreateKey (HKEY_CURRENT_USER, AFSREG_USER_OPENAFS_SUBKEY "\\Reminders", &hk) == 0)
{
DWORD dwValue = g.aCreds[ iCreds ].fRemind;
RegSetValueEx (hk, g.aCreds[ iCreds ].szCell, NULL, REG_DWORD, (PBYTE)&dwValue, sizeof(DWORD));
--- 73,80 ----
void SaveRemind (size_t iCreds)
{
HKEY hk;
! if (RegCreateKeyEx (HKEY_CURRENT_USER, AFSREG_USER_OPENAFS_SUBKEY "\\Reminders", 0, NULL, 0,
! (IsWow64()?KEY_WOW64_64KEY:0)|KEY_WRITE, NULL, &hk, NULL) == 0)
{
DWORD dwValue = g.aCreds[ iCreds ].fRemind;
RegSetValueEx (hk, g.aCreds[ iCreds ].szCell, NULL, REG_DWORD, (PBYTE)&dwValue, sizeof(DWORD));
***************
*** 128,131 ****
return NULL;
}
-
--- 130,132 ----
Index: openafs/src/WINNT/client_creds/settings.cpp
diff -c openafs/src/WINNT/client_creds/settings.cpp:1.2 openafs/src/WINNT/client_creds/settings.cpp:1.2.32.1
*** openafs/src/WINNT/client_creds/settings.cpp:1.2 Sat Nov 4 05:02:47 2000
--- openafs/src/WINNT/client_creds/settings.cpp Fri Feb 8 21:32:23 2008
***************
*** 15,20 ****
--- 15,21 ----
#include
#include
#include
+ #include "afscreds.h"
#include "settings.h"
***************
*** 88,94 ****
void EraseSettings (HKEY hkParent, LPCTSTR pszBase, LPCTSTR pszValue)
{
HKEY hk;
! if (RegOpenKey (hkParent, pszBase, &hk) == 0)
{
RegDeleteValue (hk, pszValue);
RegCloseKey (hk);
--- 89,96 ----
void EraseSettings (HKEY hkParent, LPCTSTR pszBase, LPCTSTR pszValue)
{
HKEY hk;
! if (RegOpenKeyEx (hkParent, pszBase, 0,
! (IsWow64()?KEY_WOW64_64KEY:0)|KEY_SET_VALUE, &hk) == 0)
{
RegDeleteValue (hk, pszValue);
RegCloseKey (hk);
***************
*** 105,111 ****
BOOL rc = FALSE;
HKEY hkFinal;
! if (RegOpenKey (hk, pszBase, &hkFinal) == ERROR_SUCCESS)
{
DWORD dwType;
DWORD dwSize = (DWORD)cbData;
--- 107,114 ----
BOOL rc = FALSE;
HKEY hkFinal;
! if (RegOpenKeyEx (hk, pszBase, 0,
! (IsWow64()?KEY_WOW64_64KEY:0)|KEY_QUERY_VALUE, &hkFinal) == ERROR_SUCCESS)
{
DWORD dwType;
DWORD dwSize = (DWORD)cbData;
***************
*** 127,133 ****
size_t cb = 0;
HKEY hkFinal;
! if (RegOpenKey (hk, pszBase, &hkFinal) == ERROR_SUCCESS)
{
DWORD dwType;
DWORD dwSize = 0;
--- 130,137 ----
size_t cb = 0;
HKEY hkFinal;
! if (RegOpenKeyEx (hk, pszBase, 0,
! (IsWow64()?KEY_WOW64_64KEY:0)|KEY_QUERY_VALUE, &hkFinal) == ERROR_SUCCESS)
{
DWORD dwType;
DWORD dwSize = 0;
***************
*** 153,159 ****
BOOL rc = FALSE;
HKEY hkFinal;
! if (RegCreateKey (hk, pszBase, &hkFinal) == ERROR_SUCCESS)
{
DWORD dwSize = (DWORD)cbData;
--- 157,164 ----
BOOL rc = FALSE;
HKEY hkFinal;
! if (RegCreateKeyEx (hk, pszBase, 0, NULL, 0,
! (IsWow64()?KEY_WOW64_64KEY:0)|KEY_WRITE, NULL, &hkFinal, NULL) == ERROR_SUCCESS)
{
DWORD dwSize = (DWORD)cbData;
***************
*** 173,179 ****
BOOL RegDeltreeKey (HKEY hk, LPTSTR pszKey)
{
HKEY hkSub;
! if (RegOpenKey (hk, pszKey, &hkSub) == 0)
{
TCHAR szFound[ MAX_PATH ];
while (RegEnumKey (hkSub, 0, szFound, MAX_PATH) == 0)
--- 178,185 ----
BOOL RegDeltreeKey (HKEY hk, LPTSTR pszKey)
{
HKEY hkSub;
! if (RegOpenKeyEx (hk, pszKey, 0,
! (IsWow64()?KEY_WOW64_64KEY:0)|KEY_WRITE, &hkSub) == 0)
{
TCHAR szFound[ MAX_PATH ];
while (RegEnumKey (hkSub, 0, szFound, MAX_PATH) == 0)
Index: openafs/src/WINNT/client_creds/shortcut.cpp
diff -c openafs/src/WINNT/client_creds/shortcut.cpp:1.10 openafs/src/WINNT/client_creds/shortcut.cpp:1.10.4.1
*** openafs/src/WINNT/client_creds/shortcut.cpp:1.10 Wed Jul 6 20:23:29 2005
--- openafs/src/WINNT/client_creds/shortcut.cpp Fri Feb 8 21:32:23 2008
***************
*** 114,120 ****
TCHAR szParams[ 64 ] = TEXT(AFSCREDS_SHORTCUT_OPTIONS);
code = RegOpenKeyEx(HKEY_CURRENT_USER, AFSREG_USER_OPENAFS_SUBKEY,
! 0, KEY_QUERY_VALUE, &hk);
if (code == ERROR_SUCCESS) {
len = sizeof(szParams);
type = REG_SZ;
--- 114,120 ----
TCHAR szParams[ 64 ] = TEXT(AFSCREDS_SHORTCUT_OPTIONS);
code = RegOpenKeyEx(HKEY_CURRENT_USER, AFSREG_USER_OPENAFS_SUBKEY,
! 0, (IsWow64()?KEY_WOW64_64KEY:0)|KEY_QUERY_VALUE, &hk);
if (code == ERROR_SUCCESS) {
len = sizeof(szParams);
type = REG_SZ;
***************
*** 124,130 ****
}
if (code != ERROR_SUCCESS) {
code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSREG_CLT_OPENAFS_SUBKEY,
! 0, KEY_QUERY_VALUE, &hk);
if (code == ERROR_SUCCESS) {
len = sizeof(szParams);
type = REG_SZ;
--- 124,130 ----
}
if (code != ERROR_SUCCESS) {
code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSREG_CLT_OPENAFS_SUBKEY,
! 0, (IsWow64()?KEY_WOW64_64KEY:0)|KEY_QUERY_VALUE, &hk);
if (code == ERROR_SUCCESS) {
len = sizeof(szParams);
type = REG_SZ;
Index: openafs/src/WINNT/client_creds/window.cpp
diff -c openafs/src/WINNT/client_creds/window.cpp:1.16.4.1 openafs/src/WINNT/client_creds/window.cpp:1.16.4.2
*** openafs/src/WINNT/client_creds/window.cpp:1.16.4.1 Tue Oct 10 11:54:33 2006
--- openafs/src/WINNT/client_creds/window.cpp Fri Feb 8 21:32:23 2008
***************
*** 260,266 ****
GetString (szUser, IDS_UNKNOWN);
HKEY hk;
! if (RegOpenKey (HKEY_LOCAL_MACHINE, AFSREG_CLT_SW_VERSION_SUBKEY, &hk) == 0)
{
DWORD dwSize = sizeof(szVersion);
DWORD dwType = REG_SZ;
--- 260,267 ----
GetString (szUser, IDS_UNKNOWN);
HKEY hk;
! if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, AFSREG_CLT_SW_VERSION_SUBKEY, 0,
! (IsWow64()?KEY_WOW64_64KEY:0)|KEY_QUERY_VALUE, &hk) == 0)
{
DWORD dwSize = sizeof(szVersion);
DWORD dwType = REG_SZ;
***************
*** 460,473 ****
{
HKEY hk;
! if (RegOpenKey (HKEY_CURRENT_USER, AFSREG_USER_OPENAFS_SUBKEY, &hk) == 0)
{
DWORD dwSize = sizeof(g.fStartup);
DWORD dwType = REG_DWORD;
RegQueryValueEx (hk, TEXT("ShowTrayIcon"), NULL, &dwType, (PBYTE)&g.fStartup, &dwSize);
RegCloseKey (hk);
}
! else if (RegOpenKey (HKEY_LOCAL_MACHINE, AFSREG_CLT_OPENAFS_SUBKEY, &hk) == 0)
{
DWORD dwSize = sizeof(g.fStartup);
DWORD dwType = REG_DWORD;
--- 461,476 ----
{
HKEY hk;
! if (RegOpenKeyEx (HKEY_CURRENT_USER, AFSREG_USER_OPENAFS_SUBKEY, 0,
! (IsWow64()?KEY_WOW64_64KEY:0)|KEY_QUERY_VALUE, &hk) == 0)
{
DWORD dwSize = sizeof(g.fStartup);
DWORD dwType = REG_DWORD;
RegQueryValueEx (hk, TEXT("ShowTrayIcon"), NULL, &dwType, (PBYTE)&g.fStartup, &dwSize);
RegCloseKey (hk);
}
! else if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, AFSREG_CLT_OPENAFS_SUBKEY, 0,
! (IsWow64()?KEY_WOW64_64KEY:0)|KEY_QUERY_VALUE, &hk) == 0)
{
DWORD dwSize = sizeof(g.fStartup);
DWORD dwType = REG_DWORD;
***************
*** 800,806 ****
g.fStartup = IsDlgButtonChecked (hDlg, IDC_STARTUP);
HKEY hk;
! if (RegCreateKey (HKEY_CURRENT_USER, AFSREG_USER_OPENAFS_SUBKEY, &hk) == 0)
{
DWORD dwSize = sizeof(g.fStartup);
DWORD dwType = REG_DWORD;
--- 803,810 ----
g.fStartup = IsDlgButtonChecked (hDlg, IDC_STARTUP);
HKEY hk;
! if (RegCreateKeyEx (HKEY_CURRENT_USER, AFSREG_USER_OPENAFS_SUBKEY, 0, NULL, 0,
! (IsWow64()?KEY_WOW64_64KEY:0)|KEY_WRITE, NULL, &hk, NULL) == 0)
{
DWORD dwSize = sizeof(g.fStartup);
DWORD dwType = REG_DWORD;
Index: openafs/src/WINNT/client_exp/NTMakefile
diff -c openafs/src/WINNT/client_exp/NTMakefile:1.9.4.2 openafs/src/WINNT/client_exp/NTMakefile:1.9.4.4
*** openafs/src/WINNT/client_exp/NTMakefile:1.9.4.2 Tue Oct 10 11:49:34 2006
--- openafs/src/WINNT/client_exp/NTMakefile Fri Feb 8 21:32:24 2008
***************
*** 44,49 ****
--- 44,50 ----
$(OUT)\unlog_dlg.obj \
$(OUT)\volumeinfo.obj \
$(OUT)\make_symbolic_link_dlg.obj \
+ $(OUT)\symlinks_dlg.obj \
$(OUT)\AFS_component_version_number.obj
AFSD = ..\afsd
***************
*** 59,64 ****
--- 60,66 ----
$(DESTDIR)\lib\afsauthent.lib \
$(DESTDIR)\lib\libafsconf.lib \
$(DESTDIR)\lib\libosi.lib \
+ $(DESTDIR)\lib\afs\afsreg.lib \
$(DESTDIR)\lib\afs\TaLocale.lib \
$(DESTDIR)\lib\afs\afsutil.lib
Index: openafs/src/WINNT/client_exp/afs_shl_ext.cpp
diff -c openafs/src/WINNT/client_exp/afs_shl_ext.cpp:1.6.4.3 openafs/src/WINNT/client_exp/afs_shl_ext.cpp:1.6.4.4
*** openafs/src/WINNT/client_exp/afs_shl_ext.cpp:1.6.4.3 Tue Jan 30 07:42:43 2007
--- openafs/src/WINNT/client_exp/afs_shl_ext.cpp Fri Feb 8 21:32:24 2008
***************
*** 17,24 ****
#include
#include "help.h"
#include "shell_ext.h"
! #include "winreg.h"
!
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
--- 17,26 ----
#include
#include "help.h"
#include "shell_ext.h"
! #include
! extern "C" {
! #include "WINNT\afsreg.h"
! }
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
***************
*** 300,306 ****
lResult = RegOpenKeyEx( hKey,
pszSubKey,
0,
! KEY_ALL_ACCESS,
&thKey);
if(NOERROR == lResult)
{
--- 302,308 ----
lResult = RegOpenKeyEx( hKey,
pszSubKey,
0,
! (IsWow64()?KEY_WOW64_64KEY:0)|KEY_ALL_ACCESS,
&thKey);
if(NOERROR == lResult)
{
***************
*** 344,346 ****
--- 346,349 ----
return S_OK;
}
+
Index: openafs/src/WINNT/client_exp/gui2fs.cpp
diff -c openafs/src/WINNT/client_exp/gui2fs.cpp:1.19.4.2 openafs/src/WINNT/client_exp/gui2fs.cpp:1.19.4.5
*** openafs/src/WINNT/client_exp/gui2fs.cpp:1.19.4.2 Mon Feb 12 22:09:20 2007
--- openafs/src/WINNT/client_exp/gui2fs.cpp Fri Feb 8 21:32:24 2008
***************
*** 21,26 ****
--- 21,27 ----
#include "results_dlg.h"
#include "volume_inf.h"
#include "mount_points_dlg.h"
+ #include "symlinks_dlg.h"
#include "hourglass.h"
#include "down_servers_dlg.h"
***************
*** 992,997 ****
--- 993,1007 ----
return strMountPointInfo;
}
+ CString ParseSymlink(const CString strFile, CString strSymlink)
+ {
+ CString strSymlinkInfo;
+
+ strSymlinkInfo = strFile + "\t" + strSymlink;
+
+ return strSymlinkInfo;
+ }
+
BOOL IsPathInAfs(const CHAR *strPath)
{
struct ViceIoctl blob;
***************
*** 999,1011 ****
HOURGLASS hourglass;
blob.in_size = 0;
blob.out_size = MAXSIZE;
blob.out = space;
code = pioctl((LPTSTR)((LPCTSTR)strPath), VIOC_FILE_CELL_NAME, &blob, 1);
! if (code)
return FALSE;
return TRUE;
}
--- 1009,1031 ----
HOURGLASS hourglass;
+ char buf[512];
+ sprintf(buf, "IsPathInAfs(%s)", strPath);
+ OutputDebugString(buf);
+
blob.in_size = 0;
blob.out_size = MAXSIZE;
blob.out = space;
code = pioctl((LPTSTR)((LPCTSTR)strPath), VIOC_FILE_CELL_NAME, &blob, 1);
!
! sprintf(buf, "VIOC_FILE_CELL_NAME=%d", code);
! OutputDebugString(buf);
!
! if (code) {
! if ((errno == EINVAL) || (errno == ENOENT))
return FALSE;
+ }
return TRUE;
}
***************
*** 1034,1040 ****
DWORD enabled = 0;
code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSREG_CLT_SVC_PARAM_SUBKEY,
! 0, KEY_QUERY_VALUE, &parmKey);
if (code == ERROR_SUCCESS) {
dummyLen = sizeof(buffer);
code = RegQueryValueEx(parmKey, "NetbiosName", NULL, NULL,
--- 1054,1060 ----
DWORD enabled = 0;
code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSREG_CLT_SVC_PARAM_SUBKEY,
! 0, (IsWow64()?KEY_WOW64_64KEY:0)|KEY_QUERY_VALUE, &parmKey);
if (code == ERROR_SUCCESS) {
dummyLen = sizeof(buffer);
code = RegQueryValueEx(parmKey, "NetbiosName", NULL, NULL,
***************
*** 1514,1519 ****
--- 1534,1543 ----
HOURGLASS hourglass;
+ char buf[512];
+ sprintf(buf, "IsSymlink(%s)", true_name);
+ OutputDebugString(buf);
+
last_component = (char *) strrchr(true_name, '\\');
if (!last_component)
last_component = (char *) strrchr(true_name, '/');
***************
*** 1550,1555 ****
--- 1574,1582 ----
fs_StripDriveLetter(true_name, strip_name, sizeof(strip_name));
}
+ sprintf(buf, "last_component=%s", last_component);
+ OutputDebugString(buf);
+
blob.in = last_component;
blob.in_size = strlen(last_component)+1;
blob.out_size = MAXSIZE;
***************
*** 1569,1576 ****
--- 1596,1609 ----
register char *tp;
char szCurItem[1024];
+ HOURGLASS hourglass;
+
strcpy(szCurItem, name);
+ char buf[512];
+ sprintf(buf, "IsMountPoint(%s)", name);
+ OutputDebugString(buf);
+
tp = (char *)strrchr(szCurItem, '\\');
if (tp) {
strncpy(tbuffer, szCurItem, code = tp - szCurItem + 1); /* the dir name */
***************
*** 1596,1601 ****
--- 1629,1637 ----
fs_StripDriveLetter(tp, tp, 0);
}
+ sprintf(buf, "last_component=%s", tp);
+ OutputDebugString(buf);
+
blob.in = tp;
blob.in_size = strlen(tp)+1;
blob.out = lsbuffer;
***************
*** 1959,1965 ****
return TRUE;
}
! UINT MakeSymbolicLink(const char *strName, const char *strDir)
{
struct ViceIoctl blob;
char space[MAXSIZE];
--- 1995,2001 ----
return TRUE;
}
! UINT MakeSymbolicLink(const char *strName, const char *strTarget)
{
struct ViceIoctl blob;
char space[MAXSIZE];
***************
*** 1970,2014 ****
HOURGLASS hourglass;
static char message[2048];
! strcpy(path, strDir);
parent = Parent(path);
! sprintf(message,"MakeSymbolicLink: path = %s parent = %s\n",path,parent);
OutputDebugString(message);
- /*lets confirm its a good symlink*/
- if (!IsPathInAfs(path)) {
- const char * nbname = NetbiosName();
- int len = strlen(nbname);
-
- if (parent[0] == '\\' && parent[1] == '\\' &&
- parent[len+2] == '\\' &&
- parent[len+3] == '\0' &&
- !strnicmp(nbname,&parent[2],len))
- {
- sprintf(path,"%sall\\%s", parent, &strDir[strlen(parent)]);
- parent = Parent(path);
- sprintf(message,"MakeSymbolicLink: new path = %s parent = %s\n",path,parent);
- OutputDebugString(message);
-
- if (!IsPathInAfs(parent)) {
- ShowMessageBox(IDS_MAKE_LNK_NOT_AFS_ERROR, MB_ICONERROR, IDS_MAKE_LNK_NOT_AFS_ERROR);
- return TRUE;
- }
- } else {
- ShowMessageBox(IDS_MAKE_LNK_NOT_AFS_ERROR, MB_ICONERROR, IDS_MAKE_LNK_NOT_AFS_ERROR);
- return TRUE;
- }
- }
-
if ( IsFreelanceRoot(parent) && !IsAdmin() ) {
ShowMessageBox(IDS_NOT_AFS_CLIENT_ADMIN_ERROR, MB_ICONERROR, IDS_NOT_AFS_CLIENT_ADMIN_ERROR);
return FALSE;
}
! LPTSTR lpsz = new TCHAR[strlen(strDir)+1];
_tcscpy(lpsz, strName);
! strcpy(space, strDir);
blob.out_size = 0;
blob.in_size = 1 + strlen(space);
blob.in = space;
--- 2006,2025 ----
HOURGLASS hourglass;
static char message[2048];
! strcpy(path, strName);
parent = Parent(path);
! sprintf(message,"MakeSymbolicLink: name = %s target = %s parent = %s\n",strName,strTarget, parent);
OutputDebugString(message);
if ( IsFreelanceRoot(parent) && !IsAdmin() ) {
ShowMessageBox(IDS_NOT_AFS_CLIENT_ADMIN_ERROR, MB_ICONERROR, IDS_NOT_AFS_CLIENT_ADMIN_ERROR);
return FALSE;
}
! LPTSTR lpsz = new TCHAR[strlen(strTarget)+1];
_tcscpy(lpsz, strName);
! strcpy(space, strTarget);
blob.out_size = 0;
blob.in_size = 1 + strlen(space);
blob.in = space;
***************
*** 2082,2084 ****
--- 2093,2180 ----
ASSERT(strlen(space)MAX_PATH-2)
! {
! MessageBeep((UINT)-1);
! ShowMessageBox(IDS_CURRENT_DIRECTORY_PATH_TOO_LONG,MB_OK,IDS_CURRENT_DIRECTORY_PATH_TOO_LONG);
! }
! if (!SetCurrentDirectory(m_sBase))
! {
! MessageBeep((UINT)-1);
! ShowMessageBox(IDS_UNABLE_TO_SET_CURRENT_DIRECTORY,MB_OK,IDS_UNABLE_TO_SET_CURRENT_DIRECTORY);
! return;
! }
! if ((code=MakeSymbolicLink(strName,strDir))!=0){
! MessageBeep((UINT)-1);
! ShowMessageBox(IDS_UNABLE_TO_CREATE_SYMBOLIC_LINK,MB_OK,IDS_UNABLE_TO_CREATE_SYMBOLIC_LINK,code);
! return;
! }
! CDialog::OnOK();
}
/*
void CMakeSymbolicLinkDlg::OnChangeName()
--- 66,102 ----
void CMakeSymbolicLinkDlg::OnOK()
{
! char space[64];
! UINT code;
! int i;
! UpdateData(TRUE);
! CString strName;
! CString strTarget;
! m_Name.GetWindowText(strName);
! m_Dir.GetWindowText(strTarget);
if (!IsPathInAfs(m_sBase)) {
! MessageBeep((UINT)-1);
! strTarget+=" - Path is not in AFS directory";
! AfxMessageBox(strTarget,MB_OK);
! return;
! }
! if (m_sBase.GetLength()>MAX_PATH-2)
! {
! MessageBeep((UINT)-1);
! ShowMessageBox(IDS_CURRENT_DIRECTORY_PATH_TOO_LONG,MB_OK,IDS_CURRENT_DIRECTORY_PATH_TOO_LONG);
! }
! if (!SetCurrentDirectory(m_sBase))
! {
! MessageBeep((UINT)-1);
! ShowMessageBox(IDS_UNABLE_TO_SET_CURRENT_DIRECTORY,MB_OK,IDS_UNABLE_TO_SET_CURRENT_DIRECTORY);
! return;
! }
! if ((code=MakeSymbolicLink(strName,strTarget))!=0){
! MessageBeep((UINT)-1);
! ShowMessageBox(IDS_UNABLE_TO_CREATE_SYMBOLIC_LINK,MB_OK,IDS_UNABLE_TO_CREATE_SYMBOLIC_LINK,code);
! return;
! }
! CDialog::OnOK();
}
/*
void CMakeSymbolicLinkDlg::OnChangeName()
Index: openafs/src/WINNT/client_exp/resource.h
diff -c openafs/src/WINNT/client_exp/resource.h:1.8.4.1 openafs/src/WINNT/client_exp/resource.h:1.8.4.2
*** openafs/src/WINNT/client_exp/resource.h:1.8.4.1 Thu Aug 31 07:35:12 2006
--- openafs/src/WINNT/client_exp/resource.h Sat Jan 12 18:31:24 2008
***************
*** 118,124 ****
#define IDS_REALLY_REMOVE_SYMLINK 118
#define IDS_SYMBOLICLINK_ADD 128
! #define IDS_SYMBOLICLINK_EDIT 129
#define IDS_SYMBOLICLINK_REMOVE 130
#define IDS_SYMBOLIC_LINK_ITEM 131
#define IDS_UNABLE_TO_CREATE_SYMBOLIC_LINK 132
--- 118,124 ----
#define IDS_REALLY_REMOVE_SYMLINK 118
#define IDS_SYMBOLICLINK_ADD 128
! #define IDS_SYMBOLICLINK_SHOW 129
#define IDS_SYMBOLICLINK_REMOVE 130
#define IDS_SYMBOLIC_LINK_ITEM 131
#define IDS_UNABLE_TO_CREATE_SYMBOLIC_LINK 132
***************
*** 129,134 ****
--- 129,135 ----
#define IDS_NOT_AFS_CLIENT_ADMIN_ERROR 137
#define IDS_WARNING 138
#define IDS_VOLUME_NOT_IN_CELL_WARNING 139
+ #define IDS_NOT_SYMLINK_ERROR 140
#define IDM_AUTHENTICATION 0
#define IDM_ACL_SET 1
***************
*** 148,154 ****
#define IDM_ACL_CLEAN 15
#define IDM_SUBMOUNTS_EDIT 16
#define IDM_REMOVE_SYMLINK 17
!
#define ID_GET_TOKENS 917
#define ID_DISCARD_TOKENS 918
#define IDD_KLOG_DIALOG 920
--- 149,156 ----
#define IDM_ACL_CLEAN 15
#define IDM_SUBMOUNTS_EDIT 16
#define IDM_REMOVE_SYMLINK 17
! #define IDM_SYMBOLICLINK_SHOW 18
!
#define ID_GET_TOKENS 917
#define ID_DISCARD_TOKENS 918
#define IDD_KLOG_DIALOG 920
***************
*** 177,182 ****
--- 179,186 ----
#define ID_REMOVE_SYMLINK 957
#define ID_SYMBOLICLINK_ADD 958
#define ID_SYMBOLICLINK_REMOVE 959
+ #define ID_SYMBOLICLINK_SHOW 960
+ #define IDD_SYMLINKS 961
#define IDC_LIST 1001
#define IDC_PASSWORD 1002
#define IDC_OFFLINE_MSG 1003
Index: openafs/src/WINNT/client_exp/shell_ext.cpp
diff -c openafs/src/WINNT/client_exp/shell_ext.cpp:1.12.4.2 openafs/src/WINNT/client_exp/shell_ext.cpp:1.12.4.4
*** openafs/src/WINNT/client_exp/shell_ext.cpp:1.12.4.2 Tue Jan 30 07:42:43 2007
--- openafs/src/WINNT/client_exp/shell_ext.cpp Fri Feb 8 21:32:24 2008
***************
*** 76,82 ****
m_bIsOverlayEnabled=FALSE;
if (FAILED(hr))
m_pAlloc = NULL;
! RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSREG_CLT_SVC_PARAM_SUBKEY,0, KEY_QUERY_VALUE, &NPKey);
LSPsize=sizeof(ShellOption);
code=RegQueryValueEx(NPKey, "ShellOption", NULL,
&LSPtype, (LPBYTE)&ShellOption, &LSPsize);
--- 76,82 ----
m_bIsOverlayEnabled=FALSE;
if (FAILED(hr))
m_pAlloc = NULL;
! RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSREG_CLT_SVC_PARAM_SUBKEY,0, (IsWow64()?KEY_WOW64_64KEY:0)|KEY_QUERY_VALUE, &NPKey);
LSPsize=sizeof(ShellOption);
code=RegQueryValueEx(NPKey, "ShellOption", NULL,
&LSPtype, (LPBYTE)&ShellOption, &LSPsize);
***************
*** 183,189 ****
// IConextMenu Functions
/////////////////////////////////////////////////////////////////////////////
STDMETHODIMP CShellExt::XMenuExt::QueryContextMenu(HMENU hMenu,UINT indexMenu,
! UINT idCmdFirst, UINT idCmdLast,UINT uFlags)
{
METHOD_PROLOGUE(CShellExt, MenuExt);
--- 183,189 ----
// IConextMenu Functions
/////////////////////////////////////////////////////////////////////////////
STDMETHODIMP CShellExt::XMenuExt::QueryContextMenu(HMENU hMenu,UINT indexMenu,
! UINT idCmdFirst, UINT idCmdLast,UINT uFlags)
{
METHOD_PROLOGUE(CShellExt, MenuExt);
***************
*** 207,213 ****
DeleteMenu (hMenu, iItem, MF_BYPOSITION);
continue;
}
! if ((!lstrcmp(szItemText,"Cu&t"))&&(pThis->m_bIsSymlink)) { /*same for cut*/
DeleteMenu (hMenu, iItem, MF_BYPOSITION);
continue;
}
--- 207,213 ----
DeleteMenu (hMenu, iItem, MF_BYPOSITION);
continue;
}
! if ((!lstrcmp(szItemText,"Cu&t"))&&(pThis->m_bIsSymlink)) { /*same for cut*/
DeleteMenu (hMenu, iItem, MF_BYPOSITION);
continue;
}
***************
*** 218,228 ****
HMENU hAfsMenu = CreatePopupMenu();
int indexAfsMenu = 0;
- // The Authentication item has been removed from the AFS menu because
- // there is now a tray icon to handle authentication.
- //
- //::InsertMenu(hAfsMenu, indexAfsMenu++, MF_STRING | MF_BYPOSITION, idCmdFirst + IDM_AUTHENTICATION, GetMessageString(IDS_AUTHENTICATION_ITEM));
-
// Only enable the ACL menu item if a single directory is selected
int nSingleDirOnly = MF_GRAYED;
if (pThis->m_bDirSelected && (pThis->m_astrFileNames.GetSize() == 1))
--- 218,223 ----
***************
*** 259,280 ****
HMENU hSymbolicMenu = CreatePopupMenu();
int indexSymbolicMenu = 0;
::InsertMenu(hSymbolicMenu, indexSymbolicMenu++, MF_STRING | MF_BYPOSITION, idCmdFirst + IDM_SYMBOLICLINK_ADD, GetMessageString(IDS_SYMBOLICLINK_ADD));
! // ::InsertMenu(hSymbolicMenu, indexSymbolicMenu, MF_STRING | MF_BYPOSITION, idCmdFirst + IDM_SYMBOLICLINK_EDIT, GetMessageString(IDS_SYMBOLICLINK_EDIT));
! // ::EnableMenuItem(hSymbolicMenu,indexSymbolicMenu++,((pThis->m_bIsSymlink)?MF_ENABLED:MF_GRAYED)|MF_BYPOSITION);
! ::InsertMenu(hSymbolicMenu, indexSymbolicMenu, MF_STRING | MF_BYPOSITION, idCmdFirst + IDM_SYMBOLICLINK_REMOVE, GetMessageString(IDS_SYMBOLICLINK_REMOVE));
! ::EnableMenuItem(hSymbolicMenu,indexSymbolicMenu++,((pThis->m_bIsSymlink)?MF_ENABLED:MF_GRAYED)|MF_BYPOSITION);
::InsertMenu(hAfsMenu, indexAfsMenu++, MF_STRING | MF_BYPOSITION | MF_POPUP, (UINT)hSymbolicMenu, GetMessageString(IDS_SYMBOLIC_LINK_ITEM));
// The Submounts menu has been removed because the AFS tray icon
// and control panel now support mapping drives directly to an AFS
// path.
//
! // HMENU hSubmountMenu = CreatePopupMenu();
! // int indexSubmountMenu = 0;
! // ::InsertMenu(hSubmountMenu, indexSubmountMenu++, MF_STRING | MF_BYPOSITION | nSingleDirOnly, idCmdFirst + IDM_SUBMOUNTS_CREATE, GetMessageString(IDS_SUBMOUNTS_CREATE_ITEM));
! // ::InsertMenu(hSubmountMenu, indexSubmountMenu++, MF_STRING | MF_BYPOSITION, idCmdFirst + IDM_SUBMOUNTS_EDIT, GetMessageString(IDS_SUBMOUNTS_EDIT_ITEM));
! // ::InsertMenu(hAfsMenu, indexAfsMenu++, MF_STRING | MF_BYPOSITION | MF_POPUP, (UINT)hSubmountMenu, GetMessageString(IDS_SUBMOUNTS_ITEM));
// Add a separator
::InsertMenu (hMenu, indexMenu + indexShellMenu++, MF_STRING | MF_BYPOSITION | MF_SEPARATOR, 0, TEXT(""));
--- 254,281 ----
HMENU hSymbolicMenu = CreatePopupMenu();
int indexSymbolicMenu = 0;
+ int nSymlinkSelected = MF_GRAYED;
+ for (int n = pThis->m_astrFileNames.GetSize() - 1 ; n >= 0; n--) {
+ if ( IsSymlink(pThis->m_astrFileNames[n]) ) {
+ nSymlinkSelected = MF_ENABLED;
+ break;
+ }
+ }
+
::InsertMenu(hSymbolicMenu, indexSymbolicMenu++, MF_STRING | MF_BYPOSITION, idCmdFirst + IDM_SYMBOLICLINK_ADD, GetMessageString(IDS_SYMBOLICLINK_ADD));
! ::InsertMenu(hSymbolicMenu, indexSymbolicMenu++, MF_STRING | MF_BYPOSITION | nSymlinkSelected, idCmdFirst + IDM_SYMBOLICLINK_SHOW, GetMessageString(IDS_SYMBOLICLINK_SHOW));
! ::InsertMenu(hSymbolicMenu, indexSymbolicMenu++, MF_STRING | MF_BYPOSITION | nSymlinkSelected, idCmdFirst + IDM_SYMBOLICLINK_REMOVE, GetMessageString(IDS_SYMBOLICLINK_REMOVE));
::InsertMenu(hAfsMenu, indexAfsMenu++, MF_STRING | MF_BYPOSITION | MF_POPUP, (UINT)hSymbolicMenu, GetMessageString(IDS_SYMBOLIC_LINK_ITEM));
// The Submounts menu has been removed because the AFS tray icon
// and control panel now support mapping drives directly to an AFS
// path.
//
! //HMENU hSubmountMenu = CreatePopupMenu();
! //int indexSubmountMenu = 0;
! //::InsertMenu(hSubmountMenu, indexSubmountMenu++, MF_STRING | MF_BYPOSITION | nSingleDirOnly, idCmdFirst + IDM_SUBMOUNTS_CREATE, GetMessageString(IDS_SUBMOUNTS_CREATE_ITEM));
! //::InsertMenu(hSubmountMenu, indexSubmountMenu++, MF_STRING | MF_BYPOSITION, idCmdFirst + IDM_SUBMOUNTS_EDIT, GetMessageString(IDS_SUBMOUNTS_EDIT_ITEM));
! //::InsertMenu(hAfsMenu, indexAfsMenu++, MF_STRING | MF_BYPOSITION | MF_POPUP, (UINT)hSubmountMenu, GetMessageString(IDS_SUBMOUNTS_ITEM));
// Add a separator
::InsertMenu (hMenu, indexMenu + indexShellMenu++, MF_STRING | MF_BYPOSITION | MF_SEPARATOR, 0, TEXT(""));
***************
*** 418,424 ****
dlg.DoModal();
break;
}
!
case IDM_REMOVE_SYMLINK: {
if (files.GetSize()>1)
break;
--- 419,429 ----
dlg.DoModal();
break;
}
!
! case IDM_SYMBOLICLINK_SHOW:
! ListSymlink(files);
! break;
!
case IDM_REMOVE_SYMLINK: {
if (files.GetSize()>1)
break;
***************
*** 502,507 ****
--- 507,516 ----
nCmdStrID = ID_SYMBOLICLINK_ADD;
break;
+ case IDM_SYMBOLICLINK_SHOW:
+ nCmdStrID = ID_SYMBOLICLINK_SHOW;
+ break;
+
case IDM_SYMBOLICLINK_REMOVE:
nCmdStrID = ID_SYMBOLICLINK_REMOVE;
break;
Index: openafs/src/WINNT/client_exp/submounts_dlg.cpp
diff -c openafs/src/WINNT/client_exp/submounts_dlg.cpp:1.5 openafs/src/WINNT/client_exp/submounts_dlg.cpp:1.5.6.1
*** openafs/src/WINNT/client_exp/submounts_dlg.cpp:1.5 Fri Mar 11 00:35:12 2005
--- openafs/src/WINNT/client_exp/submounts_dlg.cpp Fri Feb 8 21:32:24 2008
***************
*** 50,56 ****
0,
"AFS",
REG_OPTION_NON_VOLATILE,
! KEY_READ,
NULL,
&hkSubmounts,
NULL );
--- 50,56 ----
0,
"AFS",
REG_OPTION_NON_VOLATILE,
! (IsWow64()?KEY_WOW64_64KEY:0)|KEY_READ,
NULL,
&hkSubmounts,
NULL );
***************
*** 171,177 ****
0,
"AFS",
REG_OPTION_NON_VOLATILE,
! KEY_READ|KEY_WRITE|KEY_QUERY_VALUE,
NULL,
&hkSubmounts,
NULL );
--- 171,177 ----
0,
"AFS",
REG_OPTION_NON_VOLATILE,
! (IsWow64()?KEY_WOW64_64KEY:0)|KEY_READ|KEY_WRITE|KEY_QUERY_VALUE,
NULL,
&hkSubmounts,
NULL );
***************
*** 253,259 ****
0,
"AFS",
REG_OPTION_NON_VOLATILE,
! KEY_WRITE,
NULL,
&hkSubmounts,
NULL );
--- 253,259 ----
0,
"AFS",
REG_OPTION_NON_VOLATILE,
! (IsWow64()?KEY_WOW64_64KEY:0)|KEY_WRITE,
NULL,
&hkSubmounts,
NULL );
***************
*** 275,281 ****
0,
"AFS",
REG_OPTION_NON_VOLATILE,
! KEY_WRITE,
NULL,
&hkSubmounts,
NULL );
--- 275,281 ----
0,
"AFS",
REG_OPTION_NON_VOLATILE,
! (IsWow64()?KEY_WOW64_64KEY:0)|KEY_WRITE,
NULL,
&hkSubmounts,
NULL );
Index: openafs/src/WINNT/client_exp/symlinks_dlg.cpp
diff -c /dev/null openafs/src/WINNT/client_exp/symlinks_dlg.cpp:1.1.2.2
*** /dev/null Mon Feb 11 10:58:12 2008
--- openafs/src/WINNT/client_exp/symlinks_dlg.cpp Sat Jan 12 18:31:24 2008
***************
*** 0 ****
--- 1,84 ----
+ /*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License. For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
+ extern "C" {
+ #include
+ #include
+ }
+
+ #include "stdafx.h"
+ #include "afs_shl_ext.h"
+ #include "symlinks_dlg.h"
+
+ #ifdef _DEBUG
+ #define new DEBUG_NEW
+ #undef THIS_FILE
+ static char THIS_FILE[] = __FILE__;
+ #endif
+
+ /////////////////////////////////////////////////////////////////////////////
+ // CSymlinksDlg dialog
+
+
+ CSymlinksDlg::CSymlinksDlg(CWnd* pParent /*=NULL*/)
+ : CDialog()
+ {
+ InitModalIndirect (TaLocale_GetDialogResource (CSymlinksDlg::IDD), pParent);
+
+ //{{AFX_DATA_INIT(CSymlinksDlg)
+ // NOTE: the ClassWizard will add member initialization here
+ //}}AFX_DATA_INIT
+ }
+
+
+ void CSymlinksDlg::DoDataExchange(CDataExchange* pDX)
+ {
+ CDialog::DoDataExchange(pDX);
+ //{{AFX_DATA_MAP(CSymlinksDlg)
+ DDX_Control(pDX, IDC_LIST, m_List);
+ //}}AFX_DATA_MAP
+ }
+
+
+ BEGIN_MESSAGE_MAP(CSymlinksDlg, CDialog)
+ //{{AFX_MSG_MAP(CSymlinksDlg)
+ ON_BN_CLICKED(IDHELP, OnHelp)
+ //}}AFX_MSG_MAP
+ END_MESSAGE_MAP()
+
+ /////////////////////////////////////////////////////////////////////////////
+ // CSymlinksDlg message handlers
+
+ BOOL CSymlinksDlg::OnInitDialog()
+ {
+ CDialog::OnInitDialog();
+
+ int tabs[] = { 64 };
+
+ m_List.SetTabStops(sizeof(tabs) / sizeof(int), tabs);
+
+ for (int i = 0; i < m_Symlinks.GetSize(); i++)
+ m_List.AddString(m_Symlinks[i]);
+
+ return TRUE; // return TRUE unless you set the focus to a control
+ // EXCEPTION: OCX Property Pages should return FALSE
+ }
+
+ void CSymlinksDlg::SetSymlinks(const CStringArray& symlinks)
+ {
+ m_Symlinks.RemoveAll();
+
+ m_Symlinks.Copy(symlinks);
+ }
+
+ void CSymlinksDlg::OnHelp()
+ {
+ ShowHelp(m_hWnd, SYMLINK_HELP_ID);
+ }
+
Index: openafs/src/WINNT/client_exp/symlinks_dlg.h
diff -c /dev/null openafs/src/WINNT/client_exp/symlinks_dlg.h:1.1.2.2
*** /dev/null Mon Feb 11 10:58:12 2008
--- openafs/src/WINNT/client_exp/symlinks_dlg.h Sat Jan 12 18:31:24 2008
***************
*** 0 ****
--- 1,43 ----
+ /*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License. For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
+ class CSymlinksDlg : public CDialog
+ {
+ CStringArray m_Symlinks;
+
+ // Construction
+ public:
+ CSymlinksDlg(CWnd* pParent = NULL); // standard constructor
+
+ void SetSymlinks(const CStringArray& mountPoints);
+
+ // Dialog Data
+ //{{AFX_DATA(CSymlinksDlg)
+ enum { IDD = IDD_SYMLINKS };
+ CListBox m_List;
+ //}}AFX_DATA
+
+
+ // Overrides
+ // ClassWizard generated virtual function overrides
+ //{{AFX_VIRTUAL(CSymlinksDlg)
+ protected:
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
+ //}}AFX_VIRTUAL
+
+ // Implementation
+ protected:
+
+ // Generated message map functions
+ //{{AFX_MSG(CSymlinksDlg)
+ virtual BOOL OnInitDialog();
+ afx_msg void OnHelp();
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP()
+ };
Index: openafs/src/WINNT/client_exp/lang/en_US/afs_shl_ext.rc
diff -c openafs/src/WINNT/client_exp/lang/en_US/afs_shl_ext.rc:1.10.4.1 openafs/src/WINNT/client_exp/lang/en_US/afs_shl_ext.rc:1.10.4.2
*** openafs/src/WINNT/client_exp/lang/en_US/afs_shl_ext.rc:1.10.4.1 Thu Aug 31 07:35:12 2006
--- openafs/src/WINNT/client_exp/lang/en_US/afs_shl_ext.rc Sat Jan 12 18:31:25 2008
***************
*** 318,329 ****
LISTBOX IDC_LIST,10,20,280,115,LBS_SORT | LBS_USETABSTOPS |
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL |
WS_TABSTOP
! LTEXT "File",IDC_STATIC,10,11,13,8
LTEXT "Volume",IDC_STATIC,75,11,27,8
LTEXT "Cell",IDC_STATIC,155,11,15,8
LTEXT "Type",IDC_STATIC,230,11,20,8
END
IDD_DOWN_SERVERS DIALOG DISCARDABLE 0, 0, 209, 163
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Down Servers"
--- 318,343 ----
LISTBOX IDC_LIST,10,20,280,115,LBS_SORT | LBS_USETABSTOPS |
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL |
WS_TABSTOP
! LTEXT "Name",IDC_STATIC,10,11,20,8
LTEXT "Volume",IDC_STATIC,75,11,27,8
LTEXT "Cell",IDC_STATIC,155,11,15,8
LTEXT "Type",IDC_STATIC,230,11,20,8
END
+ IDD_SYMLINKS DIALOG DISCARDABLE 0, 0, 299, 168
+ STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+ CAPTION "Symlinks"
+ FONT 8, "MS Sans Serif"
+ BEGIN
+ DEFPUSHBUTTON "Close",IDOK,65,145,50,14
+ PUSHBUTTON "Help",9,180,145,50,14
+ LISTBOX IDC_LIST,10,20,280,115,LBS_SORT | LBS_USETABSTOPS |
+ LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL |
+ WS_TABSTOP
+ LTEXT "Name",IDC_STATIC,10,11,20,8
+ LTEXT "Target",IDC_STATIC,75,11,27,8
+ END
+
IDD_DOWN_SERVERS DIALOG DISCARDABLE 0, 0, 209, 163
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Down Servers"
***************
*** 650,656 ****
STRINGTABLE DISCARDABLE
BEGIN
IDS_SYMBOLICLINK_ADD "&Add"
! IDS_SYMBOLICLINK_EDIT "&Edit..."
IDS_SYMBOLICLINK_REMOVE "&Remove"
IDS_SYMBOLIC_LINK_ITEM "Symbolic &Link"
IDS_UNABLE_TO_CREATE_SYMBOLIC_LINK "Unable to create symbolic link: %o."
--- 664,670 ----
STRINGTABLE DISCARDABLE
BEGIN
IDS_SYMBOLICLINK_ADD "&Add"
! IDS_SYMBOLICLINK_SHOW "&Show"
IDS_SYMBOLICLINK_REMOVE "&Remove"
IDS_SYMBOLIC_LINK_ITEM "Symbolic &Link"
IDS_UNABLE_TO_CREATE_SYMBOLIC_LINK "Unable to create symbolic link: %o."
***************
*** 661,666 ****
--- 675,684 ----
IDS_NOT_AFS_CLIENT_ADMIN_ERROR "Must be AFS Client Administrators to modify the root.afs volume."
IDS_WARNING "Warning"
IDS_VOLUME_NOT_IN_CELL_WARNING "Volume %s does not exist in cell %s.\n"
+ IDS_NOT_SYMLINK_ERROR "%o is not a symbolic link."
+ ID_SYMBOLICLINK_ADD "symlink make"
+ ID_SYMBOLICLINK_SHOW "symlink list"
+ ID_SYMBOLICLINK_REMOVE "symlink remove"
END
STRINGTABLE DISCARDABLE
Index: openafs/src/WINNT/client_osi/NTMakefile
diff -c openafs/src/WINNT/client_osi/NTMakefile:1.10.4.1 openafs/src/WINNT/client_osi/NTMakefile:1.10.4.2
*** openafs/src/WINNT/client_osi/NTMakefile:1.10.4.1 Mon Nov 20 13:04:53 2006
--- openafs/src/WINNT/client_osi/NTMakefile Sat Feb 2 08:43:23 2008
***************
*** 46,52 ****
EXELIBS = \
rpcrt4.lib rpcns4.lib \
! Ws2_32.lib \
$(DESTDIR)\lib\libosi.lib
############################################################################
--- 46,52 ----
EXELIBS = \
rpcrt4.lib rpcns4.lib \
! Ws2_32.lib shell32.lib \
$(DESTDIR)\lib\libosi.lib
############################################################################
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.24 openafs/src/WINNT/doc/install/Documentation/en_US/html/index.htm:1.5.4.26
*** openafs/src/WINNT/doc/install/Documentation/en_US/html/index.htm:1.5.4.24 Fri Dec 28 14:47:11 2007
--- openafs/src/WINNT/doc/install/Documentation/en_US/html/index.htm Wed Feb 6 12:58:17 2008
***************
*** 57,63 ****
OpenAFS for Windows
! Version 1.5.29
--- 57,63 ----
OpenAFS for Windows
! Version 1.5.31
***************
*** 80,86 ****
·
OpenAFS for Windows 1.5.29
Release Notes
--- 80,86 ----
·
OpenAFS for Windows 1.5.31
Release Notes
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.24 openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/logo.htm:1.1.6.26
*** openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/logo.htm:1.1.6.24 Fri Dec 28 14:47:19 2007
--- openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/logo.htm Wed Feb 6 12:58:20 2008
***************
*** 18,24 ****
.shape {behavior:url(#default#VML);}
!
OpenAFS for Windows 1.5.29 Release Notes
! OpenAFS for Windows 1.5.31 Release Notes
! OpenAFS for Windows 1.5.29 Release Notes
! OpenAFS for Windows 1.5.31 Release Notes
Jeffrey Altman
! 3
! 930
2006-11-29T17:26:00Z
! 2007-06-22T13:42:00Z
1
! 18300
! 104312
Secure Endpoints Inc.
! 869
! 244
! 122368
11.9999
-
- 1. Installer Options
2. System Requirements
2.1 Supported Operating Systems
2.1.1 Unsupported Operating Systems
2.2 Disk Space
2.3 Additional Software Packages
3. Operational Notes
3.1. Requirements for Kerberos v5
Authentication
3.1.1. Active Directory
3.1.2. Using the krb524 service
3.1.3. Network Identity Manager Provider
3.2. Use of the Microsoft Loopback Adapter by
the AFS Client Service
3.3. Using Freelance (Dynamic Root) Mode to
Improve Mobility
3.4. Locating AFS Volume Database Servers via
DNS
3.5. Obtaining AFS Tokens as a Integrated
Part of Windows Logon
3.6. AFS System Tray Command Line Options
3.7. The “AFS Client Admins” Authorization
Group
3.8. OpenAFS support for UNC paths
3.9. aklog.exe
3.10. OpenAFS Servers on Windows are
Unsupported
3.10.1. OpenAFS Server Installation
3.10.2. Using the AFS Client Service when the
Server is installed
3.11. OpenAFS Debugging Symbol files
3.12. Large File (64-bit) Support
3.13. Encrypted AFS Network Communication
3.14. Authenticated Access to the OpenAFS
Client Service
3.15. No More INI Files
3.16. Microsoft Windows Internet Connection
Firewall
3.17. Browsing AFS from the Explorer Shell
and Office
3.18. Byte Range Locking
3.19. Automatic Discarding of AFS Tokens at
Logoff
3.20. Windows Terminal Server installations
3.21. Hidden Dot Files
3.22. Status Cache Limits
3.23. NETBIOS over TCP/IP must be enabled
3.24. OpenAFS binaries are digitally signed
3.25. Maximum Size of the AFSCache File
3.26. Filename Character Sets
3.27. Known Character Set Issues with Roaming
Profiles
3.28. The AFSCache File
3.29. Restricting OpenAFS Client Service
! Start and Stop
3.30. The @sys Name List
3.31. Symlinks to AFS UNC paths
3.32. Cache Manager Debugging
3.33. Windows Logon Caching vs. Kerberos
Logons
3.34. Initial Server Preferences
3.35. File Timestamps
3.36. Windows RPC client support must be
installed
3.37. Generating Minidumps of the OpenAFS
! Client Service
3.38. AFS Client Universally Unique
Identifiers (UUIDs) vs. System Cloning
3.39. Delayed Write Errors with Microsoft
Office Applications
3.40. Global Drives (aka Service Drive
Letters) are no longer supported by Microsoft
3.41. 64-bit Microsoft Windows Installations
3.42. Known Issues with Microsoft Windows
Vista
3.43. New AFS Share Name Syntax Provides
Direct Access to Volumes
3.44. Differences between Windows and UNIX
“fs examine”
4. How to Debug Problems with OpenAFS for
Windows:
4.1. pioctl debugging (IoctlDebug registry
key)
4.2. afsd_service initialization log
(%WinDir%\TEMP\afsd_init.log)
4.3. afsd_service debug logs (fs trace {-on,
-off, -dump} ->%WinDir%\TEMP\afsd.log)
4.4. Using SysInternal’s DbgView and ProcMon
or FileMon Tools
4.5. Microsoft MiniDumps (fs minidump -> %WinDir%\TEMP\afsd.dmp)
4.6. Single Sign-on (Integrated Logon)
debugging
4.7. RX (AFS RPC) debugging (rxdebug)
4.8. Cache Manager debugging (cmdebug)
4.9. Persistent Cache consistency check
4.10. Token Acquisition Debugging
5. Reporting Bugs:
6. How to Contribute to the Development of
OpenAFS for Windows
6.1. The USENIX OpenAFS Fund
6.2. Secure Endpoints Inc.
6.3. Direct contributions of code and/or
documentation
6.4. OpenAFS for Windows Mailing Lists
7. MSI Deployment Guide
7.1. Introduction
7.1.1 Requirements
7.1.2 Authoring a Transform
7.2. Configuration Options
7.2.1 Configurable Properties
7.2.1.1 Setting Properties
7.2.1.2 OpenAFS for Windows Properties
(Service parameters):
(Network provider):
(OpenAFS Client):
7.2.1.2.1 Registry Properties
AFSCACHEPATH
AFSCACHESIZE
AFSCELLNAME
FREELANCEMODE
HIDEDOTFILES
LOGONOPTIONS
MOUNTROOT
NETBIOSNAME
NOFINDLANABYNAME
RXMAXMTU
SECURITYLEVEL
SMBAUTHTYPE
STOREANSIFILENAMES
USEDNS
7.2.1.2.2 AFSCreds.exe Properties
CREDSSTARTUP
CREDSAUTOINIT
CREDSIPCHDET
CREDSQUIET
CREDSRENEWDRMAP
CREDSSHOW
7.2.2 Existing Registry Entries
7.2.3 Replacing Configuration Files
7.2.3.1 Components for Configuration Files
7.2.4 Adding Domain Specific Registry Keys
7.2.5 Adding Site Specific Freelance Registry
Keys
7.3 Additional Resources
7.4. Upgrades
Appendix A: Registry Values
A.1. Service parameters
Regkey:
[HKLM\SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters]
Value: LANadapter
Value: CacheSize
Value: ChunkSize
Value: Daemons
Value: ServerThreads
Value: Stats
Value: LogoffPreserveTokens
Value: RootVolume
Value: MountRoot
Value: CachePath
Value: NonPersistentCaching
Value: ValidateCache
Value: TrapOnPanic
Value: NetbiosName
Value: IsGateway
Value: ReportSessionStartups
Value: TraceBufferSize
Value: SysName
Value: SecurityLevel
Value: UseDNS
Value: FreelanceClient
Value: HideDotFiles
Value: MaxMpxRequests
Value: MaxVCPerServer
Value: Cell
Value: RxNoJumbo
Value: RxMaxMTU
Value: ConnDeadTimeout
Value: HardDeadTimeout
Value: TraceOption
Value: AllSubmount
Value: NoFindLanaByName
Value: MaxCPUs
Value: smbAuthType
Value: MaxLogSize
Value: FlushOnHibernate
Value: daemonCheckDownInterval
Value: daemonCheckUpInterval
Value: daemonCheckVolInterval
Value: daemonCheckCBInterval
Value: daemonCheckLockInterval
Value: daemonCheckTokenInterval
Value: daemonCheckOfflineVolInterval
Value: CallBackPort
Value: EnableServerLocks
Value: DeleteReadOnly
Value: BPlusTrees
Value: PrefetchExecutableExtensions
Value: OfflineReadOnlyIsValid
Value: GiveUpAllCallBacks
Value: FollowBackupPath
Regkey:
[HKLM\SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters\GlobalAutoMapper]
Value: <Drive Letter:> for example
"G:"
Regkey: [HKLM\SOFTWARE\OpenAFS\Client]
Value: CellServDBDir
Value: VerifyServiceSignature
Value: IoctlDebug
Value: MiniDumpType
Value: StoreAnsiFilenames
Regkey:
[HKLM\SOFTWARE\OpenAFS\Client\CSCPolicy]
Value: "smb/cifs share name"
Regkey:
[HKLM\SOFTWARE\OpenAFS\Client\Freelance]
Value: "numeric value"
Regkey:
[HKLM\SOFTWARE\OpenAFS\Client\Freelance\Symlinks]
Value: "numeric value"
Regkey:
[HKLM\SOFTWARE\OpenAFS\Client\Submounts]
Value: "submount name"
Regkey: [HKLM\SOFTWARE\OpenAFS\Client\Server
Preferences\VLDB]
Value: "hostname or ip address"
Regkey: [HKLM\SOFTWARE\OpenAFS\Client\Server
Preferences\File]
Value: "hostname or ip address"
A.2. Integrated Logon Network provider
parameters
Regkey:
[HKLM\SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters]
Value: FailLoginsSilently
Regkey:
[HKLM\SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider]
Value: NoWarnings
Value: AuthentProviderPath
Value: Class
Value: DependOnGroup
Value: DependOnService
Value: Name
Value: ProviderPath
A.2.1 Domain specific configuration keys for
the Network Provider
[HKLM\SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider]
[HKLM\SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider\Domain]
[HKLM\SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider\Domain"domain
name"]
[HKLM\SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider\Domain\LOCALHOST]
Example:
A.2.1.1 Domain specific configuration values
[HKLM\SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider]
[HKLM\SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider\Domain]
[HKLM\SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider\Domain"domain
name"] [HKLM\SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider\Domain\LOCALHOST]1. Installer Options
2. System Requirements
2.1 Supported Operating Systems
2.1.1 Unsupported Operating Systems
2.2 Disk Space
2.3 Additional Software Packages
3. Operational Notes
3.1. Requirements for Kerberos v5
Authentication
3.1.1. Active Directory
3.1.2. Using the krb524 service
3.1.3. Network Identity Manager Provider
3.2. Use of the Microsoft Loopback Adapter by
the AFS Client Service
3.3. Using Freelance (Dynamic Root) Mode to
Improve Mobility
3.4. Locating AFS Volume Database Servers via
DNS
3.5. Obtaining AFS Tokens as a Integrated
Part of Windows Logon
3.6. AFS System Tray Command Line Options
3.7. The “AFS Client Admins” Authorization
Group
3.8. OpenAFS support for UNC paths
3.9. aklog.exe
3.10. OpenAFS Servers on Windows are
Unsupported
3.10.1. OpenAFS Server Installation
3.10.2. Using the AFS Client Service when the
Server is installed
3.11. OpenAFS Debugging Symbol files
3.12. Large File (64-bit) Support
3.13. Encrypted AFS Network Communication
3.14. Authenticated Access to the OpenAFS
Client Service
3.15. No More INI Files
3.16. Microsoft Windows Internet Connection
Firewall
3.17. Browsing AFS from the Explorer Shell
and Office
3.18. Byte Range Locking
3.19. Automatic Discarding of AFS Tokens at
Logoff
3.20. Windows Terminal Server installations
3.21. Hidden Dot Files
3.22. Status Cache Limits
3.23. NETBIOS over TCP/IP must be enabled
3.24. OpenAFS binaries are digitally signed
3.25. Maximum Size of the AFSCache File
3.26. Filename Character Sets
3.27. Known Character Set Issues with Roaming
Profiles
3.28. The AFSCache File
3.29. Restricting OpenAFS Client Service Start
! and Stop
3.30. The @sys Name List
3.31. Symlinks to AFS UNC paths
3.32. Cache Manager Debugging
3.33. Windows Logon Caching vs. Kerberos
Logons
3.34. Initial Server Preferences
3.35. File Timestamps
3.36. Windows RPC client support must be
installed
3.37. Generating Minidumps of the OpenAFS Client
! Service
3.38. AFS Client Universally Unique
Identifiers (UUIDs) vs. System Cloning
3.39. Delayed Write Errors with Microsoft
Office Applications
3.40. Global Drives (aka Service Drive
Letters) are no longer supported by Microsoft
3.41. 64-bit Microsoft Windows Installations
3.42. Known Issues with Microsoft Windows
Vista
3.43. New AFS Share Name Syntax Provides
Direct Access to Volumes
3.44. Differences between Windows and UNIX
“fs examine”
+ 3.45. Literal evaluation of AFS objects via
+ fs commands
+
+ 3.46. Out of Quota errors
+
4. How to Debug Problems with OpenAFS for
Windows:
4.1. pioctl debugging (IoctlDebug registry
key)
4.2. afsd_service initialization log
(%WinDir%\TEMP\afsd_init.log)
4.3. afsd_service debug logs (fs trace {-on,
-off, -dump} ->%WinDir%\TEMP\afsd.log)
4.4. Using SysInternal’s DbgView and ProcMon
or FileMon Tools
4.5. Microsoft MiniDumps (fs minidump -> %WinDir%\TEMP\afsd.dmp)
4.6. Single Sign-on (Integrated Logon)
debugging
4.7. RX (AFS RPC) debugging (rxdebug)
4.8. Cache Manager debugging (cmdebug)
4.9. Persistent Cache consistency check
4.10. Token Acquisition Debugging
5. Reporting Bugs:
6. How to Contribute to the Development of
OpenAFS for Windows
6.1. The USENIX OpenAFS Fund
6.2. Secure Endpoints Inc.
6.3. Direct contributions of code and/or
documentation
6.4. OpenAFS for Windows Mailing Lists
7. MSI Deployment Guide
7.1. Introduction
7.1.1 Requirements
7.1.2 Authoring a Transform
7.2. Configuration Options
7.2.1 Configurable Properties
7.2.1.1 Setting Properties
7.2.1.2 OpenAFS for Windows Properties
(Service parameters):
(Network provider):
(OpenAFS Client):
7.2.1.2.1 Registry Properties
AFSCACHEPATH
AFSCACHESIZE
AFSCELLNAME
FREELANCEMODE
HIDEDOTFILES
LOGONOPTIONS
MOUNTROOT
NETBIOSNAME
NOFINDLANABYNAME
RXMAXMTU
SECURITYLEVEL
SMBAUTHTYPE
STOREANSIFILENAMES
USEDNS
7.2.1.2.2 AFSCreds.exe Properties
CREDSSTARTUP
CREDSAUTOINIT
CREDSIPCHDET
CREDSQUIET
CREDSRENEWDRMAP
CREDSSHOW
7.2.2 Existing Registry Entries
7.2.3 Replacing Configuration Files
7.2.3.1 Components for Configuration Files
7.2.4 Adding Domain Specific Registry Keys
7.2.5 Adding Site Specific Freelance Registry
Keys
7.3 Additional Resources
7.4. Upgrades
Appendix A: Registry Values
A.1. Service parameters
Regkey:
[HKLM\SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters]
Value: LANadapter
Value: CacheSize
Value: ChunkSize
Value: Daemons
Value: ServerThreads
Value: Stats
Value: LogoffPreserveTokens
Value: RootVolume
Value: MountRoot
Value: CachePath
Value: NonPersistentCaching
Value: ValidateCache
Value: TrapOnPanic
Value: NetbiosName
Value: IsGateway
Value: ReportSessionStartups
Value: TraceBufferSize
Value: SysName
Value: SecurityLevel
Value: UseDNS
Value: FreelanceClient
Value: HideDotFiles
Value: MaxMpxRequests
Value: MaxVCPerServer
Value: Cell
Value: RxNoJumbo
Value: RxMaxMTU
Value: ConnDeadTimeout
Value: HardDeadTimeout
Value: TraceOption
Value: AllSubmount
Value: NoFindLanaByName
Value: MaxCPUs
Value: smbAuthType
Value: MaxLogSize
Value: FlushOnHibernate
Value: daemonCheckDownInterval
Value: daemonCheckUpInterval
Value: daemonCheckVolInterval
Value: daemonCheckCBInterval
Value: daemonCheckLockInterval
Value: daemonCheckTokenInterval
Value: daemonCheckOfflineVolInterval
Value: CallBackPort
Value: EnableServerLocks
Value: DeleteReadOnly
Value: BPlusTrees
Value: PrefetchExecutableExtensions
Value: OfflineReadOnlyIsValid
Value: GiveUpAllCallBacks
Value: FollowBackupPath
Regkey:
[HKLM\SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters\GlobalAutoMapper]
Value: <Drive Letter:> for example
"G:"
Regkey: [HKLM\SOFTWARE\OpenAFS\Client]
Value: CellServDBDir
Value: VerifyServiceSignature
Value: IoctlDebug
Value: MiniDumpType
Value: StoreAnsiFilenames
Regkey:
[HKLM\SOFTWARE\OpenAFS\Client\CSCPolicy]
Value: "smb/cifs share name"
Regkey:
[HKLM\SOFTWARE\OpenAFS\Client\Freelance]
Value: "numeric value"
Regkey:
[HKLM\SOFTWARE\OpenAFS\Client\Freelance\Symlinks]
Value: "numeric value"
!
! Regkey: [HKLM\SOFTWARE\OpenAFS\Client\Realms]
!
! Regkey: [HKLM\SOFTWARE\OpenAFS\Client\Realms”Realm Name”]
!
! Value: AFSEnabled
!
! Regkey: [HKLM\SOFTWARE\OpenAFS\Client\Realms”Realm Name””Cell Name”]
!
! Value: MethodName
!
! Value: Realm
Regkey:
[HKLM\SOFTWARE\OpenAFS\Client\Submounts]
Value: "submount name"
Regkey: [HKLM\SOFTWARE\OpenAFS\Client\Server
Preferences\VLDB]
Value: "hostname or ip address"
Regkey: [HKLM\SOFTWARE\OpenAFS\Client\Server
Preferences\File]
Value: "hostname or ip address"
A.2. Integrated Logon Network provider
parameters
Regkey:
[HKLM\SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters]
Value: FailLoginsSilently
Regkey:
[HKLM\SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider]
Value: NoWarnings
Value: AuthentProviderPath
Value: Class
Value: DependOnGroup
Value: DependOnService
Value: Name
Value: ProviderPath
A.2.1 Domain specific configuration keys for
the Network Provider
[HKLM\SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider]
[HKLM\SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider\Domain]
[HKLM\SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider\Domain"domain
name"]
[HKLM\SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider\Domain\LOCALHOST]
Example:
A.2.1.1 Domain specific configuration values
[HKLM\SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider]
[HKLM\SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider\Domain]
[HKLM\SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider\Domain"domain
name"] [HKLM\SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider\Domain\LOCALHOST]Value: LogonOptions
Value: FailLoginsSilentl
Value: LogonScript
Value: LoginRetryInterval
Value: LoginSleepInterval
Value: Realm
Value: TheseCells
A.2.1.2 Selection of effective values for
domain specific configuration
A.2.1.3 Exceptions to A.2.1.2
2.1.3.1 'FailLoginsSilently'
2.1.3.2 'LogonScript'
A.3. AFS Credentials System Tray Tool
parameters
Regkey:
[HKLM\SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters]
Value: Gateway
Value: Cell
Regkey: [HKLM\SOFTWARE\OpenAFS\Client]
[HKCU\SOFTWARE\OpenAFS\Client]
Value: ShowTrayIcon
Value: EnableKFW
Value: AcceptDottedPrincipalNames
Value: Use524
Value: AfscredsShortcutParams
Regkey: [HKCU\SOFTWARE\OpenAFS\Client]
Value: Authentication Cell
Regkey:
[HKCU\SOFTWARE\OpenAFS\Client\Reminders]
Value: "afs cell name"
Regkey: [HKCU\SOFTWARE\OpenAFS\Client\Active
Maps]
Value: "upper case drive letter"
Regkey:
[HKCU\SOFTWARE\OpenAFS\Client\Mappings]
Value: "upper case drive letter"
A.4
OpenAFS Client Service Environment Variables
Variable: AFS_RPC_ENCRYPT
Variable: AFS_RPC_PROTSEQ
--- 1370,1539 ----
Value: LogonOptions
Value: FailLoginsSilentl
Value: LogonScript
Value: LoginRetryInterval
Value: LoginSleepInterval
Value: Realm
Value: TheseCells
A.2.1.2 Selection of effective values for
domain specific configuration
A.2.1.3 Exceptions to A.2.1.2
2.1.3.1 'FailLoginsSilently'
2.1.3.2 'LogonScript'
A.3. AFS Credentials System Tray Tool
parameters
Regkey:
[HKLM\SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters]
Value: Gateway
Value: Cell
Regkey: [HKLM\SOFTWARE\OpenAFS\Client]
[HKCU\SOFTWARE\OpenAFS\Client]
Value: ShowTrayIcon
Value: EnableKFW
Value: AcceptDottedPrincipalNames
Value: Use524
Value: AfscredsShortcutParams
Regkey: [HKCU\SOFTWARE\OpenAFS\Client]
Value: Authentication Cell
Regkey:
[HKCU\SOFTWARE\OpenAFS\Client\Reminders]
Value: "afs cell name"
Regkey: [HKCU\SOFTWARE\OpenAFS\Client\Active
Maps]
Value: "upper case drive letter"
Regkey:
[HKCU\SOFTWARE\OpenAFS\Client\Mappings]
Value: "upper case drive letter"
A.4
OpenAFS Client Service Environment Variables
Variable: AFS_RPC_ENCRYPT
Variable: AFS_RPC_PROTSEQ
Index: openafs/src/WINNT/install/NSIS/OpenAFS.nsi
diff -c openafs/src/WINNT/install/NSIS/OpenAFS.nsi:1.88.4.11 openafs/src/WINNT/install/NSIS/OpenAFS.nsi:1.88.4.12
*** openafs/src/WINNT/install/NSIS/OpenAFS.nsi:1.88.4.11 Tue Sep 18 02:05:28 2007
--- openafs/src/WINNT/install/NSIS/OpenAFS.nsi Wed Jan 30 22:03:13 2008
***************
*** 561,570 ****
!insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscred_en_us.dll" "$INSTDIR\Client\Program\afscred_en_us.dll" "$INSTDIR"
File "${AFS_CLIENT_BUILDDIR}\afsplhlp.chm"
! SetOutPath "$SYSDIR"
! !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afslogon.dll" "$SYSDIR\afslogon.dll" "$INSTDIR"
File "${AFS_CLIENT_BUILDDIR}\afscpcc.exe"
!ifdef AFSIFS
!ifndef DEBUG
!insertmacro ReplaceDLL "..\..\afsrdr\objfre_w2K_x86\i386\afsrdr.sys" "$SYSDIR\DRIVERS\afsrdr.sys" "$INSTDIR"
!else
--- 561,571 ----
!insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscred_en_us.dll" "$INSTDIR\Client\Program\afscred_en_us.dll" "$INSTDIR"
File "${AFS_CLIENT_BUILDDIR}\afsplhlp.chm"
! !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afslogon.dll" "$INSTDIR\Client\Program\afslogon.dll" "$INSTDIR"
File "${AFS_CLIENT_BUILDDIR}\afscpcc.exe"
+
!ifdef AFSIFS
+ SetOutPath "$SYSDIR"
!ifndef DEBUG
!insertmacro ReplaceDLL "..\..\afsrdr\objfre_w2K_x86\i386\afsrdr.sys" "$SYSDIR\DRIVERS\afsrdr.sys" "$INSTDIR"
!else
***************
*** 713,720 ****
; Daemon entries
WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon" "" ""
! WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider" "ProviderPath" "$SYSDIR\afslogon.dll"
! WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider" "AuthentProviderPath" "$SYSDIR\afslogon.dll"
WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider" "Class" 2
WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider" "VerboseLogging" 10
--- 714,721 ----
; Daemon entries
WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon" "" ""
! WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider" "ProviderPath" "$INSTDIR\Client\Program\afslogon.dll"
! WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider" "AuthentProviderPath" "$INSTDIR\Client\Program\afslogon.dll"
WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider" "Class" 2
WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider" "VerboseLogging" 10
***************
*** 1168,1176 ****
File "${AFS_DESTDIR}\etc\backup.pdb"
File "${AFS_CLIENT_BUILDDIR}\afs_cpa.pdb"
File "${AFS_CLIENT_BUILDDIR}\afscred.pdb"
SetOutPath "$SYSDIR"
- File "${AFS_CLIENT_BUILDDIR}\afslogon.pdb"
DoServer:
SectionGetFlags ${secServer} $R0
--- 1169,1178 ----
File "${AFS_DESTDIR}\etc\backup.pdb"
File "${AFS_CLIENT_BUILDDIR}\afs_cpa.pdb"
File "${AFS_CLIENT_BUILDDIR}\afscred.pdb"
+ File "${AFS_CLIENT_BUILDDIR}\afslogon.pdb"
+ File "${AFS_CLIENT_BUILDDIR}\afscpcc.pdb"
SetOutPath "$SYSDIR"
DoServer:
SectionGetFlags ${secServer} $R0
***************
*** 1853,1866 ****
;RMDIR /r "$INSTDIR\Server\usr\afs\logs"
Delete /REBOOTOK "$SYSDIR\afsserver.cpl"
! Delete /REBOOTOK "$SYSDIR\afs_cpa.cpl"
! Delete /REBOOTOK "$SYSDIR\afslogon.dll"
! Delete /REBOOTOK "$SYSDIR\afscpcc.exe"
Delete /REBOOTOK "$SYSDIR\afsserver.pdb"
! Delete /REBOOTOK "$SYSDIR\afs_cpa.pdb"
! Delete /REBOOTOK "$SYSDIR\afslogon.pdb"
! Delete /REBOOTOK "$SYSDIR\afscpcc.pdb"
RMDir /r "$INSTDIR\Documentation\html\CmdRef"
RMDir /r "$INSTDIR\Documentation\html\InstallGd"
--- 1855,1868 ----
;RMDIR /r "$INSTDIR\Server\usr\afs\logs"
Delete /REBOOTOK "$SYSDIR\afsserver.cpl"
! Delete /REBOOTOK "$INSTDIR\Client\Program\afs_cpa.cpl"
! Delete /REBOOTOK "$INSTDIR\Client\Program\afslogon.dll"
! Delete /REBOOTOK "$INSTDIR\Client\Program\afscpcc.exe"
Delete /REBOOTOK "$SYSDIR\afsserver.pdb"
! Delete /REBOOTOK "$INSTDIR\Client\Program\afs_cpa.pdb"
! Delete /REBOOTOK "$INSTDIR\Client\Program\afslogon.pdb"
! Delete /REBOOTOK "$INSTDIR\Client\Program\afscpcc.pdb"
RMDir /r "$INSTDIR\Documentation\html\CmdRef"
RMDir /r "$INSTDIR\Documentation\html\InstallGd"
***************
*** 1871,1877 ****
RMDir "$INSTDIR\Documentation"
; Delete DOC short cut
Delete /REBOOTOK "$INSTDIR\Client\Program\afscreds.exe"
-
Delete /REBOOTOK "$INSTDIR\Client\Program\afscreds.pdb"
Delete /REBOOTOK "$INSTDIR\SDK\Include\*"
--- 1873,1878 ----
Index: openafs/src/WINNT/install/wix/feature.wxi
diff -c openafs/src/WINNT/install/wix/feature.wxi:1.14.2.7 openafs/src/WINNT/install/wix/feature.wxi:1.14.2.9
*** openafs/src/WINNT/install/wix/feature.wxi:1.14.2.7 Thu Aug 30 22:27:38 2007
--- openafs/src/WINNT/install/wix/feature.wxi Tue Feb 5 20:14:52 2008
***************
*** 71,76 ****
--- 71,79 ----
+
+
+
***************
*** 119,126 ****
!
!
--- 122,129 ----
!
!
***************
*** 299,304 ****
--- 302,310 ----
+
+
+
Index: openafs/src/WINNT/install/wix/files.wxi
diff -c openafs/src/WINNT/install/wix/files.wxi:1.22.2.18 openafs/src/WINNT/install/wix/files.wxi:1.22.2.20
*** openafs/src/WINNT/install/wix/files.wxi:1.22.2.18 Fri Dec 7 16:34:12 2007
--- openafs/src/WINNT/install/wix/files.wxi Tue Feb 5 20:14:52 2008
***************
*** 21,26 ****
--- 21,35 ----
+
+
+
+
+
+
+
+
+
***************
*** 28,48 ****
-
-
-
-
-
-
-
-
-
--- 37,48 ----
***************
*** 71,81 ****
-
-
-
--- 71,78 ----
***************
*** 84,89 ****
--- 81,89 ----
+
+
+
Index: openafs/src/WINNT/netidmgr_plugin/afscred.h
diff -c openafs/src/WINNT/netidmgr_plugin/afscred.h:1.1.2.5 openafs/src/WINNT/netidmgr_plugin/afscred.h:1.1.2.6
*** openafs/src/WINNT/netidmgr_plugin/afscred.h:1.1.2.5 Tue Aug 28 12:54:46 2007
--- openafs/src/WINNT/netidmgr_plugin/afscred.h Fri Feb 1 16:17:15 2008
***************
*** 1,5 ****
/*
! * Copyright (c) 2005,2006 Secure Endpoints Inc.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
--- 1,5 ----
/*
! * Copyright (c) 2005-2008 Secure Endpoints Inc.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
***************
*** 22,28 ****
* SOFTWARE.
*/
! /* $Id: afscred.h,v 1.1.2.5 2007/08/28 16:54:46 jaltman Exp $ */
#ifndef __KHIMAIRA_AFSCRED_H
#define __KHIMAIRA_AFSCRED_H
--- 22,28 ----
* SOFTWARE.
*/
! /* $Id: afscred.h,v 1.1.2.6 2008/02/01 21:17:15 jaltman Exp $ */
#ifndef __KHIMAIRA_AFSCRED_H
#define __KHIMAIRA_AFSCRED_H
***************
*** 41,48 ****
#include
- #include
#include
#include
#include
#include
--- 41,48 ----
#include
#include
+ #include
#include
#include
#include
Index: openafs/src/WINNT/netidmgr_plugin/afsnewcreds.c
diff -c openafs/src/WINNT/netidmgr_plugin/afsnewcreds.c:1.1.2.6 openafs/src/WINNT/netidmgr_plugin/afsnewcreds.c:1.1.2.7
*** openafs/src/WINNT/netidmgr_plugin/afsnewcreds.c:1.1.2.6 Tue Aug 28 12:54:46 2007
--- openafs/src/WINNT/netidmgr_plugin/afsnewcreds.c Tue Jan 8 12:06:39 2008
***************
*** 1,5 ****
/*
! * Copyright (c) 2005,2006 Secure Endpoints Inc.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
--- 1,5 ----
/*
! * Copyright (c) 2005,2006,2007,2008 Secure Endpoints Inc.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
***************
*** 22,28 ****
* SOFTWARE.
*/
! /* $Id: afsnewcreds.c,v 1.1.2.6 2007/08/28 16:54:46 jaltman Exp $ */
#include
#include
--- 22,28 ----
* SOFTWARE.
*/
! /* $Id: afsnewcreds.c,v 1.1.2.7 2008/01/08 17:06:39 jaltman Exp $ */
#include
#include
***************
*** 545,550 ****
--- 545,656 ----
return ok_to_add;
}
+ static void
+ add_token_to_list(afs_cred_list * l,
+ khm_handle h_gcells,
+ HKEY hk_gcells,
+ const wchar_t * c_cell)
+ {
+ khm_size cb;
+ int i;
+ afs_cred_row * r;
+ khm_handle h_cell = NULL;
+ HKEY hk_cell = NULL;
+ wchar_t wbuf[MAXCELLCHARS];
+ wchar_t wmethod[KHUI_MAXCCH_NAME];
+
+ if (FAILED(StringCbLength(c_cell, (MAXCELLCHARS + 1) * sizeof(wchar_t),
+ &cb)))
+ return;
+ cb += sizeof(wchar_t);
+
+ for (i=0; i < l->n_rows; i++) {
+ if (!_wcsicmp(l->rows[i].cell, c_cell))
+ break;
+ }
+
+ if (i < l->n_rows)
+ return;
+
+ r = afs_cred_get_new_row(l);
+
+ r->cell = PMALLOC(cb);
+ StringCbCopy(r->cell, cb, c_cell);
+
+ if (h_gcells &&
+ KHM_SUCCEEDED(khc_open_space(h_gcells, c_cell, 0, &h_cell))) {
+
+ cb = sizeof(wmethod);
+ if (KHM_SUCCEEDED(khc_read_string(h_cell, L"MethodName",
+ wmethod, &cb))) {
+
+ r->method = afs_get_method_id(wmethod);
+
+ /* remove the deprecated value if it is present. */
+ khc_remove_value(h_cell, L"Method", 0);
+
+ } else if (KHM_SUCCEEDED(khc_read_int32(h_cell,
+ L"Method", &i))) {
+ /* the Method property is deprecated. We detect and
+ correct this whenever possible. */
+
+ if (!afs_is_valid_method_id(i))
+ i = AFS_TOKEN_AUTO;
+
+ r->method = i;
+
+ afs_get_method_name(i, wmethod, sizeof(wmethod));
+
+ khc_write_string(h_cell, L"MethodName", wmethod);
+
+ khc_remove_value(h_cell, L"Method", 0);
+ } else {
+ r->method = AFS_TOKEN_AUTO;
+ }
+
+ cb = sizeof(wbuf);
+ if (KHM_SUCCEEDED(khc_read_string(h_cell, L"Realm", wbuf, &cb)) &&
+ cb > sizeof(wchar_t)) {
+ r->realm = PMALLOC(cb);
+ StringCbCopy(r->realm, cb, wbuf);
+ } else {
+ r->realm = NULL;
+ }
+
+ khc_close_space(h_cell);
+ h_cell = NULL;
+ } else if (hk_gcells &&
+ RegOpenKeyEx(hk_gcells, c_cell, 0, KEY_READ, &hk_cell) == ERROR_SUCCESS) {
+
+ DWORD cbd;
+
+ cbd = sizeof(wmethod);
+ if (RegQueryValueEx(hk_cell, L"MethodName", NULL, NULL, (LPBYTE) wmethod, &cbd) == ERROR_SUCCESS) {
+ r->method = afs_get_method_id(wmethod);
+ } else {
+ r->method = AFS_TOKEN_AUTO;
+ }
+
+ cbd = sizeof(wbuf);
+ if (RegQueryValueEx(hk_cell, L"Realm", NULL, NULL, (LPBYTE) wbuf, &cbd) == ERROR_SUCCESS) {
+ cbd += sizeof(wchar_t);
+ r->realm = PMALLOC(cbd);
+ ZeroMemory(r->realm, cbd);
+ StringCbCopy(r->realm, cbd, wbuf);
+ } else {
+ r->realm = NULL;
+ }
+
+ RegCloseKey(hk_cell);
+
+ } else {
+ r->realm = NULL;
+ r->method = AFS_TOKEN_AUTO;
+ }
+
+ r->flags = 0;
+ }
+
void
afs_cred_get_identity_creds(afs_cred_list * l,
***************
*** 598,667 ****
s = ms;
for(s = ms; s && *s; s = multi_string_next(s)) {
! afs_cred_row * r;
! size_t cb;
! khm_handle h_cell = NULL;
!
! /* is this a valid cell name? */
! if(FAILED(StringCbLength(s, MAXCELLCHARS, &cb)))
! continue;
! cb += sizeof(wchar_t);
!
! r = afs_cred_get_new_row(l);
!
! r->cell = PMALLOC(cb);
! StringCbCopy(r->cell, cb, s);
!
! r->realm = NULL;
! r->method = AFS_TOKEN_AUTO;
! r->flags = DLGROW_FLAG_CONFIG;
!
! if(KHM_SUCCEEDED(khc_open_space(h_cells, s,
! 0, &h_cell))) {
! khm_int32 i;
! wchar_t wname[KHUI_MAXCCH_NAME];
! khm_size cb;
!
! if(khc_read_string(h_cell, L"Realm",
! NULL, &cbi) ==
! KHM_ERROR_TOO_LONG &&
! cbi > sizeof(wchar_t)) {
!
! r->realm = PMALLOC(cbi);
! khc_read_string(h_cell, L"Realm", r->realm, &cbi);
! }
!
! i = AFS_TOKEN_AUTO;
!
! cb = sizeof(wname);
! if (KHM_SUCCEEDED(khc_read_string(h_cell, L"MethodName",
! wname, &cb))) {
!
! r->method = afs_get_method_id(wname);
!
! /* remove the deprecated value if it is present. */
! khc_remove_value(h_cell, L"Method", 0);
!
! } else if (KHM_SUCCEEDED(khc_read_int32(h_cell,
! L"Method", &i))) {
! /* the Method property is deprecated. We detect and
! correct this whenever possible. */
!
! if (!afs_is_valid_method_id(i))
! i = AFS_TOKEN_AUTO;
!
! r->method = i;
!
! afs_get_method_name(i, wname, sizeof(wname));
!
! khc_write_string(h_cell, L"MethodName",
! wname);
!
! khc_remove_value(h_cell, L"Method", 0);
! }
!
! khc_close_space(h_cell);
! }
}
if(ms) {
--- 704,710 ----
s = ms;
for(s = ms; s && *s; s = multi_string_next(s)) {
! add_token_to_list(l, h_cells, NULL, s);
}
if(ms) {
***************
*** 675,685 ****
/* We want to load defaults */
char buf[MAXCELLCHARS];
wchar_t wbuf[MAXCELLCHARS];
- wchar_t wmethod[KHUI_MAXCCH_NAME];
wchar_t * defcells;
khm_size cb_defcells;
- afs_cred_row * r;
- khm_size sz;
khc_open_space(csp_params, L"Cells", 0, &h_gcells);
--- 718,725 ----
***************
*** 688,730 ****
AnsiStrToUnicode(wbuf, sizeof(wbuf), buf);
if (afs_check_add_token_to_identity(wbuf, ident, NULL)) {
! khm_handle h_cell = NULL;
!
! r = afs_cred_get_new_row(l);
!
! StringCbLength(wbuf, sizeof(wbuf), &sz);
! sz += sizeof(wchar_t);
!
! r->cell = PMALLOC(sz);
! StringCbCopy(r->cell, sz, wbuf);
!
! if (h_gcells &&
! KHM_SUCCEEDED(khc_open_space(h_gcells, wbuf, 0, &h_cell))) {
! khm_size cb;
!
! cb = sizeof(wmethod);
! if (KHM_SUCCEEDED(khc_read_string(h_cell, L"MethodName", wmethod, &cb))) {
! r->method = afs_get_method_id(wmethod);
! } else {
! r->method = AFS_TOKEN_AUTO;
! }
!
! cb = sizeof(wbuf);
! if (KHM_SUCCEEDED(khc_read_string(h_cell, L"Realm", wbuf, &cb))) {
! r->realm = PMALLOC(cb);
! StringCbCopy(r->realm, cb, wbuf);
! } else {
! r->realm = NULL;
! }
!
! khc_close_space(h_cell);
!
! } else {
! r->realm = NULL;
! r->method = AFS_TOKEN_AUTO;
! }
!
! r->flags = 0;
}
}
--- 728,734 ----
AnsiStrToUnicode(wbuf, sizeof(wbuf), buf);
if (afs_check_add_token_to_identity(wbuf, ident, NULL)) {
! add_token_to_list(l, h_gcells, NULL, wbuf);
}
}
***************
*** 746,812 ****
for (c_cell = defcells;
c_cell && *c_cell;
c_cell = multi_string_next(c_cell)) {
! khm_size cb;
! int i;
! khm_handle h_cell = NULL;
! afs_cred_row * r;
! if (FAILED(StringCbLength(c_cell, (MAXCELLCHARS + 1) * sizeof(wchar_t),
! &cb)))
continue;
- cb += sizeof(wchar_t);
! for (i=0; i < l->n_rows; i++) {
! if (!_wcsicmp(l->rows[i].cell, c_cell))
! break;
}
! if (i < l->n_rows)
! continue;
! {
! char cell[MAXCELLCHARS];
! UnicodeStrToAnsi(cell, sizeof(cell), c_cell);
! if (!afs_check_for_cell_realm_match(ident, cell))
! continue;
! }
! r = afs_cred_get_new_row(l);
! r->cell = PMALLOC(cb);
! StringCbCopy(r->cell, cb, c_cell);
! if (h_gcells &&
! KHM_SUCCEEDED(khc_open_space(h_gcells, c_cell, 0, &h_cell))) {
! cb = sizeof(wmethod);
! if (KHM_SUCCEEDED(khc_read_string(h_cell, L"MethodName", wmethod, &cb))) {
! r->method = afs_get_method_id(wmethod);
! } else {
! r->method = AFS_TOKEN_AUTO;
! }
! cb = sizeof(wbuf);
! if (KHM_SUCCEEDED(khc_read_string(h_cell, L"Realm", wbuf, &cb))) {
! r->realm = PMALLOC(cb);
! StringCbCopy(r->realm, cb, wbuf);
! } else {
! r->realm = NULL;
! }
! khc_close_space(h_cell);
! } else {
! r->realm = NULL;
! r->method = AFS_TOKEN_AUTO;
}
! r->flags = 0;
}
! PFREE(defcells);
}
}
--- 750,843 ----
for (c_cell = defcells;
c_cell && *c_cell;
c_cell = multi_string_next(c_cell)) {
+ char cell[MAXCELLCHARS];
! UnicodeStrToAnsi(cell, sizeof(cell), c_cell);
! if (!afs_check_for_cell_realm_match(ident, cell))
continue;
! add_token_to_list(l, h_gcells, NULL, c_cell);
}
! PFREE(defcells);
! }
! /* Check HKLM\Software\OpenAFS\Client\Realms\ registry key as well */
! {
! wchar_t idname[KCDB_IDENT_MAXCCH_NAME];
! wchar_t * realm;
! wchar_t * cell=NULL;
! khm_size cb;
! HKEY hk_realms = NULL, hk_realm = NULL;
! cb = sizeof(idname);
! kcdb_identity_get_name(ident, idname, &cb);
! realm = wcsrchr(idname, L'@');
! if (realm == NULL || realm[1] == L'\0')
! goto _done_realms;
! realm++;
! if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"SOFTWARE\\OpenAFS\\Client\\Realms", 0, KEY_READ, &hk_realms) != ERROR_SUCCESS)
! goto _done_realms;
! if (RegOpenKeyEx(hk_realms, realm, 0, KEY_READ, &hk_realm) != ERROR_SUCCESS)
! goto _done_realms;
! if (penabled) {
! DWORD enabled = 1;
! DWORD cbd;
! cbd = sizeof(enabled);
! if (RegQueryValueEx(hk_realm, L"AFSEnabled",
! NULL, NULL, (LPBYTE) &enabled, &cbd) == ERROR_SUCCESS) {
! *penabled = !!enabled;
}
+ }
+
+ {
+ DWORD dwNumCells=0, dwMaxCellLen=0, dwIndex, dwCellBufSz;
+
+ RegQueryInfoKey( hk_realm,
+ NULL, /* lpClass */
+ NULL, /* lpcClass */
+ NULL, /* lpReserved */
+ &dwNumCells, /* lpcSubKeys */
+ &dwMaxCellLen, /* lpcMaxSubKeyLen */
+ NULL, /* lpcMaxClassLen */
+ NULL, /* lpcValues */
+ NULL, /* lpcMaxValueNameLen */
+ NULL, /* lpcMaxValueLen */
+ NULL, /* lpcbSecurityDescriptor */
+ NULL /* lpftLastWriteTime */
+ );
+
+ dwCellBufSz = (dwMaxCellLen + 1) * sizeof(wchar_t);
+ cell = PMALLOC(dwCellBufSz);
+ ZeroMemory(cell, dwCellBufSz);
! for ( dwIndex=0; dwIndex < dwNumCells; dwIndex++ ) {
! if (RegEnumKey( hk_realm, dwIndex, cell, dwCellBufSz) != ERROR_SUCCESS)
! goto _done_realms;
!
! if (afs_check_add_token_to_identity(cell, ident, NULL))
! add_token_to_list(l, NULL, hk_realm, cell);
! }
}
! _done_realms:
!
! if (hk_realm)
! RegCloseKey(hk_realm);
!
! if (hk_realms)
! RegCloseKey(hk_realms);
!
! if (cell)
! PFREE(cell);
}
}
Index: openafs/src/afs/afs_call.c
diff -c openafs/src/afs/afs_call.c:1.86.4.19 openafs/src/afs/afs_call.c:1.86.4.20
*** openafs/src/afs/afs_call.c:1.86.4.19 Mon Dec 10 17:42:30 2007
--- openafs/src/afs/afs_call.c Wed Jan 30 16:05:47 2008
***************
*** 11,17 ****
#include "afs/param.h"
RCSID
! ("$Header: /cvs/openafs/src/afs/afs_call.c,v 1.86.4.19 2007/12/10 22:42:30 shadow Exp $");
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
--- 11,17 ----
#include "afs/param.h"
RCSID
! ("$Header: /cvs/openafs/src/afs/afs_call.c,v 1.86.4.20 2008/01/30 21:05:47 shadow Exp $");
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
***************
*** 540,545 ****
--- 540,546 ----
#endif /* RXK_LISTENER_ENV */
afs_osi_Invisible();
afs_RXCallBackServer();
+ afs_osi_Visible();
}
#ifdef AFS_SGI_ENV
AFS_GUNLOCK();
***************
*** 568,573 ****
--- 569,575 ----
afs_osi_RxkRegister();
#endif /* !UKERNEL */
rxk_Listener();
+ afs_osi_Visible();
}
#ifdef AFS_SGI_ENV
AFS_GUNLOCK();
***************
*** 587,592 ****
--- 589,595 ----
afs_osi_Wakeup(&afs_initState);
afs_osi_Invisible();
afs_Daemon();
+ afs_osi_Visible();
#ifdef AFS_SGI_ENV
AFS_GUNLOCK();
exit(CLD_EXITED, 0);
***************
*** 594,599 ****
--- 597,603 ----
} else if (parm == AFSOP_START_CS) {
afs_osi_Invisible();
afs_CheckServerDaemon();
+ afs_osi_Visible();
#ifdef AFS_SGI_ENV
AFS_GUNLOCK();
exit(CLD_EXITED, 0);
***************
*** 613,618 ****
--- 617,623 ----
else
#endif /* AFS_AIX32_ENV */
afs_BackgroundDaemon();
+ afs_osi_Visible();
#ifdef AFS_SGI_ENV
AFS_GUNLOCK();
exit(CLD_EXITED, 0);
***************
*** 623,628 ****
--- 628,634 ----
/* start the bkg daemon */
afs_osi_Invisible();
afs_CacheTruncateDaemon();
+ afs_osi_Visible();
#ifdef AFS_SGI_ENV
AFS_GUNLOCK();
exit(CLD_EXITED, 0);
***************
*** 634,639 ****
--- 640,646 ----
afs_osi_Sleep(&afs_initState);
afs_osi_Invisible();
afs_rxevent_daemon();
+ afs_osi_Visible();
#ifdef AFS_SGI_ENV
AFS_GUNLOCK();
exit(CLD_EXITED, 0);
Index: openafs/src/afs/afs_cell.c
diff -c openafs/src/afs/afs_cell.c:1.34.4.6 openafs/src/afs/afs_cell.c:1.34.4.7
*** openafs/src/afs/afs_cell.c:1.34.4.6 Tue Dec 4 15:31:07 2007
--- openafs/src/afs/afs_cell.c Sun Jan 27 20:39:18 2008
***************
*** 14,20 ****
#include "afs/param.h"
RCSID
! ("$Header: /cvs/openafs/src/afs/afs_cell.c,v 1.34.4.6 2007/12/04 20:31:07 shadow Exp $");
#include "afs/stds.h"
#include "afs/sysincludes.h" /* Standard vendor system headers */
--- 14,20 ----
#include "afs/param.h"
RCSID
! ("$Header: /cvs/openafs/src/afs/afs_cell.c,v 1.34.4.7 2008/01/28 01:39:18 shadow Exp $");
#include "afs/stds.h"
#include "afs/sysincludes.h" /* Standard vendor system headers */
***************
*** 158,170 ****
ObtainReadLock(&afsdb_req_lock);
};
- afs_osi_FreeStr(afsdb_req.cellname);
ReleaseReadLock(&afsdb_req_lock);
ReleaseWriteLock(&afsdb_client_lock);
! if (afsdb_req.cellname)
return 0;
! else
return ENOENT;
}
#endif
--- 158,169 ----
ObtainReadLock(&afsdb_req_lock);
};
ReleaseReadLock(&afsdb_req_lock);
ReleaseWriteLock(&afsdb_client_lock);
! if (afsdb_req.cellname) {
return 0;
! } else
return ENOENT;
}
#endif
Index: openafs/src/afs/afs_osi.c
diff -c openafs/src/afs/afs_osi.c:1.58.2.4 openafs/src/afs/afs_osi.c:1.58.2.6
*** openafs/src/afs/afs_osi.c:1.58.2.4 Thu Dec 28 16:49:33 2006
--- openafs/src/afs/afs_osi.c Tue Feb 5 20:32:13 2008
***************
*** 11,17 ****
#include "afs/param.h"
RCSID
! ("$Header: /cvs/openafs/src/afs/afs_osi.c,v 1.58.2.4 2006/12/28 21:49:33 shadow Exp $");
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
--- 11,17 ----
#include "afs/param.h"
RCSID
! ("$Header: /cvs/openafs/src/afs/afs_osi.c,v 1.58.2.6 2008/02/06 01:32:13 shadow Exp $");
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
***************
*** 177,185 ****
void
afs_osi_RxkRegister(void)
{
- #ifdef AFS_LINUX22_ENV
- osi_linux_rxkreg();
- #endif
}
/* procedure for making our processes as invisible as we can */
--- 177,182 ----
***************
*** 205,210 ****
--- 202,220 ----
AFS_STATCNT(osi_Invisible);
}
+ void
+ afs_osi_Visible(void)
+ {
+ #if defined(AFS_SUN5_ENV)
+ curproc->p_flag &= ~SSYS;
+ #elif defined(AFS_DARWIN80_ENV)
+ #elif defined(AFS_DARWIN_ENV)
+ /* maybe call init_process instead? */
+ current_proc()->p_flag &= ~P_SYSTEM;
+ #elif defined(AFS_XBSD_ENV)
+ curproc->p_flag &= ~P_SYSTEM;
+ #endif
+ }
#if !defined(AFS_LINUX20_ENV) && !defined(AFS_FBSD_ENV)
/* set the real time */
Index: openafs/src/afs/afs_prototypes.h
diff -c openafs/src/afs/afs_prototypes.h:1.74.2.10 openafs/src/afs/afs_prototypes.h:1.74.2.13
*** openafs/src/afs/afs_prototypes.h:1.74.2.10 Fri Nov 23 09:32:56 2007
--- openafs/src/afs/afs_prototypes.h Sun Feb 10 23:00:47 2008
***************
*** 499,504 ****
--- 499,505 ----
/* afs_osi.c */
extern afs_lock_t afs_ftf;
extern void afs_osi_Invisible(void);
+ extern void afs_osi_Visible(void);
extern void afs_osi_RxkRegister(void);
extern void afs_osi_MaskSignals(void);
extern void afs_osi_UnmaskRxkSignals(void);
***************
*** 591,597 ****
#endif
extern void osi_linux_mask(void);
extern void osi_linux_unmask(void);
- extern void osi_linux_rxkreg(void);
extern int setpag(cred_t ** cr, afs_uint32 pagvalue, afs_uint32 * newpag,
int change_parent);
#endif
--- 592,597 ----
***************
*** 850,855 ****
--- 850,858 ----
#ifndef afs_strchr
extern char *afs_strchr(char *s, int c);
#endif
+ #ifndef afs_strrchr
+ extern char *afs_strrchr(char *s, int c);
+ #endif
extern char *afs_strdup(char *s);
extern void print_internet_address(char *preamble, struct srvAddr *sa,
char *postamble, int flag);
Index: openafs/src/afs/afs_util.c
diff -c openafs/src/afs/afs_util.c:1.28.2.6 openafs/src/afs/afs_util.c:1.28.2.7
*** openafs/src/afs/afs_util.c:1.28.2.6 Thu Jul 26 13:05:40 2007
--- openafs/src/afs/afs_util.c Sun Feb 10 23:00:47 2008
***************
*** 16,22 ****
#include "afs/param.h"
RCSID
! ("$Header: /cvs/openafs/src/afs/afs_util.c,v 1.28.2.6 2007/07/26 17:05:40 shadow Exp $");
#include "afs/stds.h"
#include "afs/sysincludes.h" /* Standard vendor system headers */
--- 16,22 ----
#include "afs/param.h"
RCSID
! ("$Header: /cvs/openafs/src/afs/afs_util.c,v 1.28.2.7 2008/02/11 04:00:47 shadow Exp $");
#include "afs/stds.h"
#include "afs/sysincludes.h" /* Standard vendor system headers */
***************
*** 136,141 ****
--- 136,154 ----
return NULL;
}
#endif
+ #ifndef afs_strrchr
+ char *
+ afs_strrchr(char *s, int c)
+ {
+ char *p = NULL;
+
+ do {
+ if (*s == c)
+ p = (char*) s;
+ } while (*s++);
+ return p;
+ }
+ #endif
char *
afs_strdup(char *s)
Index: openafs/src/afs/DARWIN/osi_vnodeops.c
diff -c openafs/src/afs/DARWIN/osi_vnodeops.c:1.41.2.10 openafs/src/afs/DARWIN/osi_vnodeops.c:1.41.2.11
*** openafs/src/afs/DARWIN/osi_vnodeops.c:1.41.2.10 Tue Nov 27 15:02:35 2007
--- openafs/src/afs/DARWIN/osi_vnodeops.c Sun Feb 10 23:00:48 2008
***************
*** 5,11 ****
#include
RCSID
! ("$Header: /cvs/openafs/src/afs/DARWIN/osi_vnodeops.c,v 1.41.2.10 2007/11/27 20:02:35 shadow Exp $");
#include /* Standard vendor system headers */
#include /* Afs-based standard headers */
--- 5,11 ----
#include
RCSID
! ("$Header: /cvs/openafs/src/afs/DARWIN/osi_vnodeops.c,v 1.41.2.11 2008/02/11 04:00:48 shadow Exp $");
#include /* Standard vendor system headers */
#include /* Afs-based standard headers */
***************
*** 1420,1427 ****
#if !defined(AFS_DARWIN80_ENV)
VOP_UNLOCK(fvp, 0, p);
#endif
! FREE(fname, M_TEMP);
! FREE(tname, M_TEMP);
#ifdef AFS_DARWIN80_ENV
cache_purge(fdvp);
cache_purge(fvp);
--- 1420,1437 ----
#if !defined(AFS_DARWIN80_ENV)
VOP_UNLOCK(fvp, 0, p);
#endif
! #ifdef notdef
! if (error == EXDEV) {
! /* The idea would be to have a userspace handler like afsdb to
! * run mv as the user, thus:
! */
! printf("su %d -c /bin/mv /afs/.:mount/%d:%d:%d:%d/%s /afs/.:mount/%d:%d:%d:%d/%s\n",
! (cn_cred(tcnp))->cr_uid, fvc->fid.Cell, fvc->fid.Fid.Volume,
! fvc->fid.Fid.Vnode, fvc->fid.Fid.Unique, fname,
! tvc->fid.Cell, tvc->fid.Fid.Volume, tvc->fid.Fid.Vnode,
! tvc->fid.Fid.Unique, tname);
! }
! #endif
#ifdef AFS_DARWIN80_ENV
cache_purge(fdvp);
cache_purge(fvp);
***************
*** 1446,1451 ****
--- 1456,1463 ----
vrele(fdvp);
vrele(fvp);
#endif
+ FREE(fname, M_TEMP);
+ FREE(tname, M_TEMP);
return error;
}
Index: openafs/src/afs/FBSD/osi_vnodeops.c
diff -c openafs/src/afs/FBSD/osi_vnodeops.c:1.22 openafs/src/afs/FBSD/osi_vnodeops.c:1.22.6.1
*** openafs/src/afs/FBSD/osi_vnodeops.c:1.22 Fri Apr 29 17:55:58 2005
--- openafs/src/afs/FBSD/osi_vnodeops.c Tue Jan 15 01:09:11 2008
***************
*** 48,54 ****
#include
RCSID
! ("$Header: /cvs/openafs/src/afs/FBSD/osi_vnodeops.c,v 1.22 2005/04/29 21:55:58 rees Exp $");
#include /* Standard vendor system headers */
#include /* Afs-based standard headers */
--- 48,54 ----
#include
RCSID
! ("$Header: /cvs/openafs/src/afs/FBSD/osi_vnodeops.c,v 1.22.6.1 2008/01/15 06:09:11 shadow Exp $");
#include /* Standard vendor system headers */
#include /* Afs-based standard headers */
***************
*** 746,752 ****
--- 746,756 ----
* now tell them that it is ok to use.
*/
if (!code) {
+ #if defined(AFS_FBSD70_ENV)
+ if(0) /* XXXX fixme for 7.0 */
+ #else
if (m->flags & PG_WANTED)
+ #endif
vm_page_activate(m);
else
vm_page_deactivate(m);
Index: openafs/src/afs/LINUX/osi_groups.c
diff -c openafs/src/afs/LINUX/osi_groups.c:1.28.4.8 openafs/src/afs/LINUX/osi_groups.c:1.28.4.11
*** openafs/src/afs/LINUX/osi_groups.c:1.28.4.8 Wed Aug 22 15:39:03 2007
--- openafs/src/afs/LINUX/osi_groups.c Wed Jan 30 12:30:41 2008
***************
*** 20,26 ****
#endif
RCSID
! ("$Header: /cvs/openafs/src/afs/LINUX/osi_groups.c,v 1.28.4.8 2007/08/22 19:39:03 shadow Exp $");
#include "afs/sysincludes.h"
#include "afsincludes.h"
--- 20,26 ----
#endif
RCSID
! ("$Header: /cvs/openafs/src/afs/LINUX/osi_groups.c,v 1.28.4.11 2008/01/30 17:30:41 shadow Exp $");
#include "afs/sysincludes.h"
#include "afsincludes.h"
***************
*** 223,229 ****
--- 223,233 ----
}
#ifdef LINUX_KEYRING_SUPPORT
+ #ifdef EXPORTS_KEY_TYPE_KEYRING
+ static struct key_type *__key_type_keyring = &key_type_keyring;
+ #else
static struct key_type *__key_type_keyring;
+ #endif
static int
install_session_keyring(struct task_struct *task, struct key *keyring)
***************
*** 623,628 ****
--- 627,633 ----
void osi_keyring_init(void)
{
+ #ifndef EXPORTS_KEY_TYPE_KEYRING
struct task_struct *p;
#ifdef EXPORTED_TASKLIST_LOCK
if (&tasklist_lock)
***************
*** 647,652 ****
--- 652,658 ----
#endif
rcu_read_unlock();
#endif
+ #endif
register_key_type(&key_type_afs_pag);
}
Index: openafs/src/afs/LINUX/osi_misc.c
diff -c openafs/src/afs/LINUX/osi_misc.c:1.44.4.3 openafs/src/afs/LINUX/osi_misc.c:1.44.4.4
*** openafs/src/afs/LINUX/osi_misc.c:1.44.4.3 Mon Jul 31 17:27:39 2006
--- openafs/src/afs/LINUX/osi_misc.c Wed Jan 30 12:26:01 2008
***************
*** 15,21 ****
#include "afs/param.h"
RCSID
! ("$Header: /cvs/openafs/src/afs/LINUX/osi_misc.c,v 1.44.4.3 2006/07/31 21:27:39 shadow Exp $");
#include /* early to avoid printf->printk mapping */
#include "afs/sysincludes.h"
--- 15,21 ----
#include "afs/param.h"
RCSID
! ("$Header: /cvs/openafs/src/afs/LINUX/osi_misc.c,v 1.44.4.4 2008/01/30 17:26:01 shadow Exp $");
#include /* early to avoid printf->printk mapping */
#include "afs/sysincludes.h"
***************
*** 65,72 ****
#endif
}
- struct task_struct *rxk_ListenerTask;
-
void
osi_linux_mask(void)
{
--- 65,70 ----
***************
*** 76,88 ****
SIG_UNLOCK(current);
}
- void
- osi_linux_rxkreg(void)
- {
- rxk_ListenerTask = current;
- }
-
-
#if defined(AFS_LINUX24_ENV)
/* LOOKUP_POSITIVE is becoming the default */
#ifndef LOOKUP_POSITIVE
--- 74,79 ----
Index: openafs/src/afs/SOLARIS/osi_vfsops.c
diff -c openafs/src/afs/SOLARIS/osi_vfsops.c:1.18.14.4 openafs/src/afs/SOLARIS/osi_vfsops.c:1.18.14.5
*** openafs/src/afs/SOLARIS/osi_vfsops.c:1.18.14.4 Thu Nov 1 12:57:37 2007
--- openafs/src/afs/SOLARIS/osi_vfsops.c Mon Jan 21 12:37:30 2008
***************
*** 14,20 ****
#include "afs/param.h"
RCSID
! ("$Header: /cvs/openafs/src/afs/SOLARIS/osi_vfsops.c,v 1.18.14.4 2007/11/01 16:57:37 shadow Exp $");
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
--- 14,20 ----
#include "afs/param.h"
RCSID
! ("$Header: /cvs/openafs/src/afs/SOLARIS/osi_vfsops.c,v 1.18.14.5 2008/01/21 17:37:30 shadow Exp $");
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
***************
*** 103,108 ****
--- 103,109 ----
register afs_int32 code = 0;
struct vrequest treq;
register struct vcache *tvp = 0;
+ struct vcache *gvp;
struct proc *proc = ttoproc(curthread);
struct vnode *vp = afsp->vfs_vnodecovered;
int locked = 0;
***************
*** 118,123 ****
--- 119,125 ----
AFS_STATCNT(afs_root);
+ again:
if (afs_globalVp && (afs_globalVp->states & CStatd)) {
tvp = afs_globalVp;
} else {
***************
*** 128,135 ****
}
if (afs_globalVp) {
! afs_PutVCache(afs_globalVp);
afs_globalVp = NULL;
}
if (!(code = afs_InitReq(&treq, proc->p_cred))
--- 130,138 ----
}
if (afs_globalVp) {
! gvp = afs_globalVp;
afs_globalVp = NULL;
+ afs_PutVCache(gvp);
}
if (!(code = afs_InitReq(&treq, proc->p_cred))
***************
*** 137,142 ****
--- 140,151 ----
tvp = afs_GetVCache(&afs_rootFid, &treq, NULL, NULL);
/* we really want this to stay around */
if (tvp) {
+ if (afs_globalVp) {
+ /* someone else got there before us! */
+ afs_PutVCache(tvp);
+ tvp = 0;
+ goto again;
+ }
afs_globalVp = tvp;
} else
code = ENOENT;
Index: openafs/src/afs/UKERNEL/afs_usrops.c
diff -c openafs/src/afs/UKERNEL/afs_usrops.c:1.30.6.6 openafs/src/afs/UKERNEL/afs_usrops.c:1.30.6.7
*** openafs/src/afs/UKERNEL/afs_usrops.c:1.30.6.6 Mon Nov 26 16:08:40 2007
--- openafs/src/afs/UKERNEL/afs_usrops.c Thu Jan 31 15:18:36 2008
***************
*** 15,21 ****
#include "afs/param.h"
RCSID
! ("$Header: /cvs/openafs/src/afs/UKERNEL/afs_usrops.c,v 1.30.6.6 2007/11/26 21:08:40 shadow Exp $");
#ifdef UKERNEL
--- 15,21 ----
#include "afs/param.h"
RCSID
! ("$Header: /cvs/openafs/src/afs/UKERNEL/afs_usrops.c,v 1.30.6.7 2008/01/31 20:18:36 shadow Exp $");
#ifdef UKERNEL
***************
*** 1004,1009 ****
--- 1004,1015 ----
return;
}
+ void
+ afs_osi_Visible(void)
+ {
+ return;
+ }
+
int
osi_GetTime(struct timeval *tv)
{
Index: openafs/src/afs/VNOPS/afs_vnop_lookup.c
diff -c openafs/src/afs/VNOPS/afs_vnop_lookup.c:1.72.2.3 openafs/src/afs/VNOPS/afs_vnop_lookup.c:1.72.2.4
*** openafs/src/afs/VNOPS/afs_vnop_lookup.c:1.72.2.3 Mon Jul 31 17:27:40 2006
--- openafs/src/afs/VNOPS/afs_vnop_lookup.c Sun Feb 10 23:00:49 2008
***************
*** 18,24 ****
#include "afs/param.h"
RCSID
! ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_lookup.c,v 1.72.2.3 2006/07/31 21:27:40 shadow Exp $");
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
--- 18,24 ----
#include "afs/param.h"
RCSID
! ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_lookup.c,v 1.72.2.4 2008/02/11 04:00:49 shadow Exp $");
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
***************
*** 57,63 ****
static int
EvalMountData(char type, char *data, afs_uint32 states, afs_uint32 cellnum,
struct volume **avolpp, register struct vrequest *areq,
! afs_uint32 *acellidxp, afs_uint32 *avolnump)
{
struct volume *tvp = 0;
struct VenusFid tfid;
--- 57,63 ----
static int
EvalMountData(char type, char *data, afs_uint32 states, afs_uint32 cellnum,
struct volume **avolpp, register struct vrequest *areq,
! afs_uint32 *acellidxp, afs_uint32 *avolnump, afs_uint32 *avnoidp)
{
struct volume *tvp = 0;
struct VenusFid tfid;
***************
*** 67,79 ****
afs_int32 prefetch; /* 1=>None 2=>RO 3=>BK */
afs_int32 mtptCell, assocCell = 0, hac = 0;
afs_int32 samecell, roname, len;
! afs_uint32 volid, cellidx;
cpos = afs_strchr(data, ':'); /* if cell name present */
if (cpos) {
volnamep = cpos + 1;
*cpos = 0;
! tcell = afs_GetCellByName(data, READ_LOCK);
*cpos = ':';
} else if (cellnum) {
volnamep = data;
--- 67,87 ----
afs_int32 prefetch; /* 1=>None 2=>RO 3=>BK */
afs_int32 mtptCell, assocCell = 0, hac = 0;
afs_int32 samecell, roname, len;
! afs_uint32 volid, cellidx, vnoid = 0;
cpos = afs_strchr(data, ':'); /* if cell name present */
if (cpos) {
+ cellnum = 0;
volnamep = cpos + 1;
*cpos = 0;
! for (x = data; *x >= '0' && *x <= '9'; x++)
! cellnum = (cellnum * 10) + (*x - '0');
! if (cellnum && !*x)
! tcell = afs_GetCell(cellnum, READ_LOCK);
! else {
! tcell = afs_GetCellByName(data, READ_LOCK);
! cellnum = 0;
! }
*cpos = ':';
} else if (cellnum) {
volnamep = data;
***************
*** 92,101 ****
--- 100,121 ----
}
afs_PutCell(tcell, READ_LOCK);
+ cpos = afs_strrchr(volnamep, ':'); /* if vno present */
+ if (cpos)
+ *cpos = 0;
/* Look for an all-numeric volume ID */
volid = 0;
for (x = volnamep; *x >= '0' && *x <= '9'; x++)
volid = (volid * 10) + (*x - '0');
+ if (cpos) {
+ *cpos = ':';
+ vnoid = 0;
+ if (!*x) /* allow vno with numeric volid only */
+ for (x = (cpos + 1); *x >= '0' && *x <= '9'; x++)
+ vnoid = (vnoid * 10) + (*x - '0');
+ if (*x)
+ vnoid = 0;
+ }
/*
* If the volume ID was all-numeric, and they didn't ask for a
***************
*** 108,113 ****
--- 128,135 ----
*acellidxp = cellidx;
if (avolnump)
*avolnump = volid;
+ if (avnoidp)
+ *avnoidp = vnoid;
return 0;
}
***************
*** 221,226 ****
--- 243,250 ----
*acellidxp = cellidx;
if (avolnump)
*avolnump = tvp->volume;
+ if (avnoidp)
+ *avnoidp = vnoid;
if (avolpp)
*avolpp = tvp;
else
***************
*** 233,238 ****
--- 257,263 ----
struct volume **avolpp, register struct vrequest *areq)
{
afs_int32 code;
+ afs_uint32 avnoid;
AFS_STATCNT(EvalMountPoint);
#ifdef notdef
***************
*** 246,260 ****
/* Determine which cell and volume the mointpoint goes to */
code = EvalMountData(avc->linkData[0], avc->linkData + 1,
! avc->states, avc->fid.Cell, avolpp, areq, 0, 0);
if (code) return code;
if (avc->mvid == 0)
avc->mvid =
(struct VenusFid *)osi_AllocSmallSpace(sizeof(struct VenusFid));
avc->mvid->Cell = (*avolpp)->cell;
avc->mvid->Fid.Volume = (*avolpp)->volume;
! avc->mvid->Fid.Vnode = 1;
avc->mvid->Fid.Unique = 1;
avc->states |= CMValid;
--- 271,289 ----
/* Determine which cell and volume the mointpoint goes to */
code = EvalMountData(avc->linkData[0], avc->linkData + 1,
! avc->states, avc->fid.Cell, avolpp, areq, 0, 0,
! &avnoid);
if (code) return code;
+ if (!avnoid)
+ avnoid = 1;
+
if (avc->mvid == 0)
avc->mvid =
(struct VenusFid *)osi_AllocSmallSpace(sizeof(struct VenusFid));
avc->mvid->Cell = (*avolpp)->cell;
avc->mvid->Fid.Volume = (*avolpp)->volume;
! avc->mvid->Fid.Vnode = avnoid;
avc->mvid->Fid.Unique = 1;
avc->states |= CMValid;
***************
*** 1334,1342 ****
*/
if (afs_IsDynrootMount(adp)) {
struct VenusFid tfid;
! afs_uint32 cellidx, volid;
! code = EvalMountData('%', aname, 0, 0, NULL, &treq, &cellidx, &volid);
if (code)
goto done;
afs_GetDynrootMountFid(&tfid);
--- 1363,1371 ----
*/
if (afs_IsDynrootMount(adp)) {
struct VenusFid tfid;
! afs_uint32 cellidx, volid, vnoid;
! code = EvalMountData('%', aname, 0, 0, NULL, &treq, &cellidx, &volid, &vnoid);
if (code)
goto done;
afs_GetDynrootMountFid(&tfid);
Index: openafs/src/afsd/afs.rc.darwin
diff -c openafs/src/afsd/afs.rc.darwin:1.8 openafs/src/afsd/afs.rc.darwin:1.8.2.1
*** openafs/src/afsd/afs.rc.darwin:1.8 Tue Feb 14 19:37:28 2006
--- openafs/src/afsd/afs.rc.darwin Mon Jan 21 15:57:23 2008
***************
*** 36,54 ****
if [ -x /usr/sbin/kextstat ]; then KMODSTAT=/usr/sbin/kextstat; fi
if [ -x /usr/sbin/kmodstat ]; then KMODSTAT=/usr/sbin/kmodstat; fi
StartService()
{
echo "Starting OpenAFS"
! if [ -f $AFSDOPT ]; then
! OPTIONS=`cat $AFSDOPT`
else
! OPTIONS="$MEDIUM -fakestat"
fi
if [ "${NETWORKUP}" = "-NO-" ]; then
! echo $OPTIONS | grep -e '-dynroot' || exit
fi
# Need the commands ps, awk, kill, sleep
--- 36,63 ----
if [ -x /usr/sbin/kextstat ]; then KMODSTAT=/usr/sbin/kextstat; fi
if [ -x /usr/sbin/kmodstat ]; then KMODSTAT=/usr/sbin/kmodstat; fi
+ if [ -f $CONFIG/afs.conf ]; then
+ . $CONFIG/afs.conf
+ fi
+
+ # Check this file second so that if users have altered the file, it will
+ # override the default options
+ if [ -f $AFSDOPT ]; then
+ OPTIONS=`cat $AFSDOPT`
+ fi
StartService()
{
echo "Starting OpenAFS"
! if [ -z "$OPTIONS" ] || [ "$OPTIONS" = "AUTOMATIC" ] ; then
! AFSD_OPTIONS="$VERBOSE"
else
! AFSD_OPTIONS="$OPTIONS $VERBOSE"
fi
if [ "${NETWORKUP}" = "-NO-" ]; then
! echo $AFSD_OPTIONS | grep -e '-dynroot' || exit
fi
# Need the commands ps, awk, kill, sleep
***************
*** 76,82 ****
if [ -x /usr/afs/bin/bosserver ]; then
echo "Starting AFS Server processes"
/usr/afs/bin/bosserver
! OPTIONS="$OPTIONS -nosettime"
sleep 30
fi
--- 85,91 ----
if [ -x /usr/afs/bin/bosserver ]; then
echo "Starting AFS Server processes"
/usr/afs/bin/bosserver
! AFSD_OPTIONS="$AFSD_OPTIONS -nosettime"
sleep 30
fi
***************
*** 107,113 ****
done
echo "Starting afsd"
! $AFSD $OPTIONS
#
# Call afssettings (if it exists) to set customizable parameters
--- 116,128 ----
done
echo "Starting afsd"
! $AFSD $AFSD_OPTIONS
!
! #
! # From /var/db/openafs/etc/config/afs.conf, call a post-init function or
! # command if it's been defined
! #
! $AFS_POST_INIT
#
# Call afssettings (if it exists) to set customizable parameters
***************
*** 118,123 ****
--- 133,146 ----
fi
#
+ # From /var/db/openafs/etc/config/afs.conf, set a sysname list if one was
+ # configured.
+ #
+ if [ -n "$AFS_SYSNAME" ] ; then
+ fs sysname $AFS_SYSNAME
+ fi
+
+ #
# Run package to update the disk
#
if [ -f /usr/afsws/etc/package -a -f $PACKAGE ]; then
***************
*** 151,156 ****
--- 174,185 ----
{
echo "Stopping AFS"
+ #
+ # If a pre-shutdown function was defined in /var/db/openafs/etc/config/afs.conf
+ # was defined, then run it
+ #
+ $AFS_PRE_SHUTDOWN
+
if $KMODSTAT | perl -e 'exit not grep /openafs/, <>' ; then
echo "Unmounting /afs"
umount -f /afs 2>&1 > /dev/console
Index: openafs/src/afsd/afs.rc.linux
diff -c openafs/src/afsd/afs.rc.linux:1.12 openafs/src/afsd/afs.rc.linux:1.12.4.1
*** openafs/src/afsd/afs.rc.linux:1.12 Sun Oct 2 23:13:26 2005
--- openafs/src/afsd/afs.rc.linux Mon Jan 21 16:04:53 2008
***************
*** 58,64 ****
echo
}
! SYSCNF=/etc/sysconfig/afs
KERNEL_VERSION=`uname -r`
# Gather up options and post startup script name, if present
--- 58,64 ----
echo
}
! SYSCNF=${SYSCNF:-/etc/sysconfig/afs}
KERNEL_VERSION=`uname -r`
# Gather up options and post startup script name, if present
***************
*** 69,74 ****
--- 69,78 ----
CACHEINFO=${CACHEINFO:-/usr/vice/etc/cacheinfo}
CACHE=${CACHEDIR:-/usr/vice/cache}
AFS=${AFSDIR:-/afs}
+ AFSD=${AFSD:-/usr/vice/etc/afsd}
+ BOSSERVER=${BOSSERVER:-/usr/afs/bin/bosserver}
+ BOS=${BOS:-/usr/bin/bos}
+ KILLAFS=${KILLAFS:-/usr/vice/etc/killafs}
# is_on returns 1 if value of arg is "on"
is_on() {
***************
*** 183,189 ****
esac
}
! MODLOADDIR=/usr/vice/etc/modload
# load_client loads the AFS client module if it's not already loaded.
load_client() {
# If LIBAFS is set, use it.
--- 187,193 ----
esac
}
! MODLOADDIR=${MODLOADDIR:-/usr/vice/etc/modload}
# load_client loads the AFS client module if it's not already loaded.
load_client() {
# If LIBAFS is set, use it.
***************
*** 279,291 ****
echo "Starting AFS services..... "
# Start bosserver, it if exists
! if is_on $AFS_SERVER && test -x /usr/afs/bin/bosserver ; then
! /usr/afs/bin/bosserver
test "$afs_rh" && touch /var/lock/subsys/afs
if is_on $WAIT_FOR_SALVAGE; then
# wait for fileserver to finish salvaging
sleep 10
! while /usr/bin/bos status localhost fs 2>&1 | grep 'Auxiliary.*salvaging'; do
echo "Waiting for salvager to finish..... "
sleep 10
done
--- 283,295 ----
echo "Starting AFS services..... "
# Start bosserver, it if exists
! if is_on $AFS_SERVER && test -x $BOSSERVER ; then
! $BOSSERVER
test "$afs_rh" && touch /var/lock/subsys/afs
if is_on $WAIT_FOR_SALVAGE; then
# wait for fileserver to finish salvaging
sleep 10
! while $BOS status localhost fs 2>&1 | grep 'Auxiliary.*salvaging'; do
echo "Waiting for salvager to finish..... "
sleep 10
done
***************
*** 293,302 ****
fi
# Start AFS client
! if is_on $AFS_CLIENT && test -x /usr/vice/etc/afsd ; then
generate_cacheinfo
choose_afsdoptions
! /usr/vice/etc/afsd ${AFSD_OPTIONS}
test "$afs_rh" && touch /var/lock/subsys/afs
$AFS_POST_INIT
fi
--- 297,306 ----
fi
# Start AFS client
! if is_on $AFS_CLIENT && test -x $AFSD ; then
generate_cacheinfo
choose_afsdoptions
! $AFSD ${AFSD_OPTIONS}
test "$afs_rh" && touch /var/lock/subsys/afs
$AFS_POST_INIT
fi
***************
*** 309,324 ****
echo "Stopping AFS services..... "
if is_on $AFS_CLIENT ; then
! if [ -x /usr/vice/etc/killafs ] ; then
! runcmd "Sending all processes using /afs the TERM signal ..." /usr/vice/etc/killafs TERM
! runcmd "Sending all processes using /afs the KILL signal ..." /usr/vice/etc/killafs KILL
fi
umount /afs
fi
! if is_on $AFS_SERVER && test -x /usr/bin/bos ; then
echo "Stopping AFS bosserver"
! /usr/bin/bos shutdown localhost -localauth -wait
killall -HUP bosserver
fi
--- 313,328 ----
echo "Stopping AFS services..... "
if is_on $AFS_CLIENT ; then
! if [ -x $KILLAFS ] ; then
! runcmd "Sending all processes using /afs the TERM signal ..." $KILLAFS TERM
! runcmd "Sending all processes using /afs the KILL signal ..." $KILLAFS KILL
fi
umount /afs
fi
! if is_on $AFS_SERVER && test -x $BOS ; then
echo "Stopping AFS bosserver"
! $BOS shutdown localhost -localauth -wait
killall -HUP bosserver
fi
Index: openafs/src/auth/NTMakefile
diff -c openafs/src/auth/NTMakefile:1.10.4.2 openafs/src/auth/NTMakefile:1.10.4.3
*** openafs/src/auth/NTMakefile:1.10.4.2 Mon Jul 2 20:35:14 2007
--- openafs/src/auth/NTMakefile Sat Feb 2 08:43:23 2008
***************
*** 85,91 ****
$(SETKEY_EXEFILE): $(SETKEY_EXEOBJS) $(EXELIBS)
! $(EXECONLINK) dnsapi.lib
$(_VC_MANIFEST_EMBED_EXE)
$(EXEPREP)
--- 85,91 ----
$(SETKEY_EXEFILE): $(SETKEY_EXEOBJS) $(EXELIBS)
! $(EXECONLINK) dnsapi.lib shell32.lib
$(_VC_MANIFEST_EMBED_EXE)
$(EXEPREP)
Index: openafs/src/bozo/NTMakefile
diff -c openafs/src/bozo/NTMakefile:1.10.4.1 openafs/src/bozo/NTMakefile:1.10.4.2
*** openafs/src/bozo/NTMakefile:1.10.4.1 Tue Jul 4 02:28:23 2006
--- openafs/src/bozo/NTMakefile Sat Feb 2 08:43:24 2008
***************
*** 70,76 ****
$(DESTDIR)\lib\cm_dns.obj
$(BOSSERVER_EXEFILE): $(BOSSERVER_EXEOBJS) $(BOSSERVER_EXELIBS)
! $(EXECONLINK) dnsapi.lib mpr.lib iphlpapi.lib
$(_VC_MANIFEST_EMBED_EXE)
$(EXEPREP)
--- 70,76 ----
$(DESTDIR)\lib\cm_dns.obj
$(BOSSERVER_EXEFILE): $(BOSSERVER_EXEOBJS) $(BOSSERVER_EXELIBS)
! $(EXECONLINK) dnsapi.lib mpr.lib iphlpapi.lib shell32.lib
$(_VC_MANIFEST_EMBED_EXE)
$(EXEPREP)
***************
*** 107,113 ****
$(RS_BOS_EXEFILE): $(BOS_EXEOBJS) $(BOS_EXELIBS)
! $(EXECONLINK) dnsapi.lib mpr.lib iphlpapi.lib
$(_VC_MANIFEST_EMBED_EXE)
$(EXEPREP)
--- 107,113 ----
$(RS_BOS_EXEFILE): $(BOS_EXEOBJS) $(BOS_EXELIBS)
! $(EXECONLINK) dnsapi.lib mpr.lib iphlpapi.lib shell32.lib
$(_VC_MANIFEST_EMBED_EXE)
$(EXEPREP)
Index: openafs/src/bozo/bosserver.c
diff -c openafs/src/bozo/bosserver.c:1.32.2.7 openafs/src/bozo/bosserver.c:1.32.2.9
*** openafs/src/bozo/bosserver.c:1.32.2.7 Mon Nov 26 16:08:40 2007
--- openafs/src/bozo/bosserver.c Sun Feb 3 22:51:41 2008
***************
*** 11,17 ****
#include
RCSID
! ("$Header: /cvs/openafs/src/bozo/bosserver.c,v 1.32.2.7 2007/11/26 21:08:40 shadow Exp $");
#include
#include
--- 11,17 ----
#include
RCSID
! ("$Header: /cvs/openafs/src/bozo/bosserver.c,v 1.32.2.9 2008/02/04 03:51:41 jaltman Exp $");
#include
#include
***************
*** 71,76 ****
--- 71,77 ----
struct ktime bozo_nextRestartKT, bozo_nextDayKT;
int bozo_newKTs;
int rxBind = 0;
+ int rxkadDisableDotCheck = 0;
#define ADDRSPERSITE 16 /* Same global is in rx/rx_user.c */
afs_uint32 SHostAddrs[ADDRSPERSITE];
***************
*** 820,825 ****
--- 821,829 ----
else if (strcmp(argv[code], "-rxbind") == 0) {
rxBind = 1;
}
+ else if (strcmp(argv[code], "-allow-dotted-principals") == 0) {
+ rxkadDisableDotCheck = 1;
+ }
else if (!strcmp(argv[i], "-rxmaxmtu")) {
if ((i + 1) >= argc) {
fprintf(stderr, "missing argument for -rxmaxmtu\n");
***************
*** 828,834 ****
rxMaxMTU = atoi(argv[++i]);
if ((rxMaxMTU < RX_MIN_PACKET_SIZE) ||
(rxMaxMTU > RX_MAX_PACKET_DATA_SIZE)) {
! printf("rxMaxMTU %d% invalid; must be between %d-%d\n",
rxMaxMTU, RX_MIN_PACKET_SIZE,
RX_MAX_PACKET_DATA_SIZE);
exit(1);
--- 832,838 ----
rxMaxMTU = atoi(argv[++i]);
if ((rxMaxMTU < RX_MIN_PACKET_SIZE) ||
(rxMaxMTU > RX_MAX_PACKET_DATA_SIZE)) {
! printf("rxMaxMTU %d invalid; must be between %d-%d\n",
rxMaxMTU, RX_MIN_PACKET_SIZE,
RX_MAX_PACKET_DATA_SIZE);
exit(1);
***************
*** 871,884 ****
#ifndef AFS_NT40_ENV
printf("Usage: bosserver [-noauth] [-log] "
"[-auditlog ] "
! "[-rxmaxmtu ] [-rxbind] "
"[-syslog[=FACILITY]] "
"[-enable_peer_stats] [-enable_process_stats] "
"[-nofork] " "[-help]\n");
#else
printf("Usage: bosserver [-noauth] [-log] "
"[-auditlog ] "
! "[-rxmaxmtu ] [-rxbind] "
"[-enable_peer_stats] [-enable_process_stats] "
"[-help]\n");
#endif
--- 875,888 ----
#ifndef AFS_NT40_ENV
printf("Usage: bosserver [-noauth] [-log] "
"[-auditlog ] "
! "[-rxmaxmtu ] [-rxbind] [-allow-dotted-principals]"
"[-syslog[=FACILITY]] "
"[-enable_peer_stats] [-enable_process_stats] "
"[-nofork] " "[-help]\n");
#else
printf("Usage: bosserver [-noauth] [-log] "
"[-auditlog ] "
! "[-rxmaxmtu ] [-rxbind] [-allow-dotted-principals]"
"[-enable_peer_stats] [-enable_process_stats] "
"[-help]\n");
#endif
***************
*** 1061,1066 ****
--- 1065,1075 ----
rx_SetMinProcs(tservice, 2);
rx_SetMaxProcs(tservice, 4);
rx_SetStackSize(tservice, BOZO_LWP_STACKSIZE); /* so gethostbyname works (in cell stuff) */
+ if (rxkadDisableDotCheck) {
+ rx_SetSecurityConfiguration(tservice, RXS_CONFIG_FLAGS,
+ (void *)RXS_CONFIG_FLAGS_DISABLE_DOTCHECK,
+ NULL);
+ }
tservice =
rx_NewServiceHost(host, 0, RX_STATS_SERVICE_ID, "rpcstats", bozo_rxsc,
Index: openafs/src/bucoord/NTMakefile
diff -c openafs/src/bucoord/NTMakefile:1.13.4.1 openafs/src/bucoord/NTMakefile:1.13.4.2
*** openafs/src/bucoord/NTMakefile:1.13.4.1 Wed Sep 19 13:58:48 2007
--- openafs/src/bucoord/NTMakefile Sat Feb 2 08:43:24 2008
***************
*** 92,98 ****
$(EXEFILE): $(EXEOBJS) $(EXERES) $(EXELIBS)
! $(EXECONLINK) dnsapi.lib mpr.lib iphlpapi.lib
$(_VC_MANIFEST_EMBED_EXE)
$(EXEPREP)
--- 92,98 ----
$(EXEFILE): $(EXEOBJS) $(EXERES) $(EXELIBS)
! $(EXECONLINK) dnsapi.lib mpr.lib iphlpapi.lib shell32.lib
$(_VC_MANIFEST_EMBED_EXE)
$(EXEPREP)
Index: openafs/src/budb/NTMakefile
diff -c openafs/src/budb/NTMakefile:1.10.4.1 openafs/src/budb/NTMakefile:1.10.4.2
*** openafs/src/budb/NTMakefile:1.10.4.1 Tue Jul 4 02:28:24 2006
--- openafs/src/budb/NTMakefile Sat Feb 2 08:43:24 2008
***************
*** 81,87 ****
$(EXEFILE): $(EXEOBJS) $(EXELIBS)
! $(EXECONLINK) dnsapi.lib iphlpapi.lib
$(_VC_MANIFEST_EMBED_EXE)
$(EXEPREP)
--- 81,87 ----
$(EXEFILE): $(EXEOBJS) $(EXELIBS)
! $(EXECONLINK) dnsapi.lib iphlpapi.lib shell32.lib
$(_VC_MANIFEST_EMBED_EXE)
$(EXEPREP)
Index: openafs/src/butc/NTMakefile
diff -c openafs/src/butc/NTMakefile:1.10.4.1 openafs/src/butc/NTMakefile:1.10.4.2
*** openafs/src/butc/NTMakefile:1.10.4.1 Wed Sep 19 13:58:48 2007
--- openafs/src/butc/NTMakefile Sat Feb 2 08:43:24 2008
***************
*** 57,63 ****
$(EXERES): butc.rc AFS_component_version_number.h
$(EXEFILE): $(EXEOBJS) $(EXERES) $(EXELIBS)
! $(EXECONLINK) dnsapi.lib mpr.lib iphlpapi.lib
$(_VC_MANIFEST_EMBED_EXE)
$(EXEPREP)
--- 57,63 ----
$(EXERES): butc.rc AFS_component_version_number.h
$(EXEFILE): $(EXEOBJS) $(EXERES) $(EXELIBS)
! $(EXECONLINK) dnsapi.lib mpr.lib iphlpapi.lib shell32.lib
$(_VC_MANIFEST_EMBED_EXE)
$(EXEPREP)
Index: openafs/src/cf/linux-test4.m4
diff -c openafs/src/cf/linux-test4.m4:1.29.2.31 openafs/src/cf/linux-test4.m4:1.29.2.36
*** openafs/src/cf/linux-test4.m4:1.29.2.31 Sat Dec 8 12:46:09 2007
--- openafs/src/cf/linux-test4.m4 Wed Jan 30 12:30:41 2008
***************
*** 728,744 ****
ac_cv_linux_statfs_takes_dentry=no)])
AC_MSG_RESULT($ac_cv_linux_statfs_takes_dentry)])
AC_DEFUN([LINUX_LINUX_KEYRING_SUPPORT], [
AC_MSG_CHECKING([for linux kernel keyring support])
AC_CACHE_VAL([ac_cv_linux_keyring_support], [
AC_TRY_KBUILD(
[#include
#include
#include ],
[#ifdef CONFIG_KEYS
request_key(NULL, NULL, NULL);
! #if !defined(KEY_POS_VIEW) || !defined(KEY_POS_SEARCH)
! #error "Your linux/key.h does not contain KEY_POS_VIEW or KEY_POS_SEARCH"
#endif
#else
#error rebuild your kernel with CONFIG_KEYS
--- 728,761 ----
ac_cv_linux_statfs_takes_dentry=no)])
AC_MSG_RESULT($ac_cv_linux_statfs_takes_dentry)])
+
+ AC_DEFUN([LINUX_KEY_TYPE_H_EXISTS], [
+ AC_MSG_CHECKING([for linux/key-type.h existance])
+ AC_CACHE_VAL([ac_cv_linux_key_type_h_exists], [
+ AC_TRY_KBUILD(
+ [#include ],
+ [return;],
+ ac_cv_linux_key_type_h_exists=yes,
+ ac_cv_linux_key_type_h_exists=no)])
+ AC_MSG_RESULT($ac_cv_linux_key_type_h_exists)
+ if test "x$ac_cv_linux_key_type_h_exists" = "xyes"; then
+ AC_DEFINE([KEY_TYPE_H_EXISTS], 1, [define if linux/key-type.h exists])
+ fi])
+
AC_DEFUN([LINUX_LINUX_KEYRING_SUPPORT], [
AC_MSG_CHECKING([for linux kernel keyring support])
AC_CACHE_VAL([ac_cv_linux_keyring_support], [
AC_TRY_KBUILD(
[#include
+ #ifdef KEY_TYPE_H_EXISTS
+ #include
+ #endif
#include
#include ],
[#ifdef CONFIG_KEYS
request_key(NULL, NULL, NULL);
! #if !defined(KEY_POS_VIEW) || !defined(KEY_POS_SEARCH) || !defined(KEY_POS_SETATTR)
! #error "Your linux/key.h does not contain KEY_POS_VIEW or KEY_POS_SEARCH or KEY_POS_SETATTR"
#endif
#else
#error rebuild your kernel with CONFIG_KEYS
***************
*** 750,755 ****
--- 767,796 ----
AC_DEFINE([LINUX_KEYRING_SUPPORT], 1, [define if your kernel has keyring support])
fi])
+
+ AC_DEFUN([LINUX_EXPORTS_KEY_TYPE_KEYRING], [
+ AC_MSG_CHECKING([for exported key_type_keyring])
+ AC_CACHE_VAL([ac_cv_linux_exports_key_type_keyring], [
+ AC_TRY_KBUILD(
+ [
+ #include
+ #include
+ #ifdef KEY_TYPE_H_EXISTS
+ #include
+ #endif
+ #include
+ ],
+ [
+ printk("%x\n", key_type_keyring);
+ ],
+ ac_cv_linux_exports_key_type_keyring=yes,
+ ac_cv_linux_exports_key_type_keyring=no)])
+ AC_MSG_RESULT($ac_cv_linux_exports_key_type_keyring)
+ if test "x$ac_cv_linux_exports_key_type_keyring" = "xyes"; then
+ AC_DEFINE([EXPORTS_KEY_TYPE_KEYRING], 1, [define if key_type_keyring is exported])
+ fi])
+
+
AC_DEFUN([LINUX_KEY_ALLOC_NEEDS_STRUCT_TASK], [
AC_MSG_CHECKING([if key_alloc() takes a struct task *])
AC_CACHE_VAL([ac_cv_key_alloc_needs_struct_task], [
***************
*** 768,785 ****
AC_DEFUN([LINUX_DO_SYNC_READ], [
AC_MSG_CHECKING([for linux do_sync_read()])
AC_CACHE_VAL([ac_cv_linux_do_sync_read], [
! AC_TRY_KBUILD(
! [#include ],
! [do_sync_read(NULL, NULL, 0, NULL, 0);],
! ac_cv_linux_do_sync_read=no,
! ac_cv_linux_do_sync_read=maybe)
! if test "x$ac_cv_linux_do_sync_read" = "xmaybe"; then
AC_TRY_KBUILD(
[#include ],
[do_sync_read(NULL, NULL, 0, NULL);],
ac_cv_linux_do_sync_read=yes,
! ac_cv_linux_do_sync_read=no)])
! fi
AC_MSG_RESULT($ac_cv_linux_do_sync_read)
if test "x$ac_cv_linux_do_sync_read" = "xyes"; then
AC_DEFINE([DO_SYNC_READ], 1, [define if your kernel has do_sync_read()])
--- 809,822 ----
AC_DEFUN([LINUX_DO_SYNC_READ], [
AC_MSG_CHECKING([for linux do_sync_read()])
AC_CACHE_VAL([ac_cv_linux_do_sync_read], [
! save_CPPFLAGS="$CPPFLAGS"
! CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
AC_TRY_KBUILD(
[#include ],
[do_sync_read(NULL, NULL, 0, NULL);],
ac_cv_linux_do_sync_read=yes,
! ac_cv_linux_do_sync_read=no)
! CPPFLAGS="$save_CPPFLAGS"])
AC_MSG_RESULT($ac_cv_linux_do_sync_read)
if test "x$ac_cv_linux_do_sync_read" = "xyes"; then
AC_DEFINE([DO_SYNC_READ], 1, [define if your kernel has do_sync_read()])
***************
*** 788,805 ****
AC_DEFUN([LINUX_GENERIC_FILE_AIO_READ], [
AC_MSG_CHECKING([for linux generic_file_aio_read()])
AC_CACHE_VAL([ac_cv_linux_generic_file_aio_read], [
! AC_TRY_KBUILD(
! [#include ],
! [generic_file_aio_read(NULL, NULL, 0, 0, 0);],
! ac_cv_linux_generic_file_aio_read=no,
! ac_cv_linux_generic_file_aio_read=maybe)
! if test "x$ac_cv_linux_generic_file_aio_read" = "xmaybe"; then
AC_TRY_KBUILD(
[#include ],
[generic_file_aio_read(NULL, NULL, 0, 0);],
ac_cv_linux_generic_file_aio_read=yes,
! ac_cv_linux_generic_file_aio_read=no)])
! fi
AC_MSG_RESULT($ac_cv_linux_generic_file_aio_read)
if test "x$ac_cv_linux_generic_file_aio_read" = "xyes"; then
AC_DEFINE([GENERIC_FILE_AIO_READ], 1, [define if your kernel has generic_file_aio_read()])
--- 825,838 ----
AC_DEFUN([LINUX_GENERIC_FILE_AIO_READ], [
AC_MSG_CHECKING([for linux generic_file_aio_read()])
AC_CACHE_VAL([ac_cv_linux_generic_file_aio_read], [
! save_CPPFLAGS="$CPPFLAGS"
! CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
AC_TRY_KBUILD(
[#include ],
[generic_file_aio_read(NULL, NULL, 0, 0);],
ac_cv_linux_generic_file_aio_read=yes,
! ac_cv_linux_generic_file_aio_read=no)
! CPPFLAGS="$save_CPPFLAGS"])
AC_MSG_RESULT($ac_cv_linux_generic_file_aio_read)
if test "x$ac_cv_linux_generic_file_aio_read" = "xyes"; then
AC_DEFINE([GENERIC_FILE_AIO_READ], 1, [define if your kernel has generic_file_aio_read()])
***************
*** 933,948 ****
ac_cv_linux_fs_struct_fop_has_splice=no)])
AC_MSG_RESULT($ac_cv_linux_fs_struct_fop_has_splice)])
- AC_DEFUN([LINUX_KEY_TYPE_H_EXISTS], [
- AC_MSG_CHECKING([whether linux/key-type.h exists])
- AC_CACHE_VAL([ac_cv_linux_key_type_h_exists], [
- AC_TRY_KBUILD(
- [#include ],
- [return;],
- ac_cv_linux_key_type_h_exists=yes,
- ac_cv_linux_key_type_h_exists=no)])
- AC_MSG_RESULT($ac_cv_linux_key_type_h_exists)])
-
AC_DEFUN([LINUX_HAVE_CURRENT_KERNEL_TIME], [
AC_MSG_CHECKING([for current_kernel_time()])
AC_CACHE_VAL([ac_cv_linux_have_current_kernel_time], [
--- 966,971 ----
***************
*** 971,978 ****
AC_CACHE_VAL([ac_cv_linux_sysctl_table_checking], [
AC_TRY_KBUILD(
[#include ],
! [ sysctl_check_table(NULL);],
! ac_cv_linux_sysctl_table_checking=yes,
! ac_cv_linux_sysctl_table_checking=no)])
! AC_MSG_RESULT($ac_cv_linux_sysctl_table_checking)])
--- 994,1002 ----
AC_CACHE_VAL([ac_cv_linux_sysctl_table_checking], [
AC_TRY_KBUILD(
[#include ],
! [ extern int sysctl_check_table(int) __attribute__((weak));
! sysctl_check_table(NULL);],
! ac_cv_linux_sysctl_table_checking=no,
! ac_cv_linux_sysctl_table_checking=yes)])
! AC_MSG_RESULT($ac_cv_linux_sysctl_table_checking)])
Index: openafs/src/cf/osconf.m4
diff -c openafs/src/cf/osconf.m4:1.83.2.6 openafs/src/cf/osconf.m4:1.83.2.7
*** openafs/src/cf/osconf.m4:1.83.2.6 Mon Nov 12 13:28:35 2007
--- openafs/src/cf/osconf.m4 Tue Jan 15 00:21:18 2008
***************
*** 119,124 ****
--- 119,156 ----
SHLIB_LINKER="${MT_CC} -shared"
;;
+ arm_linux24)
+ CCOBJ="${CC} -fPIC"
+ KERN_OPTMZ=-O2
+ LEX="flex -l"
+ MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
+ MT_LIBS="-lpthread"
+ PAM_OPTMZ=-O2
+ PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LDFLAGS="-shared -Xlinker -x"
+ TXLIBS="-lncurses"
+ XCFLAGS="-D_LARGEFILE64_SOURCE"
+ YACC="bison -y"
+ SHLIB_LINKER="${MT_CC} -shared"
+ ;;
+
+ arm_linux26)
+ CCOBJ="${CC} -fPIC"
+ KERN_OPTMZ=-O2
+ LEX="flex -l"
+ MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
+ MT_LIBS="-lpthread"
+ PAM_OPTMZ=-O2
+ PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LDFLAGS="-shared -Xlinker -x"
+ TXLIBS="-lncurses"
+ XCFLAGS="-D_LARGEFILE64_SOURCE"
+ YACC="bison -y"
+ SHLIB_LINKER="${MT_CC} -shared"
+ ;;
+
hp_ux102)
AS="/usr/ccs/bin/as"
CC="/opt/ansic/bin/cc -Ae"
Index: openafs/src/cmd/cmd.c
diff -c openafs/src/cmd/cmd.c:1.12.4.2 openafs/src/cmd/cmd.c:1.12.4.3
*** openafs/src/cmd/cmd.c:1.12.4.2 Wed Oct 31 00:09:25 2007
--- openafs/src/cmd/cmd.c Sun Jan 13 10:35:41 2008
***************
*** 11,17 ****
#include
RCSID
! ("$Header: /cvs/openafs/src/cmd/cmd.c,v 1.12.4.2 2007/10/31 04:09:25 shadow Exp $");
#include
#include
--- 11,17 ----
#include
RCSID
! ("$Header: /cvs/openafs/src/cmd/cmd.c,v 1.12.4.3 2008/01/13 15:35:41 jaltman Exp $");
#include
#include
***************
*** 40,52 ****
static char *
NName(char *a1, char *a2)
{
! static char tbuffer[80];
if (strlen(a1) == 0) {
! return "";
} else {
! strcpy(tbuffer, a1);
! strcat(tbuffer, a2);
! return tbuffer;
}
}
--- 40,53 ----
static char *
NName(char *a1, char *a2)
{
! static char tbuffer[300];
if (strlen(a1) == 0) {
! return "";
} else {
! strncpy(tbuffer, a1, sizeof(tbuffer));
! strncat(tbuffer, a2, sizeof(tbuffer));
! tbuffer[sizeof(tbuffer)-1]='\0';
! return tbuffer;
}
}
Index: openafs/src/config/.cvsignore
diff -c openafs/src/config/.cvsignore:1.5 openafs/src/config/.cvsignore:1.5.14.1
*** openafs/src/config/.cvsignore:1.5 Thu Jun 19 12:28:58 2003
--- openafs/src/config/.cvsignore Fri Jan 11 17:41:50 2008
***************
*** 1,18 ****
AFS_component_version_number.c
Makefile
Makefile.*_*[0123456789]
Makefile.version
Makefile.version-NOCML
afsconfig.h
afsconfig.h.in
config
mkvers
- Makefile.hp_ux102
- Makefile.hp_ux110
- Makefile.i386_linux22
- Makefile.i386_linux24
- Makefile.sun4x_56
- Makefile.sun4x_57
param.h.new
Makefile.config
stamp-h1
--- 1,13 ----
AFS_component_version_number.c
Makefile
Makefile.*_*[0123456789]
+ Makefile.*_*[0123456789].in
Makefile.version
Makefile.version-NOCML
afsconfig.h
afsconfig.h.in
config
mkvers
param.h.new
Makefile.config
stamp-h1
Index: openafs/src/config/NTMakefile.amd64_w2k
diff -c openafs/src/config/NTMakefile.amd64_w2k:1.24.2.34 openafs/src/config/NTMakefile.amd64_w2k:1.24.2.37
*** openafs/src/config/NTMakefile.amd64_w2k:1.24.2.34 Fri Dec 28 15:19:10 2007
--- openafs/src/config/NTMakefile.amd64_w2k Sun Feb 10 23:04:05 2008
***************
*** 84,90 ****
#define used in WinNT/2000 installation and program version display
AFSPRODUCT_VER_MAJOR=1
AFSPRODUCT_VER_MINOR=5
! AFSPRODUCT_VER_PATCH=2900
AFSPRODUCT_VER_BUILD=0
AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
--- 84,90 ----
#define used in WinNT/2000 installation and program version display
AFSPRODUCT_VER_MAJOR=1
AFSPRODUCT_VER_MINOR=5
! AFSPRODUCT_VER_PATCH=3100
AFSPRODUCT_VER_BUILD=0
AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
***************
*** 217,222 ****
--- 217,227 ----
-DAFS_64BIT_ENV \
-DAFS_64BIT_CLIENT \
-DAFS_LARGEFILE_ENV \
+ -D_USE_DECLSPECS_FOR_SAL=0 \
+ -D_USE_ATTRIBUTES_FOR_SAL=0 \
+ -D_ATL_SECURE_NO_DEPRECATE \
+ -D_AFX_DISABLE_DEPRECATED \
+ -D_AFX_SECURE_NO_WARNINGS \
$(AFSDEV_AUXCDEFINES)
# Compiler switches (except include paths and preprocessor defines)
***************
*** 227,233 ****
# /GF pool strings and place in read-only memory
# /Gd use cdecl calling convention by default
# /Gy enable function-level linking
! # /GX enable C++ exceptions (assumes extern C funcs never throw exceptions)
# /Os favor small (over fast) code; seems to avoid 64-bit bugs in VC compiler
afscflags =\
--- 232,238 ----
# /GF pool strings and place in read-only memory
# /Gd use cdecl calling convention by default
# /Gy enable function-level linking
! # /EHsc enable C++ exceptions (assumes extern C funcs never throw exceptions)
# /Os favor small (over fast) code; seems to avoid 64-bit bugs in VC compiler
afscflags =\
***************
*** 237,243 ****
/Gy \
/Os
! !IF ("$(AFSVER_CL)"=="1400")
afscflags = $(afscflags) /EHsc /wd4996
!ELSE
afscflags = $(afscflags) /GX
--- 242,248 ----
/Gy \
/Os
! !IF ("$(AFSVER_CL)"=="1400" || "$(AFSVER_CL)"=="1500")
afscflags = $(afscflags) /EHsc /wd4996
!ELSE
afscflags = $(afscflags) /GX
***************
*** 246,252 ****
!IF ("$(AFSVER_CL)"!="1200")
afscflags = $(afscflags) /GT /GS
#/Wp64
! !IF ("$(AFSVER_CL)"!="1400")
afscflags = $(afscflags) /G7
!ENDIF
!ENDIF
--- 251,257 ----
!IF ("$(AFSVER_CL)"!="1200")
afscflags = $(afscflags) /GT /GS
#/Wp64
! !IF ("$(AFSVER_CL)"!="1400" && "$(AFSVER_CL)"!="1500")
afscflags = $(afscflags) /G7
!ENDIF
!ENDIF
***************
*** 278,284 ****
_VC_MANIFEST_BASENAME = __OAFW.Debug
!ENDIF
! !IF ("$(AFSVER_CL)"=="1400")
_VC_MANIFEST_EMBED_EXE= \
if exist $@.manifest mt.exe -manifest $@.manifest -outputresource:$@;1
--- 283,289 ----
_VC_MANIFEST_BASENAME = __OAFW.Debug
!ENDIF
! !IF ("$(AFSVER_CL)"=="1400" || "$(AFSVER_CL)"=="1500")
_VC_MANIFEST_EMBED_EXE= \
if exist $@.manifest mt.exe -manifest $@.manifest -outputresource:$@;1
***************
*** 302,307 ****
--- 307,315 ----
!ERROR Must define AFSDEV_WARNLEVEL to be one of 0 through 4.
!ENDIF
!ENDIF
+ !IF ("$(AFSDEV_WARNLEVEL)" == "4" && "$(AFSVER_CL)" == "1500")
+ _AFSDEV_WARNLEVEL=3
+ !ENDIF
afscflags = $(afscflags) /W$(AFSDEV_WARNLEVEL)
***************
*** 356,365 ****
#################### Link optional build flags set ###########
! afslflags = $(afslflags) \
! /FIXED:NO /VERBOSE:LIB /MACHINE:X64
! !IF ("$(AFSVER_CL)"=="1400")
afslflags = $(afslflags) /MANIFEST
!ENDIF
--- 364,377 ----
#################### Link optional build flags set ###########
! afslflags = $(afslflags) /FIXED:NO /VERBOSE:LIB
! !IF ("$(AFSVER_CL)"=="1500")
! afslflags = $(afslflags) /MACHINE:AMD64
! !ELSE
! afslflags = $(afslflags) /MACHINE:X64
! !ENDIF
! !IF ("$(AFSVER_CL)"=="1400" || "$(AFSVER_CL)"=="1500")
afslflags = $(afslflags) /MANIFEST
!ENDIF
Index: openafs/src/config/NTMakefile.i386_nt40
diff -c openafs/src/config/NTMakefile.i386_nt40:1.84.2.33 openafs/src/config/NTMakefile.i386_nt40:1.84.2.36
*** openafs/src/config/NTMakefile.i386_nt40:1.84.2.33 Fri Dec 28 15:19:10 2007
--- openafs/src/config/NTMakefile.i386_nt40 Sun Feb 10 23:04:05 2008
***************
*** 84,90 ****
#define used in WinNT/2000 installation and program version display
AFSPRODUCT_VER_MAJOR=1
AFSPRODUCT_VER_MINOR=5
! AFSPRODUCT_VER_PATCH=2900
AFSPRODUCT_VER_BUILD=0
AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
--- 84,90 ----
#define used in WinNT/2000 installation and program version display
AFSPRODUCT_VER_MAJOR=1
AFSPRODUCT_VER_MINOR=5
! AFSPRODUCT_VER_PATCH=3100
AFSPRODUCT_VER_BUILD=0
AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
Index: openafs/src/config/NTMakefile.i386_w2k
diff -c openafs/src/config/NTMakefile.i386_w2k:1.23.2.34 openafs/src/config/NTMakefile.i386_w2k:1.23.2.37
*** openafs/src/config/NTMakefile.i386_w2k:1.23.2.34 Fri Dec 28 15:19:10 2007
--- openafs/src/config/NTMakefile.i386_w2k Sun Feb 10 23:04:05 2008
***************
*** 84,90 ****
#define used in WinNT/2000 installation and program version display
AFSPRODUCT_VER_MAJOR=1
AFSPRODUCT_VER_MINOR=5
! AFSPRODUCT_VER_PATCH=2900
AFSPRODUCT_VER_BUILD=0
AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
--- 84,90 ----
#define used in WinNT/2000 installation and program version display
AFSPRODUCT_VER_MAJOR=1
AFSPRODUCT_VER_MINOR=5
! AFSPRODUCT_VER_PATCH=3100
AFSPRODUCT_VER_BUILD=0
AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
***************
*** 245,251 ****
/Gy \
/Os
! !IF ("$(AFSVER_CL)"=="1400")
afscflags = $(afscflags) /EHsc /wd4996
!ELSE
afscflags = $(afscflags) /GX
--- 245,251 ----
/Gy \
/Os
! !IF ("$(AFSVER_CL)"=="1400" || "$(AFSVER_CL)"=="1500")
afscflags = $(afscflags) /EHsc /wd4996
!ELSE
afscflags = $(afscflags) /GX
***************
*** 254,260 ****
!IF ("$(AFSVER_CL)"!="1200")
afscflags = $(afscflags) /GT /GS
#/Wp64
! !IF ("$(AFSVER_CL)"!="1400")
afscflags = $(afscflags) /G7
!ENDIF
!ENDIF
--- 254,260 ----
!IF ("$(AFSVER_CL)"!="1200")
afscflags = $(afscflags) /GT /GS
#/Wp64
! !IF ("$(AFSVER_CL)"!="1400" && "$(AFSVER_CL)"!="1500")
afscflags = $(afscflags) /G7
!ENDIF
!ENDIF
***************
*** 288,294 ****
_VC_MANIFEST_BASENAME = __OAFW.Debug
!ENDIF
! !IF ("$(AFSVER_CL)"=="1400" || "$(AFSVER_CL)" == "1310")
_VC_MANIFEST_EMBED_EXE= \
if exist $@.manifest mt.exe -manifest $@.manifest -outputresource:$@;1
--- 288,294 ----
_VC_MANIFEST_BASENAME = __OAFW.Debug
!ENDIF
! !IF ("$(AFSVER_CL)"=="1500"|| "$(AFSVER_CL)"=="1400" || "$(AFSVER_CL)" == "1310")
_VC_MANIFEST_EMBED_EXE= \
if exist $@.manifest mt.exe -manifest $@.manifest -outputresource:$@;1
***************
*** 373,379 ****
afslflags =\
/FIXED:NO /VERBOSE:LIB /MACHINE:I386
! !IF ("$(AFSVER_CL)"=="1400" || "$(AFSVER_CL)"=="1310")
afslflags = $(afslflags) /MANIFEST
!ENDIF
--- 373,379 ----
afslflags =\
/FIXED:NO /VERBOSE:LIB /MACHINE:I386
! !IF ("$(AFSVER_CL)"=="1500" || "$(AFSVER_CL)"=="1400" || "$(AFSVER_CL)"=="1310")
afslflags = $(afslflags) /MANIFEST
!ENDIF
Index: openafs/src/config/afs_args.h
diff -c openafs/src/config/afs_args.h:1.20.4.1 openafs/src/config/afs_args.h:1.20.4.2
*** openafs/src/config/afs_args.h:1.20.4.1 Wed Oct 10 13:01:46 2007
--- openafs/src/config/afs_args.h Wed Jan 30 16:37:24 2008
***************
*** 123,128 ****
--- 123,129 ----
/* #define AFSOP_STOP_COMPLETE 215 defined in osi.h */
/* #define AFSOP_STOP_RXK_LISTENER 217 defined in osi.h */
#define AFSOP_STOP_AFSDB 218 /* Stop AFSDB handler */
+ #define AFSOP_STOP_NETIF 219 /* Stop Netif poller */
/* Main afs syscall entry; this number may vary per system (i.e. defined in afs/param.h) */
#ifndef AFS_SYSCALL
Index: openafs/src/config/afs_sysnames.h
diff -c openafs/src/config/afs_sysnames.h:1.77.2.3 openafs/src/config/afs_sysnames.h:1.77.2.5
*** openafs/src/config/afs_sysnames.h:1.77.2.3 Thu Feb 8 20:13:19 2007
--- openafs/src/config/afs_sysnames.h Tue Jan 15 01:09:12 2008
***************
*** 184,189 ****
--- 184,191 ----
#define SYS_NAME_ID_i386_fbsd_53 2108
#define SYS_NAME_ID_i386_fbsd_60 2112
#define SYS_NAME_ID_i386_fbsd_61 2113
+ #define SYS_NAME_ID_i386_fbsd_62 2114
+ #define SYS_NAME_ID_i386_fbsd_70 2115
#define SYS_NAME_ID_ia64_linux2 2200
#define SYS_NAME_ID_ia64_linux22 2201
***************
*** 262,267 ****
--- 264,274 ----
#define SYS_NAME_ID_i64_w2k 3500
+ #define SYS_NAME_ID_arm_linux2 3800
+ #define SYS_NAME_ID_arm_linux22 3801
+ #define SYS_NAME_ID_arm_linux24 3802
+ #define SYS_NAME_ID_arm_linux26 3803
+
/*
* Placeholder to keep system-wide standard flags since this file is included by all
* files (i.e in afs/param.h)
Index: openafs/src/config/param.arm_linux24.h
diff -c /dev/null openafs/src/config/param.arm_linux24.h:1.1.2.2
*** /dev/null Mon Feb 11 10:58:21 2008
--- openafs/src/config/param.arm_linux24.h Tue Jan 15 00:12:14 2008
***************
*** 0 ****
--- 1,146 ----
+ #ifndef UKERNEL
+ /* This section for kernel libafs compiles only */
+
+ #ifndef AFS_PARAM_H
+ #define AFS_PARAM_H
+
+ /* In user space the AFS_LINUX20_ENV should be sufficient. In the kernel,
+ * it's a judgment call. If something is obviously i386 specific, use that
+ * #define instead. Note that "20" refers to the linux 2.0 kernel. The "2"
+ * in the sysname is the current version of the client. This takes into
+ * account the perferred OS user space configuration as well as the kernel.
+ */
+
+ #define AFS_LINUX20_ENV 1
+ #define AFS_LINUX22_ENV 1
+ #define AFS_LINUX24_ENV 1
+ #define AFS_ARM_LINUX20_ENV 1
+ #define AFS_ARM_LINUX22_ENV 1
+ #define AFS_ARM_LINUX24_ENV 1
+ #define AFS_NONFSTRANS 1
+
+ #define AFS_MOUNT_AFS "afs" /* The name of the filesystem type. */
+ #define AFS_SYSCALL 137
+ #define AFS_64BIT_IOPS_ENV 1
+ #define AFS_NAMEI_ENV 1 /* User space interface to file system */
+ #define AFS_64BIT_ENV 1
+ #define AFS_64BIT_CLIENT 1
+
+ #if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
+
+ #ifdef CONFIG_SMP
+ #undef CONFIG_SMP
+ #endif
+ /* Using "AFS_SMP" to map to however many #define's are required to get
+ * MP to compile for Linux
+ */
+ #ifdef AFS_SMP
+ #define CONFIG_SMP 1
+ #ifndef __SMP__
+ #define __SMP__
+ #endif
+ #endif
+ #define AFS_GLOBAL_SUNLOCK
+
+ #if defined(MODULE) && defined(CONFIG_MODVERSIONS)
+ #define MODVERSIONS
+ #include
+ #endif
+
+ #endif /* __KERNEL__ && !DUMP_KERNEL */
+
+ #include
+ #define AFS_USERSPACE_IP_ADDR 1
+ #define RXK_LISTENER_ENV 1
+ #define AFS_GCPAGS 1
+
+ #define AFSLITTLE_ENDIAN 1
+ #define AFS_HAVE_FFS 1 /* Use system's ffs. */
+ #define AFS_HAVE_STATVFS 0 /* System doesn't support statvfs */
+ #define AFS_VM_RDWR_ENV 1 /* read/write implemented via VM */
+ #define AFS_USE_GETTIMEOFDAY 1 /* use gettimeofday to implement rx clock */
+
+ #ifdef KERNEL
+ #ifndef MIN
+ #define MIN(A,B) ((A) < (B) ? (A) : (B))
+ #endif
+ #ifndef MAX
+ #define MAX(A,B) ((A) > (B) ? (A) : (B))
+ #endif
+ #endif /* KERNEL */
+
+ #ifndef KERNEL
+ #define __USE_LARGEFILE64 1
+ #if !defined off64_t
+ #define off64_t __off64_t
+ #endif
+ #endif
+
+ /* Machine / Operating system information */
+ #define SYS_NAME "arm_linux24"
+ #define SYS_NAME_ID SYS_NAME_ID_arm_linux24
+
+ #endif /* AFS_PARAM_H */
+
+
+
+ #else /* !defined(UKERNEL) */
+
+ /* This section for user space compiles only */
+
+ #ifndef AFS_PARAM_H
+ #define AFS_PARAM_H
+
+ /* In user space the AFS_LINUX20_ENV should be sufficient. In the kernel,
+ * it's a judgment call. If something is obviously i386 specific, use that
+ * #define instead. Note that "20" refers to the linux 2.0 kernel. The "2"
+ * in the sysname is the current version of the client. This takes into
+ * account the perferred OS user space configuration as well as the kernel.
+ */
+
+ #define UKERNEL 1 /* user space kernel */
+ #define AFS_ENV 1
+ #define AFS_USR_LINUX20_ENV 1
+ #define AFS_USR_LINUX22_ENV 1
+ #define AFS_USR_LINUX24_ENV 1
+ #define AFS_NONFSTRANS 1
+
+ #define AFS_MOUNT_AFS "afs" /* The name of the filesystem type. */
+ #define AFS_SYSCALL 137
+ #define AFS_64BIT_IOPS_ENV 1
+ #define AFS_NAMEI_ENV 1 /* User space interface to file system */
+ #include
+
+ #define AFS_USERSPACE_IP_ADDR 1
+ #define RXK_LISTENER_ENV 1
+ #define AFS_GCPAGS 0 /* if nonzero, garbage collect PAGs */
+
+
+ /* Machine / Operating system information */
+ #define SYS_NAME "arm_linux24"
+ #define SYS_NAME_ID SYS_NAME_ID_arm_linux24
+ #define AFSLITTLE_ENDIAN 1
+ #define AFS_HAVE_FFS 1 /* Use system's ffs. */
+ #define AFS_HAVE_STATVFS 0 /* System doesn't support statvfs */
+ #define AFS_VM_RDWR_ENV 1 /* read/write implemented via VM */
+
+ #define afsio_iov uio_iov
+ #define afsio_iovcnt uio_iovcnt
+ #define afsio_offset uio_offset
+ #define afsio_seg uio_segflg
+ #define afsio_fmode uio_fmode
+ #define afsio_resid uio_resid
+ #define AFS_UIOSYS 1
+ #define AFS_UIOUSER UIO_USERSPACE
+ #define AFS_CLBYTES MCLBYTES
+ #define AFS_MINCHANGE 2
+ #define VATTR_NULL usr_vattr_null
+
+ #define AFS_DIRENT
+ #ifndef CMSERVERPREF
+ #define CMSERVERPREF
+ #endif
+
+ #endif /* AFS_PARAM_H */
+
+ #endif /* !defined(UKERNEL) */
Index: openafs/src/config/param.arm_linux26.h
diff -c /dev/null openafs/src/config/param.arm_linux26.h:1.1.2.2
*** /dev/null Mon Feb 11 10:58:21 2008
--- openafs/src/config/param.arm_linux26.h Tue Jan 15 00:12:14 2008
***************
*** 0 ****
--- 1,152 ----
+ #ifndef UKERNEL
+ /* This section for kernel libafs compiles only */
+
+ #ifndef AFS_PARAM_H
+ #define AFS_PARAM_H
+
+ /* In user space the AFS_LINUX20_ENV should be sufficient. In the kernel,
+ * it's a judgment call. If something is obviously i386 specific, use that
+ * #define instead. Note that "20" refers to the linux 2.0 kernel. The "2"
+ * in the sysname is the current version of the client. This takes into
+ * account the perferred OS user space configuration as well as the kernel.
+ */
+
+ #define AFS_LINUX20_ENV 1
+ #define AFS_LINUX22_ENV 1
+ #define AFS_LINUX24_ENV 1
+ #define AFS_LINUX26_ENV 1
+ #define AFS_ARM_LINUX20_ENV 1
+ #define AFS_ARM_LINUX22_ENV 1
+ #define AFS_ARM_LINUX24_ENV 1
+ #define AFS_ARM_LINUX26_ENV 1
+
+ #define AFS_MOUNT_AFS "afs" /* The name of the filesystem type. */
+ #define AFS_SYSCALL 137
+ #define AFS_64BIT_IOPS_ENV 1
+ #define AFS_NAMEI_ENV 1 /* User space interface to file system */
+ #define AFS_64BIT_ENV 1
+ #define AFS_64BIT_CLIENT 1
+
+ #if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
+
+ #ifdef CONFIG_SMP
+ #ifndef AFS_SMP
+ #define AFS_SMP 1
+ #endif
+ #endif
+ /* Using "AFS_SMP" to map to however many #define's are required to get
+ * MP to compile for Linux
+ */
+ #ifdef AFS_SMP
+ #ifndef CONFIG_SMP
+ #define CONFIG_SMP 1
+ #endif
+ #ifndef __SMP__
+ #define __SMP__
+ #endif
+ #endif
+ #define AFS_GLOBAL_SUNLOCK
+
+ #endif /* __KERNEL__ && !DUMP_KERNEL */
+
+ #include
+ #define AFS_USERSPACE_IP_ADDR 1
+ #define RXK_LISTENER_ENV 1
+ #define AFS_GCPAGS 1
+
+ #define AFSLITTLE_ENDIAN 1
+ #define AFS_HAVE_FFS 1 /* Use system's ffs. */
+ #define AFS_HAVE_STATVFS 0 /* System doesn't support statvfs */
+ #define AFS_VM_RDWR_ENV 1 /* read/write implemented via VM */
+ #define AFS_USE_GETTIMEOFDAY 1 /* use gettimeofday to implement rx clock */
+
+ #ifdef KERNEL
+ #ifndef MIN
+ #define MIN(A,B) ((A) < (B) ? (A) : (B))
+ #endif
+ #ifndef MAX
+ #define MAX(A,B) ((A) > (B) ? (A) : (B))
+ #endif
+ #endif /* KERNEL */
+
+ #ifndef KERNEL
+ #define __USE_LARGEFILE64 1
+ #if !defined off64_t
+ #define off64_t __off64_t
+ #endif
+ #endif
+
+ /* Machine / Operating system information */
+ #define SYS_NAME "arm_linux26"
+ #define SYS_NAME_ID SYS_NAME_ID_arm_linux26
+
+ #ifdef __GLIBC__
+ #if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 3)
+ #define USE_UCONTEXT
+ #endif
+ #endif
+ #endif /* AFS_PARAM_H */
+
+
+
+ #else /* !defined(UKERNEL) */
+
+ /* This section for user space compiles only */
+
+ #ifndef AFS_PARAM_H
+ #define AFS_PARAM_H
+
+ /* In user space the AFS_LINUX20_ENV should be sufficient. In the kernel,
+ * it's a judgment call. If something is obviously i386 specific, use that
+ * #define instead. Note that "20" refers to the linux 2.0 kernel. The "2"
+ * in the sysname is the current version of the client. This takes into
+ * account the perferred OS user space configuration as well as the kernel.
+ */
+
+ #define UKERNEL 1 /* user space kernel */
+ #define AFS_ENV 1
+ #define AFS_USR_LINUX20_ENV 1
+ #define AFS_USR_LINUX22_ENV 1
+ #define AFS_USR_LINUX24_ENV 1
+ #define AFS_USR_LINUX26_ENV 1
+ #define AFS_NONFSTRANS 1
+
+ #define AFS_MOUNT_AFS "afs" /* The name of the filesystem type. */
+ #define AFS_SYSCALL 137
+ #define AFS_64BIT_IOPS_ENV 1
+ #define AFS_NAMEI_ENV 1 /* User space interface to file system */
+ #include
+
+ #define AFS_USERSPACE_IP_ADDR 1
+ #define RXK_LISTENER_ENV 1
+ #define AFS_GCPAGS 0 /* if nonzero, garbage collect PAGs */
+
+
+ /* Machine / Operating system information */
+ #define SYS_NAME "arm_linux26"
+ #define SYS_NAME_ID SYS_NAME_ID_arm_linux26
+ #define AFSLITTLE_ENDIAN 1
+ #define AFS_HAVE_FFS 1 /* Use system's ffs. */
+ #define AFS_HAVE_STATVFS 0 /* System doesn't support statvfs */
+ #define AFS_VM_RDWR_ENV 1 /* read/write implemented via VM */
+
+ #define afsio_iov uio_iov
+ #define afsio_iovcnt uio_iovcnt
+ #define afsio_offset uio_offset
+ #define afsio_seg uio_segflg
+ #define afsio_fmode uio_fmode
+ #define afsio_resid uio_resid
+ #define AFS_UIOSYS 1
+ #define AFS_UIOUSER UIO_USERSPACE
+ #define AFS_CLBYTES MCLBYTES
+ #define AFS_MINCHANGE 2
+ #define VATTR_NULL usr_vattr_null
+
+ #define AFS_DIRENT
+ #ifndef CMSERVERPREF
+ #define CMSERVERPREF
+ #endif
+
+ #endif /* AFS_PARAM_H */
+
+ #endif /* !defined(UKERNEL) */
Index: openafs/src/config/param.i386_fbsd_62.h
diff -c /dev/null openafs/src/config/param.i386_fbsd_62.h:1.1.2.2
*** /dev/null Mon Feb 11 10:58:22 2008
--- openafs/src/config/param.i386_fbsd_62.h Tue Jan 15 01:09:12 2008
***************
*** 0 ****
--- 1,209 ----
+ #ifndef AFS_PARAM_H
+ #define AFS_PARAM_H
+
+ /* Machine / Operating system information */
+ #define SYS_NAME "i386_fbsd_62"
+ #define SYS_NAME_ID SYS_NAME_ID_i386_fbsd_62
+
+ #define AFSLITTLE_ENDIAN 1
+ #define AFS_HAVE_FFS 1 /* Use system's ffs. */
+ #define AFS_HAVE_STATVFS 1 /* System doesn't support statvfs */
+ #define AFS_VM_RDWR_ENV 1 /* read/write implemented via VM */
+
+
+ #ifndef UKERNEL
+ /* This section for kernel libafs compiles only */
+
+ #ifndef IGNORE_STDS_H
+ #include
+ #endif
+
+ #define AFS_XBSD_ENV 1 /* {Free,Open,Net}BSD */
+ #define AFS_X86_XBSD_ENV 1
+
+ #define AFS_NAMEI_ENV 1 /* User space interface to file system */
+ #define AFS_64BIT_ENV 1
+ #define AFS_64BIT_CLIENT 1
+ #define AFS_64BIT_IOPS_ENV 1 /* Needed for NAMEI */
+ #define AFS_FBSD_ENV 1
+ #define AFS_FBSD40_ENV 1
+ #define AFS_FBSD42_ENV 1
+ #define AFS_FBSD43_ENV 1
+ #define AFS_FBSD44_ENV 1
+ #define AFS_FBSD45_ENV 1
+ #define AFS_FBSD46_ENV 1
+ #define AFS_FBSD47_ENV 1
+ #define AFS_FBSD50_ENV 1
+ #define AFS_FBSD51_ENV 1
+ #define AFS_FBSD52_ENV 1
+ #define AFS_FBSD53_ENV 1
+ #define AFS_FBSD60_ENV 1
+ #define AFS_FBSD61_ENV 1
+ #define AFS_FBSD62_ENV 1
+ #define AFS_X86_FBSD_ENV 1
+ #define AFS_X86_FBSD40_ENV 1
+ #define AFS_X86_FBSD42_ENV 1
+ #define AFS_X86_FBSD43_ENV 1
+ #define AFS_X86_FBSD46_ENV 1
+ #define AFS_X86_FBSD47_ENV 1
+ #define AFS_X86_FBSD50_ENV 1
+ #define AFS_X86_FBSD60_ENV 1
+ #define AFS_X86_FBSD62_ENV 1
+ #define AFS_X86_ENV 1
+ #define AFS_NONFSTRANS 1
+ #define FTRUNC O_TRUNC
+
+ #define IUPD 0x0010
+ #define IACC 0x0020
+ #define ICHG 0x0040
+ #define IMOD 0x0080
+
+ #define IN_LOCK(ip) lockmgr(&ip->i_lock, LK_EXCLUSIVE, \
+ NULL, curproc)
+ #define IN_UNLOCK(ip) lockmgr(&ip->i_lock, LK_RELEASE, \
+ NULL, curproc)
+
+ #include
+
+ #define AFS_VFS_ENV 1
+ #define AFS_VFSINCL_ENV 1
+ #define AFS_GREEDY43_ENV 1
+ #define AFS_ENV 1
+
+ #define AFS_SYSCALL 339
+ #define AFS_MOUNT_AFS "afs"
+
+ #ifndef MOUNT_UFS
+ #define MOUNT_UFS "ufs"
+ #endif
+
+ #ifndef MOUNT_AFS
+ #define MOUNT_AFS AFS_MOUNT_AFS
+ #endif
+
+ #define RXK_LISTENER_ENV 1
+ #define AFS_GCPAGS 0 /* if nonzero, garbage collect PAGs */
+ #define AFS_USE_GETTIMEOFDAY 1 /* use gettimeofday to implement rx clock */
+
+ /* Extra kernel definitions (from kdefs file) */
+ #ifdef _KERNEL
+ #define AFS_GLOBAL_SUNLOCK 1
+ #define AFS_VFS34 1 /* What is VFS34??? */
+ #define AFS_SHORTGID 0 /* are group id's short? */
+ #define afsio_iov uio_iov
+ #define afsio_iovcnt uio_iovcnt
+ #define afsio_offset uio_offset
+ #define afsio_seg uio_segflg
+ #define afsio_resid uio_resid
+ #define AFS_UIOSYS UIO_SYSSPACE
+ #define AFS_UIOUSER UIO_USERSPACE
+ #define AFS_CLBYTES CLBYTES
+ #define osi_GetTime(x) microtime(x)
+ #define AFS_KALLOC(x) osi_fbsd_alloc((x), 1)
+ #undef AFS_KALLOC_NOSLEEP
+ #define AFS_KALLOC_NOSLEEP(x) osi_fbsd_alloc((x), 0)
+ #define AFS_KFREE(x,y) osi_fbsd_free((x))
+ #define v_count v_usecount
+ #define v_vfsp v_mount
+ #define vfs_bsize mnt_stat.f_bsize
+ #define vfs_fsid mnt_stat.f_fsid
+ #define va_nodeid va_fileid
+ #define vfs_vnodecovered mnt_vnodecovered
+ #define direct dirent
+ #define vnode_t struct vnode
+
+ #ifndef MUTEX_DEFAULT
+ #define MUTEX_DEFAULT 0
+ #endif /* MUTEX_DEFAULT */
+
+ #ifndef SSYS
+ #define SSYS 0x00002
+ #endif /* SSYS */
+
+ #define p_rcred p_ucred
+
+ #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__)
+ enum vcexcl { NONEXCL, EXCL };
+
+ #ifdef KERNEL
+ #ifndef MIN
+ #define MIN(A,B) ((A) < (B) ? (A) : (B))
+ #endif
+ #ifndef MAX
+ #define MAX(A,B) ((A) > (B) ? (A) : (B))
+ #endif
+ #endif /* KERNEL */
+
+ #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */
+ #endif /* _KERNEL */
+
+ #else /* !defined(UKERNEL) */
+
+ /* This section for user space compiles only */
+
+ #define UKERNEL 1 /* user space kernel */
+ #define AFS_ENV 1
+ #define AFS_VFSINCL_ENV 1
+ #define AFS_USR_FBSD40_ENV 1
+ #define AFS_USR_FBSD42_ENV 1
+ #define AFS_USR_FBSD43_ENV 1
+ #define AFS_USR_FBSD44_ENV 1
+ #define AFS_USR_FBSD45_ENV 1
+ #define AFS_USR_FBSD46_ENV 1
+ #define AFS_USR_FBSD47_ENV 1
+ #define AFS_USR_FBSD50_ENV 1
+ #define AFS_USR_FBSD51_ENV 1
+ #define AFS_USR_FBSD52_ENV 1
+ #define AFS_USR_FBSD53_ENV 1
+ #define AFS_USR_FBSD60_ENV 1
+ #define AFS_USR_FBSD61_ENV 1
+ #define AFS_USR_FBSD62_ENV 1
+ #define AFS_USR_FBSD_ENV 1
+ #define AFS_NONFSTRANS 1
+
+ #define AFS_MOUNT_AFS "afs" /* The name of the filesystem type. */
+ #define AFS_SYSCALL 339
+ #define AFS_NAMEI_ENV 1 /* User space interface to file system */
+ #define AFS_64BIT_ENV 1
+ #define AFS_64BIT_IOPS_ENV 1 /* Needed for NAMEI */
+ #define AFS_USERSPACE_IP_ADDR 1
+ #define RXK_LISTENER_ENV 1
+ #define AFS_GCPAGS 0 /* if nonzero, garbage collect PAGs */
+
+ #include
+
+ #define afsio_iov uio_iov
+ #define afsio_iovcnt uio_iovcnt
+ #define afsio_offset uio_offset
+ #define afsio_seg uio_segflg
+ #define afsio_fmode uio_fmode
+ #define afsio_resid uio_resid
+ #define AFS_UIOSYS 1
+ #define AFS_UIOUSER UIO_USERSPACE
+ #define AFS_CLBYTES MCLBYTES
+ #define AFS_MINCHANGE 2
+ #define VATTR_NULL usr_vattr_null
+
+ #define AFS_DIRENT
+ #ifndef CMSERVERPREF
+ #define CMSERVERPREF
+ #endif
+
+ #include
+ #include
+ #include
+ #include
+ #include
+ #include
+ #include
+ #include
+
+ #endif /* !defined(UKERNEL) */
+
+ /* general user-space compiles */
+
+ #if defined(UKERNEL) || !defined(KERNEL)
+ #define STDLIB_HAS_MALLOC_PROTOS 1
+ #endif
+
+ #endif /* AFS_PARAM_H */
Index: openafs/src/config/param.i386_fbsd_70.h
diff -c /dev/null openafs/src/config/param.i386_fbsd_70.h:1.1.2.2
*** /dev/null Mon Feb 11 10:58:22 2008
--- openafs/src/config/param.i386_fbsd_70.h Tue Jan 15 01:09:12 2008
***************
*** 0 ****
--- 1,211 ----
+ #ifndef AFS_PARAM_H
+ #define AFS_PARAM_H
+
+ /* Machine / Operating system information */
+ #define SYS_NAME "i386_fbsd_70"
+ #define SYS_NAME_ID SYS_NAME_ID_i386_fbsd_70
+
+ #define AFSLITTLE_ENDIAN 1
+ #define AFS_HAVE_FFS 1 /* Use system's ffs. */
+ #define AFS_HAVE_STATVFS 1 /* System doesn't support statvfs */
+ #define AFS_VM_RDWR_ENV 1 /* read/write implemented via VM */
+
+
+ #ifndef UKERNEL
+ /* This section for kernel libafs compiles only */
+
+ #ifndef IGNORE_STDS_H
+ #include
+ #endif
+
+ #define AFS_XBSD_ENV 1 /* {Free,Open,Net}BSD */
+ #define AFS_X86_XBSD_ENV 1
+
+ #define AFS_NAMEI_ENV 1 /* User space interface to file system */
+ #define AFS_64BIT_ENV 1
+ #define AFS_64BIT_CLIENT 1
+ #define AFS_64BIT_IOPS_ENV 1 /* Needed for NAMEI */
+ #define AFS_FBSD_ENV 1
+ #define AFS_FBSD40_ENV 1
+ #define AFS_FBSD42_ENV 1
+ #define AFS_FBSD43_ENV 1
+ #define AFS_FBSD44_ENV 1
+ #define AFS_FBSD45_ENV 1
+ #define AFS_FBSD46_ENV 1
+ #define AFS_FBSD47_ENV 1
+ #define AFS_FBSD50_ENV 1
+ #define AFS_FBSD51_ENV 1
+ #define AFS_FBSD52_ENV 1
+ #define AFS_FBSD53_ENV 1
+ #define AFS_FBSD60_ENV 1
+ #define AFS_FBSD61_ENV 1
+ #define AFS_FBSD62_ENV 1
+ #define AFS_FBSD70_ENV 1
+ #define AFS_X86_FBSD_ENV 1
+ #define AFS_X86_FBSD40_ENV 1
+ #define AFS_X86_FBSD42_ENV 1
+ #define AFS_X86_FBSD43_ENV 1
+ #define AFS_X86_FBSD46_ENV 1
+ #define AFS_X86_FBSD47_ENV 1
+ #define AFS_X86_FBSD50_ENV 1
+ #define AFS_X86_FBSD60_ENV 1 /* added at 70--ie, some changes should port <-- */
+ #define AFS_X86_FBSD62_ENV 1
+ #define AFS_X86_FBSD70_ENV 1
+ #define AFS_X86_ENV 1
+ #define AFS_NONFSTRANS 1
+ #define FTRUNC O_TRUNC
+
+ #define IUPD 0x0010
+ #define IACC 0x0020
+ #define ICHG 0x0040
+ #define IMOD 0x0080
+
+ #define IN_LOCK(ip) lockmgr(&ip->i_lock, LK_EXCLUSIVE, \
+ NULL, curproc)
+ #define IN_UNLOCK(ip) lockmgr(&ip->i_lock, LK_RELEASE, \
+ NULL, curproc)
+
+ #include
+
+ #define AFS_VFS_ENV 1
+ #define AFS_VFSINCL_ENV 1
+ #define AFS_GREEDY43_ENV 1
+ #define AFS_ENV 1
+
+ #define AFS_SYSCALL 339
+ #define AFS_MOUNT_AFS "afs"
+
+ #ifndef MOUNT_UFS
+ #define MOUNT_UFS "ufs"
+ #endif
+
+ #ifndef MOUNT_AFS
+ #define MOUNT_AFS AFS_MOUNT_AFS
+ #endif
+
+ #define RXK_LISTENER_ENV 1
+ #define AFS_GCPAGS 0 /* if nonzero, garbage collect PAGs */
+ #define AFS_USE_GETTIMEOFDAY 1 /* use gettimeofday to implement rx clock */
+
+ /* Extra kernel definitions (from kdefs file) */
+ #ifdef _KERNEL
+ #define AFS_GLOBAL_SUNLOCK 1
+ #define AFS_VFS34 1 /* What is VFS34??? */
+ #define AFS_SHORTGID 0 /* are group id's short? */
+ #define afsio_iov uio_iov
+ #define afsio_iovcnt uio_iovcnt
+ #define afsio_offset uio_offset
+ #define afsio_seg uio_segflg
+ #define afsio_resid uio_resid
+ #define AFS_UIOSYS UIO_SYSSPACE
+ #define AFS_UIOUSER UIO_USERSPACE
+ #define AFS_CLBYTES CLBYTES
+ #define osi_GetTime(x) microtime(x)
+ #define AFS_KALLOC(x) osi_fbsd_alloc((x), 1)
+ #undef AFS_KALLOC_NOSLEEP
+ #define AFS_KALLOC_NOSLEEP(x) osi_fbsd_alloc((x), 0)
+ #define AFS_KFREE(x,y) osi_fbsd_free((x))
+ #define v_count v_usecount
+ #define v_vfsp v_mount
+ #define vfs_bsize mnt_stat.f_bsize
+ #define vfs_fsid mnt_stat.f_fsid
+ #define va_nodeid va_fileid
+ #define vfs_vnodecovered mnt_vnodecovered
+ #define direct dirent
+ #define vnode_t struct vnode
+
+ #ifndef MUTEX_DEFAULT
+ #define MUTEX_DEFAULT 0
+ #endif /* MUTEX_DEFAULT */
+
+ #ifndef SSYS
+ #define SSYS 0x00002
+ #endif /* SSYS */
+
+ #define p_rcred p_ucred
+
+ #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__)
+ enum vcexcl { NONEXCL, EXCL };
+
+ #ifdef KERNEL
+ #ifndef MIN
+ #define MIN(A,B) ((A) < (B) ? (A) : (B))
+ #endif
+ #ifndef MAX
+ #define MAX(A,B) ((A) > (B) ? (A) : (B))
+ #endif
+ #endif /* KERNEL */
+
+ #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */
+ #endif /* _KERNEL */
+
+ #else /* !defined(UKERNEL) */
+
+ /* This section for user space compiles only */
+
+ #define UKERNEL 1 /* user space kernel */
+ #define AFS_ENV 1
+ #define AFS_VFSINCL_ENV 1
+ #define AFS_USR_FBSD40_ENV 1
+ #define AFS_USR_FBSD42_ENV 1
+ #define AFS_USR_FBSD43_ENV 1
+ #define AFS_USR_FBSD44_ENV 1
+ #define AFS_USR_FBSD45_ENV 1
+ #define AFS_USR_FBSD46_ENV 1
+ #define AFS_USR_FBSD47_ENV 1
+ #define AFS_USR_FBSD50_ENV 1
+ #define AFS_USR_FBSD51_ENV 1
+ #define AFS_USR_FBSD52_ENV 1
+ #define AFS_USR_FBSD53_ENV 1
+ #define AFS_USR_FBSD60_ENV 1
+ #define AFS_USR_FBSD61_ENV 1
+ #define AFS_USR_FBSD70_ENV 1
+ #define AFS_USR_FBSD_ENV 1
+ #define AFS_NONFSTRANS 1
+
+ #define AFS_MOUNT_AFS "afs" /* The name of the filesystem type. */
+ #define AFS_SYSCALL 339
+ #define AFS_NAMEI_ENV 1 /* User space interface to file system */
+ #define AFS_64BIT_ENV 1
+ #define AFS_64BIT_IOPS_ENV 1 /* Needed for NAMEI */
+ #define AFS_USERSPACE_IP_ADDR 1
+ #define RXK_LISTENER_ENV 1
+ #define AFS_GCPAGS 0 /* if nonzero, garbage collect PAGs */
+
+ #include
+
+ #define afsio_iov uio_iov
+ #define afsio_iovcnt uio_iovcnt
+ #define afsio_offset uio_offset
+ #define afsio_seg uio_segflg
+ #define afsio_fmode uio_fmode
+ #define afsio_resid uio_resid
+ #define AFS_UIOSYS 1
+ #define AFS_UIOUSER UIO_USERSPACE
+ #define AFS_CLBYTES MCLBYTES
+ #define AFS_MINCHANGE 2
+ #define VATTR_NULL usr_vattr_null
+
+ #define AFS_DIRENT
+ #ifndef CMSERVERPREF
+ #define CMSERVERPREF
+ #endif
+
+ #include
+ #include
+ #include
+ #include
+ #include
+ #include
+ #include
+ #include
+
+ #endif /* !defined(UKERNEL) */
+
+ /* general user-space compiles */
+
+ #if defined(UKERNEL) || !defined(KERNEL)
+ #define STDLIB_HAS_MALLOC_PROTOS 1
+ #endif
+
+ #endif /* AFS_PARAM_H */
Index: openafs/src/des/andrew-conf.h
diff -c openafs/src/des/andrew-conf.h:1.18 openafs/src/des/andrew-conf.h:1.18.2.1
*** openafs/src/des/andrew-conf.h:1.18 Thu Mar 9 01:34:36 2006
--- openafs/src/des/andrew-conf.h Tue Jan 15 00:12:14 2008
***************
*** 82,88 ****
--- 82,92 ----
#ifdef AFS_PPC64_LINUX20_ENV
#include "conf-ppc64-linux.h"
#else
+ #ifdef AFS_ARM_LINUX20_ENV
+ #include "conf-arm-linux.h"
+ #else
#include "conf-i386-linux.h"
+ #endif /* AFS_ARM_LINUX20_ENV */
#endif /* AFS_PPC64_LINUX20_ENV */
#endif /* AFS_AMD64_LINUX20_ENV */
#endif /* AFS_IA64_LINUX20_ENV */
Index: openafs/src/des/conf-arm-linux.h
diff -c /dev/null openafs/src/des/conf-arm-linux.h:1.1.2.2
*** /dev/null Mon Feb 11 10:58:22 2008
--- openafs/src/des/conf-arm-linux.h Tue Jan 15 00:12:14 2008
***************
*** 0 ****
--- 1,14 ----
+ /*
+ * Copyright 1988 by the Massachusetts Institute of Technology.
+ *
+ * For copying and distribution information, please see the file
+ * .
+ *
+ * Machine-type definitions: Linux on Intel
+ */
+
+ #include
+
+ #define BITS32
+ #define BIG
+ #define LSBFIRST
Index: openafs/src/fsint/afsint.xg
diff -c openafs/src/fsint/afsint.xg:1.13 openafs/src/fsint/afsint.xg:1.13.14.1
*** openafs/src/fsint/afsint.xg:1.13 Wed Jun 2 02:57:35 2004
--- openafs/src/fsint/afsint.xg Tue Feb 5 12:26:46 2008
***************
*** 693,703 ****
) split = 65538;
GiveUpAllCallBacks(
! ) = 65539;
GetCapabilities(
Capabilities *capabilities
! ) = 65540;
CallBackRxConnAddr(
IN afs_int32 *addr
--- 693,703 ----
) split = 65538;
GiveUpAllCallBacks(
! ) multi = 65539;
GetCapabilities(
Capabilities *capabilities
! ) multi = 65540;
CallBackRxConnAddr(
IN afs_int32 *addr
Index: openafs/src/kauth/NTMakefile
diff -c openafs/src/kauth/NTMakefile:1.11.4.1 openafs/src/kauth/NTMakefile:1.11.4.2
*** openafs/src/kauth/NTMakefile:1.11.4.1 Tue Jul 4 02:28:24 2006
--- openafs/src/kauth/NTMakefile Sat Feb 2 08:43:25 2008
***************
*** 125,131 ****
$(DESTDIR)\lib\afs\afsprocmgmt.lib
$(KASERVER): $(KASERVER_OBJS) $(AFSLIBS) $(KASERVER_EXELIBS)
! $(EXECONLINK) dnsapi.lib mpr.lib iphlpapi.lib
$(_VC_MANIFEST_EMBED_EXE)
$(EXEPREP)
--- 125,131 ----
$(DESTDIR)\lib\afs\afsprocmgmt.lib
$(KASERVER): $(KASERVER_OBJS) $(AFSLIBS) $(KASERVER_EXELIBS)
! $(EXECONLINK) dnsapi.lib mpr.lib iphlpapi.lib shell32.lib
$(_VC_MANIFEST_EMBED_EXE)
$(EXEPREP)
***************
*** 150,156 ****
$(OUT)\kas.res
$(KAS): $(KAS_OBJS) $(AFSLIBS) $(KAUTH_LIBFILE) $(TOKENLIB)
! $(EXECONLINK) dnsapi.lib mpr.lib iphlpapi.lib
$(_VC_MANIFEST_EMBED_EXE)
$(EXEPREP)
--- 150,156 ----
$(OUT)\kas.res
$(KAS): $(KAS_OBJS) $(AFSLIBS) $(KAUTH_LIBFILE) $(TOKENLIB)
! $(EXECONLINK) dnsapi.lib mpr.lib iphlpapi.lib shell32.lib
$(_VC_MANIFEST_EMBED_EXE)
$(EXEPREP)
***************
*** 164,186 ****
$(OUT)\kpasswd.res
$(KPASSWD_EXEFILE): $(KPASSWD_OBJS) $(AFSLIBS) $(KAUTH_LIBFILE) $(TOKENLIB)
! $(EXECONLINK) dnsapi.lib mpr.lib iphlpapi.lib
$(_VC_MANIFEST_EMBED_EXE)
$(EXEPREP)
#kpwvalid.exe
$(OUT)\kpwvalid.exe: $(OUT)\kpwvalid.obj $(AFSLIBS) $(KAUTH_LIBFILE)
! $(EXECONLINK) dnsapi.lib mpr.lib iphlpapi.lib
$(_VC_MANIFEST_EMBED_EXE)
#kdb.exe - Not implemented for NT - because dbm not available on NT
#kdb.exe: $(OUT)\kdb.obj $(AFSLIBS) $(KAUTH_LIBFILE)
! # $(EXECONLINK) dnsapi.lib mpr.lib iphlpapi.lib
# $(_VC_MANIFEST_EMBED_EXE)
#rebuild.exe
$(OUT)\rebuild.exe: $(OUT)\rebuild.obj $(OUT)\kautils.obj $(AFSLIBS)
! $(EXECONLINK) dnsapi.lib mpr.lib iphlpapi.lib
$(_VC_MANIFEST_EMBED_EXE)
############################################################################
--- 164,186 ----
$(OUT)\kpasswd.res
$(KPASSWD_EXEFILE): $(KPASSWD_OBJS) $(AFSLIBS) $(KAUTH_LIBFILE) $(TOKENLIB)
! $(EXECONLINK) dnsapi.lib mpr.lib iphlpapi.lib shell32.lib
$(_VC_MANIFEST_EMBED_EXE)
$(EXEPREP)
#kpwvalid.exe
$(OUT)\kpwvalid.exe: $(OUT)\kpwvalid.obj $(AFSLIBS) $(KAUTH_LIBFILE)
! $(EXECONLINK) dnsapi.lib mpr.lib iphlpapi.lib shell32.lib
$(_VC_MANIFEST_EMBED_EXE)
#kdb.exe - Not implemented for NT - because dbm not available on NT
#kdb.exe: $(OUT)\kdb.obj $(AFSLIBS) $(KAUTH_LIBFILE)
! # $(EXECONLINK) dnsapi.lib mpr.lib iphlpapi.lib shell32.lib
# $(_VC_MANIFEST_EMBED_EXE)
#rebuild.exe
$(OUT)\rebuild.exe: $(OUT)\rebuild.obj $(OUT)\kautils.obj $(AFSLIBS)
! $(EXECONLINK) dnsapi.lib mpr.lib iphlpapi.lib shell32.lib
$(_VC_MANIFEST_EMBED_EXE)
############################################################################
Index: openafs/src/kauth/krb_udp.c
diff -c openafs/src/kauth/krb_udp.c:1.23.14.3 openafs/src/kauth/krb_udp.c:1.23.14.4
*** openafs/src/kauth/krb_udp.c:1.23.14.3 Mon Nov 26 16:08:42 2007
--- openafs/src/kauth/krb_udp.c Sun Feb 3 22:59:06 2008
***************
*** 16,22 ****
#include
RCSID
! ("$Header: /cvs/openafs/src/kauth/krb_udp.c,v 1.23.14.3 2007/11/26 21:08:42 shadow Exp $");
#include
#include
--- 16,22 ----
#include
RCSID
! ("$Header: /cvs/openafs/src/kauth/krb_udp.c,v 1.23.14.4 2008/02/04 03:59:06 jaltman Exp $");
#include
#include
***************
*** 60,65 ****
--- 60,68 ----
#define KDC_GEN_ERR 20
#endif
+ #ifndef AFS_NT40_ENV
+ #define closesocket close
+ #endif
int krb_udp_debug = 0;
***************
*** 892,902 ****
}
}
if (sock_kerb >= 0) {
! close(sock_kerb);
sock_kerb = -1;
}
if (sock_kerb5 >= 0) {
! close(sock_kerb5);
sock_kerb5 = -1;
}
printf("UDP SocketListener exiting due to error\n");
--- 895,905 ----
}
}
if (sock_kerb >= 0) {
! closesocket(sock_kerb);
sock_kerb = -1;
}
if (sock_kerb5 >= 0) {
! closesocket(sock_kerb5);
sock_kerb5 = -1;
}
printf("UDP SocketListener exiting due to error\n");
Index: openafs/src/libadmin/adminutil/NTMakefile
diff -c openafs/src/libadmin/adminutil/NTMakefile:1.8 openafs/src/libadmin/adminutil/NTMakefile:1.8.4.1
*** openafs/src/libadmin/adminutil/NTMakefile:1.8 Sun Nov 20 20:56:55 2005
--- openafs/src/libadmin/adminutil/NTMakefile Sat Feb 2 08:43:25 2008
***************
*** 143,149 ****
$(DESTDIR)\lib\afs\afsreg.lib
$(DLLFILE): $(DLLOBJS) $(DLLLIBS)
! $(DLLCONLINK) /DEF:afsadminutil.def
$(_VC_MANIFEST_EMBED_DLL)
$(DLLPREP)
$(COPY) $*.lib $(ILIBDIR)
--- 143,149 ----
$(DESTDIR)\lib\afs\afsreg.lib
$(DLLFILE): $(DLLOBJS) $(DLLLIBS)
! $(DLLCONLINK) /DEF:afsadminutil.def shell32.lib
$(_VC_MANIFEST_EMBED_DLL)
$(DLLPREP)
$(COPY) $*.lib $(ILIBDIR)
Index: openafs/src/libadmin/bos/Makefile.in
diff -c openafs/src/libadmin/bos/Makefile.in:1.7 openafs/src/libadmin/bos/Makefile.in:1.7.14.1
*** openafs/src/libadmin/bos/Makefile.in:1.7 Sat Jan 11 02:34:29 2003
--- openafs/src/libadmin/bos/Makefile.in Mon Jan 21 13:38:02 2008
***************
*** 12,18 ****
CFLAGS=${COMMON_CFLAGS} ${MT_CFLAGS}
CCRULE = ${CC} ${CFLAGS} -c $?
! BOZO = ../../bozo/
ADMINOBJS = afs_bosAdmin.o
--- 12,18 ----
CFLAGS=${COMMON_CFLAGS} ${MT_CFLAGS}
CCRULE = ${CC} ${CFLAGS} -c $?
! BOZO = ../../bozo
ADMINOBJS = afs_bosAdmin.o
Index: openafs/src/libadmin/cfg/NTMakefile
diff -c openafs/src/libadmin/cfg/NTMakefile:1.6 openafs/src/libadmin/cfg/NTMakefile:1.6.4.2
*** openafs/src/libadmin/cfg/NTMakefile:1.6 Sun Nov 20 20:56:57 2005
--- openafs/src/libadmin/cfg/NTMakefile Sat Feb 2 08:43:25 2008
***************
*** 55,64 ****
$(DESTDIR)\lib\afs\afsvosadmin.lib \
$(DESTDIR)\lib\afsrpc.lib \
$(DESTDIR)\lib\afsauthent.lib \
! $(DESTDIR)\lib\afs\afsreg.lib
$(DLLFILE): $(DLLOBJS) $(DLLLIBS)
! $(DLLCONLINK) /DEF:afscfgadmin.def
$(_VC_MANIFEST_EMBED_DLL)
$(DLLPREP)
$(COPY) $*.lib $(ILIBDIR)
--- 55,65 ----
$(DESTDIR)\lib\afs\afsvosadmin.lib \
$(DESTDIR)\lib\afsrpc.lib \
$(DESTDIR)\lib\afsauthent.lib \
! $(DESTDIR)\lib\afs\afsreg.lib \
! $(DESTDIR)\lib\libafsconf.lib
$(DLLFILE): $(DLLOBJS) $(DLLLIBS)
! $(DLLCONLINK) /DEF:afscfgadmin.def shell32.lib
$(_VC_MANIFEST_EMBED_DLL)
$(DLLPREP)
$(COPY) $*.lib $(ILIBDIR)
Index: openafs/src/libadmin/kas/Makefile.in
diff -c openafs/src/libadmin/kas/Makefile.in:1.7 openafs/src/libadmin/kas/Makefile.in:1.7.14.1
*** openafs/src/libadmin/kas/Makefile.in:1.7 Sat Jan 11 02:34:35 2003
--- openafs/src/libadmin/kas/Makefile.in Mon Jan 21 13:38:02 2008
***************
*** 12,18 ****
CFLAGS=${COMMON_CFLAGS} ${MT_CFLAGS} -I../../kauth -I${srcdir}/../../kauth
CCRULE = ${CC} ${CFLAGS} -c $?
! KAUTH= ${srcdir}/../../kauth/
ADMINOBJS = afs_kasAdmin.o
--- 12,18 ----
CFLAGS=${COMMON_CFLAGS} ${MT_CFLAGS} -I../../kauth -I${srcdir}/../../kauth
CCRULE = ${CC} ${CFLAGS} -c $?
! KAUTH= ${srcdir}/../../kauth
ADMINOBJS = afs_kasAdmin.o
Index: openafs/src/libadmin/pts/Makefile.in
diff -c openafs/src/libadmin/pts/Makefile.in:1.7 openafs/src/libadmin/pts/Makefile.in:1.7.14.1
*** openafs/src/libadmin/pts/Makefile.in:1.7 Sat Jan 11 02:34:36 2003
--- openafs/src/libadmin/pts/Makefile.in Mon Jan 21 13:38:03 2008
***************
*** 12,18 ****
CFLAGS=${COMMON_CFLAGS} ${MT_CFLAGS}
CCRULE = ${CC} ${CFLAGS} -c $?
! PTSERVER = ../../ptserver/
ADMINOBJS = \
afs_ptsAdmin.o
--- 12,18 ----
CFLAGS=${COMMON_CFLAGS} ${MT_CFLAGS}
CCRULE = ${CC} ${CFLAGS} -c $?
! PTSERVER = ../../ptserver
ADMINOBJS = \
afs_ptsAdmin.o
Index: openafs/src/libadmin/vos/Makefile.in
diff -c openafs/src/libadmin/vos/Makefile.in:1.7 openafs/src/libadmin/vos/Makefile.in:1.7.14.1
*** openafs/src/libadmin/vos/Makefile.in:1.7 Sat Jan 11 02:34:39 2003
--- openafs/src/libadmin/vos/Makefile.in Mon Jan 21 13:38:03 2008
***************
*** 12,20 ****
CFLAGS=${COMMON_CFLAGS} ${MT_CFLAGS}
CCRULE = ${CC} ${CFLAGS} -c $?
! VLSERVER = ../../vlserver/
! VOLSER = ../../volser/
! FSINT = ../../fsint/
ADMINOBJS =\
afs_vosAdmin.o \
--- 12,20 ----
CFLAGS=${COMMON_CFLAGS} ${MT_CFLAGS}
CCRULE = ${CC} ${CFLAGS} -c $?
! VLSERVER = ../../vlserver
! VOLSER = ../../volser
! FSINT = ../../fsint
ADMINOBJS =\
afs_vosAdmin.o \
Index: openafs/src/libafs/MakefileProto.FBSD.in
diff -c openafs/src/libafs/MakefileProto.FBSD.in:1.27 openafs/src/libafs/MakefileProto.FBSD.in:1.27.4.1
*** openafs/src/libafs/MakefileProto.FBSD.in:1.27 Fri Jan 20 11:40:25 2006
--- openafs/src/libafs/MakefileProto.FBSD.in Tue Jan 15 01:09:13 2008
***************
*** 30,37 ****
# System specific build commands and flags
KSRC = @BSD_KERNEL_PATH@
KBLD = @BSD_KERNEL_BUILD@
! KDEFS=-Wall -ansi -nostdinc -I/usr/include -D_KERNEL -DKLD_MODULE \
! -elf -mpreferred-stack-boundary=2 -fformat-extensions \
-include ${KBLD}/opt_global.h \
--- 30,39 ----
# System specific build commands and flags
KSRC = @BSD_KERNEL_PATH@
KBLD = @BSD_KERNEL_BUILD@
! KDEFS=-Wall -nostdinc -I/usr/include -D_KERNEL -DKLD_MODULE \
! -elf -mpreferred-stack-boundary=2 \
!
! -fformat-extensions \
-include ${KBLD}/opt_global.h \
Index: openafs/src/libafsauthent/NTMakefile
diff -c openafs/src/libafsauthent/NTMakefile:1.15 openafs/src/libafsauthent/NTMakefile:1.15.4.1
*** openafs/src/libafsauthent/NTMakefile:1.15 Sun Nov 20 20:57:07 2005
--- openafs/src/libafsauthent/NTMakefile Sat Feb 2 08:43:25 2008
***************
*** 144,150 ****
$(DESTDIR)\lib\lanahelper.lib
$(LIBFILE): $(DLLOBJS) $(DLLLIBS) $(RXOBJS)
! $(DLLCONLINK) /DEF:afsauthent.def rpcrt4.lib dnsapi.lib mpr.lib secur32.lib
$(_VC_MANIFEST_EMBED_DLL)
$(DLLPREP)
--- 144,150 ----
$(DESTDIR)\lib\lanahelper.lib
$(LIBFILE): $(DLLOBJS) $(DLLLIBS) $(RXOBJS)
! $(DLLCONLINK) /DEF:afsauthent.def rpcrt4.lib dnsapi.lib mpr.lib secur32.lib shell32.lib
$(_VC_MANIFEST_EMBED_DLL)
$(DLLPREP)
Index: openafs/src/libafsauthent/afsauthent.def
diff -c openafs/src/libafsauthent/afsauthent.def:1.5.2.2 openafs/src/libafsauthent/afsauthent.def:1.5.2.3
*** openafs/src/libafsauthent/afsauthent.def:1.5.2.2 Tue Jul 4 02:28:25 2006
--- openafs/src/libafsauthent/afsauthent.def Thu Jan 24 11:08:11 2008
***************
*** 114,116 ****
--- 114,117 ----
rx_InitHost @112
VOTE_GetSyncSite @113
ubik_RefreshConn @114
+ rx_SetSecurityConfiguration @115
Index: openafs/src/libafsrpc/afsrpc.def
diff -c openafs/src/libafsrpc/afsrpc.def:1.11.4.5 openafs/src/libafsrpc/afsrpc.def:1.11.4.7
*** openafs/src/libafsrpc/afsrpc.def:1.11.4.5 Tue Apr 10 18:09:18 2007
--- openafs/src/libafsrpc/afsrpc.def Tue Feb 5 12:26:47 2008
***************
*** 220,222 ****
--- 220,228 ----
rx_NewServiceHost @225
osi_AssertFailU @226
DllMain @227
+ rx_SetSecurityConfiguration @228
+ ; RXAFSCB_ExecuteRequest @229
+ EndRXAFS_GetTime @230
+ StartRXAFS_GetTime @231
+ EndRXAFS_GetCapabilities @232
+ StartRXAFS_GetCapabilities @233
Index: openafs/src/libuafs/Makefile.common.in
diff -c openafs/src/libuafs/Makefile.common.in:1.13.4.4 openafs/src/libuafs/Makefile.common.in:1.13.4.5
*** openafs/src/libuafs/Makefile.common.in:1.13.4.4 Mon Jul 31 17:27:41 2006
--- openafs/src/libuafs/Makefile.common.in Mon Jan 21 13:38:03 2008
***************
*** 839,847 ****
# These files are for the netscape plugin
! $(WEBOBJ)/afs_atomlist.o: $(TOP_SRCDIR)/util//afs_atomlist.c
$(CRULE2)
! $(WEBOBJ)/afs_lhash.o: $(TOP_SRCDIR)/util//afs_lhash.c
$(CRULE2)
$(WEBOBJ)/afs_analyze.o: $(TOP_SRC_AFS)/afs_analyze.c
$(CRULE2)
--- 839,847 ----
# These files are for the netscape plugin
! $(WEBOBJ)/afs_atomlist.o: $(TOP_SRCDIR)/util/afs_atomlist.c
$(CRULE2)
! $(WEBOBJ)/afs_lhash.o: $(TOP_SRCDIR)/util/afs_lhash.c
$(CRULE2)
$(WEBOBJ)/afs_analyze.o: $(TOP_SRC_AFS)/afs_analyze.c
$(CRULE2)
***************
*** 1102,1108 ****
$(JUAFS)/afs_atomlist.o: $(TOP_SRCDIR)/util/afs_atomlist.c
$(CRULE1)
! $(JUAFS)/afs_lhash.o: $(TOP_SRCDIR)/util//afs_lhash.c
$(CRULE1)
$(JUAFS)/afs_analyze.o: $(TOP_SRC_AFS)/afs_analyze.c
$(CRULE1)
--- 1102,1108 ----
$(JUAFS)/afs_atomlist.o: $(TOP_SRCDIR)/util/afs_atomlist.c
$(CRULE1)
! $(JUAFS)/afs_lhash.o: $(TOP_SRCDIR)/util/afs_lhash.c
$(CRULE1)
$(JUAFS)/afs_analyze.o: $(TOP_SRC_AFS)/afs_analyze.c
$(CRULE1)
Index: openafs/src/libuafs/MakefileProto.FBSD.in
diff -c openafs/src/libuafs/MakefileProto.FBSD.in:1.11 openafs/src/libuafs/MakefileProto.FBSD.in:1.11.14.1
*** openafs/src/libuafs/MakefileProto.FBSD.in:1.11 Sun Apr 18 02:10:33 2004
--- openafs/src/libuafs/MakefileProto.FBSD.in Tue Jan 15 01:09:13 2008
***************
*** 19,25 ****
--- 19,29 ----
TEST_CFLAGS=-D_REENTRANT -DAFS_PTHREAD_ENV -DAFS_FBSD40_ENV
TEST_LDFLAGS=
+
TEST_LIBS=-lc_r
+
+ TEST_LIBS=-lpthread
+
LIBUAFS = libuafs.a
LIBJUAFS = libjuafs.a
Index: openafs/src/lwp/lwp.c
diff -c openafs/src/lwp/lwp.c:1.34.2.3 openafs/src/lwp/lwp.c:1.34.2.4
*** openafs/src/lwp/lwp.c:1.34.2.3 Mon Nov 26 16:08:43 2007
--- openafs/src/lwp/lwp.c Tue Jan 15 00:12:15 2008
***************
*** 17,23 ****
#include
#include
! RCSID("$Header: /cvs/openafs/src/lwp/lwp.c,v 1.34.2.3 2007/11/26 21:08:43 shadow Exp $");
#include
#include
--- 17,23 ----
#include
#include
! RCSID("$Header: /cvs/openafs/src/lwp/lwp.c,v 1.34.2.4 2008/01/15 05:12:15 shadow Exp $");
#include
#include
***************
*** 47,57 ****
--- 47,59 ----
extern void *malloc(int size);
extern void *realloc(void *ptr, int size);
#endif
+ #ifndef AFS_ARM_LINUX20_ENV
#if defined(AFS_OSF_ENV) || defined(AFS_S390_LINUX20_ENV)
extern int PRE_Block; /* from preempt.c */
#else
extern char PRE_Block; /* from preempt.c */
#endif
+ #endif
#define ON 1
#define OFF 0
***************
*** 367,377 ****
--- 369,381 ----
Initialize_PCB(temp, priority, stackmemory, stacksize, ep, parm, name);
insert(temp, &runnable[priority]);
temp2 = lwp_cpptr;
+ #ifndef AFS_ARM_LINUX20_ENV
if (PRE_Block != 0)
Abort_LWP("PRE_Block not 0");
/* Gross hack: beware! */
PRE_Block = 1;
+ #endif
lwp_cpptr = temp;
#if defined(AFS_PARISC_LINUX24_ENV)
savecontext(Create_Process_Part2, &temp2->context,
***************
*** 460,470 ****
--- 464,476 ----
Initialize_PCB(temp, priority, stackptr, stacksize, ep, parm, name);
insert(temp, &runnable[priority]);
temp2 = lwp_cpptr;
+ #ifndef AFS_ARM_LINUX20_ENV
if (PRE_Block != 0)
Abort_LWP("PRE_Block not 0");
/* Gross hack: beware! */
PRE_Block = 1;
+ #endif
lwp_cpptr = temp;
savecontext(Create_Process_Part2, &temp2->context,
stackptr + stacksize - sizeof(void *));
***************
*** 956,963 ****
--- 962,971 ----
printf("Dispatch %d [PCB at 0x%x] \"%s\"\n", ++dispatch_count,
runnable[i].head, runnable[i].head->name);
#endif
+ #ifndef AFS_ARM_LINUX20_ENV
if (PRE_Block != 1)
Abort_LWP("PRE_Block not 1");
+ #endif
lwp_cpptr = runnable[i].head;
returnto(&lwp_cpptr->context);
Index: openafs/src/lwp/process.s
diff -c openafs/src/lwp/process.s:1.12 openafs/src/lwp/process.s:1.12.8.2
*** openafs/src/lwp/process.s:1.12 Wed Aug 11 11:45:37 2004
--- openafs/src/lwp/process.s Tue Jan 15 09:09:42 2008
***************
*** 12,19 ****
#include
/*#endif /* AFS_DJGPP_ENV */
! #if defined(RIOS)
/* I don't know if we have to save the TOC (R2) or not...
* Note that stack-frame is supposed to be aligned on
* a double-word boundary.
--- 12,74 ----
#include
/*#endif /* AFS_DJGPP_ENV */
! #if defined(__arm32__) || defined(__arm__)
! /* register definitions */
! fp .req r11
! ip .req r12
! sp .req r13
! lp .req r14
! pc .req r15
!
! /*
! savecontext(f, area1, newsp)
! int (*f)()#if defined(RIOS);
! struct savearea *area1;
! char *newsp;
! */
!
! /* Arguments appear as: f in r0, area1 in r1, newsp in r2 */
!
! .text
! .align 0
! .globl savecontext
! .type savecontext, #function
! savecontext:
! @ build the frame
! mov ip, sp
! stmfd sp!, {fp, ip, lr, pc}
! sub fp, ip, #4
! @ stack r0 - r10, current fp
! stmfd sp!, {r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, fp}
! str sp, [r1, #0]
! @ check if newsp is zero
! movs r2, r2
! movne sp, r2
! @ call function ...
! mov pc, r0
!
! /* should never get here ... */
! /* bl EXT(abort) */
!
! /*
! returnto(area2)
! struct savearea *area2;
! */
+ /* area2 is in r0. */
+
+ .globl returnto
+ .type returnto, #function
+ returnto:
+ @ restore r0-r10, fp
+ ldr r0, [r0, #0]
+ ldmfd r0, {r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, fp}
+ @ return from function call
+ ldmea fp, {fp, sp, pc}
+
+ #endif /* __arm32__ or __arm__ */
+
+ #if defined(RIOS)
/* I don't know if we have to save the TOC (R2) or not...
* Note that stack-frame is supposed to be aligned on
* a double-word boundary.
Index: openafs/src/packaging/MacOS/OpenAFS.post_install
diff -c openafs/src/packaging/MacOS/OpenAFS.post_install:1.7.2.3 openafs/src/packaging/MacOS/OpenAFS.post_install:1.7.2.4
*** openafs/src/packaging/MacOS/OpenAFS.post_install:1.7.2.3 Wed Oct 24 23:43:39 2007
--- openafs/src/packaging/MacOS/OpenAFS.post_install Mon Jan 21 15:57:24 2008
***************
*** 44,51 ****
fi
rm -f config/afsd.options.broken
! if [ ! -f config/afsd.options -a -f config/afsd.options.sample ]; then
! cp config/afsd.options.sample config/afsd.options
fi
# testing case -- upgrading from pre 1.2.7, but .last file exists.
--- 44,60 ----
fi
rm -f config/afsd.options.broken
! # if the user hasn't changed these settings, then they should just use the new
! # afsd.conf file
! rm -f config/afsd.options.old
! echo '-afsdb -stat 2000 -dcache 800 -daemons 3 -volumes 70 -dynroot -fakestat-all' >config/afsd.options.old
! if cmp -s config/afsd.options.old config/afsd.options ; then
! rm -f config/afsd.options
! fi
! rm -f config/afsd.options.old
!
! if [ ! -f config/afs.conf -a -f config/afs.conf.sample ]; then
! cp config/afs.conf.sample config/afs.conf
fi
# testing case -- upgrading from pre 1.2.7, but .last file exists.
Index: openafs/src/packaging/MacOS/afs.conf
diff -c /dev/null openafs/src/packaging/MacOS/afs.conf:1.1.2.2
*** /dev/null Mon Feb 11 10:58:23 2008
--- openafs/src/packaging/MacOS/afs.conf Mon Jan 21 15:57:24 2008
***************
*** 0 ****
--- 1,94 ----
+ # -*- sh -*-
+ # WARNING: this file is ignored if /var/db/openafs/etc/config/afsd.options
+ # exists.
+ #
+ # Copyright 2000, International Business Machines Corporation and others.
+ # All Rights Reserved.
+ #
+ # This software has been released under the terms of the IBM Public
+ # License. For details, see the LICENSE file in the top-level source
+ # directory or online at http://www.openafs.org/dl/license10.html
+
+ # Configuration information for AFS client.
+
+ # Set to "-verbose" for a lot of debugging information from afsd. Only useful
+ # for debugging as it prints a LOT of information.
+ VERBOSE=
+
+ # AFS client configuration options.
+ #
+ # Here is a (mostly) complete list of flags that afsd accepts and that are
+ # useful here:
+ #
+ # -blocks The number of blocks available in the workstation cache.
+ # -files The target number of files in the workstation cache (Default:
+ # 1000).
+ # -rootvol The name of the root volume to use.
+ # -stat The number of stat cache entries.
+ # -hosts List of servers to check for volume location info FOR THE
+ # HOME CELL.
+ # -memcache Use an in-memory cache rather than disk.
+ # -cachedir The base directory for the workstation cache.
+ # -mountdir The directory on which the AFS is to be mounted.
+ # -confdir The configuration directory.
+ # -nosettime Don't keep checking the time to avoid drift (default).
+ # -settime Keep checking the time to avoid drift.
+ # -verbose Be chatty.
+ # -debug Print out additional debugging info.
+ # -daemons The number of background daemons to start (Default: 2).
+ # -rmtsys Also fires up an afs remote sys call (e.g. pioctl, setpag)
+ # support daemon
+ # -chunksize 2^n is the chunksize to be used (Default: use a kernel
+ # module default).
+ # -dcache The number of data cache entries.
+ # -prealloc Number of preallocated "small" memory blocks
+ # -waitclose Make close calls always synchronous (slows them down, though)
+ # -files_per_subdir Number of files per cache subdir (Default: 2048).
+ #
+ # Using the memory cache is not recommended. It's less stable than the disk
+ # cache and doesn't improve performance as much as it might sound.
+ #
+ # The default behavior is to let afsd automatically choose an apporpriate set
+ # of flags. This should produce reasonable behavior for most working sets
+ # provided that one is using a modern AFS client (1.4.2 or later).
+ #
+ # You can override that default behavior by setting OPTIONS to a specific set
+ # of flags.
+ OPTIONS="-afsdb -stat 2000 -dcache 800 -daemons 3 -volumes 70 -dynroot -fakestat-all"
+
+ # The default value for the client sysname (as returned by fs sysname) is
+ # determined during the kernel module build and is taken from the architecture
+ # and the major Linux kernel version. Accesses to directories named "@sys" in
+ # AFS will be internally redirected to a directory by this name by the AFS
+ # client, allowing a single path to resolve to different directories depending
+ # on the client architecture.
+ #
+ # If you would like to override the client sysname, uncomment this line and
+ # set the variable to a space-separated list of sysnames. The AFS client will
+ # attempt to resolve @sys to each directory name in the order given.
+ AFS_SYSNAME=""
+
+ # If you want to prefer particular servers for replicated volumes, you can
+ # configure that by defining an afs_server_prefs function here and then
+ # uncommenting the setting of AFS_POST_INIT below. For more information, see
+ # fs help setserverprefs and fs getserverprefs (for the current values).
+
+ #afs_server_prefs() {
+ # fs setserverprefs
+ #}
+
+ # If you want to always run some command after starting OpenAFS, you can put
+ # it here. Note that you cannot run multiple commands, even combined with &&
+ # or ; or similar shell meta-characters. If you want to run multiple
+ # commands, define a shell function instead and put the name of the shell
+ # function here.
+ AFS_POST_INIT=
+
+ # Uncomment this line if you defined an afs_server_prefs function. (If you
+ # have other commands that you also want to run, you'll have to put them in
+ # that function, as you can only run one function.)
+ #AFS_POST_INIT=afs_server_prefs
+
+ # If you want to always run some command before shutting down OpenAFS, you can
+ # put it here. The same caveat applies about multiple commands.
+ AFS_PRE_SHUTDOWN=
Index: openafs/src/packaging/MacOS/buildpkg.sh.in
diff -c openafs/src/packaging/MacOS/buildpkg.sh.in:1.1.2.3 openafs/src/packaging/MacOS/buildpkg.sh.in:1.1.2.4
*** openafs/src/packaging/MacOS/buildpkg.sh.in:1.1.2.3 Fri Nov 23 08:03:05 2007
--- openafs/src/packaging/MacOS/buildpkg.sh.in Mon Jan 21 15:57:24 2008
***************
*** 131,137 ****
else
echo /Network/afs:/var/db/openafs/cache:30000 > $PKGROOT/private/var/db/openafs/etc/cacheinfo.sample
fi
! echo '-afsdb -stat 2000 -dcache 800 -daemons 3 -volumes 70 -dynroot -fakestat-all' > $PKGROOT/private/var/db/openafs/etc/config/afsd.options.sample
strip -X -S $PKGROOT/Library/OpenAFS/Tools/root.client/usr/vice/etc/afs.kext/Contents/MacOS/afs
--- 131,137 ----
else
echo /Network/afs:/var/db/openafs/cache:30000 > $PKGROOT/private/var/db/openafs/etc/cacheinfo.sample
fi
! cp afs.conf $PKGROOT/private/var/db/openafs/etc/config/afs.conf.sample
strip -X -S $PKGROOT/Library/OpenAFS/Tools/root.client/usr/vice/etc/afs.kext/Contents/MacOS/afs
Index: openafs/src/packaging/MacOS/decode-panic
diff -c /dev/null openafs/src/packaging/MacOS/decode-panic:1.1.2.2
*** /dev/null Mon Feb 11 10:58:23 2008
--- openafs/src/packaging/MacOS/decode-panic Sun Jan 27 13:46:14 2008
***************
*** 0 ****
--- 1,302 ----
+ #!/usr/bin/perl
+
+ # decode-panic - decode a Mac OS panic log to show source line numbers
+ # see the end of the file for full documentation and license.
+
+ use Carp;
+ use English qw( -no_match_vars ) ;
+ use File::Basename;
+ use File::Temp qw( tempdir );
+ use Getopt::Long;
+ use IO::Dir;
+ use IO::File;
+ use Pod::Usage;
+ use warnings;
+ use strict;
+
+ my $panic_file = "/Library/Logs/panic.log";
+ my %crash_info;
+ my $backtrace;
+ my $kextload = "/sbin/kextload";
+ my $gdb = "/usr/bin/gdb";
+ my $gdb_file = "gdb.input";
+ my $temp_dir = tempdir( "afsdebugXXXXXX", DIR => File::Spec->tmpdir,
+ TMPDIR => 1, CLEANUP => 1 );
+ my $dump_file = "/var/db/openafs/logs/crash.dump";
+
+ my $option_quiet;
+ my $option_help;
+ my $result = GetOptions ("input=s" => \$panic_file,
+ "output=s" => \$dump_file,
+ "quiet" => \$option_quiet,
+ "help" => \$option_help
+ );
+
+ if ( !$result ) {
+ pod2usage(-message => "Syntax error.",
+ -exitval => 2,
+ -verbose => 1,
+ -output => \*STDERR);
+
+ exit;
+ }
+
+ if ($option_help) {
+ pod2usage(-message => "",
+ -exitval => 2,
+ -verbose => 3,
+ -output => \*STDERR);
+ exit;
+ }
+
+ # check for necessary programs & panic file
+ for my $program ( $kextload, $gdb ) {
+ if ( ! -x $program ) {
+ if ( $option_quiet ) {
+ exit 1;
+ } else {
+ croak "Can't find $program!\n"
+ }
+ }
+ }
+
+ croak "Can't find panic file: $panic_file!\n" if ( ! -r $panic_file );
+
+ read_panic( $panic_file, \%crash_info );
+
+ generate_symbol_files( $crash_info{"afs_kernel_address"}, $temp_dir );
+
+ write_gdb_input_file( $temp_dir, $gdb_file, $crash_info{ "backtrace" } );
+
+ my $gdb_output = `$gdb /mach_kernel -batch -x $temp_dir/$gdb_file`;
+ croak "gdb failed!\n" if $CHILD_ERROR;
+
+ write_dump_file( $dump_file, \%crash_info, $gdb_output );
+
+ # read the panic file and parse out the addresses
+ sub read_panic {
+
+ my $filename = shift;
+ my $hash_ref = shift;
+
+ my $kernel_line;
+ my $line;
+ my @panic_section_positions = ( 0 );
+
+
+ my $panic_fh = IO::File->new( $filename, '<' )
+ or croak "Can't open backtrace file $filename: $OS_ERROR\n";
+
+ # find the last panic section as denoted by "*********"
+ while ( $line = <$panic_fh> ) {
+ chomp $line;
+ if ( $line eq "*********" ) {
+ # skip a line
+ $line = <$panic_fh>;
+ push @panic_section_positions, $panic_fh->tell;
+ }
+ }
+
+ # ignore the empty last section
+ if ( @panic_section_positions > 2 ) {
+ pop @panic_section_positions
+ }
+
+ # Seek to last full panic section
+ # or the beginning of the file if appropriate
+ $panic_fh->seek( $panic_section_positions[-1], 0 );
+
+ $hash_ref->{ "date" } = <$panic_fh>;
+ chomp $hash_ref->{ "date" };
+
+ while ( $line = <$panic_fh> ) {
+ chomp $line;
+
+ #skip lines until "Backtrace" is seen
+ $line =~ /^\s*(Backtrace,|Backtrace:)/;
+ $backtrace = $1;
+ last if $backtrace;
+ }
+
+ if ( !$backtrace ) {
+ if ( $option_quiet ) {
+ exit 1;
+ } else {
+ croak "Couldn't find a backtrace in $filename\n";
+ }
+ }
+
+ # gather the backtrace addresses
+ if ( $backtrace eq "Backtrace:" ) {
+ # ppc format panic
+ while ( $line = <$panic_fh> ) {
+ chomp $line;
+ last if $line !~ /^\s*(0x[0-9a-fA-F]{8})/;
+ my @memory_addresses = split /\s+/, $line;
+
+ # add non-empty array elements to the list
+ push @{ $hash_ref->{ "backtrace" } },
+ grep { /0x/ } @memory_addresses;
+ }
+ } else {
+ # intel format panic
+ while ( $line = <$panic_fh> ) {
+ chomp $line;
+ last if $line !~ /^\s*0x[0-9a-fA-F]{8} : (0x[0-9a-fA-F]*)/;
+ push @{ $hash_ref->{ "backtrace" } }, $1;
+ }
+ }
+
+ # now we need the address for the afs kernel module
+ while ( $line = <$panic_fh> ) {
+ chomp $line;
+ next if ( $line !~ /org\.openafs\.filesystems\.afs/ );
+
+ $kernel_line = $line;
+ $line =~ /\@(0x[0-9a-fA-F]+)/;
+ $hash_ref->{ "afs_kernel_address" } = $1;
+ $kernel_line =~ /^\s+([^@]+)@.+/;
+ $hash_ref->{ "afs_info" } = $1;
+
+ last;
+ }
+
+ # grab the kernel version
+ while ( $line = <$panic_fh> ) {
+ chomp $line;
+ next if ( $line !~ /^Darwin Kernel Version/ );
+ $hash_ref->{ "kernel_version" } = $line;
+ }
+
+ $panic_fh->close()
+ or croak "Can't close file $filename: $OS_ERROR\n";
+
+ if ( !$kernel_line ) {
+ if ( $option_quiet ) {
+ exit 1;
+ } else {
+ croak "No OpenAFS reference found in latest panic!";
+ }
+ }
+ }
+
+ # generate the symbol files that will be read by gdb
+ sub generate_symbol_files {
+ my $kernel_address = shift;
+ my $symbol_write_dir = shift;
+
+ system( "/sbin/kextload",
+ "-s", $temp_dir,
+ "-a", 'org.openafs.filesystems.afs@' . $kernel_address,
+ "-n", "/Library/OpenAFS/Tools/root.client/usr/vice/etc/afs.kext/" );
+ if ( $CHILD_ERROR ) {
+ # error
+ croak "kextload failed to run: $OS_ERROR\n";
+ }
+ }
+
+
+ sub write_gdb_input_file {
+
+ my $write_dir = shift;
+ my $filename = shift;
+ my $backtrace_ref = shift;
+
+ my @symbol_files = ( $write_dir . "/org.openafs.filesystems.afs.sym" );
+
+ my $fh = IO::File->new( $write_dir . "/" . $filename, '>' )
+ or croak "Can't open gdb file $filename for writing: $OS_ERROR\n";
+
+ for my $symbol ( @symbol_files ) {
+ print $fh "add-symbol-file $symbol\n";
+ }
+
+ print $fh "set print asm-demangle on\n";
+
+ for my $address ( @{ $backtrace_ref } ) {
+ print $fh "x/i $address\n";
+ }
+
+ $fh->close()
+ or croak "Can't close file $filename: $OS_ERROR\n";
+ }
+
+ # write out the pertinent details to a file.
+ sub write_dump_file {
+ my $filename = shift;
+ my $hash_ref = shift;
+ my $output = shift;
+
+ my $log_dir = dirname $filename;
+
+ if ( ! -d $log_dir ) {
+ mkdir $log_dir, 0755;
+ croak "Can't create directory $log_dir: $OS_ERROR\n" if $CHILD_ERROR;
+ }
+
+ croak "Can't write to folder $log_dir." if ( ! -w $log_dir );
+
+ my $fh = IO::File->new( $filename, '>', 0664 )
+ or croak "Can't open dump file $filename for writing: $OS_ERROR\n";
+
+ print $fh "Panic Date: ", $hash_ref->{ "date" }, "\n";
+ print $fh "Kernel Version: ", $hash_ref->{ "kernel_version" }, "\n";
+ print $fh "OpenAFS Version: ", $hash_ref->{ "afs_info" }, "\n";
+ print $fh "=============\n";
+ print $fh $output;
+
+ $fh->close()
+ or croak "Can't close file $filename: $OS_ERROR\n";
+ }
+
+ __END__
+
+ =head1 NAME
+
+ decode-panic - decode a Mac OS panic log to show source line numbers
+
+ =head1 VERSION
+
+ This documentation refers to decode-panic version $Revision: 1.1.2.2 $
+
+ =head1 SYNOPSIS
+
+ decode-panic [-i ] [-o