httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Garey Smiley" <ga...@main.slink.com>
Subject More OS/2 patches.
Date Sun, 16 Jun 1996 23:30:03 GMT
Could someone please commit these.

*** http_protocol.c.orig	Sun Jun 09 21:04:04 1996
--- http_protocol.c	Sun Jun 16 18:25:02 1996
***************
*** 236,241 ****
--- 236,246 ----
       * But for now...
       */
  
+ #ifdef __EMX__
+     /* Variable for OS/2 fix below. */
+     int loop;
+ #endif
+ 
  /* A proxy request contains a ':' early on, but not as first
character */
      for (s=uri; s != '\0'; s++)
      if (!isalnum(*s) && *s != '+' && *s != '-' && *s != '.') break;
***************
*** 249,254 ****
--- 254,270 ----
      {
      r->proxyreq = 0;
      r->uri = getword (r->pool, &uri, '?');
+ 
+ #ifdef __EMX__
+     /* Handle path translations for OS/2 and plug security hole. */
+     /* This will prevent "http://www.wherever.com/..\..\/" from
+        returning a directory for the root drive. */
+     for (loop = 0; loop <= strlen(r->uri); ++loop) {
+         if (r->uri[loop] == '\\')
+             r->uri[loop] = '/';
+     };
+ #endif
+ 
      if (*uri) r->args= uri;
      else r->args = NULL;
      }
*** alloc.c.orig	Mon Jun 03 07:04:18 1996
--- alloc.c	Sun Jun 16 18:14:18 1996
***************
*** 889,902 ****
--- 889,912 ----
  
    if (pipe_out) {
      close (out_fds[1]);
+ #ifdef __EMX__
+     /* Need binary mode set for OS/2. */
+     *pipe_out = fdopen (out_fds[0], "rb");
+ #else
      *pipe_out = fdopen (out_fds[0], "r");
+ #endif
  
      if (*pipe_out) note_cleanups_for_file (p, *pipe_out);
    }
  
    if (pipe_in) {
      close (in_fds[0]);
+ #ifdef __EMX__
+     /* Need binary mode set for OS/2. */
+     *pipe_in = fdopen (in_fds[1], "wb");
+ #else
      *pipe_in = fdopen (in_fds[1], "w");
+ #endif
  
      if (*pipe_in) note_cleanups_for_file (p, *pipe_in);
    }
***************
*** 1040,1053 ****
    
    if (pipe_out) {
      close (out_fds[1]);
!     *pipe_out = fdopen (out_fds[0], "r");
      
      if (*pipe_out) note_cleanups_for_file (p, *pipe_out);
    }
  
    if (pipe_in) {
      close (in_fds[0]);
!     *pipe_in = fdopen (in_fds[1], "w");
      
      if (*pipe_in) note_cleanups_for_file (p, *pipe_in);
    }
--- 1050,1065 ----
  
    if (pipe_out) {
      close (out_fds[1]);
!     /* Need binary mode set for OS/2. */
!     *pipe_out = fdopen (out_fds[0], "rb");
  
      if (*pipe_out) note_cleanups_for_file (p, *pipe_out);
    }
  
    if (pipe_in) {
      close (in_fds[0]);
!     /* Need binary mode set for OS/2. */
!     *pipe_in = fdopen (in_fds[1], "wb");
  
      if (*pipe_in) note_cleanups_for_file (p, *pipe_in);
    }


Garey Smiley
SoftLink Services
garey@slink.com
http://www.slink.com/
(216)848-1312 FAX/Data(216)699-4474

Mime
View raw message