yy_tmpoper->flags = yy_oper->flags;
yy_tmpoper->umodes = yy_oper->umodes;
yy_tmpoper->snomask = yy_oper->snomask;
+ yy_tmpoper->privset = yy_oper->privset;
#ifdef HAVE_LIBCRYPTO
if(yy_oper->rsa_pubkey_file)
set_modes_from_table(&yy_oper->flags, "flag", oper_table, args);
}
+static void
+conf_set_oper_privset(void *data)
+{
+ yy_oper->privset = privilegeset_get((char *) data);
+}
+
static void
conf_set_oper_user(void *data)
{
{ "rsa_public_key_file", CF_QSTRING, conf_set_oper_rsa_public_key_file, 0, NULL },
{ "flags", CF_STRING | CF_FLIST, conf_set_oper_flags, 0, NULL },
{ "umodes", CF_STRING | CF_FLIST, conf_set_oper_umodes, 0, NULL },
+ { "privset", CF_QSTRING, conf_set_oper_privset, 0, NULL },
{ "snomask", CF_QSTRING, conf_set_oper_snomask, 0, NULL },
{ "user", CF_QSTRING, conf_set_oper_user, 0, NULL },
{ "password", CF_QSTRING, conf_set_oper_password, 0, NULL },
return NULL;
}
-struct oper_flags
-{
- int flag;
- const char *name;
-};
-static struct oper_flags oper_flagtable[] =
-{
- { OPER_KLINE, "kline" },
- { OPER_XLINE, "xline" },
- { OPER_RESV, "resv" },
- { OPER_GLOBKILL, "global_kill" },
- { OPER_LOCKILL, "local_kill" },
- { OPER_REMOTE, "remote" },
- { OPER_UNKLINE, "unkline" },
- { OPER_REHASH, "rehash" },
- { OPER_DIE, "die" },
- { OPER_ADMIN, "admin" },
- { OPER_HADMIN, "hidden_admin" },
- { OPER_NICKS, "nick_changes" },
- { OPER_OPERWALL, "operwall" },
- { OPER_SPY, "spy" },
- { OPER_INVIS, "hidden_oper" },
- { OPER_REMOTEBAN, "remoteban" },
- { OPER_MASSNOTICE, "mass_notice" },
- { 0, NULL }
-};
-
-const char *
-get_oper_privs(int flags)
-{
- static char buf[BUFSIZE];
- char *p;
- int i;
-
- p = buf;
- *p = '\0';
-
- for(i = 0; oper_flagtable[i].flag; i++)
- if (flags & oper_flagtable[i].flag)
- {
- if(*buf != '\0')
- rb_strlcat(buf, ", ", sizeof(buf));
-
- rb_strlcat(buf, oper_flagtable[i].name, sizeof(buf));
- }
-
- return buf;
-}
-
struct server_conf *
make_server_conf(void)
{
sendto_one_numeric(source_p, RPL_SNOMASK, form_str(RPL_SNOMASK),
construct_snobuf(source_p->snomask));
sendto_one(source_p, form_str(RPL_YOUREOPER), me.name, source_p->name);
- sendto_one_notice(source_p, ":*** Oper privs are %s", get_oper_privs(oper_p->flags));
+ 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_oper_motd(source_p);
return (1);