Received: by taz.hyperreal.com (8.8.3/V2.0) id VAA09969; Sat, 11 Jan 1997 21:59:09 -0800 (PST) Received: from Master by taz.hyperreal.com (8.8.3/V2.0) with SMTP id VAA09965; Sat, 11 Jan 1997 21:59:06 -0800 (PST) Date: Sun, 12 Jan 1997 00:40:22 -0500 Message-Id: <97011200402242@decus.org> From: coar@decus.org (Rodent of Unusual Size) To: new-httpd@hyperreal.com, Coar@topaz.decus.org Subject: Re: Bug #17: mod_info not displaying current config X-VMS-To: SMTP%"new-httpd@hyperreal.com" X-VMS-Cc: COAR Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@hyperreal.com >From the fingers of Brian Behlendorf flowed the following: > >On Fri, 10 Jan 1997, Rodent of Unusual Size wrote: >> >> 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.' > >Nope, the config files on www.apache.org are world-readable, and the info >output is still blank. < http://www.apache.org/serv-info > Hah, *squish*! mod_info.c is making the assumption that the config files are relative to ServerRoot. Looking at the /serv-info, it's clear that www.apache.org's server is started with -f and an absolute pathname. Hence, breakage. The previous patch would have revealed this, BTW, because it would have recorded the attempt to access the bogus file ("$ServerRoot/$ServerConfigFile") in the error log. A slight change to use the standard logic for this, and it appears to be working now. I'm still including the changes that log mod_info's failure to find/open the config files. #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/12 05:34:39 *************** *** 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)); *************** *** 234,240 **** int display_info(request_rec *r) { module *modp = NULL; ! char buf[256]; command_rec *cmd=NULL; handler_rec *hand=NULL; server_rec *serv = r->server; --- 244,250 ---- int display_info(request_rec *r) { module *modp = NULL; ! char buf[256], *cfname; command_rec *cmd=NULL; handler_rec *hand=NULL; server_rec *serv = r->server; *************** *** 267,278 **** rputs("Server Information\n",r); rputs("

Apache Server Information

\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("Server Settings, ",r); for(modp = top_module; modp; modp = modp->next) { --- 277,288 ---- rputs("Server Information\n",r); rputs("

Apache Server Information

\n",r); if(!r->args || strcasecmp(r->args,"list")) { ! cfname = server_root_relative (r->pool, server_confname); ! mod_info_cfg_httpd = mod_info_load_config (r->pool, cfname, r); ! cfname = server_root_relative (r->pool, serv->srm_confname); ! mod_info_cfg_srm = mod_info_load_config(r->pool, cfname, r); ! cfname = server_root_relative (r->pool, serv->access_confname); ! mod_info_cfg_access = mod_info_load_config (r->pool, cfname, r); if(!r->args) { rputs("Server Settings, ",r); for(modp = top_module; modp; modp = modp->next) {