diff --git a/src/lib66/ssexec_disable.c b/src/lib66/ssexec_disable.c index 9b1d92abca26c3fcaa652ea6a8741d89e8f5217f..6284d4a7df0ded9523a09d74a7d62e8b61d23892 100644 --- a/src/lib66/ssexec_disable.c +++ b/src/lib66/ssexec_disable.c @@ -59,7 +59,7 @@ int svc_remove(genalloc *tostop,ss_resolve_t *res, char const *src,ssexec_t *inf { if (!stralloc_cats(&dst,SS_SVC)) goto err ; } - else if (!stralloc_cats(&dst,SS_DB SS_SRC)) retstralloc(0,"remove_sv") ; + else if (!stralloc_cats(&dst,SS_DB SS_SRC)) goto err ; if (!stralloc_cats(&dst,"/")) goto err ; newlen = dst.len ; diff --git a/src/lib66/ssexec_init.c b/src/lib66/ssexec_init.c index ed8fb77f8c7b77d871a2bed79d68b84bb9529eec..65c32f657c569ae50f1beb25aedbbe499bb817cb 100644 --- a/src/lib66/ssexec_init.c +++ b/src/lib66/ssexec_init.c @@ -80,13 +80,12 @@ int ssexec_init(int argc, char const *const *argv,char const *const *envp,ssexec } size_t dirlen ; - size_t svdirlen ; char svdir[info->tree.len + SS_SVDIRS_LEN + SS_SVC_LEN + 1] ; memcpy(svdir,info->tree.s,info->tree.len) ; memcpy(svdir + info->tree.len ,SS_SVDIRS ,SS_SVDIRS_LEN) ; - svdirlen = info->tree.len + SS_SVDIRS_LEN ; - memcpy(svdir + svdirlen, SS_SVC ,SS_SVC_LEN) ; - svdir[svdirlen + SS_SVC_LEN] = 0 ; + memcpy(svdir + info->tree.len + SS_SVDIRS_LEN, SS_SVC ,SS_SVC_LEN) ; + dirlen = info->tree.len + SS_SVDIRS_LEN + SS_SVC_LEN ; + svdir[dirlen] = 0 ; /** svc already initiated? */ if (classic) @@ -122,18 +121,17 @@ int ssexec_init(int argc, char const *const *argv,char const *const *envp,ssexec else { if (!ss_resolve_create_live(info)) strerr_diefu1sys(111,"create live state") ; - dirlen = strlen(svdir) ; for (i = 0 ; i < genalloc_len(ss_resolve_t,&gares) ; i++) { char *string = genalloc_s(ss_resolve_t,&gares)[i].sa.s ; char *name = string + genalloc_s(ss_resolve_t,&gares)[i].name ; - size_t namelen = gaistrlen(&gasvc,i) ; + size_t namelen = strlen(name) ; char tocopy[dirlen + 1 + namelen + 1] ; memcpy(tocopy,svdir,dirlen) ; tocopy[dirlen] = '/' ; memcpy(tocopy + dirlen + 1, name, namelen) ; tocopy[dirlen + 1 + namelen] = 0 ; - if (!hiercopy(tocopy,string + genalloc_s(ss_resolve_t,&gares)[i].runat)) strerr_diefu4sys(111,"to copy: ",tocopy," to: ",string + genalloc_s(ss_resolve_t,&gares)[i].runat) ; + if (!hiercopy(tocopy,string + genalloc_s(ss_resolve_t,&gares)[i].runat)) strerr_diefu4sys(111,"copy: ",tocopy," to: ",string + genalloc_s(ss_resolve_t,&gares)[i].runat) ; ss_state_setflag(&sta,SS_FLAGS_RELOAD,SS_FLAGS_FALSE) ; ss_state_setflag(&sta,SS_FLAGS_INIT,SS_FLAGS_FALSE) ; ss_state_setflag(&sta,SS_FLAGS_UNSUPERVISE,SS_FLAGS_FALSE) ;