]> jfr.im git - irc/atheme/atheme.git/commitdiff
chanserv/info: viewing PRIVATE info needs +A
authorJanik Kleinhoff <redacted>
Fri, 24 Oct 2014 05:33:00 +0000 (07:33 +0200)
committerWilliam Pitcock <redacted>
Fri, 24 Oct 2014 23:00:11 +0000 (18:00 -0500)
The rationale is that access to private information about a channel
requires the +A flag; PRIVATE and PUBACL allow making adjustments to
what is considered private. With PRIVATE set, most info requires +A.

However, on channels with PUBACL set, we display the founder and
successor to everyone as they could just check the ACL themselves
anyway.

modules/chanserv/info.c

index cbb69556cca0dbdaa5eeaddf52ddd3b0c442a67f..9c7ce935e02f98d203228b05a26df4711cfbf8ab 100644 (file)
@@ -40,7 +40,7 @@ static void cs_cmd_info(sourceinfo_t *si, int parc, char *parv[])
        metadata_t *md;
        mowgli_patricia_iteration_state_t state;
        hook_channel_req_t req;
-       bool hide_info;
+       bool hide_info, hide_acl;
 
        if (!name)
        {
@@ -69,19 +69,21 @@ static void cs_cmd_info(sourceinfo_t *si, int parc, char *parv[])
        }
 
        hide_info = use_channel_private && mc->flags & MC_PRIVATE &&
-               !(mc->flags & MC_PUBACL) && !chanacs_source_has_flag(mc, si, CA_ACLVIEW) &&
+               !chanacs_source_has_flag(mc, si, CA_ACLVIEW) &&
                !has_priv(si, PRIV_CHAN_AUSPEX);
+       hide_acl = !chanacs_source_has_flag(mc, si, CA_ACLVIEW) &&
+               !has_priv(si, PRIV_CHAN_AUSPEX) &&
+               !(mc->flags & MC_PUBACL);
 
        tm = *localtime(&mc->registered);
        strftime(strfbuf, sizeof strfbuf, TIME_FORMAT, &tm);
 
        command_success_nodata(si, _("Information on \2%s\2:"), mc->name);
 
-       if (!hide_info)
+       if (!(hide_info && hide_acl))
                command_success_nodata(si, _("Founder    : %s"), mychan_founder_names(mc));
 
-       if ((!(mc->flags & MC_PUBACL) && chanacs_source_has_flag(mc, si, CA_ACLVIEW)) ||
-               has_priv(si, PRIV_CHAN_AUSPEX))
+       if (!hide_acl)
        {
                mu = mychan_pick_successor(mc);
                if (mu != NULL)