]> git.ipfire.org Git - ipfire-3.x.git/blob - sssd/patches/0501-Partially-revert-CONFIG-Use-default-config-when-none.patch
git: Update to 2.23.0
[ipfire-3.x.git] / sssd / patches / 0501-Partially-revert-CONFIG-Use-default-config-when-none.patch
1 From 829aa39dffbe35f58b34159b962a2dd8de85fd30 Mon Sep 17 00:00:00 2001
2 From: Lukas Slebodnik <lslebodn@redhat.com>
3 Date: Mon, 12 Dec 2016 18:33:48 +0100
4 Subject: [PATCH] Partially revert "CONFIG: Use default config when none
5 provided"
6
7 This reverts part of commit 59744cff6edb106ae799b2321cb8731edadf409a.
8
9 Removed is copying of default configuration into /etc/sssd/sssd.conf
10 Sample configurations is still part of installation.
11 ---
12 Makefile.am | 3 ---
13 src/confdb/confdb.h | 1 -
14 src/confdb/confdb_setup.c | 40 ++++------------------------------------
15 3 files changed, 4 insertions(+), 40 deletions(-)
16
17 diff --git a/Makefile.am b/Makefile.am
18 index a15e68f682f6d8af301e11df8dcaef6d7f27e8c0..45d44146e737fc8460a2ed9ffc0171a6bb494b2b 100644
19 --- a/Makefile.am
20 +++ b/Makefile.am
21 @@ -462,7 +462,6 @@ AM_CPPFLAGS = \
22 -DSSSDDATADIR=\"$(sssddatadir)\" \
23 -DSSSD_LIBEXEC_PATH=\"$(sssdlibexecdir)\" \
24 -DSSSD_CONF_DIR=\"$(sssdconfdir)\" \
25 - -DSSSD_DEFAULT_CONF_DIR=\"$(sssddefaultconfdir)\" \
26 -DSSS_NSS_MCACHE_DIR=\"$(mcpath)\" \
27 -DSSS_NSS_SOCKET_NAME=\"$(pipepath)/nss\" \
28 -DSSS_PAM_SOCKET_NAME=\"$(pipepath)/pam\" \
29 @@ -1232,8 +1231,6 @@ sssd_SOURCES = \
30 src/confdb/confdb_setup.c \
31 src/monitor/monitor_iface_generated.c \
32 src/util/nscd.c \
33 - src/tools/files.c \
34 - src/tools/selinux.c \
35 $(NULL)
36 sssd_LDADD = \
37 $(SSSD_LIBS) \
38 diff --git a/src/confdb/confdb.h b/src/confdb/confdb.h
39 index 12beaabf8c949bd111abbe16cb98a205490fb08f..4813072bdafb5d6c9ec56a9ccaa5db6a1120112d 100644
40 --- a/src/confdb/confdb.h
41 +++ b/src/confdb/confdb.h
42 @@ -40,7 +40,6 @@
43
44 #define CONFDB_DEFAULT_CFG_FILE_VER 2
45 #define CONFDB_FILE "config.ldb"
46 -#define SSSD_DEFAULT_CONFIG_FILE SSSD_DEFAULT_CONF_DIR"/sssd.conf"
47 #define SSSD_CONFIG_FILE SSSD_CONF_DIR"/sssd.conf"
48 #define CONFDB_DEFAULT_CONFIG_DIR SSSD_CONF_DIR"/conf.d"
49 #define SSSD_MIN_ID 1
50 diff --git a/src/confdb/confdb_setup.c b/src/confdb/confdb_setup.c
51 index d6feab9000d54d2c3761de6d8e990053ade7e85f..a71d9dd1202824b3c9a7e69f1d8fa905ac1b8c02 100644
52 --- a/src/confdb/confdb_setup.c
53 +++ b/src/confdb/confdb_setup.c
54 @@ -21,14 +21,12 @@
55
56 #include "config.h"
57 #include <sys/stat.h>
58 -#include <unistd.h>
59 #include "util/util.h"
60 #include "db/sysdb.h"
61 #include "confdb.h"
62 #include "confdb_private.h"
63 #include "confdb_setup.h"
64 #include "util/sss_ini.h"
65 -#include "tools/tools_util.h"
66
67
68 static int confdb_test(struct confdb_ctx *cdb)
69 @@ -161,41 +159,11 @@ static int confdb_init_db(const char *config_file, const char *config_dir,
70 DEBUG(SSSDBG_TRACE_FUNC,
71 "sss_ini_config_file_open failed: %s [%d]\n", strerror(ret),
72 ret);
73 - if (ret != ENOENT) {
74 - /* Anything other than ENOENT is unrecoverable */
75 - goto done;
76 - } else {
77 - /* Copy the default configuration file to the standard location
78 - * and then retry
79 - */
80 - ret = copy_file_secure(SSSD_DEFAULT_CONFIG_FILE,
81 - SSSD_CONFIG_FILE,
82 - 0600,
83 - getuid(),
84 - getgid(),
85 - false);
86 - if (ret != EOK) {
87 - DEBUG(SSSDBG_FATAL_FAILURE,
88 - "Could not copy default configuration: %s",
89 - sss_strerror(ret));
90 - /* sss specific error denoting missing configuration file */
91 - ret = ERR_MISSING_CONF;
92 - goto done;
93 - }
94 -
95 - /* Try again */
96 - ret = sss_ini_config_file_open(init_data, config_file);
97 - if (ret != EOK) {
98 - DEBUG(SSSDBG_TRACE_FUNC,
99 - "sss_ini_config_file_open(default) failed: %s [%d]\n",
100 - strerror(ret), ret);
101 - if (ret == ENOENT) {
102 - /* sss specific error denoting missing configuration file */
103 - ret = ERR_MISSING_CONF;
104 - }
105 - goto done;
106 - }
107 + if (ret == ENOENT) {
108 + /* sss specific error denoting missing configuration file */
109 + ret = ERR_MISSING_CONF;
110 }
111 + goto done;
112 }
113
114 ret = sss_ini_config_access_check(init_data);
115 --
116 2.11.0
117