0, /* W */
0, /* X */
0, /* Y */
- UMODE_SSLCLIENT, /* Z */
+ UMODE_SECURE, /* Z */
/* 0x5B */ 0, 0, 0, 0, 0, 0, /* 0x60 */
UMODE_ADMIN, /* a */
0, /* b */
{
/* This shouldn't happen, better tell the ops... */
ierror("authd sent us a malformed OPM string %s", proxy);
- sendto_realops_snomask(SNO_GENERAL, L_ALL,
+ sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
"authd sent us a malformed OPM string %s", proxy);
break;
}
if(rb_dlink_list_length(&lclient_list) >=
(unsigned long)GlobalSetOptions.maxclients && !IsConfExemptLimits(aconf))
{
- sendto_realops_snomask(SNO_FULL, L_ALL,
+ sendto_realops_snomask(SNO_FULL, L_NETWIDE,
"Too many clients, rejecting %s[%s].", source_p->name, source_p->host);
ServerStats.is_ref++;
if(!valid_username(source_p->username))
{
- sendto_realops_snomask(SNO_REJ, L_ALL,
+ sendto_realops_snomask(SNO_REJ, L_NETWIDE,
"Invalid username: %s (%s@%s)",
source_p->name, source_p->username, source_p->host);
ServerStats.is_ref++;
}
if (IsSecure(source_p))
- source_p->umodes |= UMODE_SSLCLIENT;
+ source_p->umodes |= UMODE_SECURE;
if (source_p->umodes & UMODE_INVISIBLE)
Count.invisi++;
{
Count.max_loc = rb_dlink_list_length(&lclient_list);
if(!(Count.max_loc % 10))
- sendto_realops_snomask(SNO_GENERAL, L_ALL,
+ sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
"New Max Local Clients: %d", Count.max_loc);
}
}
}
+void
+report_priv_change(struct Client *client, struct PrivilegeSet *old, struct PrivilegeSet *new)
+{
+ struct privset_diff diff = privilegeset_diff(old, new);
+
+ hook_data_priv_change hdata = {
+ .client = client,
+ .new = new,
+ .old = old,
+ .unchanged = diff.unchanged,
+ .added = diff.added,
+ .removed = diff.removed,
+ };
+ call_hook(h_priv_change, &hdata);
+}
+
static void
show_other_user_mode(struct Client *source_p, struct Client *target_p)
{
if(IsServer(source_p))
{
- sendto_realops_snomask(SNO_GENERAL, L_ADMIN,
+ sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
"*** Mode for User %s from %s", parv[1], source_p->name);
return 0;
}
if(source_p->user->privset != NULL)
{
+ report_priv_change(source_p, source_p->user->privset, NULL);
+
privilegeset_unref(source_p->user->privset);
source_p->user->privset = NULL;
}
source_p->user->opername = rb_strdup(oper_p->name);
source_p->user->privset = privilegeset_ref(oper_p->privset);
+ report_priv_change(source_p, NULL, source_p->user->privset);
+
rb_dlinkAddAlloc(source_p, &local_oper_list);
rb_dlinkAddAlloc(source_p, &oper_list);
construct_snobuf(source_p->snomask));
sendto_one(source_p, form_str(RPL_YOUREOPER), me.name, source_p->name);
sendto_one_notice(source_p, ":*** Oper privilege set is %s", oper_p->privset->name);
- sendto_one_notice(source_p, ":*** Oper privs are %s", oper_p->privset->privs);
+ send_multiline_init(source_p, " ", ":%s NOTICE %s :*** Oper privs are ", me.name, source_p->name);
+ for (const char *const *s = privilegeset_privs(oper_p->privset); *s != NULL; s++)
+ send_multiline_item(source_p, "%s", *s);
+ send_multiline_fini(source_p, NULL);
send_oper_motd(source_p);
}
if (user_modes[i] == 0)
{
orphaned_umodes |= prev_user_modes[i];
- sendto_realops_snomask(SNO_DEBUG, L_ALL, "Umode +%c is now orphaned", i);
+ sendto_realops_snomask(SNO_DEBUG, L_NETWIDE, "Umode +%c is now orphaned", i);
}
else
{
orphaned_umodes &= ~prev_user_modes[i];
- sendto_realops_snomask(SNO_DEBUG, L_ALL, "Orphaned umode +%c is picked up by module", i);
+ sendto_realops_snomask(SNO_DEBUG, L_NETWIDE, "Orphaned umode +%c is picked up by module", i);
}
user_modes[i] = prev_user_modes[i];
}
del_all_accepts(target_p);
}
}
+
+bool
+has_common_channel(struct Client *source_p, struct Client *target_p)
+{
+ rb_dlink_node *ps, *pt;
+ struct membership *ms, *mt;
+ struct Channel *chptr;
+
+ ITER_COMM_CHANNELS(ps, pt, source_p->user->channel.head, target_p->user->channel.head, ms, mt, chptr)
+ {
+ if (ms != NULL && mt != NULL)
+ return true;
+ }
+
+ return false;
+}
+