commit - 45b1a45c979d0418591a1c62204d5a607cf86cde
commit + 4a3e40bc95e783145855da611fa5944401a9c2c9
blob - e7dfee6c944e48237b25a4d2aa7942aa81c3676b
blob + 656e9591f801bd11555a21c3a0ca843cd2d89652
--- src/ngircd/irc-oper.c
+++ src/ngircd/irc-oper.c
* Check that the client is an IRC operator allowed to administer this server.
*/
static bool
-Check_Oper(CLIENT * Client)
+Check_Oper(CLIENT * Client, REQUEST * Req)
{
- if (!Client_HasMode(Client, 'o'))
+ CLIENT *c;
+
+ assert(Client != NULL);
+ assert(Req != NULL);
+
+ if (Client_Type(Client) == CLIENT_SERVER && Req->prefix)
+ c = Client_Search(Req->prefix);
+ else
+ c = Client;
+ if (!c)
return false;
- if (!Client_OperByMe(Client) && !Conf_AllowRemoteOper)
+ if (!Client_HasMode(c, 'o'))
return false;
+ if (!Client_OperByMe(c) && !Conf_AllowRemoteOper)
+ return false;
/* The client is an local IRC operator, or this server is configured
* to trust remote operators. */
return true;
assert(Client != NULL);
assert(Req != NULL);
- if (!Check_Oper(Client))
+ if (!Check_Oper(Client, Req))
return No_Privileges(Client, Req);
/* Bad number of parameters? */
assert( Client != NULL );
assert( Req != NULL );
- if (!Check_Oper(Client))
+ if (!Check_Oper(Client, Req))
return No_Privileges(Client, Req);
/* Bad number of parameters? */
assert( Client != NULL );
assert( Req != NULL );
- if (!Check_Oper(Client))
+ if (!Check_Oper(Client, Req))
return No_Privileges(Client, Req);
/* Bad number of parameters? */
assert(Client != NULL);
assert(Req != NULL);
- if (!Check_Oper(Client))
+ if (!Check_Oper(Client, Req))
return No_Privileges(Client, Req);
/* Bad number of parameters? */
assert(Client != NULL);
assert(Req != NULL);
- if (!Check_Oper(Client))
+ if (!Check_Oper(Client, Req))
return No_Privileges(Client, Req);
/* Bad number of parameters? */