2 # Parent 956177bd34a75c9221a0f81bfeb69f769ba7c86f
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
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
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
35 cli_user(cli)->acc_flags = strtoull(end2 + 1, NULL, 10);
37 + params[0][len] = '\0';
41 /* Copy account name to User structure. */
42 ircd_strncpy(cli_user(cli)->account, params[0], ACCOUNTLEN);
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
48 NumNick(sptr), cli_info(sptr));
50 tmpstr = umode_str(sptr, UMODE_ALL_PARAMS);
52 /* Send oper name and full IP address to IPv6-grokking servers. */
53 sendcmdto_flagarray_serv_butone(user->server, CMD_NICK, cptr,
54 ipv6andopername, 2, NULL, 0,
56 const char* nick, int parc, char* parv[])
61 * A server introducing a new client, change source
64 assert(cli_local(sptr));
65 targets = cli_targets(sptr);
67 + /* opers always have a free target */
72 * Same target as last time?
76 if (is_silenced(source, dest))
79 + if (IsAccountOnly(dest) && !IsAccount(source) && !IsXtraOp(source)) {
81 + send_reply(source, ERR_ACCOUNTONLY, cli_name(source), feature_str(FEAT_URLREG));
86 sendcmdto_one(source, CMD_NOTICE, dest, "%C :%s", dest, text);
89 send_reply(cptr, RPL_HOSTHIDDEN, cli_user(cptr)->host);
91 - /* opers always have a free target */
96 * Go through all channels the client was on, rejoin him
97 * and set the modes, if any
98 @@ -1042,17 +1048,30 @@
99 /* MODE_ADD: set a new hostmask */
101 /* chop up ident and host.cc */
102 - if ((host = strrchr(hostmask, '@'))) /* oper can specifiy ident@host.cc */
103 + if ((host = strrchr(hostmask, '@'))) { /* oper can specifiy ident@host.cc */
105 - else /* user can only specifiy host.cc [password] */
106 + if ( MyConnect(cptr) && (0 == strcmp(host, cli_user(cptr)->host)) && (0 == strcmp(hostmask, cli_user(cptr)->username))) {
107 + ircd_snprintf(0, hiddenhost, HOSTLEN + USERLEN + 2, "%s@%s",
108 + cli_user(cptr)->username, cli_user(cptr)->host);
109 + send_reply(cptr, RPL_HOSTHIDDEN, hiddenhost);
112 + } else { /* user can only specifiy host.cc [password] */
114 + if ( MyConnect(cptr) && (0 == strcmp(host, cli_user(cptr)->host))) {
115 + ircd_snprintf(0, hiddenhost, HOSTLEN + USERLEN + 2, "%s@%s",
116 + cli_user(cptr)->username, cli_user(cptr)->host);
117 + send_reply(cptr, RPL_HOSTHIDDEN, hiddenhost);
124 if (MyConnect(cptr)) {
125 if (IsAnOper(cptr)) {
126 if ((new_vhost = IsVhost(host, 1)) == NULL) {
127 - if (!feature_bool(FEAT_SETHOST_FREEFORM)) {
128 + if (!HasPriv(cptr, PRIV_FREEFORM)) {
129 send_reply(cptr, ERR_HOSTUNAVAIL, hostmask);
130 log_write(LS_SETHOST, L_INFO, LOG_NOSNOTICE,
131 "SETHOST (%s@%s) by (%#R): no such s-line",
132 @@ -1167,10 +1186,10 @@
133 "%H", chan->channel);
135 if (IsChanOp(chan) && HasVoice(chan)) {
136 - sendcmdto_channel_butserv_butone(&me, CMD_MODE, chan->channel, cptr, 0,
137 + sendcmdto_channel_butserv_butone(&his, CMD_MODE, chan->channel, cptr, 0,
138 "%H +ov %C %C", chan->channel, cptr, cptr);
139 } else if (IsChanOp(chan) || HasVoice(chan)) {
140 - sendcmdto_channel_butserv_butone(&me, CMD_MODE, chan->channel, cptr, 0,
141 + sendcmdto_channel_butserv_butone(&his, CMD_MODE, chan->channel, cptr, 0,
142 "%H +%c %C", chan->channel, IsChanOp(chan) ? 'o' : 'v', cptr);
145 @@ -1201,11 +1220,15 @@
146 unsigned int tmpmask = 0;
147 int snomask_given = 0;
149 + char *hostmask, *password;
151 int do_host_hiding = 0;
153 + size_t opernamelen;
154 + char *opername = 0;
155 char* account = NULL;
157 + hostmask = password = NULL;
161 @@ -1367,8 +1390,8 @@
164 if (what == MODE_ADD)
165 - do_host_hiding = 1;
167 + do_host_hiding = 1;
170 if (what == MODE_ADD) {
171 if (*(p + 1) && is_hostmask(*(p + 1))) {
172 @@ -1393,13 +1416,6 @@
177 - if (*(p + 1) && (what == MODE_ADD)) {
181 - /* There is no -r */
184 if (what == MODE_ADD)
185 SetAccountOnly(sptr);
186 @@ -1412,6 +1428,13 @@
191 + if ((what == MODE_ADD) && *(p + 1)) {
195 + /* There is no -r */
198 send_reply(sptr, ERR_UMODEUNKNOWNFLAG, *m);
200 @@ -1436,13 +1459,13 @@
202 if (!FlagHas(&setflags, FLAG_CHSERV) && !(IsOper(sptr) && HasPriv(sptr, PRIV_CHANSERV)))
203 ClearChannelService(sptr);
204 - if (!FlagHas(&setflags, FLAG_XTRAOP) && !(IsOper(sptr) && HasPriv(sptr, PRIV_XTRA_OPER)))
205 + if (!FlagHas(&setflags, FLAG_XTRAOP) && !(IsOper(sptr) && HasPriv(sptr, PRIV_XTRA_OPER)))
207 if (!FlagHas(&setflags, FLAG_NOCHAN) && !(IsOper(sptr) || feature_bool(FEAT_USER_HIDECHANS)))
209 - if (!FlagHas(&setflags, FLAG_NOIDLE) && !((IsOper(sptr) && HasPriv(sptr, PRIV_NOIDLE)) || feature_bool(FEAT_USER_HIDEIDLETIME)))
210 + if (!FlagHas(&setflags, FLAG_NOIDLE) && !((IsOper(sptr) && HasPriv(sptr, PRIV_NOIDLE)) || feature_bool(FEAT_USER_HIDEIDLETIME)))
212 - if (!FlagHas(&setflags, FLAG_PARANOID) && !(IsOper(sptr) && HasPriv(sptr, PRIV_PARANOID)))
213 + if (!FlagHas(&setflags, FLAG_PARANOID) && !(IsOper(sptr) && HasPriv(sptr, PRIV_PARANOID)))
217 @@ -1498,6 +1521,12 @@
219 if (!FlagHas(&setflags, FLAG_HIDDENHOST) && do_host_hiding && allow_modes != ALLOWMODES_DEFAULT)
220 hide_hostmask(sptr, FLAG_HIDDENHOST);
222 + /* We clear the flag in the old mask, so that the +h will be sent */
223 + /* Only do this if we're SETTING +h and it succeeded */
224 + if (set_hostmask(sptr, hostmask, password) && hostmask)
225 + FlagClr(&setflags, FLAG_SETHOST);
228 if (IsRegistered(sptr)) {
229 if (!FlagHas(&setflags, FLAG_OPER) && IsOper(sptr)) {
230 @@ -1521,7 +1550,18 @@
231 /* user no longer oper */
232 assert(UserStats.opers > 0);
236 + /* notify my operators an operator has deOPERed on the network - wiebe */
237 + if (MyConnect(sptr)) {
238 + sendto_opmask_butone(0, SNO_OLDSNO, "%s (%s@%s) is no longer operator (O) as %s",
239 + cli_name(sptr), cli_user(sptr)->realusername, cli_user(sptr)->realhost,
240 + cli_user(sptr)->opername ? cli_user(sptr)->opername : "<unknown>");
242 + sendto_opmask_butone(0, SNO_OLDSNO, "%s (%s@%s) is no longer operator (O) as %s on %s",
243 + cli_name(sptr), cli_user(sptr)->realusername, cli_user(sptr)->realhost,
244 + cli_user(sptr)->opername ? cli_user(sptr)->opername : "<unknown>", cli_name(cli_user(sptr)->server));
247 client_set_privs(sptr, NULL); /* will clear propagate privilege */
248 if (cli_user(sptr)->opername) {
249 MyFree(cli_user(sptr)->opername);
250 @@ -1589,7 +1629,6 @@
251 cli_user(cptr)->account, cli_user(cptr)->acc_create,
252 cli_user(cptr)->acc_id, cli_user(cptr)->acc_flags);
255 while ((*m++ = *t++))
258 @@ -1695,6 +1734,7 @@
259 char* t = cli_user(sptr)->opername;
260 while ((*m++ = *t++))
262 + m--; /* Step back over the '\0' */
264 *m++ = NOOPERNAMECHARACTER;