[SSSD] [PATCH] BUILD: Enable the sssd krb5 localauth plugin by default

Lukas Slebodnik lslebodn at redhat.com
Thu Nov 5 11:12:17 UTC 2015


ehlo,

attached simple patch is a result of "Fedora end of life"
message for related Fedora ticket.

If you have an idea about better names I will be glad to change them.

BTW shoulw we also remove this part from function
sss_write_krb5_conf_snippet

LS
-------------- next part --------------
>From c4d56af303ba4385cf9ef1c9053545c243f07a44 Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn at redhat.com>
Date: Thu, 5 Nov 2015 11:08:36 +0100
Subject: [PATCH] BUILD: Enable the sssd krb5 localauth plugin by default

It will be installed to /etc/krb.conf.d/ only on these
platforms which has krb5 with this directory

Resolves:
https://fedorahosted.org/sssd/ticket/2449
---
 Makefile.am                         | 15 ++++++++++++++-
 contrib/sssd.spec.in                |  3 +++
 src/examples/sssd_localauth.conf.in |  5 +++++
 src/external/krb5.m4                |  2 ++
 4 files changed, 24 insertions(+), 1 deletion(-)
 create mode 100644 src/examples/sssd_localauth.conf.in

diff --git a/Makefile.am b/Makefile.am
index 098beb01cc7963b8fe66f61226481c848dd00b72..3f76cb404f003d75b14d695d20b6ee53a12cca38 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -55,6 +55,7 @@ sssdapiplugindir = $(sssddatadir)/sssd.api.d
 dbuspolicydir = $(sysconfdir)/dbus-1/system.d
 dbusservicedir = $(datadir)/dbus-1/system-services
 sss_statedir = $(localstatedir)/lib/sss
+krb5_conf_subdir =  $(sysconfdir)/krb5.conf.d/
 localedir = @localedir@
 nsslibdir = @nsslibdir@
 pamlibdir = @pammoddir@
@@ -312,6 +313,10 @@ endif
 if BUILD_KRB5_LOCALAUTH_PLUGIN
 krb5localauth_plugin_LTLIBRARIES = \
     sssd_krb5_localauth_plugin.la
+
+if HAVE_KRB5_CONF_D
+krb5_conf_sub_DATA = src/examples/sssd_localauth.conf
+endif
 endif
 
 if BUILD_PAC_RESPONDER
@@ -3404,6 +3409,7 @@ edit_cmd = $(SED) \
         -e 's|@sbindir[@]|$(sbindir)|g' \
         -e 's|@environment_file[@]|$(environment_file)|g' \
         -e 's|@localstatedir[@]|$(localstatedir)|g' \
+        -e 's|@krb5localauth_plugindir[@]|$(krb5localauth_plugindir)|g' \
         -e 's|@prefix[@]|$(prefix)|g'
 
 replace_script = \
@@ -3415,7 +3421,9 @@ replace_script = \
 
 EXTRA_DIST += \
     src/sysv/systemd/sssd.service.in \
-    src/sysv/systemd/journal.conf.in
+    src/sysv/systemd/journal.conf.in \
+    src/examples/sssd_localauth.conf.in \
+    $(NULL)
 
 src/sysv/systemd/sssd.service: src/sysv/systemd/sssd.service.in Makefile
 	@$(MKDIR_P) src/sysv/systemd/
@@ -3425,6 +3433,10 @@ src/sysv/systemd/journal.conf: src/sysv/systemd/journal.conf.in Makefile
 	@$(MKDIR_P) src/sysv/systemd/
 	$(replace_script)
 
+src/examples/sssd_localauth.conf: src/examples/sssd_localauth.conf.in Makefile
+	@$(MKDIR_P) src/examples/
+	$(replace_script)
+
 SSSD_USER_DIRS = \
     $(DESTDIR)$(dbpath) \
     $(DESTDIR)$(keytabdir) \
@@ -3637,6 +3649,7 @@ endif
 	rm -Rf ldb_mod_test_dir
 	rm -f $(builddir)/src/sysv/systemd/sssd.service
 	rm -f $(builddir)/src/sysv/systemd/journal.conf
+	rm -f $(builddir)/src/examples/sssd_localauth.conf
 
 CLEANFILES = *.X */*.X */*/*.X
 
diff --git a/contrib/sssd.spec.in b/contrib/sssd.spec.in
index e0367e4608956917375e2e9f983c4397897d4284..e147875d4fa857519a0550fdbc297980f9c7d408 100644
--- a/contrib/sssd.spec.in
+++ b/contrib/sssd.spec.in
@@ -822,6 +822,9 @@ rm -rf $RPM_BUILD_ROOT
 %endif
 %if (0%{?with_krb5_localauth_plugin} == 1)
 %{_libdir}/%{name}/modules/sssd_krb5_localauth_plugin.so
+%if (0%{?fedora})
+%{_sysconfdir}/krb5.conf.d/sssd_localauth.conf
+%endif
 %endif
 %{_mandir}/man8/pam_sss.8*
 %{_mandir}/man8/sssd_krb5_locator_plugin.8*
diff --git a/src/examples/sssd_localauth.conf.in b/src/examples/sssd_localauth.conf.in
new file mode 100644
index 0000000000000000000000000000000000000000..950cab8200eb50d7fc878723d38c93d5b616e468
--- /dev/null
+++ b/src/examples/sssd_localauth.conf.in
@@ -0,0 +1,5 @@
+[plugins]
+ localauth = {
+  module = sssd:@krb5localauth_plugindir@/sssd_krb5_localauth_plugin.so
+  enable_only = sssd
+ }
diff --git a/src/external/krb5.m4 b/src/external/krb5.m4
index 8fc9096c7fe70cf9bb682f1086b3bba07e936936..e3f156f336b69075d3de950d8e207f3755bb2ec1 100644
--- a/src/external/krb5.m4
+++ b/src/external/krb5.m4
@@ -112,5 +112,7 @@ AM_CONDITIONAL([BUILD_KRB5_LOCALAUTH_PLUGIN],
 AM_COND_IF([BUILD_KRB5_LOCALAUTH_PLUGIN],
            [AC_DEFINE_UNQUOTED(HAVE_KRB5_LOCALAUTH_PLUGIN, 1, [Build with krb5 localauth plugin])])
 
+AM_CONDITIONAL([HAVE_KRB5_CONF_D], [test -d /etc/krb5.conf.d/])
+
 CFLAGS=$SAVE_CFLAGS
 LIBS=$SAVE_LIBS
-- 
2.5.0



More information about the sssd-devel mailing list