gpg: Keep temp files when opening images via xdg-open

* g10/photoid.c (get_default_photo_command): Change parameter for
xdg-open.
--

xdg-open spawns the user's preferred image viewer and then exits.
Therefore we must not remove the temp file when it exits,
otherwise by the time the actual image viewer is started the file
doesn't exist any more.

Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de>
This commit is contained in:
Nicolas Fella via Gnupg-devel 2021-02-28 14:34:10 +01:00 committed by Werner Koch
parent 5ed1567e7c
commit be2da24456
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
1 changed files with 5 additions and 1 deletions

View File

@ -287,7 +287,11 @@ get_default_photo_command(void)
else if (!path_access ("display",X_OK))
return "display -title 'KeyID 0x%k' %i";
else if (getuid () && !path_access ("xdg-open", X_OK))
return "xdg-open %i";
{
/* xdg-open spawns the actual program and exits so we need to
* keep the temp file */
return "xdg-open %I";
}
else
return "/bin/true";
#endif