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

Allow empty module.

Permit to set uid and gid for a run script.
Unknown key may occur at end of the file.
Avoid to changed pointer.
Typo fix.
parent c898b1af
No related branches found
No related tags found
No related merge requests found
${LIB66}
-loblibs
-lskarnet
......@@ -196,12 +196,12 @@ extern char const *usage_scandir_wrapper ;
extern char const *help_scandir_wrapper ;
extern char const *usage_scandir_create ;
extern char const *help_scandir_create ;
extern char const *usage_scandir_remove ;
extern char const *help_scandir_remove ;
extern char const *usage_scandir_start ;
extern char const *help_scandir_start ;
extern char const *usage_scandir_stop ;
extern char const *help_scandir_stop ;
extern char const *usage_scandir_remove ;
extern char const *help_scandir_remove ;
extern char const *usage_scandir_reconfigure ;
extern char const *help_scandir_reconfigure ;
extern char const *usage_scandir_check ;
......
......@@ -41,7 +41,8 @@ static void service_db_tree(resolve_service_t *old, resolve_service_t *new, ssex
if (!stack_string_clean(&sold, ocontents))
log_dieusys(LOG_EXIT_SYS, "convert string") ;
{
if (new->dependencies.ncontents) {
size_t nlen = strlen(ncontents) ;
_alloc_stk_(snew, nlen + 1) ;
......
......@@ -133,8 +133,8 @@ lexer_config LEXER_CONFIG_KEY = { \
.slen = 0,\
.open = "@",\
.olen = 1,\
.close = "=",\
.clen = 1,\
.close = "=\n",\
.clen = 2,\
.skip = " \t\r",\
.skiplen = 3,\
.kopen = 1,\
......
......@@ -55,8 +55,8 @@ void sanitize_graph(ssexec_t *info)
sa.len = 0 ;
wres = resolve_set_struct(DATA_SERVICE, &c->res) ;
char *name = c->res.sa.s + c->res.name ;
char name[strlen(c->res.sa.s + c->res.name) + 1] ;
auto_strings(name, c->res.sa.s + c->res.name) ;
if (graph_matrix_get_edge_g_sa(&sa, &graph, name, 0, 0) < 0)
log_dieu(LOG_EXIT_SYS, "get dependencies of service: ", name) ;
......
......@@ -53,7 +53,12 @@ static int sanitize_livestate_directory(resolve_service_t *res)
if (!r) {
log_trace("create directory: ", ste) ;
r = dir_create_parent(ste, 0700) ;
/** Permissions is set to 0755 to be able
* to launch services dropping privilegies
* before executing the run.user script.
* Setting 0700 do not allow other users
* to execute the script. */
r = dir_create_parent(ste, 0755) ;
if (!r)
log_warnusys_return(LOG_EXIT_ZERO, "create directory: ", ste) ;
......
......@@ -82,7 +82,7 @@ void service_graph_build(graph_t *g, struct resolve_hash_s **hres, uint32_t flag
continue ;
if (ste.issupervised == STATE_FLAGS_FALSE && FLAGS_ISSET(flag, STATE_FLAGS_ISSUPERVISED)) {
log_warn("service: ", service, " not available -- ignore it") ;
log_warn("requested flags issupervised where service ", service, " is not -- ignoring it") ;
continue ;
}
......
......@@ -43,11 +43,12 @@ void service_graph_collect(graph_t *g, char const *slist, size_t slen, struct re
ss_state_t ste = STATE_ZERO ;
resolve_wrapper_t_ref wres = 0 ;
struct resolve_hash_s *hash = 0 ;
for (; pos < slen ; pos += strlen(slist + pos) + 1) {
char const *name = slist + pos ;
struct resolve_hash_s *hash = hash_search(hres, name) ;
hash = hash_search(hres, name) ;
if (hash == NULL) {
......
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