summaryrefslogtreecommitdiff
path: root/src/import/pull-raw.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/import/pull-raw.c')
-rw-r--r--src/import/pull-raw.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/import/pull-raw.c b/src/import/pull-raw.c
index 60a769e944..b45ac814a9 100644
--- a/src/import/pull-raw.c
+++ b/src/import/pull-raw.c
@@ -444,7 +444,7 @@ static int raw_pull_rename_auxiliary_file(
assert(suffix);
assert(path);
- /* Regenerate final name for this auxiliary file, we might know the etag of the raw file now, and we shoud
+ /* Regenerate final name for this auxiliary file, we might know the etag of the file now, and we should
* incorporate it in the file name if we can */
*path = mfree(*path);
r = raw_pull_determine_path(i, suffix, path);
@@ -478,11 +478,9 @@ static void raw_pull_job_on_finished(PullJob *j) {
} else if (j == i->settings_job) {
if (j->error != 0)
log_info_errno(j->error, "Settings file could not be retrieved, proceeding without.");
- } else if (j->error != 0) {
+ } else if (j->error != 0 && j != i->signature_job) {
if (j == i->checksum_job)
log_error_errno(j->error, "Failed to retrieve SHA256 checksum, cannot verify. (Try --verify=no?)");
- else if (j == i->signature_job)
- log_error_errno(j->error, "Failed to retrieve signature file, cannot verify. (Try --verify=no?)");
else
log_error_errno(j->error, "Failed to retrieve image file. (Wrong URL?)");
@@ -500,6 +498,13 @@ static void raw_pull_job_on_finished(PullJob *j) {
if (!raw_pull_is_done(i))
return;
+ if (i->signature_job && 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?)");
+
+ r = i->signature_job->error;
+ goto finish;
+ }
+
if (i->roothash_job)
i->roothash_job->disk_fd = safe_close(i->roothash_job->disk_fd);
if (i->settings_job)
@@ -533,7 +538,7 @@ static void raw_pull_job_on_finished(PullJob *j) {
r = rename_noreplace(AT_FDCWD, i->temp_path, AT_FDCWD, i->final_path);
if (r < 0) {
- log_error_errno(r, "Failed to move RAW file into place: %m");
+ log_error_errno(r, "Failed to rename raw file to %s: %m", i->final_path);
goto finish;
}
@@ -575,7 +580,6 @@ static int raw_pull_job_on_open_disk_generic(
const char *extra,
char **temp_path) {
- _cleanup_free_ char *p = NULL;
int r;
assert(i);
@@ -744,6 +748,7 @@ int raw_pull_start(
if (i->checksum_job) {
i->checksum_job->on_progress = raw_pull_job_on_progress;
+ i->checksum_job->style = VERIFICATION_PER_FILE;
r = pull_job_begin(i->checksum_job);
if (r < 0)