* t_an_to_ln.c: Include <stdio.h> for prototypes
authorEzra Peisach <epeisach@mit.edu>
Fri, 30 Jun 2000 19:51:59 +0000 (19:51 +0000)
committerEzra Peisach <epeisach@mit.edu>
Fri, 30 Jun 2000 19:51:59 +0000 (19:51 +0000)
* 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

src/lib/krb5/os/ChangeLog
src/lib/krb5/os/ccdefname.c
src/lib/krb5/os/changepw.c
src/lib/krb5/os/locate_kdc.c
src/lib/krb5/os/sendto_kdc.c
src/lib/krb5/os/sn2princ.c
src/lib/krb5/os/t_an_to_ln.c

index c9b4ba24fbab76ff1f1e43311d5b2eaf0a8cc38d..89ae4715efa4c085e9d64c03e1be03c4cd5cfad2 100644 (file)
@@ -1,3 +1,15 @@
+2000-06-30  Ezra Peisach  <epeisach@mit.edu>
+
+       * t_an_to_ln.c: Include <stdio.h> 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  <epeisach@mit.edu>
 
        * def_realm.c: Add newline at end of file.
index 6b00e5286eae93e890146e53c15ee346e5aba651..0c18a1e819bc3d0dd14bbabc5a46d3bfc5489bfc 100644 (file)
@@ -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
index 575866e2afb2266377ac429329745cba69383f96..74b33ff8f201a12707315398fa815c56a7fde70c 100644 (file)
@@ -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);
index cdadd0c250aacdba7447dd0daefb6b85429fc6c9..75c4e95a4b7b687718748d09ac3aff038bfb096d 100644 (file)
@@ -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];
index 241ffbcbda1f0b4cf5dfcc2ac32ddf95ff89d656..95c65ed307d25cd1bfa2f7e54caf3a2b5a21d012 100644 (file)
@@ -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;
index 896567953a15218059b62923b2655b9f30750275..0c48b5e2c035fa1bcb1d33907e6d2b0ecb009bb3 100644 (file)
@@ -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;
        }
index 39c640936bd8eb0aa6291afab0f29ad59bc6963f..a1569e948a933da46619f184cca1517d2d9d777e 100644 (file)
@@ -1,5 +1,7 @@
 #include "krb5.h"
 
+#include <stdio.h>
+
 int
 main(argc, argv)
     int                argc;