#8556 389ds interface change in slapi_be_getsuffix breaks ipa-pwd-extop plugin
Closed: fixed 3 years ago by frenaud. Opened 3 years ago by frenaud.

With commit 266d878 made on 389ds master branch, the interface slapi_be_getsuffix changed and now has a single parameter:
const Slapi_DN * slapi_be_getsuffix(Slapi_Backend *be, int n)
became
const Slapi_DN * slapi_be_getsuffix(Slapi_Backend *be).

This new interface breaks the build of ipa-pwd-extop plugin. See for instance PR #494, with the following build.log:

libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../../.. -I. -I./../common -I../../../util -I../../../asn1 -DPREFIX=\"/usr\" -DBINDIR=\"/usr/bin\" -DLIBDIR=\"/usr/lib64\" -DLIBEXECDIR=\"/usr/libexec\" -DDATADIR=\"/usr/share\" -DUSE_OPENLDAP -I/usr/include/dirsrv -I/usr/include/nspr4 -I/usr/include/nspr4 -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-align -Werror-implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D__STDC_WANT_LIB_EXT1__=1 -D_DEFAULT_SOURCE=1 -D_POSIX_C_SOURCE=200809L -Werror=implicit-function-declaration -c common.c  -fPIC -DPIC -o .libs/common.o
common.c: In function 'ipapwd_gen_checks':
common.c:556:16: error: too many arguments to function 'slapi_be_getsuffix'
  556 |         psdn = slapi_be_getsuffix(be, 0);
      |                ^~~~~~~~~~~~~~~~~~
In file included from ../libotp/otp_config.h:42,
                 from ../libotp/otp_token.h:42,
                 from ipapwd.h:44,
                 from common.c:40:
/usr/include/dirsrv/slapi-plugin.h:6401:17: note: declared here
 6401 | const Slapi_DN *slapi_be_getsuffix(Slapi_Backend *be);
      |                 ^~~~~~~~~~~~~~~~~~
make[4]: *** [Makefile:615: common.lo] Error 1

@mreynolds reverted the API/ABI change by ignoring the second argument to slapi_be_getsuffix(), so the next re-run of the 389-ds/freeipa nightly should fix the issue:
https://github.com/389ds/389-ds-base/commit/e227c5be7d359138bb54414b8f910e774c05083f

This issue can be closed, PR #508 demonstrates that the nightly copr for 389ds master branch contains the fix and freeipa now builds successfully (Details).

Metadata Update from @frenaud:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

3 years ago

Login to comment on this ticket.

Metadata