Don't load .pk3s as .dlls, and don't load user config files from .pk3s.

This commit is contained in:
SmileTheory 2017-03-13 14:14:00 -07:00
parent cd41690fc3
commit 376267d534
3 changed files with 15 additions and 2 deletions

View file

@ -3200,7 +3200,7 @@ void CL_InitRef( void ) {
Com_Printf( "----- Initializing Renderer ----\n" ); Com_Printf( "----- Initializing Renderer ----\n" );
#ifdef USE_RENDERER_DLOPEN #ifdef USE_RENDERER_DLOPEN
cl_renderer = Cvar_Get("cl_renderer", "opengl2", CVAR_ARCHIVE | CVAR_LATCH); cl_renderer = Cvar_Get("cl_renderer", "opengl2", CVAR_ARCHIVE | CVAR_LATCH | CVAR_PROTECTED);
Com_sprintf(dllName, sizeof(dllName), "renderer_%s_" ARCH_STRING DLL_EXT, cl_renderer->string); Com_sprintf(dllName, sizeof(dllName), "renderer_%s_" ARCH_STRING DLL_EXT, cl_renderer->string);
@ -3551,7 +3551,7 @@ void CL_Init( void ) {
cl_allowDownload = Cvar_Get ("cl_allowDownload", "0", CVAR_ARCHIVE); cl_allowDownload = Cvar_Get ("cl_allowDownload", "0", CVAR_ARCHIVE);
#ifdef USE_CURL_DLOPEN #ifdef USE_CURL_DLOPEN
cl_cURLLib = Cvar_Get("cl_cURLLib", DEFAULT_CURL_LIB, CVAR_ARCHIVE); cl_cURLLib = Cvar_Get("cl_cURLLib", DEFAULT_CURL_LIB, CVAR_ARCHIVE | CVAR_PROTECTED);
#endif #endif
cl_conXOffset = Cvar_Get ("cl_conXOffset", "0", 0); cl_conXOffset = Cvar_Get ("cl_conXOffset", "0", 0);

View file

@ -1364,12 +1364,18 @@ long FS_FOpenFileRead(const char *filename, fileHandle_t *file, qboolean uniqueF
{ {
searchpath_t *search; searchpath_t *search;
long len; long len;
qboolean isLocalConfig;
if(!fs_searchpaths) if(!fs_searchpaths)
Com_Error(ERR_FATAL, "Filesystem call made without initialization"); Com_Error(ERR_FATAL, "Filesystem call made without initialization");
isLocalConfig = !strcmp(filename, "autoexec.cfg") || !strcmp(filename, Q3CONFIG_CFG);
for(search = fs_searchpaths; search; search = search->next) for(search = fs_searchpaths; search; search = search->next)
{ {
// autoexec.cfg and q3config.cfg can only be loaded outside of pk3 files.
if (isLocalConfig && search->pack)
continue;
len = FS_FOpenFileReadDir(filename, search, file, uniqueFILE, qfalse); len = FS_FOpenFileReadDir(filename, search, file, uniqueFILE, qfalse);
if(file == NULL) if(file == NULL)

View file

@ -500,6 +500,13 @@ void *Sys_LoadDll(const char *name, qboolean useSystemLib)
{ {
void *dllhandle; void *dllhandle;
// Don't load any DLLs that end with the pk3 extension
if (COM_CompareExtension(name, ".pk3"))
{
Com_Printf("Rejecting DLL named \"%s\"", name);
return NULL;
}
if(useSystemLib) if(useSystemLib)
Com_Printf("Trying to load \"%s\"...\n", name); Com_Printf("Trying to load \"%s\"...\n", name);