From: Mitchell Berger Date: Wed, 20 Jun 2001 07:57:27 +0000 (+0000) Subject: * Makefile.in: Include clnt_generation.[co] in the build X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cced9f432d1c1723828ffc189452fb8f57fa3e41;p=thirdparty%2Fkrb5.git * Makefile.in: Include clnt_generation.[co] in the build * client_rpc.c: Minor formatting fixes on get_privs_1, added new function getgeneration_4. * clnt_generation.c: Added this new file containing the new function kadm5_get_generation_number. git-svn-id: svn://anonsvn.mit.edu/krb5/branches/incremental-propagation-branch@13406 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/kadm5/clnt/ChangeLog b/src/lib/kadm5/clnt/ChangeLog index fd2789d139..8f8ef3c076 100644 --- a/src/lib/kadm5/clnt/ChangeLog +++ b/src/lib/kadm5/clnt/ChangeLog @@ -1,3 +1,13 @@ +2001-06-20 Mitchell Berger + + * Makefile.in: Include clnt_generation.[co] in the build. + + * client_rpc.c: Minor formatting fixes on get_privs_1, added new + function getgeneration_4. + + * clnt_generation.c: Added this new file containing the new function + kadm5_get_generation_number. + 2001-06-18 Ezra Peisach * client_init.c (_kadm5_init_any): Add casts to (gss_OID) in calls diff --git a/src/lib/kadm5/clnt/Makefile.in b/src/lib/kadm5/clnt/Makefile.in index 9a1a39f28b..ac5de80160 100644 --- a/src/lib/kadm5/clnt/Makefile.in +++ b/src/lib/kadm5/clnt/Makefile.in @@ -28,7 +28,8 @@ SRCS = $(srcdir)/clnt_policy.c \ $(srcdir)/client_principal.c \ $(srcdir)/client_init.c \ $(srcdir)/clnt_privs.c \ - $(srcdir)/clnt_chpass_util.c + $(srcdir)/clnt_chpass_util.c \ + $(srcdir)/clnt_generation.c OBJS = \ clnt_policy.$(OBJEXT) \ @@ -36,7 +37,8 @@ OBJS = \ client_principal.$(OBJEXT) \ client_init.$(OBJEXT) \ clnt_privs.$(OBJEXT) \ - clnt_chpass_util.$(OBJEXT) + clnt_chpass_util.$(OBJEXT) \ + clnt_generation.$(OBJEXT) STLIBOBJS = \ clnt_policy.o \ @@ -44,7 +46,8 @@ STLIBOBJS = \ client_principal.o \ client_init.o \ clnt_privs.o \ - clnt_chpass_util.o + clnt_chpass_util.o \ + clnt_generation.o all-unix:: includes all-unix:: all-liblinks diff --git a/src/lib/kadm5/clnt/client_rpc.c b/src/lib/kadm5/clnt/client_rpc.c index 4e3b68a7f4..8c43062b1b 100644 --- a/src/lib/kadm5/clnt/client_rpc.c +++ b/src/lib/kadm5/clnt/client_rpc.c @@ -277,7 +277,8 @@ get_pols_1(argp, clnt) return (&res); } -getprivs_ret *get_privs_1(argp, clnt) +getprivs_ret * +get_privs_1(argp, clnt) void *argp; CLIENT *clnt; { @@ -291,6 +292,21 @@ getprivs_ret *get_privs_1(argp, clnt) return (&res); } +getgeneration_ret * +getgeneration_4(argp, clnt) + getgeneration_arg *argp; + CLIENT *clnt; +{ + static getgeneration_ret res; + + memset((char *)&res, 0, sizeof(res)); + if (clnt_call(clnt, GET_GENERATION_NUMBER, xdr_u_int32, argp, + xdr_getgeneration_ret, &res, TIMEOUT) != RPC_SUCCESS) { + return (NULL); + } + return (&res); +} + generic_ret * init_1(argp, clnt) void *argp; diff --git a/src/lib/kadm5/clnt/clnt_generation.c b/src/lib/kadm5/clnt/clnt_generation.c new file mode 100644 index 0000000000..26bce60eb9 --- /dev/null +++ b/src/lib/kadm5/clnt/clnt_generation.c @@ -0,0 +1,57 @@ +/* + * lib/kadm5/clnt/clnt_generation.c + * + * (C) Copyright 2001 by the Massachusetts Institute of Technology. + * All Rights Reserved. + * + * Export of this software from the United States of America may + * require a specific license from the United States Government. + * It is the responsibility of any person or organization contemplating + * export to obtain such a license before exporting. + * + * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + * distribute this software and its documentation for any purpose and + * without fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright notice and + * this permission notice appear in supporting documentation, and that + * the name of M.I.T. not be used in advertising or publicity pertaining + * to distribution of the software without specific, written prior + * permission. Furthermore if you modify this software you must label + * your software as modified software and not distribute it in such a + * fashion that it might be confused with the original M.I.T. software. + * M.I.T. makes no representations about the suitability of + * this software for any purpose. It is provided "as is" without express + * or implied warranty. + * + */ + +#if !defined(lint) && !defined(__CODECENTER__) +static char *rcsid = "$Header$"; +#endif + +#include +#include +#include +#ifdef HAVE_MEMORY_H +#include +#endif +#include "client_internal.h" + +kadm5_ret_t +kadm5_get_generation_number(void *server_handle, krb5_int32 *generation) +{ + getgeneration_arg arg; + getgeneration_ret *r; + kadm5_server_handle_t handle = server_handle; + + CHECK_HANDLE(server_handle); + + arg.api_version = handle->api_version; + r = getgeneration_4(&arg, handle->clnt); + if (r == NULL) + return KADM5_RPC_ERROR; + if (r->code == 0) + *generation = r->generation; + return r->code; +} +