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

deny to parse or reconfigure a service

that is a part of a module
parent b0cb3921
No related branches found
No related tags found
No related merge requests found
......@@ -34,6 +34,7 @@ int ssexec_parse(int argc, char const *const *argv, ssexec_t *info)
{
log_flow() ;
int r = 0 ;
uint8_t force = 0 , conf = 0 ;
stralloc sa = STRALLOC_ZERO ;
......@@ -107,6 +108,15 @@ int ssexec_parse(int argc, char const *const *argv, ssexec_t *info)
name_isvalid(sv) ;
r = str_contain(sv, ":") ;
if (r >= 0) {
size_t len = strlen(sv) ;
_alloc_stk_(stk, len + 1) ;
stack_add(&stk, sv, len - (--r)) ; // do not check output here, we are dying anyway
stack_close(&stk) ;
log_die(LOG_EXIT_USER, "parsing an individual service that is part of a module is not allowed -- please parse the entire module instead using \'66 parse ", stk.s, "\'") ;
}
if (!service_frontend_path(&sa, sv, info->owner, directory_forced, exclude, exlen))
log_dieu(LOG_EXIT_USER, "find service frontend file of: ", sv) ;
......
......@@ -97,6 +97,9 @@ int ssexec_reconfigure(int argc, char const *const *argv, ssexec_t *info)
log_dieu(LOG_EXIT_USER, "find service: ", argv[n], " -- did you parse it?") ;
pres = &hash->res ;
if (pres->inns)
log_die(LOG_EXIT_USER, "reconfiguring an individual service that is part of a module is not allowed -- please reconfigure the entire module instead using \'66 reconfigure ", pres->sa.s + pres->inns, "\'") ;
char status[strlen(pres->sa.s + pres->path.servicedir) + SS_STATE_LEN + 1] ;
auto_strings(status, pres->sa.s + pres->path.servicedir, SS_STATE) ;
......
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