only check signature job error if signature job exists#6118
only check signature job error if signature job exists#6118poettering merged 1 commit intosystemd:masterfrom tblume:fix-no-signature-job-handling
Conversation
src/import/pull-tar.c
Outdated
| if (i->checksum_job->style == VERIFICATION_PER_DIRECTORY && i->signature_job->error != 0) { | ||
| log_error_errno(j->error, "Failed to retrieve signature file, cannot verify. (Try --verify=no?)"); | ||
| if (i->signature_job) { | ||
| if (i->checksum_job->style == VERIFICATION_PER_DIRECTORY && i->signature_job->error != 0) { |
There was a problem hiding this comment.
hmm, not sure i follow. how can this even happen? if style is VERIFICATION_PER_DIRECTORY, then we really should have a signature job, no?
There was a problem hiding this comment.
This happens when verify=no is used, so there is no signature job started. I didn't consider this case when checking for: signature_job->error.
There was a problem hiding this comment.
ok, but don't you also have to check whether checksum_job is != NULL too?
Also I think it would be nicer to just add this to the if check, but only place one if check here. i.e. instead of:
if (i->signature_job) {
if (i->checksum_job->… && i->signature_job…) {
…do:
…
if (i->signature_job && i->checksum_job->… && i->signature_job…) {
…That saves one level of indentation..
There was a problem hiding this comment.
According to pull-common.c a checksum job is always started unless verify is IMPORT_VERIFY_NO. A signature job is only started when verify is IMPORT_VERIFY_SIGNATURE in which case a checksum job is also started, because verify isn't IMPORT_VERIFY_NO. In other words, a signature job implies the presence of a checksum job, so I guess I only have to check for the signature job.
Otherwise, I have updated my patch. Could you please review again?
otherwise it will segfault when accessing signature jobs error status
otherwise it will segfault when accessing signature jobs error status (cherry picked from commit c9fb8c7) [tblume: fixes boo#1043758]
otherwise it will segfault when accessing signature jobs error status