git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7065 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kevin P. Fleming
2005-11-11 00:53:19 +00:00
parent c79c0f97f1
commit 5545974c6a
2 changed files with 15 additions and 12 deletions

View File

@@ -1,5 +1,7 @@
2005-11-10 Kevin P. Fleming <kpfleming@digium.com> 2005-11-10 Kevin P. Fleming <kpfleming@digium.com>
* apps/app_disa.c (disa_exec): correct password file parsing (issue #5676)
* apps/app_meetme.c (conf_run): don't restrict admin users from joining a locked conference (issue #5680) * apps/app_meetme.c (conf_run): don't restrict admin users from joining a locked conference (issue #5680)
* channels/chan_misdn.c: include stdio.h (issue #5671) * channels/chan_misdn.c: include stdio.h (issue #5671)

View File

@@ -119,6 +119,7 @@ static int disa_exec(struct ast_channel *chan, void *data)
int digittimeout = 10000; int digittimeout = 10000;
struct localuser *u; struct localuser *u;
char *tmp, arg2[256]="",exten[AST_MAX_EXTENSION],acctcode[20]=""; char *tmp, arg2[256]="",exten[AST_MAX_EXTENSION],acctcode[20]="";
char pwline[256];
char *ourcontext,*ourcallerid,ourcidname[256],ourcidnum[256],*mailbox; char *ourcontext,*ourcallerid,ourcidname[256],ourcidnum[256],*mailbox;
struct ast_frame *f; struct ast_frame *f;
struct timeval lastdigittime; struct timeval lastdigittime;
@@ -262,18 +263,18 @@ static int disa_exec(struct ast_channel *chan, void *data)
LOCAL_USER_REMOVE(u); LOCAL_USER_REMOVE(u);
return -1; return -1;
} }
tmp[0] = 0; pwline[0] = 0;
while(fgets(tmp,sizeof(tmp) - 1,fp)) while(fgets(pwline,sizeof(pwline) - 1,fp))
{ {
char *stringp=NULL,*stringp2; char *stringp=NULL,*stringp2;
if (!tmp[0]) continue; if (!pwline[0]) continue;
if (tmp[strlen(tmp) - 1] == '\n') if (pwline[strlen(pwline) - 1] == '\n')
tmp[strlen(tmp) - 1] = 0; pwline[strlen(pwline) - 1] = 0;
if (!tmp[0]) continue; if (!pwline[0]) continue;
/* skip comments */ /* skip comments */
if (tmp[0] == '#') continue; if (pwline[0] == '#') continue;
if (tmp[0] == ';') continue; if (pwline[0] == ';') continue;
stringp=tmp; stringp=pwline;
strsep(&stringp, "|"); strsep(&stringp, "|");
stringp2=strsep(&stringp, "|"); stringp2=strsep(&stringp, "|");
if (stringp2) { if (stringp2) {
@@ -287,14 +288,14 @@ static int disa_exec(struct ast_channel *chan, void *data)
ast_log(LOG_DEBUG, "Mailbox: %s\n",mailbox); ast_log(LOG_DEBUG, "Mailbox: %s\n",mailbox);
/* password must be in valid format (numeric) */ /* password must be in valid format (numeric) */
if (sscanf(tmp,"%d",&j) < 1) continue; if (sscanf(pwline,"%d",&j) < 1) continue;
/* if we got it */ /* if we got it */
if (!strcmp(exten,tmp)) break; if (!strcmp(exten,pwline)) break;
} }
fclose(fp); fclose(fp);
} }
/* compare the two */ /* compare the two */
if (strcmp(exten,tmp)) if (strcmp(exten,pwline))
{ {
ast_log(LOG_WARNING,"DISA on chan %s got bad password %s\n",chan->name,exten); ast_log(LOG_WARNING,"DISA on chan %s got bad password %s\n",chan->name,exten);
goto reorder; goto reorder;