SHA256
1
0
forked from pool/libtirpc

Accepting request 747540 from home:pevik:branches:Base:System

- Fix previous version:
  - actually delete
    0001-xdrstdio_create-buffers-do-not-output-encoded-values.patch
  - use 0001-Makefile.am-Use-LIBADD-instead-of-LDFLAGS-to-link-ag.patch
  - use 0002-man-rpc_secure.3t-Fix-typo-in-manpage.patch (renamed from
    0003-man-rpc_secure.3t-Fix-typo-in-manpage.patch)
  - use 0003-xdr-add-a-defensive-mask-in-xdr_int64_t-and-xdr_u_in.patch
    (renamed from
    0004-xdr-add-a-defensive-mask-in-xdr_int64_t-and-xdr_u_in.patch)

  - 000-bindresvport_blacklist.patch (accepted in 5b037cc9, libtirpc 1.1.4)
  - 001-new-rpcbindsock-path.patch (not needed, rpcbind now uses /var/run directory)
  - 002-revert-binddynport.patch (fixed in 2802259, libtirpc-1-0-4-rc1)
  - 0001-Fix-regression-introduced-by-change-rpc-version-orde.patch
    (backport of 25d38d7, libtirpc-1-0-4-rc1)
  - 0001-xdrstdio_create-buffers-do-not-output-encoded-values.patch
    (backport of 145272c, libtirpc-1-0-4-rc2)
  - 0001-Makefile.am-Use-LIBADD-instead-of-LDFLAGS-to-link-ag.patch
  - 0003-man-rpc_secure.3t-Fix-typo-in-manpage.patch
  - 0004-xdr-add-a-defensive-mask-in-xdr_int64_t-and-xdr_u_in.patch

OBS-URL: https://build.opensuse.org/request/show/747540
OBS-URL: https://build.opensuse.org/package/show/Base:System/libtirpc?expand=0&rev=79
This commit is contained in:
Marcus Meissner 2019-11-24 10:23:02 +00:00 committed by Git OBS Bridge
parent b62bf7c05a
commit 4c276cfbb2
5 changed files with 29 additions and 79 deletions

View File

@ -1,69 +0,0 @@
From 145272c2b6d89a1c3a7de86a2cbef43880f1b61b Mon Sep 17 00:00:00 2001
From: Steve Dickson <steved@redhat.com>
Date: Wed, 11 Jul 2018 11:21:39 -0400
Subject: [PATCH] xdrstdio_create buffers do not output encoded values on ppc
References: bsc#1126096
Patch-mainline: libtirpc-1-0-4
Git-commit: 145272c2b6d89a1c3a7de86a2cbef43880f1b61b
The cause is that the xdr_putlong uses a long to store the
converted value, then passes it to fwrite as a byte buffer.
Only the first 4 bytes are written, which is okay for a LE
system after byteswapping, but writes all zeroes on BE systems.
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1261738
Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
Acked-by: Michal Suchanek <msuchanek@suse.de>
---
src/xdr_stdio.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/src/xdr_stdio.c b/src/xdr_stdio.c
index 4410262275b6..846c7bf2a9c7 100644
--- a/src/xdr_stdio.c
+++ b/src/xdr_stdio.c
@@ -38,6 +38,7 @@
*/
#include <stdio.h>
+#include <stdint.h>
#include <arpa/inet.h>
#include <rpc/types.h>
@@ -103,10 +104,12 @@ xdrstdio_getlong(xdrs, lp)
XDR *xdrs;
long *lp;
{
+ int32_t mycopy;
- if (fread(lp, sizeof(int32_t), 1, (FILE *)xdrs->x_private) != 1)
+ if (fread(&mycopy, sizeof(int32_t), 1, (FILE *)xdrs->x_private) != 1)
return (FALSE);
- *lp = (long)ntohl((u_int32_t)*lp);
+
+ *lp = (long)ntohl(mycopy);
return (TRUE);
}
@@ -115,8 +118,14 @@ xdrstdio_putlong(xdrs, lp)
XDR *xdrs;
const long *lp;
{
- long mycopy = (long)htonl((u_int32_t)*lp);
+ int32_t mycopy;
+
+#if defined(_LP64)
+ if ((*lp > UINT32_MAX) || (*lp < INT32_MIN))
+ return (FALSE);
+#endif
+ mycopy = (int32_t)htonl((int32_t)*lp);
if (fwrite(&mycopy, sizeof(int32_t), 1, (FILE *)xdrs->x_private) != 1)
return (FALSE);
return (TRUE);
--
2.20.1

View File

@ -1,3 +1,16 @@
-------------------------------------------------------------------
Tue Nov 12 10:24:59 UTC 2019 - Petr Vorel <pvorel@suse.cz>
- Fix previous version:
- actually delete
0001-xdrstdio_create-buffers-do-not-output-encoded-values.patch
- use 0001-Makefile.am-Use-LIBADD-instead-of-LDFLAGS-to-link-ag.patch
- use 0002-man-rpc_secure.3t-Fix-typo-in-manpage.patch (renamed from
0003-man-rpc_secure.3t-Fix-typo-in-manpage.patch)
- use 0003-xdr-add-a-defensive-mask-in-xdr_int64_t-and-xdr_u_in.patch
(renamed from
0004-xdr-add-a-defensive-mask-in-xdr_int64_t-and-xdr_u_in.patch)
-------------------------------------------------------------------
Wed Oct 16 11:46:28 UTC 2019 - Petr Vorel <pvorel@suse.cz>
@ -8,18 +21,18 @@ Wed Oct 16 11:46:28 UTC 2019 - Petr Vorel <pvorel@suse.cz>
although it's not compiled with --enable-obsolete-rpc
- Drop patches accepted in previous releases or not needed
- 000-bindresvport_blacklist.patch (accepted in 5b037cc9, libtirpc 1.1.4)
- 001-new-rpcbindsock-path.patch (not needed, rpcbind now uses /var/run directory)
- 002-revert-binddynport.patch (fixed in 2802259, libtirpc-1-0-4-rc1)
- 0001-Fix-regression-introduced-by-change-rpc-version-orde.patch
(backport of 25d38d7, libtirpc-1-0-4-rc1)
- 0001-xdrstdio_create-buffers-do-not-output-encoded-values.patch
(backport of 145272c, libtirpc-1-0-4-rc2)
- 000-bindresvport_blacklist.patch (accepted in 5b037cc9, libtirpc 1.1.4)
- 001-new-rpcbindsock-path.patch (not needed, rpcbind now uses /var/run directory)
- 002-revert-binddynport.patch (fixed in 2802259, libtirpc-1-0-4-rc1)
- 0001-Fix-regression-introduced-by-change-rpc-version-orde.patch
(backport of 25d38d7, libtirpc-1-0-4-rc1)
- 0001-xdrstdio_create-buffers-do-not-output-encoded-values.patch
(backport of 145272c, libtirpc-1-0-4-rc2)
- Add fixes from upcomming release
- 0001-Makefile.am-Use-LIBADD-instead-of-LDFLAGS-to-link-ag.patch
- 0003-man-rpc_secure.3t-Fix-typo-in-manpage.patch
- 0004-xdr-add-a-defensive-mask-in-xdr_int64_t-and-xdr_u_in.patch
- 0001-Makefile.am-Use-LIBADD-instead-of-LDFLAGS-to-link-ag.patch
- 0003-man-rpc_secure.3t-Fix-typo-in-manpage.patch
- 0004-xdr-add-a-defensive-mask-in-xdr_int64_t-and-xdr_u_in.patch
-------------------------------------------------------------------
Mon Mar 11 15:23:12 UTC 2019 - Michal Suchanek <msuchanek@suse.de>

View File

@ -36,6 +36,9 @@ Source: %{name}-%{version}.tar.bz2
Source1: baselibs.conf
Patch0: libtirpc-1-1-5-rc1.patch
Patch1: libtirpc-1-1-5-rc2.patch
Patch2: 0001-Makefile.am-Use-LIBADD-instead-of-LDFLAGS-to-link-ag.patch
Patch3: 0002-man-rpc_secure.3t-Fix-typo-in-manpage.patch
Patch4: 0003-xdr-add-a-defensive-mask-in-xdr_int64_t-and-xdr_u_in.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define debug_package_requires libtirpc3 = %{version}-%{release}
@ -82,6 +85,9 @@ TCP over IPv4.
%setup -q -n %name-%version
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%build
sed -i -e 's|@includedir@/tirpc|@includedir@|g' libtirpc.pc.in