You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apache-bugdb@apache.org by Stan Malyshev <st...@xcf.berkeley.edu> on 1999/03/02 01:21:55 UTC

general/3982: PATCH for problem #3769

>Number:         3982
>Category:       general
>Synopsis:       PATCH for problem #3769
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    apache
>State:          open
>Class:          change-request
>Submitter-Id:   apache
>Arrival-Date:   Mon Mar  1 16:30:00 PST 1999
>Last-Modified:
>Originator:     stas@xcf.berkeley.edu
>Organization:
apache
>Release:        1.3.4
>Environment:
NT, VC++ 6.x
>Description:
Diff follows..
>How-To-Repeat:
Diff follows..
>Fix:
Here it is:

*** util_win32.orig	Tue Jan 05 00:17:32 1999
--- util_win32.c	Mon Mar 01 16:06:24 1999
***************
*** 574,582 ****
      char seglength;
      const char *pos;
      static const char * const invalid_characters = "?\"<>*|:";
!     static const char * const invalid_filenames[] = { 
! 	"CON", "AUX", "COM1", "COM2", "COM3", 
! 	"COM4", "LPT1", "LPT2", "LPT3", "PRN", "NUL", NULL 
      };
  
      /* Test 1 */
--- 574,584 ----
      char seglength;
      const char *pos;
      static const char * const invalid_characters = "?\"<>*|:";
!     static const char * const invalid_filenames3[] = { 
!       "CON", "AUX", "PRN", "NUL", NULL 
!     };
!     static const char * const invalid_filenames4[] = { 
!       "COM1", "COM2", "COM3", "COM4", "LPT1", "LPT2", "LPT3", NULL 
      };
  
      /* Test 1 */
***************
*** 663,676 ****
  	/* baselength is the number of characters in the base path of
  	 * the segment (which could be the same as the whole segment length,
  	 * if it does not include any dot characters). */
! 	if (baselength == 3 || baselength == 4) {
! 	    for (idx = 0; invalid_filenames[idx]; idx++) {
! 		if (!strnicmp(invalid_filenames[idx], segstart, baselength)) {
! 		    return 0;
! 		}
  	    }
  	}
      }
! 
      return 1;
  }
--- 665,685 ----
  	/* baselength is the number of characters in the base path of
  	 * the segment (which could be the same as the whole segment length,
  	 * if it does not include any dot characters). */
! 	if(baselength == 3){
! 	  for(idx = 0; invalid_filenames3[idx]; idx++){
! 	    if(0 == strnicmp(invalid_filenames3[idx], segstart, baselength)) {
! 	      return 0;
! 	    }
! 	  }
! 	}
! 	else if(baselength == 4){
! 	  for(idx = 0; invalid_filenames4[idx]; idx++){
! 	    if (0 == strnicmp(invalid_filenames4[idx], segstart, baselength)) {
! 	      return 0;
  	    }
+ 	  }
  	}
      }
!     
      return 1;
  }
>Audit-Trail:
>Unformatted:
[In order for any reply to be added to the PR database, ]
[you need to include <ap...@Apache.Org> in the Cc line ]
[and leave the subject line UNCHANGED.  This is not done]
[automatically because of the potential for mail loops. ]
[If you do not include this Cc, your reply may be ig-   ]
[nored unless you are responding to an explicit request ]
[from a developer.                                      ]
[Reply only with text; DO NOT SEND ATTACHMENTS!         ]