dect
/
asterisk
Archived
13
0
Fork 0

Merged revisions 38420 via svnmerge from

https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r38420 | file | 2006-07-28 14:49:00 -0400 (Fri, 28 Jul 2006) | 2 lines

Make a copy of the request URI in check_user_full instead of modifying the one on the structure, and also strip params properly from the user portion of the SIP URI so as to preserve the domain (issue #7552 reported by dan42)

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38421 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
file 2006-07-28 18:53:43 +00:00
parent 950e4373b5
commit 1b8e8e1633
1 changed files with 5 additions and 4 deletions

View File

@ -8535,9 +8535,10 @@ static enum check_auth_result check_user_full(struct sip_pvt *p, struct sip_requ
int debug=sip_debug_test_addr(sin);
struct ast_variable *tmpvar = NULL, *v = NULL;
int usenatroute;
char *uri2 = ast_strdupa(uri);
/* Terminate URI */
t = uri;
t = uri2;
while (*t && *t > 32 && *t != ';')
t++;
*t = '\0';
@ -8557,7 +8558,7 @@ static enum check_auth_result check_user_full(struct sip_pvt *p, struct sip_requ
of = get_in_brackets(from);
if (ast_strlen_zero(p->exten)) {
t = uri;
t = uri2;
if (!strncmp(t, "sip:", 4))
t+= 4;
ast_string_field_set(p, exten, t);
@ -8630,7 +8631,7 @@ static enum check_auth_result check_user_full(struct sip_pvt *p, struct sip_requ
ast_log(LOG_DEBUG, "Setting NAT on UDPTL to %s\n", usenatroute ? "On" : "Off");
ast_udptl_setnat(p->udptl, usenatroute);
}
if (!(res = check_auth(p, req, user->name, user->secret, user->md5secret, sipmethod, uri, reliable, ast_test_flag(req, SIP_PKT_IGNORE)))) {
if (!(res = check_auth(p, req, user->name, user->secret, user->md5secret, sipmethod, uri2, reliable, ast_test_flag(req, SIP_PKT_IGNORE)))) {
sip_cancel_destroy(p);
ast_copy_flags(&p->flags[0], &user->flags[0], SIP_FLAGS_TO_COPY);
ast_copy_flags(&p->flags[1], &user->flags[1], SIP_PAGE2_FLAGS_TO_COPY);
@ -8757,7 +8758,7 @@ static enum check_auth_result check_user_full(struct sip_pvt *p, struct sip_requ
ast_string_field_free(p, peersecret);
ast_string_field_free(p, peermd5secret);
}
if (!(res = check_auth(p, req, peer->name, p->peersecret, p->peermd5secret, sipmethod, uri, reliable, ast_test_flag(req, SIP_PKT_IGNORE)))) {
if (!(res = check_auth(p, req, peer->name, p->peersecret, p->peermd5secret, sipmethod, uri2, reliable, ast_test_flag(req, SIP_PKT_IGNORE)))) {
ast_copy_flags(&p->flags[0], &peer->flags[0], SIP_FLAGS_TO_COPY);
ast_copy_flags(&p->flags[1], &peer->flags[1], SIP_PAGE2_FLAGS_TO_COPY);
/* If we have a call limit, set flag */