1
0
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:
codemastr
2001-06-27 15:38:10 +00:00
parent d276e9a197
commit 2c9232113e
2 changed files with 9 additions and 1 deletions
+1 -1
View File
@@ -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
+8
View File
@@ -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",