/* usage: ModuleControlsACLs actions|all allow|deny user|group list */ MODRET set_modulectrlsacls(cmd_rec *cmd) { #ifdef PR_USE_CTRLS char *bad_action = NULL, **actions = NULL; CHECK_ARGS(cmd, 4); CHECK_CONF(cmd, CONF_ROOT); actions = ctrls_parse_acl(cmd->tmp_pool, cmd->argv[1]); if (strcmp(cmd->argv[2], "allow") != 0 && strcmp(cmd->argv[2], "deny") != 0) CONF_ERROR(cmd, "second parameter must be 'allow' or 'deny'"); if (strcmp(cmd->argv[3], "user") != 0 && strcmp(cmd->argv[3], "group") != 0) CONF_ERROR(cmd, "third parameter must be 'user' or 'group'"); bad_action = pr_ctrls_set_module_acls(dso_acttab, dso_pool, actions, cmd->argv[2], cmd->argv[3], cmd->argv[4]); if (bad_action != NULL) CONF_ERROR(cmd, pstrcat(cmd->tmp_pool, ": unknown action: '", bad_action, "'", NULL)); return PR_HANDLED(cmd); #else CONF_ERROR(cmd, "requires Controls support (--enable-ctrls)"); #endif }
/* usage: DynMasqControlsACLs actions|all allow|deny user|group list */ MODRET set_dynmasqctrlsacls(cmd_rec *cmd) { #ifdef PR_USE_CTRLS char *bad_action = NULL, **actions = NULL; CHECK_ARGS(cmd, 4); CHECK_CONF(cmd, CONF_ROOT); /* We can cheat here, and use the ctrls_parse_acl() routine to * separate the given string... */ actions = ctrls_parse_acl(cmd->tmp_pool, cmd->argv[1]); /* Check the second parameter to make sure it is "allow" or "deny" */ if (strcmp(cmd->argv[2], "allow") != 0 && strcmp(cmd->argv[2], "deny") != 0) { CONF_ERROR(cmd, "second parameter must be 'allow' or 'deny'"); } /* Check the third parameter to make sure it is "user" or "group" */ if (strcmp(cmd->argv[3], "user") != 0 && strcmp(cmd->argv[3], "group") != 0) { CONF_ERROR(cmd, "third parameter must be 'user' or 'group'"); } bad_action = pr_ctrls_set_module_acls(dynmasq_acttab, dynmasq_act_pool, actions, cmd->argv[2], cmd->argv[3], cmd->argv[4]); if (bad_action != NULL) { CONF_ERROR(cmd, pstrcat(cmd->tmp_pool, ": unknown action: '", bad_action, "'", NULL)); } return PR_HANDLED(cmd); #else CONF_ERROR(cmd, pstrcat(cmd->tmp_pool, "The ", cmd->argv[0], " directive requires Controls support (--enable-ctrls)", NULL)); #endif /* PR_USE_CTRLS */ }