[SSSD] [PATCH] BUILD: Link libsss_krb5_common.so to libkeyutils.so

Lukas Slebodnik lslebodn at redhat.com
Sat Mar 15 16:57:35 UTC 2014


On (12/11/13 11:15), Simo Sorce wrote:
>On Tue, 2013-11-12 at 11:03 -0500, Simo Sorce wrote:
>> On Tue, 2013-11-12 at 16:23 +0100, Lukas Slebodnik wrote:
>
>> > Updated patches are attached.
>> 
>> This is not the right way to fix the failure.
>> 
>> That library *knowingly* has missing symbols because it is an internal
>> library.
>> 
>> You need to build or link to an outer program that have only the
>> necessary symbols you know are going to be available.
>> 
>> In this case those symbols are in libsss_krb5.so, so all you should nee
>> to do is to have this in tests:
>> 
>> +    { "libsss_krb5_common.so", { LIBPFX"libdlopen_test_providers.so",
>> +                                 LIBPFX"libsss_krb5_common.so",
>> + 				  LIBPFX"libsss_krb5.so",
>> + 				  NULL } },
>> 
>> Adding c files to librraies to "make them pass" the dl-open test is
>> wrong in 99% of the cases. you are just making the test pass not testing
>> that the libraries have the right dependencies. In particular for
>> internal modules you really need to understand the hierarchy of the
>> modules and link in the test all the necessary dependencies before
>> thinking of adding any file to the module itself.
>> 
>> In this case what you did was to duplicate symblos in the resulting Text
>> file, and that can potentially cause very serious consequencies if any
>> of those symbols is a static symbols that is meant to have a share de
>> value all code rely on.
>
>Oh let me add.
>I did my check very quickly so it is possible that my version is not the
>final correct approach, I was just describing how you should pass in
>multiple libs for dependency.
>
>It is possible that you need those symbols directly in
>libsss_krb5_common.so, but if that is actually the case, then it means
>you have to remove those symbols from libsss_krb5.so and add them
>libsss_krb5_common.so as dependency for libsss_krb5.so in makefile and
>tests. This may even require moving functions from one file to another
>in the extreme case.
>

zombie patches are returning :-)

I hope all commit messages are self descripting.

They were lot of changes in Makefile.am
sh-4.2$ git diff --stat HEAD~6..HEAD Makefile.am
 Makefile.am | 99 +++++++++++++++++++------------------------------------------
 1 file changed, 31 insertions(+), 68 deletions(-)

LS
-------------- next part --------------
>From c3c1541ffa684e764a0a96be63dd3f5239a747d2 Mon Sep 17 00:00:00 2001
From: Benjamin Franzke <benjaminfranzke at googlemail.com>
Date: Wed, 16 Oct 2013 13:23:48 +0200
Subject: [PATCH 1/6] BUILD: Link libsss_krb5_common.so to libkeyutils.so

The symbol add_key (from libkeyutils) is used by
function add_user_to_delayed_online_authentication
(from file src/providers/krb5/krb5_delayed_online_authentication.c)
which is part of libsss_krb5_common.so

Fixes following error:
[sssd[be[default]]] [load_backend_module]
  (0x0010): Unable to load ad module with path
  (/usr/lib64/sssd/libsss_ad.so), error:
  /usr/lib64/sssd/libsss_krb5_common.so: undefined symbol: add_key

-lkeyutils was passed to the libraries libsss_{krb5,ipa,ad}.so,
but when compiling with -Wl,--as-needed this flag will be ignored,
since it is not used directly. So it was unavailable to
libsss_krb5_common.so which actually needs it.

This patch removes $(KEYUTILS_LIBS) from those libraries and adds it to
libsss_krb5_common.so
---
 Makefile.am | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index f3196242d6691114738c58d5c2b60cffd1c0031a..2540988b0b44cb23842e6afb89a8773f4f55324a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1831,6 +1831,8 @@ libsss_krb5_common_la_SOURCES = \
     src/providers/krb5/krb5_access.c \
     src/providers/krb5/krb5_child_handler.c \
     src/providers/krb5/krb5_init_shared.c
+libsss_krb5_common_la_LIBADD = \
+    $(KEYUTILS_LIBS)
 libsss_krb5_common_la_LDFLAGS = \
     -avoid-version
 libsss_krb5_common_la_CFLAGS = \
@@ -1902,7 +1904,6 @@ libsss_krb5_la_CFLAGS = \
 libsss_krb5_la_LIBADD = \
     $(SYSTEMD_LOGIN_LIBS) \
     $(DHASH_LIBS) \
-    $(KEYUTILS_LIBS) \
     $(KRB5_LIBS) \
     libsss_krb5_common.la
 libsss_krb5_la_LDFLAGS = \
@@ -1956,7 +1957,6 @@ libsss_ipa_la_LIBADD = \
     $(OPENLDAP_LIBS) \
     $(DHASH_LIBS) \
     $(NDR_NBT_LIBS) \
-    $(KEYUTILS_LIBS) \
     $(KRB5_LIBS) \
     $(SELINUX_LIBS) \
     libsss_ldap_common.la \
@@ -2019,7 +2019,6 @@ libsss_ad_la_LIBADD = \
     $(OPENLDAP_LIBS) \
     $(SASL_LIBS) \
     $(DHASH_LIBS) \
-    $(KEYUTILS_LIBS) \
     $(KRB5_LIBS) \
     $(NDR_NBT_LIBS) \
     libsss_ldap_common.la \
-- 
1.8.5.3

-------------- next part --------------
>From a955e9194f634aa1cbacf34eb78afa2394ffd307 Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn at redhat.com>
Date: Sat, 15 Mar 2014 15:21:09 +0100
Subject: [PATCH 2/6] BUILD: Move file find_uid.c into libsss_util.so

Functions from module find_uid.c were duplicated in many libraries.
e.g. symol check_if_uid_is_active was in libsss_ad.so, libsss_ipa.so,
    libsss_krb5.so, libsss_ldap.so
---
 Makefile.am | 44 ++++++++++++--------------------------------
 1 file changed, 12 insertions(+), 32 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 2540988b0b44cb23842e6afb89a8773f4f55324a..2f2489aaca5fab5893f3eca8a8449e9660085b21 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -614,12 +614,17 @@ libsss_util_la_SOURCES = \
     src/util/domain_info_utils.c \
     src/util/util_lock.c \
     src/util/util_errors.c \
+    src/util/find_uid.c \
     src/util/sss_ini.c \
     src/util/io.c \
     src/util/util_sss_idmap.c \
     src/util/well_known_sids.c
+libsss_util_la_CFLAGS = \
+    $(AM_CFLAGS) \
+    $(SYSTEMD_LOGIN_CFLAGS)
 libsss_util_la_LIBADD = \
     $(SSSD_LIBS) \
+    $(SYSTEMD_LOGIN_LIBS) \
     $(UNICODE_LIBS)
 if BUILD_SUDO
     libsss_util_la_SOURCES += src/db/sysdb_sudo.c
@@ -850,16 +855,13 @@ sss_useradd_LDADD = \
 
 sss_userdel_SOURCES = \
     src/tools/sss_userdel.c \
-    src/util/find_uid.c \
     $(SSSD_LCL_TOOLS_OBJ)
 sss_userdel_LDADD = \
     $(TOOLS_LIBS) \
-    $(SYSTEMD_LOGIN_LIBS) \
     $(SSSD_INTERNAL_LTLIBS) \
     $(CLIENT_LIBS)
 sss_userdel_CFLAGS = \
-    $(AM_CFLAGS) \
-    $(SYSTEMD_LOGIN_CFLAGS)
+    $(AM_CFLAGS)
 
 sss_groupadd_SOURCES = \
     src/tools/sss_groupadd.c \
@@ -1054,7 +1056,6 @@ krb5_utils_tests_SOURCES = \
     src/providers/krb5/krb5_become_user.c \
     src/providers/krb5/krb5_common.c \
     src/util/sss_krb5.c \
-    src/util/find_uid.c \
     src/providers/data_provider_fo.c \
     src/providers/data_provider_opts.c \
     src/providers/data_provider_callbacks.c \
@@ -1062,14 +1063,12 @@ krb5_utils_tests_SOURCES = \
 krb5_utils_tests_CFLAGS = \
     $(AM_CFLAGS) \
     $(KRB5_CFLAGS) \
-    $(CHECK_CFLAGS) \
-    $(SYSTEMD_LOGIN_CFLAGS)
+    $(CHECK_CFLAGS)
 krb5_utils_tests_LDADD = \
     $(SSSD_LIBS)\
     $(CARES_LIBS) \
     $(KRB5_LIBS) \
     $(CHECK_LIBS) \
-    $(SYSTEMD_LOGIN_LIBS) \
     $(SSSD_INTERNAL_LTLIBS) \
     libsss_test_common.la
 
@@ -1334,7 +1333,6 @@ krb5_child_test_SOURCES = \
     src/providers/krb5/krb5_become_user.c \
     src/providers/krb5/krb5_common.c \
     src/util/sss_krb5.c \
-    src/util/find_uid.c \
     src/providers/data_provider_fo.c \
     src/providers/data_provider_opts.c \
     src/providers/data_provider_callbacks.c \
@@ -1343,14 +1341,12 @@ krb5_child_test_CFLAGS = \
     $(AM_CFLAGS) \
     -DKRB5_CHILD_DIR=\"$(builddir)\" \
     $(KRB5_CFLAGS) \
-    $(CHECK_CFLAGS) \
-    $(SYSTEMD_LOGIN_CFLAGS)
+    $(CHECK_CFLAGS)
 krb5_child_test_LDADD = \
     $(SSSD_LIBS) \
     $(CARES_LIBS) \
     $(KRB5_LIBS) \
     $(CHECK_LIBS) \
-    $(SYSTEMD_LOGIN_LIBS) \
     $(SSSD_INTERNAL_LTLIBS) \
     libsss_test_common.la
 
@@ -1565,7 +1561,6 @@ test_search_bases_SOURCES = \
     $(sssd_be_SOURCES) \
     src/util/sss_ldap.c \
     src/util/sss_krb5.c \
-    src/util/find_uid.c \
     src/util/user_info_msg.c \
     src/tests/cmocka/test_search_bases.c
 test_search_bases_CFLAGS = \
@@ -1579,7 +1574,6 @@ test_search_bases_LDADD = \
     $(CARES_LIBS) \
     $(KRB5_LIBS) \
     $(SSSD_INTERNAL_LTLIBS) \
-    $(SYSTEMD_LOGIN_LIBS) \
     libsss_ldap_common.la \
     libsss_idmap.la \
     libsss_krb5_common.la \
@@ -1589,13 +1583,11 @@ ad_access_filter_tests_SOURCES = \
     $(sssd_be_SOURCES) \
     src/util/sss_ldap.c \
     src/util/sss_krb5.c \
-    src/util/find_uid.c \
     src/util/user_info_msg.c \
     src/providers/ad/ad_common.c \
     src/tests/cmocka/test_ad_access_filter.c
 ad_access_filter_tests_CFLAGS = \
     $(AM_CFLAGS) \
-    $(SYSTEMD_LOGIN_CFLAGS) \
     -DUNIT_TESTING
 ad_access_filter_tests_LDADD = \
     $(PAM_LIBS) \
@@ -1604,7 +1596,6 @@ ad_access_filter_tests_LDADD = \
     $(CARES_LIBS) \
     $(KRB5_LIBS) \
     $(SSSD_INTERNAL_LTLIBS) \
-    $(SYSTEMD_LOGIN_LIBS) \
     libsss_ldap_common.la \
     libsss_idmap.la \
     libsss_krb5_common.la \
@@ -1614,12 +1605,10 @@ ad_common_tests_SOURCES = \
     $(sssd_be_SOURCES) \
     src/util/sss_ldap.c \
     src/util/sss_krb5.c \
-    src/util/find_uid.c \
     src/util/user_info_msg.c \
     src/tests/cmocka/test_ad_common.c
 ad_common_tests_CFLAGS = \
     $(AM_CFLAGS) \
-    $(SYSTEMD_LOGIN_CFLAGS) \
     -DUNIT_TESTING
 ad_common_tests_LDFLAGS = \
     -Wl,-wrap,sdap_set_sasl_options
@@ -1630,7 +1619,6 @@ ad_common_tests_LDADD = \
     $(CARES_LIBS) \
     $(KRB5_LIBS) \
     $(SSSD_INTERNAL_LTLIBS) \
-    $(SYSTEMD_LOGIN_LIBS) \
     libsss_ldap_common.la \
     libsss_idmap.la \
     libsss_krb5_common.la \
@@ -1839,7 +1827,6 @@ libsss_krb5_common_la_CFLAGS = \
     $(KRB5_CFLAGS)
 
 libsss_ldap_la_SOURCES = \
-    src/util/find_uid.c \
     src/providers/ldap/ldap_init.c \
     src/providers/ldap/ldap_access.c \
     src/providers/krb5/krb5_common.c \
@@ -1850,14 +1837,13 @@ libsss_ldap_la_SOURCES = \
     src/util/sss_krb5.c
 libsss_ldap_la_CFLAGS = \
     $(AM_CFLAGS) \
-    $(SYSTEMD_LOGIN_CFLAGS) \
     $(OPENLDAP_CFLAGS) \
     $(KRB5_CFLAGS)
 libsss_ldap_la_LIBADD = \
     $(OPENLDAP_LIBS) \
     $(DHASH_LIBS) \
     $(KRB5_LIBS) \
-    $(SYSTEMD_LOGIN_LIBS) \
+    $(SSSD_INTERNAL_LTLIBS) \
     libsss_ldap_common.la \
     libsss_idmap.la
 libsss_ldap_la_LDFLAGS = \
@@ -1894,17 +1880,15 @@ libsss_simple_la_LDFLAGS = \
 
 libsss_krb5_la_SOURCES = \
     src/providers/krb5/krb5_init.c \
-    src/util/find_uid.c \
     src/util/sss_krb5.c
 libsss_krb5_la_CFLAGS = \
     $(AM_CFLAGS) \
-    $(SYSTEMD_LOGIN_CFLAGS) \
     $(DHASH_CFLAGS) \
     $(KRB5_CFLAGS)
 libsss_krb5_la_LIBADD = \
-    $(SYSTEMD_LOGIN_LIBS) \
     $(DHASH_LIBS) \
     $(KRB5_LIBS) \
+    $(SSSD_INTERNAL_LTLIBS) \
     libsss_krb5_common.la
 libsss_krb5_la_LDFLAGS = \
     -avoid-version \
@@ -1942,23 +1926,21 @@ libsss_ipa_la_SOURCES = \
     src/providers/ad/ad_srv.c \
     src/providers/ad/ad_domain_info.c \
     src/util/user_info_msg.c \
-    src/util/find_uid.c \
     src/util/sss_ldap.c \
     src/util/sss_krb5.c
 libsss_ipa_la_CFLAGS = \
     $(AM_CFLAGS) \
-    $(SYSTEMD_LOGIN_CFLAGS) \
     $(OPENLDAP_CFLAGS) \
     $(DHASH_CFLAGS) \
     $(NDR_NBT_CFLAGS) \
     $(KRB5_CFLAGS)
 libsss_ipa_la_LIBADD = \
-    $(SYSTEMD_LOGIN_LIBS) \
     $(OPENLDAP_LIBS) \
     $(DHASH_LIBS) \
     $(NDR_NBT_LIBS) \
     $(KRB5_LIBS) \
     $(SELINUX_LIBS) \
+    $(SSSD_INTERNAL_LTLIBS) \
     libsss_ldap_common.la \
     libsss_krb5_common.la \
     libipa_hbac.la \
@@ -1996,7 +1978,6 @@ libsss_ad_la_SOURCES = \
     src/providers/ad/ad_subdomains.h \
     src/providers/ad/ad_domain_info.c \
     src/providers/ad/ad_domain_info.h \
-    src/util/find_uid.c \
     src/util/user_info_msg.c \
     src/util/sss_krb5.c \
     src/util/sss_ldap.c
@@ -2008,19 +1989,18 @@ endif
 
 libsss_ad_la_CFLAGS = \
     $(AM_CFLAGS) \
-    $(SYSTEMD_LOGIN_CFLAGS) \
     $(OPENLDAP_CFLAGS) \
     $(SASL_CFLAGS) \
     $(DHASH_CFLAGS) \
     $(KRB5_CFLAGS) \
     $(NDR_NBT_CFLAGS)
 libsss_ad_la_LIBADD = \
-    $(SYSTEMD_LOGIN_LIBS) \
     $(OPENLDAP_LIBS) \
     $(SASL_LIBS) \
     $(DHASH_LIBS) \
     $(KRB5_LIBS) \
     $(NDR_NBT_LIBS) \
+    $(SSSD_INTERNAL_LTLIBS) \
     libsss_ldap_common.la \
     libsss_krb5_common.la \
     libsss_idmap.la
-- 
1.8.5.3

-------------- next part --------------
>From b84c2c6d3ce988c26a3acbddcc0cf3c4fba849b6 Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn at redhat.com>
Date: Sat, 15 Mar 2014 15:59:01 +0100
Subject: [PATCH 3/6] BUILD: Move file sss_krb5.c into libsss_krb5_common.so

Functions from module sss_krb5.c were duplicated in many libraries.
e.g. symol check_fast was in libsss_ad.so, libsss_ipa.so,
    libsss_krb5.so, libsss_ldap.so

This patch also remove duplicate files between libsss_ldap.so and
libsss_krb5_common.so. libsss_ldap.so has already depended on libkrb5.
Now, it will depend on libsss_krb5_common.so
---
 Makefile.am | 29 ++++++++++-------------------
 1 file changed, 10 insertions(+), 19 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 2f2489aaca5fab5893f3eca8a8449e9660085b21..aada0e021c72a3a0e6809b0a96307802225a0216 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1560,7 +1560,6 @@ test_utils_LDADD = \
 test_search_bases_SOURCES = \
     $(sssd_be_SOURCES) \
     src/util/sss_ldap.c \
-    src/util/sss_krb5.c \
     src/util/user_info_msg.c \
     src/tests/cmocka/test_search_bases.c
 test_search_bases_CFLAGS = \
@@ -1582,7 +1581,6 @@ test_search_bases_LDADD = \
 ad_access_filter_tests_SOURCES = \
     $(sssd_be_SOURCES) \
     src/util/sss_ldap.c \
-    src/util/sss_krb5.c \
     src/util/user_info_msg.c \
     src/providers/ad/ad_common.c \
     src/tests/cmocka/test_ad_access_filter.c
@@ -1604,7 +1602,6 @@ ad_access_filter_tests_LDADD = \
 ad_common_tests_SOURCES = \
     $(sssd_be_SOURCES) \
     src/util/sss_ldap.c \
-    src/util/sss_krb5.c \
     src/util/user_info_msg.c \
     src/tests/cmocka/test_ad_common.c
 ad_common_tests_CFLAGS = \
@@ -1818,9 +1815,12 @@ libsss_krb5_common_la_SOURCES = \
     src/providers/krb5/krb5_auth.c \
     src/providers/krb5/krb5_access.c \
     src/providers/krb5/krb5_child_handler.c \
-    src/providers/krb5/krb5_init_shared.c
+    src/providers/krb5/krb5_init_shared.c \
+    src/util/sss_krb5.c
 libsss_krb5_common_la_LIBADD = \
-    $(KEYUTILS_LIBS)
+    $(KEYUTILS_LIBS) \
+    $(DHASH_LIBS) \
+    $(KRB5_LIBS)
 libsss_krb5_common_la_LDFLAGS = \
     -avoid-version
 libsss_krb5_common_la_CFLAGS = \
@@ -1829,22 +1829,16 @@ libsss_krb5_common_la_CFLAGS = \
 libsss_ldap_la_SOURCES = \
     src/providers/ldap/ldap_init.c \
     src/providers/ldap/ldap_access.c \
-    src/providers/krb5/krb5_common.c \
-    src/providers/krb5/krb5_utils.c \
-    src/providers/krb5/krb5_become_user.c \
     src/util/user_info_msg.c \
-    src/util/sss_ldap.c \
-    src/util/sss_krb5.c
+    src/util/sss_ldap.c
 libsss_ldap_la_CFLAGS = \
     $(AM_CFLAGS) \
-    $(OPENLDAP_CFLAGS) \
-    $(KRB5_CFLAGS)
+    $(OPENLDAP_CFLAGS)
 libsss_ldap_la_LIBADD = \
     $(OPENLDAP_LIBS) \
-    $(DHASH_LIBS) \
-    $(KRB5_LIBS) \
     $(SSSD_INTERNAL_LTLIBS) \
     libsss_ldap_common.la \
+    libsss_krb5_common.la \
     libsss_idmap.la
 libsss_ldap_la_LDFLAGS = \
     -avoid-version \
@@ -1879,8 +1873,7 @@ libsss_simple_la_LDFLAGS = \
     -module
 
 libsss_krb5_la_SOURCES = \
-    src/providers/krb5/krb5_init.c \
-    src/util/sss_krb5.c
+    src/providers/krb5/krb5_init.c
 libsss_krb5_la_CFLAGS = \
     $(AM_CFLAGS) \
     $(DHASH_CFLAGS) \
@@ -1926,8 +1919,7 @@ libsss_ipa_la_SOURCES = \
     src/providers/ad/ad_srv.c \
     src/providers/ad/ad_domain_info.c \
     src/util/user_info_msg.c \
-    src/util/sss_ldap.c \
-    src/util/sss_krb5.c
+    src/util/sss_ldap.c
 libsss_ipa_la_CFLAGS = \
     $(AM_CFLAGS) \
     $(OPENLDAP_CFLAGS) \
@@ -1979,7 +1971,6 @@ libsss_ad_la_SOURCES = \
     src/providers/ad/ad_domain_info.c \
     src/providers/ad/ad_domain_info.h \
     src/util/user_info_msg.c \
-    src/util/sss_krb5.c \
     src/util/sss_ldap.c
 
 if BUILD_SUDO
-- 
1.8.5.3

-------------- next part --------------
>From 20465ef0191c09b89edf00d00c9343fa8a1e1c24 Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn at redhat.com>
Date: Sat, 15 Mar 2014 16:40:58 +0100
Subject: [PATCH 4/6] BUILD: Link libsss_ldap_common.so to libsss_idmap.so

Library libsss_ldap.so does not directly use functions from library
libsss_idmap.so. It only call function sdap_idmap_init (from file sdap_idmap.c)
which is in library libsss_ldap_common.so

sh-4.2$ nm -D --undefined-only /usr/lib64/sssd/libsss_ldap.so | grep idmap
                 U sdap_idmap_init

On the other hand, libsss_ldap_common.so uses functions from libsss_idmap
but it was not linked to libsss_idmap.so.

sh-4.2$ objdump -p /usr/lib64/sssd/libsss_ldap_common.so | grep idmap
sh-4.2$ echo $?
1
---
 Makefile.am | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index aada0e021c72a3a0e6809b0a96307802225a0216..c6222b813f0af8ae4324bf827e8f3a35879b0876 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1782,6 +1782,8 @@ libsss_ldap_common_la_SOURCES = \
     src/providers/ldap/sdap_utils.c \
     src/providers/ldap/sdap_domain.c \
     src/providers/ldap/sdap.c
+libsss_ldap_common_la_LIBADD = \
+    libsss_idmap.la
 libsss_ldap_common_la_LDFLAGS = \
     -avoid-version
 
@@ -1838,8 +1840,7 @@ libsss_ldap_la_LIBADD = \
     $(OPENLDAP_LIBS) \
     $(SSSD_INTERNAL_LTLIBS) \
     libsss_ldap_common.la \
-    libsss_krb5_common.la \
-    libsss_idmap.la
+    libsss_krb5_common.la
 libsss_ldap_la_LDFLAGS = \
     -avoid-version \
     -module
-- 
1.8.5.3

-------------- next part --------------
>From 457eaee99fb5afba5f6dd3752efcf78ce19d723c Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn at redhat.com>
Date: Sat, 15 Mar 2014 17:29:25 +0100
Subject: [PATCH 5/6] BUILD: Move duplicated files from providers to
 libsss_ldap_common.so

Files sss_ldap.c, user_info_msg.c were built in libsss_{ad,ipa,ldap}.so.
In these two files, there are functions sss_ldap_get_diagnostic_msg,
pack_user_info_chpass_error which are needed in libsss_ldap_common.so

sss_ldap_get_diagnostic_msg is used in src/providers/ldap/sdap_async.c,
    src/providers/ldap/sdap_async_connection.c

pack_user_info_chpass_error is used in src/providers/ldap/ldap_auth.c
---
 Makefile.am | 24 ++++++++----------------
 1 file changed, 8 insertions(+), 16 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index c6222b813f0af8ae4324bf827e8f3a35879b0876..f73911379a7ace989ec9a54d13bc1496425cc9b9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1559,8 +1559,6 @@ test_utils_LDADD = \
 
 test_search_bases_SOURCES = \
     $(sssd_be_SOURCES) \
-    src/util/sss_ldap.c \
-    src/util/user_info_msg.c \
     src/tests/cmocka/test_search_bases.c
 test_search_bases_CFLAGS = \
     $(AM_CFLAGS) \
@@ -1580,8 +1578,6 @@ test_search_bases_LDADD = \
 
 ad_access_filter_tests_SOURCES = \
     $(sssd_be_SOURCES) \
-    src/util/sss_ldap.c \
-    src/util/user_info_msg.c \
     src/providers/ad/ad_common.c \
     src/tests/cmocka/test_ad_access_filter.c
 ad_access_filter_tests_CFLAGS = \
@@ -1601,8 +1597,6 @@ ad_access_filter_tests_LDADD = \
 
 ad_common_tests_SOURCES = \
     $(sssd_be_SOURCES) \
-    src/util/sss_ldap.c \
-    src/util/user_info_msg.c \
     src/tests/cmocka/test_ad_common.c
 ad_common_tests_CFLAGS = \
     $(AM_CFLAGS) \
@@ -1781,8 +1775,12 @@ libsss_ldap_common_la_SOURCES = \
     src/providers/ldap/sdap_refresh.c \
     src/providers/ldap/sdap_utils.c \
     src/providers/ldap/sdap_domain.c \
-    src/providers/ldap/sdap.c
+    src/providers/ldap/sdap.c \
+    src/util/user_info_msg.c \
+    src/util/sss_ldap.c
 libsss_ldap_common_la_LIBADD = \
+    $(KRB5_LIBS) \
+    libsss_krb5_common.la \
     libsss_idmap.la
 libsss_ldap_common_la_LDFLAGS = \
     -avoid-version
@@ -1830,9 +1828,7 @@ libsss_krb5_common_la_CFLAGS = \
 
 libsss_ldap_la_SOURCES = \
     src/providers/ldap/ldap_init.c \
-    src/providers/ldap/ldap_access.c \
-    src/util/user_info_msg.c \
-    src/util/sss_ldap.c
+    src/providers/ldap/ldap_access.c
 libsss_ldap_la_CFLAGS = \
     $(AM_CFLAGS) \
     $(OPENLDAP_CFLAGS)
@@ -1918,9 +1914,7 @@ libsss_ipa_la_SOURCES = \
     src/providers/ad/ad_dyndns.c \
     src/providers/ad/ad_id.c \
     src/providers/ad/ad_srv.c \
-    src/providers/ad/ad_domain_info.c \
-    src/util/user_info_msg.c \
-    src/util/sss_ldap.c
+    src/providers/ad/ad_domain_info.c
 libsss_ipa_la_CFLAGS = \
     $(AM_CFLAGS) \
     $(OPENLDAP_CFLAGS) \
@@ -1970,9 +1964,7 @@ libsss_ad_la_SOURCES = \
     src/providers/ad/ad_subdomains.c \
     src/providers/ad/ad_subdomains.h \
     src/providers/ad/ad_domain_info.c \
-    src/providers/ad/ad_domain_info.h \
-    src/util/user_info_msg.c \
-    src/util/sss_ldap.c
+    src/providers/ad/ad_domain_info.h
 
 if BUILD_SUDO
 libsss_ad_la_SOURCES += \
-- 
1.8.5.3

-------------- next part --------------
>From d076f84e843b839e132b51fabfad235c44500ddf Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn at redhat.com>
Date: Sat, 15 Mar 2014 17:44:19 +0100
Subject: [PATCH 6/6] TEST: Add untested libraries into dlopen test

---
 src/tests/dlopen-tests.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/tests/dlopen-tests.c b/src/tests/dlopen-tests.c
index dd4cc754ac37621b953a462b5e73696d4556770c..7a218c70ad5ccc640388ac6b933299ceaae384ca 100644
--- a/src/tests/dlopen-tests.c
+++ b/src/tests/dlopen-tests.c
@@ -80,10 +80,16 @@ struct so {
                          LIBPFX"libsss_ipa.so", NULL } },
     { "libsss_krb5.so", { LIBPFX"libdlopen_test_providers.so",
                           LIBPFX"libsss_krb5.so", NULL } },
+    { "libsss_krb5_common.so", { LIBPFX"libdlopen_test_providers.so",
+                                 LIBPFX"libsss_krb5_common.so", NULL } },
     { "libsss_ldap.so", { LIBPFX"libdlopen_test_providers.so",
                           LIBPFX"libsss_ldap.so", NULL } },
+    { "libsss_ldap_common.so", { LIBPFX"libdlopen_test_providers.so",
+                                 LIBPFX"libsss_ldap_common.so", NULL } },
     { "libsss_proxy.so", { LIBPFX"libdlopen_test_providers.so",
                            LIBPFX"libsss_proxy.so", NULL } },
+    { "libdlopen_test_providers.so", { LIBPFX"libdlopen_test_providers.so",
+                                       NULL } },
 #ifdef HAVE_PYTHON_BINDINGS
     { "pyhbac.so", { LIBPFX"pyhbac.so", NULL } },
     { "pysss.so", { LIBPFX"pysss.so", NULL } },
-- 
1.8.5.3



More information about the sssd-devel mailing list