[Asterisk-cvs] asterisk/apps app_authenticate.c,1.12,1.13

kpfleming kpfleming
Tue Aug 23 11:19:48 CDT 2005


Update of /usr/cvsroot/asterisk/apps
In directory mongoose.digium.com:/tmp/cvs-serv15850/apps

Modified Files:
	app_authenticate.c 
Log Message:
fix buglets in new authentication code (issue #4860)


Index: app_authenticate.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_authenticate.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- app_authenticate.c	5 Aug 2005 21:44:19 -0000	1.12
+++ app_authenticate.c	23 Aug 2005 15:21:48 -0000	1.13
@@ -139,7 +139,7 @@
 									break;
 								}
 							} else {
-								if(!strcmp(passwd, buf)) {
+								if (!strcmp(passwd, buf)) {
 									if (strchr(opts, 'a'))
 										ast_cdr_setaccount(chan, buf);
 									break;
@@ -150,7 +150,7 @@
 					fclose(f);
 					if (!ast_strlen_zero(buf)) {
 						if (strchr(opts, 'm')) {
-							if (!strcmp(md5passwd, md5secret))
+							if (md5secret && !strcmp(md5passwd, md5secret))
 								break;
 						} else {
 							if (!strcmp(passwd, buf))
@@ -168,7 +168,7 @@
 		prompt="auth-incorrect";
 	}
 	if ((retries < 3) && !res) {
-		if (strchr(opts, 'a')) 
+		if (strchr(opts, 'a') && !strchr(opts, 'm')) 
 			ast_cdr_setaccount(chan, passwd);
 		res = ast_streamfile(chan, "auth-thankyou", chan->language);
 		if (!res)




More information about the svn-commits mailing list