Bug 2056529 - Dracut module installation fails due to nullglob being set
Summary: Dracut module installation fails due to nullglob being set
Keywords:
Status: NEW
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: prefixdevname
Version: 9.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: ---
Assignee: Michal Sekletar
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-02-21 13:23 UTC by Michal Hečko
Modified: 2023-07-22 07:29 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-112921 0 None None None 2022-02-21 13:37:04 UTC

Description Michal Hečko 2022-02-21 13:23:31 UTC
Description of problem:

The dracut installation script does not set the expected value of `nullglob`. If the shell option is set and not correctly cleaned by any of the scripts executed by dracut, the installation of the `prefixdevname` module might fail. The failure can be observed given that the /etc/systemd/network does not exists, which causes the glob expression to be expanded to a null string, and thus no arguments are passed to the `inst_multiple` call.  

Steps to Reproduce:
1. Make sure the /etc/systemd/network does not exists
2. Use `shopt -s nullglob` in one of the /usr/lib/dracut/modules.d/ scripts that are executed before `prefixdevname`, simulating that the nullglob is set and not cleaned afterwards. 
3. Run `dracut -f`

Actual results:
```
dracut-install: No SOURCE argument given
Usage: dracut-install -D DESTROOTDIR [-r SYSROOTDIR] [OPTION]... -a SOURCE...
```

Expected results:
No failure reported.

Additional info:
The `shopt -s nullglob` leak will might happen due to a specific system setup in which the `10i18n` calls the `findkeymap` function recursively. Bugzilla reporting this problem to the dracut team:
- https://bugzilla.redhat.com/show_bug.cgi?id=2047654

I've already submitted a patch fixing this behaviour: 
- https://github.com/msekletar/prefixdevname/pull/1/files

Comment 1 Pavel Valena 2022-11-23 11:03:03 UTC
This should be resolved in dracut: https://github.com/dracutdevs/dracut/pull/1762


Note You need to log in before you can comment on or make changes to this bug.