Skip to content

Commit

Permalink
Merge pull request #84 from kelvinfan001/kfan-fix-gensnippet-if
Browse files Browse the repository at this point in the history
gensnippet_if: Fix infinite recursive function
  • Loading branch information
kelvinfan001 authored Oct 2, 2020
2 parents 75458c0 + 75733af commit 793b02d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions usr/libexec/console-login-helper-messages/gensnippet_if
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ is_iface_backed_by_real_device() {
# Check if device has any subordinate devices that are backed by a real
# device, recursively.
for subifacedir in ${iface}/lower_*; do
# Bash still runs the loop if the wildcard does not match anything.
# Skip non-existent directories.
if [ ! -e "$subifacedir" ]; then
break
fi
subiface=$(readlink -f ${subifacedir})
if is_iface_backed_by_real_device ${subiface}; then
return 0
Expand Down

0 comments on commit 793b02d

Please sign in to comment.