httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jos Ewert <fl...@flami.net>
Subject config is not read correctly
Date Sat, 15 Nov 2008 23:51:44 GMT
Hi,

Im trying to modify mod_fcgid to suit my needs, but I have a problem with 
reading my newly added config directive.
For some reason it sets the config in my setter right but in the getter it 
always reads the default value.

Whats even stranger is that I used this with mod_fcgid 1.10 too and it works.

e.g. 
set :
&config : 7092232, &config->homedir : 7101472 
get:
&config : 7100440, &config->homedir : 7845640

to set the value I use:

##########
 const char *set_homedir(cmd_parms *cmd, void *dirconfig, 
                                   const char *uid, const char *gid) 
 { 
       
       server_rec *s = cmd->server; 
       fcgid_server_conf *config =  
                         ap_get_module_config(s->module_config, &fcgid_module); 
         
       struct passwd *pw; 
       if((pw = getpwuid(ap_uname2id(uid))) == NULL){ 
	fprintf(stderr, 
              "Critical Error: You have specified an invalid user in 
SuexecUserGroup.\n"); 
	exit(1); 
       } else { 
       config->homedir = strdup(pw->pw_dir);
       return NULL; 
       } 
 }  
#########

To get the config:
###########

char *get_homedir(request_rec * r) 
 { 
       server_rec *s = r->server; 	
       fcgid_server_conf *config = 
			 ap_get_module_config(s->module_config, &fcgid_module); 
       return config->homedir;
 }  

###########
I removed all the debugging stuff I added to make it more readable.

if you want to take a look at the whole file + the other 2 I modified:
http://pastebin.com/f4c834a94


Any ideas what could have gone wrong? 

Greetings,
Josi

Mime
View raw message