chiark / gitweb /
Import gnupg2_2.1.18-6.debian.tar.bz2
[gnupg2.git] / patches / 0013-tools-Improve-error-handling.patch
1 From: Justus Winter <justus@g10code.com>
2 Date: Mon, 23 Jan 2017 14:24:22 +0100
3 Subject: tools: Improve error handling.
4
5 * tools/gpgconf-comp.c (gp_component_change_options): Improve error
6 handling when reading from stdin.
7 --
8 Previously, errors encountered while reading the configuration changes
9 were ignored.
10
11 Signed-off-by: Justus Winter <justus@g10code.com>
12 (cherry picked from commit b0348fdb26637b0bcbd68a96c1746a1613b309af)
13 ---
14  tools/gpgconf-comp.c | 2 ++
15  1 file changed, 2 insertions(+)
16
17 diff --git a/tools/gpgconf-comp.c b/tools/gpgconf-comp.c
18 index 85eb80ab5..180fd65c2 100644
19 --- a/tools/gpgconf-comp.c
20 +++ b/tools/gpgconf-comp.c
21 @@ -3328,6 +3328,8 @@ gc_component_change_options (int component, estream_t in, estream_t out,
22  
23            change_one_value (option, runtime, flags, new_value, 0);
24          }
25 +      if (length < 0 || gpgrt_ferror (in))
26 +       gc_error (1, errno, "error reading stream 'in'");
27      }
28  
29    /* Now that we have collected and locally verified the changes,