summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-01-21 03:01:13 +0100
committerLennart Poettering <lennart@poettering.net>2015-01-21 04:03:54 +0100
commit3576d6315f3b6b686cdcf9f280d5e829e3d3daa0 (patch)
treeb89135ea6144eb7bc53c165d2c6eeac18ed2e259 /src/shared
parent72521ab9fd8a47e5b9df4b99b7289531124df5e7 (diff)
import: add image verification using gpg
This also adds an initial keyring for the verification, that contains Ubuntu's and Fedora's key. We should probably add more entries sooner or later.
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/util.c10
-rw-r--r--src/shared/util.h3
2 files changed, 13 insertions, 0 deletions
diff --git a/src/shared/util.c b/src/shared/util.c
index 5157b94a34..9392477787 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -8011,3 +8011,13 @@ ssize_t sparse_write(int fd, const void *p, size_t sz, size_t run_length) {
return q - (const uint8_t*) p;
}
+
+void sigkill_wait(pid_t *pid) {
+ if (!pid)
+ return;
+ if (*pid <= 1)
+ return;
+
+ if (kill(*pid, SIGKILL) > 0)
+ (void) wait_for_terminate(*pid, NULL);
+}
diff --git a/src/shared/util.h b/src/shared/util.h
index d40c0b0378..f59a2bbb99 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
@@ -1065,3 +1065,6 @@ void release_lock_file(LockFile *f);
#define RLIMIT_MAKE_CONST(lim) ((struct rlimit) { lim, lim })
ssize_t sparse_write(int fd, const void *p, size_t sz, size_t run_length);
+
+void sigkill_wait(pid_t *pid);
+#define _cleanup_sigkill_wait_ _cleanup_(sigkill_wait)