httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@decus.org (Rodent of Unusual Size)
Subject Bug #17: mod_info not displaying current config
Date Fri, 10 Jan 1997 20:51:22 GMT
>>Number:         17
>>Category:       mod_info
>>Synopsis:       mod_info output is not displaying current configuration.
>>Severity:       critical
>>Priority:       medium
>>State:          open
>>Arrival-Date:   Tue Oct  8 20:47:26 1996
>>Originator:     rasmus@bellglobal.com
>>Release:        1.2-dev
>>Description:
>The mod_info output from the Apache site is a bit odd.  None of the
>current configuration output is showing up.  If you have a look at the
>Apache site version and compare it to www.vex.net/info you will see
>what I mean.

    I was easily able to reproduce this here - if I protected the
    configuration files against the user the server was running as.  All
    of the `current configuration' fields were empty.  As soon as I
    opened up the config files so they could be read, the display
    started reflecting their contents.

    Could someone check to see if the config files at www.apache.org are
    readable by the server user?  I don't know what location has been
    enabled for the info display at that server, so I can't see if it's
    still exhibiting the problem.  If it is, maybe unprotecting the
    files and looking again will show the problem fixed..  If it does, I
    suspect this bug can be marked `closed.'

    FWIW, since the protection issue can cause the display to fail
    silently (leading to bug reports ;-), here's a patch to mod_info.c
    that will at least record the server's failure to open the file(s)
    in the error log.

    #ken    :-)}

Index: mod_info.c
===================================================================
RCS file: /usr/users/coar/myApache/repository/apache/src/mod_info.c,v
retrieving revision 1.8
diff -c -r1.8 mod_info.c
*** 1.8	1997/01/01 18:10:35
--- mod_info.c	1997/01/10 20:49:20
***************
*** 103,116 ****
  	return(ret);
  }
  
! mod_info_config_lines *mod_info_load_config(pool *p, char *filename) {
  	char s[MAX_STRING_LEN];
  	FILE *fp;
  	mod_info_config_lines *new, *ret=NULL, *prev=NULL;
! 	char *t,*tt,o;
  	
  	fp = pfopen(p,filename,"r");
! 	if(!fp) return NULL;
  	while(!cfg_getline(s,MAX_STRING_LEN,fp)) {
  		if(*s=='#') continue; /* skip comments */
  		new = palloc(p,sizeof(struct mod_info_config_lines));
--- 103,126 ----
  	return(ret);
  }
  
! mod_info_config_lines *mod_info_load_config(pool *p, char *filename, request_rec *r) {
  	char s[MAX_STRING_LEN];
  	FILE *fp;
  	mod_info_config_lines *new, *ret=NULL, *prev=NULL;
! 	char *t,*tt,o, *msg;
  	
  	fp = pfopen(p,filename,"r");
! 	if(!fp) {
! 	    msg = pstrcat
! 		    (
! 			r->pool,
! 			"mod_info: couldn't open config file ",
! 			filename,
! 			NULL
! 		    );
! 	    log_error (msg, r->server);
! 	    return NULL;
! 	}
  	while(!cfg_getline(s,MAX_STRING_LEN,fp)) {
  		if(*s=='#') continue; /* skip comments */
  		new = palloc(p,sizeof(struct mod_info_config_lines));
***************
*** 268,278 ****
  	rputs("<body><h1 align=center>Apache Server Information</h1>\n",r);
  	if(!r->args || strcasecmp(r->args,"list")) {
  		sprintf(buf,"%s/%s",server_root,server_confname);
! 		mod_info_cfg_httpd = mod_info_load_config(r->pool,buf);
  		sprintf(buf,"%s/%s",server_root,serv->srm_confname);
! 		mod_info_cfg_srm = mod_info_load_config(r->pool,buf);
  		sprintf(buf,"%s/%s",server_root,serv->access_confname);
! 		mod_info_cfg_access = mod_info_load_config(r->pool,buf);
  		if(!r->args) {
  			rputs("<tt><a href=\"#server\">Server Settings</a>, ",r);
  			for(modp = top_module; modp; modp = modp->next) {
--- 278,288 ----
  	rputs("<body><h1 align=center>Apache Server Information</h1>\n",r);
  	if(!r->args || strcasecmp(r->args,"list")) {
  		sprintf(buf,"%s/%s",server_root,server_confname);
! 		mod_info_cfg_httpd = mod_info_load_config(r->pool,buf, r);
  		sprintf(buf,"%s/%s",server_root,serv->srm_confname);
! 		mod_info_cfg_srm = mod_info_load_config(r->pool,buf, r);
  		sprintf(buf,"%s/%s",server_root,serv->access_confname);
! 		mod_info_cfg_access = mod_info_load_config(r->pool,buf, r);
  		if(!r->args) {
  			rputs("<tt><a href=\"#server\">Server Settings</a>, ",r);
  			for(modp = top_module; modp; modp = modp->next) {

Mime
View raw message