From nobody Wed Feb 23 05:04:42 2022 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8823419E751C; Wed, 23 Feb 2022 05:04:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4K3P963Rvnz3QDc; Wed, 23 Feb 2022 05:04:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645592682; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1eqF+HBIK5YjtfnapgoDq0Ddm78aSIWqbu3imCCX7fE=; b=ed6w7gjhSzwDPqRg7cfXiVEwJQu8Nx0PVQhn0EjqrKA1vFi9BFjP62gn6Hdc+qe6t1LCbn Nj1GtfIg8nxv7IbOstg1TdvjNTGtI7tRRopkEyOEeo21t/Qy6zlUANdksktgNNLOU0FVjV Dighp/nTmDFjvlZ079JRLAnHSeWy096GwJz6fqHsHXJyjpJhxUTLKfdiOADtEX4OZqXVro q90F0l77ezlBULSUZMCF+Ugni1idjDphY8UYGqgJTdQu0UlsLIf+WXpID96Jxsl3V1ZqGO Mpb/aPVNYxCCDC3MAk+a6th37NjQVznyau2llekyTWfUuc4z8qSv89nnV8jzaA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5700F1224C; Wed, 23 Feb 2022 05:04:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 21N54gRD069143; Wed, 23 Feb 2022 05:04:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21N54gjb069142; Wed, 23 Feb 2022 05:04:42 GMT (envelope-from git) Date: Wed, 23 Feb 2022 05:04:42 GMT Message-Id: <202202230504.21N54gjb069142@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Mikhail Teterin Subject: git: 6cf646c7a526 - main - security/sssd: implement detection of mempcpy at configure-time List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mi X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6cf646c7a526c6c4ca21b2faa9c10b3970f72850 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645592682; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1eqF+HBIK5YjtfnapgoDq0Ddm78aSIWqbu3imCCX7fE=; b=xJdoqv3d06U21wJhnXuQuLkDK76NhhtuoLSA/2iKaew0GW8rEzaUenaNKinLr7Js7rotjY tkUmfra+8kNVEiMcb3awp2o9fIkaqkEdOI4PyP63PYVWkoscb3fUqTdM1ovqnmRbW/Fyo/ b0VLOWNyUcWb9zl4v6/7GIDHiV1fXQtQbLCzn+6kz9vc1trSaWj01xz/eo8IyT7S7WWFd/ U4FgEJ+pAyixhCsRgnR6TofRKzZz9XdpuPtWNRxU/MkZ142pL5dqo8yo1Hd6SlKBfhl7JX vPhUMTT07uWxNz8AN9X5GD5iYK8eim96frAmaSMkb4vO9QklXpki221UMNGQbw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645592682; a=rsa-sha256; cv=none; b=J6DuRDyBcaF+GbVAT/asbbJIVu3jsf3bT+Pkgbjet2mEN6R6KqM/Ys6bgnP4NAdoPUnT8f 5orgh7Uc4zrNjPS2t8pCQEOnhFq3QoTOvCx62GyPxLJZUdkcmt1PJSzbjU7wsY8E9TJlnI PSI3Knx0twrJatbQekd3/qJ80CMUOVOlSqRpTORsxbuRNxr+CaYfLDaG1GM2ZG3MSoNvW5 cKIoQbJYySYbyAfSsUqJZxR0dd2xH2m4MSyt70H6KMVtcllklMLEfLiE9/XpWjAldLLM9K x/VH1GuF+PTCIOVtUKQYSalxzCvbwvG1TZ+tzdwXwTwdow3pXj642rrPbuwaIg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mi: URL: https://cgit.FreeBSD.org/ports/commit/?id=6cf646c7a526c6c4ca21b2faa9c10b3970f72850 commit 6cf646c7a526c6c4ca21b2faa9c10b3970f72850 Author: Mikhail Teterin AuthorDate: 2022-02-23 04:59:36 +0000 Commit: Mikhail Teterin CommitDate: 2022-02-23 04:59:36 +0000 security/sssd: implement detection of mempcpy at configure-time Newer versions of FreeBSD provide mempcpy, which conflicts with the port's own implementation -- meant for the older versions. While here, fix compilation with newer Python -- not just 3.7 -- and relax the requirement for Python-version. This necessitated bumping PORTREVISION -- because the default Python is 3.8 nowadays. Also, define TEST_TARGET -- and fix one of the test to compile. This needs further work, however. PR: 257866 --- security/sssd/Makefile | 6 ++-- security/sssd/files/patch-configure.ac | 25 +++++++++++-- security/sssd/files/patch-src__external__python.m4 | 9 +++++ .../patch-src__tests__cmocka__test_negcache_2.c | 42 ++++++++++++++++++++++ ...__util__crypto__libcrypto__crypto_sha512crypt.c | 4 ++- ...patch-src__util__crypto__nss__nss_sha512crypt.c | 4 ++- 6 files changed, 83 insertions(+), 7 deletions(-) diff --git a/security/sssd/Makefile b/security/sssd/Makefile index 3e6f3d311f3a..7df225a4d755 100644 --- a/security/sssd/Makefile +++ b/security/sssd/Makefile @@ -2,7 +2,7 @@ PORTNAME= sssd PORTVERSION= 1.16.5 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= security MASTER_SITES= https://releases.pagure.org/SSSD/${PORTNAME}/ @@ -60,8 +60,10 @@ PLIST_SUB= PYTHON_VER=${PYTHON_VER} 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 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,4 +1,4 @@ ---- 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) @@ -9,10 +9,29 @@ 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)]) 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 @@ -2,15 +2,17 @@ diff --git src/util/crypto/libcrypto/crypto_sha512crypt.c src/util/crypto/libcry 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 @@ -2,15 +2,17 @@ diff --git src/util/crypto/nss/nss_sha512crypt.c src/util/crypto/nss/nss_sha512c 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$";