[SSSD] [PATCH] libwbclient-sssd: update interface to version 0.12

Lukas Slebodnik lslebodn at redhat.com
Tue May 26 07:51:08 UTC 2015


On (26/05/15 09:46), Sumit Bose wrote:
>On Mon, May 25, 2015 at 09:32:25AM +0200, Lukas Slebodnik wrote:
>> On (15/05/15 12:52), Sumit Bose wrote:
>> >On Mon, May 11, 2015 at 06:38:30PM +0200, Lukas Slebodnik wrote:
>> >> On (11/05/15 18:26), Sumit Bose wrote:
>> >> >On Mon, May 11, 2015 at 09:12:38AM +0200, Lukas Slebodnik wrote:
>> >> >> On (06/05/15 16:25), Sumit Bose wrote:
>> >> >> >Hi,
>> >> >> >
>> >> >> >with Samba-4.2.x libwbclient has a new interface version because new
>> >> >> >calls were added which have an opaque context as an argument to allow
>> >> >> >threaded applications to send multiple requests to winbind in parallel.
>> >> >> >
>> >> >> >This patch adds the new interface but so far does not implement any calls.
>> >> >> >
>> >> >> >We have a similar issue in SSSD, all applications either single all
>> >> >> >multi-threaded use a single file-descriptor to talk to the SSSD
>> >> >> >responders and the requests are serialized. Originally the only clients
>> >> >> >were the NSS and PAM client code where there was no way around it
>> >> >> >because the PAM and NSS interface do not provide a way to pass a
>> >> >> >thread-local context.
>> >> >> >
>> >> >> >Nowadays there are applications like 389ds running on a FreeIPA server
>> >> >> >which want to get data exclusively from SSSD which can use more enhanced
>> >> >> >interface. So I think it would make sense to consider an enhancement to
>> >> >> >the low-level client communication code similar to the changes done in
>> >> >> >Samba so that threads can get an individual file-descriptors to talk to
>> >> >> >the responders. When this is done the new context aware libwbclient
>> >> >> >calls can be implemented (as long as it is possible).
>> >> >> >
>> >> >> >bye,
>> >> >> >Sumit
>> >> >> 
>> >> >> >From 137f33cdb7429ec4aeafd8ca4856bc1527e30443 Mon Sep 17 00:00:00 2001
>> >> >> >From: Sumit Bose <sbose at redhat.com>
>> >> >> >Date: Wed, 6 May 2015 13:07:54 +0200
>> >> >> >Subject: [PATCH] libwbclient-sssd: update interface to version 0.12
>> >> >> >
>> >> >> >This patch adds the new interface version 0.12 to libwbclient-sssd. The
>> >> >> >old version can still be generated with the --with-libwbclient-011
>> >> >> >configure option.
>> >> >> >
>> >> >> >This patch does not add an implementation of the new calls because first
>> >> >> >the SSSD client code has to be made thread friendly similar to Samba's
>> >> >> >libwbclient.
>> >> >> >---
>> >> >> > Makefile.am                                        |  30 +-
>> >> >> > configure.ac                                       |   1 +
>> >> >> > src/conf_macros.m4                                 |  26 +
>> >> >> > src/sss_client/libwbclient/wbc_ctx_sssd.c          | 396 ++++++++++
>> >> >> > .../{wbclient.exports => wbclient-0.11.exports}    |   4 +-
>> >> >> > src/sss_client/libwbclient/wbclient.exports        |  62 +-
>> >> >> > .../{wbclient_sssd.h => wbclient_sssd-0.11.h}      |   0
>> >> >> > src/sss_client/libwbclient/wbclient_sssd.h         | 853 ++++++++++++++++++---
>> >> >> > src/sss_client/libwbclient/wbclient_sssd.pc.in     |   2 +-
>> >> >> > 9 files changed, 1267 insertions(+), 107 deletions(-)
>> >> >> > create mode 100644 src/sss_client/libwbclient/wbc_ctx_sssd.c
>> >> >> > copy src/sss_client/libwbclient/{wbclient.exports => wbclient-0.11.exports} (98%)
>> >> >> > copy src/sss_client/libwbclient/{wbclient_sssd.h => wbclient_sssd-0.11.h} (100%)
>> >> >> >
>> >> >> >diff --git a/Makefile.am b/Makefile.am
>> >> >> >index 0aad222c1276b76607ec2d0e5c6b411d3b17b0a7..ce83e2ecd9151179e05ad37cbfe5aee86d384741 100644
>> >> >> >--- a/Makefile.am
>> >> >> >+++ b/Makefile.am
>> >> >> >@@ -887,7 +887,10 @@ libwbclient_LTLIBRARIES = libwbclient.la
>> >> >> > pkgconfig_DATA += src/sss_client/libwbclient/wbclient_sssd.pc
>> >> >> > 
>> >> >> > EXTRA_libwbclient_la_DEPENDENCIES = \
>> >> >> >-    src/sss_client/libwbclient/wbclient.exports
>> >> >> >+    src/sss_client/libwbclient/wbclient.exports \
>> >> >> >+    src/sss_client/libwbclient/wbclient-0.11.exports \
>> >> >> >+    $(NULL)
>> >> >> >+
>> >> >> > libwbclient_la_SOURCES = \
>> >> >> >     src/sss_client/libwbclient/wbc_guid.c \
>> >> >> >     src/sss_client/libwbclient/wbc_idmap_common.c \
>> >> >> >@@ -900,17 +903,34 @@ libwbclient_la_SOURCES = \
>> >> >> >     src/sss_client/libwbclient/wbc_sid_sssd.c \
>> >> >> >     src/sss_client/libwbclient/wbc_sssd_internal.h \
>> >> >> >     src/sss_client/libwbclient/wbc_util_common.c \
>> >> >> >-    src/sss_client/libwbclient/wbc_util_sssd.c
>> >> >> >+    src/sss_client/libwbclient/wbc_util_sssd.c \
>> >> >> >+    src/sss_client/libwbclient/wbc_ctx_sssd.c \
>> >> >> >+    $(NULL)
>> >> >> > libwbclient_la_LIBADD = \
>> >> >> >     libsss_nss_idmap.la \
>> >> >> >-    $(CLIENT_LIBS)
>> >> >> >+    $(CLIENT_LIBS) \
>> >> >> >+    $(NULL)
>> >> >> >+
>> >> >> >+if BUILD_LIBWBCLIENT_011
>> >> >> > libwbclient_la_LDFLAGS = \
>> >> >> >-    -Wl,--version-script,$(srcdir)/src/sss_client/libwbclient/wbclient.exports \
>> >> >> >+    -Wl,--version-script,$(srcdir)/src/sss_client/libwbclient/wbclient-0.11.exports \
>> >> >> >     -version-info 11:0:11
>> >> >> > 
>> >> >> >-dist_noinst_DATA += src/sss_client/libwbclient/wbclient.exports
>> >> >> >+include_HEADERS += src/sss_client/libwbclient/wbclient_sssd-0.11.h
>> >> >> >+dist_noinst_HEADERS += src/sss_client/libwbclient/wbclient_sssd.h
>> >> >> >+else #BUILD_LIBWBCLIENT_011
>> >> >> >+libwbclient_la_LDFLAGS = \
>> >> >> >+    -Wl,--version-script,$(srcdir)/src/sss_client/libwbclient/wbclient.exports \
>> >> >> >+    -version-info 12:0:12
>> >> >> > 
>> >> >> > include_HEADERS += src/sss_client/libwbclient/wbclient_sssd.h
>> >> >> >+dist_noinst_HEADERS += src/sss_client/libwbclient/wbclient_sssd-0.11.h
>> >> >> >+endif
>> >> >> >+
>> >> >> >+dist_noinst_DATA += src/sss_client/libwbclient/wbclient.exports \
>> >> >> >+    src/sss_client/libwbclient/wbclient-0.11.exports \
>> >> >> >+    $(NULL)
>> >> >> >+
>> >> >> > endif #BUILD_LIBWBCLIENT
>> >> >> > 
>> >> >> > if BUILD_IFP
>> >> >> >diff --git a/configure.ac b/configure.ac
>> >> >> >index 1f9c6f86772890bb0e269287d58aa6ea46e59ee1..15b421515aab4dc6e9f5a9e29670bdbe76313e0c 100644
>> >> >> >--- a/configure.ac
>> >> >> >+++ b/configure.ac
>> >> >> >@@ -137,6 +137,7 @@ WITH_SAMBA
>> >> >> > WITH_NFS
>> >> >> > WITH_NFS_LIB_PATH
>> >> >> > WITH_LIBWBCLIENT
>> >> >> >+WITH_LIBWBCLIENT_011
>> >> >> > WITH_SSSD_USER
>> >> >> > 
>> >> >> > m4_include([src/external/pkg.m4])
>> >> >> >diff --git a/src/conf_macros.m4 b/src/conf_macros.m4
>> >> >> >index 9ed0a4c44c209e88fc896d0cd3040cb572b358c9..728da445282d76d4048ef2a105b45954a961cbdb 100644
>> >> >> >--- a/src/conf_macros.m4
>> >> >> >+++ b/src/conf_macros.m4
>> >> >> >@@ -698,10 +698,36 @@ AC_DEFUN([WITH_LIBWBCLIENT],
>> >> >> > 
>> >> >> >     if test x"$with_libwbclient" = xyes; then
>> >> >> >         AC_DEFINE(BUILD_LIBWBCLIENT, 1, [whether to build SSSD implementation of libwbclient])
>> >> >> >+
>> >> >> >+        libwbclient_version="0.12"
>> >> >> >+        AC_SUBST(libwbclient_version)
>> >> >> >     fi
>> >> >> >     AM_CONDITIONAL([BUILD_LIBWBCLIENT], [test x"$with_libwbclient" = xyes])
>> >> >> >+    AM_CONDITIONAL([BUILD_LIBWBCLIENT_011], [test x = y])
>> >> >> >   ])
>> >> >> > 
>> >> >> >+AC_DEFUN([WITH_LIBWBCLIENT_011],
>> >> >> >+  [ AC_ARG_WITH([libwbclient_011],
>> >> >> >+                [AC_HELP_STRING([--with-libwbclient-0.11],
>> >> >> >+                                [Whether to build version 0.11 of SSSD implementation of libwbclient [no]]
>> >> >> >+                               )
>> >> >> >+                ],
>> >> >> >+                [with_libwbclient_011=$withval],
>> >> >> >+                with_libwbclient_011=no
>> >> >> >+               )
>> >> >> >+
>> >> >> >+    if test x"$with_libwbclient_011" = xyes; then
>> >> >> >+        AC_DEFINE(BUILD_LIBWBCLIENT, 1, [whether to build SSSD implementation of libwbclient])
>> >> >> >+        AC_DEFINE(BUILD_LIBWBCLIENT_011, 1, [whether to build version 0.11 of SSSD implementation of libwbclient])
>> >> >> >+
>> >> >> >+        libwbclient_version="0.11"
>> >> >> >+        AC_SUBST(libwbclient_version)
>> >> >> >+    fi
>> >> >> >+    AM_CONDITIONAL([BUILD_LIBWBCLIENT], [test x"$with_libwbclient" = xyes])
>> >> >> >+    AM_CONDITIONAL([BUILD_LIBWBCLIENT_011], [test x"$with_libwbclient_011" = xyes])
>> >> >> >+  ])
>> >> >> >+
>> >> >> >+
>> >> >> 
>> >> >> I would prefer to keep it simple.
>> >> >> 
>> >> >> libwbclient.so.0.12 is backward compatible with libwbclient.so.0.11.
>> >> >> Just new functions were added.
>> >> >> 
>> >> >> It means that each program which was compiled with libwbclient.so.0.11 will
>> >> >> work with libwbclient.so.0.12 as well. We needn't complicate our life with two
>> >> >> versions of libwbclient.
>> >> >
>> >> >In general I agree. But my intend was to make it easy for distributions
>> >> >and other integrators to build and use libwbclient-sssd for older samba
>> >> >versions using 0.11 without irritating the users. So I would prefer to
>> >> >do it this way for a start and try to get some experience and feedback
>> >> >if it is needed by other and switch to a different scheme later, because
>> >> >I agree that was cannot do this for ever.
>> >> >
>> >> 
>> >> I'm sorry I do not understand the use case.
>> >> What do you mean by "libwbclient-sssd for older samba"?
>> >> What problems can you see in packaging/distributions?
>> >> 
>> >> Maybe I miss some corner cases
>> >> but I cannot see any problem with samba/libwbclient.so.0.11
>> >> together with sssd/libwbclient.so.0.12.
>> >> It can be easily handled with alternatives and symbolic links.
>> >> 
>> >> /usr/lib{.64}/libwbclient.so.0.11 can point either to samba/libwbclient.so.0.11
>> >> or sssd/libwbclient.so.0.12
>> >> 
>> >
>> >ok, I removed the 0.11 parts and made some changes which should make it
>> >easy to add new versions or create an older version. The explicit
>> >version information can be found in src/conf_macros.m4. If someone wants
>> >to create an older version the number has to be change here and the
>> >newer versions have to be removed from
>> >src/sss_client/libwbclient/wbclient.exports, that's all.
>> >
>> 
>> than you for patch.
>> I tested on fedora 22 (already have samba-libwblient.so.0.12)
>> and on rhel7 with small cheat (I was lazy to patch autoconf files :-)
>> alternatives --install /usr/lib64/libwbclient.so.0.11 \
>>                        libwbclient.so.0.11-64
>>                        /usr/lib64/sssd/modules/libwbclient.so.0.12.0
>> 
>> all QE tests passed.
>> 
>> Maybe we can do another compromise and have two vesion files
>> as in your previous version. So if someone "really" don't want
>> symbols from libwbclient.so. then he can just patch makefile and remove
>> line with version-script (LDFLAGS)
>> 
>> But I'm fine with this version and I would like to ack it and backport fo
>> fedora 22. I just want to know your preference about version-script files.
>
>I think it would be a bit odd to carry two version-scripts and use only
>one. Since version-scripts have a clear structure and the different
>versions are easy to identify I think it is ok to ship only the latest
>version and let the user remove the offending versions if it is "really"
>needed.
>
OK

ACK

LS



More information about the sssd-devel mailing list