mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
gpg: Fix wrong use of FD2INT with iobuf_fdopen_nc.
* g10/decrypt.c (decrypt_message_fd): Use INPUT_FD directly. * g10/encrypt.c (encrypt_crypt): Use FILEFD directly. -- Before 8402815d, original code was with iobuf_open_fd_or_name, which used gnupg_fd_t for the file descriptor (FD2INT was relevant at that time). After the change, because it's not gnupg_fd_t but int, use of FD2INT is irrelevant. Fixes-commit: 8402815d8e0e04a44362968f88b3d484d2395402 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
7ccd489aa2
commit
d68a803c47
@ -120,7 +120,7 @@ decrypt_message_fd (ctrl_t ctrl, int input_fd, int output_fd)
|
||||
pfx = new_progress_context ();
|
||||
|
||||
/* Open the message file. */
|
||||
fp = iobuf_fdopen_nc (FD2INT(input_fd), "rb");
|
||||
fp = iobuf_fdopen_nc (input_fd, "rb");
|
||||
if (fp && is_secured_file (iobuf_get_fd (fp)))
|
||||
{
|
||||
iobuf_close (fp);
|
||||
|
@ -829,10 +829,10 @@ encrypt_crypt (ctrl_t ctrl, int filefd, const char *filename,
|
||||
gpg_err_set_errno (ENOSYS);
|
||||
}
|
||||
#else
|
||||
if (filefd == GNUPG_INVALID_FD)
|
||||
if (filefd == -1)
|
||||
inp = iobuf_open (filename);
|
||||
else
|
||||
inp = iobuf_fdopen_nc (FD2INT(filefd), "rb");
|
||||
inp = iobuf_fdopen_nc (filefd, "rb");
|
||||
#endif
|
||||
if (inp)
|
||||
iobuf_ioctl (inp, IOBUF_IOCTL_NO_CACHE, 1, NULL);
|
||||
|
Loading…
x
Reference in New Issue
Block a user