summaryrefslogtreecommitdiff
path: root/src/import/pull-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/import/pull-common.c')
-rw-r--r--src/import/pull-common.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/import/pull-common.c b/src/import/pull-common.c
index 4117ed2e6a..acfe380969 100644
--- a/src/import/pull-common.c
+++ b/src/import/pull-common.c
@@ -14,6 +14,7 @@
#include "process-util.h"
#include "pull-common.h"
#include "pull-job.h"
+#include "rlimit-util.h"
#include "rm-rf.h"
#include "signal-util.h"
#include "siphash24.h"
@@ -338,10 +339,9 @@ static int verify_one(PullJob *checksum_job, PullJob *job) {
if (r < 0)
return log_oom();
- if (!filename_is_valid(fn)) {
- log_error("Cannot verify checksum, could not determine server-side file name.");
- return -EBADMSG;
- }
+ if (!filename_is_valid(fn))
+ return log_error_errno(SYNTHETIC_ERRNO(EBADMSG),
+ "Cannot verify checksum, could not determine server-side file name.");
line = strjoina(job->checksum, " *", fn, "\n");
@@ -359,10 +359,9 @@ static int verify_one(PullJob *checksum_job, PullJob *job) {
strlen(line));
}
- if (!p || (p != (char*) checksum_job->payload && p[-1] != '\n')) {
- log_error("DOWNLOAD INVALID: Checksum of %s file did not checkout, file has been tampered with.", fn);
- return -EBADMSG;
- }
+ if (!p || (p != (char*) checksum_job->payload && p[-1] != '\n'))
+ return log_error_errno(SYNTHETIC_ERRNO(EBADMSG),
+ "DOWNLOAD INVALID: Checksum of %s file did not checkout, file has been tampered with.", fn);
log_info("SHA256 checksum of %s is valid.", job->url);
return 1;
@@ -474,6 +473,8 @@ int pull_verify(PullJob *main_job,
_exit(EXIT_FAILURE);
}
+ (void) rlimit_nofile_safe();
+
cmd[k++] = strjoina("--homedir=", gpg_home);
/* We add the user keyring only to the command line
@@ -520,8 +521,7 @@ int pull_verify(PullJob *main_job,
}
finish:
- if (sig_file >= 0)
- (void) unlink(sig_file_path);
+ (void) unlink(sig_file_path);
if (gpg_home_created)
(void) rm_rf(gpg_home, REMOVE_ROOT|REMOVE_PHYSICAL);