Make privilegeset_privs more const

This commit is contained in:
Ed Kellett 2021-02-14 00:31:43 +00:00
parent 9962f62577
commit 181410f218
4 changed files with 5 additions and 5 deletions

View file

@ -68,7 +68,7 @@ struct privset_diff {
}; };
bool privilegeset_in_set(const struct PrivilegeSet *set, const char *priv); bool privilegeset_in_set(const struct PrivilegeSet *set, const char *priv);
const char **privilegeset_privs(const struct PrivilegeSet *set); const char *const *privilegeset_privs(const struct PrivilegeSet *set);
struct PrivilegeSet *privilegeset_set_new(const char *name, const char *privs, PrivilegeFlags flags); struct PrivilegeSet *privilegeset_set_new(const char *name, const char *privs, PrivilegeFlags flags);
struct PrivilegeSet *privilegeset_extend(const struct PrivilegeSet *parent, const char *name, const char *privs, PrivilegeFlags flags); struct PrivilegeSet *privilegeset_extend(const struct PrivilegeSet *parent, const char *name, const char *privs, PrivilegeFlags flags);
struct PrivilegeSet *privilegeset_get(const char *name); struct PrivilegeSet *privilegeset_get(const char *name);

View file

@ -233,7 +233,7 @@ privilegeset_in_set(const struct PrivilegeSet *set, const char *priv)
return found != NULL; return found != NULL;
} }
const char ** const char *const *
privilegeset_privs(const struct PrivilegeSet *set) privilegeset_privs(const struct PrivilegeSet *set)
{ {
static const char *no_privs[] = { NULL }; static const char *no_privs[] = { NULL };
@ -451,7 +451,7 @@ privilegeset_report(struct Client *source_p)
set->name); set->name);
send_multiline_remote_pad(source_p, &me); send_multiline_remote_pad(source_p, &me);
send_multiline_remote_pad(source_p, source_p); send_multiline_remote_pad(source_p, source_p);
for (const char **s = privilegeset_privs(set); *s != NULL; s++) for (const char *const *s = privilegeset_privs(set); *s != NULL; s++)
send_multiline_item(source_p, "%s", *s); send_multiline_item(source_p, "%s", *s);
send_multiline_fini(source_p, NULL); send_multiline_fini(source_p, NULL);
} }

View file

@ -1492,7 +1492,7 @@ oper_up(struct Client *source_p, struct oper_conf *oper_p)
sendto_one(source_p, form_str(RPL_YOUREOPER), me.name, source_p->name); 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 privilege set is %s", oper_p->privset->name);
send_multiline_init(source_p, " ", ":%s NOTICE %s :*** Oper privs are ", me.name, source_p->name); send_multiline_init(source_p, " ", ":%s NOTICE %s :*** Oper privs are ", me.name, source_p->name);
for (const char **s = privilegeset_privs(oper_p->privset); *s != NULL; s++) for (const char *const *s = privilegeset_privs(oper_p->privset); *s != NULL; s++)
send_multiline_item(source_p, "%s", *s); send_multiline_item(source_p, "%s", *s);
send_multiline_fini(source_p, NULL); send_multiline_fini(source_p, NULL);
send_oper_motd(source_p); send_oper_motd(source_p);

View file

@ -95,7 +95,7 @@ static void show_privs(struct Client *source_p, struct Client *target_p)
send_multiline_remote_pad(source_p, source_p); send_multiline_remote_pad(source_p, source_p);
if (target_p->user->privset) if (target_p->user->privset)
for (const char **s = privilegeset_privs(target_p->user->privset); *s != NULL; s++) for (const char *const *s = privilegeset_privs(target_p->user->privset); *s != NULL; s++)
send_multiline_item(source_p, "%s", *s); send_multiline_item(source_p, "%s", *s);
if (IsOper(target_p)) if (IsOper(target_p))