Revert "Revert "oran-shell-release: release image for F""
[pti/rtp.git] / meta-starlingx / meta-stx-distro / recipes-security / gssproxy / files / Fix-segfault-when-no-config-files-are-present.patch
1 From 76954aa028a897021a9bdcb0a1b5249e2652f7b6 Mon Sep 17 00:00:00 2001
2 From: Robbie Harwood <rharwood@redhat.com>
3 Date: Tue, 16 May 2017 14:16:23 -0400
4 Subject: [PATCH] Fix segfault when no config files are present
5
6 Resolves: rhbz#1451255
7 Signed-off-by: Robbie Harwood <rharwood@redhat.com>
8 Reviewed-by: Simo Sorce <simo@redhat.com>
9 Merges: #185
10 (cherry picked from commit df434333de34a13440857b511a4c60fbc6a71a5c)
11 ---
12  proxy/src/gp_config.c | 7 ++++---
13  1 file changed, 4 insertions(+), 3 deletions(-)
14
15 diff --git a/proxy/src/gp_config.c b/proxy/src/gp_config.c
16 index b4ab90c..8fd60a3 100644
17 --- a/proxy/src/gp_config.c
18 +++ b/proxy/src/gp_config.c
19 @@ -844,16 +844,17 @@ int gp_config_init(const char *config_file, const char *config_dir,
20  
21      if (config_file) {
22          ret = gp_config_from_file(config_file, ini_config, collision_flags);
23 -        if (ret == ENOENT) {
24 -            GPDEBUG("Expected config file %s but did not find it.\n",
25 +        if (ret) {
26 +            GPDEBUG("Error when trying to read config file %s.\n",
27                      config_file);
28 -        } else if (ret) {
29              return ret;
30          }
31      }
32      if (config_dir) {
33          ret = gp_config_from_dir(config_dir, &ini_config, collision_flags);
34          if (ret) {
35 +            GPDEBUG("Error when trying to read config directory %s.\n",
36 +                    config_dir);
37              return ret;
38          }
39      }