diff options
author | Russell King <rmk+kernel@armlinux.org.uk> | 2016-06-05 16:45:55 +0100 |
---|---|---|
committer | Russell King <rmk+kernel@armlinux.org.uk> | 2019-07-21 20:59:35 +0100 |
commit | 9c7fd727cf375974894624674a561c0adf12aa6e (patch) | |
tree | bc5e971f92916cbe0d05163efbcf9ceaa50653b6 | |
parent | 35736254aaf68620da3b3e85c3a959cfaa85b543 (diff) |
m_operspy
-rw-r--r-- | contrib/m_operspy.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/contrib/m_operspy.c b/contrib/m_operspy.c index 5e2b1a0..f4a0ab4 100644 --- a/contrib/m_operspy.c +++ b/contrib/m_operspy.c @@ -36,7 +36,6 @@ #include "channel_mode.h" #include "client.h" #include "ircd.h" -#include "sprintf_irc.h" #include "numeric.h" #include "fdlist.h" #include "s_bsd.h" @@ -119,20 +118,21 @@ static const struct operspy_s { { NULL, NULL } }; -static void +static int ms_operspy(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { #ifdef OPERSPY_LOG operspy_log(source_p, parv[1], parv[2]); #endif + return 0; } /* mo_operspy() * parv[1] = operspy command * parv[2] = command parameter */ -static void +static int mo_operspy(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -144,7 +144,7 @@ mo_operspy(struct Client *client_p, struct Client *source_p, { sendto_one(client_p, form_str(ERR_NOPRIVILEGES), me.name, client_p->name); - return; + return 0; } assert(client_p == source_p); @@ -154,7 +154,7 @@ mo_operspy(struct Client *client_p, struct Client *source_p, if (!irccmp(optr->cmd, parv[1])) { (*optr->func_p)(client_p, parc, parv); - return; + return 0; } } @@ -171,6 +171,8 @@ mo_operspy(struct Client *client_p, struct Client *source_p, sendto_one(client_p, ":%s NOTICE %s :%s is not a valid option. Choose from %s", me.name, client_p->name, parv[1], cmdbuf); + + return 0; } static void @@ -438,7 +440,7 @@ operspy_whois(struct Client *client_p, int parc, char *parv[]) sendto_one(client_p, form_str(RPL_WHOISUSER), me.name, client_p->name, target_p->name, target_p->username, target_p->host, target_p->info); - mlen = ircsprintf(buf, form_str(RPL_WHOISCHANNELS), me.name, + mlen = snprintf(buf, sizeof(buf), form_str(RPL_WHOISCHANNELS), me.name, client_p->name, target_p->name, ""); cur_len = mlen; t = buf + mlen; @@ -454,7 +456,7 @@ operspy_whois(struct Client *client_p, int parc, char *parv[]) t = buf + mlen; } - tlen = ircsprintf(t, "%s%s%s ", + tlen = snprintf(t, buf + sizeof(buf) - t, "%s%s%s ", ShowChannel(client_p, chptr_whois) ? "" : "%", get_member_status((struct Membership *)lp->data, 1), chptr_whois->chname); @@ -484,8 +486,10 @@ operspy_whois(struct Client *client_p, int parc, char *parv[]) me.name, client_p->name, target_p->name); if (HasUMode(target_p, UMODE_OPER)) - sendto_one(client_p, form_str(HasUMode(target_p, UMODE_ADMIN) ? RPL_WHOISADMIN : - RPL_WHOISOPERATOR), me.name, client_p->name, target_p->name); + sendto_one(client_p, form_str(RPL_WHOISOPERATOR), me.name, + client_p->name, target_p->name, + HasUMode(target_p, UMODE_ADMIN) ? "is a Server Administrator" : + "is an IRC Operator"); if (strcmp(target_p->sockhost, "0") && target_p->sockhost[0] != '\0') { |