]>
Commit | Line | Data |
---|---|---|
bc999d0f | 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 | |
3 | ||
4 | diff -r 14467ecfea35 ircd/s_user.c | |
5 | --- a/ircd/s_user.c | |
6 | +++ b/ircd/s_user.c | |
7 | @@ -1317,13 +1317,7 @@ | |
8 | if (MyConnect(sptr)) | |
9 | { | |
10 | tmpmask = cli_snomask(sptr) & ~SNO_OPER; | |
11 | - cli_handler(sptr) = CLIENT_HANDLER; | |
12 | - | |
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); | |
17 | - | |
18 | + cli_handler(sptr) = CLIENT_HANDLER; | |
19 | } | |
20 | } | |
21 | break; | |
22 | @@ -1521,7 +1515,7 @@ | |
23 | ++UserStats.opers; | |
24 | client_set_privs(sptr, NULL); /* may set propagate privilege */ | |
25 | ||
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)) { | |
33 | prop = 1; | |
34 | } | |
35 | + | |
36 | + /* user was a local operator */ | |
37 | + if (FlagHas(&setflags, FLAG_LOCOP) && !IsLocOp(sptr)) { | |
38 | + | |
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); | |
43 | + } | |
44 | + | |
45 | if (FlagHas(&setflags, FLAG_OPER) && !IsOper(sptr)) { | |
46 | /* user no longer oper */ | |
47 | assert(UserStats.opers > 0); | |
48 | --UserStats.opers; | |
49 | ||
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>"); | |
58 | } else { | |
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)); | |
64 | } | |
65 | ||
66 | client_set_privs(sptr, NULL); /* will clear propagate privilege */ |