diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-05-25 22:50:49 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-05-25 22:50:49 +0000 |
commit | fed2216d997d57c2931fd59946c6d48bc9544311 (patch) | |
tree | 2da8717933959a63b20d128ed08342facc02c5a9 /src/configreader.cpp | |
parent | 52e139da19b6b1aed81e6d1c3ee3ad8712ce2273 (diff) |
Remove the ServerConfig::DirValid check that breaks symlinks
This was included as a security check to prevent symlink attacks,
but this is no longer useful; anyone who can exploit the attack now
can just modify the ircd itself.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11390 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/configreader.cpp')
-rw-r--r-- | src/configreader.cpp | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp index 0fcf88e9d..51045ef58 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -2046,64 +2046,6 @@ char* ServerConfig::CleanFilename(char* name) } -bool ServerConfig::DirValid(const char* dirandfile) -{ -#ifdef WINDOWS - return true; -#else - - char work[1024]; - char buffer[1024]; - char otherdir[1024]; - int p; - - strlcpy(work, dirandfile, 1024); - p = strlen(work); - - // we just want the dir - while (*work) - { - if (work[p] == '/') - { - work[p] = '\0'; - break; - } - - work[p--] = '\0'; - } - - // Get the current working directory - if (getcwd(buffer, 1024 ) == NULL ) - return false; - - if (chdir(work) == -1) - return false; - - if (getcwd(otherdir, 1024 ) == NULL ) - return false; - - if (chdir(buffer) == -1) - return false; - - size_t t = strlen(work); - - if (strlen(otherdir) >= t) - { - otherdir[t] = '\0'; - if (!strcmp(otherdir,work)) - { - return true; - } - - return false; - } - else - { - return false; - } -#endif -} - std::string ServerConfig::GetFullProgDir() { char buffer[PATH_MAX]; |