1*0Sstevel@tonic-gate /* 2*0Sstevel@tonic-gate * Copyright 2003 Sun Microsystems, Inc. All rights reserved. 3*0Sstevel@tonic-gate * Use is subject to license terms. 4*0Sstevel@tonic-gate */ 5*0Sstevel@tonic-gate 6*0Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 7*0Sstevel@tonic-gate 8*0Sstevel@tonic-gate /* 9*0Sstevel@tonic-gate * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING 10*0Sstevel@tonic-gate * 11*0Sstevel@tonic-gate * Openvision retains the copyright to derivative works of 12*0Sstevel@tonic-gate * this source code. Do *NOT* create a derivative of this 13*0Sstevel@tonic-gate * source code before consulting with your legal department. 14*0Sstevel@tonic-gate * Do *NOT* integrate *ANY* of this source code into another 15*0Sstevel@tonic-gate * product before consulting with your legal department. 16*0Sstevel@tonic-gate * 17*0Sstevel@tonic-gate * For further information, read the top-level Openvision 18*0Sstevel@tonic-gate * copyright which is contained in the top-level MIT Kerberos 19*0Sstevel@tonic-gate * copyright. 20*0Sstevel@tonic-gate * 21*0Sstevel@tonic-gate * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING 22*0Sstevel@tonic-gate * 23*0Sstevel@tonic-gate */ 24*0Sstevel@tonic-gate 25*0Sstevel@tonic-gate 26*0Sstevel@tonic-gate #include <rpc/rpc.h> /* SUNWresync121 XXX */ 27*0Sstevel@tonic-gate #include <kadm5/kadm_rpc.h> 28*0Sstevel@tonic-gate #include <krb5.h> 29*0Sstevel@tonic-gate #include <kadm5/admin.h> 30*0Sstevel@tonic-gate #include <memory.h> 31*0Sstevel@tonic-gate 32*0Sstevel@tonic-gate /* Default timeout can be changed using clnt_control() */ 33*0Sstevel@tonic-gate static struct timeval TIMEOUT = { 25, 0 }; 34*0Sstevel@tonic-gate 35*0Sstevel@tonic-gate generic_ret * 36*0Sstevel@tonic-gate create_principal_1(argp, clnt) 37*0Sstevel@tonic-gate cprinc_arg *argp; 38*0Sstevel@tonic-gate CLIENT *clnt; 39*0Sstevel@tonic-gate { 40*0Sstevel@tonic-gate static generic_ret res; 41*0Sstevel@tonic-gate 42*0Sstevel@tonic-gate if (clnt == NULL) 43*0Sstevel@tonic-gate return (NULL); 44*0Sstevel@tonic-gate memset((char *)&res, 0, sizeof(res)); 45*0Sstevel@tonic-gate if (clnt_call(clnt, CREATE_PRINCIPAL, (xdrproc_t) xdr_cprinc_arg, 46*0Sstevel@tonic-gate (caddr_t) argp, (xdrproc_t) xdr_generic_ret, (caddr_t) &res, TIMEOUT) != RPC_SUCCESS) { 47*0Sstevel@tonic-gate return (NULL); 48*0Sstevel@tonic-gate } 49*0Sstevel@tonic-gate return (&res); 50*0Sstevel@tonic-gate } 51*0Sstevel@tonic-gate 52*0Sstevel@tonic-gate generic_ret * 53*0Sstevel@tonic-gate create_principal3_1(argp, clnt) 54*0Sstevel@tonic-gate cprinc_arg *argp; 55*0Sstevel@tonic-gate CLIENT *clnt; 56*0Sstevel@tonic-gate { 57*0Sstevel@tonic-gate static generic_ret res; 58*0Sstevel@tonic-gate 59*0Sstevel@tonic-gate if (clnt == NULL) 60*0Sstevel@tonic-gate return (NULL); 61*0Sstevel@tonic-gate memset((char *)&res, 0, sizeof(res)); 62*0Sstevel@tonic-gate if (clnt_call(clnt, CREATE_PRINCIPAL3, xdr_cprinc3_arg, 63*0Sstevel@tonic-gate (caddr_t) argp, /* SUNWresync121 XXX */ 64*0Sstevel@tonic-gate xdr_generic_ret, 65*0Sstevel@tonic-gate (caddr_t) &res, TIMEOUT) != RPC_SUCCESS) { 66*0Sstevel@tonic-gate return (NULL); 67*0Sstevel@tonic-gate } 68*0Sstevel@tonic-gate return (&res); 69*0Sstevel@tonic-gate } 70*0Sstevel@tonic-gate 71*0Sstevel@tonic-gate generic_ret * 72*0Sstevel@tonic-gate delete_principal_1(argp, clnt) 73*0Sstevel@tonic-gate dprinc_arg *argp; 74*0Sstevel@tonic-gate CLIENT *clnt; 75*0Sstevel@tonic-gate { 76*0Sstevel@tonic-gate static generic_ret res; 77*0Sstevel@tonic-gate 78*0Sstevel@tonic-gate if (clnt == NULL) 79*0Sstevel@tonic-gate return (NULL); 80*0Sstevel@tonic-gate memset((char *)&res, 0, sizeof(res)); 81*0Sstevel@tonic-gate if (clnt_call(clnt, DELETE_PRINCIPAL, xdr_dprinc_arg, (caddr_t) argp, 82*0Sstevel@tonic-gate xdr_generic_ret, (caddr_t) &res, TIMEOUT) != RPC_SUCCESS) { 83*0Sstevel@tonic-gate return (NULL); 84*0Sstevel@tonic-gate } 85*0Sstevel@tonic-gate return (&res); 86*0Sstevel@tonic-gate } 87*0Sstevel@tonic-gate 88*0Sstevel@tonic-gate generic_ret * 89*0Sstevel@tonic-gate modify_principal_1(argp, clnt) 90*0Sstevel@tonic-gate mprinc_arg *argp; 91*0Sstevel@tonic-gate CLIENT *clnt; 92*0Sstevel@tonic-gate { 93*0Sstevel@tonic-gate static generic_ret res; 94*0Sstevel@tonic-gate 95*0Sstevel@tonic-gate if (clnt == NULL) 96*0Sstevel@tonic-gate return (NULL); 97*0Sstevel@tonic-gate memset((char *)&res, 0, sizeof(res)); 98*0Sstevel@tonic-gate if (clnt_call(clnt, MODIFY_PRINCIPAL, xdr_mprinc_arg, (caddr_t) argp, 99*0Sstevel@tonic-gate xdr_generic_ret, (caddr_t) &res, TIMEOUT) != RPC_SUCCESS) { 100*0Sstevel@tonic-gate return (NULL); 101*0Sstevel@tonic-gate } 102*0Sstevel@tonic-gate return (&res); 103*0Sstevel@tonic-gate } 104*0Sstevel@tonic-gate 105*0Sstevel@tonic-gate generic_ret * 106*0Sstevel@tonic-gate rename_principal_1(argp, clnt) 107*0Sstevel@tonic-gate rprinc_arg *argp; 108*0Sstevel@tonic-gate CLIENT *clnt; 109*0Sstevel@tonic-gate { 110*0Sstevel@tonic-gate static generic_ret res; 111*0Sstevel@tonic-gate 112*0Sstevel@tonic-gate if (clnt == NULL) 113*0Sstevel@tonic-gate return (NULL); 114*0Sstevel@tonic-gate memset((char *)&res, 0, sizeof(res)); 115*0Sstevel@tonic-gate if (clnt_call(clnt, RENAME_PRINCIPAL, xdr_rprinc_arg, (caddr_t) argp, 116*0Sstevel@tonic-gate xdr_generic_ret, (caddr_t) &res, TIMEOUT) != RPC_SUCCESS) { 117*0Sstevel@tonic-gate return (NULL); 118*0Sstevel@tonic-gate } 119*0Sstevel@tonic-gate return (&res); 120*0Sstevel@tonic-gate } 121*0Sstevel@tonic-gate 122*0Sstevel@tonic-gate gprinc_ret * 123*0Sstevel@tonic-gate get_principal_1(argp, clnt) 124*0Sstevel@tonic-gate gprinc_arg *argp; 125*0Sstevel@tonic-gate CLIENT *clnt; 126*0Sstevel@tonic-gate { 127*0Sstevel@tonic-gate static gprinc_ret res; 128*0Sstevel@tonic-gate 129*0Sstevel@tonic-gate if (clnt == NULL) 130*0Sstevel@tonic-gate return (NULL); 131*0Sstevel@tonic-gate memset((char *)&res, 0, sizeof(res)); 132*0Sstevel@tonic-gate if (clnt_call(clnt, GET_PRINCIPAL, xdr_gprinc_arg, (caddr_t) argp, 133*0Sstevel@tonic-gate xdr_gprinc_ret, (caddr_t) &res, TIMEOUT) != RPC_SUCCESS) { 134*0Sstevel@tonic-gate return (NULL); 135*0Sstevel@tonic-gate } 136*0Sstevel@tonic-gate return (&res); 137*0Sstevel@tonic-gate } 138*0Sstevel@tonic-gate 139*0Sstevel@tonic-gate gprincs_ret * 140*0Sstevel@tonic-gate get_princs_1(argp, clnt) 141*0Sstevel@tonic-gate gprinc_arg *argp; 142*0Sstevel@tonic-gate CLIENT *clnt; 143*0Sstevel@tonic-gate { 144*0Sstevel@tonic-gate static gprincs_ret res; 145*0Sstevel@tonic-gate 146*0Sstevel@tonic-gate if (clnt == NULL) 147*0Sstevel@tonic-gate return (NULL); 148*0Sstevel@tonic-gate memset((char *)&res, 0, sizeof(res)); 149*0Sstevel@tonic-gate if (clnt_call(clnt, GET_PRINCS, xdr_gprincs_arg, (caddr_t) argp, 150*0Sstevel@tonic-gate xdr_gprincs_ret, (caddr_t) &res, TIMEOUT) != RPC_SUCCESS) { 151*0Sstevel@tonic-gate return (NULL); 152*0Sstevel@tonic-gate } 153*0Sstevel@tonic-gate return (&res); 154*0Sstevel@tonic-gate } 155*0Sstevel@tonic-gate 156*0Sstevel@tonic-gate generic_ret * 157*0Sstevel@tonic-gate chpass_principal_1(argp, clnt) 158*0Sstevel@tonic-gate chpass_arg *argp; 159*0Sstevel@tonic-gate CLIENT *clnt; 160*0Sstevel@tonic-gate { 161*0Sstevel@tonic-gate static generic_ret res; 162*0Sstevel@tonic-gate 163*0Sstevel@tonic-gate if (clnt == NULL) 164*0Sstevel@tonic-gate return (NULL); 165*0Sstevel@tonic-gate memset((char *)&res, 0, sizeof(res)); 166*0Sstevel@tonic-gate if (clnt_call(clnt, CHPASS_PRINCIPAL, xdr_chpass_arg, (caddr_t) argp, 167*0Sstevel@tonic-gate xdr_generic_ret, (caddr_t) &res, TIMEOUT) != RPC_SUCCESS) { 168*0Sstevel@tonic-gate return (NULL); 169*0Sstevel@tonic-gate } 170*0Sstevel@tonic-gate return (&res); 171*0Sstevel@tonic-gate } 172*0Sstevel@tonic-gate 173*0Sstevel@tonic-gate generic_ret * 174*0Sstevel@tonic-gate chpass_principal3_1(argp, clnt) 175*0Sstevel@tonic-gate chpass_arg *argp; 176*0Sstevel@tonic-gate CLIENT *clnt; 177*0Sstevel@tonic-gate { 178*0Sstevel@tonic-gate static generic_ret res; 179*0Sstevel@tonic-gate 180*0Sstevel@tonic-gate if (clnt == NULL) 181*0Sstevel@tonic-gate return (NULL); 182*0Sstevel@tonic-gate memset((char *)&res, 0, sizeof(res)); 183*0Sstevel@tonic-gate if (clnt_call(clnt, CHPASS_PRINCIPAL3, xdr_chpass3_arg, 184*0Sstevel@tonic-gate (caddr_t) argp, /* SUNWresync 121 XXX */ 185*0Sstevel@tonic-gate xdr_generic_ret, (caddr_t) &res, 186*0Sstevel@tonic-gate TIMEOUT) != RPC_SUCCESS) { 187*0Sstevel@tonic-gate return (NULL); 188*0Sstevel@tonic-gate } 189*0Sstevel@tonic-gate return (&res); 190*0Sstevel@tonic-gate } 191*0Sstevel@tonic-gate 192*0Sstevel@tonic-gate generic_ret * 193*0Sstevel@tonic-gate setv4key_principal_1(argp, clnt) 194*0Sstevel@tonic-gate setv4key_arg *argp; 195*0Sstevel@tonic-gate CLIENT *clnt; 196*0Sstevel@tonic-gate { 197*0Sstevel@tonic-gate static generic_ret res; 198*0Sstevel@tonic-gate 199*0Sstevel@tonic-gate if (clnt == NULL) 200*0Sstevel@tonic-gate return (NULL); 201*0Sstevel@tonic-gate memset((char *)&res, 0, sizeof(res)); 202*0Sstevel@tonic-gate if (clnt_call(clnt, SETV4KEY_PRINCIPAL, xdr_setv4key_arg, 203*0Sstevel@tonic-gate (caddr_t) argp, /* SUNWresync121 XXX */ 204*0Sstevel@tonic-gate xdr_generic_ret, (caddr_t) &res, 205*0Sstevel@tonic-gate TIMEOUT) != RPC_SUCCESS) { 206*0Sstevel@tonic-gate return (NULL); 207*0Sstevel@tonic-gate } 208*0Sstevel@tonic-gate return (&res); 209*0Sstevel@tonic-gate } 210*0Sstevel@tonic-gate 211*0Sstevel@tonic-gate generic_ret * 212*0Sstevel@tonic-gate setkey_principal_1(argp, clnt) 213*0Sstevel@tonic-gate setkey_arg *argp; 214*0Sstevel@tonic-gate CLIENT *clnt; 215*0Sstevel@tonic-gate { 216*0Sstevel@tonic-gate static generic_ret res; 217*0Sstevel@tonic-gate 218*0Sstevel@tonic-gate if (clnt == NULL) 219*0Sstevel@tonic-gate return (NULL); 220*0Sstevel@tonic-gate memset((char *)&res, 0, sizeof(res)); 221*0Sstevel@tonic-gate if (clnt_call(clnt, SETKEY_PRINCIPAL, xdr_setkey_arg, 222*0Sstevel@tonic-gate (caddr_t) argp, /* SUNWresync121 XXX */ 223*0Sstevel@tonic-gate xdr_generic_ret, (caddr_t) &res, 224*0Sstevel@tonic-gate TIMEOUT) != RPC_SUCCESS) { 225*0Sstevel@tonic-gate return (NULL); 226*0Sstevel@tonic-gate } 227*0Sstevel@tonic-gate return (&res); 228*0Sstevel@tonic-gate } 229*0Sstevel@tonic-gate 230*0Sstevel@tonic-gate generic_ret * 231*0Sstevel@tonic-gate setkey_principal3_1(argp, clnt) 232*0Sstevel@tonic-gate setkey_arg *argp; 233*0Sstevel@tonic-gate CLIENT *clnt; 234*0Sstevel@tonic-gate { 235*0Sstevel@tonic-gate static generic_ret res; 236*0Sstevel@tonic-gate 237*0Sstevel@tonic-gate if (clnt == NULL) 238*0Sstevel@tonic-gate return (NULL); 239*0Sstevel@tonic-gate memset((char *)&res, 0, sizeof(res)); 240*0Sstevel@tonic-gate if (clnt_call(clnt, SETKEY_PRINCIPAL3, xdr_setkey3_arg, 241*0Sstevel@tonic-gate (caddr_t) argp, /* SUNWresync121 XXX */ 242*0Sstevel@tonic-gate xdr_generic_ret, (caddr_t) &res, 243*0Sstevel@tonic-gate TIMEOUT) != RPC_SUCCESS) { 244*0Sstevel@tonic-gate return (NULL); 245*0Sstevel@tonic-gate } 246*0Sstevel@tonic-gate return (&res); 247*0Sstevel@tonic-gate } 248*0Sstevel@tonic-gate 249*0Sstevel@tonic-gate chrand_ret * 250*0Sstevel@tonic-gate chrand_principal_1(argp, clnt) 251*0Sstevel@tonic-gate chrand_arg *argp; 252*0Sstevel@tonic-gate CLIENT *clnt; 253*0Sstevel@tonic-gate { 254*0Sstevel@tonic-gate static chrand_ret res; 255*0Sstevel@tonic-gate 256*0Sstevel@tonic-gate if (clnt == NULL) 257*0Sstevel@tonic-gate return (NULL); 258*0Sstevel@tonic-gate memset((char *)&res, 0, sizeof(res)); 259*0Sstevel@tonic-gate if (clnt_call(clnt, CHRAND_PRINCIPAL, xdr_chrand_arg, (caddr_t) argp, 260*0Sstevel@tonic-gate xdr_chrand_ret, (caddr_t) &res, TIMEOUT) != RPC_SUCCESS) { 261*0Sstevel@tonic-gate return (NULL); 262*0Sstevel@tonic-gate } 263*0Sstevel@tonic-gate return (&res); 264*0Sstevel@tonic-gate } 265*0Sstevel@tonic-gate 266*0Sstevel@tonic-gate chrand_ret * 267*0Sstevel@tonic-gate chrand_principal3_1(argp, clnt) 268*0Sstevel@tonic-gate chrand_arg *argp; 269*0Sstevel@tonic-gate CLIENT *clnt; 270*0Sstevel@tonic-gate { 271*0Sstevel@tonic-gate static chrand_ret res; 272*0Sstevel@tonic-gate 273*0Sstevel@tonic-gate if (clnt == NULL) 274*0Sstevel@tonic-gate return (NULL); 275*0Sstevel@tonic-gate memset((char *)&res, 0, sizeof(res)); 276*0Sstevel@tonic-gate if (clnt_call(clnt, CHRAND_PRINCIPAL3, xdr_chrand3_arg, 277*0Sstevel@tonic-gate (caddr_t) argp, /* SUNWresync121 XXX */ 278*0Sstevel@tonic-gate xdr_chrand_ret, (caddr_t) &res, 279*0Sstevel@tonic-gate TIMEOUT) != RPC_SUCCESS) { 280*0Sstevel@tonic-gate return (NULL); 281*0Sstevel@tonic-gate } 282*0Sstevel@tonic-gate return (&res); 283*0Sstevel@tonic-gate } 284*0Sstevel@tonic-gate 285*0Sstevel@tonic-gate generic_ret * 286*0Sstevel@tonic-gate create_policy_1(argp, clnt) 287*0Sstevel@tonic-gate cpol_arg *argp; 288*0Sstevel@tonic-gate CLIENT *clnt; 289*0Sstevel@tonic-gate { 290*0Sstevel@tonic-gate static generic_ret res; 291*0Sstevel@tonic-gate 292*0Sstevel@tonic-gate if (clnt == NULL) 293*0Sstevel@tonic-gate return (NULL); 294*0Sstevel@tonic-gate memset((char *)&res, 0, sizeof(res)); 295*0Sstevel@tonic-gate if (clnt_call(clnt, CREATE_POLICY, xdr_cpol_arg, (caddr_t) argp, 296*0Sstevel@tonic-gate xdr_generic_ret, (caddr_t) &res, TIMEOUT) != RPC_SUCCESS) { 297*0Sstevel@tonic-gate return (NULL); 298*0Sstevel@tonic-gate } 299*0Sstevel@tonic-gate return (&res); 300*0Sstevel@tonic-gate } 301*0Sstevel@tonic-gate 302*0Sstevel@tonic-gate generic_ret * 303*0Sstevel@tonic-gate delete_policy_1(argp, clnt) 304*0Sstevel@tonic-gate dpol_arg *argp; 305*0Sstevel@tonic-gate CLIENT *clnt; 306*0Sstevel@tonic-gate { 307*0Sstevel@tonic-gate static generic_ret res; 308*0Sstevel@tonic-gate 309*0Sstevel@tonic-gate if (clnt == NULL) 310*0Sstevel@tonic-gate return (NULL); 311*0Sstevel@tonic-gate memset((char *)&res, 0, sizeof(res)); 312*0Sstevel@tonic-gate if (clnt_call(clnt, DELETE_POLICY, xdr_dpol_arg, (caddr_t) argp, 313*0Sstevel@tonic-gate xdr_generic_ret, (caddr_t) &res, TIMEOUT) != RPC_SUCCESS) { 314*0Sstevel@tonic-gate return (NULL); 315*0Sstevel@tonic-gate } 316*0Sstevel@tonic-gate return (&res); 317*0Sstevel@tonic-gate } 318*0Sstevel@tonic-gate 319*0Sstevel@tonic-gate generic_ret * 320*0Sstevel@tonic-gate modify_policy_1(argp, clnt) 321*0Sstevel@tonic-gate mpol_arg *argp; 322*0Sstevel@tonic-gate CLIENT *clnt; 323*0Sstevel@tonic-gate { 324*0Sstevel@tonic-gate static generic_ret res; 325*0Sstevel@tonic-gate 326*0Sstevel@tonic-gate if (clnt == NULL) 327*0Sstevel@tonic-gate return (NULL); 328*0Sstevel@tonic-gate memset((char *)&res, 0, sizeof(res)); 329*0Sstevel@tonic-gate if (clnt_call(clnt, MODIFY_POLICY, xdr_mpol_arg, (caddr_t) argp, 330*0Sstevel@tonic-gate xdr_generic_ret, (caddr_t) &res, TIMEOUT) != RPC_SUCCESS) { 331*0Sstevel@tonic-gate return (NULL); 332*0Sstevel@tonic-gate } 333*0Sstevel@tonic-gate return (&res); 334*0Sstevel@tonic-gate } 335*0Sstevel@tonic-gate 336*0Sstevel@tonic-gate gpol_ret * 337*0Sstevel@tonic-gate get_policy_1(argp, clnt) 338*0Sstevel@tonic-gate gpol_arg *argp; 339*0Sstevel@tonic-gate CLIENT *clnt; 340*0Sstevel@tonic-gate { 341*0Sstevel@tonic-gate static gpol_ret res; 342*0Sstevel@tonic-gate 343*0Sstevel@tonic-gate if (clnt == NULL) 344*0Sstevel@tonic-gate return (NULL); 345*0Sstevel@tonic-gate memset((char *)&res, 0, sizeof(res)); 346*0Sstevel@tonic-gate if (clnt_call(clnt, GET_POLICY, xdr_gpol_arg, (caddr_t) argp, 347*0Sstevel@tonic-gate xdr_gpol_ret, (caddr_t) &res, TIMEOUT) != RPC_SUCCESS) { 348*0Sstevel@tonic-gate return (NULL); 349*0Sstevel@tonic-gate } 350*0Sstevel@tonic-gate return (&res); 351*0Sstevel@tonic-gate } 352*0Sstevel@tonic-gate 353*0Sstevel@tonic-gate gpols_ret * 354*0Sstevel@tonic-gate get_pols_1(argp, clnt) 355*0Sstevel@tonic-gate gprinc_arg *argp; 356*0Sstevel@tonic-gate CLIENT *clnt; 357*0Sstevel@tonic-gate { 358*0Sstevel@tonic-gate static gpols_ret res; 359*0Sstevel@tonic-gate 360*0Sstevel@tonic-gate if (clnt == NULL) 361*0Sstevel@tonic-gate return (NULL); 362*0Sstevel@tonic-gate memset((char *)&res, 0, sizeof(res)); 363*0Sstevel@tonic-gate if (clnt_call(clnt, GET_POLS, xdr_gpols_arg, (caddr_t) argp, 364*0Sstevel@tonic-gate xdr_gpols_ret, (caddr_t) &res, TIMEOUT) != RPC_SUCCESS) { 365*0Sstevel@tonic-gate return (NULL); 366*0Sstevel@tonic-gate } 367*0Sstevel@tonic-gate return (&res); 368*0Sstevel@tonic-gate } 369*0Sstevel@tonic-gate 370*0Sstevel@tonic-gate getprivs_ret *get_privs_1(argp, clnt) 371*0Sstevel@tonic-gate void *argp; 372*0Sstevel@tonic-gate CLIENT *clnt; 373*0Sstevel@tonic-gate { 374*0Sstevel@tonic-gate static getprivs_ret res; 375*0Sstevel@tonic-gate 376*0Sstevel@tonic-gate if (clnt == NULL) 377*0Sstevel@tonic-gate return (NULL); 378*0Sstevel@tonic-gate memset((char *)&res, 0, sizeof(res)); 379*0Sstevel@tonic-gate if (clnt_call(clnt, GET_PRIVS, xdr_u_int, (caddr_t) argp, 380*0Sstevel@tonic-gate xdr_getprivs_ret, (caddr_t) &res, TIMEOUT) != RPC_SUCCESS) { 381*0Sstevel@tonic-gate return (NULL); 382*0Sstevel@tonic-gate } 383*0Sstevel@tonic-gate return (&res); 384*0Sstevel@tonic-gate } 385*0Sstevel@tonic-gate 386*0Sstevel@tonic-gate generic_ret * 387*0Sstevel@tonic-gate init_1(argp, clnt, rpc_err_code) 388*0Sstevel@tonic-gate void *argp; 389*0Sstevel@tonic-gate CLIENT *clnt; 390*0Sstevel@tonic-gate enum clnt_stat *rpc_err_code; 391*0Sstevel@tonic-gate { 392*0Sstevel@tonic-gate static generic_ret res; 393*0Sstevel@tonic-gate 394*0Sstevel@tonic-gate enum clnt_stat retval; 395*0Sstevel@tonic-gate 396*0Sstevel@tonic-gate if (clnt == NULL) 397*0Sstevel@tonic-gate return (NULL); 398*0Sstevel@tonic-gate memset((char *)&res, 0, sizeof(res)); 399*0Sstevel@tonic-gate retval = clnt_call(clnt, INIT, xdr_u_int, (caddr_t) argp, 400*0Sstevel@tonic-gate xdr_generic_ret, (caddr_t) &res, TIMEOUT); 401*0Sstevel@tonic-gate 402*0Sstevel@tonic-gate if (retval != RPC_SUCCESS) { 403*0Sstevel@tonic-gate *rpc_err_code = retval; 404*0Sstevel@tonic-gate return (NULL); 405*0Sstevel@tonic-gate } 406*0Sstevel@tonic-gate return (&res); 407*0Sstevel@tonic-gate } 408