summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2023-07-25 09:20:54 +0200
committerJustus Winter <justus@sequoia-pgp.org>2023-07-25 11:44:27 +0200
commit648858b7b8ce1db35a6f5f4a993a79590a3991c7 (patch)
tree9ba0a8e524b59ddd4c7eeb427e1fac727a587f38
parent64a5636b6926092015c60b109e6fe51500abc163 (diff)
ipc: Make starting the gpg-agent more robust.
- Try to create the socket directory, but don't fail if that should fail. In environments where /run/user/$UID doesn't exist, this will fail, and GnuPG will transparently fall back to putting the sockets into $GNUPGHOME.
-rw-r--r--ipc/src/gnupg.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/ipc/src/gnupg.rs b/ipc/src/gnupg.rs
index ca833040..be2290f9 100644
--- a/ipc/src/gnupg.rs
+++ b/ipc/src/gnupg.rs
@@ -260,7 +260,7 @@ impl Context {
/// Starts a GnuPG component.
pub fn start(&self, component: &str) -> Result<()> {
- self.create_socket_dir()?;
+ let _ = self.create_socket_dir(); // Best effort.
Self::gpgconf(&self.homedir, &["--launch", component], 1)?;
Ok(())
}