aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn L McGrath <bug1@ihug.co.nz>2003-05-14 12:11:36 +0000
committerGlenn L McGrath <bug1@ihug.co.nz>2003-05-14 12:11:36 +0000
commit874e3381dbe1d74c6249d4b0eb5e319602557e48 (patch)
tree1a1ec185bb43896b6088c9f1f3c625172c01d9a3
parent0a3b0106ab62950a3486ca33a7e3c9ee6d0e0fca (diff)
downloadbusybox-w32-874e3381dbe1d74c6249d4b0eb5e319602557e48.tar.gz
busybox-w32-874e3381dbe1d74c6249d4b0eb5e319602557e48.tar.bz2
busybox-w32-874e3381dbe1d74c6249d4b0eb5e319602557e48.zip
vodz, last_patch_85
-rw-r--r--networking/httpd.c77
1 files changed, 38 insertions, 39 deletions
diff --git a/networking/httpd.c b/networking/httpd.c
index 9411117ea..df99f1c8b 100644
--- a/networking/httpd.c
+++ b/networking/httpd.c
@@ -320,19 +320,6 @@ static void free_config_lines(Htaccess **pprev)
320 *pprev = NULL; 320 *pprev = NULL;
321} 321}
322 322
323static void add_config_line(Htaccess **pprev, Htaccess *cur)
324{
325 if(*pprev == NULL) {
326 *pprev = cur;
327 } else {
328 Htaccess *prev;
329
330 for(prev = *pprev; prev->next; prev = prev->next)
331 ;
332 prev->next = cur;
333 }
334}
335
336/* flag */ 323/* flag */
337#define FIRST_PARSE 0 324#define FIRST_PARSE 0
338#define SUBDIR_PARSE 1 325#define SUBDIR_PARSE 1
@@ -480,11 +467,30 @@ static void parse_conf(const char *path, int flag)
480 if(*cf == '/') 467 if(*cf == '/')
481 free(p0); 468 free(p0);
482#endif 469#endif
483 if(*cf == 'A' || *cf == 'D') 470 if(*cf == 'A' || *cf == 'D') {
484 add_config_line(&config->ip_a_d, cur); 471 if(*cf == 'D' && *c) {
472 /* Deny:form_IP move top */
473 cur->next = config->ip_a_d;
474 config->ip_a_d = cur;
475 } else {
476 /* add to bottom current IP config line */
477 Htaccess *prev_IP = config->ip_a_d;
478
479 if(prev_IP == NULL) {
480 config->ip_a_d = cur;
481 } else {
482 while(prev_IP->next)
483 prev_IP = prev_IP->next;
484 prev_IP->next = cur;
485 }
486 }
487 }
485#ifdef CONFIG_FEATURE_HTTPD_CONFIG_WITH_MIME_TYPES 488#ifdef CONFIG_FEATURE_HTTPD_CONFIG_WITH_MIME_TYPES
486 else if(*cf == '.') 489 else if(*cf == '.') {
487 add_config_line(&config->mime_a, cur); 490 /* config .mime line move top for overwrite previous */
491 cur->next = config->mime_a;
492 config->mime_a = cur;
493 }
488#endif 494#endif
489 495
490#ifdef CONFIG_FEATURE_HTTPD_BASIC_AUTH 496#ifdef CONFIG_FEATURE_HTTPD_BASIC_AUTH
@@ -726,28 +732,21 @@ static void decodeBase64(char *Data)
726 while (*in) { 732 while (*in) {
727 int t = *in++; 733 int t = *in++;
728 734
729 switch(t) { 735 if(t >= '0' && t <= '9')
730 case '+': 736 t = t - '0' + 52;
731 t = 62; 737 else if(t >= 'A' && t <= 'Z')
732 break; 738 t = t - 'A';
733 case '/': 739 else if(t >= 'a' && t <= 'z')
734 t = 63; 740 t = t - 'a' + 26;
735 break; 741 else if(t == '+')
736 case '=': 742 t = 62;
737 t = 0; 743 else if(t == '/')
738 break; 744 t = 63;
739 case 'A' ... 'Z': 745 else if(t == '=')
740 t = t - 'A'; 746 t = 0;
741 break; 747 else
742 case 'a' ... 'z': 748 continue;
743 t = t - 'a' + 26; 749
744 break;
745 case '0' ... '9':
746 t = t - '0' + 52;
747 break;
748 default:
749 continue;
750 }
751 ch = (ch << 6) | t; 750 ch = (ch << 6) | t;
752 i++; 751 i++;
753 if (i == 4) { 752 if (i == 4) {