SHA256
1
0
forked from pool/libtirpc
libtirpc/patch6_7.diff
Cristian Rodríguez 167c8f44ce Accepting request 305737 from home:kukuk:NIS
- Fix HAVE_AUTHDES/HAVE_GSSAPI in public header files
  (001-tirpc-features.patch)

- Update to official release 0.3.0. authdes was disabled by default
  upstream.
- Following patches were merged:
  - 001-symbol-versions-v5.patch
  - 003-add-des_crypt.diff
- Remove 002-old-automake.patch, not needed anymore

- Update 001-symbol-versions-v4.patch with
  001-symbol-versions-v5.patch: Add --disable-symvers option

- Update 003-add-des_crypt.diff, fix unresolved des functions

- Update to git
- Add 003-add-des_crypt.diff to fix unresolved *_crypt() functions

- Disable gssapi for SLE11, kerberos version is too old

- rpc/rpc.h requires now indirectly gssapi.h from krb5-devel

- Update to current git.
- The following patches were accepted upstream:
  - 003-xdr_h-fix.patch
  - 005-disable-rpcent.patch
  - 006-no-libnsl.patch
  - patch1_7.diff
  - patch2_7.diff
  - patch3_7.diff

OBS-URL: https://build.opensuse.org/request/show/305737
OBS-URL: https://build.opensuse.org/package/show/Base:System/libtirpc?expand=0&rev=43
2015-05-07 19:52:27 +00:00

80 lines
2.7 KiB
Diff

Most folks seem to copy this gentoo patch to silence an alleged
_FORTIFY_SOURCE=2 warning:
http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/net-libs/libtirpc/files/libtirpc-0.2.1-fortify.patch?diff_format=s&revision=1.2&view=markup
Given that gethostbyname is obsolescent, let's just use getaddrinfo
instead (to silence warnings about the OB function).
I am undecided if setting AI_V4MAPPED and AI_ADDRCONFIG is a good idea.
Personally i would be inclined to s/if 0/if 1/ but i'll leave that up to
you.
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
---
src/getrpcport.c | 37 +++++++++++++++++++++++++------------
1 file changed, 25 insertions(+), 12 deletions(-)
diff --git a/src/getrpcport.c b/src/getrpcport.c
index b452c99..f36158d 100644
--- a/src/getrpcport.c
+++ b/src/getrpcport.c
@@ -48,19 +48,32 @@ getrpcport(host, prognum, versnum, proto)
int prognum, versnum, proto;
{
struct sockaddr_in addr;
- struct hostent *hp;
+ struct addrinfo hints, *result, *rp;
+ int ret = 0;
assert(host != NULL);
-
- if ((hp = gethostbyname(host)) == NULL)
+ memset(&hints, 0, sizeof(struct addrinfo));
+ hints.ai_family = AF_INET; /* ??? :-( */
+#if 0
+#ifdef AI_V4MAPPED
+ hints.ai_flags |= AI_V4MAPPED;
+#endif
+#ifdef AI_ADDRCONFIG
+ hints.ai_flags |= AI_ADDRCONFIG;
+#endif
+#endif
+ if (getaddrinfo(host, NULL, &hints, &result) != 0)
return (0);
- memset(&addr, 0, sizeof(addr));
- addr.sin_family = AF_INET;
- addr.sin_port = 0;
- if (hp->h_length > sizeof(addr))
- hp->h_length = sizeof(addr);
- memcpy(&addr.sin_addr.s_addr, hp->h_addr, (size_t)hp->h_length);
- /* Inconsistent interfaces need casts! :-( */
- return (pmap_getport(&addr, (u_long)prognum, (u_long)versnum,
- (u_int)proto));
+ for (rp = result; rp != NULL; rp = rp->ai_next) {
+ assert (rp->ai_family == AF_INET && rp->ai_addrlen == 16);
+ memcpy(&addr, rp->ai_addr, rp->ai_addrlen);
+ assert (addr.sin_family == AF_INET && addr.sin_port == 0);
+ /* Inconsistent interfaces need casts! :-( */
+ ret = (pmap_getport(&addr, (u_long)prognum, (u_long)versnum,
+ (u_int)proto));
+ if (ret)
+ break;
+ }
+ freeaddrinfo(result);
+ return (ret);
}
--
2.1.4
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Libtirpc-devel mailing list
Libtirpc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libtirpc-devel