Skip to content

fix(dracut-functions.sh): do not attempt to install zero-size library files - #2442

Open
aafeijoo-suse wants to merge 2 commits into
dracut-ng:mainfrom
aafeijoo-suse:fix-2441
Open

fix(dracut-functions.sh): do not attempt to install zero-size library files#2442
aafeijoo-suse wants to merge 2 commits into
dracut-ng:mainfrom
aafeijoo-suse:fix-2441

Conversation

@aafeijoo-suse

Copy link
Copy Markdown
Contributor

It should fix #2441

Checklist

  • I have tested it locally
  • I have reviewed and updated any documentation if relevant
  • I am providing new code and test(s) for it

@bdrung bdrung left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks good to me. Can you extent the first commit with some more details/reasoning from the PR and linked bug?

… files

dracut-install calls `mmap()` in `resolve_deps()`, and that function fails with
EINVAL if the second argument `length` is zero (i.e., the file size). There
should be no library file with zero bytes, but this actually happened due to
some RPM stray files and a less restrictive pattern passed to
`inst_libdir_file()`, so extend the condition to additionally check whether the
library files contain data.

Fixes dracut-ng#2441
These files have the suffix `;%08x`, i.e., semicolon followed by 8 hexadecimal
characters.
Comment thread dracut-functions.sh
for _dir in $libdirs; do
for _i in "$@"; do
for _f in "${dracutsysrootdir-}$_dir"/$_i; do
# Filter temporary RPM files

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this an issue only with RPM ?

It is sad that dracut needs to have knowledge about the underlaying host package manager.

Is this file format/pattern for temp RPM files documented somewhere that we can reference here ?

@devkontrol

Copy link
Copy Markdown
Collaborator

Could this be handled in a config file for RPM based distros with --remove option - as a compromise ?

I am not strongly against the idea, but I do wonder if dracut is the best place to deal with this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dracut failed due to stray files like /usr/lib64/libnss_myhostname.so.2;69c039c9

3 participants