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 assert(cli_local(sptr));
49 targets = cli_targets(sptr);
51 + /* opers always have a free target */
56 * Same target as last time?
60 if (is_silenced(source, dest))
63 + if (IsAccountOnly(dest) && !IsAccount(source) && !IsXtraOp(source)) {
65 + send_reply(source, ERR_ACCOUNTONLY, cli_name(source), feature_str(FEAT_URLREG));
70 sendcmdto_one(source, CMD_NOTICE, dest, "%C :%s", dest, text);
73 send_reply(cptr, RPL_HOSTHIDDEN, cli_user(cptr)->host);
75 - /* opers always have a free target */
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 */
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 */
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);
96 + } else { /* user can only specifiy host.cc [password] */
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);
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);
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);
129 @@ -1201,11 +1220,15 @@
130 unsigned int tmpmask = 0;
131 int snomask_given = 0;
133 + char *hostmask, *password;
135 int do_host_hiding = 0;
137 + size_t opernamelen;
138 + char *opername = 0;
139 char* account = NULL;
141 + hostmask = password = NULL;
145 @@ -1367,8 +1390,8 @@
148 if (what == MODE_ADD)
149 - do_host_hiding = 1;
151 + do_host_hiding = 1;
154 if (what == MODE_ADD) {
155 if (*(p + 1) && is_hostmask(*(p + 1))) {
156 @@ -1393,13 +1416,6 @@
161 - if (*(p + 1) && (what == MODE_ADD)) {
165 - /* There is no -r */
168 if (what == MODE_ADD)
169 SetAccountOnly(sptr);
170 @@ -1412,6 +1428,13 @@
175 + if ((what == MODE_ADD) && *(p + 1)) {
179 + /* There is no -r */
182 send_reply(sptr, ERR_UMODEUNKNOWNFLAG, *m);
184 @@ -1436,13 +1459,13 @@
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)))
191 if (!FlagHas(&setflags, FLAG_NOCHAN) && !(IsOper(sptr) || feature_bool(FEAT_USER_HIDECHANS)))
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)))
196 - if (!FlagHas(&setflags, FLAG_PARANOID) && !(IsOper(sptr) && HasPriv(sptr, PRIV_PARANOID)))
197 + if (!FlagHas(&setflags, FLAG_PARANOID) && !(IsOper(sptr) && HasPriv(sptr, PRIV_PARANOID)))
201 @@ -1498,6 +1521,12 @@
203 if (!FlagHas(&setflags, FLAG_HIDDENHOST) && do_host_hiding && allow_modes != ALLOWMODES_DEFAULT)
204 hide_hostmask(sptr, FLAG_HIDDENHOST);
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);
212 if (IsRegistered(sptr)) {
213 if (!FlagHas(&setflags, FLAG_OPER) && IsOper(sptr)) {
214 @@ -1695,6 +1734,7 @@
215 char* t = cli_user(sptr)->opername;
216 while ((*m++ = *t++))
218 + m--; /* Step back over the '\0' */
220 *m++ = NOOPERNAMECHARACTER;