Remove oper privileges in DETACH command.
[silc.git] / apps / silcd / command.c
index 93e94e80bca35c2c41f56685ad9820e0ba9c95c6..5d6b3cda0a86012b518213d379e88fd35f89a01b 100644 (file)
@@ -5010,6 +5010,11 @@ SILC_SERVER_CMD_FUNC(detach)
 
   SILC_SERVER_COMMAND_CHECK(SILC_COMMAND_DETACH, cmd, 0, 0);
 
+  /* Remove operator privileges, since the client may resume in some
+     other server which to it does not have operator privileges. */
+  client->mode &= ~(SILC_UMODE_SERVER_OPERATOR |
+                   SILC_UMODE_ROUTER_OPERATOR);
+
   /* Send the user mode notify to notify that client is detached */
   client->mode |= SILC_UMODE_DETACHED;
   client->data.status &= ~SILC_IDLIST_STATUS_RESUMED;