Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore processing variable files with unsupported encoding (RhBug:2141215) #1860

Merged
merged 1 commit into from Nov 28, 2022

Conversation

jan-kolarik
Copy link
Member

This issue could be seen for example when there are some temporary files stored by text editors in the /etc/dnf/vars folder. These files could be in the binary format and causes UnicodeDecodeError exception to be thrown during processing of the var files.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2141215.

@jan-kolarik
Copy link
Member Author

jan-kolarik commented Nov 9, 2022

I was just checking this behavior for dnf5 and it seems the current implementation has no problem parsing variable files binary content into char buffers, so it is not crashing there. Here is the related code portion.

@j-mracek j-mracek self-assigned this Nov 16, 2022
dnf/conf/substitutions.py Outdated Show resolved Hide resolved
@lgtm-com
Copy link

lgtm-com bot commented Nov 21, 2022

This pull request fixes 2 alerts when merging 882e0c2 into 45a06f9 - view on LGTM.com

fixed alerts:

  • 2 for Unused import

Heads-up: LGTM.com's PR analysis will be disabled on the 5th of December, and LGTM.com will be shut down ⏻ completely on the 16th of December 2022. Please enable GitHub code scanning, which uses the same CodeQL engine ⚙️ that powers LGTM.com. For more information, please check out our post on the GitHub blog.

dnf/conf/substitutions.py Outdated Show resolved Hide resolved
dnf/conf/substitutions.py Outdated Show resolved Hide resolved
…1215)

This issue could be seen for example when there are some temporary files stored by text editors in the `/etc/dnf/vars` folder. These files could be in the binary format and causes `UnicodeDecodeError` exception to be thrown during processing of the var files.

= changelog =
type: bugfix
resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2141215
@lgtm-com
Copy link

lgtm-com bot commented Nov 23, 2022

This pull request fixes 2 alerts when merging d95afd9 into 855af7c - view on LGTM.com

fixed alerts:

  • 2 for Unused import

Heads-up: LGTM.com's PR analysis will be disabled on the 5th of December, and LGTM.com will be shut down ⏻ completely on the 16th of December 2022. Please enable GitHub code scanning, which uses the same CodeQL engine ⚙️ that powers LGTM.com. For more information, please check out our post on the GitHub blog.

@j-mracek
Copy link
Member

LGTM

@j-mracek j-mracek merged commit e2fbdc6 into master Nov 28, 2022
@j-mracek j-mracek deleted the jkolarik/vars-parsing-fix branch November 28, 2022 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants