mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-06-29 15:46:37 +02:00
Made glob() used GLOB_LIMIT on OpenBSD 2.9 to try and stop DoSing
This commit is contained in:
@@ -613,4 +613,4 @@ seen. gmtime warning still there
|
||||
- Added configure check for glob.h
|
||||
- Added the ability to use file globs in loadmodule and include (only if your system has glob)
|
||||
- Added ./Config option to enable IPv6 (and made a configure check to make sure we can)
|
||||
|
||||
- Made glob() use GLOB_LIMIT on OpenBSD 2.9 to help prevent a DoS
|
||||
|
||||
@@ -924,7 +924,11 @@ int _conf_include(ConfigFile *conf, ConfigEntry *ce)
|
||||
chmod(ce->ce_vardata, DEFAULT_PERMISSIONS);
|
||||
#endif
|
||||
#ifdef GLOBH
|
||||
#if defined(__OpenBSD__) && defined(GLOB_LIMIT)
|
||||
glob(ce->ce_vardata, GLOB_NOSORT|GLOB_NOCHECK|GLOB_LIMIT, NULL, &files);
|
||||
#else
|
||||
glob(ce->ce_vardata, GLOB_NOSORT|GLOB_NOCHECK, NULL, &files);
|
||||
#endif
|
||||
if (!files.gl_pathc) {
|
||||
globfree(&files);
|
||||
config_error("%s:%i: include %s: invalid file given",
|
||||
@@ -1157,7 +1161,11 @@ int _conf_loadmodule(ConfigFile *conf, ConfigEntry *ce)
|
||||
return -1;
|
||||
}
|
||||
#ifdef GLOBH
|
||||
#if defined(__OpenBSD__) && defined(GLOB_LIMIT)
|
||||
glob(ce->ce_vardata, GLOB_NOSORT|GLOB_NOCHECK|GLOB_LIMIT, NULL, &files);
|
||||
#else
|
||||
glob(ce->ce_vardata, GLOB_NOSORT|GLOB_NOCHECK, NULL, &files);
|
||||
#endif
|
||||
if (!files.gl_pathc) {
|
||||
globfree(&files);
|
||||
config_error("%s:%i: loadmodule %s: failed to load",
|
||||
|
||||
Reference in New Issue
Block a user