Changeset 1429
- Timestamp:
- 11/04/09 09:21:07 (4 years ago)
- Location:
- trunk/wifidog
- Files:
-
- 7 modified
-
ChangeLog (modified) (1 diff)
-
libhttpd/api.c (modified) (11 diffs)
-
libhttpd/ip_acl.c (modified) (1 diff)
-
libhttpd/protocol.c (modified) (1 diff)
-
src/conf.c (modified) (2 diffs)
-
src/fw_iptables.c (modified) (1 diff)
-
src/util.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wifidog/ChangeLog
r1423 r1429 1 1 # $Id$ 2 2009-11-03 3 * Fix #625, does not display failure notice when quiet is set to true 4 * Fix #587, change index and rindex to strchr and strrchr 5 * Fix #548, trim leading spaces of the config file's options 6 2 7 2009-09-28 Benoit Grégoire <benoitg@coeus.ca> 3 8 * Fix #471, patch by wichert -
trunk/wifidog/libhttpd/api.c
r1423 r1429 472 472 *end; 473 473 474 var = index(buf,':');474 var = strchr(buf,':'); 475 475 while(var) 476 476 { 477 477 var++; 478 val = index(var, '=');478 val = strchr(var, '='); 479 479 *val = 0; 480 480 val++; 481 end = index(val,';');481 end = strchr(val,';'); 482 482 if(end) 483 483 *end = 0; … … 490 490 if (strncasecmp(buf,"Authorization: ",15) == 0) 491 491 { 492 cp = index(buf,':') + 2;492 cp = strchr(buf,':') + 2; 493 493 if (strncmp(cp,"Basic ", 6) != 0) 494 494 { … … 499 499 char authBuf[100]; 500 500 501 cp = index(cp,' ') + 1;501 cp = strchr(cp,' ') + 1; 502 502 _httpd_decode(cp, authBuf, 100); 503 503 r->request.authLength = 504 504 strlen(authBuf); 505 cp = index(authBuf,':');505 cp = strchr(authBuf,':'); 506 506 if (cp) 507 507 { … … 520 520 if (strncasecmp(buf,"Referer: ",9) == 0) 521 521 { 522 cp = index(buf,':') + 2;522 cp = strchr(buf,':') + 2; 523 523 if(cp) 524 524 { … … 533 533 if (strncasecmp(buf,"Host: ",6) == 0) 534 534 { 535 cp = index(buf,':');535 cp = strchr(buf,':'); 536 536 if(cp) 537 537 { … … 546 546 if (strncasecmp(buf,"If-Modified-Since: ",19) == 0) 547 547 { 548 cp = index(buf,':') + 2;548 cp = strchr(buf,':') + 2; 549 549 if(cp) 550 550 { … … 552 552 HTTP_MAX_URL); 553 553 r->request.ifModified[HTTP_MAX_URL-1]=0; 554 cp = index(r->request.ifModified,554 cp = strchr(r->request.ifModified, 555 555 ';'); 556 556 if (cp) … … 560 560 if (strncasecmp(buf,"Content-Type: ",14) == 0) 561 561 { 562 cp = index(buf,':') + 2;562 cp = strchr(buf,':') + 2; 563 563 if(cp) 564 564 { … … 570 570 if (strncasecmp(buf,"Content-Length: ",16) == 0) 571 571 { 572 cp = index(buf,':') + 2;572 cp = strchr(buf,':') + 2; 573 573 if(cp) 574 574 r->request.contentLength=atoi(cp); … … 599 599 ** Process any URL data 600 600 */ 601 cp = index(r->request.path,'?');601 cp = strchr(r->request.path,'?'); 602 602 if (cp != NULL) 603 603 { … … 958 958 strncpy(dirName, httpdRequestPath(r), HTTP_MAX_URL); 959 959 dirName[HTTP_MAX_URL-1]=0; 960 cp = rindex(dirName, '/');960 cp = strrchr(dirName, '/'); 961 961 if (cp == NULL) 962 962 { -
trunk/wifidog/libhttpd/ip_acl.c
r274 r1429 53 53 cp = val; 54 54 res1 = atoi(cp); 55 cp = index(cp,'.');55 cp = strchr(cp,'.'); 56 56 if (!cp) 57 57 return(-1); 58 58 cp++; 59 59 res2 = atoi(cp); 60 cp = index(cp,'.');60 cp = strchr(cp,'.'); 61 61 if (!cp) 62 62 return(-1); 63 63 cp++; 64 64 res3 = atoi(cp); 65 cp = index(cp,'.');65 cp = strchr(cp,'.'); 66 66 if (!cp) 67 67 return(-1); 68 68 cp++; 69 69 res4 = atoi(cp); 70 cp = index(cp,'/');70 cp = strchr(cp,'/'); 71 71 if (!cp) 72 72 { -
trunk/wifidog/libhttpd/protocol.c
r1371 r1429 608 608 struct stat sbuf; 609 609 610 suffix = rindex(path, '.');610 suffix = strrchr(path, '.'); 611 611 if (suffix != NULL) 612 612 { -
trunk/wifidog/src/conf.c
r1373 r1429 634 634 FILE *fd; 635 635 char line[MAX_BUF], *s, *p1, *p2; 636 int linenum = 0, opcode, value ;636 int linenum = 0, opcode, value, len; 637 637 638 638 debug(LOG_INFO, "Reading configuration file '%s'", filename); … … 659 659 if (p1) { 660 660 p1++; 661 662 // Trim leading spaces 663 len = strlen(p1); 664 while (*p1 && len) { 665 if (*p1 == ' ') 666 p1++; 667 else 668 break; 669 len = strlen(p1); 670 } 671 661 672 662 673 if ((p2 = strchr(p1, ' '))) { -
trunk/wifidog/src/fw_iptables.c
r1420 r1429 113 113 rc = execute(cmd, fw_quiet); 114 114 115 if (rc!=0) 116 debug(LOG_ERR, "iptables command failed(%d): %s", rc, cmd); 115 if (rc!=0) { 116 // If quiet, do not display the error 117 if (fw_quiet == 0) 118 debug(LOG_ERR, "iptables command failed(%d): %s", rc, cmd); 119 else if (fw_quiet == 1) 120 debug(LOG_DEBUG, "iptables command failed(%d): %s", rc, cmd); 121 } 117 122 118 123 free(cmd); -
trunk/wifidog/src/util.c
r1381 r1429 115 115 } else { 116 116 debug(LOG_ERR, "execvp() failed"); 117 }118 exit(1);117 } 118 exit(1); 119 119 } 120 120
