char *privs_old = privs;
privs = rb_malloc(strlen(privs_old) + 1 + strlen(args->v.string) + 1);
- strcpy(privs_old, privs);
+ strcpy(privs, privs_old);
strcat(privs, " ");
strcat(privs, args->v.string);
if (!set)
{
- conf_report_error("Warning -- unknown parent privilege set %s for %s; ignored.", yy_privset_extends, conf_cur_block_name);
+ conf_report_error("Warning -- unknown parent privilege set %s for %s; assuming defaults", yy_privset_extends, conf_cur_block_name);
- rb_free(yy_privset_extends);
- rb_free(privs);
-
- yy_privset_extends = NULL;
- return;
+ set = privilegeset_get("default");
}
privilegeset_extend(set, conf_cur_block_name != NULL ? conf_cur_block_name : "<unknown>", privs, 0);
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);
+
+ if (!yy_oper->privset)
+ yy_oper->privset = privilegeset_get("default");
+}
+
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 },