From c9339265f7036dd465a4bbf8e762fc246f45d6a4 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Sat, 2 Feb 2008 00:23:44 +0000 Subject: [PATCH] windows-client-config-cellservdb-20080201 LICENSE MIT modify cellservdb.c to use cm_GetCellServDB() from libafsconf.dll. This results in both libadmin and the afs client control panel using the same CellServDB as the rest of the system. --- src/WINNT/client_config/cellservdb.c | 43 ++---------------------------------- 1 file changed, 2 insertions(+), 41 deletions(-) diff --git a/src/WINNT/client_config/cellservdb.c b/src/WINNT/client_config/cellservdb.c index ddecb30..9a2222b 100644 --- a/src/WINNT/client_config/cellservdb.c +++ b/src/WINNT/client_config/cellservdb.c @@ -15,14 +15,10 @@ #include #include #include "cellservdb.h" +#include -#ifdef AFS_NT40_ENV #include #include -#else -#include -#endif -#include /* * PROTOTYPES _________________________________________________________________ @@ -66,38 +62,7 @@ static void strzcpy (char *pszTarget, const char *pszSource, size_t cch) 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 + cm_GetCellServDB(pszFilename, MAX_CSDB_PATH); } @@ -191,11 +156,7 @@ BOOL CSDB_WriteFile (PCELLSERVDB pCellServDB) { 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); } -- 1.9.4