[mod_verto] add chop-domain undocumented feature to allow FS to ignore @ in username

This commit is contained in:
Anthony Minessale 2020-08-13 21:08:32 +00:00 committed by Andrey Volk
parent 8c351a4667
commit 46903fb13e
2 changed files with 7 additions and 4 deletions

View File

@ -970,10 +970,10 @@ static switch_bool_t check_auth(jsock_t *jsock, cJSON *params, int *code, char *
} else if (switch_true(jsock->profile->userauth)) {
id = switch_core_strdup(jsock->pool, login);
if ((domain = strchr(id, '@'))) {
if (jsock->profile->chop_domain && (domain = strchr(id, '@'))) {
*domain++ = '\0';
}
}
if (jsock->profile->register_domain) {
@ -5065,7 +5065,7 @@ static switch_status_t parse_config(const char *cf)
profile->mcast_sub.sock = KS_SOCK_INVALID;
profile->mcast_pub.sock = KS_SOCK_INVALID;
profile->chop_domain = SWITCH_TRUE;
for (param = switch_xml_child(xprofile, "param"); param; param = param->next) {
char *var = NULL;
@ -5107,6 +5107,8 @@ static switch_status_t parse_config(const char *cf)
profile->blind_reg = switch_true(val);
} else if (!strcasecmp(var, "userauth") && !zstr(val)) {
profile->userauth = switch_core_strdup(profile->pool, val);
} else if (!strcasecmp(var, "chop-domain") && !zstr(val)) {
profile->chop_domain = switch_true(val);
} else if (!strcasecmp(var, "root-password") && !zstr(val)) {
profile->root_passwd = switch_core_strdup(profile->pool, val);
} else if (!strcasecmp(var, "send-auth-password") && !zstr(val)) {

View File

@ -241,7 +241,8 @@ struct verto_profile_s {
int ssl_ready;
int ready;
int debug;
int chop_domain;
int in_thread;
int blind_reg;