xref: /titanic_51/usr/src/lib/krb5/kadm5/clnt/client_rpc.c (revision 159d09a20817016f09b3ea28d1bdada4a336bb91)
17c478bd9Sstevel@tonic-gate /*
2*159d09a2SMark Phalan  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
37c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
47c478bd9Sstevel@tonic-gate  */
57c478bd9Sstevel@tonic-gate 
67c478bd9Sstevel@tonic-gate 
77c478bd9Sstevel@tonic-gate /*
87c478bd9Sstevel@tonic-gate  * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
97c478bd9Sstevel@tonic-gate  *
107c478bd9Sstevel@tonic-gate  *	Openvision retains the copyright to derivative works of
117c478bd9Sstevel@tonic-gate  *	this source code.  Do *NOT* create a derivative of this
127c478bd9Sstevel@tonic-gate  *	source code before consulting with your legal department.
137c478bd9Sstevel@tonic-gate  *	Do *NOT* integrate *ANY* of this source code into another
147c478bd9Sstevel@tonic-gate  *	product before consulting with your legal department.
157c478bd9Sstevel@tonic-gate  *
167c478bd9Sstevel@tonic-gate  *	For further information, read the top-level Openvision
177c478bd9Sstevel@tonic-gate  *	copyright which is contained in the top-level MIT Kerberos
187c478bd9Sstevel@tonic-gate  *	copyright.
197c478bd9Sstevel@tonic-gate  *
207c478bd9Sstevel@tonic-gate  * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
217c478bd9Sstevel@tonic-gate  *
227c478bd9Sstevel@tonic-gate  */
237c478bd9Sstevel@tonic-gate 
247c478bd9Sstevel@tonic-gate 
257c478bd9Sstevel@tonic-gate #include <rpc/rpc.h> /* SUNWresync121 XXX */
267c478bd9Sstevel@tonic-gate #include <kadm5/kadm_rpc.h>
277c478bd9Sstevel@tonic-gate #include <krb5.h>
287c478bd9Sstevel@tonic-gate #include <kadm5/admin.h>
2956a424ccSmp153739 #ifdef HAVE_MEMORY_H
307c478bd9Sstevel@tonic-gate #include <memory.h>
3156a424ccSmp153739 #endif
327c478bd9Sstevel@tonic-gate 
337c478bd9Sstevel@tonic-gate /* Default timeout can be changed using clnt_control() */
347c478bd9Sstevel@tonic-gate static struct timeval TIMEOUT = { 25, 0 };
357c478bd9Sstevel@tonic-gate 
367c478bd9Sstevel@tonic-gate generic_ret *
37*159d09a2SMark Phalan create_principal_2(cprinc_arg *argp, CLIENT *clnt)
387c478bd9Sstevel@tonic-gate {
39*159d09a2SMark Phalan 	static generic_ret clnt_res;
407c478bd9Sstevel@tonic-gate 
41*159d09a2SMark Phalan 	/* Solaris Kerberos */
427c478bd9Sstevel@tonic-gate 	if (clnt == NULL)
437c478bd9Sstevel@tonic-gate 		return (NULL);
44*159d09a2SMark Phalan 	memset((char *)&clnt_res, 0, sizeof(clnt_res));
45*159d09a2SMark Phalan 	if (clnt_call(clnt, CREATE_PRINCIPAL,
46*159d09a2SMark Phalan 		      (xdrproc_t) xdr_cprinc_arg, (caddr_t) argp,
47*159d09a2SMark Phalan 		      (xdrproc_t) xdr_generic_ret, (caddr_t) &clnt_res,
48*159d09a2SMark Phalan 		      TIMEOUT) != RPC_SUCCESS) {
497c478bd9Sstevel@tonic-gate 		return (NULL);
507c478bd9Sstevel@tonic-gate 	}
51*159d09a2SMark Phalan 	return (&clnt_res);
527c478bd9Sstevel@tonic-gate }
537c478bd9Sstevel@tonic-gate 
547c478bd9Sstevel@tonic-gate generic_ret *
55*159d09a2SMark Phalan create_principal3_2(cprinc3_arg *argp, CLIENT *clnt)
567c478bd9Sstevel@tonic-gate {
57*159d09a2SMark Phalan 	static generic_ret clnt_res;
587c478bd9Sstevel@tonic-gate 
59*159d09a2SMark Phalan 	/* Solaris Kerberos */
607c478bd9Sstevel@tonic-gate 	if (clnt == NULL)
617c478bd9Sstevel@tonic-gate 		return (NULL);
62*159d09a2SMark Phalan 	memset((char *)&clnt_res, 0, sizeof(clnt_res));
63*159d09a2SMark Phalan 	if (clnt_call(clnt, CREATE_PRINCIPAL3,
64*159d09a2SMark Phalan 		      (xdrproc_t) xdr_cprinc3_arg, (caddr_t) argp,
65*159d09a2SMark Phalan 		      (xdrproc_t) xdr_generic_ret, (caddr_t) &clnt_res,
66*159d09a2SMark Phalan 		      TIMEOUT) != RPC_SUCCESS) {
677c478bd9Sstevel@tonic-gate 		return (NULL);
687c478bd9Sstevel@tonic-gate 	}
69*159d09a2SMark Phalan 	return (&clnt_res);
707c478bd9Sstevel@tonic-gate }
717c478bd9Sstevel@tonic-gate 
727c478bd9Sstevel@tonic-gate generic_ret *
73*159d09a2SMark Phalan delete_principal_2(dprinc_arg *argp, CLIENT *clnt)
747c478bd9Sstevel@tonic-gate {
75*159d09a2SMark Phalan 	static generic_ret clnt_res;
767c478bd9Sstevel@tonic-gate 
77*159d09a2SMark Phalan 	/* Solaris Kerberos */
787c478bd9Sstevel@tonic-gate 	if (clnt == NULL)
797c478bd9Sstevel@tonic-gate 		return (NULL);
80*159d09a2SMark Phalan 	memset((char *)&clnt_res, 0, sizeof(clnt_res));
81*159d09a2SMark Phalan 	if (clnt_call(clnt, DELETE_PRINCIPAL,
82*159d09a2SMark Phalan 		      (xdrproc_t) xdr_dprinc_arg, (caddr_t) argp,
83*159d09a2SMark Phalan 		      (xdrproc_t) xdr_generic_ret, (caddr_t) &clnt_res,
84*159d09a2SMark Phalan 		      TIMEOUT) != RPC_SUCCESS) {
857c478bd9Sstevel@tonic-gate 		return (NULL);
867c478bd9Sstevel@tonic-gate 	}
87*159d09a2SMark Phalan 	return (&clnt_res);
887c478bd9Sstevel@tonic-gate }
897c478bd9Sstevel@tonic-gate 
907c478bd9Sstevel@tonic-gate generic_ret *
91*159d09a2SMark Phalan modify_principal_2(mprinc_arg *argp, CLIENT *clnt)
927c478bd9Sstevel@tonic-gate {
93*159d09a2SMark Phalan 	static generic_ret clnt_res;
947c478bd9Sstevel@tonic-gate 
95*159d09a2SMark Phalan 	/* Solaris Kerberos */
967c478bd9Sstevel@tonic-gate 	if (clnt == NULL)
977c478bd9Sstevel@tonic-gate 		return (NULL);
98*159d09a2SMark Phalan 	memset((char *)&clnt_res, 0, sizeof(clnt_res));
99*159d09a2SMark Phalan 	if (clnt_call(clnt, MODIFY_PRINCIPAL,
100*159d09a2SMark Phalan 		      (xdrproc_t) xdr_mprinc_arg, (caddr_t) argp,
101*159d09a2SMark Phalan 		      (xdrproc_t) xdr_generic_ret, (caddr_t) &clnt_res,
102*159d09a2SMark Phalan 		      TIMEOUT) != RPC_SUCCESS) {
1037c478bd9Sstevel@tonic-gate 		return (NULL);
1047c478bd9Sstevel@tonic-gate 	}
105*159d09a2SMark Phalan 	return (&clnt_res);
1067c478bd9Sstevel@tonic-gate }
1077c478bd9Sstevel@tonic-gate 
1087c478bd9Sstevel@tonic-gate generic_ret *
109*159d09a2SMark Phalan rename_principal_2(rprinc_arg *argp, CLIENT *clnt)
1107c478bd9Sstevel@tonic-gate {
111*159d09a2SMark Phalan 	static generic_ret clnt_res;
1127c478bd9Sstevel@tonic-gate 
113*159d09a2SMark Phalan 	/* Solaris Kerberos */
1147c478bd9Sstevel@tonic-gate 	if (clnt == NULL)
1157c478bd9Sstevel@tonic-gate 		return (NULL);
116*159d09a2SMark Phalan 	memset((char *)&clnt_res, 0, sizeof(clnt_res));
117*159d09a2SMark Phalan 	if (clnt_call(clnt, RENAME_PRINCIPAL,
118*159d09a2SMark Phalan 		      (xdrproc_t) xdr_rprinc_arg, (caddr_t) argp,
119*159d09a2SMark Phalan 		      (xdrproc_t) xdr_generic_ret, (caddr_t) &clnt_res,
120*159d09a2SMark Phalan 		      TIMEOUT) != RPC_SUCCESS) {
1217c478bd9Sstevel@tonic-gate 		return (NULL);
1227c478bd9Sstevel@tonic-gate 	}
123*159d09a2SMark Phalan 	return (&clnt_res);
1247c478bd9Sstevel@tonic-gate }
1257c478bd9Sstevel@tonic-gate 
1267c478bd9Sstevel@tonic-gate gprinc_ret *
127*159d09a2SMark Phalan get_principal_2(gprinc_arg *argp, CLIENT *clnt)
1287c478bd9Sstevel@tonic-gate {
129*159d09a2SMark Phalan 	static gprinc_ret clnt_res;
1307c478bd9Sstevel@tonic-gate 
131*159d09a2SMark Phalan 	/* Solaris Kerberos */
1327c478bd9Sstevel@tonic-gate 	if (clnt == NULL)
1337c478bd9Sstevel@tonic-gate 		return (NULL);
134*159d09a2SMark Phalan 	memset((char *)&clnt_res, 0, sizeof(clnt_res));
135*159d09a2SMark Phalan 	if (clnt_call(clnt, GET_PRINCIPAL,
136*159d09a2SMark Phalan 		      (xdrproc_t) xdr_gprinc_arg, (caddr_t) argp,
137*159d09a2SMark Phalan 		      (xdrproc_t) xdr_gprinc_ret, (caddr_t) &clnt_res,
138*159d09a2SMark Phalan 		      TIMEOUT) != RPC_SUCCESS) {
1397c478bd9Sstevel@tonic-gate 		return (NULL);
1407c478bd9Sstevel@tonic-gate 	}
141*159d09a2SMark Phalan 	return (&clnt_res);
1427c478bd9Sstevel@tonic-gate }
1437c478bd9Sstevel@tonic-gate 
1447c478bd9Sstevel@tonic-gate gprincs_ret *
145*159d09a2SMark Phalan get_princs_2(gprincs_arg *argp, CLIENT *clnt)
1467c478bd9Sstevel@tonic-gate {
147*159d09a2SMark Phalan 	static gprincs_ret clnt_res;
1487c478bd9Sstevel@tonic-gate 
149*159d09a2SMark Phalan 	/* Solaris Kerberos */
1507c478bd9Sstevel@tonic-gate 	if (clnt == NULL)
1517c478bd9Sstevel@tonic-gate 		return (NULL);
152*159d09a2SMark Phalan 	memset((char *)&clnt_res, 0, sizeof(clnt_res));
153*159d09a2SMark Phalan 	if (clnt_call(clnt, GET_PRINCS,
154*159d09a2SMark Phalan 		      (xdrproc_t) xdr_gprincs_arg, (caddr_t) argp,
155*159d09a2SMark Phalan 		      (xdrproc_t) xdr_gprincs_ret, (caddr_t) &clnt_res,
1567c478bd9Sstevel@tonic-gate 		      TIMEOUT) != RPC_SUCCESS) {
1577c478bd9Sstevel@tonic-gate 	     return (NULL);
1587c478bd9Sstevel@tonic-gate 	}
159*159d09a2SMark Phalan 	return (&clnt_res);
1607c478bd9Sstevel@tonic-gate }
1617c478bd9Sstevel@tonic-gate 
1627c478bd9Sstevel@tonic-gate generic_ret *
163*159d09a2SMark Phalan chpass_principal_2(chpass_arg *argp, CLIENT *clnt)
1647c478bd9Sstevel@tonic-gate {
165*159d09a2SMark Phalan 	static generic_ret clnt_res;
1667c478bd9Sstevel@tonic-gate 
167*159d09a2SMark Phalan 	/* Solaris Kerberos */
1687c478bd9Sstevel@tonic-gate 	if (clnt == NULL)
1697c478bd9Sstevel@tonic-gate 		return (NULL);
170*159d09a2SMark Phalan 	memset((char *)&clnt_res, 0, sizeof(clnt_res));
171*159d09a2SMark Phalan 	if (clnt_call(clnt, CHPASS_PRINCIPAL,
172*159d09a2SMark Phalan 		      (xdrproc_t) xdr_chpass_arg, (caddr_t) argp,
173*159d09a2SMark Phalan 		      (xdrproc_t) xdr_generic_ret, (caddr_t) &clnt_res,
1747c478bd9Sstevel@tonic-gate 		      TIMEOUT) != RPC_SUCCESS) {
1757c478bd9Sstevel@tonic-gate 		return (NULL);
1767c478bd9Sstevel@tonic-gate 	}
177*159d09a2SMark Phalan 	return (&clnt_res);
1787c478bd9Sstevel@tonic-gate }
1797c478bd9Sstevel@tonic-gate 
1807c478bd9Sstevel@tonic-gate generic_ret *
181*159d09a2SMark Phalan chpass_principal3_2(chpass3_arg *argp, CLIENT *clnt)
1827c478bd9Sstevel@tonic-gate {
183*159d09a2SMark Phalan 	static generic_ret clnt_res;
1847c478bd9Sstevel@tonic-gate 
185*159d09a2SMark Phalan 	/* Solaris Kerberos */
1867c478bd9Sstevel@tonic-gate 	if (clnt == NULL)
1877c478bd9Sstevel@tonic-gate 		return (NULL);
188*159d09a2SMark Phalan 	memset((char *)&clnt_res, 0, sizeof(clnt_res));
189*159d09a2SMark Phalan 	if (clnt_call(clnt, CHPASS_PRINCIPAL3,
190*159d09a2SMark Phalan 		      (xdrproc_t) xdr_chpass3_arg, (caddr_t) argp,
191*159d09a2SMark Phalan 		      (xdrproc_t) xdr_generic_ret, (caddr_t) &clnt_res,
1927c478bd9Sstevel@tonic-gate 		      TIMEOUT) != RPC_SUCCESS) {
1937c478bd9Sstevel@tonic-gate 		return (NULL);
1947c478bd9Sstevel@tonic-gate 	}
195*159d09a2SMark Phalan 	return (&clnt_res);
1967c478bd9Sstevel@tonic-gate }
1977c478bd9Sstevel@tonic-gate 
1987c478bd9Sstevel@tonic-gate generic_ret *
199*159d09a2SMark Phalan setv4key_principal_2(setv4key_arg *argp, CLIENT *clnt)
2007c478bd9Sstevel@tonic-gate {
201*159d09a2SMark Phalan 	static generic_ret clnt_res;
2027c478bd9Sstevel@tonic-gate 
203*159d09a2SMark Phalan 	/* Solaris Kerberos */
2047c478bd9Sstevel@tonic-gate 	if (clnt == NULL)
2057c478bd9Sstevel@tonic-gate 		return (NULL);
206*159d09a2SMark Phalan 	memset((char *)&clnt_res, 0, sizeof(clnt_res));
207*159d09a2SMark Phalan 	if (clnt_call(clnt, SETV4KEY_PRINCIPAL,
208*159d09a2SMark Phalan 		      (xdrproc_t) xdr_setv4key_arg, (caddr_t) argp,
209*159d09a2SMark Phalan 		      (xdrproc_t) xdr_generic_ret, (caddr_t) &clnt_res,
2107c478bd9Sstevel@tonic-gate 		      TIMEOUT) != RPC_SUCCESS) {
2117c478bd9Sstevel@tonic-gate 		return (NULL);
2127c478bd9Sstevel@tonic-gate 	}
213*159d09a2SMark Phalan 	return (&clnt_res);
214*159d09a2SMark Phalan }
215*159d09a2SMark Phalan 
216*159d09a2SMark Phalan generic_ret *
217*159d09a2SMark Phalan setkey_principal_2(setkey_arg *argp, CLIENT *clnt)
218*159d09a2SMark Phalan {
219*159d09a2SMark Phalan 	static generic_ret clnt_res;
220*159d09a2SMark Phalan 
221*159d09a2SMark Phalan 	/* Solaris Kerberos */
222*159d09a2SMark Phalan 	if (clnt == NULL)
223*159d09a2SMark Phalan 		return (NULL);
224*159d09a2SMark Phalan 	memset((char *)&clnt_res, 0, sizeof(clnt_res));
225*159d09a2SMark Phalan 	if (clnt_call(clnt, SETKEY_PRINCIPAL,
226*159d09a2SMark Phalan 		      (xdrproc_t) xdr_setkey_arg, (caddr_t) argp,
227*159d09a2SMark Phalan 		      (xdrproc_t) xdr_generic_ret, (caddr_t) &clnt_res,
228*159d09a2SMark Phalan 		      TIMEOUT) != RPC_SUCCESS) {
229*159d09a2SMark Phalan 		return (NULL);
230*159d09a2SMark Phalan 	}
231*159d09a2SMark Phalan 	return (&clnt_res);
232*159d09a2SMark Phalan }
233*159d09a2SMark Phalan 
234*159d09a2SMark Phalan generic_ret *
235*159d09a2SMark Phalan setkey_principal3_2(setkey3_arg *argp, CLIENT *clnt)
236*159d09a2SMark Phalan {
237*159d09a2SMark Phalan 	static generic_ret clnt_res;
238*159d09a2SMark Phalan 
239*159d09a2SMark Phalan 	/* Solaris Kerberos */
240*159d09a2SMark Phalan 	if (clnt == NULL)
241*159d09a2SMark Phalan 		return (NULL);
242*159d09a2SMark Phalan 	memset((char *)&clnt_res, 0, sizeof(clnt_res));
243*159d09a2SMark Phalan 	if (clnt_call(clnt, SETKEY_PRINCIPAL3,
244*159d09a2SMark Phalan 		      (xdrproc_t) xdr_setkey3_arg, (caddr_t) argp,
245*159d09a2SMark Phalan 		      (xdrproc_t) xdr_generic_ret, (caddr_t) &clnt_res,
246*159d09a2SMark Phalan 		      TIMEOUT) != RPC_SUCCESS) {
247*159d09a2SMark Phalan 		return (NULL);
248*159d09a2SMark Phalan 	}
249*159d09a2SMark Phalan 	return (&clnt_res);
2507c478bd9Sstevel@tonic-gate }
2517c478bd9Sstevel@tonic-gate 
2527c478bd9Sstevel@tonic-gate chrand_ret *
253*159d09a2SMark Phalan chrand_principal_2(chrand_arg *argp, CLIENT *clnt)
2547c478bd9Sstevel@tonic-gate {
255*159d09a2SMark Phalan 	static chrand_ret clnt_res;
2567c478bd9Sstevel@tonic-gate 
257*159d09a2SMark Phalan 	/* Solaris Kerberos */
2587c478bd9Sstevel@tonic-gate 	if (clnt == NULL)
2597c478bd9Sstevel@tonic-gate 		return (NULL);
260*159d09a2SMark Phalan 	memset((char *)&clnt_res, 0, sizeof(clnt_res));
261*159d09a2SMark Phalan 	if (clnt_call(clnt, CHRAND_PRINCIPAL,
262*159d09a2SMark Phalan 		      (xdrproc_t) xdr_chrand_arg, (caddr_t) argp,
263*159d09a2SMark Phalan 		      (xdrproc_t) xdr_chrand_ret, (caddr_t) &clnt_res,
2647c478bd9Sstevel@tonic-gate 		      TIMEOUT) != RPC_SUCCESS) {
2657c478bd9Sstevel@tonic-gate 		return (NULL);
2667c478bd9Sstevel@tonic-gate 	}
267*159d09a2SMark Phalan 	return (&clnt_res);
268*159d09a2SMark Phalan }
269*159d09a2SMark Phalan 
270*159d09a2SMark Phalan chrand_ret *
271*159d09a2SMark Phalan chrand_principal3_2(chrand3_arg *argp, CLIENT *clnt)
272*159d09a2SMark Phalan {
273*159d09a2SMark Phalan 	static chrand_ret clnt_res;
274*159d09a2SMark Phalan 
275*159d09a2SMark Phalan 	/* Solaris Kerberos */
276*159d09a2SMark Phalan 	if (clnt == NULL)
277*159d09a2SMark Phalan 		return (NULL);
278*159d09a2SMark Phalan 	memset((char *)&clnt_res, 0, sizeof(clnt_res));
279*159d09a2SMark Phalan 	if (clnt_call(clnt, CHRAND_PRINCIPAL3,
280*159d09a2SMark Phalan 		      (xdrproc_t) xdr_chrand3_arg, (caddr_t) argp,
281*159d09a2SMark Phalan 		      (xdrproc_t) xdr_chrand_ret, (caddr_t) &clnt_res,
282*159d09a2SMark Phalan 		      TIMEOUT) != RPC_SUCCESS) {
283*159d09a2SMark Phalan 		return (NULL);
284*159d09a2SMark Phalan 	}
285*159d09a2SMark Phalan 	return (&clnt_res);
2867c478bd9Sstevel@tonic-gate }
2877c478bd9Sstevel@tonic-gate 
2887c478bd9Sstevel@tonic-gate generic_ret *
289*159d09a2SMark Phalan create_policy_2(cpol_arg *argp, CLIENT *clnt)
2907c478bd9Sstevel@tonic-gate {
291*159d09a2SMark Phalan 	static generic_ret clnt_res;
2927c478bd9Sstevel@tonic-gate 
293*159d09a2SMark Phalan 	/* Solaris Kerberos */
2947c478bd9Sstevel@tonic-gate 	if (clnt == NULL)
2957c478bd9Sstevel@tonic-gate 		return (NULL);
296*159d09a2SMark Phalan 	memset((char *)&clnt_res, 0, sizeof(clnt_res));
297*159d09a2SMark Phalan 	if (clnt_call(clnt, CREATE_POLICY,
298*159d09a2SMark Phalan 		      (xdrproc_t) xdr_cpol_arg, (caddr_t) argp,
299*159d09a2SMark Phalan 		      (xdrproc_t) xdr_generic_ret, (caddr_t) &clnt_res,
300*159d09a2SMark Phalan 		      TIMEOUT) != RPC_SUCCESS) {
3017c478bd9Sstevel@tonic-gate 		return (NULL);
3027c478bd9Sstevel@tonic-gate 	}
303*159d09a2SMark Phalan 	return (&clnt_res);
3047c478bd9Sstevel@tonic-gate }
3057c478bd9Sstevel@tonic-gate 
3067c478bd9Sstevel@tonic-gate generic_ret *
307*159d09a2SMark Phalan delete_policy_2(dpol_arg *argp, CLIENT *clnt)
3087c478bd9Sstevel@tonic-gate {
309*159d09a2SMark Phalan 	static generic_ret clnt_res;
3107c478bd9Sstevel@tonic-gate 
311*159d09a2SMark Phalan 	/* Solaris Kerberos */
3127c478bd9Sstevel@tonic-gate 	if (clnt == NULL)
3137c478bd9Sstevel@tonic-gate 		return (NULL);
314*159d09a2SMark Phalan 	memset((char *)&clnt_res, 0, sizeof(clnt_res));
315*159d09a2SMark Phalan 	if (clnt_call(clnt, DELETE_POLICY,
316*159d09a2SMark Phalan 		      (xdrproc_t) xdr_dpol_arg, (caddr_t) argp,
317*159d09a2SMark Phalan 		      (xdrproc_t) xdr_generic_ret, (caddr_t) &clnt_res,
318*159d09a2SMark Phalan 		      TIMEOUT) != RPC_SUCCESS) {
3197c478bd9Sstevel@tonic-gate 		return (NULL);
3207c478bd9Sstevel@tonic-gate 	}
321*159d09a2SMark Phalan 	return (&clnt_res);
3227c478bd9Sstevel@tonic-gate }
3237c478bd9Sstevel@tonic-gate 
3247c478bd9Sstevel@tonic-gate generic_ret *
325*159d09a2SMark Phalan modify_policy_2(mpol_arg *argp, CLIENT *clnt)
3267c478bd9Sstevel@tonic-gate {
327*159d09a2SMark Phalan 	static generic_ret clnt_res;
3287c478bd9Sstevel@tonic-gate 
329*159d09a2SMark Phalan 	/* Solaris Kerberos */
3307c478bd9Sstevel@tonic-gate 	if (clnt == NULL)
3317c478bd9Sstevel@tonic-gate 		return (NULL);
332*159d09a2SMark Phalan 	memset((char *)&clnt_res, 0, sizeof(clnt_res));
333*159d09a2SMark Phalan 	if (clnt_call(clnt, MODIFY_POLICY,
334*159d09a2SMark Phalan 		      (xdrproc_t) xdr_mpol_arg, (caddr_t) argp,
335*159d09a2SMark Phalan 		      (xdrproc_t) xdr_generic_ret, (caddr_t) &clnt_res,
336*159d09a2SMark Phalan 		      TIMEOUT) != RPC_SUCCESS) {
3377c478bd9Sstevel@tonic-gate 		return (NULL);
3387c478bd9Sstevel@tonic-gate 	}
339*159d09a2SMark Phalan 	return (&clnt_res);
3407c478bd9Sstevel@tonic-gate }
3417c478bd9Sstevel@tonic-gate 
3427c478bd9Sstevel@tonic-gate gpol_ret *
343*159d09a2SMark Phalan get_policy_2(gpol_arg *argp, CLIENT *clnt)
3447c478bd9Sstevel@tonic-gate {
345*159d09a2SMark Phalan 	static gpol_ret clnt_res;
3467c478bd9Sstevel@tonic-gate 
347*159d09a2SMark Phalan 	/* Solaris Kerberos */
3487c478bd9Sstevel@tonic-gate 	if (clnt == NULL)
3497c478bd9Sstevel@tonic-gate 		return (NULL);
350*159d09a2SMark Phalan 	memset((char *)&clnt_res, 0, sizeof(clnt_res));
351*159d09a2SMark Phalan 	if (clnt_call(clnt, GET_POLICY,
352*159d09a2SMark Phalan 		      (xdrproc_t) xdr_gpol_arg, (caddr_t) argp,
353*159d09a2SMark Phalan 		      (xdrproc_t) xdr_gpol_ret, (caddr_t) &clnt_res,
354*159d09a2SMark Phalan 		      TIMEOUT) != RPC_SUCCESS) {
3557c478bd9Sstevel@tonic-gate 		return (NULL);
3567c478bd9Sstevel@tonic-gate 	}
357*159d09a2SMark Phalan 	return (&clnt_res);
3587c478bd9Sstevel@tonic-gate }
3597c478bd9Sstevel@tonic-gate 
3607c478bd9Sstevel@tonic-gate gpols_ret *
361*159d09a2SMark Phalan get_pols_2(gpols_arg *argp, CLIENT *clnt)
3627c478bd9Sstevel@tonic-gate {
363*159d09a2SMark Phalan 	static gpols_ret clnt_res;
3647c478bd9Sstevel@tonic-gate 
365*159d09a2SMark Phalan 	/* Solaris Kerberos */
3667c478bd9Sstevel@tonic-gate 	if (clnt == NULL)
3677c478bd9Sstevel@tonic-gate 		return (NULL);
368*159d09a2SMark Phalan 	memset((char *)&clnt_res, 0, sizeof(clnt_res));
369*159d09a2SMark Phalan 	if (clnt_call(clnt, GET_POLS,
370*159d09a2SMark Phalan 		      (xdrproc_t) xdr_gpols_arg, (caddr_t) argp,
371*159d09a2SMark Phalan 		      (xdrproc_t) xdr_gpols_ret, (caddr_t) &clnt_res,
372*159d09a2SMark Phalan 		      TIMEOUT) != RPC_SUCCESS) {
3737c478bd9Sstevel@tonic-gate 	     return (NULL);
3747c478bd9Sstevel@tonic-gate 	}
375*159d09a2SMark Phalan 	return (&clnt_res);
3767c478bd9Sstevel@tonic-gate }
3777c478bd9Sstevel@tonic-gate 
378*159d09a2SMark Phalan getprivs_ret *
379*159d09a2SMark Phalan get_privs_2(void *argp, CLIENT *clnt)
3807c478bd9Sstevel@tonic-gate {
381*159d09a2SMark Phalan      static getprivs_ret clnt_res;
3827c478bd9Sstevel@tonic-gate 
383*159d09a2SMark Phalan 	/* Solaris Kerberos */
3847c478bd9Sstevel@tonic-gate 	if (clnt == NULL)
3857c478bd9Sstevel@tonic-gate 		return (NULL);
386*159d09a2SMark Phalan      memset((char *)&clnt_res, 0, sizeof(clnt_res));
387*159d09a2SMark Phalan      if (clnt_call(clnt, GET_PRIVS,
388*159d09a2SMark Phalan 		   (xdrproc_t) xdr_u_int, (caddr_t) argp,
389*159d09a2SMark Phalan 		   (xdrproc_t) xdr_getprivs_ret, (caddr_t) &clnt_res,
390*159d09a2SMark Phalan 		   TIMEOUT) != RPC_SUCCESS) {
3917c478bd9Sstevel@tonic-gate 	  return (NULL);
3927c478bd9Sstevel@tonic-gate      }
393*159d09a2SMark Phalan      return (&clnt_res);
3947c478bd9Sstevel@tonic-gate }
3957c478bd9Sstevel@tonic-gate 
3967c478bd9Sstevel@tonic-gate generic_ret *
397*159d09a2SMark Phalan init_2(void *argp, CLIENT *clnt)
3987c478bd9Sstevel@tonic-gate {
399*159d09a2SMark Phalan      static generic_ret clnt_res;
4007c478bd9Sstevel@tonic-gate 
401*159d09a2SMark Phalan 	/* Solaris Kerberos */
4027c478bd9Sstevel@tonic-gate      if (clnt == NULL)
4037c478bd9Sstevel@tonic-gate          return (NULL);
4047c478bd9Sstevel@tonic-gate 
405*159d09a2SMark Phalan      memset((char *)&clnt_res, 0, sizeof(clnt_res));
406*159d09a2SMark Phalan      if (clnt_call(clnt, INIT,
407*159d09a2SMark Phalan 		   (xdrproc_t) xdr_u_int, (caddr_t) argp,
408*159d09a2SMark Phalan 		   (xdrproc_t) xdr_generic_ret, (caddr_t) &clnt_res,
409*159d09a2SMark Phalan 		   TIMEOUT) != RPC_SUCCESS) {
4107c478bd9Sstevel@tonic-gate 	  return (NULL);
4117c478bd9Sstevel@tonic-gate      }
412*159d09a2SMark Phalan      return (&clnt_res);
4137c478bd9Sstevel@tonic-gate }
414