From 419adf41afa40e5b34f646f2cb16d8aebda20048 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingo=20Kl=C3=B6cker?= Date: Mon, 23 Jan 2023 12:17:22 +0100 Subject: core: Allow setting the base directory when creating an archive * src/engine-gpg.c (gpg_encrypt, gpg_encrypt_sign, gpg_sign): Pass file name set in data with --directory option to gpgtar. * tests/run-encrypt.c (show_usage): New option --directory. (main): Parse new option. Set file name of input data to option value. * tests/run-sign.c (show_usage): New option --directory. (main): Parse new option. Set file name of input data to option value. -- GnuPG-bug-id: 6342 --- doc/gpgme.texi | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'doc/gpgme.texi') diff --git a/doc/gpgme.texi b/doc/gpgme.texi index 8b6106af..b8b90bb1 100644 --- a/doc/gpgme.texi +++ b/doc/gpgme.texi @@ -2199,6 +2199,11 @@ associated with the data object. The file name will be stored in the output when encrypting or signing the data and will be returned to the user when decrypting or verifying the output data. +If a signed or encrypted archive is created, then the file name will be +interpreted as the base directory for the relative paths of the files and +directories to put into the archive. This corresponds to the --directory +option of gpgtar. + The function returns the error code @code{GPG_ERR_INV_VALUE} if @var{dh} is not a valid pointer and @code{GPG_ERR_ENOMEM} if not enough memory is available. @@ -6260,7 +6265,8 @@ If signature mode @code(GPGME_SIG_MODE_ARCHIVE) is requested, then a signed archive is created from the files and directories given as NUL-separated list in the data object @var{plain} and returned in the data object @var{sig}. The paths of the files and directories have to -be given as paths relative to the current working directory. +be given as paths relative to the current working directory or relative +to the base directory set with @code{gpgme_data_set_file_name}. After the operation completed successfully, the result can be retrieved with @code{gpgme_op_sign_result}. @@ -6437,7 +6443,8 @@ If the flag @code(GPGME_ENCRYPT_ARCHIVE) is set, then an encrypted archive is created from the files and directories given as NUL-separated list in the data object @var{plain} and returned in the data object @var{cipher}. The paths of the files and directories have to -be given as paths relative to the current working directory. +be given as paths relative to the current working directory or relative +to the base directory set with @code{gpgme_data_set_file_name}. @var{recp} must be a @code{NULL}-terminated array of keys. The user must keep references for all keys during the whole duration of the -- cgit v1.2.3