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@gentoo.org>
This commit is contained in:
Ionen Wolkens
2022-09-28 20:55:34 -04:00
parent c4dbd767a4
commit 8f0b320d0d
3 changed files with 93 additions and 1 deletions

View File

@@ -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);

View File

@@ -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 <philipp@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;

View File

@@ -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() {