libtirpc/011-authdes_create.patch
Marcus Meissner 25987c29d1 Accepting request 315658 from home:kukuk:NIS
- Add 012-xp_sock.patch: add sunrpc compatibility define

- Update 009-authdes_pk_create.patch (fix syncaddr handling)
- Add 011-authdes_create.patch (fix syncaddr handling)

- Add 010-xdr_sizeof.patch (enable xdr_sizeof)

- Add 009-authdes_pk_create.patch (missing SunRPC compat function)

OBS-URL: https://build.opensuse.org/request/show/315658
OBS-URL: https://build.opensuse.org/package/show/Base:System/libtirpc?expand=0&rev=51
2015-07-10 10:28:23 +00:00

40 lines
1.1 KiB
Diff

diff --git a/src/rpc_soc.c b/src/rpc_soc.c
index e146ed4..9d555d3 100644
--- a/src/rpc_soc.c
+++ b/src/rpc_soc.c
@@ -531,7 +531,6 @@ authdes_create(servername, window, syncaddr, ckey)
struct sockaddr *syncaddr; /* optional hostaddr to sync with */
des_block *ckey; /* optional conversation key to use */
{
- AUTH *dummy;
AUTH *nauth;
char hostname[NI_MAXHOST];
@@ -540,16 +539,20 @@ authdes_create(servername, window, syncaddr, ckey)
* Change addr to hostname, because that is the way
* new interface takes it.
*/
- if (getnameinfo(syncaddr, sizeof(syncaddr), hostname,
- sizeof hostname, NULL, 0, 0) != 0)
- goto fallback;
-
+ switch (syncaddr->sa_family) {
+ case AF_INET:
+ if (getnameinfo(syncaddr, sizeof(struct sockaddr_in), hostname,
+ sizeof hostname, NULL, 0, 0) != 0)
+ goto fallback;
+ break;
+ default:
+ goto fallback;
+ }
nauth = authdes_seccreate(servername, window, hostname, ckey);
return (nauth);
}
fallback:
- dummy = authdes_seccreate(servername, window, NULL, ckey);
- return (dummy);
+ return authdes_seccreate(servername, window, NULL, ckey);
}
/*