]>
Commit | Line | Data |
---|---|---|
edb26b39 P |
1 | # HG changeset patch |
2 | # Parent 956177bd34a75c9221a0f81bfeb69f769ba7c86f | |
3 | ||
4 | diff -r 956177bd34a7 ircd/m_wallchops.c | |
5 | --- a/ircd/m_wallchops.c Fri Jul 19 22:51:36 2013 +0100 | |
6 | +++ b/ircd/m_wallchops.c Fri Jul 19 22:54:29 2013 +0100 | |
7 | @@ -162,8 +162,7 @@ | |
8 | return 0; | |
9 | ||
10 | if (!IsLocalChannel(parv[1]) && (chptr = FindChannel(parv[1]))) { | |
11 | - if (client_can_send_to_channel(sptr, chptr, 0) && !(chptr->mode.mode & MODE_NONOTICE)) { | |
12 | - RevealDelayedJoinIfNeeded(sptr, chptr); | |
13 | + if (client_can_send_to_channel(sptr, chptr, 1)) { | |
14 | sendcmdto_channel_butone(sptr, CMD_WALLCHOPS, chptr, cptr, | |
15 | SKIP_DEAF | SKIP_BURST | SKIP_NONOPS, | |
16 | "%H :%s", chptr, parv[parc - 1]); | |
17 | diff -r 956177bd34a7 ircd/m_wallvoices.c | |
18 | --- a/ircd/m_wallvoices.c Fri Jul 19 22:51:36 2013 +0100 | |
19 | +++ b/ircd/m_wallvoices.c Fri Jul 19 22:54:29 2013 +0100 | |
20 | @@ -161,8 +161,7 @@ | |
21 | return 0; | |
22 | ||
23 | if (!IsLocalChannel(parv[1]) && (chptr = FindChannel(parv[1]))) { | |
24 | - if (client_can_send_to_channel(sptr, chptr, 0) && !(chptr->mode.mode & MODE_NONOTICE)) { | |
25 | - RevealDelayedJoinIfNeeded(sptr, chptr); | |
26 | + if (client_can_send_to_channel(sptr, chptr, 1)) { | |
27 | sendcmdto_channel_butone(sptr, CMD_WALLVOICES, chptr, cptr, | |
28 | SKIP_DEAF | SKIP_BURST | SKIP_NONVOICES, | |
29 | "%H :%s", chptr, parv[parc - 1]); | |
30 | diff -r 956177bd34a7 ircd/s_auth.c | |
31 | --- a/ircd/s_auth.c Fri Jul 19 22:51:36 2013 +0100 | |
32 | +++ b/ircd/s_auth.c Fri Jul 19 22:54:29 2013 +0100 | |
33 | @@ -1940,9 +1940,9 @@ | |
34 | if (*end2 == ':') | |
35 | cli_user(cli)->acc_flags = strtoull(end2 + 1, NULL, 10); | |
36 | } | |
37 | + params[0][len] = '\0'; | |
38 | } | |
39 | ||
40 | - | |
41 | /* Copy account name to User structure. */ | |
42 | ircd_strncpy(cli_user(cli)->account, params[0], ACCOUNTLEN); | |
43 | SetAccount(cli); | |
44 | diff -r 956177bd34a7 ircd/s_user.c | |
45 | --- a/ircd/s_user.c Fri Jul 19 22:51:36 2013 +0100 | |
46 | +++ b/ircd/s_user.c Fri Jul 19 22:54:29 2013 +0100 | |
edb26b39 P |
47 | @@ -749,6 +749,10 @@ |
48 | assert(cli_local(sptr)); | |
49 | targets = cli_targets(sptr); | |
50 | ||
51 | + /* opers always have a free target */ | |
52 | + if (IsAnOper(sptr)) | |
53 | + return 0; | |
54 | + | |
55 | /* | |
56 | * Same target as last time? | |
57 | */ | |
58 | @@ -846,6 +850,12 @@ | |
59 | } | |
60 | if (is_silenced(source, dest)) | |
61 | return 0; | |
62 | + | |
63 | + if (IsAccountOnly(dest) && !IsAccount(source) && !IsXtraOp(source)) { | |
64 | + if(!is_notice) | |
65 | + send_reply(source, ERR_ACCOUNTONLY, cli_name(source), feature_str(FEAT_URLREG)); | |
66 | + return 0; | |
67 | + } | |
68 | ||
69 | if (is_notice) | |
70 | sendcmdto_one(source, CMD_NOTICE, dest, "%C :%s", dest, text); | |
71 | @@ -966,10 +976,6 @@ | |
72 | if (MyConnect(cptr)) | |
73 | send_reply(cptr, RPL_HOSTHIDDEN, cli_user(cptr)->host); | |
74 | ||
75 | - /* opers always have a free target */ | |
76 | - if (IsAnOper(sptr)) | |
77 | - return 0; | |
78 | - | |
79 | /* | |
80 | * Go through all channels the client was on, rejoin him | |
81 | * and set the modes, if any | |
82 | @@ -1042,17 +1048,30 @@ | |
83 | /* MODE_ADD: set a new hostmask */ | |
84 | } else { | |
85 | /* chop up ident and host.cc */ | |
86 | - if ((host = strrchr(hostmask, '@'))) /* oper can specifiy ident@host.cc */ | |
87 | + if ((host = strrchr(hostmask, '@'))) { /* oper can specifiy ident@host.cc */ | |
88 | *host++ = '\0'; | |
89 | - else /* user can only specifiy host.cc [password] */ | |
90 | + if ( MyConnect(cptr) && (0 == strcmp(host, cli_user(cptr)->host)) && (0 == strcmp(hostmask, cli_user(cptr)->username))) { | |
91 | + ircd_snprintf(0, hiddenhost, HOSTLEN + USERLEN + 2, "%s@%s", | |
92 | + cli_user(cptr)->username, cli_user(cptr)->host); | |
93 | + send_reply(cptr, RPL_HOSTHIDDEN, hiddenhost); | |
94 | + return 0; | |
95 | + } | |
96 | + } else { /* user can only specifiy host.cc [password] */ | |
97 | host = hostmask; | |
98 | + if ( MyConnect(cptr) && (0 == strcmp(host, cli_user(cptr)->host))) { | |
99 | + ircd_snprintf(0, hiddenhost, HOSTLEN + USERLEN + 2, "%s@%s", | |
100 | + cli_user(cptr)->username, cli_user(cptr)->host); | |
101 | + send_reply(cptr, RPL_HOSTHIDDEN, hiddenhost); | |
102 | + return 0; | |
103 | + } | |
104 | + } | |
105 | /* | |
106 | * Oper sethost | |
107 | */ | |
108 | if (MyConnect(cptr)) { | |
109 | if (IsAnOper(cptr)) { | |
110 | if ((new_vhost = IsVhost(host, 1)) == NULL) { | |
111 | - if (!feature_bool(FEAT_SETHOST_FREEFORM)) { | |
112 | + if (!HasPriv(cptr, PRIV_FREEFORM)) { | |
113 | send_reply(cptr, ERR_HOSTUNAVAIL, hostmask); | |
114 | log_write(LS_SETHOST, L_INFO, LOG_NOSNOTICE, | |
115 | "SETHOST (%s@%s) by (%#R): no such s-line", | |
116 | @@ -1167,10 +1186,10 @@ | |
117 | "%H", chan->channel); | |
118 | } | |
119 | if (IsChanOp(chan) && HasVoice(chan)) { | |
120 | - sendcmdto_channel_butserv_butone(&me, CMD_MODE, chan->channel, cptr, 0, | |
121 | + sendcmdto_channel_butserv_butone(&his, CMD_MODE, chan->channel, cptr, 0, | |
122 | "%H +ov %C %C", chan->channel, cptr, cptr); | |
123 | } else if (IsChanOp(chan) || HasVoice(chan)) { | |
124 | - sendcmdto_channel_butserv_butone(&me, CMD_MODE, chan->channel, cptr, 0, | |
125 | + sendcmdto_channel_butserv_butone(&his, CMD_MODE, chan->channel, cptr, 0, | |
126 | "%H +%c %C", chan->channel, IsChanOp(chan) ? 'o' : 'v', cptr); | |
127 | } | |
128 | } | |
129 | @@ -1201,11 +1220,15 @@ | |
130 | unsigned int tmpmask = 0; | |
131 | int snomask_given = 0; | |
132 | char buf[BUFSIZE]; | |
133 | + char *hostmask, *password; | |
134 | int prop = 0; | |
135 | int do_host_hiding = 0; | |
136 | int do_set_host = 0; | |
137 | + size_t opernamelen; | |
138 | + char *opername = 0; | |
139 | char* account = NULL; | |
140 | ||
141 | + hostmask = password = NULL; | |
142 | what = MODE_ADD; | |
143 | ||
144 | if (parc < 3) | |
145 | @@ -1367,8 +1390,8 @@ | |
146 | break; | |
147 | case 'x': | |
148 | if (what == MODE_ADD) | |
149 | - do_host_hiding = 1; | |
150 | - break; | |
151 | + do_host_hiding = 1; | |
152 | + break; | |
153 | case 'h': | |
154 | if (what == MODE_ADD) { | |
155 | if (*(p + 1) && is_hostmask(*(p + 1))) { | |
156 | @@ -1393,13 +1416,6 @@ | |
157 | password = NULL; | |
158 | } | |
159 | break; | |
160 | - case 'r': | |
161 | - if (*(p + 1) && (what == MODE_ADD)) { | |
162 | - account = *(++p); | |
163 | - SetAccount(sptr); | |
164 | - } | |
165 | - /* There is no -r */ | |
166 | - break; | |
167 | case 'R': | |
168 | if (what == MODE_ADD) | |
169 | SetAccountOnly(sptr); | |
170 | @@ -1412,6 +1428,13 @@ | |
171 | else | |
172 | ClearParanoid(sptr); | |
173 | break; | |
174 | + case 'r': | |
175 | + if ((what == MODE_ADD) && *(p + 1)) { | |
176 | + account = *(++p); | |
177 | + SetAccount(sptr); | |
178 | + } | |
179 | + /* There is no -r */ | |
180 | + break; | |
181 | default: | |
182 | send_reply(sptr, ERR_UMODEUNKNOWNFLAG, *m); | |
183 | break; | |
184 | @@ -1436,13 +1459,13 @@ | |
185 | */ | |
186 | if (!FlagHas(&setflags, FLAG_CHSERV) && !(IsOper(sptr) && HasPriv(sptr, PRIV_CHANSERV))) | |
187 | ClearChannelService(sptr); | |
188 | - if (!FlagHas(&setflags, FLAG_XTRAOP) && !(IsOper(sptr) && HasPriv(sptr, PRIV_XTRA_OPER))) | |
189 | + if (!FlagHas(&setflags, FLAG_XTRAOP) && !(IsOper(sptr) && HasPriv(sptr, PRIV_XTRA_OPER))) | |
190 | ClearXtraOp(sptr); | |
191 | if (!FlagHas(&setflags, FLAG_NOCHAN) && !(IsOper(sptr) || feature_bool(FEAT_USER_HIDECHANS))) | |
192 | ClearNoChan(sptr); | |
193 | - if (!FlagHas(&setflags, FLAG_NOIDLE) && !((IsOper(sptr) && HasPriv(sptr, PRIV_NOIDLE)) || feature_bool(FEAT_USER_HIDEIDLETIME))) | |
194 | + if (!FlagHas(&setflags, FLAG_NOIDLE) && !((IsOper(sptr) && HasPriv(sptr, PRIV_NOIDLE)) || feature_bool(FEAT_USER_HIDEIDLETIME))) | |
195 | ClearNoIdle(sptr); | |
196 | - if (!FlagHas(&setflags, FLAG_PARANOID) && !(IsOper(sptr) && HasPriv(sptr, PRIV_PARANOID))) | |
197 | + if (!FlagHas(&setflags, FLAG_PARANOID) && !(IsOper(sptr) && HasPriv(sptr, PRIV_PARANOID))) | |
198 | ClearParanoid(sptr); | |
199 | ||
200 | /* | |
201 | @@ -1498,6 +1521,12 @@ | |
202 | } | |
203 | if (!FlagHas(&setflags, FLAG_HIDDENHOST) && do_host_hiding && allow_modes != ALLOWMODES_DEFAULT) | |
204 | hide_hostmask(sptr, FLAG_HIDDENHOST); | |
205 | + if (do_set_host) { | |
206 | + /* We clear the flag in the old mask, so that the +h will be sent */ | |
207 | + /* Only do this if we're SETTING +h and it succeeded */ | |
208 | + if (set_hostmask(sptr, hostmask, password) && hostmask) | |
209 | + FlagClr(&setflags, FLAG_SETHOST); | |
210 | + } | |
211 | ||
212 | if (IsRegistered(sptr)) { | |
213 | if (!FlagHas(&setflags, FLAG_OPER) && IsOper(sptr)) { | |
edb26b39 P |
214 | @@ -1695,6 +1734,7 @@ |
215 | char* t = cli_user(sptr)->opername; | |
216 | while ((*m++ = *t++)) | |
217 | ; /* Empty loop */ | |
218 | + m--; /* Step back over the '\0' */ | |
219 | } else { | |
220 | *m++ = NOOPERNAMECHARACTER; | |
221 | } |