From 636a52312b9ba4c5ffc886c7bdba14bd76726976 Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 20 Sep 2008 21:46:56 +0000 Subject: Fix a rather nasty race condition revealed by my reading through the comments and enhancing them. Back when i did executeable includes, i placed a 'todo' in the code which said something along the lines of: 'we cant pass a User* into the config reader any more, because when the config reader thread finishes, that user may be gone and this will crash. Consider using an UID instead so that if the user vanishes, we can detect this situation.' Of course, nobody ever did this, so i'm doing it now to ensure we dont come up against some particularly ugly race condition crashes! git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10569 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/commands/cmd_rehash.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/commands/cmd_rehash.cpp') diff --git a/src/commands/cmd_rehash.cpp b/src/commands/cmd_rehash.cpp index 9a9384af5..ebbb7c9bd 100644 --- a/src/commands/cmd_rehash.cpp +++ b/src/commands/cmd_rehash.cpp @@ -64,10 +64,10 @@ CmdResult CommandRehash::Handle (const std::vector& parameters, Use if (!ServerInstance->ConfigThread) { - ServerInstance->Config->RehashUser = user; + ServerInstance->Config->RehashUserUID = user->uuid; ServerInstance->Config->RehashParameter = parameters.size() ? parameters[0] : ""; - ServerInstance->ConfigThread = new ConfigReaderThread(ServerInstance, false, user); + ServerInstance->ConfigThread = new ConfigReaderThread(ServerInstance, false, ServerInstance->Config->RehashUserUID); ServerInstance->Threads->Create(ServerInstance->ConfigThread); } else -- cgit v1.2.3