]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
cryptsetup: make sure we invoke the cryptsetup tools with a shared keyring 6832/head
authorLennart Poettering <lennart@poettering.net>
Thu, 14 Sep 2017 19:23:56 +0000 (21:23 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 15 Sep 2017 14:53:35 +0000 (16:53 +0200)
We want that cryptsetup can cache keys between multiple invocations, and
it does so via the root user's user keyring, hence let's share it among
services.

Replaces: #6286

src/cryptsetup/cryptsetup-generator.c
src/gpt-auto-generator/gpt-auto-generator.c

index 11d98926580e2060ef814078d4bf33e9cd0f4ca3..f882a4f80eefdd588f27e20c0abb7562830e8da9 100644 (file)
@@ -170,6 +170,7 @@ static int create_disk(
                 "Type=oneshot\n"
                 "RemainAfterExit=yes\n"
                 "TimeoutSec=0\n" /* the binary handles timeouts anyway */
+                "KeyringMode=shared\n" /* make sure we can share cached keys among instances */
                 "ExecStart=" SYSTEMD_CRYPTSETUP_PATH " attach '%s' '%s' '%s' '%s'\n"
                 "ExecStop=" SYSTEMD_CRYPTSETUP_PATH " detach '%s'\n",
                 name, u, strempty(password), strempty(filtered),
index dcbf3ff061069611c7d5ed48654eea2fc6e0ac7e..bf28af0a6f9863b77f8995c5e785b1fed8222c69 100644 (file)
@@ -99,6 +99,7 @@ static int add_cryptsetup(const char *id, const char *what, bool rw, bool requir
                 "Type=oneshot\n"
                 "RemainAfterExit=yes\n"
                 "TimeoutSec=0\n" /* the binary handles timeouts anyway */
+                "KeyringMode=shared\n" /* make sure we can share cached keys among instances */
                 "ExecStart=" SYSTEMD_CRYPTSETUP_PATH " attach '%s' '%s' '' '%s'\n"
                 "ExecStop=" SYSTEMD_CRYPTSETUP_PATH " detach '%s'\n",
                 d, d,