mirror of
https://git.openafs.org/openafs.git
synced 2025-02-01 05:57:43 +00:00
STABLE14-windows-reg-fix-20060215
cleanup the back connection hostname code (cherry picked from commit 658338b015fa6cd081726a6c96ab8c756857974a)
This commit is contained in:
parent
d71224dabc
commit
0605e114b8
@ -279,26 +279,29 @@ configureBackConnectionHostNames(void)
|
|||||||
KEY_READ|KEY_WRITE,
|
KEY_READ|KEY_WRITE,
|
||||||
&hkMSV10) == ERROR_SUCCESS )
|
&hkMSV10) == ERROR_SUCCESS )
|
||||||
{
|
{
|
||||||
if (RegQueryValueEx( hkMSV10, "BackConnectionHostNames", 0, &dwType, NULL, &dwSize) == ERROR_SUCCESS) {
|
if (RegQueryValueEx( hkMSV10, "BackConnectionHostNames", 0,
|
||||||
pHostNames = malloc(dwSize + strlen(cm_NetbiosName) + 1);
|
&dwType, NULL, &dwSize) == ERROR_SUCCESS) {
|
||||||
RegQueryValueEx( hkMSV10, "BackConnectionHostNames", 0, &dwType, pHostNames, &dwSize);
|
dwSize += strlen(cm_NetbiosName) + 1;
|
||||||
|
pHostNames = malloc(dwSize);
|
||||||
for (pName = pHostNames; *pName ; pName += strlen(pName) + 1)
|
if (RegQueryValueEx( hkMSV10, "BackConnectionHostNames", 0, &dwType,
|
||||||
{
|
pHostNames, &dwSize) == ERROR_SUCCESS) {
|
||||||
if ( !stricmp(pName, cm_NetbiosName) ) {
|
for (pName = pHostNames; *pName ; pName += strlen(pName) + 1)
|
||||||
bNameFound = TRUE;
|
{
|
||||||
break;
|
if ( !stricmp(pName, cm_NetbiosName) ) {
|
||||||
}
|
bNameFound = TRUE;
|
||||||
}
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ( !bNameFound ) {
|
if ( !bNameFound ) {
|
||||||
int size = strlen(cm_NetbiosName) + 2;
|
int size = strlen(cm_NetbiosName) + 2;
|
||||||
if ( !pHostNames ) {
|
if ( !pHostNames ) {
|
||||||
pHostNames = malloc(size);
|
pHostNames = malloc(size);
|
||||||
dwSize = 1;
|
dwSize = size;
|
||||||
|
pName = pHostNames;
|
||||||
}
|
}
|
||||||
pName = pHostNames;
|
|
||||||
StringCbCopyA(pName, size, cm_NetbiosName);
|
StringCbCopyA(pName, size, cm_NetbiosName);
|
||||||
pName += size - 1;
|
pName += size - 1;
|
||||||
*pName = '\0'; /* add a second nul terminator */
|
*pName = '\0'; /* add a second nul terminator */
|
||||||
@ -370,8 +373,12 @@ configureBackConnectionHostNames(void)
|
|||||||
}
|
}
|
||||||
RegCloseKey(hkMSV10);
|
RegCloseKey(hkMSV10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pHostNames)
|
||||||
|
free(pHostNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if !defined(DJGPP)
|
#if !defined(DJGPP)
|
||||||
static void afsd_InitServerPreferences(void)
|
static void afsd_InitServerPreferences(void)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user