aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Fella via Gnupg-devel <[email protected]>2021-02-28 13:34:10 +0000
committerWerner Koch <[email protected]>2021-03-01 08:47:21 +0000
commit0441ed6e1c1d7eac81bfbec6ce51f319d9d20eb7 (patch)
tree5a47b4b5e5f56c8e6aec7f0073fb06534f4d3076
parentsm: Silence some other pkcs#12 import prattle (diff)
downloadgnupg-0441ed6e1c1d7eac81bfbec6ce51f319d9d20eb7.tar.gz
gnupg-0441ed6e1c1d7eac81bfbec6ce51f319d9d20eb7.zip
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 <[email protected]>
-rw-r--r--g10/photoid.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/g10/photoid.c b/g10/photoid.c
index 81ea7a0ca..dbef7d7c6 100644
--- a/g10/photoid.c
+++ b/g10/photoid.c
@@ -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