From 4c0251143057558de11a9c28434e22d01d589ffb Mon Sep 17 00:00:00 2001 From: Andrea Lora Date: Sun, 15 Jun 2014 02:25:42 +0200 Subject: [PATCH] Fixes compatibilty with legacy asterisk user Deleted ugly system line --- src/Cedar/Protocol.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Cedar/Protocol.c b/src/Cedar/Protocol.c index 0fbdcc08..38dac652 100644 --- a/src/Cedar/Protocol.c +++ b/src/Cedar/Protocol.c @@ -2043,6 +2043,7 @@ bool ServerAccept(CONNECTION *c) AcLock(hub); { char *domain; + tokenized=NULL; //check if username is an email address if(spc_email_isvalid(username)) { domain = strchr (username, '@'); @@ -2051,12 +2052,16 @@ bool ServerAccept(CONNECTION *c) tokenized = (char*)malloc((strlen(domain)+6+1) * sizeof(char)); sprintf(tokenized,"token#%s",domain); b = AcIsUser(hub, tokenized); + if(b == false) { + free(tokenized); + tokenized=NULL; + } + } } //fall back to the old method if(b == false) { b = AcIsUser(hub, "*"); - system("echo Comunque dentro asterisk > /tmp/leggimi"); } }