You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by Dean Gaudet <dg...@hyperreal.org> on 1997/07/08 04:04:50 UTC

cvs commit: apache/src CHANGES http_config.c http_config.h http_core.c http_request.c

dgaudet     97/07/07 19:04:48

  Modified:    htdocs/manual  new_features_1_3.html
               htdocs/manual/mod  core.html
               src       CHANGES http_config.c http_config.h http_core.c
                        http_request.c
  Log:
  The AccessFileName directive can now take more than one file.
  
  Submitted by:	"Lou D. Langholtz" <ld...@usi.utah.edu>
  Reviewed by:	Dean Gaudet, Marc Slemko, Brian Behlendorf
  
  Revision  Changes    Path
  1.5       +8 -0      apache/htdocs/manual/new_features_1_3.html
  
  Index: new_features_1_3.html
  ===================================================================
  RCS file: /export/home/cvs/apache/htdocs/manual/new_features_1_3.html,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -C3 -r1.4 -r1.5
  *** new_features_1_3.html	1997/07/06 17:26:00	1.4
  --- new_features_1_3.html	1997/07/08 02:04:36	1.5
  ***************
  *** 62,67 ****
  --- 62,75 ----
      </P>
     </LI>
    
  + <li><strong><a href="mod/core.html#accessfilename">AccessFileName
  + Enhancement</a></strong><br>
  + The &lt;AccessFileName&gt; directive can now take more than one
  + filename. This lets sites serving pages from network file systems and
  + more than one Apache web server, configure access based on the server
  + through which shared pages are being served.
  + 
  + 
    </ul>
    
    <!--#include virtual="footer.html" -->
  
  
  
  1.63      +5 -4      apache/htdocs/manual/mod/core.html
  
  Index: core.html
  ===================================================================
  RCS file: /export/home/cvs/apache/htdocs/manual/mod/core.html,v
  retrieving revision 1.62
  retrieving revision 1.63
  diff -C3 -r1.62 -r1.63
  *** core.html	1997/07/06 17:19:13	1.62
  --- core.html	1997/07/08 02:04:38	1.63
  ***************
  *** 94,106 ****
    
    <h2><A name="accessfilename">AccessFileName directive</A></h2>
    <!--%plaintext &lt;?INDEX {\tt AccessFileName} directive&gt; -->
  ! <strong>Syntax:</strong> AccessFileName <em>filename</em><br>
    <strong>Default:</strong> <code>AccessFileName .htaccess</code><br>
    <strong>Context:</strong> server config, virtual host<br>
  ! <strong>Status:</strong> core<p>
    
  ! When returning a document to the client the server looks for an
  ! access control file with this name in every directory of the path to
    the document, if access control files are enabled for that directory.
    
    For example:
  --- 94,107 ----
    
    <h2><A name="accessfilename">AccessFileName directive</A></h2>
    <!--%plaintext &lt;?INDEX {\tt AccessFileName} directive&gt; -->
  ! <strong>Syntax:</strong> AccessFileName <em>filename filename ...</em><br>
    <strong>Default:</strong> <code>AccessFileName .htaccess</code><br>
    <strong>Context:</strong> server config, virtual host<br>
  ! <strong>Status:</strong> core<br>
  ! <strong>Compatibility:</strong> AccessFileName can accept more than one filename only in Apache 1.3 and later<p>
    
  ! When returning a document to the client the server looks for the first existing
  ! access control file from this list of names in every directory of the path to
    the document, if access control files are enabled for that directory.
    
    For example:
  
  
  
  1.326     +4 -1      apache/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /export/home/cvs/apache/src/CHANGES,v
  retrieving revision 1.325
  retrieving revision 1.326
  diff -C3 -r1.325 -r1.326
  *** CHANGES	1997/07/07 18:18:42	1.325
  --- CHANGES	1997/07/08 02:04:40	1.326
  ***************
  *** 1,5 ****
    Changes with Apache 1.3
  !   
      *) The new mod_mime_magic can be used to "magically" determine the type
         of a file if the extension is unknown.  Based on the unix file(1)
         command.  [Ian Kluft <ik...@cisco.com>]
  --- 1,8 ----
    Changes with Apache 1.3
  ! 
  !   *) The AccessFileName directive can now take more than one filename.
  !      ["Lou D. Langholtz" <ld...@usi.utah.edu>]
  ! 
      *) The new mod_mime_magic can be used to "magically" determine the type
         of a file if the extension is unknown.  Based on the unix file(1)
         command.  [Ian Kluft <ik...@cisco.com>]
  
  
  
  1.56      +15 -3     apache/src/http_config.c
  
  Index: http_config.c
  ===================================================================
  RCS file: /export/home/cvs/apache/src/http_config.c,v
  retrieving revision 1.55
  retrieving revision 1.56
  diff -C3 -r1.55 -r1.56
  *** http_config.c	1997/06/30 21:18:11	1.55
  --- http_config.c	1997/07/08 02:04:41	1.56
  ***************
  *** 864,874 ****
    
    
    int parse_htaccess(void **result, request_rec *r, int override,
  ! 		   char *d, char *filename)
    {
  !     FILE *f;
        cmd_parms parms;
        const char *errmsg;
        const struct htaccess_result *cache;
        struct htaccess_result *new;
        void *dc;
  --- 864,875 ----
    
    
    int parse_htaccess(void **result, request_rec *r, int override,
  ! 		   char *d, const char *access_name)
    {
  !     FILE *f = NULL;
        cmd_parms parms;
        const char *errmsg;
  +     char *filename;
        const struct htaccess_result *cache;
        struct htaccess_result *new;
        void *dc;
  ***************
  *** 888,894 ****
        parms.server = r->server;
        parms.path = d;
    
  !     if((f=pfopen(r->pool, filename, "r"))) {
            dc = create_per_dir_config (r->pool);
    	
            parms.infile = f;
  --- 889,906 ----
        parms.server = r->server;
        parms.path = d;
    
  !     if (access_name) {
  ! 	while (!f && access_name[0]) {
  ! 	    char *w = getword_conf(r->pool, &access_name);
  ! 	    filename = make_full_path(r->pool, d, w);
  ! 	    f=pfopen(r->pool, filename, "r");
  ! 	}
  !     }
  !     else {
  ! 	filename = make_full_path(r->pool, d, 0);
  ! 	f=pfopen(r->pool, filename, "r");
  !     }
  !     if(f) {
            dc = create_per_dir_config (r->pool);
    	
            parms.infile = f;
  
  
  
  1.33      +1 -1      apache/src/http_config.h
  
  Index: http_config.h
  ===================================================================
  RCS file: /export/home/cvs/apache/src/http_config.h,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -C3 -r1.32 -r1.33
  *** http_config.h	1997/06/28 22:12:54	1.32
  --- http_config.h	1997/07/08 02:04:42	1.33
  ***************
  *** 275,281 ****
    /* For http_core.c... (<Directory> command and virtual hosts) */
    
    int parse_htaccess(void **result, request_rec *r, int override,
  ! 		   char *path, char *file);
    const char *srm_command_loop (cmd_parms *parms, void *config);
    
    server_rec *init_virtual_host (pool *p, const char *hostname, server_rec *main_server);
  --- 275,281 ----
    /* For http_core.c... (<Directory> command and virtual hosts) */
    
    int parse_htaccess(void **result, request_rec *r, int override,
  ! 		   char *path, const char *access_name);
    const char *srm_command_loop (cmd_parms *parms, void *config);
    
    server_rec *init_virtual_host (pool *p, const char *hostname, server_rec *main_server);
  
  
  
  1.91      +2 -2      apache/src/http_core.c
  
  Index: http_core.c
  ===================================================================
  RCS file: /export/home/cvs/apache/src/http_core.c,v
  retrieving revision 1.90
  retrieving revision 1.91
  diff -C3 -r1.90 -r1.91
  *** http_core.c	1997/06/30 22:50:39	1.90
  --- http_core.c	1997/07/08 02:04:43	1.91
  ***************
  *** 417,423 ****
        void *sconf = cmd->server->module_config;
        core_server_config *conf = get_module_config (sconf, &core_module);
      
  !     conf->access_name = arg;
        return NULL;
    }
    
  --- 417,423 ----
        void *sconf = cmd->server->module_config;
        core_server_config *conf = get_module_config (sconf, &core_module);
      
  !     conf->access_name = pstrdup(cmd->pool, arg);
        return NULL;
    }
    
  ***************
  *** 1216,1222 ****
    
    /* Old resource config file commands */
      
  ! { "AccessFileName", set_access_name, NULL, RSRC_CONF, TAKE1, "Name of per-directory config files (default: .htaccess)" },
    { "DocumentRoot", set_document_root, NULL, RSRC_CONF, TAKE1, "Root directory of the document tree"  },
    { "ErrorDocument", set_error_document, NULL, OR_FILEINFO, RAW_ARGS, "Change responses for HTTP errors" },
    { "AllowOverride", set_override, NULL, ACCESS_CONF, RAW_ARGS, "Controls what groups of directives can be configured by per-directory config files" },
  --- 1216,1222 ----
    
    /* Old resource config file commands */
      
  ! { "AccessFileName", set_access_name, NULL, RSRC_CONF, RAW_ARGS, "Name(s) of per-directory config files (default: .htaccess)" },
    { "DocumentRoot", set_document_root, NULL, RSRC_CONF, TAKE1, "Root directory of the document tree"  },
    { "ErrorDocument", set_error_document, NULL, OR_FILEINFO, RAW_ARGS, "Change responses for HTTP errors" },
    { "AllowOverride", set_override, NULL, ACCESS_CONF, RAW_ARGS, "Controls what groups of directives can be configured by per-directory config files" },
  
  
  
  1.58      +2 -12     apache/src/http_request.c
  
  Index: http_request.c
  ===================================================================
  RCS file: /export/home/cvs/apache/src/http_request.c,v
  retrieving revision 1.57
  retrieving revision 1.58
  diff -C3 -r1.57 -r1.58
  *** http_request.c	1997/07/07 14:34:27	1.57
  --- http_request.c	1997/07/08 02:04:44	1.58
  ***************
  *** 414,431 ****
    	 */
    	
    	if (overrides_here) {
  ! 	    int len;
  ! 
  ! 	    if (test_htaccess == NULL) {
  ! 		/* we delayed allocating this in case there wasn't a need */
  ! 		test_htaccess = palloc (r->pool,
  ! 		    test_filename_len + 1 + strlen (sconf->access_name));
  ! 	    }
  ! 	    len = test_dirname_tail - test_dirname;
  ! 	    memcpy (test_htaccess, test_dirname, len);
  ! 	    strcpy (test_htaccess + len, sconf->access_name);
  ! 	    res = parse_htaccess (&htaccess_conf, r, overrides_here,
  ! 				  test_dirname, test_htaccess);
    	    if (res) return res;
    	}
    
  --- 414,421 ----
    	 */
    	
    	if (overrides_here) {
  !   	    res = parse_htaccess (&htaccess_conf, r, overrides_here,
  !  				  test_dirname, sconf->access_name);
    	    if (res) return res;
    	}