aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/rpc/rpc_soc.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/rpc/rpc_soc.c')
-rw-r--r--lib/libc/rpc/rpc_soc.c31
1 files changed, 27 insertions, 4 deletions
diff --git a/lib/libc/rpc/rpc_soc.c b/lib/libc/rpc/rpc_soc.c
index e293a2ccf22f..c63b89594ce6 100644
--- a/lib/libc/rpc/rpc_soc.c
+++ b/lib/libc/rpc/rpc_soc.c
@@ -379,13 +379,36 @@ clnt_broadcast(u_long prog, u_long vers, u_long proc, xdrproc_t xargs,
* Create the client des authentication object. Obsoleted by
* authdes_seccreate().
*/
-static AUTH *
-__authdes_create(char *servername, u_int window, struct sockaddr *syncaddr,
+AUTH *
+authdes_create(char *servername, u_int window, struct sockaddr *syncaddr,
des_block *ckey)
+/*
+ * char *servername; // network name of server
+ * u_int window; // time to live
+ * struct sockaddr *syncaddr; // optional hostaddr to sync with
+ * des_block *ckey; // optional conversation key to use
+ */
{
- return (NULL);
+ AUTH *dummy;
+ AUTH *nauth;
+ char hostname[NI_MAXHOST];
+
+ if (syncaddr) {
+ /*
+ * Change addr to hostname, because that is the way
+ * new interface takes it.
+ */
+ if (getnameinfo(syncaddr, syncaddr->sa_len, hostname,
+ sizeof hostname, NULL, 0, 0) != 0)
+ goto fallback;
+
+ nauth = authdes_seccreate(servername, window, hostname, ckey);
+ return (nauth);
+ }
+fallback:
+ dummy = authdes_seccreate(servername, window, NULL, ckey);
+ return (dummy);
}
-__sym_compat(authdes_create, __authdes_create, FBSD_1.0);
/*
* Create a client handle for a unix connection. Obsoleted by clnt_vc_create()