1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-06 02:53:12 +02:00

Duh, I meant, NOREMOVETMP.

[skip ci]
This commit is contained in:
Bram Matthys
2019-09-06 09:13:19 +02:00
parent 46486310dc
commit 9b1fa66434
2 changed files with 9 additions and 12 deletions
-2
View File
@@ -1204,9 +1204,7 @@ int InitUnrealIRCd(int argc, char *argv[])
init_CommandHash();
initwhowas();
initstats();
#ifndef NOREMOVETMP
DeleteTempModules();
#endif
booted = FALSE;
#if !defined(_WIN32) && !defined(_AMIGA) && !defined(OSXTIGER) && DEFAULT_PERMISSIONS != 0
/* Hack to stop people from being able to read the config file */
+9 -10
View File
@@ -69,6 +69,12 @@ void *obsd_dlsym(void *handle, char *symbol) {
}
#endif
void deletetmp(char *path)
{
#ifndef NOREMOVETMP
remove(path);
#endif
}
void DeleteTempModules(void)
{
@@ -94,7 +100,7 @@ void DeleteTempModules(void)
if (!strstr(fname, ".so") && !strstr(fname, ".conf") && strstr(fname, "core"))
continue; /* core dump */
ircsnprintf(tempbuf, sizeof(tempbuf), "%s/%s", TMPDIR, fname);
remove(tempbuf);
deletetmp(tempbuf);
}
closedir(fd);
#else
@@ -109,7 +115,7 @@ void DeleteTempModules(void)
if (strcmp(hData.cFileName, ".") || strcmp(hData.cFileName, ".."))
{
ircsnprintf(tempbuf, sizeof(tempbuf), "%s/%s", TMPDIR, hData.cFileName);
remove(tempbuf);
deletetmp(tempbuf);
}
}
while (FindNextFile(hFile, &hData))
@@ -117,7 +123,7 @@ void DeleteTempModules(void)
if (!strcmp(hData.cFileName, ".") || !strcmp(hData.cFileName, ".."))
continue;
ircsnprintf(tempbuf, sizeof(tempbuf), "%s/%s", TMPDIR, hData.cFileName);
remove(tempbuf);
deletetmp(tempbuf);
}
FindClose(hFile);
#endif
@@ -241,13 +247,6 @@ static char *validate_mod_header(ModuleHeader *mod_header)
return NULL; /* SUCCESS */
}
void deletetmp(char *path)
{
#ifndef REMOVETMP
remove(path);
#endif
}
/*
* Returns an error if insucessful .. yes NULL is OK!
*/