#include <afsconfig.h>
#include <afs/param.h>
-RCSID
- ("$Header$");
#include <afs/stds.h>
#include <afs/debug.h>
#include <stdio.h>
#include <rx/rx.h>
+#include <rx/rxkad.h>
#include <lock.h>
#define UBIK_LEGACY_CALLITER 1
#include <ubik.h>
#include <afs/cmd.h>
#include <afs/com_err.h>
#include <afs/afsutil.h>
+#include <des.h>
+#include <des_prototypes.h>
#include "kauth.h"
#include "kautils.h"
#include "kaport.h"
+#include "kkids.h"
#define CMD_PARSER_AMBIG_FIX 1 /* allow ambiguous aliases */
static int finished;
static int zero_argc;
static char **zero_argv;
-afs_uint32 ka_islocked();
+afs_uint32 ka_islocked(char *, char *, afs_uint32 *);
afs_int32
DefaultCell(void)
str = lcstring(bitspec, str, sizeof(bitspec));
if (isdigit(*str)) {
if (strncmp(str, "0x", 2) == 0) /* 0x => hex */
- sscanf(str, "0x%lx", &f);
+ sscanf(str, "0x%lx", (long unsigned int *) &f);
else if (*str == '0') /* assume octal */
- sscanf(str, "%lo", &f);
+ sscanf(str, "%lo", (long unsigned int *) &f);
else /* just assume hex */
- sscanf(str, "%lx", &f);
+ sscanf(str, "%lx", (long unsigned int *) &f);
} else {
if (*str == '=') {
str++;
0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
if (code) {
if (seriouserror(code))
- afs_com_err(whoami, code, "");
+ afs_com_err(whoami, code, NULL);
} else if (tempwhen) { /* user is locked */
if (!*when || tempwhen < *when) {
*when = tempwhen;
}
ucstring(realm, realm, sizeof(realm));
} else {
- if (code = DefaultCell())
+ if ((code = DefaultCell()))
return code;
ucstring(realm, cell, sizeof(realm));
}
ka_PrintBytes((char *)&key, sizeof(key));
printf("'.\n");
- des_string_to_key(as->parms[0].items->data, &key);
+ des_string_to_key(as->parms[0].items->data, ktc_to_cblockptr(&key));
printf("Converting %s with the DES string to key yields key='",
as->parms[0].items->data);
return 0;
}
-static
+static int
GetTicket(struct cmd_syndesc *as, void *arock)
{
int code;
return KABADCMD;
}
if (server.cell[0] == 0) {
- if (code = DefaultCell())
+ if ((code = DefaultCell()))
return code;
strcpy(server.cell, cell);
} else {
return code;
}
-static
+static int
GetPassword(struct cmd_syndesc *as, void *arock)
{
int code;
ka_PrintBytes((char *)&key, sizeof(key));
printf(" (");
for (i = 0; i < sizeof(key); i++) {
- printf("%0.2x", ((char *)&key)[i] & 0xff);
+ printf("%.2x", ((char *)&key)[i] & 0xff);
if (i == 3)
printf(" ");
else if (i != 7)
(double)dynamics.hashTableUtilization / 100.0);
ka_timestr(dynamics.start_time, bob, KA_TIMESTR_LEN);
printf("From host %lx started at %s:\n",
- afs_cast_uint32(dynamics.host), bob);
+ afs_printable_uint32_lu(dynamics.host), bob);
#define print_stat(name) if (dynamics.name.requests) printf (" of %d requests for %s, %d were aborted.\n", dynamics.name.requests, # name, dynamics.name.aborts)
print_stat(Authenticate);
}
ka_timestr(info.startTime, bob, KA_TIMESTR_LEN);
printf("From host %lx started %sat %s:\n",
- afs_cast_uint32(info.host),
+ afs_printable_uint32_lu(info.host),
(info.noAuth ? "w/o authorization " : ""), bob);
ka_timestr(info.lastTrans, bob, KA_TIMESTR_LEN);
printf("Last trans was %s at %s\n", info.lastOperation, bob);
info.updatesRemaining);
if (info.cheader_lock || info.keycache_lock)
printf("locks: cheader %08lx, keycache %08lx\n",
- afs_cast_uint32(info.cheader_lock),
- afs_cast_uint32(info.keycache_lock));
+ afs_printable_uint32_lu(info.cheader_lock),
+ afs_printable_uint32_lu(info.keycache_lock));
printf("Last authentication for %s, last admin user was %s\n",
info.lastAuth, info.lastAdmin);
printf("Last TGS op was a %s ticket was for %s\n", info.lastTGSServer,
static int
MyBeforeProc(struct cmd_syndesc *as, void *arock)
{
- extern struct passwd *getpwuid();
struct ktc_encryptionKey key;
- struct ktc_principal auth_server, auth_token, client;
+ struct ktc_principal auth_server, client;
+ struct ktc_token auth_token;
char realm[MAXKTCREALMLEN];
struct ktc_token token, *pToken;
ka_GetAdminToken(name, instance, cell, &key, KA_SIXHOURS,
&token, 0 /* !new */ );
if (code == KABADREQUEST) {
- des_string_to_key(passwd, &key);
+ des_string_to_key(passwd, ktc_to_cblockptr(&key));
code =
ka_GetAdminToken(name, instance, cell, &key, KA_SIXHOURS,
&token, 0 /* !new */ );
/* These are some helpful command that deal with the cache managers tokens. */
-static
+static int
ForgetTicket(struct cmd_syndesc *as, void *arock)
{
afs_int32 code;
return 0;
}
-static
+static int
ListTickets(struct cmd_syndesc *as, void *arock)
{
afs_int32 code = 0;
return code;
}
if (server.cell[0] == 0) {
- if (code = DefaultCell())
+ if ((code = DefaultCell()))
return code;
strcpy(server.cell, cell);
} else {
strcpy(whoami, "kas");
- if (code = cmd_Dispatch(cmd_argc, cmd_argv)) {
+ if ((code = cmd_Dispatch(cmd_argc, cmd_argv))) {
return code;
}