URL: https://github.com/SSSD/sssd/pull/108
Author: lslebodn
 Title: #108: Partially revert "CONFIG: Use default config when none provided"
Action: opened

PR body:
"""
This reverts part of commit 59744cff6edb106ae799b2321cb8731edadf409a.

Removed is copying of default configuration into /etc/sssd/sssd.conf
Sample configurations is still part of installation.

Copying default configuration from /usr/lib64/sssd/conf/sssd.conf -> 
/etc/sssd/sssd.conf
is not the best idea. There are better way how to use default configuration
and we will need to change anyway due to files provider.

I can revert sample configuration as well.

"""

To pull the PR as Git branch:
git remote add ghsssd https://github.com/SSSD/sssd
git fetch ghsssd pull/108/head:pr108
git checkout pr108
From 829aa39dffbe35f58b34159b962a2dd8de85fd30 Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <[email protected]>
Date: Mon, 12 Dec 2016 18:33:48 +0100
Subject: [PATCH] Partially revert "CONFIG: Use default config when none
 provided"

This reverts part of commit 59744cff6edb106ae799b2321cb8731edadf409a.

Removed is copying of default configuration into /etc/sssd/sssd.conf
Sample configurations is still part of installation.
---
 Makefile.am               |  3 ---
 src/confdb/confdb.h       |  1 -
 src/confdb/confdb_setup.c | 40 ++++------------------------------------
 3 files changed, 4 insertions(+), 40 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index a15e68f..45d4414 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -462,7 +462,6 @@ AM_CPPFLAGS = \
     -DSSSDDATADIR=\"$(sssddatadir)\" \
     -DSSSD_LIBEXEC_PATH=\"$(sssdlibexecdir)\" \
     -DSSSD_CONF_DIR=\"$(sssdconfdir)\" \
-    -DSSSD_DEFAULT_CONF_DIR=\"$(sssddefaultconfdir)\" \
     -DSSS_NSS_MCACHE_DIR=\"$(mcpath)\" \
     -DSSS_NSS_SOCKET_NAME=\"$(pipepath)/nss\" \
     -DSSS_PAM_SOCKET_NAME=\"$(pipepath)/pam\" \
@@ -1232,8 +1231,6 @@ sssd_SOURCES = \
     src/confdb/confdb_setup.c \
     src/monitor/monitor_iface_generated.c \
     src/util/nscd.c \
-    src/tools/files.c \
-    src/tools/selinux.c \
     $(NULL)
 sssd_LDADD = \
     $(SSSD_LIBS) \
diff --git a/src/confdb/confdb.h b/src/confdb/confdb.h
index 12beaab..4813072 100644
--- a/src/confdb/confdb.h
+++ b/src/confdb/confdb.h
@@ -40,7 +40,6 @@
 
 #define CONFDB_DEFAULT_CFG_FILE_VER 2
 #define CONFDB_FILE "config.ldb"
-#define SSSD_DEFAULT_CONFIG_FILE SSSD_DEFAULT_CONF_DIR"/sssd.conf"
 #define SSSD_CONFIG_FILE SSSD_CONF_DIR"/sssd.conf"
 #define CONFDB_DEFAULT_CONFIG_DIR SSSD_CONF_DIR"/conf.d"
 #define SSSD_MIN_ID 1
diff --git a/src/confdb/confdb_setup.c b/src/confdb/confdb_setup.c
index d6feab9..a71d9dd 100644
--- a/src/confdb/confdb_setup.c
+++ b/src/confdb/confdb_setup.c
@@ -21,14 +21,12 @@
 
 #include "config.h"
 #include <sys/stat.h>
-#include <unistd.h>
 #include "util/util.h"
 #include "db/sysdb.h"
 #include "confdb.h"
 #include "confdb_private.h"
 #include "confdb_setup.h"
 #include "util/sss_ini.h"
-#include "tools/tools_util.h"
 
 
 static int confdb_test(struct confdb_ctx *cdb)
@@ -161,41 +159,11 @@ static int confdb_init_db(const char *config_file, const char *config_dir,
         DEBUG(SSSDBG_TRACE_FUNC,
               "sss_ini_config_file_open failed: %s [%d]\n", strerror(ret),
                ret);
-        if (ret != ENOENT) {
-            /* Anything other than ENOENT is unrecoverable */
-            goto done;
-        } else {
-            /* Copy the default configuration file to the standard location
-             * and then retry
-             */
-             ret = copy_file_secure(SSSD_DEFAULT_CONFIG_FILE,
-                                    SSSD_CONFIG_FILE,
-                                    0600,
-                                    getuid(),
-                                    getgid(),
-                                    false);
-             if (ret != EOK) {
-                 DEBUG(SSSDBG_FATAL_FAILURE,
-                       "Could not copy default configuration: %s",
-                       sss_strerror(ret));
-                 /* sss specific error denoting missing configuration file */
-                 ret = ERR_MISSING_CONF;
-                 goto done;
-             }
-
-             /* Try again */
-             ret = sss_ini_config_file_open(init_data, config_file);
-            if (ret != EOK) {
-                DEBUG(SSSDBG_TRACE_FUNC,
-                      "sss_ini_config_file_open(default) failed: %s [%d]\n",
-                      strerror(ret), ret);
-                if (ret == ENOENT) {
-                    /* sss specific error denoting missing configuration file */
-                    ret = ERR_MISSING_CONF;
-                }
-                goto done;
-            }
+        if (ret == ENOENT) {
+            /* sss specific error denoting missing configuration file */
+            ret = ERR_MISSING_CONF;
         }
+        goto done;
     }
 
     ret = sss_ini_config_access_check(init_data);
_______________________________________________
sssd-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to