You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Garey Smiley <ga...@main.slink.com> on 1996/06/17 01:30:03 UTC

More OS/2 patches.

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

Re: More OS/2 patches.

Posted by Brian Behlendorf <br...@organic.com>.
On Sun, 16 Jun 1996, Garey Smiley wrote:
> Could someone please commit these.

I would, but not all of them are enclosed ifdef __EMX__.  Should the
following be?  You ifdef'd similar changes earlier up.

	Brian

> ***************
> *** 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);
>     }

	Brian

--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
brian@organic.com  www.apache.org  hyperreal.com  http://www.organic.com/JOBS