|
|
@@ -654,7 +654,7 @@ int cacheauth(struct clientparam * param){
|
|
|
|
|
|
}
|
|
|
if(((!(conf.authcachetype&2)) || (param->username && ac->username && !strcmp(ac->username, (char *)param->username))) &&
|
|
|
- ((!(conf.authcachetype&1)) || (*SAFAMILY(&ac->sa) == *SAFAMILY(¶m->sincr) && !memcmp(SAADDR(&ac->sa), ¶m->sincr, SAADDRLEN(&ac->sa)))) &&
|
|
|
+ ((!(conf.authcachetype&1)) || (*SAFAMILY(&ac->sa) == *SAFAMILY(¶m->sincr) && !memcmp(SAADDR(&ac->sa), SAADDR(¶m->sincr), SAADDRLEN(&ac->sa)))) &&
|
|
|
(!(conf.authcachetype&4) || (ac->password && param->password && !strcmp(ac->password, (char *)param->password)))) {
|
|
|
if(param->username){
|
|
|
myfree(param->username);
|
|
|
@@ -688,7 +688,7 @@ int doauth(struct clientparam * param){
|
|
|
pthread_mutex_lock(&hash_mutex);
|
|
|
for(ac = authc; ac; ac = ac->next){
|
|
|
if((!(conf.authcachetype&2) || !strcmp(ac->username, (char *)param->username)) &&
|
|
|
- (!(conf.authcachetype&1) || (*SAFAMILY(&ac->sa) == *SAFAMILY(¶m->sincr) && !memcmp(SAADDR(&ac->sa), ¶m->sincr, SAADDRLEN(&ac->sa)))) &&
|
|
|
+ (!(conf.authcachetype&1) || (*SAFAMILY(&ac->sa) == *SAFAMILY(¶m->sincr) && !memcmp(SAADDR(&ac->sa), SAADDR(¶m->sincr), SAADDRLEN(&ac->sa)))) &&
|
|
|
(!(conf.authcachetype&4) || (ac->password && !strcmp(ac->password, (char *)param->password)))) {
|
|
|
ac->expires = conf.time + conf.authcachetime;
|
|
|
if(strcmp(ac->username, (char *)param->username)){
|
|
|
@@ -709,7 +709,7 @@ int doauth(struct clientparam * param){
|
|
|
ac = myalloc(sizeof(struct authcache));
|
|
|
if(ac){
|
|
|
ac->expires = conf.time + conf.authcachetime;
|
|
|
- ac->username = mystrdup((char *)param->username);
|
|
|
+ ac->username = param->username?mystrdup((char *)param->username):NULL;
|
|
|
ac->sa = param->sincr;
|
|
|
ac->password = NULL;
|
|
|
if((conf.authcachetype&4) && param->password) ac->password = mystrdup((char *)param->password);
|