[NFSD][TELNETD][LIBTIRPC][MAN] Don't hardcode C:\ReactOS (#2334)

CORE-14747
This commit is contained in:
Katayama Hirofumi MZ 2020-02-14 02:03:35 +09:00 committed by GitHub
parent 35710b51af
commit 214a9cb660
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 21 additions and 4 deletions

View file

@ -381,7 +381,9 @@ static int config_init(
} }
else else
{ {
StringCchCopyA(config_path, ARRAYSIZE(config_path), "C:\\ReactOS\\system32\\drivers\\etc\\ms-nfs41-idmap.conf"); status = GetLastError();
eprintf("GetSystemDirectoryA failed with %ld\n", GetLastError());
goto out;
} }
#endif #endif

View file

@ -177,7 +177,8 @@ static bool_t check_for_files()
} }
else else
{ {
StringCchCopyA(config_path, ARRAYSIZE(config_path), "C:\\ReactOS\\system32\\drivers\\etc\\netconfig"); eprintf("GetSystemDirectoryA failed with error %ld\n", GetLastError());
return FALSE;
} }
fd = fopen(config_path, "r"); fd = fopen(config_path, "r");

View file

@ -377,7 +377,7 @@ static void RunShell(client_t *client)
} }
else else
{ {
StringCchCopyA(cmd_path, ARRAYSIZE(cmd_path), "C:\\ReactOS\\system32\\cmd.exe"); ErrorExit("GetSystemDirectoryA failed\n");
} }
} }

View file

@ -93,6 +93,9 @@ BOOL winsock_fini(void)
return TRUE; return TRUE;
} }
#ifdef __REACTOS__
char NETCONFIG[MAX_PATH] = "";
#endif
BOOL WINAPI DllMain/*tirpc_main*/(HINSTANCE hinstDLL, // DLL module handle BOOL WINAPI DllMain/*tirpc_main*/(HINSTANCE hinstDLL, // DLL module handle
DWORD fdwReason, // reason called DWORD fdwReason, // reason called
LPVOID lpvReserved) // reserved LPVOID lpvReserved) // reserved
@ -109,6 +112,12 @@ BOOL WINAPI DllMain/*tirpc_main*/(HINSTANCE hinstDLL, // DLL module handle
// The DLL is loading due to process // The DLL is loading due to process
// initialization or a call to LoadLibrary. // initialization or a call to LoadLibrary.
case DLL_PROCESS_ATTACH: case DLL_PROCESS_ATTACH:
#ifdef __REACTOS__
if (!GetSystemDirectoryA(NETCONFIG, ARRAYSIZE(NETCONFIG)))
return FALSE;
lstrcatA(NETCONFIG, "\\drivers\\etc\\netconfig");
#endif
// Initialize socket library // Initialize socket library
if (winsock_init() == FALSE) if (winsock_init() == FALSE)

View file

@ -3,8 +3,13 @@
//#include <features.h> //#include <features.h>
#ifdef __REACTOS__
#undef NETCONFIG
extern char NETCONFIG[];
#else
// XXX Should be in, or come from, the registry!!! // XXX Should be in, or come from, the registry!!!
#define NETCONFIG "C:\\ReactOS\\System32\\drivers\\etc\\netconfig" #define NETCONFIG "C:\\ReactOS\\System32\\drivers\\etc\\netconfig"
#endif
#define NETPATH "NETPATH" #define NETPATH "NETPATH"
struct netconfig { struct netconfig {

View file

@ -13,7 +13,7 @@ rem []------------------------------------[]
rem []==[Config area]==[] rem []==[Config area]==[]
set MANED=edit set MANED=edit
set MANMORE=cat set MANMORE=cat
set MAN=c:\ReactOS\man set MAN=%WINDIR%\man
rem []==[End of config area]==[] rem []==[End of config area]==[]
goto chk_param goto chk_param