windows-getrootcellname-20090223

LICENSE MIT

do not mix and match CELL_MAXNAMELEN and MAXCELLCHARS.  They are
not the same.
This commit is contained in:
Jeffrey Altman 2009-02-23 14:28:32 +00:00
parent f83cfcafcb
commit 80faa5e93d
2 changed files with 6 additions and 3 deletions

View File

@ -447,7 +447,7 @@ KFW_initialize(void)
LoadFuncs(CCAPI_DLL, ccapi_fi, &hCCAPI, 0, 1, 0, 0);
if ( KFW_is_available() ) {
char rootcell[MAXCELLCHARS+1];
char rootcell[CELL_MAXNAMELEN+1];
#ifdef USE_MS2MIT
KFW_import_windows_lsa();
#endif /* USE_MS2MIT */

View File

@ -394,7 +394,10 @@ long cm_GetCellServDB(char *cellNamep, afs_uint32 len)
return 0;
}
/* look up the root cell's name in the Registry */
/* look up the root cell's name in the Registry
* Input buffer must be at least CELL_MAXNAMELEN
* in size. (Defined in cm_cell.h)
*/
long cm_GetRootCellName(char *cellNamep)
{
DWORD code, dummyLen;
@ -405,7 +408,7 @@ long cm_GetRootCellName(char *cellNamep)
if (code != ERROR_SUCCESS)
return -1;
dummyLen = 256;
dummyLen = CELL_MAXNAMELEN;
code = RegQueryValueEx(parmKey, "Cell", NULL, NULL,
cellNamep, &dummyLen);
RegCloseKey (parmKey);