[64] in Kerberos-V5-bugs

home help back first fref pref prev next nref lref last post

re: Const/non-const clashes in alpha2 drop.

daemon@ATHENA.MIT.EDU (daemon@ATHENA.MIT.EDU)
Tue Nov 27 11:30:58 1990

Date: Tue, 27 Nov 90 11:28:47 -0500
From: John T Kohl <jtkohl@ATHENA.MIT.EDU>
To: sommerfeld@apollo.com
Cc: krb5-testers@ATHENA.MIT.EDU
In-Reply-To: [63]

>Completed "encrypt_key.c" on apollo //ka10 (1f9a4)
>Build encrypt_key.c!25-Nov-1990.12:50:20

> (0055)     bcopy((char *)&in->length, (char *)out->contents, sizeof(out->length));

>******** Line 55: [Warning #279]  Illegal conversion from const * "length".

casting goof...length is a const, and bcopy takes a const 1st arg, but
the cast needs to be (const char *).  Fixed.

>Completed "enc_dec.c" on apollo //galen (1e1e9)
>Build enc_dec.c!25-Nov-1990.12:56:18
> (0074)     return (mit_des_cbc_encrypt((krb5_octet *)in,
>******** Line 74: [Warning #279]  Illegal conversion from const * "in".
>(0106)     p = (char *)in + sumsize - (4*sizeof(krb5_octet));
>******** Line 106: [Warning #279]  Illegal conversion from const * "in".
> (0107)     endinput = (char *)in + size;
>******** Line 107: [Warning #279]  Illegal conversion from const * "in".
> (0112)                   sum_func)((krb5_pointer) in,
>******** Line 112: [Warning #279]  Illegal conversion from const * "in".
> (0157)     return (mit_des_cbc_encrypt ((krb5_octet *)in,
>******** Line 157: [Warning #279]  Illegal conversion from const * "in".
>Completed "free_krbhs.c" on apollo //warp5 (1eca1)
>Build free_krbhs.c!25-Nov-1990.13:04:10
> (0036)     free((char *)hostlist);
>******** Line 36: [Warning #279]  Illegal conversion from const * "hostlist".
>Completed "free_rtree.c" on apollo //case2 (1ef83)
>Build free_rtree.c!25-Nov-1990.13:04:16
> (0031)     free((char *)(realms));
>******** Line 31: [Warning #279]  Illegal conversion from const * "realms".
>Completed "in_tkt_sky.c" on apollo //warp5 (1eca1)
>Build in_tkt_sky.c!25-Nov-1990.13:06:07
> (0132) 	arg.key = (krb5_keyblock *)key;
>******** Line 132: [Warning #279]  Illegal conversion from const * "key".
>Completed "in_tkt_pwd.c" on apollo //tossup (22936)
>Build in_tkt_pwd.c!25-Nov-1990.13:05:58
> (0050)     arg = (struct pwd_keyproc_arg *)keyseed;
>******** Line 50: [Warning #279]  Illegal conversion from const * "keyseed".
> (0116)     keyseed.password.data = (char *)password;
>******** Line 116: [Warning #279]  Illegal conversion from const * "password".
>Completed "get_in_tkt.c" on apollo //vigor (29ce5.114dd)
>Build get_in_tkt.c!25-Nov-1990.13:05:12
> (0114)     request.addresses = (krb5_address **) addrs;
>******** Line 114: [Warning #279]  Illegal conversion from const * "addrs".
>Completed "mk_req.c" on apollo //kurk (29ce5.21b4b)
>Build mk_req.c!25-Nov-1990.13:15:33
> (0058)     creds.server = (krb5_principal) server;
>******** Line 58: [Warning #279]  Illegal conversion from const * "server".
>Completed "process_ky.c" on apollo //scotty (29ce5.28975)
>Build process_ky.c!25-Nov-1990.13:17:01
> (0062) 	eblock->key = (krb5_keyblock *) keyblock;
>******** Line 62: [Warning #279]  Illegal conversion from const * "keyblock".
>Completed "send_tgs.c" on apollo //oh_baby (2401a)
>Build send_tgs.c!25-Nov-1990.13:19:21
> (0074)     tgsreq.server = (krb5_principal) sname;
>******** Line 74: [Warning #279]  Illegal conversion from const * "sname".
> (0085)     tgsreq.addresses = (krb5_address **) addrs;
>******** Line 85: [Warning #279]  Illegal conversion from const * "addrs".
> (0086)     tgsreq.authorization_data = (krb5_authdata **)authorization_data;
>******** Line 86: [Warning #279]  Illegal conversion from const * "authorization_data".

Those are all correct casts.  The input is indeed const, and its
pointed-to values won't be changed by this code, and the casts are there
to make our compiler shut up.  Can you make your compiler only complain
about implicit "illegal conversions" and not explicit ones?

>Completed "kuserok.c" on apollo //vigor (29ce5.114dd)
>Build kuserok.c!25-Nov-1990.13:14:30
> (0065)     if ((pwd = getpwnam(luser)) == 0) {
>******** Line 65: [Warning #279]  Illegal conversion from const * "luser".

getpwnam() has (should have) a prototype (on our systems at least)
specifying that it takes a const char * as its only argument; perhaps
your prototypes are in error?  [one of the declarations in our
fake-stdlib.h didn't have the "const" before; I have fixed that]

>Completed "princ_comp.c" on apollo //warp5 (1eca1)
>Build princ_comp.c!25-Nov-1990.13:16:44
> (0035)     for (p1 = princ1, p2 = princ2; *p1  && *p2; p1++, p2++)
>******** Line 35: [Warning #279]  Illegal conversion from const * "princ1".
>******** Line 35: [Warning #279]  Illegal conversion from const * "princ2".

a mis-ordered const and * pair; fixed.


>Completed "rd_req_dec.c" on apollo //scotty (29ce5.28975)
>Build rd_req_dec.c!25-Nov-1990.13:18:29
> (0094) 	    retval = krb5_kt_resolve((char *)fetchfrom, &keytabid);
>******** Line 94: [Warning #279]  Illegal conversion from const * "fetchfrom".

the first argument should really be const char *; krb5_kt_resolve will
be fixed, and the cast removed.

Thanks,

John

home help back first fref pref prev next nref lref last post