commit:     8f0b320d0db1beb60f0a124d07a280cd2e330fa2
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 29 00:55:34 2022 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Thu Sep 29 04:17:53 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8f0b320d

www-apache/pwauth: fix build with clang

Fixes both issues with clang16 and older clang depending on USE.
These fixes exist upstream and in a PR, but does not seem to be
any activity anymore.

Revbump given may help with potential runtime issues on other
compilers.

Closes: https://bugs.gentoo.org/870631
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 www-apache/pwauth/files/pwauth-2.3.10-clang.patch  | 39 +++++++++++++++++
 .../pwauth/files/pwauth-2.3.10-warnings.patch      | 51 ++++++++++++++++++++++
 ...th-2.3.10-r1.ebuild => pwauth-2.3.10-r2.ebuild} |  4 +-
 3 files changed, 93 insertions(+), 1 deletion(-)

diff --git a/www-apache/pwauth/files/pwauth-2.3.10-clang.patch 
b/www-apache/pwauth/files/pwauth-2.3.10-clang.patch
new file mode 100644
index 000000000000..ac241b465dde
--- /dev/null
+++ b/www-apache/pwauth/files/pwauth-2.3.10-clang.patch
@@ -0,0 +1,39 @@
+Minimal additional fixes for with both clang16 and older clang.
+
+https://bugs.gentoo.org/870631
+See also: https://github.com/phokz/pwauth/pull/13
+--- a/auth_sun.c
++++ b/auth_sun.c
+@@ -33,2 +33,3 @@
+ 
++#include <time.h>
+ #include "pwauth.h"
+--- a/fail_log.c
++++ b/fail_log.c
+@@ -33,2 +33,3 @@
+ 
++#include <time.h>
+ #include "pwauth.h"
+@@ -72,3 +73,3 @@
+ 
+-void log_failure()
++void log_failure(void)
+ {
+@@ -151,3 +152,3 @@
+ 
+-log_failure()
++void log_failure(void)
+ {
+--- a/nologin.c
++++ b/nologin.c
+@@ -40,3 +40,3 @@
+ 
+-check_nologin()
++int check_nologin(void)
+ {
+--- a/pwauth.h
++++ b/pwauth.h
+@@ -133 +133,3 @@
+ int check_auth(char *login, char *passwd);
++int check_nologin(void);
++void log_failure(void);

diff --git a/www-apache/pwauth/files/pwauth-2.3.10-warnings.patch 
b/www-apache/pwauth/files/pwauth-2.3.10-warnings.patch
new file mode 100644
index 000000000000..29faff3e0e9c
--- /dev/null
+++ b/www-apache/pwauth/files/pwauth-2.3.10-warnings.patch
@@ -0,0 +1,51 @@
+Backport to fix some clang16 issues.
+https://bugs.gentoo.org/870631
+
+https://github.com/phokz/pwauth/commit/c1e7fd9af0
+From: Philip Prindeville <phil...@redfish-solutions.com>
+Date: Mon, 23 Jul 2018 13:41:47 -0600
+Subject: [PATCH] Quiet compiler warnings for signatures
+
+There are missing/incomplete function declarations.  Also a missing
+header.
+--- a/lastlog.c
++++ b/lastlog.c
+@@ -31,6 +31,8 @@
+  * =======================================================================
+  */
+ 
++#include <time.h>
++
+ #include "pwauth.h"
+ 
+ /* LASTLOG - update the system's lastlog */
+--- a/main.c
++++ b/main.c
+@@ -44,6 +44,7 @@ int server_uids[]= {SERVER_UIDS, 0};
+ #endif
+ 
+ 
++int
+ main(int argc, char **argv)
+ {
+ #ifdef ENV_METHOD
+--- a/pwauth.h
++++ b/pwauth.h
+@@ -127,3 +127,7 @@ extern int haveuid;
+ #ifndef BFSZ
+ # define BFSZ 1024
+ #endif
++
++void snooze(int seconds);
++void lastlog(void);
++int check_auth(char *login, char *passwd);
+--- a/snooze.c
++++ b/snooze.c
+@@ -42,6 +42,7 @@
+  * sleep time, if other pwauth processes are in sleeps.
+  */
+ 
++void
+ snooze(int seconds)
+ {
+     int slfd;

diff --git a/www-apache/pwauth/pwauth-2.3.10-r1.ebuild 
b/www-apache/pwauth/pwauth-2.3.10-r2.ebuild
similarity index 94%
rename from www-apache/pwauth/pwauth-2.3.10-r1.ebuild
rename to www-apache/pwauth/pwauth-2.3.10-r2.ebuild
index 99e0dfdf3fe0..a99fff7b1ff0 100644
--- a/www-apache/pwauth/pwauth-2.3.10-r1.ebuild
+++ b/www-apache/pwauth/pwauth-2.3.10-r2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -22,6 +22,8 @@ PATCHES=(
        "${FILESDIR}/${P}-config.patch"
        "${FILESDIR}/${P}-makefile.patch"
        "${FILESDIR}/${PN}-strchr.patch"
+       "${FILESDIR}/${P}-warnings.patch"
+       "${FILESDIR}/${P}-clang.patch"
 )
 
 pkg_setup() {

Reply via email to