forked from pool/libtirpc
Accepting request 686706 from Base:System
OBS-URL: https://build.opensuse.org/request/show/686706 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libtirpc?expand=0&rev=50
This commit is contained in:
commit
6b040016b8
@ -0,0 +1,69 @@
|
|||||||
|
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
|
||||||
|
|
@ -1,3 +1,10 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Mar 11 15:23:12 UTC 2019 - Michal Suchanek <msuchanek@suse.de>
|
||||||
|
|
||||||
|
- Fix SLES 15 - yp_bind_client_create_v3: RPC: Unknown host (bsc#1126096).
|
||||||
|
- Add upstream patch
|
||||||
|
0001-xdrstdio_create-buffers-do-not-output-encoded-values.patch
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Apr 12 08:06:23 UTC 2018 - Thomas.Blume@suse.com
|
Thu Apr 12 08:06:23 UTC 2018 - Thomas.Blume@suse.com
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package libtirpc
|
# spec file for package libtirpc
|
||||||
#
|
#
|
||||||
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
|
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@ -12,7 +12,7 @@
|
|||||||
# license that conforms to the Open Source Definition (Version 1.9)
|
# license that conforms to the Open Source Definition (Version 1.9)
|
||||||
# published by the Open Source Initiative.
|
# published by the Open Source Initiative.
|
||||||
|
|
||||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
@ -40,6 +40,7 @@ Patch1: 001-new-rpcbindsock-path.patch
|
|||||||
# Revert upstream change until tirpc 1.0.4 with a final solutions comes out
|
# Revert upstream change until tirpc 1.0.4 with a final solutions comes out
|
||||||
Patch2: 002-revert-binddynport.patch
|
Patch2: 002-revert-binddynport.patch
|
||||||
Patch3: 0001-Fix-regression-introduced-by-change-rpc-version-orde.patch
|
Patch3: 0001-Fix-regression-introduced-by-change-rpc-version-orde.patch
|
||||||
|
Patch16: 0001-xdrstdio_create-buffers-do-not-output-encoded-values.patch
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
%define debug_package_requires libtirpc3 = %{version}-%{release}
|
%define debug_package_requires libtirpc3 = %{version}-%{release}
|
||||||
|
|
||||||
@ -90,6 +91,7 @@ TCP over IPv4.
|
|||||||
%endif
|
%endif
|
||||||
%patch2 -p1
|
%patch2 -p1
|
||||||
%patch3 -p1
|
%patch3 -p1
|
||||||
|
%patch16 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
sed -i -e 's|@includedir@/tirpc|@includedir@|g' libtirpc.pc.in
|
sed -i -e 's|@includedir@/tirpc|@includedir@|g' libtirpc.pc.in
|
||||||
|
Loading…
Reference in New Issue
Block a user