summaryrefslogtreecommitdiffstats
path: root/tools/gpgtar-create.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* gpgtar: Make option -C work for archive creation.Werner Koch2019-03-061-0/+8
| | | | | | | | | | | * tools/gpgtar-create.c (gpgtar_create): Switch to the -C directory. -- The -C option is pretty useful given that pattern are always relative to the current directory. In contrast to GNU tar, the switching is done only once. Signed-off-by: Werner Koch <wk@gnupg.org>
* Remove -I option to common.NIIBE Yutaka2017-03-071-1/+1
| | | | | | | | | | | | | * 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 <gniibe@fsij.org>
* Silence two -Wlogical-op warnings.Werner Koch2017-01-051-1/+5
| | | | | | | | * common/tlv.c (parse_ber_header): Avoid compiler warning about a duplicate condition. * tools/gpgtar-create.c (pattern_valid_p): Likewise. Signed-off-by: Werner Koch <wk@gnupg.org>
* Change all http://www.gnu.org in license notices to https://Werner Koch2016-11-051-1/+1
| | | | --
* tools: Fix error handling.Justus Winter2016-10-071-3/+1
| | | | | | | * tools/gpgtar-create.c (gpgtar_create): Do not crash if opening the tarball failed. Signed-off-by: Justus Winter <justus@g10code.com>
* common: Add a status callback to gnupg_exec_tool_stream.Werner Koch2016-05-281-1/+1
| | | | | | | | | | | | * common/exectool.h (exec_tool_status_cb_t): New. * common/exectool.c: Include missing exectool.h. (read_and_log_buffer_t): Replace array by pointer. (gnupg_exec_tool_stream): Add args 'status_cb' and 'status_cb_value'. Change all callers to pass NULL for them. Malloc buffer for FDERRSTATE. (read_and_log_stderr): Implement status_fd feature. Signed-off-by: Werner Koch <wk@gnupg.org>
* common: Allow a second input stream for gnupg_exec_tool_stream.Werner Koch2016-05-271-1/+1
| | | | | | | | | | | | | | | | | | * common/exechelp-posix.c (do_exec): Add arg 'except' and pass to close_all_fds. (gnupg_spawn_process): Add arg 'except'. Change callers to pass NULL for it. * common/exechelp-w32.c (gnupg_spawn_process): Add dummy arg 'except'. * common/exechelp-w32ce.c (gnupg_spawn_process): Ditto. * common/exectool.c (copy_buffer_do_copy): Allow NULL for SINK. (gnupg_exec_tool_stream): Add arg 'inextra'. Change callers to pass NULL for it. Allow NULL for OUTPUT. -- This hack is a first step to allow calling gpg for verification of signatures. Signed-off-by: Werner Koch <wk@gnupg.org>
* gpgtar: Simplify code by using ccparray.Werner Koch2016-05-241-28/+22
| | | | | | | | * tools/gpgtar-create.c (gpgtar_create): Use ccparray functions. * tools/gpgtar-extract.c (gpgtar_extract): Ditto. * tools/gpgtar-list.c (gpgtar_list): Ditto. Signed-off-by: Werner Koch <wk@gnupg.org>
* gpgtar,w32: Fix gpgtar 8 bit encoding handling on W32Andre Heinecke2016-01-261-5/+5
| | | | | | | | | | | | | | | | | | | | | * common/utf8conv.c (wchar_to_utf8): Factor code out to ... (wchar_to_cp): new. (utf8_to_wchar): Factor code out to ... (cp_to_wchar): new. (wchar_to_native): New. (native_to_wchar): New. * tools/gpgtar-create.c (fillup_entry_w32): Use native_to_wchar. (scan_directory): Use wchar_to_native. -- Gpgtar needs to handle filenames in the local 8 bit encoding on Windows as it uses the 8 bit file io functions. GnuPG-bug-id: 1624, 1746 Patch from bug 1624 modified to fit into GnuPG 2.1 by wk. Signed-off-by: Werner Koch <wk@gnupg.org>
* common: Rename sh-exectool to exectool.Werner Koch2015-12-141-3/+3
| | | | | | | | | | | | | | | | | | | * common/sh-exectool.c: Rename to exectool.c. * common/sh-exectool.h: Rename to exectool.h. * common/Makefile.am (common_sources): Adjust for rename. * common/exectool.c (sh_exec_tool_stream): Rename to gnupg_exec-tool-stream. (sh_exec_tool): Rename to gnupg_exec_tool. * tools/gpgtar-create.c (gpgtar_create): Adjust for changes. * tools/gpgtar-extract.c: Adjust for changes. * tools/gpgtar-list.c: Adjust for changes. -- The "sh-" presifx is used by g13 for system helpers which are used by processes created via userv. A generic function in common/ should also have a generic name. Signed-off-by: Werner Koch <wk@gnupg.org>
* tools/gpgtar: Implement symmetric encryption.Justus Winter2015-12-041-2/+12
| | | | | | | | | * tests/openpgp/gpgtar.test: Add test case. * tools/gpgtar-create.c (gpgtar_create): Pass '--symmetric' flag to gpg. * tools/gpgtar.c (parse_arguments): We do handle the argument now. Signed-off-by: Justus Winter <justus@g10code.com>
* tools/gpgtar: Implement signing.Justus Winter2015-12-041-6/+14
| | | | | | | | | | | | | * tests/openpgp/gpgtar.test: Test signing. * tools/gpgtar-create.c (gpgtar_create): Add 'sign' option, add the appropriate gpg arguments to implement signing and selecting the local user. * tools/gpgtar.c (parse_options): We do handle '--local-user' now. (main): Handle signing, encrypting, and doing both when creating an archive. * tools/gpgtar.h (gpgtar_create): Update prototype. Signed-off-by: Justus Winter <justus@g10code.com>
* tools/gpgtar: Use the new exectool helper.Justus Winter2015-12-041-7/+31
| | | | | | | | | | | | * tools/Makefile.am: gpgtar now requires neither npth nor libassuan. * tools/gpgtar-create.c (gpgtar_create): Use the new 'sh-exectool' helper. * tools/gpgtar-extract.c (gpgtar_extract): Likewise. * tools/gpgtar-list.c (gpgtar_list): Likewise. * tools/gpgtar.c (main): Set default gpg program. Drop the initialization of npth and libassuan. Signed-off-by: Justus Winter <justus@g10code.com>
* tools/gpgtar: Handle '--gpg-args'.Justus Winter2015-11-261-1/+1
| | | | | | | | | | | | | * tools/gpgtar-create.c (gpgtar_create): Use given arguments. * tools/gpgtar-extract.c (gpgtar_extract): Likewise. * tools/gpgtar-list.c (gpgtar_list): Likewise. * tools/gpgtar.c (enum cmd_and_opt_values): New value. (opts): Add 'gpg-args'. (parse_arguments): Handle arguments. * tools/gpgtar.h (opt): Add field 'gpg_arguments'. * tests/openpgp/gpgtar.test: Simplify accordingly. Signed-off-by: Justus Winter <justus@g10code.com>
* common: Make the GPG arguments configurable in call-gpg.Justus Winter2015-11-261-0/+1
| | | | | | | | | | | | | | | | * common/call-gpg.c (start_gpg): Add parameter 'gpg_arguments'. (_gpg_encrypt, gpg_encrypt_blob, gpg_encrypt_stream): Likewise. (_gpg_decrypt, gpg_decrypt_blob, gpg_decrypt_stream): Likewise. * common/call-gpg.h: Adapt prototypes. * g13/create.c (encrypt_keyblob): Adapt callsite. * g13/g13-common.h (opt): Add field 'gpg_arguments'. * g13/g13.c (main): Construct default arguments. * g13/mount.c (decrypt_keyblob): Adapt callsite. * tools/gpgtar-create.c (gpgtar_create): Likewise. * tools/gpgtar-extract.c (gpgtar_extract): Likewise. * tools/gpgtar-list.c (gpgtar_list): Likewise. Signed-off-by: Justus Winter <justus@g10code.com>
* tools/gpgtar: Handle '--gpg' argument.Justus Winter2015-11-251-1/+2
| | | | | | | | | | | | * tools/gpgtar-create.c (gpgtar_create): Use given gpg program. * tools/gpgtar-extract.c (gpgtar_extract): Likewise. * tools/gpgtar-list.c (gpgtar_list): Likewise. * tools/gpgtar.c (enum cmd_and_opt_values): New constant. (opts): Add argument. (main): Handle argument. * tools/gpgtar.h (opt): Add field 'gpg_program'. Signed-off-by: Justus Winter <justus@g10code.com>
* tools/gpgtar: Improve error handling.Justus Winter2015-11-251-3/+7
| | | | | | | | | | | | | | | | * tools/gpgtar-create.c (gpgtar_create): Return an error code, fix error handling. * tools/gpgtar-extract.c (gpgtar_extract): Likewise. * tools/gpgtar-list.c (read_header): Return an error code. (gpgtar_list): Return an error code, fix error handling. (gpgtar_read_header): Return an error code. * tools/gpgtar.c: Add missing include. (main): Print an generic error message if a command failed and no error has been printed yet. * tools/gpgtar.h (gpgtar_{create,extract,list,read_header}): Fix the prototypes accordingly. Signed-off-by: Justus Winter <justus@g10code.com>
* tools: Add encryption and decryption support to gpgtar.Justus Winter2015-11-251-1/+37
| | | | | | | | | | | | | | | | | | * tools/Makefile.am: Amend CFLAGS and LDADD. * tools/gpgtar-create.c (gpgtar_create): Add encrypt flag and encrypt stream if requested. * tools/gpgtar-extract.c (gpgtar_extract): Likewise for decryption. * tools/gpgtar-list.c (gpgtar_list): Likewise. * tools/gpgtar.c (main): Initialize npth and assuan. Parse recipient and local user, and note which flags are currently ignored. Adapt calls to gpgtar_list and friends. (tar_and_encrypt): Drop stub function and prototype. (decrypt_and_untar): Likewise. (decrypt_and_list): Likewise. * tools/gpgtar.h (gpgtar_{create,extract,list}): Add encryption or decryption argument. Signed-off-by: Justus Winter <justus@g10code.com>
* Change all quotes in strings and comments to the new GNU standard.Werner Koch2012-06-051-44/+44
| | | | | | | | | | | | | | | | | | | 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.
* Support "-" for --output.Werner Koch2010-08-111-1/+7
|
* Add option --nullWerner Koch2010-08-091-6/+67
|
* Some work on porting dirmngr (unfinished)Werner Koch2010-07-161-35/+223
| | | | | Ported gpgtar to W32.
* Add unfinished gpgtar.Werner Koch2010-06-071-0/+643
Collected changes and ports of bug fixes from stable.