This commit is contained in:
the-djmaze 2022-04-18 23:59:06 +02:00
parent fb6b84d920
commit 3d0421762a
2 changed files with 8 additions and 1 deletions

View file

@ -23,6 +23,13 @@ trait Pgp
\RainLoop\Providers\Storage\Enumerations\StorageType::PGP \RainLoop\Providers\Storage\Enumerations\StorageType::PGP
)) . '/.gnupg'; )) . '/.gnupg';
if (!\is_dir($homedir)) {
\mkdir($homedir, 0700, true);
}
if (!\is_writable($homedir)) {
throw new \Exception("gpg homedir '{$homedir}' not writable");
}
/** /**
* Workaround error: socket name for '/very/long/path/to/.gnupg/S.gpg-agent.extra' is too long * Workaround error: socket name for '/very/long/path/to/.gnupg/S.gpg-agent.extra' is too long
* BSD 4.4 max length = 104 * BSD 4.4 max length = 104

View file

@ -85,7 +85,7 @@ class GPG
$this->options['homedir'] = \rtrim($homedir, '/\\'); $this->options['homedir'] = \rtrim($homedir, '/\\');
// the random seed file makes subsequent actions faster so only disable it if we have to. // the random seed file makes subsequent actions faster so only disable it if we have to.
if ($this->options['homedir'] && !\is_writeable($this->options['homedir'])) { if ($this->options['homedir'] && !\is_writable($this->options['homedir'])) {
$this->options['no-random-seed-file'] = true; $this->options['no-random-seed-file'] = true;
} }