xref: /titanic_52/usr/src/lib/krb5/kadm5/clnt/clnt_privs.c (revision 0eb822a1c0c2bea495647510b75f77f0e57633eb)
1 /*
2  * Copyright 2002 Sun Microsystems, Inc.  All rights reserved.
3  * Use is subject to license terms.
4  */
5 
6 #pragma ident	"%Z%%M%	%I%	%E% SMI"
7 
8 /*
9  * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
10  *
11  *	Openvision retains the copyright to derivative works of
12  *	this source code.  Do *NOT* create a derivative of this
13  *	source code before consulting with your legal department.
14  *	Do *NOT* integrate *ANY* of this source code into another
15  *	product before consulting with your legal department.
16  *
17  *	For further information, read the top-level Openvision
18  *	copyright which is contained in the top-level MIT Kerberos
19  *	copyright.
20  *
21  * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
22  *
23  */
24 
25 
26 /*
27  * Copyright 1993 OpenVision Technologies, Inc., All Rights Reserved.
28  *
29  * $Id: clnt_privs.c,v 1.2 1998/02/14 02:32:58 tlyu Exp $
30  * $Source: /cvs/krbdev/krb5/src/lib/kadm5/clnt/clnt_privs.c,v $
31  *
32  * $Log: clnt_privs.c,v $
33  * Revision 1.2  1998/02/14 02:32:58  tlyu
34  * 	* client_init.c:
35  * 	* client_principal.c:
36  * 	* client_rpc.c:
37  * 	* clnt_policy.c:
38  * 	* clnt_privs.c: Update header locations.
39  *
40  * 	* Makefile.in (LIBMAJOR): Bump major version to reflect change in
41  * 	rpc library.
42  *
43  * Revision 1.1  1996/07/24 22:22:48  tlyu
44  * 	* Makefile.in, configure.in: break out client lib into a
45  * 		subdirectory
46  *
47  * Revision 1.6  1996/07/22 20:35:57  marc
48  * this commit includes all the changes on the OV_9510_INTEGRATION and
49  * OV_MERGE branches.  This includes, but is not limited to, the new openvision
50  * admin system, and major changes to gssapi to add functionality, and bring
51  * the implementation in line with rfc1964.  before committing, the
52  * code was built and tested for netbsd and solaris.
53  *
54  * Revision 1.5.4.1  1996/07/18 03:08:45  marc
55  * merged in changes from OV_9510_BP to OV_9510_FINAL1
56  *
57  * Revision 1.5.2.1  1996/06/20  02:16:53  marc
58  * File added to the repository on a branch
59  *
60  * Revision 1.5  1996/05/17  21:36:50  bjaspan
61  * rename to kadm5, begin implementing version 2
62  *
63  * Revision 1.4  1996/05/16 21:45:51  bjaspan
64  * u_int32 -> long, add krb5_context
65  *
66  * Revision 1.3  1994/09/20 16:25:05  bjaspan
67  * [secure-admin/2436: API versioning fixes to various admin files]
68  * [secure-releng/2502: audit secure-admin/2436: random API versioning fixes]
69  *
70  * Sandbox:
71  *
72  *  Unnecessary variable initialization removed.
73  *
74  * Revision 1.3  1994/09/12  20:26:39  jik
75  * Unnecessary variable initialization removed.
76  *
77  * Revision 1.2  1994/08/16  18:52:02  jik
78  * Versioning changes.
79  *
80  * Revision 1.1  1993/11/10  23:10:39  bjaspan
81  * Initial revision
82  *
83  */
84 
85 #if !defined(lint) && !defined(__CODECENTER__)
86 static char *rcsid = "$Header: /cvs/krbdev/krb5/src/lib/kadm5/clnt/clnt_privs.c,v 1.2 1998/02/14 02:32:58 tlyu Exp $";
87 #endif
88 
89 #include    <rpc/rpc.h> /* SUNWresync121 XXX */
90 #include    <kadm5/admin.h>
91 #include    <kadm5/kadm_rpc.h>
92 #include    "client_internal.h"
93 
94 kadm5_ret_t kadm5_get_privs(void *server_handle, long *privs)
95 {
96      getprivs_ret *r;
97      kadm5_server_handle_t handle = server_handle;
98 
99      r = get_privs_1(&handle->api_version, handle->clnt);
100      if (r == NULL)
101 	  return KADM5_RPC_ERROR;
102      else if (r->code == KADM5_OK)
103 	  *privs = r->privs;
104      return r->code;
105 }
106