You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Jim Jagielski <ji...@jaguNET.com> on 1998/05/09 16:48:55 UTC

[PATCH] Depreciate SERVER_SUBVERSION and reorder server_version

This patch totally removes the SERVER_SUBVERSION hack. This forces
people to use ap_add_version_componant. Also, it adjusts things so
that it appends rather than prepends the tokens to the server_version
string. Thus, it reflects the order in which they were added. Also
includes Paul's "make ap_get_server_version sane" fix:


Index: src/include/httpd.h
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/include/httpd.h,v
retrieving revision 1.211
diff -u -r1.211 httpd.h
--- httpd.h	1998/05/09 14:27:26	1.211
+++ httpd.h	1998/05/09 14:41:09
@@ -369,15 +369,9 @@
 #define DEFAULT_LISTENBACKLOG 511
 #endif
 
-/* If you have altered Apache and wish to change the SERVER_VERSION
- * identifier below, please keep to the HTTP specification.  This states that
- * the identification string should consist of product tokens with an optional
- * slash and version designator.  Sub-products which form a significant part 
- * of the application can be listed, separated by whitespace, by adding
- * their product tokens to EXTRA_CFLAGS in the Configuration file like so.
+/* Base version for Apache. Extra tokens are appended to this
+ * via the ap_add_version_component() function.
  *
- * EXTRA_CFLAGS="-DSERVER_SUBVERSION="MrWidget/0.1-alpha"
- *
  * The tokens are listed in order of their significance for identifying the
  * application.
  *
@@ -388,11 +382,7 @@
  */
 
 #define SERVER_BASEVERSION "Apache/1.3b7-dev"	/* SEE COMMENTS ABOVE */
-#ifdef SERVER_SUBVERSION
-#define SERVER_VERSION	SERVER_BASEVERSION " " SERVER_SUBVERSION
-#else
 #define SERVER_VERSION	SERVER_BASEVERSION
-#endif
 
 API_EXPORT(const char *) ap_get_server_version(void);
 API_EXPORT(void) ap_add_version_component(const char *component);
Index: src/main/http_main.c
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
retrieving revision 1.344
diff -u -r1.344 http_main.c
--- http_main.c	1998/05/09 13:23:56	1.344
+++ http_main.c	1998/05/09 14:41:13
@@ -359,7 +359,7 @@
 
 API_EXPORT(const char *) ap_get_server_version()
 {
-    return server_version;
+    return (server_version ? server_version : SERVER_BASEVERSION);
 }
 
 API_EXPORT(void) ap_add_version_component(const char *component)
@@ -376,9 +376,10 @@
 	}
 	else {
 	    /*
-	     * Prepend the given component identifier to the existing string
+	     * Tack the given component identifier to the end of
+	     * the existing string
 	     */
-	    server_version = ap_pstrcat(pconf, component, " ", server_version,
+	    server_version = ap_pstrcat(pconf, server_version, " ", component,
 					NULL);
 	}
     }
@@ -390,16 +391,12 @@
  */
 static void ap_set_version()
 {
-#ifdef SERVER_SUBVERSION
-    ap_add_version_component(SERVER_SUBVERSION);
-#endif
     if (ap_note_platform) {
         ap_add_version_component(SERVER_BASEVERSION " (" PLATFORM ")");
     }
     else {
         ap_add_version_component(SERVER_BASEVERSION);
     }
-    version_locked++;
 }
 
 static APACHE_TLS int volatile exit_after_unblock = 0;
@@ -2989,10 +2986,6 @@
 static void show_compile_settings(void)
 {
     printf("Server base version: %s\n", SERVER_BASEVERSION);
-#ifdef SERVER_SUBVERSION
-    printf("Server sub-version:  %s\n", SERVER_SUBVERSION);
-#endif
-    printf("Server Full version: %s\n", ap_get_server_version());
     printf("Server built:        %s\n", ap_get_server_built());
     printf("Server's Module Magic Number: %u\n", MODULE_MAGIC_NUMBER);
     printf("Server compiled with....\n");
@@ -3863,8 +3856,9 @@
 	setup_listeners(pconf);
 	ap_open_logs(server_conf, pconf);
 	ap_log_pid(pconf, ap_pid_fname);
+	ap_set_version();	/* create our server_version string */
 	ap_init_modules(pconf, server_conf);
-	ap_set_version();
+	version_locked++;	/* no more changes to server_version */
 	SAFE_ACCEPT(accept_mutex_init(pconf));
 	if (!is_graceful) {
 	    reinit_scoreboard(pconf);
@@ -4135,8 +4129,9 @@
 
     if (ap_standalone) {
 	ap_open_logs(server_conf, pconf);
-	ap_init_modules(pconf, server_conf);
 	ap_set_version();
+	ap_init_modules(pconf, server_conf);
+	version_locked++;
 	STANDALONE_MAIN(argc, argv);
     }
     else {
@@ -5007,8 +5002,9 @@
 
 	server_conf = ap_read_config(pconf, pparent, ap_server_confname);
 	ap_open_logs(server_conf, pconf);
-	ap_init_modules(pconf, server_conf);
 	ap_set_version();
+	ap_init_modules(pconf, server_conf);
+	version_locked++;
 	if (!is_graceful)
 	    reinit_scoreboard(pconf);
 
@@ -5242,9 +5238,10 @@
 
     server_conf = ap_read_config(pconf, ptrans, ap_server_confname);
     ap_log_pid(pconf, ap_pid_fname);
+    ap_set_version();
     ap_init_modules(pconf, server_conf);
     ap_suexec_enabled = init_suexec();
-    ap_set_version();
+    version_locked++;
     ap_open_logs(server_conf, pconf);
     set_group_privs();
 
-- 
===========================================================================
   Jim Jagielski   |||   jim@jaguNET.com   |||   http://www.jaguNET.com/
            "That's no ordinary rabbit... that's the most foul,
            cruel and bad-tempered rodent you ever laid eyes on"

Re: [PATCH] Depreciate SERVER_SUBVERSION and reorder server_version

Posted by Brian Behlendorf <br...@hyperreal.org>.
At 03:50 PM 5/9/98 -0400, you wrote:
>How about ServerHeader [none|normal|os|full]
>
>  none:   <Nothing>
>  normal: Apache/1.3.0
>  os:     Apache/1.3.0 (UNIX)
>  full:   Apache/1.3.0 (UNIX) PHP/3.0 FooBar/1.1a

I am okay if "normal" becomes "minimal", and "full" becomes the default.
Otherwise we'll have people going "I compiled this in and it didn't show up".

Time's running out folks.

	Brian


--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
pure chewing satisfaction                                  brian@apache.org
                                                        brian@hyperreal.org

Re: [PATCH] Depreciate SERVER_SUBVERSION and reorder server_version

Posted by Gregory A Lundberg <lu...@vr.net>.
On Sat, 9 May 1998, Brian Behlendorf wrote:

> >I'd like to see a three-way option: full strings (server version with
> >subversions and whatever other crap modules authors decide to add), server
> >name and version only (the default), or strings at all (with a clear note
> >in the documentation recommending this setting).
> 
> What if we extended "AddVersionPlatform" to cover module components as
> well?  E.g. a "AddVersionPlatform no" would only return "Server:
> Apache/1.3.0".  

I'm unclear on what AddVersionPlatform does.  From its name, it sounds
like it's asking whether or not to expose the OS and/or hardware.  OK.
Sounds like a good place as any.  But keep it simple .. please!  Give the
admin the ability to hide or expose the server name, version, platform,
and modules.  For modules, I see it as all-or-nothing, but that may be
just me.  And make the default just the server name and version.  How
about:

default sends: "Server: Apache/1.3.0" and that's it

AddVersionPlatform [[no] [version|platform|other] ...]

'AddVersionPlatform no' by itself supresses 'Server:' totally

'AddVersionPlatform no version' sends 'Server: Apache'

'AddVersionPlatform platform no version' sends 'Server: Apache (UNIX)'

'AddVersionPlatform version platform other' sends 'Server: Apache/1.3.0
(UNIX) MyModule/1.3 YourModule/3.4' blah blah blah

you get the idea?  I've not looked at the RFC to see what the strings must
look like, so I hope you can see where I'd like it to go.

----

Gregory A Lundberg		Senior Partner, VRnet Company
1441 Elmdale Drive              lundberg@vr.net
Kettering, OH 45409-1615 USA    1-800-809-2195


Re: [PATCH] Depreciate SERVER_SUBVERSION and reorder server_vers

Posted by Lars Eilebrecht <La...@unix-ag.org>.
According to Brian Behlendorf:

>  At 11:25 AM 5/9/98 -0400, you wrote:
> >I'd like to see a three-way option: full strings (server version with
> >subversions and whatever other crap modules authors decide to add), server
> >name and version only (the default), or strings at all (with a clear note
> >in the documentation recommending this setting).
>  
>  What if we extended "AddVersionPlatform" to cover module components as
>  well?  E.g. a "AddVersionPlatform no" would only return "Server:
>  Apache/1.3.0".  

Good idea, but the name AddVersionPlatform should be changed to something
more general... maybe just AddVersion or maybe ServerHeader (like
ServerSignature, ServerName etc.)


ciao...
-- 
Lars Eilebrecht                  - Windows is a system that even a fool can use
sfx@unix-ag.org                      - and only a fool will want to use it.
http://www.home.unix-ag.org/sfx/


Re: [PATCH] Depreciate SERVER_SUBVERSION and reorder server_version

Posted by Brian Behlendorf <br...@hyperreal.org>.
At 11:25 AM 5/9/98 -0400, you wrote:
>I'd like to see a three-way option: full strings (server version with
>subversions and whatever other crap modules authors decide to add), server
>name and version only (the default), or strings at all (with a clear note
>in the documentation recommending this setting).

What if we extended "AddVersionPlatform" to cover module components as
well?  E.g. a "AddVersionPlatform no" would only return "Server:
Apache/1.3.0".  

	Brian


--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
pure chewing satisfaction                                  brian@apache.org
                                                        brian@hyperreal.org

Re: [PATCH] Depreciate SERVER_SUBVERSION and reorder server_version

Posted by Gregory A Lundberg <lu...@vr.net>.
On Sat, 9 May 1998, Jim Jagielski wrote:

> This patch totally removes the SERVER_SUBVERSION hack. This forces
> people to use ap_add_version_componant. Also, it adjusts things so
> that it appends rather than prepends the tokens to the server_version
> string. Thus, it reflects the order in which they were added. Also
> includes Paul's "make ap_get_server_version sane" fix:

Dumb question.  Can I, as a web master, easily turn off this junk without
having to hack the code?  My fear is that add-on authors will stuff
identification strings in willy-nilly and some exploit will turn up
directed at servers with that add-on.

Source code availability is NOT comfigurability.  For many of us, it's
critically important to know we are running a clean copy, with just those
add-ons we choose and WITHOUT having to keep track of local hacks.  So
here's a vote from a lurker:

-1 on all changes to support server subversions in runtime unless and
until a configuration option is added to the command line or config files
to disable transmission of the version information.

I'd like to see a three-way option: full strings (server version with
subversions and whatever other crap modules authors decide to add), server
name and version only (the default), or strings at all (with a clear note
in the documentation recommending this setting).

For those to which it's important to see the full strings when they've
been configured off, add them to the mod_info module so we can
access-restrict them.

----

Gregory A Lundberg		Senior Partner, VRnet Company
1441 Elmdale Drive              lundberg@vr.net
Kettering, OH 45409-1615 USA    1-800-809-2195


Re: [PATCH] Depreciate SERVER_SUBVERSION and reorder server_version

Posted by Brian Behlendorf <br...@hyperreal.org>.
At 10:48 AM 5/9/98 -0400, you wrote:
>This patch totally removes the SERVER_SUBVERSION hack.

Hmm, there seems to be no clear consensus on this, with patches alternating
back and forth between supporting it and not supporting it, and even people
waffling.  I think it's OK to leave it there for 1.3.0, now that it's
there; we should put in our API docs or wherever we document
SERVER_SUBVERSION that it's deprecated and expected to be removed in a
future iteration of the server, and people should use the API call.

	Brian


--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
pure chewing satisfaction                                  brian@apache.org
                                                        brian@hyperreal.org