1 do check user was indeed a local oper when -o or -O is set
2 if it is my user, use cli_sockhost() instead of cli_user()->realhost
4 diff -r 14467ecfea35 ircd/s_user.c
10 tmpmask = cli_snomask(sptr) & ~SNO_OPER;
11 - cli_handler(sptr) = CLIENT_HANDLER;
13 - /* notify my operators a local operator has deOPERed - wiebe */
14 - sendto_opmask_butone(0, SNO_OLDSNO, "%s (%s@%s) is no longer operator (o) as %s",
15 - cli_name(sptr), cli_user(sptr)->realusername, cli_user(sptr)->realhost,
16 - cli_user(sptr)->opername);
18 + cli_handler(sptr) = CLIENT_HANDLER;
24 client_set_privs(sptr, NULL); /* may set propagate privilege */
26 - /* notify my operators a user has OPERed on a remote server - wiebe */
27 + /* notify my operators a user has OPERed on a remote server */
28 if (!MyConnect(sptr)) {
29 sendto_opmask_butone(0, SNO_OLDSNO, "%s (%s@%s) is now operator (O) as %s on %s",
30 cli_name(sptr), cli_user(sptr)->realusername, cli_user(sptr)->realhost,
31 @@ -1533,20 +1527,30 @@
32 if (HasPriv(sptr, PRIV_PROPAGATE)) {
36 + /* user was a local operator */
37 + if (FlagHas(&setflags, FLAG_LOCOP) && !IsLocOp(sptr)) {
39 + /* notify my operators a local operator has deOPERed */
40 + sendto_opmask_butone(0, SNO_OLDSNO, "%s (%s@%s) is no longer operator (o) as %s",
41 + cli_name(sptr), cli_user(sptr)->realusername, cli_sockhost(sptr),
42 + cli_user(sptr)->opername);
45 if (FlagHas(&setflags, FLAG_OPER) && !IsOper(sptr)) {
46 /* user no longer oper */
47 assert(UserStats.opers > 0);
50 - /* notify my operators an operator has deOPERed on the network - wiebe */
51 + /* notify my operators an operator has deOPERed on the network */
52 if (MyConnect(sptr)) {
53 sendto_opmask_butone(0, SNO_OLDSNO, "%s (%s@%s) is no longer operator (O) as %s",
54 - cli_name(sptr), cli_user(sptr)->realusername, cli_user(sptr)->realhost,
55 - cli_user(sptr)->opername ? cli_user(sptr)->opername : "<unknown>");
56 + cli_name(sptr), cli_user(sptr)->realusername, cli_sockhost(sptr),
57 + cli_user(sptr)->opername ? cli_user(sptr)->opername : "<unknown>");
59 sendto_opmask_butone(0, SNO_OLDSNO, "%s (%s@%s) is no longer operator (O) as %s on %s",
60 - cli_name(sptr), cli_user(sptr)->realusername, cli_user(sptr)->realhost,
61 - cli_user(sptr)->opername ? cli_user(sptr)->opername : "<unknown>", cli_name(cli_user(sptr)->server));
62 + cli_name(sptr), cli_user(sptr)->realusername, cli_user(sptr)->realhost,
63 + cli_user(sptr)->opername ? cli_user(sptr)->opername : "<unknown>", cli_name(cli_user(sptr)->server));
66 client_set_privs(sptr, NULL); /* will clear propagate privilege */