void-packages/srcpkgs/66/patches/e14021570c3037d716a1cb5d95eb06727d1745a5.diff
2021-02-24 12:16:12 -03:00

47 lines
1.6 KiB
Diff

diff --git a/src/66/66-inservice.c b/src/66/66-inservice.c
index cfe5995e4fb861b749edca9a324f0207f26facc7..03fda5587df20e796300333c2db9d4847b1aa5b9 100644
--- a/src/66/66-inservice.c
+++ b/src/66/66-inservice.c
@@ -621,6 +621,7 @@ static void info_display_envfile(char const *field,ss_resolve_t *res)
FOREACH_SASTR(&list,pos) {
+ ssize_t upstream = 0 ;
sa.len = 0 ;
salink.len = newlen ;
if (!stralloc_cats(&salink,"/") ||
@@ -630,8 +631,25 @@ static void info_display_envfile(char const *field,ss_resolve_t *res)
if (!file_readputsa_g(&sa,salink.s))
log_dieusys(LOG_EXIT_SYS,"read environment file") ;
- if (NOFIELD) {
+ /** Remove warning message */
+ if (list.s[pos] == '.') {
+
+ char t[sa.len + 1] ;
+
+ upstream = str_contain(sa.s,"[ENDWARN]") ;
+ if (upstream == -1)
+ log_die(LOG_EXIT_SYS,"invalid upstream configuration file! Do you have modified it? Tries to enable the service again.") ;
+
+ auto_strings(t,sa.s + upstream) ;
+
+ sa.len = 0 ;
+
+ if (!auto_stra(&sa,t))
+ log_die_nomem("stralloc") ;
+ }
+
+ if (NOFIELD) {
char *m = "environment variables from: " ;
size_t mlen = strlen(m) ;
@@ -640,6 +658,7 @@ static void info_display_envfile(char const *field,ss_resolve_t *res)
if (!stralloc_inserts(&sa,0,msg) ||
!stralloc_0(&sa))
log_die_nomem("stralloc") ;
+
}
if (pos)