* kdc_util.c (add_to_transited): Add braces to provide unambiguous
authorEzra Peisach <epeisach@mit.edu>
Mon, 4 Jun 2001 16:04:03 +0000 (16:04 +0000)
committerEzra Peisach <epeisach@mit.edu>
Mon, 4 Jun 2001 16:04:03 +0000 (16:04 +0000)
if - if - else statements.

* kdc_preauth.c (verify_sam_response): Cleanup assignments in
conditionals.
* main.c (main): Likewise.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13265 dc483132-0cff-0310-8789-dd5450dbe970

src/kdc/ChangeLog
src/kdc/kdc_preauth.c
src/kdc/kdc_util.c
src/kdc/main.c

index e9dc7149dd649b8cd58156868268e0dc846466cd..595c844445b4924dbfacd68174a2910f9e4ca8ce 100644 (file)
@@ -1,3 +1,12 @@
+2001-06-04  Ezra Peisach  <epeisach@mit.edu>
+
+       * kdc_util.c (add_to_transited): Add braces to provide unambiguous
+       if - if - else statements. 
+
+       * kdc_preauth.c (verify_sam_response): Cleanup assignments in
+       conditionals.
+       * main.c (main): Likewise. 
+
 2001-04-26  Ken Raeburn  <raeburn@mit.edu>
 
        * configure.in: Don't use HAS_ANSI_VOLATILE.
index 9721a2ceacdb7910831ae028fd72ab022eedbc4c..b073e786df02993dcdd2d5be9fc1c9544be73516 100644 (file)
@@ -1284,7 +1284,8 @@ verify_sam_response(context, client, request, enc_tkt_reply, pa)
        rep.server = "SAM/rc";  /* Should not match any principal name. */
        rep.ctime = psr->stime;
        rep.cusec = psr->susec;
-       if (retval = krb5_rc_store(kdc_context, kdc_rcache, &rep)) {
+       retval = krb5_rc_store(kdc_context, kdc_rcache, &rep);
+       if (retval) {
            com_err("krb5kdc", retval, "SAM psr replay attack!");
            goto cleanup;
        }
index 3660ff552870cf843bc7851d9d07a24851abe063..6d25764ecdf74d9d059df305b126aec71eff1bc0 100644 (file)
@@ -213,8 +213,8 @@ kdc_process_tgs_req(request, from, pkt, ticket, subkey)
     krb5_auth_context    auth_context = NULL;
     krb5_authenticator * authenticator = NULL;
     krb5_checksum      * his_cksum = NULL;
-    krb5_keyblock      * key = NULL;
-    krb5_kvno            kvno = 0;
+/*    krb5_keyblock    * key = NULL;*/
+/*    krb5_kvno                  kvno = 0;*/
 
     if (!request->padata)
        return KRB5KDC_ERR_PADATA_TYPE_NOSUPP;
@@ -401,7 +401,6 @@ kdc_get_server_key(ticket, key, kvno)
     krb5_boolean         more;
     int        nprincs;
     krb5_key_data      * server_key;
-    int                          i;
 
     nprincs = 1;
 
@@ -629,20 +628,21 @@ add_to_transited(tgt_trans, new_trans, tgs, client, server)
 
   /* read field into current */
   for (i = 0; *otrans != '\0';) {
-    if (*otrans == '\\')
-      if (*(++otrans) == '\0')
-       break;
-      else
-       continue;
-    if (*otrans == ',') {
-      otrans++;
-      break;
-    }
-    current[i++] = *otrans++;
-    if (i >= MAX_REALM_LN) {
-      retval = KRB5KRB_AP_ERR_ILL_CR_TKT;
-      goto fail;
-    }
+      if (*otrans == '\\') {
+         if (*(++otrans) == '\0')
+             break;
+         else
+             continue;
+      }
+      if (*otrans == ',') {
+         otrans++;
+         break;
+      }
+      current[i++] = *otrans++;
+      if (i >= MAX_REALM_LN) {
+         retval = KRB5KRB_AP_ERR_ILL_CR_TKT;
+         goto fail;
+      }
   }
   current[i] = '\0';
 
@@ -685,20 +685,21 @@ add_to_transited(tgt_trans, new_trans, tgs, client, server)
 
     /* read field into next */
     for (i = 0; *otrans != '\0';) {
-      if (*otrans == '\\')
-       if (*(++otrans) == '\0')
-         break;
-       else
-         continue;
-      if (*otrans == ',') {
-       otrans++;
-       break;
-      }
-      next[i++] = *otrans++;
-      if (i >= MAX_REALM_LN) {
-       retval = KRB5KRB_AP_ERR_ILL_CR_TKT;
-       goto fail;
-      }
+       if (*otrans == '\\') {
+           if (*(++otrans) == '\0')
+               break;
+           else
+               continue;
+       }
+       if (*otrans == ',') {
+           otrans++;
+           break;
+       }
+       next[i++] = *otrans++;
+       if (i >= MAX_REALM_LN) {
+           retval = KRB5KRB_AP_ERR_ILL_CR_TKT;
+           goto fail;
+       }
     }
     next[i] = '\0';
     nlst = i - 1;
@@ -1450,7 +1451,6 @@ select_session_keytype(context, server, nktypes, ktype)
     krb5_enctype       *ktype;
 {
     int                i;
-    krb5_enctype dfl = 0;
     
     for (i = 0; i < nktypes; i++) {
        if (!valid_enctype(ktype[i]))
index fdaec3562521f0a4ddf159827d17436ccf3ea3e5..2de048413f1ea0f92b857c48a9a0aab2206d11f3 100644 (file)
@@ -808,7 +808,8 @@ int main(argc, argv)
 
     setup_signal_handlers();
 
-    if (retval = setup_sam()) {
+    retval = setup_sam();
+    if (retval) {
        com_err(argv[0], retval, "while initializing SAM");
        finish_realms(argv[0]);
        return 1;