diff options
author | Benjamin Jemlich <pcgod@users.sourceforge.net> | 2011-10-23 11:06:59 +0400 |
---|---|---|
committer | Benjamin Jemlich <pcgod@users.sourceforge.net> | 2011-10-23 11:30:02 +0400 |
commit | 089b23d9779785afd6402f54d1a33107d582961d (patch) | |
tree | 79b92b7999b6706df844b89c7dd905d12cd9f4bb /src/murmur/RPC.cpp | |
parent | 380b52d3e00aad4ad4c2635f25d40dd05c09165d (diff) |
Fix ghost disconnect removing permissions (#3423985)
Returning a list of groups using an authenticator added
temporary group membership for the user id only. Those are
removed when we're disconnecting an old user using the same
user id. Adding the session id to the group should fix the
problem.
This won't work if someone uses verifyPassword to set the
permissions (which is an undocumented implementation detail
anyway).
Diffstat (limited to 'src/murmur/RPC.cpp')
-rw-r--r-- | src/murmur/RPC.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/murmur/RPC.cpp b/src/murmur/RPC.cpp index f290952e4..108b8be75 100644 --- a/src/murmur/RPC.cpp +++ b/src/murmur/RPC.cpp @@ -226,13 +226,16 @@ void Server::sendTextMessage(Channel *cChannel, ServerUser *pUser, bool tree, co } } -void Server::setTempGroups(int userid, Channel *cChannel, const QStringList &groups) { +void Server::setTempGroups(int userid, int sessionId, Channel *cChannel, const QStringList &groups) { if (! cChannel) cChannel = qhChannels.value(0); Group *g; - foreach(g, cChannel->qhGroups) + foreach(g, cChannel->qhGroups) { g->qsTemporary.remove(userid); + if (sessionId != 0) + g->qsTemporary.remove(- sessionId); + } QString gname; foreach(gname, groups) { @@ -241,6 +244,8 @@ void Server::setTempGroups(int userid, Channel *cChannel, const QStringList &gro g = new Group(cChannel, gname); } g->qsTemporary.insert(userid); + if (sessionId != 0) + g->qsTemporary.insert(- sessionId); } User *p = qhUsers.value(userid); |