sys-auth/pam_ssh_agent_auth: add 0.10.4; fix build with Clang 16

Closes: https://bugs.gentoo.org/725720
Closes: https://bugs.gentoo.org/870721
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Sam James
2022-09-30 21:12:20 +01:00
parent 31f6cdae30
commit 442365d12c
5 changed files with 329 additions and 14 deletions

View File

@@ -1,2 +1,4 @@
DIST pam_ssh_agent_auth-0.10.3-openssl-1.1.1.patch 46417 BLAKE2B bb62c32fc9c1eb5dc0788b9a535fdf6000812c57a6a758e693406a0d01bcf0cc5ec9f7622c4f21cee74895657a5a3ad13255e19d51e20eca8978e63864266629 SHA512 279fad3be9289c1da06d34e08d2b81a8ad863e07c7b0471419c029aa121abe9942ae4cc4259b7f1e2c2dd32368fc07dc1f9432aba860820455e0d9419c9e7f74
DIST pam_ssh_agent_auth-0.10.3.tar.bz2 1066393 BLAKE2B 07b113d05e09f770d63dbea813ea644199d2b103f9c6d7e5960bfad37cb181ce5a5f111f72e0274c0335e4c217ccd19bd53d61af23f8bc6aff14c1995fc4edc9 SHA512 d75062c4e46b0b011f46aed9704a99049995fea8b5115ff7ee26dad7e93cbcf54a8af7efc6b521109d77dc03c6f5284574d2e1b84c6829cec25610f24fb4bd66
DIST pam_ssh_agent_auth-0.10.4.tar.gz 307110 BLAKE2B dad39724db4c35ff42e28492c23ab1073baf859ecf797003509b8aa3d29c71e7fae9601d193af1def58c64f149ced07e4e050fac89ae7f42fcbce5241b99df7b SHA512 caccf72174d15e43f4c86a459ac6448682e62116557cf1e1e828955f3d1731595b238df42adec57860e7f341e92daf5d8285020bcb5018f3b8a5145aa32ee1c2
DIST pam_ssh_agent_auth-ed25519-donna.tar.gz 1169972 BLAKE2B f44fa6c00dbb5cdfe51661cb559428bf24c9886e166366d1700d479f033b8b61621d7821d39a9949a7ef7cd6f5be16be575790a8f6fee03276c2c142f65a792a SHA512 5e8b838bc66bdb1983e62b0ae969449741a3fb223198bce26fe3a8996e324728e8ba0e5259f9ef3db613fd484db21459e98c39367f7240940bc537210c6d7f63

View File

@@ -0,0 +1,49 @@
https://github.com/jbeverly/pam_ssh_agent_auth/pull/41
From ad2cc74dce3a6eaff0df193a2ae3db177e0d594f Mon Sep 17 00:00:00 2001
From: Sam James <sam@gentoo.org>
Date: Fri, 30 Sep 2022 20:51:17 +0100
Subject: [PATCH 1/2] Fix function prototypes in configure
This fixes building with Clang 16.
Bug: https://bugs.gentoo.org/870721
Signed-off-by: Sam James <sam@gentoo.org>
--- a/configure.ac
+++ b/configure.ac
@@ -500,7 +500,7 @@ int main(void) { exit(0); }
AC_DEFINE(HAVE_BUNDLE, 1, [Define if your system uses bundles instead of ELF shared objects])
AC_MSG_CHECKING(if we have working getaddrinfo)
AC_TRY_RUN([#include <mach-o/dyld.h>
-main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
+int main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
exit(0);
else
exit(1);
@@ -1467,7 +1467,7 @@ AC_MSG_CHECKING([for (overly) strict mkstemp])
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
#include <stdlib.h>
-main() { char template[]="conftest.mkstemp-test";
+int main() { char template[]="conftest.mkstemp-test";
if (mkstemp(template) == -1)
exit(1);
unlink(template); exit(0);
@@ -2598,7 +2598,7 @@ dnl test snprintf (broken on SCO w/gcc)
#include <stdio.h>
#include <string.h>
#ifdef HAVE_SNPRINTF
-main()
+int main()
{
char buf[50];
char expected_out[50];
@@ -2615,7 +2615,7 @@ main()
exit(0);
}
#else
-main() { exit(0); }
+int main() { exit(0); }
#endif
]])], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ],
AC_MSG_WARN([cross compiling: Assuming working snprintf()])

View File

@@ -0,0 +1,176 @@
https://github.com/jbeverly/pam_ssh_agent_auth/pull/41
From a12729d18c7ddeae9781a20155d5db1396e9e954 Mon Sep 17 00:00:00 2001
From: Sam James <sam@gentoo.org>
Date: Fri, 30 Sep 2022 20:54:45 +0100
Subject: [PATCH 2/2] Add missing includes (implicit function declarations)
This fixes building with Clang 16.
Bug: https://bugs.gentoo.org/870721
Closes: https://github.com/jbeverly/pam_ssh_agent_auth/pull/36
Signed-off-by: Sam James <sam@gentoo.org>
--- a/configure.ac
+++ b/configure.ac
@@ -388,6 +388,7 @@ case "$host" in
[AC_LANG_SOURCE([[
#define testmacro foo
#define testmacro bar
+#include <stdlib.h>
int main(void) { exit(0); }
]])],
[ AC_MSG_RESULT(yes) ],
@@ -500,6 +501,7 @@ int main(void) { exit(0); }
AC_DEFINE(HAVE_BUNDLE, 1, [Define if your system uses bundles instead of ELF shared objects])
AC_MSG_CHECKING(if we have working getaddrinfo)
AC_TRY_RUN([#include <mach-o/dyld.h>
+#include <stdlib.h>
int main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
exit(0);
else
@@ -918,6 +920,7 @@ AC_MSG_CHECKING(compiler and flags for sanity)
AC_RUN_IFELSE(
[AC_LANG_SOURCE([
#include <stdio.h>
+#include <stdlib.h>
int main(){exit(0);}
])],
[ AC_MSG_RESULT(yes) ],
@@ -944,6 +947,7 @@ AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
[AC_LANG_SOURCE([[
#include <libgen.h>
#include <string.h>
+#include <stdlib.h>
int main(int argc, char **argv) {
char *s, buf[32];
@@ -1102,6 +1106,7 @@ AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
#include <sys/types.h>
#include <dirent.h>
+#include <stdlib.h>
int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
]])],
[AC_MSG_RESULT(yes)],
@@ -1384,6 +1389,7 @@ if test "x$ac_cv_func_snprintf" = "xyes" ; then
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
#include <stdio.h>
+#include <stdlib.h>
int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
]])],
[AC_MSG_RESULT(yes)],
@@ -1408,6 +1414,7 @@ if test "x$ac_cv_func_asprintf" != "xyes" && \
#include <sys/types.h>
#include <stdio.h>
#include <stdarg.h>
+#include <stdlib.h>
int x_snprintf(char *str,size_t count,const char *fmt,...)
{
@@ -1496,6 +1503,7 @@ if test ! -z "$check_for_openpty_ctty_bug"; then
#include <sys/fcntl.h>
#include <sys/types.h>
#include <sys/wait.h>
+#include <stdlib.h>
int
main()
@@ -1543,6 +1551,7 @@ if test "x$ac_cv_func_getaddrinfo" = "xyes" && \
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
#include <stdio.h>
+#include <stdlib.h>
#include <sys/socket.h>
#include <netdb.h>
#include <errno.h>
@@ -1615,6 +1624,7 @@ if test "x$ac_cv_func_getaddrinfo" = "xyes" && \
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
#include <stdio.h>
+#include <stdlib.h>
#include <sys/socket.h>
#include <netdb.h>
#include <errno.h>
@@ -1677,6 +1687,7 @@ if test "x$check_for_conflicting_getspnam" = "x1"; then
AC_COMPILE_IFELSE([AC_LANG_SOURCE(
[
#include <shadow.h>
+#include <stdlib.h>
int main(void) {exit(0);}
])],
[
@@ -1750,6 +1761,7 @@ AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
#include <stdio.h>
#include <string.h>
+#include <stdlib.h>
#include <openssl/opensslv.h>
#define DATA "conftest.sslincver"
int main(void) {
@@ -1785,6 +1797,7 @@ AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
#include <stdio.h>
#include <string.h>
+#include <stdlib.h>
#include <openssl/opensslv.h>
#include <openssl/crypto.h>
#define DATA "conftest.ssllibver"
@@ -1828,7 +1841,9 @@ AC_MSG_CHECKING([whether OpenSSL's headers match the library])
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
#include <string.h>
+#include <openssl/crypto.h>
#include <openssl/opensslv.h>
+#include <stdlib.h>
int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
]])],
[
@@ -1907,6 +1922,7 @@ AC_MSG_CHECKING([whether OpenSSL has crippled AES support])
AC_LINK_IFELSE(
[AC_LANG_SOURCE([[
#include <string.h>
+#include <stdlib.h>
#include <openssl/evp.h>
int main(void) { exit(EVP_aes_192_cbc() == NULL || EVP_aes_256_cbc() == NULL);}
]])],
@@ -1952,6 +1968,7 @@ AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
#include <string.h>
+#include <stdlib.h>
#include <openssl/rand.h>
int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
]])],
@@ -2123,6 +2140,7 @@ if test -z "$have_llong_max"; then
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
#include <stdio.h>
+#include <stdlib.h>
/* Why is this so damn hard? */
#ifdef __GNUC__
# undef __GNUC__
@@ -2597,6 +2615,7 @@ dnl test snprintf (broken on SCO w/gcc)
[AC_LANG_SOURCE([[
#include <stdio.h>
#include <string.h>
+#include <stdlib.h>
#ifdef HAVE_SNPRINTF
int main()
{
@@ -2740,6 +2759,7 @@ AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
ac_cv_have_accrights_in_msghdr, [
AC_COMPILE_IFELSE([AC_LANG_SOURCE(
[
+#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/uio.h>
@@ -2767,6 +2787,7 @@ AC_CACHE_CHECK([for msg_control field in struct msghdr],
ac_cv_have_control_in_msghdr, [
AC_COMPILE_IFELSE([AC_LANG_SOURCE(
[
+#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/uio.h>

View File

@@ -0,0 +1,70 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit autotools toolchain-funcs pam
DESCRIPTION="Simple module to authenticate users against their ssh-agent keys"
HOMEPAGE="http://pamsshagentauth.sourceforge.net"
if [[ ${PV} == *9999 ]] ; then
EGIT_REPO_URI="https://github.com/jbeverly/${PN}.git"
inherit git-r3
else
ED25519_DONNA_COMMIT="8757bd4cd209cb032853ece0ce413f122eef212c"
SRC_URI="https://github.com/jbeverly/pam_ssh_agent_auth/archive/refs/tags/${P}.tar.gz"
SRC_URI+=" https://github.com/floodyberry/ed25519-donna/archive/${ED25519_DONNA_COMMIT}.tar.gz -> ${PN}-ed25519-donna.tar.gz"
S="${WORKDIR}"/${PN}-${P}
KEYWORDS="~amd64 ~arm ~x86"
fi
LICENSE="MIT"
SLOT="0"
DEPEND="
dev-libs/openssl:=
sys-libs/pam
"
RDEPEND="
${DEPEND}
virtual/ssh
"
# Needed for pod2man
BDEPEND="dev-lang/perl"
PATCHES=(
"${FILESDIR}"/${PN}-0.10.4-0001-Fix-function-prototypes-in-configure.patch
"${FILESDIR}"/${PN}-0.10.4-0002-Add-missing-includes-implicit-function-declarations.patch
)
src_prepare() {
default
# Missing from tag
rm -r ed25519-donna || die
ln -s "${WORKDIR}"/ed25519-donna-${ED25519_DONNA_COMMIT} "${S}"/ed25519-donna || die
# For configure patches
eautoreconf
}
src_configure() {
pammod_hide_symbols
# bug #725720
export AR="$(type -P $(tc-getAR))"
econf \
--without-openssl-header-check \
--libexecdir="$(getpam_mod_dir)"
}
src_install() {
# Don't use emake install as it makes it harder to have proper
# install paths.
dopammod pam_ssh_agent_auth.so
doman pam_ssh_agent_auth.8
dodoc CONTRIBUTORS
}

View File

@@ -1,9 +1,9 @@
# Copyright 1999-2020 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
EAPI=8
inherit pam
inherit autotools toolchain-funcs pam
DESCRIPTION="Simple module to authenticate users against their ssh-agent keys"
HOMEPAGE="http://pamsshagentauth.sourceforge.net"
@@ -12,31 +12,49 @@ if [[ ${PV} == *9999 ]] ; then
EGIT_REPO_URI="https://github.com/jbeverly/${PN}.git"
inherit git-r3
else
SRC_URI="mirror://sourceforge/pamsshagentauth/${PN}/v${PV}/${P}.tar.bz2
https://dev.gentoo.org/~juippis/distfiles/tmp/pam_ssh_agent_auth-0.10.3-openssl-1.1.1.patch"
ED25519_DONNA_COMMIT="8757bd4cd209cb032853ece0ce413f122eef212c"
SRC_URI="https://github.com/jbeverly/pam_ssh_agent_auth/archive/refs/tags/${P}.tar.gz"
SRC_URI+=" https://github.com/floodyberry/ed25519-donna/archive/${ED25519_DONNA_COMMIT}.tar.gz -> ${PN}-ed25519-donna.tar.gz"
S="${WORKDIR}"/${PN}-${P}
KEYWORDS="~amd64 ~arm ~x86"
fi
LICENSE="MIT"
SLOT="0"
IUSE=""
DEPEND="
dev-libs/openssl:=
sys-libs/pam
"
RDEPEND="
${DEPEND}
virtual/ssh
"
# Needed for pod2man
BDEPEND="dev-lang/perl"
PATCHES=(
"${DISTDIR}/${P}-openssl-1.1.1.patch"
"${FILESDIR}"/${PN}-0.10.4-0001-Fix-function-prototypes-in-configure.patch
"${FILESDIR}"/${PN}-0.10.4-0002-Add-missing-includes-implicit-function-declarations.patch
)
DEPEND="sys-libs/pam
dev-libs/openssl:0="
RDEPEND="${DEPEND}
virtual/ssh"
src_prepare() {
default
# needed for pod2man
DEPEND="${DEPEND}
dev-lang/perl"
# Missing from tag
rm -r ed25519-donna || die
ln -s "${WORKDIR}"/ed25519-donna-${ED25519_DONNA_COMMIT} "${S}"/ed25519-donna || die
# For configure patches
eautoreconf
}
src_configure() {
pammod_hide_symbols
# bug #725720
export AR="$(type -P $(tc-getAR))"
econf \
--without-openssl-header-check \
--libexecdir="$(getpam_mod_dir)"