Merge branch 'master' into ry

master
Nicolas Favre-Felix 14 years ago
commit dda2236e4b

@ -99,7 +99,7 @@ Examples:
"enabled": ["SET", "DEL"]
}
</pre>
ACLs are interpreted in order, later authorizations superseding earlier ones if a client matches several.
ACLs are interpreted in order, later authorizations superseding earlier ones if a client matches several. The special value "*" matches all commands.
# JSON output
JSON is the default output format. Each command returns a JSON object with the command as a key and the result as a value.

@ -77,6 +77,9 @@ acl_allow_command(struct cmd *cmd, struct conf *cfg, struct http_client *client)
if(strncasecmp(a->enabled.commands[i], cmd_name, cmd_len) == 0) {
authorized = 1;
}
if(strncasecmp(a->enabled.commands[i], "*", 1) == 0) {
authorized = 1;
}
}
/* go through unauthorized commands */
@ -84,6 +87,9 @@ acl_allow_command(struct cmd *cmd, struct conf *cfg, struct http_client *client)
if(strncasecmp(a->disabled.commands[i], cmd_name, cmd_len) == 0) {
authorized = 0;
}
if(strncasecmp(a->disabled.commands[i], "*", 1) == 0) {
authorized = 0;
}
}
}

Loading…
Cancel
Save