+2001-06-20 Mitchell Berger <mitchb@mit.edu>
+
+ * 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 <epeisach@mit.edu>
* client_init.c (_kadm5_init_any): Add casts to (gss_OID) in calls
$(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) \
client_principal.$(OBJEXT) \
client_init.$(OBJEXT) \
clnt_privs.$(OBJEXT) \
- clnt_chpass_util.$(OBJEXT)
+ clnt_chpass_util.$(OBJEXT) \
+ clnt_generation.$(OBJEXT)
STLIBOBJS = \
clnt_policy.o \
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
return (&res);
}
-getprivs_ret *get_privs_1(argp, clnt)
+getprivs_ret *
+get_privs_1(argp, clnt)
void *argp;
CLIENT *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;
--- /dev/null
+/*
+ * 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 <gssrpc/rpc.h>
+#include <kadm5/admin.h>
+#include <kadm5/kadm_rpc.h>
+#ifdef HAVE_MEMORY_H
+#include <memory.h>
+#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;
+}
+