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

Strict variable checking #65

Closed
mobileoverlord opened this issue Jul 7, 2017 · 1 comment
Closed

Strict variable checking #65

mobileoverlord opened this issue Jul 7, 2017 · 1 comment

Comments

@mobileoverlord
Copy link
Collaborator

While updating an fwup.conf file I was renaming variables and missed some. When it tried to execute complete task, it failed with misleading error messages. Fwup should warn / error on unset variables.

@fhunleth
Copy link
Collaborator

fhunleth commented Jul 8, 2017

Fwup can't warn on unset variables, or at least I'm pretty sure that it can't, since the variable lookup is done by libconfuse. Fwup can detect empty strings for parameters, though, and I think that will catch what happened to you. I thought that I handled this case, but it turned out that if you had a variable as a parameter and it was undefined that an empty string was passed. strtoull happily returned 0 instead of reporting an error. I added a check to fail on empty strings. The error message is not as helpful as it could be, but you'll get an invalid argument error with the right line number. That should be a big improvement over succeeding and accidentally overwriting your MBR or whatever is at offset 0.

The fix is in 485befd.

@fhunleth fhunleth closed this as completed Jul 8, 2017
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

No branches or pull requests

2 participants