Bug 2056529

Summary: Dracut module installation fails due to nullglob being set
Product: Red Hat Enterprise Linux 9 Reporter: Michal Hečko <mhecko>
Component: prefixdevnameAssignee: Michal Sekletar <msekleta>
Status: NEW --- QA Contact: qe-baseos-daemons
Severity: medium Docs Contact:
Priority: unspecified    
Version: 9.0CC: pvalena
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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