]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
* Makefile.in: Include clnt_generation.[co] in the build
authorMitchell Berger <mitchb@mit.edu>
Wed, 20 Jun 2001 07:57:27 +0000 (07:57 +0000)
committerMitchell Berger <mitchb@mit.edu>
Wed, 20 Jun 2001 07:57:27 +0000 (07:57 +0000)
* 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

src/lib/kadm5/clnt/ChangeLog
src/lib/kadm5/clnt/Makefile.in
src/lib/kadm5/clnt/client_rpc.c
src/lib/kadm5/clnt/clnt_generation.c [new file with mode: 0644]

index fd2789d13963fc527f77e828e75db64bf46a3e72..8f8ef3c076662acf3056d6a43192aca45e7e9cc0 100644 (file)
@@ -1,3 +1,13 @@
+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
index 9a1a39f28babec7e242d5de35a217c8d23e804a8..ac5de8016028423adb4d4b0e6bdd37867155270e 100644 (file)
@@ -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
index 4e3b68a7f4f9fb78de08c7c919cfe6c1316e5b91..8c43062b1b86b3a47682b04cbc117fe559c24f93 100644 (file)
@@ -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 (file)
index 0000000..26bce60
--- /dev/null
@@ -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    <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;
+}
+