You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by John Bley <jb...@acpub.duke.edu> on 1999/02/19 07:08:40 UTC

[PATCH] Codenits: sparse initializers and ANSI compliance

Patch for three sparse initializers (static inits of structs that 
don't fill out all members of that struct).  I supplied "sane" 
defaults (0, NULL), perhaps more appropriate values exist.

The strange string modification is a wholy arbitrary synonym replacement 
- ANSI C requires that compilers be able to handle string literals of up 
to and including 509 characters in length.  This particular string 
(warning the user about running apache as root) was, sadly, 510 
characters in length.  Any reduction of its length by one byte would do, 
this patch is one of far too many possibilities.

-- 
John Bley - jbb6@acpub.duke.edu
Duke '99 - English/Computer Science
  Since English is a mess, it maps well onto the problem space,
  which is also a mess, which we call reality.     - Larry Wall

diff -Burp apache_1.3.4/src/main/http_config.c apache_1.3.4-patched/src/main/http_config.c
--- apache_1.3.4/src/main/http_config.c	Fri Jan  1 14:04:48 1999
+++ apache_1.3.4-patched/src/main/http_config.c	Fri Feb 19 00:35:14 1999
@@ -1069,7 +1069,7 @@ API_EXPORT_NONSTD(const char *) ap_set_f
  */
 
 static cmd_parms default_parms =
-{NULL, 0, -1, NULL, NULL, NULL, NULL, NULL, NULL};
+{NULL, 0, -1, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
 
 API_EXPORT(char *) ap_server_root_relative(pool *p, char *file)
 {
diff -Burp apache_1.3.4/src/main/http_core.c apache_1.3.4-patched/src/main/http_core.c
--- apache_1.3.4/src/main/http_core.c	Thu Jan  7 15:46:58 1999
+++ apache_1.3.4-patched/src/main/http_core.c	Fri Feb 19 00:32:51 1999
@@ -1719,7 +1719,7 @@ static const char *set_user(cmd_parms *c
 		"Error:\tApache has not been designed to serve pages while\n"
 		"\trunning as root.  There are known race conditions that\n"
 		"\twill allow any local user to read any file on the system.\n"
-		"\tShould you still desire to serve pages as root then\n"
+		"\tIf you still desire to serve pages as root then\n"
 		"\tadd -DBIG_SECURITY_HOLE to the EXTRA_CFLAGS line in your\n"
 		"\tsrc/Configuration file and rebuild the server.  It is\n"
 		"\tstrongly suggested that you instead modify the User\n"
@@ -2668,7 +2668,7 @@ static const command_rec core_cmds[] = {
   (void*)XtOffsetOf(core_dir_config, limit_req_body),
   OR_ALL, TAKE1,
   "Limit (in bytes) on maximum size of request message body" },
-{ NULL },
+{ NULL, NULL, NULL, 0, 0, NULL},
 };
 
 /*****************************************************************
@@ -2909,7 +2909,7 @@ static int default_handler(request_rec *
 static const handler_rec core_handlers[] = {
 { "*/*", default_handler },
 { "default-handler", default_handler },
-{ NULL }
+{ NULL, NULL }
 };
 
 API_VAR_EXPORT module core_module = {

Re: [PATCH] Codenits: sparse initializers and ANSI compliance

Posted by Dean Gaudet <dg...@arctic.org>.

On Fri, 19 Feb 1999, John Bley wrote:

> Patch for three sparse initializers (static inits of structs that 
> don't fill out all members of that struct).  I supplied "sane" 
> defaults (0, NULL), perhaps more appropriate values exist.

It's not just "sane" -- it's what ANSI requires...

> The strange string modification is a wholy arbitrary synonym replacement 
> - ANSI C requires that compilers be able to handle string literals of up 
> to and including 509 characters in length.  This particular string 
> (warning the user about running apache as root) was, sadly, 510 
> characters in length.  Any reduction of its length by one byte would do, 
> this patch is one of far too many possibilities.

Bleh.

Thanks.

Dean