Skip to content
Snippets Groups Projects
Commit b6bb2241 authored by Eric Vidal's avatar Eric Vidal :speech_balloon:
Browse files

automatically add the env @options if the [environment] is set

parent 07fb0762
No related branches found
No related tags found
No related merge requests found
...@@ -841,6 +841,26 @@ int keep_environ(sv_alltype *service,keynocheck *nocheck) ...@@ -841,6 +841,26 @@ int keep_environ(sv_alltype *service,keynocheck *nocheck)
log_warnu_return(LOG_EXIT_ZERO,"clean environment value") ; log_warnu_return(LOG_EXIT_ZERO,"clean environment value") ;
if (!auto_stra(&service->saenv,nocheck->val.s)) if (!auto_stra(&service->saenv,nocheck->val.s))
log_warnu_return(LOG_EXIT_ZERO,"store environment value") ; log_warnu_return(LOG_EXIT_ZERO,"store environment value") ;
{
/** The declaration of the [environment] automatically add
* the @options=(env) */
if (!service->opts[2]) {
stralloc saconf = STRALLOC_ZERO ;
if (!env_resolve_conf(&saconf,keep.s + service->cname.name,MYUID)) {
stralloc_free(&saconf) ;
return 0 ;
}
service->srconf = keep.len ;
if (!stralloc_catb(&keep,saconf.s,saconf.len + 1)) {
stralloc_free(&saconf) ;
return 0 ;
}
service->opts[2] = 1 ;
stralloc_free(&saconf) ;
}
}
;
break ; break ;
default: log_warn_return(LOG_EXIT_ZERO,"unknown key: ",get_key_by_enum(ENUM_KEY_SECTION_ENVIRON,nocheck->idkey)) ; default: log_warn_return(LOG_EXIT_ZERO,"unknown key: ",get_key_by_enum(ENUM_KEY_SECTION_ENVIRON,nocheck->idkey)) ;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment