You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Robert S. Thau" <rs...@ai.mit.edu> on 1995/08/20 17:57:38 UTC

Roy's problems I

I thought I'd checked the FollowSymLinks code, but it turns out I
missed a case... it was checking the directories leading up to the
file (which must be what I tried, and why I thought it worked), but it
was not checking the file itself.  The following fixes the problem,
and will shortly appear on hyperreal as patch10.symlinks:

*** http_request.c	Sat Aug 19 13:22:18 1995
--- ../http_request.c	Sun Aug 20 11:47:51 1995
***************
*** 177,183 ****
      void *per_dir_defaults = r->server->lookup_defaults;
      char *test_filename = pstrdup (r->pool, r->filename);
  
!     int num_dirs;
      int i;
  
      /* Go down the directory hierarchy.  Where we have to check for symlinks,
--- 177,183 ----
      void *per_dir_defaults = r->server->lookup_defaults;
      char *test_filename = pstrdup (r->pool, r->filename);
  
!     int num_dirs, res;
      int i;
  
      /* Go down the directory hierarchy.  Where we have to check for symlinks,
***************
*** 199,205 ****
  	  (core_dir_config *)get_module_config(per_dir_defaults, &core_module);
  	int allowed_here = core_dir->opts;
  	int overrides_here = core_dir->override;
- 	int res;
          void *this_conf = NULL, *htaccess_conf = NULL;
  	char *this_dir = make_dirstr (r->pool, test_filename, i);
  	char *config_name = make_full_path(r->pool, this_dir,
--- 199,204 ----
***************
*** 278,283 ****
--- 277,285 ----
      }
  
      r->per_dir_config = per_dir_defaults;
+ 
+     if ((res = check_symlinks (r->filename, allow_options(r))))
+ 	return res;
      
      return OK;			/* Can only "fail" if access denied
  				 * by the symlink goop.