From: Ezra Peisach Date: Fri, 30 Jun 2000 19:51:59 +0000 (+0000) Subject: * t_an_to_ln.c: Include for prototypes X-Git-Tag: krb5-1.3-alpha1~2055 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6ea92e4dddac9d2a2b5c52aeb17d9b831cabeb34;p=krb5.git * t_an_to_ln.c: Include for prototypes * locate_kdc.c (krb5_locate_srv_dns): Remove unused variable. * changepw.c, sendto_kdc.c, sn2princ.c: Add parentheses around assignment used as truth value. * ccdefname.c (get_from_os): Cast return from getuid() to long and indicate use of format in sprintf. gcc -Wall complaints. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12482 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/os/ChangeLog b/src/lib/krb5/os/ChangeLog index c9b4ba24f..89ae4715e 100644 --- a/src/lib/krb5/os/ChangeLog +++ b/src/lib/krb5/os/ChangeLog @@ -1,3 +1,15 @@ +2000-06-30 Ezra Peisach + + * t_an_to_ln.c: Include for prototypes. + + * locate_kdc.c (krb5_locate_srv_dns): Remove unused variable. + + * changepw.c, sendto_kdc.c, sn2princ.c: Add parentheses around + assignment used as truth value. + + * ccdefname.c (get_from_os): Cast return from getuid() to long and + indicate use of format in sprintf. + 2000-06-28 Ezra Peisach * def_realm.c: Add newline at end of file. diff --git a/src/lib/krb5/os/ccdefname.c b/src/lib/krb5/os/ccdefname.c index 6b00e5286..0c18a1e81 100644 --- a/src/lib/krb5/os/ccdefname.c +++ b/src/lib/krb5/os/ccdefname.c @@ -224,7 +224,7 @@ cleanup: #if !(defined(_MSDOS) || defined(_WIN32)) static krb5_error_code get_from_os(char *name_buf, int name_size) { - sprintf(name_buf, "FILE:/tmp/krb5cc_%d", getuid()); + sprintf(name_buf, "FILE:/tmp/krb5cc_%ld", (long) getuid()); return 0; } #endif diff --git a/src/lib/krb5/os/changepw.c b/src/lib/krb5/os/changepw.c index 575866e2a..74b33ff8f 100644 --- a/src/lib/krb5/os/changepw.c +++ b/src/lib/krb5/os/changepw.c @@ -141,13 +141,14 @@ krb5_change_password(context, creds, newpw, result_code, if ((code = krb5_auth_con_init(context, &auth_context))) goto cleanup; - if (code = krb5_mk_req_extended(context, &auth_context, AP_OPTS_USE_SUBKEY, - NULL, creds, &ap_req)) + if ((code = krb5_mk_req_extended(context, &auth_context, + AP_OPTS_USE_SUBKEY, + NULL, creds, &ap_req))) goto cleanup; - if (code = krb5_locate_kpasswd(context, + if ((code = krb5_locate_kpasswd(context, krb5_princ_realm(context, creds->client), - &addr_p, &naddr_p)) + &addr_p, &naddr_p))) goto cleanup; /* this is really obscure. s1 is used for all communications. it @@ -255,13 +256,15 @@ krb5_change_password(context, creds, newpw, result_code, specified. when rd_priv is called, *only* a remote address is specified. Are we having fun yet? */ - if (code = krb5_auth_con_setaddrs(context, auth_context, &local_kaddr, NULL)) + if ((code = krb5_auth_con_setaddrs(context, auth_context, + &local_kaddr, NULL))) { code = SOCKET_ERRNO; goto cleanup; } - if (code = krb5_mk_chpw_req(context, auth_context, &ap_req, newpw, &chpw_req)) + if ((code = krb5_mk_chpw_req(context, auth_context, &ap_req, + newpw, &chpw_req))) { code = SOCKET_ERRNO; goto cleanup; @@ -321,11 +324,13 @@ krb5_change_password(context, creds, newpw, result_code, chpw_rep.length = cc; - if (code = krb5_auth_con_setaddrs(context, auth_context, NULL, &remote_kaddr)) + if ((code = krb5_auth_con_setaddrs(context, auth_context, + NULL, &remote_kaddr))) goto cleanup; - if(code = krb5_rd_chpw_rep(context, auth_context, &chpw_rep, - &local_result_code, result_string)) + if ((code = krb5_rd_chpw_rep(context, auth_context, &chpw_rep, + &local_result_code, + result_string))) goto cleanup; if (result_code) @@ -333,8 +338,9 @@ krb5_change_password(context, creds, newpw, result_code, if (result_code_string) { - if (code = krb5_chpw_result_code_string(context, local_result_code, - &code_string)) + if ((code = krb5_chpw_result_code_string(context, + local_result_code, + &code_string))) goto cleanup; result_code_string->length = strlen(code_string); diff --git a/src/lib/krb5/os/locate_kdc.c b/src/lib/krb5/os/locate_kdc.c index cdadd0c25..75c4e95a4 100644 --- a/src/lib/krb5/os/locate_kdc.c +++ b/src/lib/krb5/os/locate_kdc.c @@ -339,7 +339,6 @@ krb5_locate_srv_dns(realm, service, protocol, addr_pp, naddrs) struct sockaddr **addr_pp; int *naddrs; { - krb5_error_code code; int out, j, count; union { unsigned char bytes[2048]; diff --git a/src/lib/krb5/os/sendto_kdc.c b/src/lib/krb5/os/sendto_kdc.c index 241ffbcbd..95c65ed30 100644 --- a/src/lib/krb5/os/sendto_kdc.c +++ b/src/lib/krb5/os/sendto_kdc.c @@ -81,7 +81,7 @@ krb5_sendto_kdc (context, message, realm, reply, use_master) * find KDC location(s) for realm */ - if (retval = krb5_locate_kdc(context, realm, &addr, &naddr, use_master)) + if ((retval = krb5_locate_kdc(context, realm, &addr, &naddr, use_master))) return retval; if (naddr == 0) return (use_master ? KRB5_KDC_UNREACH : KRB5_REALM_UNKNOWN); @@ -159,11 +159,11 @@ krb5_sendto_kdc (context, message, realm, reply, use_master) waitlen.tv_sec = timeout; FD_ZERO(&readable); FD_SET(socklist[host], &readable); - if (nready = select(SOCKET_NFDS(socklist[host]), - &readable, - 0, - 0, - &waitlen)) { + if ((nready = select(SOCKET_NFDS(socklist[host]), + &readable, + 0, + 0, + &waitlen))) { if (nready == SOCKET_ERROR) { if (SOCKET_ERRNO == SOCKET_EINTR) goto retry; diff --git a/src/lib/krb5/os/sn2princ.c b/src/lib/krb5/os/sn2princ.c index 896567953..0c48b5e2c 100644 --- a/src/lib/krb5/os/sn2princ.c +++ b/src/lib/krb5/os/sn2princ.c @@ -114,7 +114,7 @@ krb5_sname_to_principal(context, hostname, sname, type, ret_princ) } - if (retval = krb5_get_host_realm(context, remote_host, &hrealms)) { + if ((retval = krb5_get_host_realm(context, remote_host, &hrealms))) { free(remote_host); return retval; } diff --git a/src/lib/krb5/os/t_an_to_ln.c b/src/lib/krb5/os/t_an_to_ln.c index 39c640936..a1569e948 100644 --- a/src/lib/krb5/os/t_an_to_ln.c +++ b/src/lib/krb5/os/t_an_to_ln.c @@ -1,5 +1,7 @@ #include "krb5.h" +#include + int main(argc, argv) int argc;