diff options
author | Waldemar Brodkorb <wbx@uclibc-ng.org> | 2016-10-08 19:31:41 +0200 |
---|---|---|
committer | Waldemar Brodkorb <wbx@uclibc-ng.org> | 2016-10-08 19:31:57 +0200 |
commit | e010476a7aa4548e47e6d76455cb09d289851ab9 (patch) | |
tree | 162d1e5e60718ccebe31c5486e37440e0cdd597e /package/rpcbind/patches | |
parent | ac9ec140fbb81e12f9121c21b0d39b5747d6c37c (diff) |
fix nfs-utils/rpcbind for musl toolchains, patches mostly from Alpine Linux
Diffstat (limited to 'package/rpcbind/patches')
-rw-r--r-- | package/rpcbind/patches/patch-src_check_bound_c | 11 | ||||
-rw-r--r-- | package/rpcbind/patches/patch-src_pmap_svc_c | 19 | ||||
-rw-r--r-- | package/rpcbind/patches/patch-src_rpcb_svc_4_c | 31 | ||||
-rw-r--r-- | package/rpcbind/patches/patch-src_rpcb_svc_c | 26 | ||||
-rw-r--r-- | package/rpcbind/patches/patch-src_rpcb_svc_com_c | 109 | ||||
-rw-r--r-- | package/rpcbind/patches/patch-src_rpcbind_c | 40 | ||||
-rw-r--r-- | package/rpcbind/patches/patch-src_util_c | 27 | ||||
-rw-r--r-- | package/rpcbind/patches/patch-src_warmstart_c | 13 |
8 files changed, 274 insertions, 2 deletions
diff --git a/package/rpcbind/patches/patch-src_check_bound_c b/package/rpcbind/patches/patch-src_check_bound_c new file mode 100644 index 000000000..9e79c1392 --- /dev/null +++ b/package/rpcbind/patches/patch-src_check_bound_c @@ -0,0 +1,11 @@ +--- rpcbind-0.2.3.orig/src/check_bound.c 2015-04-27 16:07:43.000000000 +0200 ++++ rpcbind-0.2.3/src/check_bound.c 2016-10-08 18:19:45.000000000 +0200 +@@ -70,7 +70,7 @@ static struct fdlist *fdhead; /* Link li + static struct fdlist *fdtail; + static char *nullstring = ""; + +-static bool_t check_bound __P((struct fdlist *, char *uaddr)); ++static bool_t check_bound (struct fdlist *, char *uaddr); + + /* + * Returns 1 if the given address is bound for the given addr & transport diff --git a/package/rpcbind/patches/patch-src_pmap_svc_c b/package/rpcbind/patches/patch-src_pmap_svc_c new file mode 100644 index 000000000..12eda401f --- /dev/null +++ b/package/rpcbind/patches/patch-src_pmap_svc_c @@ -0,0 +1,19 @@ +--- rpcbind-0.2.3.orig/src/pmap_svc.c 2015-04-27 16:07:43.000000000 +0200 ++++ rpcbind-0.2.3/src/pmap_svc.c 2016-10-08 18:19:45.000000000 +0200 +@@ -60,11 +60,11 @@ static char sccsid[] = "@(#)pmap_svc.c 1 + #include "rpcbind.h" + #include "xlog.h" + #include <rpc/svc_soc.h> /* svc_getcaller routine definition */ +-static struct pmaplist *find_service_pmap __P((rpcprog_t, rpcvers_t, +- rpcprot_t)); +-static bool_t pmapproc_change __P((struct svc_req *, SVCXPRT *, u_long)); +-static bool_t pmapproc_getport __P((struct svc_req *, SVCXPRT *)); +-static bool_t pmapproc_dump __P((struct svc_req *, SVCXPRT *)); ++static struct pmaplist *find_service_pmap (rpcprog_t, rpcvers_t, ++ rpcprot_t); ++static bool_t pmapproc_change (struct svc_req *, SVCXPRT *, u_long); ++static bool_t pmapproc_getport (struct svc_req *, SVCXPRT *); ++static bool_t pmapproc_dump (struct svc_req *, SVCXPRT *); + + /* + * Called for all the version 2 inquiries. diff --git a/package/rpcbind/patches/patch-src_rpcb_svc_4_c b/package/rpcbind/patches/patch-src_rpcb_svc_4_c new file mode 100644 index 000000000..fe2a0835c --- /dev/null +++ b/package/rpcbind/patches/patch-src_rpcb_svc_4_c @@ -0,0 +1,31 @@ +--- rpcbind-0.2.3.orig/src/rpcb_svc_4.c 2015-04-27 16:07:43.000000000 +0200 ++++ rpcbind-0.2.3/src/rpcb_svc_4.c 2016-10-08 18:19:45.000000000 +0200 +@@ -54,13 +54,13 @@ + #include "rpcbind.h" + #include "xlog.h" + +-static void *rpcbproc_getaddr_4_local __P((void *, struct svc_req *, SVCXPRT *, +- rpcvers_t)); +-static void *rpcbproc_getversaddr_4_local __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t)); ++static void *rpcbproc_getaddr_4_local (void *, struct svc_req *, SVCXPRT *, ++ rpcvers_t); ++static void *rpcbproc_getversaddr_4_local (void *, struct svc_req *, SVCXPRT *, rpcvers_t); + static void *rpcbproc_getaddrlist_4_local +- __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t)); +-static void free_rpcb_entry_list __P((rpcb_entry_list_ptr *)); +-static void *rpcbproc_dump_4_local __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t)); ++ (void *, struct svc_req *, SVCXPRT *, rpcvers_t); ++static void free_rpcb_entry_list (rpcb_entry_list_ptr *); ++static void *rpcbproc_dump_4_local (void *, struct svc_req *, SVCXPRT *, rpcvers_t); + + /* + * Called by svc_getreqset. There is a separate server handle for +@@ -78,7 +78,7 @@ rpcb_service_4(struct svc_req *rqstp, SV + } argument; + char *result; + xdrproc_t xdr_argument, xdr_result; +- void *(*local) __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t)); ++ void *(*local) (void *, struct svc_req *, SVCXPRT *, rpcvers_t); + rpcprog_t setprog = 0; + + rpcbs_procinfo(RPCBVERS_4_STAT, rqstp->rq_proc); diff --git a/package/rpcbind/patches/patch-src_rpcb_svc_c b/package/rpcbind/patches/patch-src_rpcb_svc_c new file mode 100644 index 000000000..dbdbf00e2 --- /dev/null +++ b/package/rpcbind/patches/patch-src_rpcb_svc_c @@ -0,0 +1,26 @@ +--- rpcbind-0.2.3.orig/src/rpcb_svc.c 2015-04-27 16:07:43.000000000 +0200 ++++ rpcbind-0.2.3/src/rpcb_svc.c 2016-10-08 18:19:45.000000000 +0200 +@@ -53,10 +53,10 @@ + #include "rpcbind.h" + #include "xlog.h" + +-static void *rpcbproc_getaddr_3_local __P((void *, struct svc_req *, SVCXPRT *, +- rpcvers_t)); +-static void *rpcbproc_dump_3_local __P((void *, struct svc_req *, SVCXPRT *, +- rpcvers_t)); ++static void *rpcbproc_getaddr_3_local (void *, struct svc_req *, SVCXPRT *, ++ rpcvers_t); ++static void *rpcbproc_dump_3_local (void *, struct svc_req *, SVCXPRT *, ++ rpcvers_t); + + /* + * Called by svc_getreqset. There is a separate server handle for +@@ -75,7 +75,7 @@ rpcb_service_3(struct svc_req *rqstp, SV + } argument; + char *result; + xdrproc_t xdr_argument, xdr_result; +- void *(*local) __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t)); ++ void *(*local) (void *, struct svc_req *, SVCXPRT *, rpcvers_t); + rpcprog_t setprog = 0; + + rpcbs_procinfo(RPCBVERS_3_STAT, rqstp->rq_proc); diff --git a/package/rpcbind/patches/patch-src_rpcb_svc_com_c b/package/rpcbind/patches/patch-src_rpcb_svc_com_c index d62181ce4..f173f2e50 100644 --- a/package/rpcbind/patches/patch-src_rpcb_svc_com_c +++ b/package/rpcbind/patches/patch-src_rpcb_svc_com_c @@ -1,6 +1,111 @@ --- rpcbind-0.2.3.orig/src/rpcb_svc_com.c 2015-04-27 16:07:43.000000000 +0200 -+++ rpcbind-0.2.3/src/rpcb_svc_com.c 2015-11-29 16:56:25.496204447 +0100 -@@ -1274,10 +1274,17 @@ handle_reply(int fd, SVCXPRT *xprt) ++++ rpcbind-0.2.3/src/rpcb_svc_com.c 2016-10-08 18:20:08.000000000 +0200 +@@ -42,8 +42,6 @@ + #include <sys/types.h> + #include <sys/stat.h> + #include <sys/param.h> +-#include <sys/poll.h> +-#include <bits/poll.h> + #include <sys/socket.h> + #include <rpc/rpc.h> + #include <rpc/rpcb_prot.h> +@@ -54,6 +52,7 @@ + #include <unistd.h> + #include <stdio.h> + #include <time.h> ++#include <poll.h> + #ifdef PORTMAP + #include <netinet/in.h> + #include <rpc/pmap_prot.h> +@@ -100,29 +99,29 @@ struct finfo { + static struct finfo FINFO[NFORWARD]; + + +-static bool_t xdr_encap_parms __P((XDR *, struct encap_parms *)); +-static bool_t xdr_rmtcall_args __P((XDR *, struct r_rmtcall_args *)); +-static bool_t xdr_rmtcall_result __P((XDR *, struct r_rmtcall_args *)); +-static bool_t xdr_opaque_parms __P((XDR *, struct r_rmtcall_args *)); +-static int find_rmtcallfd_by_netid __P((char *)); +-static SVCXPRT *find_rmtcallxprt_by_fd __P((int)); +-static int forward_register __P((u_int32_t, struct netbuf *, int, char *, +- rpcproc_t, rpcvers_t, u_int32_t *)); +-static struct finfo *forward_find __P((u_int32_t)); +-static int free_slot_by_xid __P((u_int32_t)); +-static int free_slot_by_index __P((int)); +-static int netbufcmp __P((struct netbuf *, struct netbuf *)); +-static struct netbuf *netbufdup __P((struct netbuf *)); +-static void netbuffree __P((struct netbuf *)); +-static int check_rmtcalls __P((struct pollfd *, int)); +-static void xprt_set_caller __P((SVCXPRT *, struct finfo *)); +-static void send_svcsyserr __P((SVCXPRT *, struct finfo *)); +-static void handle_reply __P((int, SVCXPRT *)); +-static void find_versions __P((rpcprog_t, char *, rpcvers_t *, rpcvers_t *)); +-static rpcblist_ptr find_service __P((rpcprog_t, rpcvers_t, char *)); +-static char *getowner __P((SVCXPRT *, char *, size_t)); +-static int add_pmaplist __P((RPCB *)); +-static int del_pmaplist __P((RPCB *)); ++static bool_t xdr_encap_parms (XDR *, struct encap_parms *); ++static bool_t xdr_rmtcall_args (XDR *, struct r_rmtcall_args *); ++static bool_t xdr_rmtcall_result (XDR *, struct r_rmtcall_args *); ++static bool_t xdr_opaque_parms (XDR *, struct r_rmtcall_args *); ++static int find_rmtcallfd_by_netid (char *); ++static SVCXPRT *find_rmtcallxprt_by_fd (int); ++static int forward_register (u_int32_t, struct netbuf *, int, char *, ++ rpcproc_t, rpcvers_t, u_int32_t *); ++static struct finfo *forward_find (u_int32_t); ++static int free_slot_by_xid (u_int32_t); ++static int free_slot_by_index (int); ++static int netbufcmp (struct netbuf *, struct netbuf *); ++static struct netbuf *netbufdup (struct netbuf *); ++static void netbuffree (struct netbuf *); ++static int check_rmtcalls (struct pollfd *, int); ++static void xprt_set_caller (SVCXPRT *, struct finfo *); ++static void send_svcsyserr (SVCXPRT *, struct finfo *); ++static void handle_reply (int, SVCXPRT *); ++static void find_versions (rpcprog_t, char *, rpcvers_t *, rpcvers_t *); ++static rpcblist_ptr find_service (rpcprog_t, rpcvers_t, char *); ++static char *getowner (SVCXPRT *, char *, size_t); ++static int add_pmaplist (RPCB *); ++static int del_pmaplist (RPCB *); + + /* + * Set a mapping of program, version, netid +@@ -1183,12 +1182,33 @@ check_rmtcalls(struct pollfd *pfds, int + return (ncallbacks_found); + } + ++/* ++ * This is really a helper function defined in libtirpc, but unfortunately, it hasn't ++ * been exported yet. ++ */ ++static struct netbuf * ++__rpc_set_netbuf(struct netbuf *nb, const void *ptr, size_t len) ++{ ++ if (nb->len != len) { ++ if (nb->len) ++ mem_free(nb->buf, nb->len); ++ nb->buf = mem_alloc(len); ++ if (nb->buf == NULL) ++ return NULL; ++ ++ nb->maxlen = nb->len = len; ++ } ++ memcpy(nb->buf, ptr, len); ++ return nb; ++} ++ + static void + xprt_set_caller(SVCXPRT *xprt, struct finfo *fi) + { ++ const struct netbuf *caller = fi->caller_addr; + u_int32_t *xidp; + +- *(svc_getrpccaller(xprt)) = *(fi->caller_addr); ++ __rpc_set_netbuf(svc_getrpccaller(xprt), caller->buf, caller->len); + xidp = __rpcb_get_dg_xidp(xprt); + *xidp = fi->caller_xid; + } +@@ -1274,10 +1294,17 @@ handle_reply(int fd, SVCXPRT *xprt) a.rmt_localvers = fi->versnum; xprt_set_caller(xprt, fi); diff --git a/package/rpcbind/patches/patch-src_rpcbind_c b/package/rpcbind/patches/patch-src_rpcbind_c new file mode 100644 index 000000000..aa2bcc78e --- /dev/null +++ b/package/rpcbind/patches/patch-src_rpcbind_c @@ -0,0 +1,40 @@ +--- rpcbind-0.2.3.orig/src/rpcbind.c 2015-04-27 16:07:43.000000000 +0200 ++++ rpcbind-0.2.3/src/rpcbind.c 2016-10-08 18:20:04.000000000 +0200 +@@ -135,13 +135,13 @@ char *tcp_uaddr; /* Universal TCP addres + static char servname[] = "rpcbind"; + static char superuser[] = "superuser"; + +-int main __P((int, char *[])); ++int main (int, char *[]); + +-static int init_transport __P((struct netconfig *)); +-static void rbllist_add __P((rpcprog_t, rpcvers_t, struct netconfig *, +- struct netbuf *)); +-static void terminate __P((int)); +-static void parseargs __P((int, char *[])); ++static int init_transport (struct netconfig *); ++static void rbllist_add (rpcprog_t, rpcvers_t, struct netconfig *, ++ struct netbuf *); ++static void terminate (int); ++static void parseargs (int, char *[]); + + int + main(int argc, char *argv[]) +@@ -532,7 +532,7 @@ init_transport(struct netconfig *nconf) + if ((aicode = getaddrinfo(hosts[nhostsbak], + servname, &hints, &res)) != 0) { + if ((aicode = getaddrinfo(hosts[nhostsbak], +- "portmapper", &hints, &res)) != 0) { ++ "sunrpc", &hints, &res)) != 0) { + syslog(LOG_ERR, + "cannot get local address for %s: %s", + nconf->nc_netid, gai_strerror(aicode)); +@@ -611,7 +611,7 @@ init_transport(struct netconfig *nconf) + if ((strcmp(nconf->nc_netid, "local") != 0) && + (strcmp(nconf->nc_netid, "unix") != 0)) { + if ((aicode = getaddrinfo(NULL, servname, &hints, &res))!= 0) { +- if ((aicode = getaddrinfo(NULL, "portmapper", &hints, &res))!= 0) { ++ if ((aicode = getaddrinfo(NULL, "sunrpc", &hints, &res))!= 0) { + printf("cannot get local address for %s: %s", nconf->nc_netid, gai_strerror(aicode)); + syslog(LOG_ERR, + "cannot get local address for %s: %s", diff --git a/package/rpcbind/patches/patch-src_util_c b/package/rpcbind/patches/patch-src_util_c new file mode 100644 index 000000000..69669f0e1 --- /dev/null +++ b/package/rpcbind/patches/patch-src_util_c @@ -0,0 +1,27 @@ +--- rpcbind-0.2.3.orig/src/util.c 2015-04-27 16:07:43.000000000 +0200 ++++ rpcbind-0.2.3/src/util.c 2016-10-08 18:28:03.000000000 +0200 +@@ -41,7 +41,6 @@ + + #include <sys/types.h> + #include <sys/socket.h> +-#include <sys/queue.h> + #include <net/if.h> + #include <netinet/in.h> + #include <ifaddrs.h> +@@ -56,6 +55,7 @@ + #include <stdio.h> + #include <arpa/inet.h> + ++#include "queue.h" + #include "rpcbind.h" + + #define SA2SIN(sa) ((struct sockaddr_in *)(sa)) +@@ -70,7 +70,7 @@ static struct sockaddr_in *local_in4; + static struct sockaddr_in6 *local_in6; + #endif + +-static int bitmaskcmp __P((void *, void *, void *, int)); ++static int bitmaskcmp (void *, void *, void *, int); + + /* + * For all bits set in "mask", compare the corresponding bits in diff --git a/package/rpcbind/patches/patch-src_warmstart_c b/package/rpcbind/patches/patch-src_warmstart_c new file mode 100644 index 000000000..79b342550 --- /dev/null +++ b/package/rpcbind/patches/patch-src_warmstart_c @@ -0,0 +1,13 @@ +--- rpcbind-0.2.3.orig/src/warmstart.c 2015-04-27 16:07:43.000000000 +0200 ++++ rpcbind-0.2.3/src/warmstart.c 2016-10-08 18:19:45.000000000 +0200 +@@ -58,8 +58,8 @@ + #define PMAPFILE RPCBIND_STATEDIR "/portmap.xdr" + #endif + +-static bool_t write_struct __P((char *, xdrproc_t, void *)); +-static bool_t read_struct __P((char *, xdrproc_t, void *)); ++static bool_t write_struct (char *, xdrproc_t, void *); ++static bool_t read_struct (char *, xdrproc_t, void *); + + static bool_t + write_struct(char *filename, xdrproc_t structproc, void *list) |