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
Fix rpm2archive behavior with multiple arguments #681
Fix rpm2archive behavior with multiple arguments #681
Conversation
It seems that your patch is broken:
|
|
||
ts = rpmtsFree(ts); | ||
if (argc == 1) | ||
argv[argc++] = "-"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't look right. You can't just write beyond the bounds of the argv array. You need to allocate a new - bigger - one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per C standard, argv[argc] is always defined to be a NULL pointer. (Section 5.1.2.2.1, paragraph 2, in ISO/IEC 9899:1999).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now you may not like that I'm doing this, which is a perfectly valid complaint and I'm happy to change it :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we don't like that. Please change :)
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
If multiple arguments are passed to rpm2archive, convert them all to tgz. (Previous behavior was to convert only the first one and silently ignore the rest.) Signed-off-by: Robbie Harwood <rharwood@redhat.com>
1bdc4de
to
342a314
Compare
Problem was due to a CI bug, which I've included a fix for. |
vsflags |= RPMVSF_MASK_NOSIGNATURES; | ||
vsflags |= RPMVSF_NOHDRCHK; | ||
(void) rpmtsSetVSFlags(ts, vsflags); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All this transaction fiddling should be done exactly once, outside the loop.
Pushed with minor tweaks. Thanks for the patch and the additional effort of fixing the test suite! |
If multiple arguments are passed to rpm2archive, convert them all to
tgz. (Previous behavior was to convert only the first one and
silently ignore the rest.)
Signed-off-by: Robbie Harwood rharwood@redhat.com