+Tue Apr 30 18:19:01 1996 Ken Raeburn <raeburn@cygnus.com>
+
+ * t_ser.c (stuff): New variable.
+ (ser_acontext_test, ser_eblock_test, ser_cksum_test): Use it,
+ instead of assuming it's valid to treat &FUNCTION as a data
+ pointer.
+
+ * conv_princ.c (sconv_list): Now const.
+ (krb5_*_conv_principal): Use pointer to const for it.
+
+ Tue Apr 23 19:39:59 1996 Mark Eichin <eichin@cygnus.com>
+
+ * get_creds.c (krb5_get_credentials): this isn't the kernel, so
+ don't return negative errno values.
+
Sat Apr 27 19:14:21 1996 Richard Basch <basch@lehman.com>
* fwd_tgt.c (krb5_fwd_tgt_creds): fixed a possible null dereference.
* kadmin/REALM.NAME. It should be kadmin/kerberos.master.host, but
* we'll fix that in the next release.
*/
-static struct krb_convert sconv_list[] = {
+static const struct krb_convert sconv_list[] = {
{"kadmin", "kadmin", 0},
{"rcmd", "host", DO_REALM_CONVERSION},
{"discuss", "discuss", DO_REALM_CONVERSION},
char *inst;
char *realm;
{
- struct krb_convert *p;
+ const struct krb_convert *p;
krb5_data *compo;
char *c;
const char *realm;
krb5_principal *princ;
{
- struct krb_convert *p;
+ const struct krb_convert *p;
char buf[256]; /* V4 instances are limited to 40 characters */
krb5_error_code retval;
char *domain, *cp;
krb5_flags fields;
if (!in_creds || !in_creds->server || !in_creds->client)
- return -EINVAL;
+ return EINVAL;
memset((char *)&mcreds, 0, sizeof(krb5_creds));
mcreds.magic = KV5M_CREDS;
}
if ((ncreds = (krb5_creds *)malloc(sizeof(krb5_creds))) == NULL)
- return -ENOMEM;
+ return ENOMEM;
memset((char *)ncreds, 0, sizeof(krb5_creds));
ncreds->magic = KV5M_CREDS;
#include "k5-int.h"
#include "auth_con.h"
+static const char stuff[]="You can't take a pointer to a function and convert \
+it to a pointer to char; ANSI doesn't say it'll work, and in fact on the HPPA \
+you can lose some bits of the function pointer, and get a pointer that you \
+can't safely dereference. This test file used to make this mistake, often.";
+
/*
* Dump an external representation.
*/
adataent.magic = KV5M_AUTHDATA;
adataent.ad_type = 123;
adataent.length = 128;
- adataent.contents = (krb5_octet *) ser_acontext_test;
+ adataent.contents = (krb5_octet *) stuff;
adatalist[0] = &adataent;
adatalist[1] = &adataent;
adatalist[2] = (krb5_authdata *) NULL;
krb5_use_enctype(kcontext, &eblock, DEFAULT_KDC_ENCTYPE);
if (!(kret = ser_data(verbose, "> NULL eblock",
(krb5_pointer) &eblock, KV5M_ENCRYPT_BLOCK))) {
- eblock.priv = (krb5_pointer) ser_eblock_test;
+ eblock.priv = (krb5_pointer) stuff;
eblock.priv_size = 8;
if (!(kret = ser_data(verbose, "> eblock with private data",
(krb5_pointer) &eblock,
checksum.checksum_type = 123;
checksum.length = sizeof(ckdata);
checksum.contents = ckdata;
-#if 0
- memcpy(ckdata, (char *) &ser_cksum_test, sizeof(ckdata));
-#else
- memcpy(ckdata, (char *) &ser_princ_test, sizeof(ckdata));
-#endif
+ memcpy(ckdata, (char *) &stuff, sizeof(ckdata));
if (!(kret = ser_data(verbose, "> checksum with data",
(krb5_pointer) &checksum, KV5M_CHECKSUM))) {
if (verbose)