fix build error

This commit is contained in:
zhangpan 2023-06-09 06:26:30 +00:00
parent 404f3dcd38
commit aaf6f31e8a
2 changed files with 49 additions and 1 deletions

View File

@ -1,7 +1,7 @@
Name: cups
Epoch: 1
Version: 2.2.13
Release: 15
Release: 16
Summary: CUPS is the standards-based, open source printing system for linux operating systems.
License: GPLv2+ and LGPLv2+ with exceptions and AML
Url: http://www.cups.org/
@ -39,6 +39,7 @@ Patch6002: backport-CVE-2022-26691.patch
#Partial backport of 82e3ee0e3230287b76a76fb8f16b92ca6e50b444
Patch6003: CVE-2019-8842.patch
Patch6004: backport-CVE-2023-32324.patch
Patch6005: fix-httpAddrGetList-test-case-fail.patch
Provides: cupsddk cupsddk-drivers cups-filesystem cups-client cups-ipptool cups-lpd
Provides: lpd lpr /usr/bin/lpq /usr/bin/lpr /usr/bin/lp /usr/bin/cancel /usr/bin/lprm /usr/bin/lpstat
@ -333,6 +334,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.2.13-16
- fix build error
* Sat Jun 3 2023 zhouwenpei <zhouwenpei@h-partners.com> - 1:2.2.13-15
- 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