openmohaa/code/sys
Zack Middleton 9c0d66c9f2
Don't list mod directories at Windows drive root
The mod list on Windows would search the root of the drive if
fs_basepath, fs_homepath, fs_steampath, or fs_gogpath are blank ("")
(which is usually the case).

The issue is in the low-level Sys_ListFiles() but it only affects the
mod menu, on Windows. It cannot be abused by console commands to
list system files outside of the virtual filesystem.

---

If a directory at the root of the drive of the working directory
contained a pk3 file, the directory was listed in the mods menu. The
virtual filesystem doesn't add blank directory names to the search path
so it cannot load mods from the drive root. (Unless of course you set a
fs_*path cvar to "C:\".)

Sys_ListFiles() with blank directory caused Windows to use "\*" for the
search path and "\" prefix means root of drive. Unix opendir("") failed
so nothing was listed for blank directory.

Sys_ListFilteredFiles() with blank directory _and_ specifying subdirs
could access any directory (on Windows and Unix-like) but no code uses
this or makes it accessible.

These functions are only used for initializing the virtual filesystem
and listing mods. They are not accessible by anything else such as a
console command. Only the mods menu, on Windows, is affected.
2023-07-06 19:46:01 +02:00
..
new Using "main" for loading DLLs as they are now combined 2023-07-02 19:15:35 +02:00
CMakeLists.txt Fixed CMakeLists (tested with CMake 3.10) 2023-06-18 12:18:10 +02:00
con_log.c ioquake3 porting 2023-05-24 19:29:36 +02:00
con_passive.c Hard reset 2016-03-27 11:49:47 +02:00
con_tty.c ioquake3 porting 2023-05-24 19:29:36 +02:00
con_win32.c ioquake3 porting 2023-05-24 19:29:36 +02:00
sys_autoupdater.c Updated platform files to ioq3 codebase 2023-01-31 00:54:21 +01:00
sys_loadlib.h ioquake3 porting 2023-05-24 19:29:36 +02:00
sys_local.h Fix macOS client/server failing to start from terminal 2023-06-17 02:19:29 +02:00
sys_main.c Fix macOS client/server failing to start from terminal 2023-06-17 02:19:29 +02:00
sys_osx.m Fix macOS client/server failing to start from terminal 2023-06-17 02:19:29 +02:00
sys_unix.c Don't list mod directories at Windows drive root 2023-07-06 19:46:01 +02:00
sys_win32.c Don't list mod directories at Windows drive root 2023-07-06 19:46:01 +02:00
win_bounds.cpp ioq3 sys 2023-05-25 19:09:32 +02:00
win_localization.cpp ioq3 files backport 2023-06-25 20:26:47 +02:00
win_localization.h Reworked file inclusion (using relative path) 2023-06-17 01:24:20 +02:00
win_manifest.xml ioquake3 porting 2023-05-24 19:29:36 +02:00
win_resource.h Hard reset 2016-03-27 11:49:47 +02:00
win_resource.rc Using latest ioq3 win_resource.rc with win_manifest.xml usage 2023-02-05 14:02:38 +01:00