aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCy Schubert <cy@FreeBSD.org>2022-12-14 21:41:10 +0000
committerCy Schubert <cy@FreeBSD.org>2023-02-01 02:55:19 +0000
commit3512eda8e078d1ca49f6c3ec74eb78d6f373b66b (patch)
tree7a3f4afcfe4743fa148498dc981b7bcee433003f
parent82de173cbc81a09191ac23a2b2e2df3d83dd55ef (diff)
downloadsrc-3512eda8e078d1ca49f6c3ec74eb78d6f373b66b.tar.gz
src-3512eda8e078d1ca49f6c3ec74eb78d6f373b66b.zip
network.subr: Fix infinite loop
When setting up carp tunnel, using a password consisting of only the characters used as hexadecimal characters, i.e. abc-def, there will be an infinite loop in the shell function ifalias_af_common_handler(). To circumvent this we test for " pass ". PR: 268378 Reported by: jyoung15@gmail.com Differential Revision: https://reviews.freebsd.org/D37748 (cherry picked from commit e3e57edf4aac05d041ca55ff2f008c6109ef88d5)
-rw-r--r--libexec/rc/network.subr3
1 files changed, 3 insertions, 0 deletions
diff --git a/libexec/rc/network.subr b/libexec/rc/network.subr
index 793784f8c927..ada4b8d138cc 100644
--- a/libexec/rc/network.subr
+++ b/libexec/rc/network.subr
@@ -1048,6 +1048,9 @@ ifalias_af_common_handler()
# Process the last component if any.
if [ -n "${_tmpargs}" ]; then
case $_tmpargs in
+ ${_af}[[:space:]]pass[[:space:]]*)
+ ${IFCONFIG_CMD} $_if $_tmpargs $_action && _ret=0
+ ;;
${_af}[[:space:]]*[0-9a-fA-F]-*)
ifalias_af_common_handler $_if $_af $_action \
`ifalias_expand_addr $_af $_action ${_tmpargs#${_af}[[:space:]]}`