]> jfr.im git - irc/quakenet/snircd-patchqueue.git/blob - hashiddenhostorissethost.patch
nickgline: include nick! bit in gline loggin
[irc/quakenet/snircd-patchqueue.git] / hashiddenhostorissethost.patch
1 add HasHiddenHostOrIsSetHost() macro instead of having to test HasHiddenHost() and IsSetHost() in many places
2
3 diff -r e4e1d8d47a8e include/client.h
4 --- a/include/client.h
5 +++ b/include/client.h
6 @@ -637,6 +637,8 @@
7 #define IsSetHost(x) HasFlag(x, FLAG_SETHOST)
8 /** Return non-zero if the client is using a spoofhost that was set by a service */
9 #define IsRemoteSetHost(x) HasFlag(x, FLAG_REMOTESETHOST)
10 +/** Return non-zero if the client's host is hidden or is using a spoofhost */
11 +#define HasHiddenHostOrIsSetHost(x) (HasHiddenHost(x) || IsSetHost(x))
12
13 /** Mark a client as having an in-progress net.burst. */
14 #define SetBurst(x) SetFlag(x, FLAG_BURST)
15 diff -r e4e1d8d47a8e ircd/m_check.c
16 --- a/ircd/m_check.c
17 +++ b/ircd/m_check.c
18 @@ -489,7 +489,7 @@
19 send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": User/Hostmask:: %s@%s [%s] (Clients: %hu)",
20 cli_user(acptr)->username, cli_user(acptr)->host, ircd_ntoa(&(cli_ip(acptr))), IPcheck_nr(acptr));
21
22 - if (IsSetHost(acptr) || HasHiddenHost(acptr))
23 + if (HasHiddenHostOrIsSetHost(acptr))
24 send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Real User/Host:: %s@%s", cli_user(acptr)->realusername, cli_user(acptr)->realhost);
25
26 /* COLOR_OFF ? */
27 diff -r e4e1d8d47a8e ircd/m_userhost.c
28 --- a/ircd/m_userhost.c
29 +++ b/ircd/m_userhost.c
30 @@ -104,7 +104,7 @@
31 * of +x. If an oper wants the real host, he should go to
32 * /whois to get it.
33 */
34 - (HasHiddenHost(cptr) || IsSetHost(cptr)) && (sptr != cptr) ?
35 + HasHiddenHostOrIsSetHost(cptr) && (sptr != cptr) ?
36 cli_user(cptr)->host : cli_user(cptr)->realhost);
37 }
38
39 diff -r e4e1d8d47a8e ircd/m_userip.c
40 --- a/ircd/m_userip.c
41 +++ b/ircd/m_userip.c
42 @@ -106,7 +106,7 @@
43 * of +x. If an oper wants the real IP, he should go to
44 * /whois to get it.
45 */
46 - ((HasHiddenHost(cptr) || IsSetHost(cptr) || feature_bool(FEAT_HIS_USERIP)) && (sptr != cptr)) ?
47 + ((HasHiddenHostOrIsSetHost(cptr) || feature_bool(FEAT_HIS_USERIP)) && (sptr != cptr)) ?
48 feature_str(FEAT_HIDDEN_IP) :
49 ircd_ntoa(&cli_ip(cptr)));
50 }
51 diff -r e4e1d8d47a8e ircd/m_who.c
52 --- a/ircd/m_who.c
53 +++ b/ircd/m_who.c
54 @@ -402,14 +402,13 @@
55 && ((!(matchsel & WHO_FIELD_HOS))
56 || matchexec(cli_user(acptr)->host, mymask, minlen))
57 && ((!(matchsel & WHO_FIELD_HOS))
58 - || !IsSetHost(acptr)
59 - || !HasHiddenHost(acptr)
60 + || !HasHiddenHostOrIsSetHost(acptr)
61 || !IsAnOper(sptr)
62 || matchexec(cli_user(acptr)->realhost, mymask, minlen))
63 && ((!(matchsel & WHO_FIELD_REN))
64 || matchexec(cli_info(acptr), mymask, minlen))
65 && ((!(matchsel & WHO_FIELD_NIP))
66 - || ((HasHiddenHost(acptr) || IsSetHost(acptr)) && !IsAnOper(sptr))
67 + || (HasHiddenHostOrIsSetHost(acptr) && !IsAnOper(sptr))
68 || !ipmask_check(&cli_ip(acptr), &imask, ibits))
69 && ((!(matchsel & WHO_FIELD_ACC))
70 || matchexec(cli_user(acptr)->account, mymask, minlen)))
71 @@ -445,14 +444,13 @@
72 && ((!(matchsel & WHO_FIELD_HOS))
73 || matchexec(cli_user(acptr)->host, mymask, minlen))
74 && ((!(matchsel & WHO_FIELD_HOS))
75 - || !IsSetHost(acptr)
76 - || !HasHiddenHost(acptr)
77 + || !HasHiddenHostOrIsSetHost(acptr)
78 || !IsAnOper(sptr)
79 || matchexec(cli_user(acptr)->realhost, mymask, minlen))
80 && ((!(matchsel & WHO_FIELD_REN))
81 || matchexec(cli_info(acptr), mymask, minlen))
82 && ((!(matchsel & WHO_FIELD_NIP))
83 - || ((HasHiddenHost(acptr) || IsSetHost(acptr)) && !IsAnOper(sptr))
84 + || (HasHiddenHostOrIsSetHost(acptr) && !IsAnOper(sptr))
85 || !ipmask_check(&cli_ip(acptr), &imask, ibits))
86 && ((!(matchsel & WHO_FIELD_ACC))
87 || matchexec(cli_user(acptr)->account, mymask, minlen)))
88 diff -r e4e1d8d47a8e ircd/m_whois.c
89 --- a/ircd/m_whois.c
90 +++ b/ircd/m_whois.c
91 @@ -214,7 +214,7 @@
92 if (IsAccount(acptr))
93 send_reply(sptr, RPL_WHOISACCOUNT, name, user->account);
94
95 - if ((HasHiddenHost(acptr) || IsSetHost(acptr)) && ((IsAnOper(sptr) && HasPriv(sptr, PRIV_USER_PRIVACY)) || acptr == sptr))
96 + if (HasHiddenHostOrIsSetHost(acptr) && ((IsAnOper(sptr) && HasPriv(sptr, PRIV_USER_PRIVACY)) || acptr == sptr))
97 send_reply(sptr, RPL_WHOISACTUALLY, name, user->realusername,
98 user->realhost, ircd_ntoa(&cli_ip(acptr)));
99
100 diff -r e4e1d8d47a8e ircd/send.c
101 --- a/ircd/send.c
102 +++ b/ircd/send.c
103 @@ -281,7 +281,7 @@
104 {
105 case MATCH_HOST:
106 return (match(mask, cli_user(one)->host) == 0 ||
107 - ((HasHiddenHost(one) || IsSetHost(one)) && match(mask, cli_user(one)->realhost) == 0));
108 + (HasHiddenHostOrIsSetHost(one) && match(mask, cli_user(one)->realhost) == 0));
109 case MATCH_SERVER:
110 default:
111 return (match(mask, cli_name(cli_user(one)->server)) == 0);
112 diff -r e4e1d8d47a8e ircd/whocmds.c
113 --- a/ircd/whocmds.c
114 +++ b/ircd/whocmds.c
115 @@ -134,7 +134,7 @@
116
117 if (fields & WHO_FIELD_NIP)
118 {
119 - const char* p2 = (HasHiddenHost(acptr) || IsSetHost(acptr) || feature_bool(FEAT_HIS_USERIP)) && (!IsAnOper(sptr) || (IsAnOper(sptr) && !HasPriv(sptr, PRIV_USER_PRIVACY))) ?
120 + const char* p2 = (HasHiddenHostOrIsSetHost(acptr) || feature_bool(FEAT_HIS_USERIP)) && (!IsAnOper(sptr) || (IsAnOper(sptr) && !HasPriv(sptr, PRIV_USER_PRIVACY))) ?
121 feature_str(FEAT_HIDDEN_IP) :
122 ircd_ntoa(&cli_ip(acptr));
123 *(p1++) = ' ';
124 diff -r e4e1d8d47a8e ircd/whowas.c
125 --- a/ircd/whowas.c
126 +++ b/ircd/whowas.c
127 @@ -272,7 +272,7 @@
128 DupString(ww->name, cli_name(cptr));
129 DupString(ww->username, cli_user(cptr)->username);
130 DupString(ww->hostname, cli_user(cptr)->host);
131 - if (HasHiddenHost(cptr))
132 + if (HasHiddenHostOrIsSetHost(cptr))
133 DupString(ww->realhost, cli_user(cptr)->realhost);
134 DupString(ww->servername, cli_name(cli_user(cptr)->server));
135 DupString(ww->realname, cli_info(cptr));