xref: /titanic_50/usr/src/lib/krb5/kadm5/clnt/clnt_privs.c (revision 7a286c471efbab8562f7655a82931904703fffe0)
1 /*
2  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
3  * Use is subject to license terms.
4  */
5 
6 
7 /*
8  * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
9  *
10  *	Openvision retains the copyright to derivative works of
11  *	this source code.  Do *NOT* create a derivative of this
12  *	source code before consulting with your legal department.
13  *	Do *NOT* integrate *ANY* of this source code into another
14  *	product before consulting with your legal department.
15  *
16  *	For further information, read the top-level Openvision
17  *	copyright which is contained in the top-level MIT Kerberos
18  *	copyright.
19  *
20  * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
21  *
22  */
23 
24 
25 /*
26  * Copyright 1993 OpenVision Technologies, Inc., All Rights Reserved.
27  *
28  * $Id: clnt_privs.c 18130 2006-06-14 21:42:02Z raeburn $
29  * $Source$
30  *
31  */
32 
33 #if !defined(lint) && !defined(__CODECENTER__)
34 static char *rcsid = "$Header$";
35 #endif
36 
37 #include    <rpc/rpc.h> /* SUNWresync121 XXX */
38 #include    <kadm5/admin.h>
39 #include    <kadm5/kadm_rpc.h>
40 #include    "client_internal.h"
41 
42 kadm5_ret_t kadm5_get_privs(void *server_handle, long *privs)
43 {
44      getprivs_ret *r;
45      kadm5_server_handle_t handle = server_handle;
46 
47      r = get_privs_2(&handle->api_version, handle->clnt);
48      if (r == NULL)
49 	  return KADM5_RPC_ERROR;
50      else if (r->code == KADM5_OK)
51 	  *privs = r->privs;
52 
53      return r->code;
54 }
55