aboutsummaryrefslogtreecommitdiffstats
path: root/g10/photoid.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2024-08-19gpg: Minor fix when building with --disable-execWerner Koch1-1/+0
* g10/photoid.c (show_photo): No return for a void function. -- GnuPG-bug-id: 7256
2024-07-09Use gpgrt_process_spawn API from libgpg-error.NIIBE Yutaka1-7/+6
* agent/genkey.c (do_check_passphrase_pattern): Use the gpgrt API. * common/asshelp.c (start_new_service): Ditto. * common/exechelp.h: Remove gnupg_process_spawn API. * common/exechelp-posix.c: Remove gnupg_process_spawn implementation. * common/exechelp-w32.c: Likewise. * common/exectool.c (gnupg_exec_tool_stream): Use the gpgrt API. * common/t-exechelp.c (test_pipe_stream): Remove. * dirmngr/ldap-wrapper.c (destroy_wrapper, ldap_reaper_thread): Use the gpgrt API. (ldap_wrapper_connection_cleanup, ldap_wrapper): Ditto. * dirmngr/ldap.c, g10/call-keyboxd.c: No need to include exechelp.h. * g10/photoid.c (run_with_pipe, show_photo): Use the gpgrt API. * g13/be-encfs.c (run_umount_helper, run_encfs_tool): Ditto. * g13/g13.c, g13/mount.c, g13/runner.c: No need to include exechelp.h. * scd/apdu.c: No need to include exechelp.h. * scd/app.c (report_change): Use the gpgrt API. * sm/export.c, sm/import.c: No need to include exechelp.h. * tests/gpgscm/ffi.c (proc_object_finalize, proc_wrap) (do_process_spawn_io, do_process_spawn_fd, do_process_wait): Use the gpgrt API. * tools/gpg-auth.c: No need to include exechelp.h. * tools/gpg-card.c (cmd_gpg): Use the gpgrt API. * tools/gpg-connect-agent.c: No need to include exechelp.h. * tools/gpg-mail-tube.c (mail_tube_encrypt, prepare_for_appimage) (start_gpg_encrypt): Use the gpgrt API. * tools/gpgconf-comp.c (gpg_agent_runtime_change) (scdaemon_runtime_change, tpm2daemon_runtime_change) (dirmngr_runtime_change, keyboxd_runtime_change) (gc_component_launch, gc_component_check_options) (retrieve_options_from_program): Ditto. * tools/gpgconf.c (show_versions_via_dirmngr): Ditto. * tools/gpgtar-create.c (gpgtar_create): Ditto. * tools/gpgtar-extract.c (gpgtar_extract): Ditto. * tools/gpgtar-list.c (gpgtar_list): Ditto. -- GnuPG-bug-id: 7192 Signed-off-by: NIIBE Yutaka <[email protected]>
2024-05-31spawn: Remove spawn callback, introduce gnupg_spawn_actions.NIIBE Yutaka1-2/+2
* common/exechelp-posix.c (call_spawn_cb): Remove. (gnupg_spawn_actions_new, gnupg_spawn_actions_release) (gnupg_spawn_actions_set_environ, gnupg_spawn_actions_set_atfork) (gnupg_spawn_actions_set_redirect) (gnupg_spawn_actions_set_inherit_fds): New. (my_exec, spawn_detached): Use spawn actions. (gnupg_spawn_helper): Remove. (gnupg_process_spawn): Remove callback, introduce gnupg_spawn_actions. * common/exechelp-w32.c: Ditto. * common/exechelp.h: Ditto. * agent/genkey.c (do_check_passphrase_pattern): Follow the change of gnupg_process_spawn API. * common/asshelp.c (start_new_service): Likewise. * common/exectool.c (gnupg_exec_tool_stream): Likewise. * common/t-exechelp.c (test_pipe_stream): Likewise. * dirmngr/ldap-wrapper.c (ldap_wrapper): Likewise. * g10/photoid.c (run_with_pipe): Likewise. * scd/app.c (report_change): Likewise. * tests/gpgscm/ffi.c (do_process_spawn_io, do_process_spawn_fd): Likewise. * tools/gpg-card.c (cmd_gpg): Likewise. * tools/gpgconf-comp.c (gpg_agent_runtime_change): Likewise. (scdaemon_runtime_change, tpm2daemon_runtime_change) (dirmngr_runtime_change, keyboxd_runtime_change) (gc_component_launch, gc_component_check_options) (retrieve_options_from_program): Likewise. * tools/gpgconf.c (show_versions_via_dirmngr): Likewise. * tools/gpgtar-create.c (gpgtar_create): Likewise. * tools/gpgtar-extract.c (gpgtar_extract): Likewise. * tools/gpgtar-list.c (gpgtar_list): Likewise. -- Signed-off-by: NIIBE Yutaka <[email protected]>
2023-06-26gpg,w32: Add comment about debug output of ShellExecuteEx.NIIBE Yutaka1-2/+9
* g10/photoid.c (w32_system): Add comment about hInstApp, why we use the integer value of possibly smaller size for the debug output. -- GnuPG-bug-id: 6508 Signed-off-by: NIIBE Yutaka <[email protected]>
2023-06-13gpg: Make progress work for large files on Windows.Werner Koch1-6/+12
* common/iobuf.c (iobuf_get_filelength): Change return type to uint64_t and remove the overflow args. For Windows always use GetFileSizeEx which is available since the long EOL-ed Windows XP. * g10/sign.c (write_plaintext_packet): Adjust for changed iobuf_get_filelength. * g10/encrypt.c (encrypt_simple, encrypt_crypt): Ditto. * g10/photoid.c (generate_photo_id): Ditto. Also add an upper limit. * g10/filter.h (progress_filter_context_t): Change amount values to use uint64_t. * g10/progress.c (write_status_progress): Change accordingly. -- GnuPG-bug-id: 6534
2023-05-16w32: Remove support of Windows 95/98/Me.NIIBE Yutaka1-13/+1
* g10/photoid.c (VER_PLATFORM_WIN32_WINDOWS): Remove fallback definition. (get_default_photo_command): Remove use of "start /w" for Windows 95. Signed-off-by: NIIBE Yutaka <[email protected]>
2023-05-11common,agent,gpg,dirmngr,g13,scd,tests,tools: New spawn function.NIIBE Yutaka1-22/+20
* common/exechelp-posix.c (do_exec, gnupg_spawn_process): Remove. (check_syscall_func, pre_syscall, post_syscall) : New. (do_create_socketpair, posix_open_null, call_spawn_cb): New. (my_exec, spawn_detached, gnupg_spawn_helper): New. (gnupg_process_spawn, process_kill, gnupg_process_terminate): New. (gnupg_process_get_fds, gnupg_process_get_streams): New. (process_vctl, gnupg_process_ctl): New. (gnupg_process_wait, gnupg_process_release): New. (gnupg_process_wait_list): New. * common/exechelp-w32.c: Add definition of _WIN32_WINNT as 0x600. (check_syscall_func, pre_syscall, post_syscall): New. (gnupg_spawn_process): Remove. (check_windows_version): New. (spawn_detached, gnupg_spawn_helper, gnupg_process_spawn): New. (gnupg_process_get_fds, gnupg_process_get_streams): New. (process_kill, process_vctl, gnupg_process_ctl): New. (gnupg_process_wait, gnupg_process_terminate): New. (gnupg_process_release, gnupg_process_wait_list): New. * common/exechelp.h: Re-write for new API. * common/exectool.c (gnupg_exec_tool_stream): Follow the change. * common/asshelp.c (start_new_service): Likewise. * agent/genkey.c (do_check_passphrase_pattern): Likewise. * dirmngr/ldap-wrapper.c (struct wrapper_context_s): Use PROC. (destroy_wrapper): Follow the change of API. (read_log_data): Follow the change of API, use printable_pid. (ldap_reaper_thread, ldap_wrapper_release_context): Likewise. (ldap_wrapper_connection_cleanup, ldap_wrapper): Likewise. * g10/photoid.c (run_with_pipe): Follow the change of API. (show_photo): Likewise. * g13/be-encfs.c (run_umount_helper): Likewise. (run_encfs_tool): Likewise. * g13/g13.c: Add including ./common/exechelp.h. * g13/mount.c: Likewise. * g13/runner.c: Follow the change of API. * g13/runner.h: Follow the change of API. * scd/app.c (setup_env): New. (report_change): Follow the change of API. * tests/gpgscm/ffi.c (proc_object_finalize): New. (proc_object_to_string): New. (proc_wrap, proc_unwrap): New. (do_spawn_process): Remove. (do_process_spawn): New. (setup_std_fds): New. (do_spawn_process_fd): Remove. (do_process_spawn_fd): New. (do_wait_process): Remove. (do_process_wait): New. (do_wait_processes): Remove. * tests/gpgscm/t-child.scm: Follow the change of API. * tests/gpgscm/tests.scm: Likewise. * tests/openpgp/defs.scm: Likewise. * tests/tpm2dtests/defs.scm: Likewise. * tools/gpg-card.c: Likewise. * tools/gpgconf-comp.c: Likewise. * tools/gpgconf.c: Likewise. * tools/gpgtar-create.c: Likewise. * tools/gpgtar-extract.c: Likewise. * tools/gpgtar-list.c: Likewise. -- GnuPG-bug-id: 6275 Signed-off-by: NIIBE Yutaka <[email protected]>
2022-11-09gpg: Move w32_system function.NIIBE Yutaka1-1/+108
* g10/exec.h (w32_system): Not exposed. * g10/exec.c (w32_system): Move to ... * g10/photoid.c: here. -- Signed-off-by: NIIBE Yutaka <[email protected]>
2021-03-01gpg: Keep temp files when opening images via xdg-openNicolas Fella via Gnupg-devel1-1/+5
* 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]>
2020-11-02gpg: Allow setting notations with the empty string as value.Werner Koch1-0/+5
* g10/misc.c (pct_expando): Catch special case of the empty string. Also map a NULL to the empty string. * g10/photoid.c (show_photos): Make an empty string used as command fail. -- This patch also fixes a segv when calling gpg wrongly like gpg -N \[email protected] GnuPG-bug-id: 5117 Signed-off-by: Werner Koch <[email protected]>
2020-10-20Replace most of the remaining stdio calls by estream calls.Werner Koch1-3/+3
-- We need to use es_fopen on Windows to cope with non-ascii file names. This is quite a large but fortunately straightforward change. At a very few places we keep using stdio (for example due to the use of popen). GnuPG-bug-id: 5098 Signed-off-by: Werner Koch <[email protected]>
2019-09-09gpg: New option --use-keyboxd.Werner Koch1-1/+1
* g10/gpg.c (oUseKeyboxd,oKeyboxdProgram): New consts. (opts): New options --use-keyboxd and --keyboxd-program. (main): Implement them. * g10/keydb.c: Move some defs out to ... * g10/keydb-private.h: new file. * g10/keydb.c: prefix function names with "internal" and move original functions to ... * g10/call-keyboxd.c: new file. Divert to the internal fucntion if --use-keyboxd is used. Add a CTRL arg to most fucntions and change all callers. * g10/Makefile.am (common_source): Add new files. (noinst_PROGRAMS): Do bot build gpgcompose. -- Note that this is just the framework with only a basic implementation of searching via keyboxd. Signed-off-by: Werner Koch <[email protected]>
2019-07-25gpg: photoid: Use standard spawn API.NIIBE Yutaka1-460/+229
* g10/photoid.c (exec_write, exec_read, exec_finish): Remove. (setup_input_file): Rename from make_tempdir. (expand_args): Drop support of 'o' and 'O'. (fill_command_argv, run_with_pipe, create_temp_file) New. (show_photo): New with gnupg_spawn_process_fd and gnupg_wait_process. (show_photos): Call show_photo. GnuPG-bug-id: 4362 Signed-off-by: NIIBE Yutaka <[email protected]>
2019-07-25gpg: photoid: Move functions from exec.c.NIIBE Yutaka1-0/+546
* g10/exec.c (w32_system): Expose to public. (exec_write, exec_read, exec_finish, make_tempdir, expand_args): Move to photoid.c. * g10/exec.h: Likewise. * g10/photoid.c (exec_write, exec_read, exec_finish, make_tempdir) (expand_args): Move here. Signed-off-by: NIIBE Yutaka <[email protected]>
2019-07-23gpg: A little clean up.NIIBE Yutaka1-2/+3
* g10/keyserver.c: Don't include exec.h. * g10/photoid.c (image_type_to_string): It's constant. * g10/photoid.h (image_type_to_string): Likewise. Signed-off-by: NIIBE Yutaka <[email protected]>
2019-05-17gpg: Improve the photo image viewer selection.Werner Koch1-3/+13
* g10/exec.c (w32_system): Add "!ShellExecute" special. * g10/photoid.c (get_default_photo_command): Use the new ShellExecute under Windows and fallbac to 'display' and 'xdg-open' in the Unix case. (show_photos): Flush stdout so that the output is shown before the image pops up. -- For Unix this basically syncs the code with what we have in gpg 1.4. Note that xdg-open may not be used when running as root which we support here. For Windows we now use ShellExecute as this seems to be preferred over "cmd /c start"; however this does not solve the actual problem we had in the bug report. To solve that problem we resort to a wait parameter which defaults to 400ms. This works on my Windows-10 virtualized test box. If we can figure out which simple viewers are commonly installed on Windows we should enhance this patch to test for them. GnuPG-bug-id: 4334 Signed-off-by: Werner Koch <[email protected]>
2017-03-07Remove -I option to common.NIIBE Yutaka1-5/+5
* dirmngr/Makefile.am (AM_CPPFLAGS): Remove -I$(top_srcdir)/common. * g10/Makefile.am (AM_CPPFLAGS): Ditto. * g13/Makefile.am (AM_CPPFLAGS): Ditto. * kbx/Makefile.am (AM_CPPFLAGS): Ditto. * scd/Makefile.am (AM_CPPFLAGS): Ditto. * sm/Makefile.am (AM_CPPFLAGS): Ditto. * tools/Makefile.am (AM_CPPFLAGS): Ditto. * Throughout: Follow the change. Signed-off-by: NIIBE Yutaka <[email protected]>
2016-11-23g10: Avoid gratuitously loading a keyblock when it is already availableNeal H. Walfield1-1/+1
* g10/trust.c (get_validity): Add new, optional parameter KB. Only load the keyblock if KB is NULL. Update callers. (get_validity): Likewise. * g10/trustdb.c (tdb_get_validity_core): Likewise. -- Signed-off-by: Neal H. Walfield <[email protected]> GnuPG-bug-id: 2812
2016-11-05Change all http://www.gnu.org in license notices to https://Werner Koch1-1/+1
--
2016-05-21gpg: Pass CTRL object down to the trust functionsWerner Koch1-6/+7
Signed-off-by: Werner Koch <[email protected]>
2014-04-17gpg: New %U expando for the photo viewer.Werner Koch1-0/+2
* g10/photoid.c (show_photos): Set namehash. * g10/misc.c (pct_expando): Add "%U" expando. -- This makes is possible to extract all photos ids from a key to different files.
2014-03-07w32: Include winsock2.h to silence warnings.Werner Koch1-0/+3
2014-02-10gpg: Cleanup compiler warnings due to some configure options.Werner Koch1-2/+7
* g10/photoid.c (show_photos) [DISABLE_PHOTO_VIEWER]: Mark args as unused. * tools/gpgconf-comp.c (my_dgettext): Mark DOMAIN as unused if NLS is not configured.
2012-06-05Change all quotes in strings and comments to the new GNU standard.Werner Koch1-2/+2
The asymmetric quotes used by GNU in the past (`...') don't render nicely on modern systems. We now use two \x27 characters ('...'). The proper solution would be to use the correct Unicode symmetric quotes here. However this has the disadvantage that the system requires Unicode support. We don't want that today. If Unicode is available a generated po file can be used to output proper quotes. A simple sed script like the one used for en@quote is sufficient to change them. The changes have been done by applying sed -i "s/\`\([^'\`]*\)'/'\1'/g" to most files and fixing obvious problems by hand. The msgid strings in the po files were fixed with a similar command.
2011-12-15Merge fix for issue 1331 from 1.4.David Shaw1-3/+2
* photoid.c (generate_photo_id): Check for the JPEG magic numbers instead of JFIF since some programs generate an EXIF header first.
2011-02-04Nuked almost all trailing white space.post-nuke-of-trailing-wsWerner Koch1-2/+2
We better do this once and for all instead of cluttering all future commits with diffs of trailing white spaces. In the majority of cases blank or single lines are affected and thus this change won't disturb a git blame too much. For future commits the pre-commit scripts checks that this won't happen again.
2010-10-01Exporting secret keys via gpg-agent is now basically supported.Werner Koch1-1/+1
A couple of forward ported changes. Doc updates.
2010-04-23Decryption and signi via agent is now implemented.Werner Koch1-13/+9
2010-04-01Use gpg_err_set_errno to assign values to ERRNO.Werner Koch1-1/+1
2010-02-02Various changes to eventually support openpgp keys in pgp-agent.Werner Koch1-1/+1
Comment fixes. Minor chnages in preparation of a W32CE port.
2009-09-03Fix bug#1122.Werner Koch1-1/+2
Note that msgmerge 0.17 is completely broken as it always prepends a fuzzy null entry to all po files.
2008-10-03* main.h, mainproc.c (check_sig_and_print), keylist.cDavid Shaw1-4/+9
(list_keyblock_print), pkclist.c (do_edit_ownertrust), keyedit.c (menu_showphoto), photoid.c (generate_photo_id, show_photos), misc.c (pct_expando): Add %v and %V expandos so that displaying photo IDs can show the attribute validity tag (%v) and string (%V). Originally by Daniel Gillmor.
2007-07-04Changed to GPLv3.Werner Koch1-4/+2
Removed intl/.
2006-04-19Merged with gpg 1.4.3 code. Werner Koch1-34/+73
The gpg part does not yet build.
2006-04-11* options.skel, photoid.c (get_default_photo_command): Find an imageDavid Shaw1-2/+16
viewer at runtime. Seems FC5 doesn't have xloadimage.
2005-10-05Renamed g10.c to gpg.cWerner Koch1-2/+4
Filelength fixes for W32.
2005-09-01* photoid.h, photoid.c (generate_photo_id): Allow passing in aDavid Shaw1-20/+37
suggested filename. * keyedit.c (keyedit_menu, menu_adduid): Call it here so "addphoto filename" works.
2005-08-31* photoid.c (generate_photo_id): Enable readline completion and tildeDavid Shaw1-3/+14
expansion for the JPEG prompt.
2005-07-27Converted all m_free to xfree etc.Werner Koch1-11/+11
2005-05-31Updated FSF street address and preparations for a release candidate.Werner Koch1-1/+2
2004-10-13Added SELInux hacks and did some cleanups.Werner Koch1-1/+7
2004-10-11* pkclist.c (do_edit_ownertrust): Use the same translated string forDavid Shaw1-2/+2
showing the user ID as mainproc.c:print_pkenc_list. * mainproc.c (print_pkenc_list): Allow translating the quotes around the user ID. * card-util.c, g10.c, photoid.c, trustdb.c: The last of the \"%s\" -> `%s' quoting for things that aren't user IDs. * keyserver.c (keyserver_spawn): If there is no keyserver host, print the whole URI since it is self-contained.
2004-10-10* card-util.c, keyedit.c, openfile.c, pkclist.c, delkey.c, keygen.c,David Shaw1-1/+1
photoid.c, revoke.c: Some yes-or-no prompts end in "(y/n)". Some don't. Consistently use y/n everywhere.
2004-09-09* photoid.c: Include ttyio.h.Werner Koch1-0/+1
* parse-packet.c (skip_rest): Removed. Changed all callers to use the new iobuf_skip_reset. Orginal patch by Florian Weimer. * iobuf.c (iobuf_skip_rest): New. Orginal patch by Florian Weimer. Added new argument PARTIAL.
2004-09-07(generate_photo_id): Use tty_printf and not justWerner Koch1-4/+4
printf. Put _() around one string.
2003-09-23Merged most of David Shaw's changes in 1.3 since 2003-06-03.Werner Koch1-2/+2
2003-08-29* passphrase.c (agent_send_all_options): Make use of $GPG_TTY.David Shaw1-2/+2
* g10.c (main): Disable use-agent if passphrase-fd is given later. Suggested by Kurt Garloff. * exec.c, g10.c, gpgv.c, passphrase.c, photoid.c: s/__MINGW32__/_WIN32/ to help building on native Windows compilers. Requested by Brian Gladman. From Werner on stable branch.
2003-06-18Finished the bulk of changes for gnupg 1.9. This included switchingWerner Koch1-12/+12
to libgcrypt functions, using shared error codes from libgpg-error, replacing the old functions we used to have in ../util by those in ../jnlib and ../common, renaming the malloc functions and a couple of types. Note, that not all changes are listed below becuause they are too similar and done at far too many places. As of today the code builds using the current libgcrypt from CVS but it is very unlikely that it actually works.
2003-06-05This commit was manufactured by cvs2svn to create branchRepo Admin1-0/+333
'GNUPG-1-9-BRANCH'.
2003-04-27* g10.c (main): Add --no-textmode.David Shaw1-1/+1
* export.c (do_export_stream), keyedit.c (show_key_with_all_names, menu_addrevoker), mainproc.c (check_sig_and_print), photoid.c (show_photos), sign.c (mk_notation_and_policy), trustdb.c (get_validity, reset_trust_records, validate_keys): Make some strings translatable. * mainproc.c (check_sig_and_print): Show digest algorithm and sig class when verifying a sig with --verbose on, and add version, pk and hash algorithms and sig class to VALIDSIG. * parse-packet.c (enum_sig_subpkt): Make a warning message a --verbose warning message since we don't need to warn every time we see an unknown critical (we only need to invalidate the signature). * trustdb.c (init_trustdb): Check the trustdb options even with TM_AUTO since the auto may become TM_CLASSIC or TM_OPENPGP.