/*
- * $source: /afs/athena.mit.edu/astaff/project/krb5/src/admin/edit/rcs/dump.c,v $
- * $author: tytso $
+ * $Source$
+ * $Author$
*
- * copyright 1990 by the massachusetts institute of technology.
+ * Copyright 1990,1991 by the Massachusetts Institute of Technology.
+ * All Rights Reserved.
*
- * for copying and distribution information, please see the file
+ * For copying and distribution information, please see the file
* <krb5/copyright.h>.
*
- * dump a kdc database
+ * Dump a KDC database
*/
-#if !defined(lint) && !defined(saber)
+#if !defined(lint) && !defined(SABER)
static char rcsid_kdb_edit_c[] =
-"$id: dump.c,v 1.6 91/01/15 18:25:41 tytso exp locker: tytso $";
+"$Id$";
#endif /* !lint & !saber */
-#include <krb5/copyright.h>
#include <krb5/krb5.h>
#include <krb5/kdb.h>
#include <krb5/kdb_dbm.h>
#include <krb5/libos-proto.h>
#include <krb5/asn1.h>
#include <krb5/config.h>
-#include <krb5/sysincl.h> /* for maxpathlen */
+#include <krb5/sysincl.h> /* for MAXPATHLEN */
#include <krb5/ext-proto.h>
#include <krb5/func-proto.h>
cleanup:
free(name);
free(mod_name);
- free((char *)entry.key.contents);
+ xfree(entry.key.contents);
}
if (retval = krb5_db_fini()) {
com_err(argv[0], retval,
* $Source$
* $Author$
*
- * Copyright 1990 by the Massachusetts Institute of Technology.
+ * Copyright 1990,1991 by the Massachusetts Institute of Technology.
*
* For copying and distribution information, please see the file
* <krb5/copyright.h>.
"$Id$";
#endif /* !lint & !SABER */
-#include <krb5/copyright.h>
#include <krb5/krb5.h>
#include <krb5/kdb.h>
#include <krb5/kdb_dbm.h>
if (retval = krb5_timeofday(&newentry.mod_date)) {
com_err(argv[0], retval, "while fetching date");
memset((char *)newentry.key.contents, 0, newentry.key.length);
- free((char *)newentry.key.contents);
+ xfree(newentry.key.contents);
return;
}
newentry.attributes = mblock.flags;
retval = krb5_db_put_principal(&newentry, &one);
memset((char *)newentry.key.contents, 0, newentry.key.length);
- free((char *)newentry.key.contents);
+ xfree(newentry.key.contents);
if (retval) {
com_err(argv[0], retval, "while storing entry for '%s'\n", argv[1]);
return;
&master_random);
memset((char *)master_keyblock.contents, 0,
master_keyblock.length);
- free((char *) master_keyblock.contents);
+ xfree(master_keyblock.contents);
master_keyblock.contents = NULL;
}
krb5_free_principal(master_princ);
&master_encblock)) {
com_err(pname, retval, "while verifying master key");
memset((char *)master_keyblock.contents, 0, master_keyblock.length);
- free((char *)master_keyblock.contents);
+ xfree(master_keyblock.contents);
valid_master_key = 0;
dbactive = TRUE;
return(1);
&master_keyblock)) {
com_err(pname, retval, "while processing master key");
memset((char *)master_keyblock.contents, 0, master_keyblock.length);
- free((char *)master_keyblock.contents);
+ xfree(master_keyblock.contents);
valid_master_key = 0;
dbactive = TRUE;
return(1);
com_err(pname, retval, "while initializing random key generator");
(void) krb5_finish_key(&master_encblock);
memset((char *)master_keyblock.contents, 0, master_keyblock.length);
- free((char *)master_keyblock.contents);
+ xfree(master_keyblock.contents);
valid_master_key = 0;
dbactive = TRUE;
return(1);
printf("'%s' added to keytab '%s'\n",
pname, ktname);
memset((char *)newentry.key.contents, 0, newentry.key.length);
- free((char *)newentry.key.contents);
+ xfree(newentry.key.contents);
cleanall:
krb5_db_free_principal(&dbentry, nentries);
cleanmost:
if (key.keytype != 1) {
com_err(argv[0], 0, "%s does not have a DES key!", pname);
memset((char *)key.contents, 0, key.length);
- free((char *)key.contents);
+ xfree(key.contents);
continue;
}
fwrite(argv[i], strlen(argv[1]) + 1, 1, fout); /* p.name */
fwrite((char *)key.contents, 8, 1, fout);
printf("'%s' added to V4 srvtab '%s'\n", pname, ktname);
memset((char *)key.contents, 0, key.length);
- free((char *)key.contents);
+ xfree(key.contents);
cleanall:
krb5_db_free_principal(&dbentry, nentries);
cleanmost:
add_key(argv, princ, &tempkey, ++vno, &salt);
xfree(salt.saltdata.data);
memset((char *)tempkey.contents, 0, tempkey.length);
- free((char *)tempkey.contents);
+ xfree(tempkey.contents);
return;
}
* $Source$
* $Author$
*
- * Copyright 1990 by the Massachusetts Institute of Technology.
+ * Copyright 1990,1991 by the Massachusetts Institute of Technology.
+ * All Rights Reserved.
*
* For copying and distribution information, please see the file
* <krb5/copyright.h>.
"$Id$";
#endif /* !lint & !SABER */
-#include <krb5/copyright.h>
-
#include <krb5/krb5.h>
#include <krb5/kdb.h>
#include <krb5/libos-proto.h>
krb5_db_free_principal(&server, 1); \
memset((char *)session_key->contents, 0, \
session_key->length); \
- free((char *)session_key->contents); \
+ xfree(session_key->contents); \
session_key->contents = 0; }
}
retval = krb5_encrypt_tkt_part(&encrypting_key, &ticket_reply);
memset((char *)encrypting_key.contents, 0, encrypting_key.length);
- free((char *)encrypting_key.contents);
+ xfree(encrypting_key.contents);
if (retval) {
cleanup();
return retval;
#define cleanup() {krb5_db_free_principal(&client, 1); \
memset((char *)session_key->contents, 0, \
session_key->length); \
- free((char *)session_key->contents); \
+ xfree(session_key->contents); \
session_key->contents = 0; \
memset(ticket_reply.enc_part.ciphertext.data, 0, \
ticket_reply.enc_part.ciphertext.length); \
#define cleanup() {krb5_db_free_principal(&client, 1); \
memset((char *)session_key->contents, 0, \
session_key->length); \
- free((char *)session_key->contents); \
+ xfree(session_key->contents); \
session_key->contents = 0; \
memset(ticket_reply.enc_part.ciphertext.data, 0, \
ticket_reply.enc_part.ciphertext.length); \
retval = krb5_encode_kdc_rep(KRB5_AS_REP, &reply_encpart,
&encrypting_key, &reply, response);
memset((char *)encrypting_key.contents, 0, encrypting_key.length);
- free((char *)encrypting_key.contents);
+ xfree(encrypting_key.contents);
cleanup();
return retval;
}
"$Id$";
#endif /* !lint & !SABER */
-#include <krb5/copyright.h>
-
#include <krb5/krb5.h>
#include <krb5/kdb.h>
#include <krb5/libos-proto.h>
#define cleanup() { krb5_db_free_principal(&server, 1); \
memset((char *)session_key->contents, 0, \
session_key->length); \
- free((char *)session_key->contents); \
+ xfree(session_key->contents); \
session_key->contents = 0; }
ticket_reply.server = request->server; /* XXX careful for realm... */
#define cleanup() { krb5_db_free_principal(&server, 1); \
memset((char *)session_key->contents, 0, \
session_key->length); \
- free((char *)session_key->contents); \
+ xfree(session_key->contents); \
session_key->contents = 0; \
if (newtransited) free(enc_tkt_reply.transited.tr_contents.data);}
retval = krb5_encrypt_tkt_part(&encrypting_key, &ticket_reply);
memset((char *)encrypting_key.contents, 0, encrypting_key.length);
- free((char *)encrypting_key.contents);
+ xfree(encrypting_key.contents);
if (retval) {
tkt_cleanup();
header_ticket->enc_part2->session,
&reply, response);
memset((char *)session_key->contents, 0, session_key->length);
- free((char *)session_key->contents);
+ xfree(session_key->contents);
tkt_cleanup();
session_key->contents = 0;
return retval;
* $Author$
*
* Copyright 1990,1991 by the Massachusetts Institute of Technology.
+ * All Rights Reserved.
*
* For copying and distribution information, please see the file
* <krb5/copyright.h>.
"$Id$";
#endif /* !lint & !SABER */
-#include <krb5/copyright.h>
#include <krb5/krb5.h>
#include <krb5/kdb.h>
#include <krb5/asn1.h>
if (freeprinc) {
krb5_db_free_principal(&server, nprincs);
memset((char *)encrypting_key.contents, 0, encrypting_key.length);
- free((char *)encrypting_key.contents);
+ xfree(encrypting_key.contents);
}
if (retval) {
cleanup_apreq();
* $Source$
* $Author$
*
- * Copyright 1990 by the Massachusetts Institute of Technology.
+ * Copyright 1990,1991 by the Massachusetts Institute of Technology.
+ * All Rights Reserved.
*
* For copying and distribution information, please see the file
* <krb5/copyright.h>.
"$Id$";
#endif /* !lint & !SABER */
-#include <krb5/copyright.h>
#include <krb5/krb5.h>
#include <krb5/mit-des.h>
#include <krb5/ext-proto.h>
OLDDECLARG(krb5_pointer *, seed)
{
memset((char *)*seed, 0, sizeof(mit_des_random_key_seed) );
- free((char *)*seed);
+ xfree(*seed);
*seed = 0;
return 0; /* XXX init_random_key */
}
* $Source$
* $Author$
*
- * Copyright 1990 by the Massachusetts Institute of Technology.
+ * Copyright 1990,1991 by the Massachusetts Institute of Technology.
+ * All Rights Reserved.
*
* For copying and distribution information, please see the file
* <krb5/copyright.h>.
"$Id$";
#endif /* !lint & !SABER */
-#include <krb5/copyright.h>
-
#include <krb5/krb5.h>
#include <krb5/ext-proto.h>
if (!(randkey = (krb5_keyblock *)malloc(sizeof(*randkey))))
return ENOMEM;
if (!(randkey->contents = (krb5_octet *)malloc(sizeof(mit_des_cblock)))) {
- free((char *)randkey);
+ xfree(randkey);
return ENOMEM;
}
randkey->length = sizeof(mit_des_cblock);
* $Source$
* $Author$
*
- * Copyright 1990 by the Massachusetts Institute of Technology.
+ * Copyright 1990,1991 by the Massachusetts Institute of Technology.
+ * All Rights Reserved.
*
* For copying and distribution information, please see the file
* <krb5/copyright.h>.
"$Id$";
#endif /* !lint & !SABER */
-#include <krb5/copyright.h>
-
#include <krb5/krb5.h>
#include <krb5/ext-proto.h>
return(ENOMEM);
#define cleanup() {memset(keyblock->contents, 0, sizeof(mit_des_cblock));\
- (void) free((char *) keyblock->contents);}
+ xfree(keyblock->contents);}
keyblock->keytype = KEYTYPE_DES;
keyblock->length = sizeof(mit_des_cblock);
* $Source$
* $Author$
*
- * Copyright 1990 by the Massachusetts Institute of Technology.
+ * Copyright 1990,1991 by the Massachusetts Institute of Technology.
+ * All Rights Reserved.
*
* For copying and distribution information, please see the file
* <krb5/copyright.h>.
"$Id$";
#endif /* !lint & !SABER */
-#include <krb5/copyright.h>
#include <krb5/krb5.h>
#include <krb5/ext-proto.h>
#include <krb5/kdb.h>
sizeof(in->length)),
(krb5_pointer) out->contents,
in->length-sizeof(in->length), eblock, 0)) {
- free((char *)out->contents);
+ xfree(out->contents);
out->contents = 0;
out->length = 0;
return retval;
}
if (out->length < 0) {
- free((char *)out->contents);
+ xfree(out->contents);
out->contents = 0;
out->length = 0;
return KRB5_KDB_INVALIDKEYSIZE;
* $Source$
* $Author$
*
- * Copyright 1990 by the Massachusetts Institute of Technology.
+ * Copyright 1990,1991 by the Massachusetts Institute of Technology.
+ * All Rights Reserved.
*
* For copying and distribution information, please see the file
* <krb5/copyright.h>.
"$Id$";
#endif /* !lint & !SABER */
-#include <krb5/copyright.h>
#include <krb5/krb5.h>
#include <krb5/ext-proto.h>
#include <krb5/kdb.h>
out->length += sizeof(out->length);
out->contents = (krb5_octet *)malloc(out->length);
if (!out->contents) {
- free((char *)tmpin.contents);
+ xfree(tmpin.contents);
out->contents = 0;
out->length = 0;
return ENOMEM;
(krb5_pointer) (((char *) out->contents) +
sizeof(out->length)),
tmpin.length, eblock, 0);
- free((char *)tmpin.contents);
+ xfree(tmpin.contents);
if (retval) {
- free((char *)out->contents);
+ xfree(out->contents);
out->contents = 0;
out->length = 0;
}
* $Source$
* $Author$
*
- * Copyright 1988,1989,1990 by the Massachusetts Institute of Technology.
+ * Copyright 1988,1989,1990,1991 by the Massachusetts Institute of Technology.
+ * All Rights Reserved.
*
* For copying and distribution information, please see the file
* <krb5/copyright.h>.
"$Id$";
#endif /* lint */
-#include <krb5/copyright.h>
#include <krb5/krb5.h>
#include <krb5/dbm.h>
#include <krb5/kdb.h>
if (keysize != entry->key.length) {
krb5_free_principal(princ);
krb5_free_principal(mod_princ);
- free((char *)entry->key.contents);
+ xfree(entry->key.contents);
(void) memset((char *) entry, 0, sizeof(*entry));
return KRB5_KDB_TRUNCATED_RECORD;
}
if (!(entry->salt = (krb5_octet *)malloc(entry->salt_length))) {
krb5_free_principal(princ);
krb5_free_principal(mod_princ);
- free((char *)entry->key.contents);
+ xfree(entry->key.contents);
(void) memset((char *) entry, 0, sizeof(*entry));
return KRB5_KDB_TRUNCATED_RECORD;
}
{
/* erase the key */
memset((char *)entry->key.contents, 0, entry->key.length);
- free((char *)entry->key.contents);
+ xfree(entry->key.contents);
if (entry->salt_length)
- free((char *)entry->salt);
+ xfree(entry->salt);
krb5_free_principal(entry->principal);
krb5_free_principal(entry->mod_name);
* $Source$
* $Author$
*
- * Copyright 1990 by the Massachusetts Institute of Technology.
+ * Copyright 1990,1991 by the Massachusetts Institute of Technology.
+ * All Rights Reserved.
*
* For copying and distribution information, please see the file
* <krb5/copyright.h>.
"$Id$";
#endif /* lint || saber */
-#include <krb5/copyright.h>
#include <isode/psap.h>
#include <krb5/krb5.h>
#include <krb5/asn1.h>
alldatout:
free((*data_out)->data);
datout:
- free((char *)*data_out);
+ xfree(*data_out);
*data_out = 0;
peout:
pe_free(pe);
* $Author$
*
* Copyright 1990,1991 by the Massachusetts Institute of Technology.
+ * All Rights Reserved.
*
* For copying and distribution information, please see the file
* <krb5/copyright.h>.
static char rcsid_fcc_sseq_c[] = "$Id$";
#endif /* !lint && !SABER */
-#include <krb5/copyright.h>
-
#include "fcc.h"
/*
if (OPENCLOSE(id)) {
ret = krb5_fcc_open_file(id, FCC_OPEN_RDONLY);
if (ret) {
- free((char *)fcursor);
+ xfree(fcursor);
return ret;
}
}
* $Source$
* $Author$
*
- * Copyright 1990 by the Massachusetts Institute of Technology.
+ * Copyright 1990,1991 by the Massachusetts Institute of Technology.
+ * All Rights Reserved.
*
* For copying and distribution information, please see the file
* <krb5/copyright.h>.
"$Id$";
#endif /* !lint & !SABER */
-#include <krb5/copyright.h>
#include <krb5/krb5.h>
#include <krb5/ext-proto.h>
*tempdata = *indata;
if (!(tempdata->data = malloc(tempdata->length))) {
- free((char *)tempdata);
+ xfree(tempdata);
return ENOMEM;
}
memcpy((char *)tempdata->data, (char *)indata->data, tempdata->length);