Skip to content

Commit ecc8bda

Browse files
committed
makefiles: hide security warnings for info targets
Security warnings (telnet, stdio_udp, psa_crypto) were displayed even for info-* targets, polluting the output and breaking tools that parse make output (e.g., compile_and_test_for_board.py). These warnings are only relevant when actually building/running code, not when querying build system information. Signed-off-by: Gilles DOFFE <[email protected]>
1 parent 02786f1 commit ecc8bda

File tree

1 file changed

+31
-28
lines changed

1 file changed

+31
-28
lines changed

makefiles/dependency_resolution.inc.mk

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -94,37 +94,40 @@ else
9494
$(error "The following non-existing features are listed in FEATURES_OPTIONAL: $(FEATURES_NONEXISTING)")
9595
endif
9696

97-
# Warn about telnet
98-
ifneq (,$(filter auto_init_telnet,$(USEMODULE)))
99-
ifneq (1,$(I_UNDERSTAND_THAT_TELNET_IS_INSECURE))
100-
$(shell $(COLOR_ECHO) "$(COLOR_RED)Telnet will be started automatically, "\
101-
"make sure you understand why this almost certainly "\
102-
"is a REALLY BAD idea before proceeding!$(COLOR_RESET)" 1>&2)
103-
$(error I_UNDERSTAND_THAT_TELNET_IS_INSECURE must be set to 1 to proceed)
104-
else
105-
$(shell $(COLOR_ECHO) "$(COLOR_YELLOW)Telnet will be started automatically,"\
106-
"don't run this on public networks!$(COLOR_RESET)" 1>&2)
97+
# Don't show warnings for info targets
98+
ifeq (,$(filter info-%,$(MAKECMDGOALS)))
99+
# Warn about telnet
100+
ifneq (,$(filter auto_init_telnet,$(USEMODULE)))
101+
ifneq (1,$(I_UNDERSTAND_THAT_TELNET_IS_INSECURE))
102+
$(shell $(COLOR_ECHO) "$(COLOR_RED)Telnet will be started automatically, "\
103+
"make sure you understand why this almost certainly "\
104+
"is a REALLY BAD idea before proceeding!$(COLOR_RESET)" 1>&2)
105+
$(error I_UNDERSTAND_THAT_TELNET_IS_INSECURE must be set to 1 to proceed)
106+
else
107+
$(shell $(COLOR_ECHO) "$(COLOR_YELLOW)Telnet will be started automatically,"\
108+
"don't run this on public networks!$(COLOR_RESET)" 1>&2)
109+
endif
107110
endif
108-
endif
109111

110-
# Warn about STDIO UDP
111-
ifneq (,$(filter stdio_udp,$(USEMODULE)))
112-
ifneq (1,$(I_UNDERSTAND_THAT_STDIO_UDP_IS_INSECURE))
113-
$(shell $(COLOR_ECHO) "$(COLOR_RED)stdio via UDP will be started automatically,"\
114-
"make sure you understand why this almost certainly"\
115-
"is a REALLY BAD idea before proceeding!$(COLOR_RESET)" 1>&2)
116-
$(error I_UNDERSTAND_THAT_STDIO_UDP_IS_INSECURE must be set to 1 to proceed)
117-
else
118-
$(shell $(COLOR_ECHO) "$(COLOR_YELLOW)stdio via UDP will be started automatically,"\
119-
"don't run this on public networks!$(COLOR_RESET)" 1>&2)
112+
# Warn about STDIO UDP
113+
ifneq (,$(filter stdio_udp,$(USEMODULE)))
114+
ifneq (1,$(I_UNDERSTAND_THAT_STDIO_UDP_IS_INSECURE))
115+
$(shell $(COLOR_ECHO) "$(COLOR_RED)stdio via UDP will be started automatically,"\
116+
"make sure you understand why this almost certainly"\
117+
"is a REALLY BAD idea before proceeding!$(COLOR_RESET)" 1>&2)
118+
$(error I_UNDERSTAND_THAT_STDIO_UDP_IS_INSECURE must be set to 1 to proceed)
119+
else
120+
$(shell $(COLOR_ECHO) "$(COLOR_YELLOW)stdio via UDP will be started automatically,"\
121+
"don't run this on public networks!$(COLOR_RESET)" 1>&2)
122+
endif
120123
endif
121-
endif
122124

123-
# Warn about PSA Crypto
124-
ifneq (,$(filter psa_crypto,$(USEMODULE)))
125-
$(shell $(COLOR_ECHO) "$(COLOR_YELLOW) You are going to use the PSA Crypto module,"\
126-
"which is only partly implemented and not yet thouroughly tested.\n"\
127-
"Please do not use this module in production, as it may introduce"\
128-
"security issues!$(COLOR_RESET)" 1>&2)
125+
# Warn about PSA Crypto
126+
ifneq (,$(filter psa_crypto,$(USEMODULE)))
127+
$(shell $(COLOR_ECHO) "$(COLOR_YELLOW) You are going to use the PSA Crypto module,"\
128+
"which is only partly implemented and not yet thouroughly tested.\n"\
129+
"Please do not use this module in production, as it may introduce"\
130+
"security issues!$(COLOR_RESET)" 1>&2)
131+
endif
129132
endif
130133
endif

0 commit comments

Comments
 (0)