forked from Mirrors/freeswitch
[mod_verto] add chop-domain undocumented feature to allow FS to ignore @ in username
This commit is contained in:
parent
8c351a4667
commit
46903fb13e
|
@ -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)) {
|
} else if (switch_true(jsock->profile->userauth)) {
|
||||||
id = switch_core_strdup(jsock->pool, login);
|
id = switch_core_strdup(jsock->pool, login);
|
||||||
|
|
||||||
if ((domain = strchr(id, '@'))) {
|
if (jsock->profile->chop_domain && (domain = strchr(id, '@'))) {
|
||||||
*domain++ = '\0';
|
*domain++ = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (jsock->profile->register_domain) {
|
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_sub.sock = KS_SOCK_INVALID;
|
||||||
profile->mcast_pub.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) {
|
for (param = switch_xml_child(xprofile, "param"); param; param = param->next) {
|
||||||
char *var = NULL;
|
char *var = NULL;
|
||||||
|
@ -5107,6 +5107,8 @@ static switch_status_t parse_config(const char *cf)
|
||||||
profile->blind_reg = switch_true(val);
|
profile->blind_reg = switch_true(val);
|
||||||
} else if (!strcasecmp(var, "userauth") && !zstr(val)) {
|
} else if (!strcasecmp(var, "userauth") && !zstr(val)) {
|
||||||
profile->userauth = switch_core_strdup(profile->pool, 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)) {
|
} else if (!strcasecmp(var, "root-password") && !zstr(val)) {
|
||||||
profile->root_passwd = switch_core_strdup(profile->pool, val);
|
profile->root_passwd = switch_core_strdup(profile->pool, val);
|
||||||
} else if (!strcasecmp(var, "send-auth-password") && !zstr(val)) {
|
} else if (!strcasecmp(var, "send-auth-password") && !zstr(val)) {
|
||||||
|
|
|
@ -241,7 +241,8 @@ struct verto_profile_s {
|
||||||
int ssl_ready;
|
int ssl_ready;
|
||||||
int ready;
|
int ready;
|
||||||
int debug;
|
int debug;
|
||||||
|
int chop_domain;
|
||||||
|
|
||||||
int in_thread;
|
int in_thread;
|
||||||
int blind_reg;
|
int blind_reg;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue