diff --git a/security/sssd/Makefile b/security/sssd/Makefile index 3e6f3d311f3a..7df225a4d755 100644 --- a/security/sssd/Makefile +++ b/security/sssd/Makefile @@ -1,129 +1,131 @@ # Created by: Lukas Slebodnik PORTNAME= sssd PORTVERSION= 1.16.5 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= security MASTER_SITES= https://releases.pagure.org/SSSD/${PORTNAME}/ MAINTAINER= lukas.slebodnik@intrak.sk COMMENT= System Security Services Daemon LICENSE= GPLv3+ LICENSE_FILE= ${WRKSRC}/COPYING LIB_DEPENDS= libpopt.so:devel/popt \ libtalloc.so:devel/talloc \ libtevent.so:devel/tevent \ libtdb.so:databases/tdb \ libldb.so:databases/ldb21 \ libcares.so:dns/c-ares \ libdbus-1.so:devel/dbus \ libdhash.so:devel/ding-libs \ libpcre.so:devel/pcre \ libunistring.so:devel/libunistring \ libnss3.so:security/nss \ libsasl2.so:security/cyrus-sasl2 \ libinotify.so:devel/libinotify \ libplds4.so:devel/nspr BUILD_DEPENDS= xmlcatalog:textproc/libxml2 \ docbook-xsl>=1:textproc/docbook-xsl \ xsltproc:textproc/libxslt \ xmlcatmgr:textproc/xmlcatmgr \ krb5>=1.10:security/krb5 \ nsupdate:dns/bind-tools FLAVORS= default smb FLAVOR?= ${FLAVORS:[1]} smb_PKGNAMESUFFIX= -smb GNU_CONFIGURE= yes CONFIGURE_ARGS= --without-selinux --without-semanage \ --without-libnl --without-nfsv4-idmapd-plugin \ --without-autofs --without-secrets --without-kcm \ --without-python2-bindings --with-python-prefix=${PREFIX} \ --with-init-dir=no \ --disable-cifs-idmap-plugin \ --with-unicode-lib=libunistring \ --with-ldb-lib-dir=${LOCALBASE}/lib/shared-modules/ldb \ --with-xml-catalog-path=${LOCALBASE}/share/xml/catalog \ --datadir=${DATADIR} --docdir=${DOCSDIR} --localstatedir=/var \ --with-db-path=/var/db/sss/db --with-mcache-path=/var/db/sss/mc \ --with-pubconf-path=/var/db/sss/pubconf \ --with-gpo-cache-path=/var/db/sss/gpo_cache \ --with-pid-path=/var/run --with-pipe-path=/var/run/sss/pipes \ --with-krb5-conf=/etc/krb5.conf \ --enable-pammoddir=${PREFIX}/lib CFLAGS+= -fstack-protector-all PLIST_SUB= PYTHON_VER=${PYTHON_VER} #DEBUG_FLAGS= -g MAKE_ENV+= LINGUAS="bg de eu es fr hu id it ja nb nl pl pt ru sv tg tr uk zh_CN zh_TW" SUB_FILES= pkg-message +TEST_TARGET= check + USES= autoreconf cpe gettext gmake iconv libtool pathfix pkgconfig \ - python:3.7 shebangfix gssapi:mit + python:3.6+ shebangfix gssapi:mit USE_LDCONFIG= yes USE_OPENLDAP= yes INSTALL_TARGET= install-strip CPE_VENDOR= fedoraproject BINARY_ALIAS= python3=python${PYTHON_VER} SHEBANG_FILES= src/tools/sss_obfuscate \ src/sbus/sbus_codegen USE_RC_SUBR= ${PORTNAME} PORTDATA= * OPTIONS_DEFINE= DOCS SMB OPTIONS_SUB= yes SMB_DESC= Install IPA and AD providers (requires Samba4) SMB_USES= samba:lib SMB_CONFIGURE_WITH= samba smb-idmap-interface-version=6 SMB_LIB_DEPENDS= libndr-nbt.so.0:net/samba412 \ libndr-krb5pac.so.0:net/samba412 \ libndr-standard.so.0:net/samba412 \ libndr.so.1:net/samba412 \ libsamba-util.so.0:net/samba412 \ libsmbclient.so.0:net/samba412 .if ${FLAVOR} == smb OPTIONS_DEFAULT+= SMB .endif post-patch: @${REINPLACE_CMD} -e 's|NSS_STATUS_NOTFOUND|NS_NOTFOUND|g' \ -e 's|NSS_STATUS_UNAVAIL|NS_UNAVAIL|g' \ -e 's|NSS_STATUS_TRYAGAIN|NS_TRYAGAIN|g' \ -e '/ETIME/d' \ -e 's|NSS_STATUS_SUCCESS|NS_SUCCESS|g' \ ${WRKSRC}/src/sss_client/common.c @${REINPLACE_CMD} \ -e 's|pam_modutil_getlogin(pamh)|getlogin()|g' \ ${WRKSRC}/src/sss_client/pam_sss.c @${REINPLACE_CMD} \ -e 's|install-data-hook install-dist_initSCRIPTS|install-dist_initSCRIPTS|g' \ -e 's|install-data-hook|notinstall-data-hook|g' \ ${WRKSRC}/Makefile.am @${REINPLACE_CMD} -e 's|/etc/sssd/|${ETCDIR}/|g' \ -e 's|/etc/openldap/|${LOCALBASE}/etc/openldap/|g' \ ${WRKSRC}/src/man/*xml @${REINPLACE_CMD} -e 's|/usr/bin/|${PREFIX}/bin/|g' \ -e 's|/var/lib/sss/pubconf/|/var/db/sss/pubconf/|g' \ ${WRKSRC}/src/man/sss_ssh_knownhostsproxy.1.xml \ ${WRKSRC}/src/man/*/sss_ssh_knownhostsproxy.1.xml \ ${WRKSRC}/src/man/po/*.po @${CP} ${FILESDIR}/bsdnss.c ${WRKSRC}/src/sss_client/bsdnss.c @${CP} ${FILESDIR}/sss_bsd_errno.h ${WRKSRC}/src/util/sss_bsd_errno.h post-install: ${INSTALL_DATA} ${WRKSRC}/src/examples/sssd-example.conf \ ${STAGEDIR}${ETCDIR}/sssd.conf.sample ${LN} -sf nss_sss.so ${STAGEDIR}${PREFIX}/lib/nss_sss.so.1 # clean unused man dirs .for i in es/man1 nl/man1 nl/man5 pt/man1 pt/man5 sv/man1 @${RMDIR} ${STAGEDIR}${PREFIX}/man/${i} .endfor .include diff --git a/security/sssd/files/patch-configure.ac b/security/sssd/files/patch-configure.ac index 4139f9c873e5..b62547432984 100644 --- a/security/sssd/files/patch-configure.ac +++ b/security/sssd/files/patch-configure.ac @@ -1,22 +1,41 @@ ---- configure.ac.orig 2020-03-17 13:31:28 UTC +--- configure.ac 2020-03-17 13:31:28 UTC +++ configure.ac @@ -44,8 +44,6 @@ AM_CONDITIONAL([HAVE_GCC], [test "$ac_cv_prog_gcc" = y AC_CHECK_HEADERS(stdint.h dlfcn.h) AC_CONFIG_HEADER(config.h) -AC_CHECK_TYPES([errno_t], [], [], [[#include ]]) - m4_include([src/build_macros.m4]) BUILD_WITH_SHARED_BUILD_DIR -@@ -356,8 +354,8 @@ them please use argument --without-python3-bindings wh +@@ -62,4 +60,18 @@ + + AM_CONDITIONAL([HAVE_PTHREAD], [test x"$HAVE_PTHREAD" != "x"]) ++ ++saved_CFLAGS="$CFLAGS" ++CFLAGS="-Werror" ++AC_COMPILE_IFELSE( ++ [AC_LANG_PROGRAM([[#include ]], ++ [[(void)mempcpy(NULL, NULL, 0);]])], ++ [AC_DEFINE([HAVE_MEMPCPY], [1], [mempcpy() available]) ++ HAVE_MEMPCPY=1 ++ ], ++ [AC_MSG_WARN([mempcpy() not found, will use private implementation])]) ++ ++CFLAGS="$saved_CFLAGS" ++ ++AM_CONDITIONAL([HAVE_MEMPCPY], [test x"$HAVE_MEMPCPY" != "x"]) + + # Check library for the timer_create function +@@ -356,8 +358,8 @@ them please use argument --without-python3-bindings wh AM_CHECK_PYTHON_HEADERS([], AC_MSG_ERROR([Could not find python3 headers])) - + - AC_SUBST([py3execdir], [$pyexecdir]) - AC_SUBST([python3dir], [$pythondir]) + AC_SUBST([py3execdir], [$(eval echo $pyexecdir)]) + AC_SUBST([python3dir], [$(eval echo $pythondir)]) AC_SUBST([PYTHON3_CFLAGS], [$PYTHON_CFLAGS]) AC_SUBST([PYTHON3_LIBS], [$PYTHON_LIBS]) AC_SUBST([PYTHON3_INCLUDES], [$PYTHON_INCLUDES]) diff --git a/security/sssd/files/patch-src__external__python.m4 b/security/sssd/files/patch-src__external__python.m4 new file mode 100644 index 000000000000..8453814e053c --- /dev/null +++ b/security/sssd/files/patch-src__external__python.m4 @@ -0,0 +1,9 @@ +--- src/external/python.m4 2020-03-17 09:31:28.000000000 -0400 ++++ src/external/python.m4 2022-02-22 22:55:04.425467000 -0500 +@@ -37,5 +37,5 @@ + PYTHON_DLOPEN_LIB="` $PYTHON_CONFIG --libs --embed | grep -o -- '-lpython@<:@^ @:>@*' |sed -e 's/^-l/lib/'`" + if test x"$PYTHON_DLOPEN_LIB" != x; then +- python_lib_path="` $PYTHON_CONFIG --ldflags | grep -o -- '-L/@<:@^ @:>@*' | sed -e 's/^-L//'`" ++ python_lib_path="` $PYTHON_CONFIG --ldflags | sed -n 's/.*-L\(@<:@^ @:>@*\).*/\1/p'`" + if test x"$python_lib_path" != x; then + PYTHON_DLOPEN_LIB=$python_lib_path"/"$PYTHON_DLOPEN_LIB diff --git a/security/sssd/files/patch-src__tests__cmocka__test_negcache_2.c b/security/sssd/files/patch-src__tests__cmocka__test_negcache_2.c new file mode 100644 index 000000000000..81e1790c4ce6 --- /dev/null +++ b/security/sssd/files/patch-src__tests__cmocka__test_negcache_2.c @@ -0,0 +1,42 @@ +--- src/tests/cmocka/test_negcache_2.c 2020-03-17 09:31:28.000000000 -0400 ++++ src/tests/cmocka/test_negcache_2.c 2022-02-22 23:48:57.315866000 -0500 +@@ -116,12 +116,8 @@ + { + int i; +- FILE *passwd_file; + const struct passwd *pwd; + +- passwd_file = fopen("/etc/passwd", "r"); +- assert_non_null(passwd_file); +- + for (i = 0; i < 2; /*no-op*/) { +- pwd = fgetpwent(passwd_file); ++ pwd = getpwent(); + assert_non_null(pwd); + if (pwd->pw_uid == 0) { +@@ -135,5 +131,4 @@ + } + +- fclose(passwd_file); + } + +@@ -141,12 +136,8 @@ + { + int i; +- FILE *group_file; + const struct group *grp; + +- group_file = fopen("/etc/group", "r"); +- assert_non_null(group_file); +- + for (i = 0; i < 2; /* no-op */) { +- grp = fgetgrent(group_file); ++ grp = getgrent(); + assert_non_null(grp); + if (grp->gr_gid == 0) { +@@ -160,5 +151,4 @@ + } + +- fclose(group_file); + } + diff --git a/security/sssd/files/patch-src__util__crypto__libcrypto__crypto_sha512crypt.c b/security/sssd/files/patch-src__util__crypto__libcrypto__crypto_sha512crypt.c index 323eef4fb139..dbea252ea1cd 100644 --- a/security/sssd/files/patch-src__util__crypto__libcrypto__crypto_sha512crypt.c +++ b/security/sssd/files/patch-src__util__crypto__libcrypto__crypto_sha512crypt.c @@ -1,16 +1,18 @@ diff --git src/util/crypto/libcrypto/crypto_sha512crypt.c src/util/crypto/libcrypto/crypto_sha512crypt.c index 2275ccd96..c1e418917 100644 --- src/util/crypto/libcrypto/crypto_sha512crypt.c +++ src/util/crypto/libcrypto/crypto_sha512crypt.c -@@ -30,6 +30,11 @@ +@@ -30,6 +30,13 @@ #include "sss_openssl.h" ++#ifndef HAVE_MEMPCPY +void * +mempcpy (void *dest, const void *src, size_t n) +{ + return (char *) memcpy (dest, src, n) + n; +} ++#endif /* HAVE_MEMPCPY */ /* Define our magic string to mark salt for SHA512 "encryption" replacement. */ const char sha512_salt_prefix[] = "$6$"; diff --git a/security/sssd/files/patch-src__util__crypto__nss__nss_sha512crypt.c b/security/sssd/files/patch-src__util__crypto__nss__nss_sha512crypt.c index aa1efee665b3..fbce0c0e298f 100644 --- a/security/sssd/files/patch-src__util__crypto__nss__nss_sha512crypt.c +++ b/security/sssd/files/patch-src__util__crypto__nss__nss_sha512crypt.c @@ -1,17 +1,19 @@ diff --git src/util/crypto/nss/nss_sha512crypt.c src/util/crypto/nss/nss_sha512crypt.c index 4d0594d9f..49801222d 100644 --- src/util/crypto/nss/nss_sha512crypt.c +++ src/util/crypto/nss/nss_sha512crypt.c -@@ -29,6 +29,12 @@ +@@ -29,6 +29,14 @@ #include #include ++#ifndef HAVE_MEMPCPY +static void * +mempcpy (void *dest, const void *src, size_t n) +{ + return (char *) memcpy (dest, src, n) + n; +} ++#endif /* HAVE_MEMPCPY */ + /* Define our magic string to mark salt for SHA512 "encryption" replacement. */ const char sha512_salt_prefix[] = "$6$"; #define SALT_PREF_SIZE (sizeof(sha512_salt_prefix) - 1)