Index: openafs/src/NTMakefile diff -c openafs/src/NTMakefile:1.27.2.2 openafs/src/NTMakefile:1.27.2.3 *** openafs/src/NTMakefile:1.27.2.2 Thu Oct 12 17:19:35 2006 --- openafs/src/NTMakefile Thu Feb 15 13:14:07 2007 *************** *** 137,143 **** $(NTMAKE) $(CD) ..\.. ! ubik_headers: rx echo ***** $@ $(DOCD) $(SRC)\ubik $(CD) $(SRC)\ubik --- 137,150 ---- $(NTMAKE) $(CD) ..\.. ! rxdebug: rx ! echo ***** $@ ! $(DOCD) $(SRC)\$@ ! $(CD) $(SRC)\$@ ! $(NTMAKE) ! $(CD) ..\.. ! ! ubik_headers: rxdebug echo ***** $@ $(DOCD) $(SRC)\ubik $(CD) $(SRC)\ubik Index: openafs/src/WINNT/afsd/afsd.h diff -c openafs/src/WINNT/afsd/afsd.h:1.18 openafs/src/WINNT/afsd/afsd.h:1.18.2.1 *** openafs/src/WINNT/afsd/afsd.h:1.18 Thu Feb 16 16:59:19 2006 --- openafs/src/WINNT/afsd/afsd.h Mon Feb 26 20:32:09 2007 *************** *** 29,43 **** #include "largeint95.h" #endif /* !DJGPP */ - #include "afsdicon.h" - #include "cm.h" - #include "krb.h" - #include "krb_prot.h" - /*#include */ - #include - #include #include "cm_config.h" #include "cm_user.h" --- 29,36 ---- *************** *** 72,77 **** --- 65,71 ---- #include #include + #include #define AFS_DAEMON_SERVICE_NAME AFSREG_CLT_SVC_NAME #define AFS_DAEMON_EVENT_NAME AFSREG_CLT_SW_NAME Index: openafs/src/WINNT/afsd/afsd_eventmessages.rc diff -c openafs/src/WINNT/afsd/afsd_eventmessages.rc:1.1 openafs/src/WINNT/afsd/afsd_eventmessages.rc:removed *** openafs/src/WINNT/afsd/afsd_eventmessages.rc:1.1 Thu Feb 26 14:22:44 2004 --- openafs/src/WINNT/afsd/afsd_eventmessages.rc Thu Mar 8 20:32:35 2007 *************** *** 1,2 **** - LANGUAGE 0x9,0x1 - 1 11 MSG00409.bin --- 0 ---- Index: openafs/src/WINNT/afsd/afsd_init.c diff -c openafs/src/WINNT/afsd/afsd_init.c:1.79.2.10 openafs/src/WINNT/afsd/afsd_init.c:1.79.2.11 *** openafs/src/WINNT/afsd/afsd_init.c:1.79.2.10 Sat Feb 3 12:49:33 2007 --- openafs/src/WINNT/afsd/afsd_init.c Wed Mar 7 13:14:05 2007 *************** *** 76,83 **** DWORD cm_CachePathLen; DWORD cm_ValidateCache = 1; - BOOL isGateway = FALSE; - BOOL reportSessionStartups = FALSE; cm_initparams_v1 cm_initParams; --- 76,81 ---- *************** *** 568,574 **** long code; /*int freelanceEnabled;*/ WSADATA WSAjunk; - lana_number_t lanaNum; int i; char *p, *q; int cm_noIPAddr; /* number of client network interfaces */ --- 566,571 ---- *************** *** 1081,1105 **** RegCloseKey (parmKey); - /* Call lanahelper to get Netbios name, lan adapter number and gateway flag */ - if (SUCCEEDED(code = lana_GetUncServerNameEx(cm_NetbiosName, &lanaNum, &isGateway, LANA_NETBIOS_NAME_FULL))) { - LANadapter = (lanaNum == LANA_INVALID)? -1: lanaNum; - - if (LANadapter != -1) - afsi_log("LAN adapter number %d", LANadapter); - else - afsi_log("LAN adapter number not determined"); - - if (isGateway) - afsi_log("Set for gateway service"); - - afsi_log("Using >%s< as SMB server name", cm_NetbiosName); - } else { - /* something went horribly wrong. We can't proceed without a netbios name */ - StringCbPrintfA(buf,sizeof(buf),"Netbios name could not be determined: %li", code); - osi_panic(buf, __FILE__, __LINE__); - } - cacheBlocks = ((afs_uint64)cacheSize * 1024) / CM_CONFIGDEFAULT_BLOCKSIZE; /* get network related info */ --- 1078,1083 ---- *************** *** 1325,1331 **** /* Do this last so that we don't handle requests before init is done. * Here we initialize the SMB listener. */ ! smb_Init(afsd_logp, cm_NetbiosName, smb_UseV3, LANadapter, numSvThreads, aMBfunc); afsi_log("smb_Init complete"); return 0; --- 1303,1309 ---- /* Do this last so that we don't handle requests before init is done. * Here we initialize the SMB listener. */ ! smb_Init(afsd_logp, smb_UseV3, numSvThreads, aMBfunc); afsi_log("smb_Init complete"); return 0; Index: openafs/src/WINNT/afsd/cm_dir.h diff -c openafs/src/WINNT/afsd/cm_dir.h:1.4 openafs/src/WINNT/afsd/cm_dir.h:1.4.4.1 *** openafs/src/WINNT/afsd/cm_dir.h:1.4 Sat Nov 5 01:47:46 2005 --- openafs/src/WINNT/afsd/cm_dir.h Mon Feb 19 22:14:45 2007 *************** *** 10,17 **** #ifndef __CM_DIR_ENV__ #define __CM_DIR_ENV__ 1 #define CM_DIR_PAGESIZE 2048 /* bytes per page */ ! #define CM_DIR_NHASHENT 256 /* entries in the hash tbl == NHSIZE */ #define CM_DIR_MAXPAGES 128 /* max pages in a dir */ #define CM_DIR_BIGMAXPAGES 1023 /* new big max pages */ #define CM_DIR_EPP 64 /* dir entries per page */ --- 10,22 ---- #ifndef __CM_DIR_ENV__ #define __CM_DIR_ENV__ 1 + /* These data structures are derived from src/dir/dir.h and should not + * be changed as they describe AFS3 wire protocol. + * + */ + #define CM_DIR_PAGESIZE 2048 /* bytes per page */ ! #define CM_DIR_NHASHENT 128 /* entries in the dir hash tbl */ #define CM_DIR_MAXPAGES 128 /* max pages in a dir */ #define CM_DIR_BIGMAXPAGES 1023 /* new big max pages */ #define CM_DIR_EPP 64 /* dir entries per page */ *************** *** 35,44 **** typedef struct cm_pageHeader { /* A page header entry. */ unsigned short pgcount; /* number of pages, or 0 if old-style */ ! unsigned short tag; /* 1234 in network byte order */ char freeCount; /* unused, info in dirHeader structure */ char freeBitmap[CM_DIR_EPP/8]; ! char padding[32-(5+CM_DIR_EPP/8)]; /* pad to one 32-byte entry */ } cm_pageHeader_t; /* a total of 13 32-byte entries, 1 for the header that in all pages, and --- 40,49 ---- typedef struct cm_pageHeader { /* A page header entry. */ unsigned short pgcount; /* number of pages, or 0 if old-style */ ! unsigned short tag; /* '1234' in network byte order */ char freeCount; /* unused, info in dirHeader structure */ char freeBitmap[CM_DIR_EPP/8]; ! char padding[CM_DIR_CHUNKSIZE-(5+CM_DIR_EPP/8)];/* pad to one 32-byte entry */ } cm_pageHeader_t; /* a total of 13 32-byte entries, 1 for the header that in all pages, and *************** *** 56,66 **** */ typedef struct cm_dirEntry { /* A directory entry */ ! char flag; char length; /* currently unused */ unsigned short next; cm_dirFid_t fid; ! char name[16]; } cm_dirEntry_t; #ifdef UNUSED --- 61,71 ---- */ typedef struct cm_dirEntry { /* A directory entry */ ! char flag; /* this must be FFIRST (1) */ char length; /* currently unused */ unsigned short next; cm_dirFid_t fid; ! char name[1]; /* the real length is determined with strlen() */ } cm_dirEntry_t; #ifdef UNUSED Index: openafs/src/WINNT/afsd/cm_dnlc.h diff -c openafs/src/WINNT/afsd/cm_dnlc.h:1.4 openafs/src/WINNT/afsd/cm_dnlc.h:1.4.6.1 *** openafs/src/WINNT/afsd/cm_dnlc.h:1.4 Fri Mar 11 00:33:22 2005 --- openafs/src/WINNT/afsd/cm_dnlc.h Mon Feb 19 22:14:45 2007 *************** *** 11,17 **** #define CM_AFSNCNAMESIZE 40 /* multiple of 8 (for 64-bit) */ #define NCSIZE 512 ! #define NHSIZE 256 /* must be power of 2 == CM_DIR_NHASHENT */ #define CM_DNLC_MAGIC ('D' | 'N' <<8 | 'L'<<16 | 'C'<<24) --- 11,17 ---- #define CM_AFSNCNAMESIZE 40 /* multiple of 8 (for 64-bit) */ #define NCSIZE 512 ! #define NHSIZE 256 /* must be power of 2 */ #define CM_DNLC_MAGIC ('D' | 'N' <<8 | 'L'<<16 | 'C'<<24) Index: openafs/src/WINNT/afsd/cm_utils.c diff -c openafs/src/WINNT/afsd/cm_utils.c:1.11.4.3 openafs/src/WINNT/afsd/cm_utils.c:1.11.4.4 *** openafs/src/WINNT/afsd/cm_utils.c:1.11.4.3 Thu Oct 5 16:30:39 2006 --- openafs/src/WINNT/afsd/cm_utils.c Thu Feb 15 01:02:03 2007 *************** *** 284,289 **** --- 284,291 ---- return error; } + error = et_to_sys_error(error); + if (error < 0) error = CM_ERROR_TIMEDOUT; else if (error == 30) *************** *** 304,327 **** long cm_MapVLRPCError(long error, cm_req_t *reqp) { ! if (error == 0) return 0; ! /* If we had to stop retrying, report our saved error code. */ ! if (reqp && error == CM_ERROR_TIMEDOUT) { ! if (reqp->accessError) ! return reqp->accessError; ! if (reqp->volumeError) ! return reqp->volumeError; ! if (reqp->rpcError) ! return reqp->rpcError; ! return error; ! } ! ! if (error < 0) ! error = CM_ERROR_TIMEDOUT; ! else if (error == VL_NOENT) ! error = CM_ERROR_NOSUCHVOLUME; return error; } cm_space_t *cm_GetSpace(void) --- 306,331 ---- long cm_MapVLRPCError(long error, cm_req_t *reqp) { ! if (error == 0) return 0; ! /* If we had to stop retrying, report our saved error code. */ ! if (reqp && error == CM_ERROR_TIMEDOUT) { ! if (reqp->accessError) ! return reqp->accessError; ! if (reqp->volumeError) ! return reqp->volumeError; ! if (reqp->rpcError) ! return reqp->rpcError; return error; + } + + error = et_to_sys_error(error); + + if (error < 0) + error = CM_ERROR_TIMEDOUT; + else if (error == VL_NOENT) + error = CM_ERROR_NOSUCHVOLUME; + return error; } cm_space_t *cm_GetSpace(void) Index: openafs/src/WINNT/afsd/fs.c diff -c openafs/src/WINNT/afsd/fs.c:1.32.4.5 openafs/src/WINNT/afsd/fs.c:1.32.4.6 *** openafs/src/WINNT/afsd/fs.c:1.32.4.5 Sun Jan 21 21:18:09 2007 --- openafs/src/WINNT/afsd/fs.c Fri Mar 2 20:32:06 2007 *************** *** 2096,2102 **** /* sanity check */ if(checkserv.tinterval<0) { printf("Warning: The negative -interval is ignored; treated as an inquiry\n"); ! checkserv.tinterval=0; } else if(checkserv.tinterval> 600) { printf("Warning: The maximum -interval value is 10 mins (600 secs)\n"); checkserv.tinterval=600; /* 10 min max interval */ --- 2096,2102 ---- /* sanity check */ if(checkserv.tinterval<0) { printf("Warning: The negative -interval is ignored; treated as an inquiry\n"); ! checkserv.tinterval=-1; } else if(checkserv.tinterval> 600) { printf("Warning: The maximum -interval value is 10 mins (600 secs)\n"); checkserv.tinterval=600; /* 10 min max interval */ *************** *** 2105,2111 **** checkserv.tinterval = -1; /* don't change current interval */ } ! if ( checkserv.tinterval != 0 ) { #ifdef WIN32 if ( !IsAdmin() ) { fprintf (stderr,"Permission denied: requires AFS Client Administrator access.\n"); --- 2105,2111 ---- checkserv.tinterval = -1; /* don't change current interval */ } ! if ( checkserv.tinterval >= 0 ) { #ifdef WIN32 if ( !IsAdmin() ) { fprintf (stderr,"Permission denied: requires AFS Client Administrator access.\n"); Index: openafs/src/WINNT/afsd/lanahelper.cpp diff -c openafs/src/WINNT/afsd/lanahelper.cpp:1.12.2.1 openafs/src/WINNT/afsd/lanahelper.cpp:1.12.2.3 *** openafs/src/WINNT/afsd/lanahelper.cpp:1.12.2.1 Sat Oct 21 16:47:48 2006 --- openafs/src/WINNT/afsd/lanahelper.cpp Tue Feb 27 19:42:05 2007 *************** *** 59,65 **** --- 59,67 ---- static const char *szNetbiosNameValue = "NetbiosName"; static const char *szIsGatewayValue = "IsGateway"; static const char *szLanAdapterValue = "LanAdapter"; + #ifdef USE_FINDLANABYNAME static const char *szNoFindLanaByName = "NoFindLanaByName"; + #endif static const char *szForceLanaLoopback = "ForceLanaLoopback"; // Use the IShellFolder API to get the connection name for the given Guid. *************** *** 522,657 **** // LANA_NETBIOS_NAME_FULL : Return full netbios name extern "C" long lana_GetUncServerNameEx(char *buffer, lana_number_t * pLana, int * pIsGateway, int flags) { HKEY hkConfig; ! DWORD dummyLen; ! LONG rv; ! int regLana; ! int regGateway, regNoFindLanaByName; ! TCHAR regNbName[MAX_NB_NAME_LENGTH]; ! TCHAR nbName[MAX_NB_NAME_LENGTH]; ! TCHAR hostname[MAX_COMPUTERNAME_LENGTH+1]; ! ! rv = RegOpenKeyEx(HKEY_LOCAL_MACHINE,AFSREG_CLT_SVC_PARAM_SUBKEY,0,KEY_READ,&hkConfig); ! if(rv == ERROR_SUCCESS) { ! if(!(flags & LANA_NETBIOS_NAME_IN) || !pLana) { ! dummyLen = sizeof(regLana); ! rv = RegQueryValueEx(hkConfig, szLanAdapterValue, NULL, NULL, (LPBYTE) ®Lana, &dummyLen); ! if(rv != ERROR_SUCCESS) regLana = -1; ! } else ! regLana = *pLana; ! ! if(!(flags & LANA_NETBIOS_NAME_IN) || !pIsGateway) { ! dummyLen = sizeof(regGateway); ! rv = RegQueryValueEx(hkConfig, szIsGatewayValue, NULL, NULL, (LPBYTE) ®Gateway, &dummyLen); ! if(rv != ERROR_SUCCESS) regGateway = 0; ! } else ! regGateway = *pIsGateway; ! ! dummyLen = sizeof(regNoFindLanaByName); ! rv = RegQueryValueEx(hkConfig, szNoFindLanaByName, NULL, NULL, (LPBYTE) ®NoFindLanaByName, &dummyLen); ! if(rv != ERROR_SUCCESS) regNoFindLanaByName = 0; ! ! // Do not care if the call fails for insufficient buffer size. We are not interested ! // in netbios names over 15 chars. ! dummyLen = sizeof(regNbName); ! rv = RegQueryValueEx(hkConfig, szNetbiosNameValue, NULL, NULL, (LPBYTE) ®NbName, &dummyLen); ! if(rv != ERROR_SUCCESS) regNbName[0] = 0; ! else regNbName[15] = 0; ! RegCloseKey(hkConfig); } else { ! if(flags & LANA_NETBIOS_NAME_IN) { ! regLana = (pLana)? *pLana: -1; ! regGateway = (pIsGateway)? *pIsGateway: 0; ! } else { ! regLana = -1; ! regGateway = 0; ! } ! regNoFindLanaByName = 0; ! regNbName[0] = 0; } if(regLana < 0 || regLana > MAX_LANA) regLana = -1; ! if(regLana == -1) { ! LANAINFO *lanaInfo = NULL; int nLana = LANA_INVALID; if (!regNoFindLanaByName) lanaInfo = lana_FindLanaByName("AFS"); ! if(lanaInfo != NULL) { nLana = lanaInfo[0].lana_number; ! free(lanaInfo); ! } else ! nLana = LANA_INVALID; ! ! if(nLana == LANA_INVALID && !regGateway) { ! nLana = lana_FindLoopback(); ! } ! if(nLana != LANA_INVALID) ! regLana = nLana; } ! 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"); ! } } ! if(pLana) *pLana = regLana; ! if(pIsGateway) *pIsGateway = regGateway; ! strcpy(buffer, nbName); ! return ERROR_SUCCESS; } extern "C" void lana_GetUncServerNameDynamic(int lanaNumber, BOOL isGateway, TCHAR *name, int type) { ! char szName[MAX_NB_NAME_LENGTH]; ! lana_number_t lana = (lana_number_t) lanaNumber; ! int gateway = (int) isGateway; ! if(SUCCEEDED(lana_GetUncServerNameEx(szName, &lana, &gateway, LANA_NETBIOS_NAME_IN | type))) { #ifdef _UNICODE ! mbswcs(name,szName,MAX_NB_NAME_LENGTH); #else ! strncpy(name,szName,MAX_NB_NAME_LENGTH); #endif ! } else ! *name = _T('\0'); } extern "C" void lana_GetUncServerName(TCHAR *name, int type) { ! char szName[MAX_NB_NAME_LENGTH]; ! if(SUCCEEDED(lana_GetUncServerNameEx(szName,NULL,NULL,type))) { #ifdef _UNICODE ! mbswcs(name,szName,MAX_NB_NAME_LENGTH); ! #else ! strncpy(name,szName,MAX_NB_NAME_LENGTH); #endif ! } else { ! *name = _T('\0'); ! } } extern "C" void lana_GetAfsNameString(int lanaNumber, BOOL isGateway, TCHAR* name) --- 524,676 ---- // LANA_NETBIOS_NAME_FULL : Return full netbios name extern "C" long lana_GetUncServerNameEx(char *buffer, lana_number_t * pLana, int * pIsGateway, int flags) { HKEY hkConfig; ! DWORD dummyLen; ! LONG rv; ! int regLana; ! int regGateway; ! #ifdef USE_FINDLANABYNAME ! int regNoFindLanaByName; ! #endif ! TCHAR regNbName[MAX_NB_NAME_LENGTH] = "AFS"; ! TCHAR nbName[MAX_NB_NAME_LENGTH]; ! TCHAR hostname[MAX_COMPUTERNAME_LENGTH+1]; ! ! rv = RegOpenKeyEx(HKEY_LOCAL_MACHINE,AFSREG_CLT_SVC_PARAM_SUBKEY,0,KEY_READ,&hkConfig); ! if(rv == ERROR_SUCCESS) { ! if(!(flags & LANA_NETBIOS_NAME_IN) || !pLana) { ! dummyLen = sizeof(regLana); ! rv = RegQueryValueEx(hkConfig, szLanAdapterValue, NULL, NULL, (LPBYTE) ®Lana, &dummyLen); ! if(rv != ERROR_SUCCESS) ! regLana = -1; ! } else ! regLana = *pLana; ! ! if(!(flags & LANA_NETBIOS_NAME_IN) || !pIsGateway) { ! dummyLen = sizeof(regGateway); ! rv = RegQueryValueEx(hkConfig, szIsGatewayValue, NULL, NULL, (LPBYTE) ®Gateway, &dummyLen); ! if(rv != ERROR_SUCCESS) ! regGateway = 0; ! } else ! regGateway = *pIsGateway; ! #ifdef USE_FINDLANABYNAME ! dummyLen = sizeof(regNoFindLanaByName); ! rv = RegQueryValueEx(hkConfig, szNoFindLanaByName, NULL, NULL, (LPBYTE) ®NoFindLanaByName, &dummyLen); ! if(rv != ERROR_SUCCESS) ! regNoFindLanaByName = 0; ! #endif ! ! // Do not care if the call fails for insufficient buffer size. We are not interested ! // in netbios names over 15 chars. ! dummyLen = sizeof(regNbName); ! rv = RegQueryValueEx(hkConfig, szNetbiosNameValue, NULL, NULL, (LPBYTE) ®NbName, &dummyLen); ! if(rv != ERROR_SUCCESS) ! strcpy(regNbName, "AFS"); ! else ! regNbName[15] = 0; ! ! RegCloseKey(hkConfig); ! } else { ! if(flags & LANA_NETBIOS_NAME_IN) { ! regLana = (pLana)? *pLana: -1; ! regGateway = (pIsGateway)? *pIsGateway: 0; } else { ! regLana = -1; ! regGateway = 0; } + #ifdef USE_FINDLANABYNAME + regNoFindLanaByName = 0; + #endif + strcpy(regNbName, "AFS"); + } if(regLana < 0 || regLana > MAX_LANA) regLana = -1; ! if(regLana == -1) { ! LANAINFO *lanaInfo = NULL; int nLana = LANA_INVALID; + #ifdef USE_FINDLANABYNAME if (!regNoFindLanaByName) lanaInfo = lana_FindLanaByName("AFS"); ! #endif ! if(lanaInfo != NULL) { nLana = lanaInfo[0].lana_number; ! free(lanaInfo); ! } else ! nLana = LANA_INVALID; ! ! if(nLana == LANA_INVALID && !regGateway) { ! nLana = lana_FindLoopback(); } + if(nLana != LANA_INVALID) + regLana = nLana; + } ! 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"); } + } ! if(pLana) ! *pLana = regLana; ! if(pIsGateway) ! *pIsGateway = regGateway; ! strcpy(buffer, nbName); ! return ERROR_SUCCESS; } extern "C" void lana_GetUncServerNameDynamic(int lanaNumber, BOOL isGateway, TCHAR *name, int type) { ! char szName[MAX_NB_NAME_LENGTH]; ! lana_number_t lana = (lana_number_t) lanaNumber; ! int gateway = (int) isGateway; ! if(SUCCEEDED(lana_GetUncServerNameEx(szName, &lana, &gateway, LANA_NETBIOS_NAME_IN | type))) { #ifdef _UNICODE ! mbswcs(name,szName,MAX_NB_NAME_LENGTH); #else ! strncpy(name,szName,MAX_NB_NAME_LENGTH); #endif ! } else ! *name = _T('\0'); } extern "C" void lana_GetUncServerName(TCHAR *name, int type) { ! char szName[MAX_NB_NAME_LENGTH]; ! if(SUCCEEDED(lana_GetUncServerNameEx(szName,NULL,NULL,type))) { #ifdef _UNICODE ! mbswcs(name,szName,MAX_NB_NAME_LENGTH); ! #else ! strncpy(name,szName,MAX_NB_NAME_LENGTH); #endif ! } else { ! *name = _T('\0'); ! } } extern "C" void lana_GetAfsNameString(int lanaNumber, BOOL isGateway, TCHAR* name) *************** *** 663,671 **** extern "C" void lana_GetNetbiosName(LPTSTR pszName, int type) { ! HKEY hkCfg; TCHAR name[MAX_NB_NAME_LENGTH]; ! DWORD dummyLen; memset(name, 0, sizeof(name)); if (GetVersion() >= 0x80000000) // not WindowsNT --- 682,690 ---- extern "C" void lana_GetNetbiosName(LPTSTR pszName, int type) { ! HKEY hkCfg; TCHAR name[MAX_NB_NAME_LENGTH]; ! DWORD dummyLen; memset(name, 0, sizeof(name)); if (GetVersion() >= 0x80000000) // not WindowsNT *************** *** 676,687 **** return; } ! if(RegOpenKeyEx(HKEY_LOCAL_MACHINE,AFSREG_CLT_SVC_PARAM_SUBKEY,0,KEY_READ,&hkCfg) == ERROR_SUCCESS) { ! dummyLen = sizeof(name); ! if(RegQueryValueEx(hkCfg,TEXT("Gateway"),NULL,NULL,(LPBYTE) name,&dummyLen) == ERROR_SUCCESS) ! name[0] = _T('\0'); ! RegCloseKey(hkCfg); ! } if (_tcslen(name) == 0) { --- 695,706 ---- return; } ! if(RegOpenKeyEx(HKEY_LOCAL_MACHINE,AFSREG_CLT_SVC_PARAM_SUBKEY,0,KEY_READ,&hkCfg) == ERROR_SUCCESS) { ! dummyLen = sizeof(name); ! if(RegQueryValueEx(hkCfg,TEXT("Gateway"),NULL,NULL,(LPBYTE) name,&dummyLen) == ERROR_SUCCESS) ! name[0] = _T('\0'); ! RegCloseKey(hkCfg); ! } if (_tcslen(name) == 0) { *************** *** 689,701 **** return; } ! _tcscpy(pszName, name); _tcscat(pszName, TEXT("-afs")); return; } lana_GetUncServerName(name,type); ! _tcslwr(name); _tcscpy(pszName, name); return; } --- 708,720 ---- return; } ! _tcscpy(pszName, name); _tcscat(pszName, TEXT("-afs")); return; } lana_GetUncServerName(name,type); ! _tcslwr(name); _tcscpy(pszName, name); return; } Index: openafs/src/WINNT/afsd/smb.c diff -c openafs/src/WINNT/afsd/smb.c:1.118.2.32 openafs/src/WINNT/afsd/smb.c:1.118.2.33 *** openafs/src/WINNT/afsd/smb.c:1.118.2.32 Fri Feb 9 18:51:15 2007 --- openafs/src/WINNT/afsd/smb.c Wed Mar 7 13:14:05 2007 *************** *** 65,70 **** --- 65,72 ---- char smb_LANadapter; unsigned char smb_sharename[NCBNAMSZ+1] = {0}; + BOOL isGateway = FALSE; + /* for debugging */ long smb_maxObsConcurrentCalls=0; long smb_concurrentCalls=0; *************** *** 8592,8597 **** --- 8594,8600 ---- int delname_tried=0; int len; int lana_found = 0; + lana_number_t lanaNum; /* setup the NCB system */ ncbp = GetNCB(); *************** *** 8599,8604 **** --- 8602,8636 ---- dos_ncb = ((smb_ncb_t *)ncbp)->dos_ncb; #endif /* DJGPP */ + /* Call lanahelper to get Netbios name, lan adapter number and gateway flag */ + if (SUCCEEDED(code = lana_GetUncServerNameEx(cm_NetbiosName, &lanaNum, &isGateway, LANA_NETBIOS_NAME_FULL))) { + smb_LANadapter = (lanaNum == LANA_INVALID)? -1: lanaNum; + + if (smb_LANadapter != -1) + afsi_log("LAN adapter number %d", smb_LANadapter); + else + afsi_log("LAN adapter number not determined"); + + if (isGateway) + afsi_log("Set for gateway service"); + + afsi_log("Using >%s< as SMB server name", cm_NetbiosName); + } else { + /* something went horribly wrong. We can't proceed without a netbios name */ + char buf[128]; + StringCbPrintfA(buf,sizeof(buf),"Netbios name could not be determined: %li", code); + osi_panic(buf, __FILE__, __LINE__); + } + + /* remember the name */ + len = (int)strlen(cm_NetbiosName); + if (smb_localNamep) + free(smb_localNamep); + smb_localNamep = malloc(len+1); + strcpy(smb_localNamep, cm_NetbiosName); + afsi_log("smb_localNamep is >%s<", smb_localNamep); + + #ifndef DJGPP if (smb_LANadapter == -1) { ncbp->ncb_command = NCBENUM; *************** *** 8835,8841 **** Sleep(1000); /* give the listener threads a chance to exit */ } ! void smb_Init(osi_log_t *logp, char *snamep, int useV3, int LANadapt, int nThreads #ifndef DJGPP , void *aMBfunc --- 8867,8873 ---- Sleep(1000); /* give the listener threads a chance to exit */ } ! void smb_Init(osi_log_t *logp, int useV3, int nThreads #ifndef DJGPP , void *aMBfunc *************** *** 8846,8852 **** thread_t phandle; int lpid; INT_PTR i; - int len; struct tm myTime; #ifdef DJGPP int npar, seg, sel; --- 8878,8883 ---- *************** *** 8862,8868 **** #endif /* DJGPP */ smb_useV3 = useV3; - smb_LANadapter = LANadapt; /* Initialize smb_localZero */ myTime.tm_isdst = -1; /* compute whether on DST or not */ --- 8893,8898 ---- *************** *** 8886,8897 **** /* initialize the remote debugging log */ smb_logp = logp; - /* remember the name */ - len = (int)strlen(snamep); - smb_localNamep = malloc(len+1); - strcpy(smb_localNamep, snamep); - afsi_log("smb_localNamep is >%s<", smb_localNamep); - /* and the global lock */ lock_InitializeRWLock(&smb_globalLock, "smb global lock"); lock_InitializeRWLock(&smb_rctLock, "smb refct and tree struct lock"); --- 8916,8921 ---- Index: openafs/src/WINNT/afsd/smb.h diff -c openafs/src/WINNT/afsd/smb.h:1.41.2.12 openafs/src/WINNT/afsd/smb.h:1.41.2.13 *** openafs/src/WINNT/afsd/smb.h:1.41.2.12 Mon Jan 15 14:52:19 2007 --- openafs/src/WINNT/afsd/smb.h Wed Mar 7 13:14:05 2007 *************** *** 523,529 **** /* prototypes */ ! extern void smb_Init(osi_log_t *logp, char *smbNamep, int useV3, int LANadapt, int nThreads #ifndef DJGPP , void *aMBfunc --- 523,529 ---- /* prototypes */ ! extern void smb_Init(osi_log_t *logp, int useV3, int nThreads #ifndef DJGPP , void *aMBfunc 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.9 openafs/src/WINNT/doc/install/Documentation/en_US/html/index.htm:1.5.4.10 *** openafs/src/WINNT/doc/install/Documentation/en_US/html/index.htm:1.5.4.9 Sat Feb 10 10:28:15 2007 --- openafs/src/WINNT/doc/install/Documentation/en_US/html/index.htm Thu Mar 8 20:13:17 2007 *************** *** 198,204 ****

OpenAFS for Windows

!

Version 1.5.15

 

--- 198,204 ----

OpenAFS for Windows

!

Version 1.5.16

 

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.10 openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/logo.htm:1.1.6.11 *** openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/logo.htm:1.1.6.10 Sat Feb 10 10:28:39 2007 --- openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/logo.htm Thu Mar 8 20:13:21 2007 *************** *** 18,24 **** .shape {behavior:url(#default#VML);} ! OpenAFS for Windows 1.5.15 Release Notes ! OpenAFS for Windows 1.5.16 Release Notes ! OpenAFS for Windows 1.5.15 Release Notes ! OpenAFS for Windows 1.5.16 Release Notes !

OpenAFS for Windows 1.5.15
Release Notes

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

!

OpenAFS for Windows 1.5.16
Release Notes

The Andrew File System (AFS) is a location-independent Index: openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/toc.htm diff -c openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/toc.htm:1.2.6.8 openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/toc.htm:1.2.6.9 *** openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/toc.htm:1.2.6.8 Sat Feb 10 10:28:39 2007 --- openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/toc.htm Thu Mar 8 20:13:21 2007 *************** *** 10,16 **** ! OpenAFS for Windows 1.5.15 Table of Contents