1From 5746b68ba9dda87586b3ac88fe84031cbc0015f7 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 11 May 2018 12:20:03 -0700
4Subject: [PATCH] Link with libtirpc
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7---
8Upstream-Status: Pending
9
10 configure                 | 2 +-
11 rpc.rusersd/rusers_proc.c | 7 +------
12 rpc.rusersd/rusersd.c     | 6 +-----
13 rup/rup.c                 | 2 +-
14 4 files changed, 4 insertions(+), 13 deletions(-)
15
16--- a/configure
17+++ b/configure
18@@ -92,7 +92,6 @@ else
19     echo -n 'Checking if C compiler works... '
20     if (
21           $CC __conftest.c -o __conftest || exit 1
22-          ./__conftest || exit 1
23        ) >/dev/null 2>&1; then
24          echo 'yes'
25      else
26@@ -146,8 +145,7 @@ else
27
28 fi
29
30-LDFLAGS=
31-LIBS=
32+LIBS="$LIBS -ltirpc"
33
34 rm -f __conftest*
35
36@@ -172,13 +170,11 @@ int main() {
37 EOF
38 if (
39       $CC $CFLAGS  __conftest.c  -o __conftest || exit 1
40-      ./__conftest || exit 1
41    ) >/dev/null 2>&1; then
42     echo 'yes'
43 else
44     if (
45           $CC $CFLAGS -D__USE_BSD_SIGNAL __conftest.c  -o __conftest || exit 1
46-          ./__conftest || exit 1
47        ) >/dev/null 2>&1; then
48         echo '-D__USE_BSD_SIGNAL'
49         CFLAGS="$CFLAGS -D__USE_BSD_SIGNAL"
50@@ -231,7 +227,6 @@ if (
51 else
52     if (
53           $CC $CFLAGS -D_GNU_SOURCE __conftest.c  -o __conftest || exit 1
54-          ./__conftest || exit 1
55        ) >/dev/null 2>&1; then
56         echo '-D_GNU_SOURCE'
57         CFLAGS="$CFLAGS -D_GNU_SOURCE"
58@@ -262,20 +257,17 @@ int main() {
59 EOF
60 if (
61       $CC $CFLAGS  __conftest.c $LIBBSD -o __conftest || exit 1
62-      ./__conftest || exit 1
63    ) >/dev/null 2>&1; then
64     echo 'ok'
65 else
66     if (
67           $CC $CFLAGS  __conftest.c -lsnprintf $LIBBSD -o __conftest || exit 1
68-          ./__conftest || exit 1
69        ) >/dev/null 2>&1; then
70         echo '-lsnprintf'
71         LIBS="$LIBS -lsnprintf"
72     else
73         if (
74               $CC $CFLAGS  __conftest.c -ldb $LIBBSD -o __conftest || exit 1
75-              ./__conftest || exit 1
76            ) >/dev/null 2>&1; then
77             echo '-ldb'
78             LIBS="$LIBS -ldb"
79--- a/rpc.rusersd/rusers_proc.c
80+++ b/rpc.rusersd/rusers_proc.c
81@@ -57,12 +57,7 @@ char rp_rcsid[] =
82 	#define RUT_TIME ut_time
83 #endif
84
85-/* Glibc strikes again */
86-#ifdef __GLIBC__
87-	#include <rpcsvc/rusers.h>
88-#else
89-	#include "rusers.h"
90-#endif
91+#include "rusers.h"
92
93 void rusers_service(struct svc_req *rqstp, SVCXPRT *transp);
94
95--- a/rpc.rusersd/rusersd.c
96+++ b/rpc.rusersd/rusersd.c
97@@ -38,11 +38,7 @@ char rusersd_rcsid[] =
98 #include <rpc/pmap_clnt.h>
99 #include <unistd.h>
100 #include <grp.h>
101-#ifdef __GLIBC__
102-	#include <rpcsvc/rusers.h>
103-#else
104-	#include "rusers.h"
105-#endif
106+#include "rusers.h"
107
108 #include "../version.h"
109
110--- a/rup/rup.c
111+++ b/rup/rup.c
112@@ -48,7 +48,7 @@ char rcsid[] = "$Id: rup.c,v 1.8 2000/07
113
114 #undef FSHIFT			/* Use protocol's shift and scale values */
115 #undef FSCALE
116-#include <rpcsvc/rstat.h>
117+#include "rstat.h"
118
119 #include "../version.h"
120
121