mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-07-03 06:06:09 +00:00
fix userauth for real
This commit is contained in:
parent
39ff276c1c
commit
534d3bcb29
@ -1556,12 +1556,16 @@ static switch_status_t parse_command(listener_t *listener, switch_event_t **even
|
|||||||
|
|
||||||
user = cmd + 9;
|
user = cmd + 9;
|
||||||
|
|
||||||
if ((pass = strchr(user, ':'))) {
|
if ((domain_name = strchr(user, '@'))) {
|
||||||
|
*domain_name++ = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((pass = strchr(domain_name, ':'))) {
|
||||||
*pass++ = '\0';
|
*pass++ = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((domain_name = strchr(user, '@'))) {
|
if ((pass = strchr(user, ':'))) {
|
||||||
*domain_name++ = '\0';
|
*pass++ = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (zstr(user) || zstr(domain_name)) {
|
if (zstr(user) || zstr(domain_name)) {
|
||||||
@ -2044,20 +2048,30 @@ static switch_status_t parse_command(listener_t *listener, switch_event_t **even
|
|||||||
char *arg = NULL;
|
char *arg = NULL;
|
||||||
strip_cr(api_cmd);
|
strip_cr(api_cmd);
|
||||||
|
|
||||||
if (!(acs.console_execute = switch_true(console_execute))) {
|
if (listener->allowed_api_hash) {
|
||||||
if ((arg = strchr(api_cmd, ' '))) {
|
char *api_copy = strdup(api_cmd);
|
||||||
*arg++ = '\0';
|
char *arg_copy = NULL;
|
||||||
}
|
int ok = 0;
|
||||||
|
|
||||||
|
if ((arg_copy = strchr(api_copy, ' '))) {
|
||||||
|
*arg_copy++ = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (listener->allowed_api_hash) {
|
ok = auth_api_command(listener, api_copy, arg_copy);
|
||||||
if (!auth_api_command(listener, api_cmd, arg)) {
|
free(api_copy);
|
||||||
|
|
||||||
|
if (!ok) {
|
||||||
switch_snprintf(reply, reply_len, "-ERR permission denied");
|
switch_snprintf(reply, reply_len, "-ERR permission denied");
|
||||||
status = SWITCH_STATUS_SUCCESS;
|
status = SWITCH_STATUS_SUCCESS;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!(acs.console_execute = switch_true(console_execute))) {
|
||||||
|
if ((arg = strchr(api_cmd, ' '))) {
|
||||||
|
*arg++ = '\0';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
acs.listener = listener;
|
acs.listener = listener;
|
||||||
acs.api_cmd = api_cmd;
|
acs.api_cmd = api_cmd;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user