On Mon, Sep 6, 2021 at 3:10 PM Coiby Xu <coxu(a)redhat.com> wrote:
On Thu, Aug 19, 2021 at 07:39:18PM +0800, Kairui Song wrote:
>Iterating over ls output is fragile:
>https://github.com/koalaman/shellcheck/wiki/SC2045
>
>Signed-off-by: Kairui Song <kasong(a)redhat.com>
>---
> dracut-module-setup.sh | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
>diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
>index c681413c..ef3c809d 100755
>--- a/dracut-module-setup.sh
>+++ b/dracut-module-setup.sh
>@@ -353,7 +353,8 @@ kdump_setup_ifname() {
> kdump_setup_bridge() {
> local _netdev=$1
> local _brif _dev _mac _kdumpdev
>- for _dev in `ls /sys/class/net/$_netdev/brif/`; do
>+ for _dev in "/sys/class/net/$_netdev/brif/"*; do
>+ [[ -e $_dev ]] || continue
This fix brings a regression. $_dev is supposed to be a network interface
name. However, $_dev now becomes
/sys/class/net/$_netdev/brif/{interface_name}
which would lead to the failure of setting up bridge network.
Thanks, I'll fix it.
> _kdumpdev=$_dev
> if kdump_is_bond "$_dev"; then
> $(kdump_setup_bond "$_dev"
"$(get_nmcli_connection_show_cmd_by_ifname "$_dev")")
>--
>2.31.1
>_______________________________________________
>kexec mailing list -- kexec(a)lists.fedoraproject.org
>To unsubscribe send an email to kexec-leave(a)lists.fedoraproject.org
>Fedora Code of Conduct:
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
>List Guidelines:
https://fedoraproject.org/wiki/Mailing_list_guidelines
>List Archives:
https://lists.fedoraproject.org/archives/list/kexec@lists.fedoraproject.org
>Do not reply to spam on the list, report it:
https://pagure.io/fedora-infrastructure
--
Best regards,
Coiby
--
Best Regards,
Kairui Song