fix build error

This commit is contained in:
zhangpan 2023-06-09 06:55:30 +00:00
parent e5c91747fa
commit aa47f5628f
2 changed files with 49 additions and 1 deletions

View File

@ -3,7 +3,7 @@
Name: cups
Epoch: 1
Version: 2.4.0
Release: 6
Release: 7
Summary: CUPS is the standards-based, open source printing system for linux operating systems.
License: GPLv2+ and LGPLv2+ with exceptions and AML
Url: https://openprinting.github.io/cups/
@ -28,6 +28,7 @@ Patch6000: backport-CVE-2022-26691.patch
Patch6001: backport-Remove-legacy-code-for-RIP_MAX_CACHE-environment-variable.patch
Patch6002: backport-Also-fix-cupsfilter.patch
Patch6003: backport-CVE-2023-32324.patch
Patch6004: fix-httpAddrGetList-test-case-fail.patch
BuildRequires: pam-devel pkgconf-pkg-config pkgconfig(gnutls) libacl-devel openldap-devel pkgconfig(libusb-1.0)
BuildRequires: krb5-devel pkgconfig(avahi-client) systemd pkgconfig(libsystemd) pkgconfig(dbus-1) python3-cups
@ -449,6 +450,9 @@ rm -f %{_exec_prefix}/lib/cups/backend/smb
%doc %{_datadir}/%{name}/www/apple-touch-icon.png
%changelog
* Fri Jun 9 2023 zhangpan <zhangpan103@h-partners.com> - 1:2.4.0-7
- fix build error
* Sat Jun 3 2023 zhouwenpei <zhouwenpei@h-partners.com> - 1:2.4.0-6
- fix CVE-2023-32324

View File

@ -0,0 +1,44 @@
From 079c00aac0db4d95383cf73be73e641ff26ebfc6 Mon Sep 17 00:00:00 2001
From: zhangpan <zhangpan103@h-partners.com>
Date: Fri, 9 Jun 2023 11:04:18 +0800
Subject: [PATCH] fix httpAddrGetList test case fail
---
cups/testhttp.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/cups/testhttp.c b/cups/testhttp.c
index 313e4bb..f446d65 100644
--- a/cups/testhttp.c
+++ b/cups/testhttp.c
@@ -14,7 +14,7 @@
*/
#include "cups-private.h"
-
+#include <unistd.h>
/*
* Types and structures...
@@ -231,7 +231,8 @@ main(int argc, /* I - Number of command-line arguments */
char scheme[HTTP_MAX_URI], /* Scheme from URI */
hostname[HTTP_MAX_URI], /* Hostname from URI */
username[HTTP_MAX_URI], /* Username:password from URI */
- resource[HTTP_MAX_URI]; /* Resource from URI */
+ resource[HTTP_MAX_URI], /* Resource from URI */
+ localhostname[HTTP_MAX_URI]; /* gethostname */
int port; /* Port number from URI */
http_uri_status_t uri_status; /* Status of URI separation */
http_addrlist_t *addrlist, /* Address list */
@@ -391,7 +392,7 @@ main(int argc, /* I - Number of command-line arguments */
printf("httpAddrGetList(%s): ", hostname);
- addrlist = httpAddrGetList(hostname, AF_UNSPEC, NULL);
+ addrlist = httpAddrGetList(gethostname(localhostname, sizeof(localhostname)), AF_UNSPEC, NULL);
if (addrlist)
{
for (i = 0, addr = addrlist; addr; i ++, addr = addr->next)
--
2.33.0