From d0c343249ce0aad22d9577dd9bfea2bd72857e06 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Mon, 6 Mar 2006 20:07:08 +0000 Subject: [PATCH] windows-init-20060306 fix sysname string on amd64 add registry configurable CallBackPort to allow for forcing the client to use different ports when talking with the file server. ==================== This delta was composed from multiple commits as part of the CVS->Git migration. The checkin message with each commit was inconsistent. The following are the additional commit messages. ==================== add registry configurable CallBackPort to allow for forcing the client to use different ports when talking with the file server. Add UAE errors to cm_Analyze debug output --- src/WINNT/afsd/afsd_init.c | 38 +++++++++++++++++++++++++++++++++----- src/WINNT/afsd/cm.h | 2 ++ src/WINNT/afsd/cm_conn.c | 5 +++++ 3 files changed, 40 insertions(+), 5 deletions(-) diff --git a/src/WINNT/afsd/afsd_init.c b/src/WINNT/afsd/afsd_init.c index 859448c0f..0e41b16e5 100644 --- a/src/WINNT/afsd/afsd_init.c +++ b/src/WINNT/afsd/afsd_init.c @@ -38,6 +38,7 @@ extern int RXAFSCB_ExecuteRequest(struct rx_call *z_call); extern int RXSTATS_ExecuteRequest(struct rx_call *z_call); extern afs_int32 cryptall; +extern int cm_enableServerLocks; osi_log_t *afsd_logp; @@ -66,6 +67,7 @@ int logReady = 0; char cm_HostName[200]; long cm_HostAddr; +unsigned short cm_callbackport = CM_DEFAULT_CALLBACKPORT; char cm_NetbiosName[MAX_NB_NAME_LENGTH] = ""; @@ -852,8 +854,8 @@ int afsd_InitCM(char **reasonP) if (code != ERROR_SUCCESS || !buf[0]) { #if defined(_IA64_) StringCbCopyA(buf, sizeof(buf), "ia64_win64"); -#elif defined(_AMD64) - StringCbCopyA(buf, sizeof(buf), "amd64_win64"); +#elif defined(_AMD64_) + StringCbCopyA(buf, sizeof(buf), "amd64_win64 x86_win32 i386_w2k"); #else /* assume x86 32-bit */ StringCbCopyA(buf, sizeof(buf), "x86_win32 i386_w2k i386_nt40"); #endif @@ -1047,6 +1049,32 @@ int afsd_InitCM(char **reasonP) cm_daemonTokenCheckInterval = dwValue; afsi_log("daemonCheckTokenInterval is %d", cm_daemonTokenCheckInterval); + dummyLen = sizeof(DWORD); + code = RegQueryValueEx(parmKey, "CallBackPort", NULL, NULL, + (BYTE *) &dwValue, &dummyLen); + if (code == ERROR_SUCCESS) { + cm_callbackport = (unsigned short) dwValue; + } + afsi_log("CM CallBackPort is %u", cm_callbackport); + + dummyLen = sizeof(DWORD); + code = RegQueryValueEx(parmKey, "EnableServerLocks", NULL, NULL, + (BYTE *) &dwValue, &dummyLen); + if (code == ERROR_SUCCESS) { + cm_enableServerLocks = (unsigned short) dwValue; + } + switch (cm_enableServerLocks) { + case 0: + afsi_log("EnableServerLocks: never"); + break; + case 2: + afsi_log("EnableServerLocks: always"); + break; + case 1: + default: + afsi_log("EnableServerLocks: server requested"); + break; + } RegCloseKey (parmKey); /* Call lanahelper to get Netbios name, lan adapter number and gateway flag */ @@ -1137,10 +1165,10 @@ int afsd_InitCM(char **reasonP) afsi_log("rx_SetMaxMTU %d successful", rx_mtu); } - /* initialize RX, and tell it to listen to port 7001, which is used for - * callback RPC messages. + /* initialize RX, and tell it to listen to the callbackport, + * which is used for callback RPC messages. */ - code = rx_Init(htons(7001)); + code = rx_Init(htons(cm_callbackport)); afsi_log("rx_Init code %x", code); if (code != 0) { *reasonP = "afsd: failed to init rx client on port 7001"; diff --git a/src/WINNT/afsd/cm.h b/src/WINNT/afsd/cm.h index 700cb90a4..ca5225214 100644 --- a/src/WINNT/afsd/cm.h +++ b/src/WINNT/afsd/cm.h @@ -231,6 +231,8 @@ int RXAFS_Lookup (struct rx_connection *, struct AFSCallBack *CallBack, struct AFSVolSync *Sync); +#define CM_DEFAULT_CALLBACKPORT 7001 + /* common flags to many procedures */ #define CM_FLAG_CREATE 1 /* create entry */ #define CM_FLAG_CASEFOLD 2 /* fold case in namei, lookup, etc. */ diff --git a/src/WINNT/afsd/cm_conn.c b/src/WINNT/afsd/cm_conn.c index 5863ee8b1..d9c5e428f 100644 --- a/src/WINNT/afsd/cm_conn.c +++ b/src/WINNT/afsd/cm_conn.c @@ -18,6 +18,7 @@ #include #include #include +#include #include "afsd.h" osi_rwlock_t cm_connLock; @@ -510,7 +511,11 @@ cm_Analyze(cm_conn_t *connp, cm_user_t *userp, cm_req_t *reqp, case VRESTARTING : s = "VRESTARTING"; break; case VREADONLY : s = "VREADONLY"; break; case EAGAIN : s = "EAGAIN"; break; + case UAEAGAIN : s = "UAEAGAIN"; break; + case EINVAL : s = "EINVAL"; break; + case UAEINVAL : s = "UAEINVAL"; break; case EACCES : s = "EACCES"; break; + case UAEACCES : s = "UAECCES"; break; } osi_Log2(afsd_logp, "cm_Analyze: ignoring error code 0x%x (%s)", errorCode, s); -- 2.39.5