mirror of
https://bitbucket.org/CPMADevs/cnq3
synced 2024-11-10 06:31:48 +00:00
ignore q3config.cfg and autoexec.cfg outside fs_gamedir to avoid config poisoning
This commit is contained in:
parent
3b4338db2e
commit
3cb1fe44a8
1 changed files with 10 additions and 0 deletions
|
@ -1013,6 +1013,16 @@ int FS_FOpenFileRead( const char *filename, fileHandle_t *file, qbool uniqueFILE
|
|||
} else if ( search->dir ) {
|
||||
// check a file in the directory tree
|
||||
|
||||
// For mods, we ignore baseq3/q3config.cfg and baseq3/autoexec.cfg
|
||||
// to avoid config pollution.
|
||||
// Mod authors should package a proper default.cfg (pretty much binds only)
|
||||
// in their .pk3 so that it overrides baseq3/default.cfg (it's in pak0.pk3).
|
||||
if ( Q_stricmp( search->dir->gamedir, fs_gamedir ) &&
|
||||
( !Q_stricmp( filename, "q3config.cfg" ) ||
|
||||
!Q_stricmp( filename, "autoexec.cfg" ) ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// if we are running restricted, the only files we
|
||||
// will allow to come from the directory are .cfg files
|
||||
l = strlen( filename );
|
||||
|
|
Loading…
Reference in a new issue