httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject [PATCH] from uunet: set_file_slot
Date Fri, 22 Aug 1997 17:10:32 GMT
[I received a bunch of patches from UUnet which they apply to every
release.  I busted them apart into smaller pieces, but haven't tested any
of them.  Consider this to be a +1 for inclusion in 1.3.  I'm hoping
someone else will redo these as patches against 1.3.]

Dean

Thu Aug 14 12:01:28 1997  David J. MacKenzie  <djm@va.pubnix.com>

	* http_config.c (set_file_slot): New function, allowing auth
	directives to be independent of the server root, so the server
	documents can be moved to a different directory or machine more
	easily.
	* http_config.h: Declare it.
	* mod_auth.c, mod_auth_db.c, mod_auth_dbm.c: Use it.
	
Index: src/http_config.c
--- http_config.c	1997/07/08 21:08:30	1.1
+++ http_config.c	1997/07/08 21:22:43	1.2
@@ -716,6 +716,21 @@
     return NULL;
 }
 
+const char *set_file_slot (cmd_parms *cmd, char *struct_ptr, char *arg)
+{
+    /* Prepend server_root to relative arg.
+       This allows .htaccess to be independent of server_root,
+       so the server can be moved or mirrored with less pain.  */
+    char *p;
+    int offset = (int)cmd->info;
+    if (*arg == '/')
+      p = pstrdup (cmd->pool, arg);
+    else
+      p = make_full_path (cmd->pool, server_root, arg);
+    *(char **)(struct_ptr + offset) = p;
+    return NULL;
+}
+
 /*****************************************************************
  *
  * Reading whole config files...
Index: src/http_config.h
--- http_config.h	1997/07/08 21:08:30	1.1
+++ http_config.h	1997/07/08 21:22:43	1.2
@@ -240,6 +240,7 @@
 
 const char *set_string_slot (cmd_parms *, char *, char *);
 const char *set_flag_slot (cmd_parms *, char *, int);
+const char *set_file_slot (cmd_parms *, char *, char *);
 
 /* For modules which need to read config files, open logs, etc. ...
  * this returns the fname argument if it begins with '/'; otherwise
Index: src/mod_auth.c
--- mod_auth.c	1997/07/08 21:08:30	1.1
+++ mod_auth.c	1997/07/08 21:22:45	1.2
@@ -94,7 +94,7 @@
     if (t && strcmp(t, "standard"))
         return pstrcat(cmd->pool, "Invalid auth file type: ",  t, NULL);
 
-    return set_string_slot(cmd, offset, f);
+    return set_file_slot(cmd, offset, f);
 }
 
 command_rec auth_cmds[] = {
Index: src/mod_auth_db.c
--- mod_auth_db.c	1997/07/08 21:08:30	1.1
+++ mod_auth_db.c	1997/07/08 21:22:45	1.2
@@ -109,14 +109,14 @@
     if (!t || strcmp(t, "db"))
         return DECLINE_CMD;
 
-    return set_string_slot(cmd, offset, f);
+    return set_file_slot(cmd, offset, f);
 }
 
 command_rec db_auth_cmds[] = {
-{ "AuthDBUserFile", set_string_slot,
+{ "AuthDBUserFile", set_file_slot,
     (void*)XtOffsetOf(db_auth_config_rec, auth_dbpwfile),
     OR_AUTHCFG, TAKE1, NULL },
-{ "AuthDBGroupFile", set_string_slot,
+{ "AuthDBGroupFile", set_file_slot,
     (void*)XtOffsetOf(db_auth_config_rec, auth_dbgrpfile),
     OR_AUTHCFG, TAKE1, NULL },
 { "AuthUserFile", set_db_slot,
Index: src/mod_auth_dbm.c
--- mod_auth_dbm.c	1997/07/08 21:08:30	1.1
+++ mod_auth_dbm.c	1997/07/08 21:22:45	1.2
@@ -96,14 +96,14 @@
     if (!t || strcmp(t, "dbm"))
 	return DECLINE_CMD;
 
-    return set_string_slot(cmd, offset, f);
+    return set_file_slot(cmd, offset, f);
 }
 
 command_rec dbm_auth_cmds[] = {
-{ "AuthDBMUserFile", set_string_slot,
+{ "AuthDBMUserFile", set_file_slot,
     (void*)XtOffsetOf(dbm_auth_config_rec, auth_dbmpwfile),
     OR_AUTHCFG, TAKE1, NULL },
-{ "AuthDBMGroupFile", set_string_slot,
+{ "AuthDBMGroupFile", set_file_slot,
     (void*)XtOffsetOf(dbm_auth_config_rec, auth_dbmgrpfile),
     OR_AUTHCFG, TAKE1, NULL },
 { "AuthUserFile", set_dbm_slot,



Mime
View raw message