Blame SOURCES/0127-Revert-CONFIG-Use-default-config-when-none-provided.patch

b2d430
From 17ba1565f6dc3874c554f37ca949ad284647141d Mon Sep 17 00:00:00 2001
b2d430
From: Jakub Hrozek <jhrozek@redhat.com>
b2d430
Date: Wed, 7 Sep 2016 17:21:19 +0200
b2d430
Subject: [PATCH 127/127] Revert "CONFIG: Use default config when none
b2d430
 provided"
b2d430
b2d430
This reverts commit 59744cff6edb106ae799b2321cb8731edadf409a.
b2d430
---
b2d430
 Makefile.am                   | 10 ----------
b2d430
 contrib/sssd.spec.in          |  3 ---
b2d430
 src/confdb/confdb.h           |  1 -
b2d430
 src/confdb/confdb_setup.c     | 40 ++++------------------------------------
b2d430
 src/examples/sssd-shadowutils |  6 ------
b2d430
 src/examples/sssd.conf        | 17 -----------------
b2d430
 6 files changed, 4 insertions(+), 73 deletions(-)
b2d430
 delete mode 100644 src/examples/sssd-shadowutils
b2d430
 delete mode 100644 src/examples/sssd.conf
b2d430
b2d430
diff --git a/Makefile.am b/Makefile.am
b2d430
index b8cd8b64ca8a130a5dd3107e1fb1445310192059..056c73bb265523705a0de16d4d5e078f516f566f 100644
b2d430
--- a/Makefile.am
b2d430
+++ b/Makefile.am
b2d430
@@ -35,7 +35,6 @@ endif
b2d430
 
b2d430
 sssdlibexecdir = $(libexecdir)/sssd
b2d430
 sssdlibdir = $(libdir)/sssd
b2d430
-sssddefaultconfdir = $(sssdlibdir)/conf
b2d430
 ldblibdir = @ldblibdir@
b2d430
 if BUILD_KRB5_LOCATOR_PLUGIN
b2d430
 krb5plugindir = @krb5pluginpath@
b2d430
@@ -85,7 +84,6 @@ pkgconfigdir = $(libdir)/pkgconfig
b2d430
 krb5rcachedir = @krb5rcachedir@
b2d430
 sudolibdir = @sudolibpath@
b2d430
 polkitdir = @polkitdir@
b2d430
-pamconfdir = $(sysconfdir)/pam.d
b2d430
 systemtap_tapdir = @tapset_dir@
b2d430
 
b2d430
 secdbpath = @secdbpath@
b2d430
@@ -464,7 +462,6 @@ AM_CPPFLAGS = \
b2d430
     -DSSSDDATADIR=\"$(sssddatadir)\" \
b2d430
     -DSSSD_LIBEXEC_PATH=\"$(sssdlibexecdir)\" \
b2d430
     -DSSSD_CONF_DIR=\"$(sssdconfdir)\" \
b2d430
-    -DSSSD_DEFAULT_CONF_DIR=\"$(sssddefaultconfdir)\" \
b2d430
     -DSSS_NSS_MCACHE_DIR=\"$(mcpath)\" \
b2d430
     -DSSS_NSS_SOCKET_NAME=\"$(pipepath)/nss\" \
b2d430
     -DSSS_PAM_SOCKET_NAME=\"$(pipepath)/pam\" \
b2d430
@@ -1465,12 +1462,6 @@ dist_noinst_DATA += \
b2d430
     src/sss_client/COPYING.LESSER \
b2d430
     src/m4
b2d430
 
b2d430
-dist_sssddefaultconf_DATA = \
b2d430
-    src/examples/sssd.conf
b2d430
-
b2d430
-dist_pamconf_DATA = \
b2d430
-    src/examples/sssd-shadowutils
b2d430
-
b2d430
 ######################
b2d430
 # Command-line Tools #
b2d430
 ######################
b2d430
@@ -3972,7 +3963,6 @@ SSSD_USER_DIRS = \
b2d430
     $(DESTDIR)$(gpocachepath) \
b2d430
     $(DESTDIR)$(sssdconfdir) \
b2d430
     $(DESTDIR)$(sssdconfdir)/conf.d \
b2d430
-    $(DESTDIR)$(sssddefaultconfdir) \
b2d430
     $(DESTDIR)$(logpath) \
b2d430
     $(NULL)
b2d430
 
b2d430
diff --git a/contrib/sssd.spec.in b/contrib/sssd.spec.in
b2d430
index cb68a73e85122b016de7df37bcf4fc232a10a2ac..4e24aa39c65ad698607615d93de8624e2e1832ff 100644
b2d430
--- a/contrib/sssd.spec.in
b2d430
+++ b/contrib/sssd.spec.in
b2d430
@@ -800,9 +800,6 @@ done
b2d430
 %dir %{_sysconfdir}/rwtab.d
b2d430
 %config(noreplace) %{_sysconfdir}/rwtab.d/sssd
b2d430
 %dir %{_datadir}/sssd
b2d430
-%{_sysconfdir}/pam.d/sssd-shadowutils
b2d430
-%{_libdir}/%{name}/conf/sssd.conf
b2d430
-
b2d430
 %{_datadir}/sssd/cfg_rules.ini
b2d430
 %{_datadir}/sssd/sssd.api.conf
b2d430
 %{_datadir}/sssd/sssd.api.d
b2d430
diff --git a/src/confdb/confdb.h b/src/confdb/confdb.h
b2d430
index 72adbd80ea534eb0becd3e517c00b0c26d00444c..e8df280562d7014e0dc5d4fe5c3336eaba204537 100644
b2d430
--- a/src/confdb/confdb.h
b2d430
+++ b/src/confdb/confdb.h
b2d430
@@ -40,7 +40,6 @@
b2d430
 
b2d430
 #define CONFDB_DEFAULT_CFG_FILE_VER 2
b2d430
 #define CONFDB_FILE "config.ldb"
b2d430
-#define SSSD_DEFAULT_CONFIG_FILE SSSD_DEFAULT_CONF_DIR"/sssd.conf"
b2d430
 #define SSSD_CONFIG_FILE SSSD_CONF_DIR"/sssd.conf"
b2d430
 #define CONFDB_DEFAULT_CONFIG_DIR SSSD_CONF_DIR"/conf.d"
b2d430
 #define SSSD_MIN_ID 1
b2d430
diff --git a/src/confdb/confdb_setup.c b/src/confdb/confdb_setup.c
b2d430
index d6feab9000d54d2c3761de6d8e990053ade7e85f..a71d9dd1202824b3c9a7e69f1d8fa905ac1b8c02 100644
b2d430
--- a/src/confdb/confdb_setup.c
b2d430
+++ b/src/confdb/confdb_setup.c
b2d430
@@ -21,14 +21,12 @@
b2d430
 
b2d430
 #include "config.h"
b2d430
 #include <sys/stat.h>
b2d430
-#include <unistd.h>
b2d430
 #include "util/util.h"
b2d430
 #include "db/sysdb.h"
b2d430
 #include "confdb.h"
b2d430
 #include "confdb_private.h"
b2d430
 #include "confdb_setup.h"
b2d430
 #include "util/sss_ini.h"
b2d430
-#include "tools/tools_util.h"
b2d430
 
b2d430
 
b2d430
 static int confdb_test(struct confdb_ctx *cdb)
b2d430
@@ -161,41 +159,11 @@ static int confdb_init_db(const char *config_file, const char *config_dir,
b2d430
         DEBUG(SSSDBG_TRACE_FUNC,
b2d430
               "sss_ini_config_file_open failed: %s [%d]\n", strerror(ret),
b2d430
                ret);
b2d430
-        if (ret != ENOENT) {
b2d430
-            /* Anything other than ENOENT is unrecoverable */
b2d430
-            goto done;
b2d430
-        } else {
b2d430
-            /* Copy the default configuration file to the standard location
b2d430
-             * and then retry
b2d430
-             */
b2d430
-             ret = copy_file_secure(SSSD_DEFAULT_CONFIG_FILE,
b2d430
-                                    SSSD_CONFIG_FILE,
b2d430
-                                    0600,
b2d430
-                                    getuid(),
b2d430
-                                    getgid(),
b2d430
-                                    false);
b2d430
-             if (ret != EOK) {
b2d430
-                 DEBUG(SSSDBG_FATAL_FAILURE,
b2d430
-                       "Could not copy default configuration: %s",
b2d430
-                       sss_strerror(ret));
b2d430
-                 /* sss specific error denoting missing configuration file */
b2d430
-                 ret = ERR_MISSING_CONF;
b2d430
-                 goto done;
b2d430
-             }
b2d430
-
b2d430
-             /* Try again */
b2d430
-             ret = sss_ini_config_file_open(init_data, config_file);
b2d430
-            if (ret != EOK) {
b2d430
-                DEBUG(SSSDBG_TRACE_FUNC,
b2d430
-                      "sss_ini_config_file_open(default) failed: %s [%d]\n",
b2d430
-                      strerror(ret), ret);
b2d430
-                if (ret == ENOENT) {
b2d430
-                    /* sss specific error denoting missing configuration file */
b2d430
-                    ret = ERR_MISSING_CONF;
b2d430
-                }
b2d430
-                goto done;
b2d430
-            }
b2d430
+        if (ret == ENOENT) {
b2d430
+            /* sss specific error denoting missing configuration file */
b2d430
+            ret = ERR_MISSING_CONF;
b2d430
         }
b2d430
+        goto done;
b2d430
     }
b2d430
 
b2d430
     ret = sss_ini_config_access_check(init_data);
b2d430
diff --git a/src/examples/sssd-shadowutils b/src/examples/sssd-shadowutils
b2d430
deleted file mode 100644
b2d430
index 626c7d075dfbf97dd91e259f94c6061689c83e9e..0000000000000000000000000000000000000000
b2d430
--- a/src/examples/sssd-shadowutils
b2d430
+++ /dev/null
b2d430
@@ -1,6 +0,0 @@
b2d430
-#%PAM-1.0
b2d430
-auth        [success=done ignore=ignore default=die] pam_unix.so nullok try_first_pass
b2d430
-auth        required      pam_deny.so
b2d430
-
b2d430
-account     required      pam_unix.so
b2d430
-account     required      pam_permit.so
b2d430
diff --git a/src/examples/sssd.conf b/src/examples/sssd.conf
b2d430
deleted file mode 100644
b2d430
index a851dbb7ecd5c3220fbd6a946a6c7be2822dbd27..0000000000000000000000000000000000000000
b2d430
--- a/src/examples/sssd.conf
b2d430
+++ /dev/null
b2d430
@@ -1,17 +0,0 @@
b2d430
-[sssd]
b2d430
-config_file_version = 2
b2d430
-services = nss, pam
b2d430
-domains = shadowutils
b2d430
-
b2d430
-[nss]
b2d430
-
b2d430
-[pam]
b2d430
-
b2d430
-[domain/shadowutils]
b2d430
-id_provider = proxy
b2d430
-proxy_lib_name = files
b2d430
-
b2d430
-auth_provider = proxy
b2d430
-proxy_pam_target = sssd-shadowutils
b2d430
-
b2d430
-proxy_fast_alias = True
b2d430
-- 
b2d430
2.7.4
b2d430