]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Rename kauth/token.c as kauth/katoken.c
authorSimon Wilkinson <sxw@your-file-system.com>
Thu, 16 Sep 2010 06:09:20 +0000 (07:09 +0100)
committerDerrick Brashear <shadow@dementia.org>
Mon, 20 Sep 2010 06:48:19 +0000 (23:48 -0700)
The kauth 'token.c' collides with the same file in auth when doing
Windows builds. As kauth is the legacy package, rename its source
file, and update the build system to take account of this.

Change-Id: Ib99ef6674a4bfd6a2810b417b34bdc564b3533dc
Reviewed-on: http://gerrit.openafs.org/2766
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
src/kauth/Makefile.in
src/kauth/NTMakefile
src/kauth/katoken.c [new file with mode: 0644]
src/kauth/token.c [deleted file]
src/libafsauthent/Makefile.in
src/libafsauthent/NTMakefile
src/libuafs/Makefile.common.in
src/shlibafsauthent/Makefile.in

index 4887bb185e0fffda7231bff164ed2d6f47a8451d..414b70b5f19bf905e364c9d1426334d1ec9d5adc 100644 (file)
@@ -36,7 +36,7 @@ LIBS=${TOP_LIBDIR}/libubik.a \
        ${TOP_LIBDIR}/libafsutil.a \
        $(DBM)
 
-UKSRCS=authclient.c user.c kautils.h kaserver.h kaaux.c token.c \
+UKSRCS=authclient.c user.c kautils.h kaserver.h kaaux.c katoken.c \
        kalocalcell.c client.c kaerrors.c
 
 KLIBS=${TOP_LIBDIR}/libubik.a \
@@ -52,8 +52,8 @@ KLIBS=${TOP_LIBDIR}/libubik.a \
        ${TOP_LIBDIR}/libcom_err.a \
        ${TOP_LIBDIR}/libafsutil.a
 
-OBJS=kauth.xdr.o kauth.cs.o kaaux.o client.o authclient.o token.o kautils.o kalocalcell.o kaerrors.o user.o krb_tf.o 
-KOBJS=kauth.xdr.o kauth.cs.o kaaux.o client.o authclient.o token.o kautils.o kalocalcell.o kaerrors.o user.krb.o krb_tf.o
+OBJS=kauth.xdr.o kauth.cs.o kaaux.o client.o authclient.o katoken.o kautils.o kalocalcell.o kaerrors.o user.o krb_tf.o
+KOBJS=kauth.xdr.o kauth.cs.o kaaux.o client.o authclient.o katoken.o kautils.o kalocalcell.o kaerrors.o user.krb.o krb_tf.o
 
 all: kaserver kas kpwvalid klog klog.krb knfs kpasswd rebuild kdb ka-forwarder \
        ${TOP_LIBDIR}/libkauth.a \
@@ -159,7 +159,7 @@ libkauth.krb.a: $(KOBJS) AFS_component_version_number.o
 read_passwd.o: read_passwd.c
        ${CC} ${CFLAGS} -c read_passwd.c
 
-token.o: token.c ${INCLS}
+katoken.o: katoken.c ${INCLS}
 
 client.o: client.c ${INCLS} AFS_component_version_number.o
 
index 69ae7d337872084b9b012e732c3fd57298180583..16e8f6854485bc98a2e699dd10eaa058c5f99f0c 100644 (file)
@@ -33,7 +33,7 @@ KAUTH_LIBOBJS =\
        $(OUT)\kaaux.obj \
        $(OUT)\client.obj \
        $(OUT)\authclient.obj \
-       $(OUT)\token.obj \
+       $(OUT)\katoken.obj \
        $(OUT)\kautils.obj \
        $(OUT)\kalocalcell.obj \
        $(OUT)\kaerrors.obj \
@@ -55,7 +55,7 @@ KAUTH_KRB_LIBOBJS =\
        $(OUT)\kaaux.obj \
        $(OUT)\client.obj \
        $(OUT)\authclient.obj \
-       $(OUT)\token.obj \
+       $(OUT)\katoken.obj \
        $(OUT)\kautils.obj \
        $(OUT)\kalocalcell.obj \
        $(OUT)\kaerrors.obj \
diff --git a/src/kauth/katoken.c b/src/kauth/katoken.c
new file mode 100644 (file)
index 0000000..0680b6c
--- /dev/null
@@ -0,0 +1,337 @@
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License.  For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
+/* These routines provide an interface to the token cache maintained by the
+   kernel.  Principally it handles cache misses by requesting the desired token
+   from the AuthServer. */
+
+#include <afsconfig.h>
+#include <afs/param.h>
+
+#ifdef UKERNEL
+# include "afsincludes.h"
+#endif
+
+#include <afs/stds.h>
+#include <sys/types.h>
+#include <rx/xdr.h>
+#include <afs/pthread_glock.h>
+#ifdef AFS_NT40_ENV
+#include <winsock2.h>
+#else
+#include <sys/socket.h>
+#include <netinet/in.h>
+#endif
+#include <string.h>
+/* netinet/in.h and cellconfig.h  are needed together */
+#include <afs/cellconfig.h>
+    /* these are needed together */
+#include <lock.h>
+#include <ubik.h>
+
+#include "kauth.h"
+#include "kautils.h"
+#include <afs/auth.h>
+
+
+afs_int32
+ka_GetAuthToken(char *name, char *instance, char *cell,
+               struct ktc_encryptionKey * key, afs_int32 lifetime,
+               afs_int32 * pwexpires)
+{
+    afs_int32 code;
+    struct ubik_client *conn;
+    afs_int32 now = time(0);
+    struct ktc_token token;
+    char cellname[MAXKTCREALMLEN];
+    char realm[MAXKTCREALMLEN];
+    struct ktc_principal client, server;
+
+    LOCK_GLOBAL_MUTEX;
+    code = ka_ExpandCell(cell, cellname, 0 /*local */ );
+    if (code) {
+       UNLOCK_GLOBAL_MUTEX;
+       return code;
+    }
+    cell = cellname;
+
+    /* get an unauthenticated connection to desired cell */
+    code = ka_AuthServerConn(cell, KA_AUTHENTICATION_SERVICE, 0, &conn);
+    if (code) {
+       UNLOCK_GLOBAL_MUTEX;
+       return code;
+    }
+    code =
+       ka_Authenticate(name, instance, cell, conn,
+                       KA_TICKET_GRANTING_SERVICE, key, now, now + lifetime,
+                       &token, pwexpires);
+    if (code) {
+       UNLOCK_GLOBAL_MUTEX;
+       return code;
+    }
+    code = ubik_ClientDestroy(conn);
+    if (code) {
+       UNLOCK_GLOBAL_MUTEX;
+       return code;
+    }
+
+    code = ka_CellToRealm(cell, realm, 0 /*local */ );
+    if (code) {
+       UNLOCK_GLOBAL_MUTEX;
+       return code;
+    }
+    strcpy(client.name, name);
+    strcpy(client.instance, instance);
+    strncpy(client.cell, cell, sizeof(client.cell));
+    strcpy(server.name, KA_TGS_NAME);
+    strcpy(server.instance, realm);
+    strcpy(server.cell, cell);
+    code = ktc_SetToken(&server, &token, &client, 0);
+    UNLOCK_GLOBAL_MUTEX;
+    return code;
+}
+
+afs_int32
+ka_GetServerToken(char *name, char *instance, char *cell, Date lifetime,
+                 struct ktc_token * token, int new, int dosetpag)
+{
+    afs_int32 code;
+    struct ubik_client *conn;
+    afs_int32 now = time(0);
+    struct ktc_token auth_token;
+    struct ktc_token cell_token;
+    struct ktc_principal server, auth_server, client;
+    char *localCell = ka_LocalCell();
+    char cellname[MAXKTCREALMLEN];
+    char realm[MAXKTCREALMLEN];
+    char authDomain[MAXKTCREALMLEN];
+    int local;
+
+    LOCK_GLOBAL_MUTEX;
+    code = ka_ExpandCell(cell, cellname, 0 /*local */ );
+    if (code) {
+       UNLOCK_GLOBAL_MUTEX;
+       return code;
+    }
+    cell = cellname;
+
+    strcpy(server.name, name);
+    strcpy(server.instance, instance);
+    lcstring(server.cell, cell, sizeof(server.cell));
+    if (!new) {
+       code =
+           ktc_GetToken(&server, token, sizeof(struct ktc_token), &client);
+       if (!code) {
+           UNLOCK_GLOBAL_MUTEX;
+           return 0;
+       }
+    }
+
+    code = ka_CellToRealm(cell, realm, &local);
+    if (code) {
+       UNLOCK_GLOBAL_MUTEX;
+       return code;
+    }
+
+    /* get TGS ticket for proper realm */
+    strcpy(auth_server.name, KA_TGS_NAME);
+    strcpy(auth_server.instance, realm);
+    lcstring(auth_server.cell, realm, sizeof(auth_server.cell));
+    strcpy(authDomain, realm);
+    code =
+       ktc_GetToken(&auth_server, &auth_token, sizeof(auth_token), &client);
+    if (code && !local) {      /* try for remotely authenticated ticket */
+       strcpy(auth_server.cell, localCell);
+       strcpy(authDomain, "");
+       code =
+           ktc_GetToken(&auth_server, &auth_token, sizeof(auth_token),
+                        &client);
+    }
+
+    if (code && local) {
+       UNLOCK_GLOBAL_MUTEX;
+       return code;
+    } else if (code) {
+       /* here we invoke the inter-cell mechanism */
+
+       /* get local auth ticket */
+       ucstring(auth_server.instance, localCell,
+                sizeof(auth_server.instance));
+       strcpy(auth_server.cell, localCell);
+       code =
+           ktc_GetToken(&auth_server, &cell_token, sizeof(cell_token),
+                        &client);
+       if (code) {
+           UNLOCK_GLOBAL_MUTEX;
+           return code;
+       }
+       /* get a connection to the local cell */
+       if ((code =
+            ka_AuthServerConn(localCell, KA_TICKET_GRANTING_SERVICE, 0,
+                              &conn))) {
+           UNLOCK_GLOBAL_MUTEX;
+           return code;
+       }
+       /* get foreign auth ticket */
+       if ((code =
+            ka_GetToken(KA_TGS_NAME, realm, localCell, client.name,
+                        client.instance, conn, now, now + lifetime,
+                        &cell_token, "" /* local auth domain */ ,
+                        &auth_token))) {
+           UNLOCK_GLOBAL_MUTEX;
+           return code;
+       }
+       code = ubik_ClientDestroy(conn);
+       if (code) {
+           UNLOCK_GLOBAL_MUTEX;
+           return code;
+       }
+       conn = 0;
+
+       /* save foreign auth ticket */
+       strcpy(auth_server.instance, realm);
+       lcstring(auth_server.cell, localCell, sizeof(auth_server.cell));
+       ucstring(authDomain, localCell, sizeof(authDomain));
+       if ((code = ktc_SetToken(&auth_server, &auth_token, &client, 0))) {
+           UNLOCK_GLOBAL_MUTEX;
+           return code;
+       }
+    }
+
+    if ((code =
+        ka_AuthServerConn(cell, KA_TICKET_GRANTING_SERVICE, 0, &conn))) {
+       UNLOCK_GLOBAL_MUTEX;
+       return code;
+    }
+    if ((code =
+        ka_GetToken(name, instance, cell, client.name, client.instance, conn,
+                    now, now + lifetime, &auth_token, authDomain, token))) {
+       UNLOCK_GLOBAL_MUTEX;
+       return code;
+    }
+    code = ubik_ClientDestroy(conn);
+    if (code) {
+       UNLOCK_GLOBAL_MUTEX;
+       return code;
+    }
+
+    if ((code =
+        ktc_SetToken(&server, token, &client,
+                     dosetpag ? AFS_SETTOK_SETPAG : 0))) {
+       UNLOCK_GLOBAL_MUTEX;
+       return code;
+    }
+    UNLOCK_GLOBAL_MUTEX;
+    return 0;
+}
+
+afs_int32
+ka_GetAdminToken(char *name, char *instance, char *cell,
+                struct ktc_encryptionKey * key, afs_int32 lifetime,
+                struct ktc_token * token, int new)
+{
+    int code;
+    struct ubik_client *conn;
+    afs_int32 now = time(0);
+    struct ktc_principal server, client;
+    struct ktc_token localToken;
+    char cellname[MAXKTCREALMLEN];
+
+    LOCK_GLOBAL_MUTEX;
+    code = ka_ExpandCell(cell, cellname, 0 /*local */ );
+    if (code) {
+       UNLOCK_GLOBAL_MUTEX;
+       return code;
+    }
+    cell = cellname;
+
+    if (token == 0)
+       token = &localToken;    /* in case caller doesn't want token */
+
+    strcpy(server.name, KA_ADMIN_NAME);
+    strcpy(server.instance, KA_ADMIN_INST);
+    strncpy(server.cell, cell, sizeof(server.cell));
+    if (!new) {
+       code =
+           ktc_GetToken(&server, token, sizeof(struct ktc_token), &client);
+       if (code == 0) {
+           UNLOCK_GLOBAL_MUTEX;
+           return 0;
+       }
+    }
+
+    if ((name == 0) || (key == 0)) {
+       /* just lookup in cache don't get new one */
+       UNLOCK_GLOBAL_MUTEX;
+       return KANOTICKET;
+    }
+
+    /* get an unauthenticated connection to desired cell */
+    code = ka_AuthServerConn(cell, KA_AUTHENTICATION_SERVICE, 0, &conn);
+    if (code) {
+       UNLOCK_GLOBAL_MUTEX;
+       return code;
+    }
+    code =
+       ka_Authenticate(name, instance, cell, conn, KA_MAINTENANCE_SERVICE,
+                       key, now, now + lifetime, token, 0);
+    (void)ubik_ClientDestroy(conn);
+    if (code) {
+       UNLOCK_GLOBAL_MUTEX;
+       return code;
+    }
+
+    strcpy(client.name, name);
+    strcpy(client.instance, instance);
+    strncpy(client.cell, cell, sizeof(client.cell));
+    code = ktc_SetToken(&server, token, &client, 0);
+    UNLOCK_GLOBAL_MUTEX;
+    return code;
+}
+
+
+afs_int32
+ka_VerifyUserToken(char *name, char *instance, char *cell,
+                  struct ktc_encryptionKey * key)
+{
+    afs_int32 code;
+    struct ubik_client *conn;
+    afs_int32 now = time(0);
+    struct ktc_token token;
+    char cellname[MAXKTCREALMLEN];
+    afs_int32 pwexpires;
+
+    LOCK_GLOBAL_MUTEX;
+    code = ka_ExpandCell(cell, cellname, 0 /*local */ );
+    if (code) {
+       UNLOCK_GLOBAL_MUTEX;
+       return code;
+    }
+
+    cell = cellname;
+
+    /* get an unauthenticated connection to desired cell */
+    code = ka_AuthServerConn(cell, KA_AUTHENTICATION_SERVICE, 0, &conn);
+    if (code) {
+       UNLOCK_GLOBAL_MUTEX;
+       return code;
+    }
+
+    code =
+       ka_Authenticate(name, instance, cell, conn,
+                       KA_TICKET_GRANTING_SERVICE, key, now,
+                       now + MAXKTCTICKETLIFETIME, &token, &pwexpires);
+    if (code) {
+       UNLOCK_GLOBAL_MUTEX;
+       return code;
+    }
+    code = ubik_ClientDestroy(conn);
+    UNLOCK_GLOBAL_MUTEX;
+    return code;
+}
diff --git a/src/kauth/token.c b/src/kauth/token.c
deleted file mode 100644 (file)
index 0680b6c..0000000
+++ /dev/null
@@ -1,337 +0,0 @@
-/*
- * Copyright 2000, International Business Machines Corporation and others.
- * All Rights Reserved.
- *
- * This software has been released under the terms of the IBM Public
- * License.  For details, see the LICENSE file in the top-level source
- * directory or online at http://www.openafs.org/dl/license10.html
- */
-
-/* These routines provide an interface to the token cache maintained by the
-   kernel.  Principally it handles cache misses by requesting the desired token
-   from the AuthServer. */
-
-#include <afsconfig.h>
-#include <afs/param.h>
-
-#ifdef UKERNEL
-# include "afsincludes.h"
-#endif
-
-#include <afs/stds.h>
-#include <sys/types.h>
-#include <rx/xdr.h>
-#include <afs/pthread_glock.h>
-#ifdef AFS_NT40_ENV
-#include <winsock2.h>
-#else
-#include <sys/socket.h>
-#include <netinet/in.h>
-#endif
-#include <string.h>
-/* netinet/in.h and cellconfig.h  are needed together */
-#include <afs/cellconfig.h>
-    /* these are needed together */
-#include <lock.h>
-#include <ubik.h>
-
-#include "kauth.h"
-#include "kautils.h"
-#include <afs/auth.h>
-
-
-afs_int32
-ka_GetAuthToken(char *name, char *instance, char *cell,
-               struct ktc_encryptionKey * key, afs_int32 lifetime,
-               afs_int32 * pwexpires)
-{
-    afs_int32 code;
-    struct ubik_client *conn;
-    afs_int32 now = time(0);
-    struct ktc_token token;
-    char cellname[MAXKTCREALMLEN];
-    char realm[MAXKTCREALMLEN];
-    struct ktc_principal client, server;
-
-    LOCK_GLOBAL_MUTEX;
-    code = ka_ExpandCell(cell, cellname, 0 /*local */ );
-    if (code) {
-       UNLOCK_GLOBAL_MUTEX;
-       return code;
-    }
-    cell = cellname;
-
-    /* get an unauthenticated connection to desired cell */
-    code = ka_AuthServerConn(cell, KA_AUTHENTICATION_SERVICE, 0, &conn);
-    if (code) {
-       UNLOCK_GLOBAL_MUTEX;
-       return code;
-    }
-    code =
-       ka_Authenticate(name, instance, cell, conn,
-                       KA_TICKET_GRANTING_SERVICE, key, now, now + lifetime,
-                       &token, pwexpires);
-    if (code) {
-       UNLOCK_GLOBAL_MUTEX;
-       return code;
-    }
-    code = ubik_ClientDestroy(conn);
-    if (code) {
-       UNLOCK_GLOBAL_MUTEX;
-       return code;
-    }
-
-    code = ka_CellToRealm(cell, realm, 0 /*local */ );
-    if (code) {
-       UNLOCK_GLOBAL_MUTEX;
-       return code;
-    }
-    strcpy(client.name, name);
-    strcpy(client.instance, instance);
-    strncpy(client.cell, cell, sizeof(client.cell));
-    strcpy(server.name, KA_TGS_NAME);
-    strcpy(server.instance, realm);
-    strcpy(server.cell, cell);
-    code = ktc_SetToken(&server, &token, &client, 0);
-    UNLOCK_GLOBAL_MUTEX;
-    return code;
-}
-
-afs_int32
-ka_GetServerToken(char *name, char *instance, char *cell, Date lifetime,
-                 struct ktc_token * token, int new, int dosetpag)
-{
-    afs_int32 code;
-    struct ubik_client *conn;
-    afs_int32 now = time(0);
-    struct ktc_token auth_token;
-    struct ktc_token cell_token;
-    struct ktc_principal server, auth_server, client;
-    char *localCell = ka_LocalCell();
-    char cellname[MAXKTCREALMLEN];
-    char realm[MAXKTCREALMLEN];
-    char authDomain[MAXKTCREALMLEN];
-    int local;
-
-    LOCK_GLOBAL_MUTEX;
-    code = ka_ExpandCell(cell, cellname, 0 /*local */ );
-    if (code) {
-       UNLOCK_GLOBAL_MUTEX;
-       return code;
-    }
-    cell = cellname;
-
-    strcpy(server.name, name);
-    strcpy(server.instance, instance);
-    lcstring(server.cell, cell, sizeof(server.cell));
-    if (!new) {
-       code =
-           ktc_GetToken(&server, token, sizeof(struct ktc_token), &client);
-       if (!code) {
-           UNLOCK_GLOBAL_MUTEX;
-           return 0;
-       }
-    }
-
-    code = ka_CellToRealm(cell, realm, &local);
-    if (code) {
-       UNLOCK_GLOBAL_MUTEX;
-       return code;
-    }
-
-    /* get TGS ticket for proper realm */
-    strcpy(auth_server.name, KA_TGS_NAME);
-    strcpy(auth_server.instance, realm);
-    lcstring(auth_server.cell, realm, sizeof(auth_server.cell));
-    strcpy(authDomain, realm);
-    code =
-       ktc_GetToken(&auth_server, &auth_token, sizeof(auth_token), &client);
-    if (code && !local) {      /* try for remotely authenticated ticket */
-       strcpy(auth_server.cell, localCell);
-       strcpy(authDomain, "");
-       code =
-           ktc_GetToken(&auth_server, &auth_token, sizeof(auth_token),
-                        &client);
-    }
-
-    if (code && local) {
-       UNLOCK_GLOBAL_MUTEX;
-       return code;
-    } else if (code) {
-       /* here we invoke the inter-cell mechanism */
-
-       /* get local auth ticket */
-       ucstring(auth_server.instance, localCell,
-                sizeof(auth_server.instance));
-       strcpy(auth_server.cell, localCell);
-       code =
-           ktc_GetToken(&auth_server, &cell_token, sizeof(cell_token),
-                        &client);
-       if (code) {
-           UNLOCK_GLOBAL_MUTEX;
-           return code;
-       }
-       /* get a connection to the local cell */
-       if ((code =
-            ka_AuthServerConn(localCell, KA_TICKET_GRANTING_SERVICE, 0,
-                              &conn))) {
-           UNLOCK_GLOBAL_MUTEX;
-           return code;
-       }
-       /* get foreign auth ticket */
-       if ((code =
-            ka_GetToken(KA_TGS_NAME, realm, localCell, client.name,
-                        client.instance, conn, now, now + lifetime,
-                        &cell_token, "" /* local auth domain */ ,
-                        &auth_token))) {
-           UNLOCK_GLOBAL_MUTEX;
-           return code;
-       }
-       code = ubik_ClientDestroy(conn);
-       if (code) {
-           UNLOCK_GLOBAL_MUTEX;
-           return code;
-       }
-       conn = 0;
-
-       /* save foreign auth ticket */
-       strcpy(auth_server.instance, realm);
-       lcstring(auth_server.cell, localCell, sizeof(auth_server.cell));
-       ucstring(authDomain, localCell, sizeof(authDomain));
-       if ((code = ktc_SetToken(&auth_server, &auth_token, &client, 0))) {
-           UNLOCK_GLOBAL_MUTEX;
-           return code;
-       }
-    }
-
-    if ((code =
-        ka_AuthServerConn(cell, KA_TICKET_GRANTING_SERVICE, 0, &conn))) {
-       UNLOCK_GLOBAL_MUTEX;
-       return code;
-    }
-    if ((code =
-        ka_GetToken(name, instance, cell, client.name, client.instance, conn,
-                    now, now + lifetime, &auth_token, authDomain, token))) {
-       UNLOCK_GLOBAL_MUTEX;
-       return code;
-    }
-    code = ubik_ClientDestroy(conn);
-    if (code) {
-       UNLOCK_GLOBAL_MUTEX;
-       return code;
-    }
-
-    if ((code =
-        ktc_SetToken(&server, token, &client,
-                     dosetpag ? AFS_SETTOK_SETPAG : 0))) {
-       UNLOCK_GLOBAL_MUTEX;
-       return code;
-    }
-    UNLOCK_GLOBAL_MUTEX;
-    return 0;
-}
-
-afs_int32
-ka_GetAdminToken(char *name, char *instance, char *cell,
-                struct ktc_encryptionKey * key, afs_int32 lifetime,
-                struct ktc_token * token, int new)
-{
-    int code;
-    struct ubik_client *conn;
-    afs_int32 now = time(0);
-    struct ktc_principal server, client;
-    struct ktc_token localToken;
-    char cellname[MAXKTCREALMLEN];
-
-    LOCK_GLOBAL_MUTEX;
-    code = ka_ExpandCell(cell, cellname, 0 /*local */ );
-    if (code) {
-       UNLOCK_GLOBAL_MUTEX;
-       return code;
-    }
-    cell = cellname;
-
-    if (token == 0)
-       token = &localToken;    /* in case caller doesn't want token */
-
-    strcpy(server.name, KA_ADMIN_NAME);
-    strcpy(server.instance, KA_ADMIN_INST);
-    strncpy(server.cell, cell, sizeof(server.cell));
-    if (!new) {
-       code =
-           ktc_GetToken(&server, token, sizeof(struct ktc_token), &client);
-       if (code == 0) {
-           UNLOCK_GLOBAL_MUTEX;
-           return 0;
-       }
-    }
-
-    if ((name == 0) || (key == 0)) {
-       /* just lookup in cache don't get new one */
-       UNLOCK_GLOBAL_MUTEX;
-       return KANOTICKET;
-    }
-
-    /* get an unauthenticated connection to desired cell */
-    code = ka_AuthServerConn(cell, KA_AUTHENTICATION_SERVICE, 0, &conn);
-    if (code) {
-       UNLOCK_GLOBAL_MUTEX;
-       return code;
-    }
-    code =
-       ka_Authenticate(name, instance, cell, conn, KA_MAINTENANCE_SERVICE,
-                       key, now, now + lifetime, token, 0);
-    (void)ubik_ClientDestroy(conn);
-    if (code) {
-       UNLOCK_GLOBAL_MUTEX;
-       return code;
-    }
-
-    strcpy(client.name, name);
-    strcpy(client.instance, instance);
-    strncpy(client.cell, cell, sizeof(client.cell));
-    code = ktc_SetToken(&server, token, &client, 0);
-    UNLOCK_GLOBAL_MUTEX;
-    return code;
-}
-
-
-afs_int32
-ka_VerifyUserToken(char *name, char *instance, char *cell,
-                  struct ktc_encryptionKey * key)
-{
-    afs_int32 code;
-    struct ubik_client *conn;
-    afs_int32 now = time(0);
-    struct ktc_token token;
-    char cellname[MAXKTCREALMLEN];
-    afs_int32 pwexpires;
-
-    LOCK_GLOBAL_MUTEX;
-    code = ka_ExpandCell(cell, cellname, 0 /*local */ );
-    if (code) {
-       UNLOCK_GLOBAL_MUTEX;
-       return code;
-    }
-
-    cell = cellname;
-
-    /* get an unauthenticated connection to desired cell */
-    code = ka_AuthServerConn(cell, KA_AUTHENTICATION_SERVICE, 0, &conn);
-    if (code) {
-       UNLOCK_GLOBAL_MUTEX;
-       return code;
-    }
-
-    code =
-       ka_Authenticate(name, instance, cell, conn,
-                       KA_TICKET_GRANTING_SERVICE, key, now,
-                       now + MAXKTCTICKETLIFETIME, &token, &pwexpires);
-    if (code) {
-       UNLOCK_GLOBAL_MUTEX;
-       return code;
-    }
-    code = ubik_ClientDestroy(conn);
-    UNLOCK_GLOBAL_MUTEX;
-    return code;
-}
index a13fdbb3bb46fe9f45a68a2abc0f402fe40a1497..7e1845656f7bb57a153aad1ccbabfc7377f3dae3 100644 (file)
@@ -162,8 +162,8 @@ client.o: ${KAUTH}/client.c
 authclient.o: ${KAUTH}/authclient.c
        ${CCRULE} -I../kauth
 
-katoken.o: ${KAUTH}/token.c
-       ${CCRULE} -o katoken.o -I../kauth
+katoken.o: ${KAUTH}/katoken.c
+       ${CCRULE} -I../kauth
 
 kautils.o: ${KAUTH}/kautils.c
        ${CCRULE} -I../kauth
index 21094f32b65e4c96bc487c0bbd49eeeb480d7d01..9b2df9146f69889f1231da1fc20772688e08dab4 100644 (file)
@@ -48,11 +48,11 @@ KAUTHOBJS = \
        $(OUT)\kaaux.obj \
        $(OUT)\client.obj \
        $(OUT)\authclient.obj \
-       $(OUT)\token.obj \
        $(OUT)\kautils.obj \
        $(OUT)\kalocalcell.obj \
        $(OUT)\kaerrors.obj \
-       $(OUT)\user_nt.obj
+       $(OUT)\user_nt.obj \
+        $(OUT)\katoken.obj
 
 UBIKOBJS = \
        $(OUT)\uinit.obj \
index dbfec0eff92aea4434a43a1993285622724014e1..f0b436f78530145f07d272384da4e4a6acac3d6f 100644 (file)
@@ -867,8 +867,8 @@ $(UOBJ)/user.o: $(TOP_SRCDIR)/kauth/user.c
        $(CRULE1)
 $(UOBJ)/hostparse.o: $(TOP_SRCDIR)/util/hostparse.c
        $(CRULE1)
-$(UOBJ)/katoken.o: $(TOP_SRCDIR)/kauth/token.c
-       $(CRULE1) -o katoken.o
+$(UOBJ)/katoken.o: $(TOP_SRCDIR)/kauth/katoken.c
+       $(CRULE1)
 $(UOBJ)/acfg_errors.o: $(TOP_OBJDIR)/src/auth/acfg_errors.c
        $(CRULE1)
 $(UOBJ)/kaaux.o: $(TOP_SRCDIR)/kauth/kaaux.c
@@ -1155,8 +1155,8 @@ $(WEBOBJ)/user.o: $(TOP_SRCDIR)/kauth/user.c
        $(CRULE2)
 $(WEBOBJ)/hostparse.o: $(TOP_SRCDIR)/util/hostparse.c
        $(CRULE2)
-$(WEBOBJ)/katoken.o: $(TOP_SRCDIR)/kauth/token.c
-       $(CRULE2) -o katoken.o
+$(WEBOBJ)/katoken.o: $(TOP_SRCDIR)/kauth/katoken.c
+       $(CRULE2)
 $(WEBOBJ)/acfg_errors.o: $(TOP_OBJDIR)/src/auth/acfg_errors.c
        $(CRULE2)
 $(WEBOBJ)/kaaux.o: $(TOP_SRCDIR)/kauth/kaaux.c
@@ -1437,8 +1437,8 @@ $(JUAFS)/user.o: $(TOP_SRCDIR)/kauth/user.c
        $(CRULE1)
 $(JUAFS)/hostparse.o: $(TOP_SRCDIR)/util/hostparse.c
        $(CRULE1)
-$(JUAFS)/katoken.o: $(TOP_SRCDIR)/kauth/token.c
-       $(CRULE1) -o katoken.o
+$(JUAFS)/katoken.o: $(TOP_SRCDIR)/kauth/katoken.c
+       $(CRULE1)
 $(JUAFS)/acfg_errors.o: $(TOP_OBJDIR)/src/auth/acfg_errors.c
        $(CRULE1)
 $(JUAFS)/kaaux.o: $(TOP_SRCDIR)/kauth/kaaux.c
index af12e16c089f3ed135d48ff8517c8ae5ef65b336..0ff87ce63210380e163a62fbb118eab6c1ea52f0 100644 (file)
@@ -193,8 +193,8 @@ client.o: ${KAUTH}/client.c
 authclient.o: ${KAUTH}/authclient.c
        ${CCRULE}
 
-katoken.o: ${KAUTH}/token.c
-       ${CCRULE} -o katoken.o
+katoken.o: ${KAUTH}/katoken.c
+       ${CCRULE}
 
 kautils.o: ${KAUTH}/kautils.c
        ${CCRULE}