14f8ab
From 04a43bb831b98ce9942ac6daa7e14ff88ecd9bee Mon Sep 17 00:00:00 2001
14f8ab
From: Tamar Shacked <tshacked@redhat.com>
14f8ab
Date: Sun, 1 Aug 2021 09:30:18 +0300
14f8ab
Subject: contrib: remove contrib/sunrpc/xdr_sizeof.c
14f8ab
14f8ab
It's not needed, and it has a license that Fedora is not very happy with.
14f8ab
Just removed that file.
14f8ab
14f8ab
Backport of:
14f8ab
> Upstream-patch-link: https://review.gluster.org/#/c/glusterfs/+/24761/
14f8ab
> Fixes: #1383
14f8ab
> Change-Id: Ia753f0058c8a7c6482aca40c3b3dc8f6aa4a266d
14f8ab
> Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
14f8ab
14f8ab
BUG: 1939340
14f8ab
14f8ab
Signed-off-by: Tamar Shacked <tshacked@redhat.com>
14f8ab
Change-Id: Ibbc3871e66f542f4cb0c5a6c3182792eb125d0f1
14f8ab
---
14f8ab
 contrib/sunrpc/xdr_sizeof.c | 204 ------------------------------------
14f8ab
 rpc/rpc-lib/src/Makefile.am |   2 +-
14f8ab
 2 files changed, 1 insertion(+), 205 deletions(-)
14f8ab
 delete mode 100644 contrib/sunrpc/xdr_sizeof.c
14f8ab
14f8ab
diff --git a/contrib/sunrpc/xdr_sizeof.c b/contrib/sunrpc/xdr_sizeof.c
14f8ab
deleted file mode 100644
14f8ab
index ca1f7bf0a..000000000
14f8ab
--- a/contrib/sunrpc/xdr_sizeof.c
14f8ab
+++ /dev/null
14f8ab
@@ -1,204 +0,0 @@
14f8ab
-/*
14f8ab
- * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
14f8ab
- *
14f8ab
- * @APPLE_LICENSE_HEADER_START@
14f8ab
- *
14f8ab
- * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
14f8ab
- * Reserved.  This file contains Original Code and/or Modifications of
14f8ab
- * Original Code as defined in and that are subject to the Apple Public
14f8ab
- * Source License Version 1.1 (the "License").  You may not use this file
14f8ab
- * except in compliance with the License.  Please obtain a copy of the
14f8ab
- * License at http://www.apple.com/publicsource and read it before using
14f8ab
- * this file.
14f8ab
- *
14f8ab
- * The Original Code and all software distributed under the License are
14f8ab
- * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14f8ab
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
14f8ab
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
14f8ab
- * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT.  Please see the
14f8ab
- * License for the specific language governing rights and limitations
14f8ab
- * under the License.
14f8ab
- *
14f8ab
- * @APPLE_LICENSE_HEADER_END@
14f8ab
- */
14f8ab
-
14f8ab
-/*
14f8ab
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
14f8ab
- * unrestricted use provided that this legend is included on all tape
14f8ab
- * media and as a part of the software program in whole or part.  Users
14f8ab
- * may copy or modify Sun RPC without charge, but are not authorized
14f8ab
- * to license or distribute it to anyone else except as part of a product or
14f8ab
- * program developed by the user.
14f8ab
- *
14f8ab
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
14f8ab
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
14f8ab
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
14f8ab
- *
14f8ab
- * Sun RPC is provided with no support and without any obligation on the
14f8ab
- * part of Sun Microsystems, Inc. to assist in its use, correction,
14f8ab
- * modification or enhancement.
14f8ab
- *
14f8ab
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
14f8ab
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
14f8ab
- * OR ANY PART THEREOF.
14f8ab
- *
14f8ab
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
14f8ab
- * or profits or other special, indirect and consequential damages, even if
14f8ab
- * Sun has been advised of the possibility of such damages.
14f8ab
- *
14f8ab
- * Sun Microsystems, Inc.
14f8ab
- * 2550 Garcia Avenue
14f8ab
- * Mountain View, California  94043
14f8ab
- */
14f8ab
-
14f8ab
-/*
14f8ab
- * xdr_sizeof.c
14f8ab
- *
14f8ab
- * Copyright 1990 Sun Microsystems, Inc.
14f8ab
- *
14f8ab
- * General purpose routine to see how much space something will use
14f8ab
- * when serialized using XDR.
14f8ab
- */
14f8ab
-
14f8ab
-#ifdef GF_DARWIN_HOST_OS
14f8ab
-
14f8ab
-#include <rpc/types.h>
14f8ab
-#include <rpc/xdr.h>
14f8ab
-#include <sys/types.h>
14f8ab
-#include <sys/cdefs.h>
14f8ab
-
14f8ab
-#include <stdlib.h>
14f8ab
-
14f8ab
-/* ARGSUSED */
14f8ab
-#ifdef GF_DARWIN_HOST_OS
14f8ab
-static bool_t
14f8ab
-x_putlong (XDR *xdrs, const int *longp)
14f8ab
-{
14f8ab
-        xdrs->x_handy += BYTES_PER_XDR_UNIT;
14f8ab
-        return TRUE;
14f8ab
-}
14f8ab
-
14f8ab
-#else
14f8ab
-static bool_t
14f8ab
-x_putlong (XDR *xdrs, const long *longp)
14f8ab
-{
14f8ab
-        xdrs->x_handy += BYTES_PER_XDR_UNIT;
14f8ab
-        return TRUE;
14f8ab
-}
14f8ab
-#endif
14f8ab
-
14f8ab
-/* ARGSUSED */
14f8ab
-static bool_t
14f8ab
-x_putbytes (XDR *xdrs, const char *bp, u_int len)
14f8ab
-{
14f8ab
-        xdrs->x_handy += len;
14f8ab
-        return TRUE;
14f8ab
-}
14f8ab
-
14f8ab
-#ifdef GF_DARWIN_HOST_OS
14f8ab
-static u_int
14f8ab
-x_getpostn (XDR *xdrs)
14f8ab
-{
14f8ab
-        return xdrs->x_handy;
14f8ab
-}
14f8ab
-#else
14f8ab
-static u_int
14f8ab
-x_getpostn (const XDR *xdrs)
14f8ab
-{
14f8ab
-        return xdrs->x_handy;
14f8ab
-}
14f8ab
-#endif
14f8ab
-
14f8ab
-/* ARGSUSED */
14f8ab
-static bool_t
14f8ab
-x_setpostn (XDR *xdrs, u_int len)
14f8ab
-{
14f8ab
-        /* This is not allowed */
14f8ab
-        return FALSE;
14f8ab
-}
14f8ab
-
14f8ab
-static int32_t *
14f8ab
-x_inline (XDR *xdrs, u_int len)
14f8ab
-{
14f8ab
-        if (len == 0)
14f8ab
-                return NULL;
14f8ab
-        if (xdrs->x_op != XDR_ENCODE)
14f8ab
-                return NULL;
14f8ab
-        if (len < (u_int) (long int) xdrs->x_base)
14f8ab
-        {
14f8ab
-                /* x_private was already allocated */
14f8ab
-                xdrs->x_handy += len;
14f8ab
-                return (int32_t *) xdrs->x_private;
14f8ab
-        }
14f8ab
-        else
14f8ab
-        {
14f8ab
-                /* Free the earlier space and allocate new area */
14f8ab
-                free (xdrs->x_private);
14f8ab
-                if ((xdrs->x_private = (caddr_t) malloc (len)) == NULL)
14f8ab
-                {
14f8ab
-                        xdrs->x_base = 0;
14f8ab
-                        return NULL;
14f8ab
-                }
14f8ab
-                xdrs->x_base = (void *) (long) len;
14f8ab
-                xdrs->x_handy += len;
14f8ab
-                return (int32_t *) xdrs->x_private;
14f8ab
-        }
14f8ab
-}
14f8ab
-
14f8ab
-static int
14f8ab
-harmless (void)
14f8ab
-{
14f8ab
-        /* Always return FALSE/NULL, as the case may be */
14f8ab
-        return 0;
14f8ab
-}
14f8ab
-
14f8ab
-static void
14f8ab
-x_destroy (XDR *xdrs)
14f8ab
-{
14f8ab
-        xdrs->x_handy = 0;
14f8ab
-        xdrs->x_base = 0;
14f8ab
-        if (xdrs->x_private)
14f8ab
-        {
14f8ab
-                free (xdrs->x_private);
14f8ab
-                xdrs->x_private = NULL;
14f8ab
-        }
14f8ab
-        return;
14f8ab
-}
14f8ab
-
14f8ab
-unsigned long
14f8ab
-xdr_sizeof (xdrproc_t func, void *data)
14f8ab
-{
14f8ab
-        XDR x;
14f8ab
-        struct xdr_ops ops;
14f8ab
-        bool_t stat;
14f8ab
-
14f8ab
-#ifdef GF_DARWIN_HOST_OS
14f8ab
-        typedef bool_t (*dummyfunc1) (XDR *, int *);
14f8ab
-#else
14f8ab
-        typedef bool_t (*dummyfunc1) (XDR *, long *);
14f8ab
-#endif
14f8ab
-        typedef bool_t (*dummyfunc2) (XDR *, caddr_t, u_int);
14f8ab
-
14f8ab
-        ops.x_putlong = x_putlong;
14f8ab
-        ops.x_putbytes = x_putbytes;
14f8ab
-        ops.x_inline = x_inline;
14f8ab
-        ops.x_getpostn = x_getpostn;
14f8ab
-        ops.x_setpostn = x_setpostn;
14f8ab
-        ops.x_destroy = x_destroy;
14f8ab
-
14f8ab
-        /* the other harmless ones */
14f8ab
-        ops.x_getlong = (dummyfunc1) harmless;
14f8ab
-        ops.x_getbytes = (dummyfunc2) harmless;
14f8ab
-
14f8ab
-        x.x_op = XDR_ENCODE;
14f8ab
-        x.x_ops = &ops;
14f8ab
-        x.x_handy = 0;
14f8ab
-        x.x_private = (caddr_t) NULL;
14f8ab
-        x.x_base = (caddr_t) 0;
14f8ab
-
14f8ab
-        stat = func (&x, data, 0);
14f8ab
-        if (x.x_private)
14f8ab
-                free (x.x_private);
14f8ab
-        return (stat == TRUE ? (unsigned) x.x_handy : 0);
14f8ab
-}
14f8ab
-#endif /* GF_DARWIN_HOST_OS */
14f8ab
diff --git a/rpc/rpc-lib/src/Makefile.am b/rpc/rpc-lib/src/Makefile.am
14f8ab
index 81a964768..35c9db07e 100644
14f8ab
--- a/rpc/rpc-lib/src/Makefile.am
14f8ab
+++ b/rpc/rpc-lib/src/Makefile.am
14f8ab
@@ -2,7 +2,7 @@ lib_LTLIBRARIES = libgfrpc.la
14f8ab
 
14f8ab
 libgfrpc_la_SOURCES = auth-unix.c rpcsvc-auth.c rpcsvc.c auth-null.c \
14f8ab
 	rpc-transport.c xdr-rpc.c xdr-rpcclnt.c rpc-clnt.c auth-glusterfs.c \
14f8ab
-	rpc-drc.c $(CONTRIBDIR)/sunrpc/xdr_sizeof.c  rpc-clnt-ping.c \
14f8ab
+	rpc-drc.c rpc-clnt-ping.c \
14f8ab
         autoscale-threads.c mgmt-pmap.c
14f8ab
 
14f8ab
 EXTRA_DIST = libgfrpc.sym
14f8ab
-- 
14f8ab
2.27.0
14f8ab