105 if(cfgmgr_load_config(&mgr) != 0) { |
106 if(cfgmgr_load_config(&mgr) != 0) { |
106 return -1; |
107 return -1; |
107 } |
108 } |
108 log_ereport(LOG_VERBOSE, "cfgmgr_load_config stage 1 successful"); |
109 log_ereport(LOG_VERBOSE, "cfgmgr_load_config stage 1 successful"); |
109 ServerConfiguration *cfg = mgr.cfg; |
110 ServerConfiguration *cfg = mgr.cfg; |
110 |
|
111 // init caches |
|
112 auth_cache_init(); |
|
113 |
|
114 // init SAFs |
|
115 common_saf_init(); |
|
116 |
111 |
117 // set global vars |
112 // set global vars |
118 conf_global_vars_s *vars = conf_getglobals(); |
113 conf_global_vars_s *vars = conf_getglobals(); |
119 |
114 |
120 WSBool changeuid = FALSE; |
115 WSBool changeuid = FALSE; |
175 } else if(vars->Vuserpw) { |
170 } else if(vars->Vuserpw) { |
176 log_ereport( |
171 log_ereport( |
177 LOG_WARN, |
172 LOG_WARN, |
178 "server must be started as root to change uid"); |
173 "server must be started as root to change uid"); |
179 } |
174 } |
|
175 |
|
176 // run Init directives |
|
177 // this must be done after setuid |
|
178 int err = apply_init_conf(init_config); |
|
179 free_init_conf(init_config); |
|
180 if(err) { |
|
181 log_ereport(LOG_FAILURE, "server init failed"); |
|
182 return 1; |
|
183 } |
|
184 |
|
185 // init caches |
|
186 auth_cache_init(); |
|
187 |
|
188 // init SAFs |
|
189 common_saf_init(); |
180 |
190 |
181 |
191 |
182 // now that the process is running as the correct user, we can load |
192 // now that the process is running as the correct user, we can load |
183 // the remaining config |
193 // the remaining config |
184 if(cfgmgr_apply_config(&mgr)) { |
194 if(cfgmgr_apply_config(&mgr)) { |