From fd5d884f98089e608174f63199ea04acda4d77be Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Sat, 5 Aug 1995 03:49:57 +0000 Subject: [PATCH] first pass attempt at cleaning up some gcc -Wall flames (see ChangeLogs for gory details) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6424 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/kdb/ChangeLog | 20 +++++++++++ src/lib/kdb/decrypt_key.c | 8 ++--- src/lib/kdb/encrypt_key.c | 5 +-- src/lib/kdb/fetch_mkey.c | 8 ++--- src/lib/kdb/kdb_dbm.c | 50 +++++++++++++++------------ src/lib/kdb/kdb_xdr.c | 20 +++++------ src/lib/kdb/setup_mkey.c | 2 +- src/lib/kdb/verify_mky.c | 11 +++--- src/lib/krb5/keytab/ChangeLog | 8 +++++ src/lib/krb5/keytab/file/ChangeLog | 13 +++++++ src/lib/krb5/keytab/file/ktf_add.c | 2 +- src/lib/krb5/keytab/file/ktf_g_ent.c | 4 +-- src/lib/krb5/keytab/file/ktf_next.c | 2 +- src/lib/krb5/keytab/file/ktf_remove.c | 7 ++-- src/lib/krb5/keytab/file/ktf_ssget.c | 2 +- src/lib/krb5/keytab/file/ktf_util.c | 6 ++-- src/lib/krb5/keytab/ktdefault.c | 2 +- src/lib/krb5/keytab/read_servi.c | 2 +- src/lib/krb5/krb/ChangeLog | 3 ++ src/lib/krb5/krb/conv_princ.c | 20 +++++------ src/lib/krb5/os/ChangeLog | 10 ++++++ src/lib/krb5/os/an_to_ln.c | 9 ++--- src/lib/krb5/os/genaddrs.c | 4 +-- src/lib/krb5/os/kuserok.c | 2 +- src/lib/krb5/rcache/ChangeLog | 10 ++++++ src/lib/krb5/rcache/rc_base.c | 16 ++++----- src/lib/krb5/rcache/rc_conv.c | 5 +-- src/lib/krb5/rcache/rc_dfl.c | 11 +++--- src/lib/krb5/rcache/rc_io.c | 3 +- 29 files changed, 171 insertions(+), 94 deletions(-) diff --git a/src/lib/kdb/ChangeLog b/src/lib/kdb/ChangeLog index 96208547e..9b4889afa 100644 --- a/src/lib/kdb/ChangeLog +++ b/src/lib/kdb/ChangeLog @@ -1,3 +1,23 @@ +Fri Aug 4 23:26:22 1995 Tom Yu + + * setup_mkey.c (krb5_db_setup_mkey_name): Add parens to shut up + gcc -Wall + + * fetch_mkey.c (krb5_db_fetch_mkey): Add parens to shut up gcc + -Wall + + * verify_mky.c (krb5_db_verify_master_key): Add parens to shut up + gcc -Wall + + * kdb_xdr.c: Add parens to shut up gcc -Wall + + * kdb_dbm.c: Add parens to shut up gcc -Wall + + * decrypt_key.c (krb5_dbekd_decrypt_key_data): Add parens to shut + up gcc -Wall + + * encrypt_key.c (krb5_dbekd_encrypt_key_data): Add parens to shut + up gcc -Wall Fri Aug 4 16:22:46 EDT 1995 Paul Park (pjpark@mit.edu) * kdb_xdr,{de,en}crypt_key.c - Use encode/decode macros to [de]serialize diff --git a/src/lib/kdb/decrypt_key.c b/src/lib/kdb/decrypt_key.c index f705387fa..25855162b 100644 --- a/src/lib/kdb/decrypt_key.c +++ b/src/lib/kdb/decrypt_key.c @@ -56,10 +56,10 @@ krb5_dbekd_decrypt_key_data(context, eblock, key_data, keyblock, keysalt) ptr = key_data->key_data_contents[0]; krb5_kdb_decode_int16(ptr, keyblock->length); ptr += 2; - if (retval = krb5_decrypt(context, (krb5_pointer) ptr, - (krb5_pointer)keyblock->contents, - key_data->key_data_length[0] - 2, - eblock, 0)) { + if ((retval = krb5_decrypt(context, (krb5_pointer) ptr, + (krb5_pointer)keyblock->contents, + key_data->key_data_length[0] - 2, + eblock, 0))) { krb5_xfree(keyblock->contents); return retval; } diff --git a/src/lib/kdb/encrypt_key.c b/src/lib/kdb/encrypt_key.c index 132891a56..bc2b0cb2d 100644 --- a/src/lib/kdb/encrypt_key.c +++ b/src/lib/kdb/encrypt_key.c @@ -81,8 +81,9 @@ krb5_dbekd_encrypt_key_data(context, eblock, keyblock, keysalt, keyver,key_data) krb5_kdb_encode_int16(len, ptr); ptr += 2; - if (retval = krb5_encrypt(context, (krb5_pointer) tmp.contents, - (krb5_pointer)(ptr), tmp.length, eblock, 0)) { + if ((retval = krb5_encrypt(context, (krb5_pointer) tmp.contents, + (krb5_pointer)(ptr), tmp.length, + eblock, 0))) { krb5_xfree(key_data->key_data_contents[0]); krb5_xfree(tmp.contents); return retval; diff --git a/src/lib/kdb/fetch_mkey.c b/src/lib/kdb/fetch_mkey.c index 2ef352651..1e1293f2b 100644 --- a/src/lib/kdb/fetch_mkey.c +++ b/src/lib/kdb/fetch_mkey.c @@ -71,10 +71,10 @@ krb5_db_fetch_mkey(context, mname, eblock, fromkeyboard, twice, keyfile, salt, k if (fromkeyboard) { krb5_data scratch; - if (retval = krb5_read_password(context, krb5_mkey_pwd_prompt1, - twice ? krb5_mkey_pwd_prompt2 : 0, - password, - &size)) + if ((retval = krb5_read_password(context, krb5_mkey_pwd_prompt1, + twice ? krb5_mkey_pwd_prompt2 : 0, + password, + &size))) return(retval); pwd.data = password; diff --git a/src/lib/kdb/kdb_dbm.c b/src/lib/kdb/kdb_dbm.c index 9cb02a36e..8a3ecc9db 100644 --- a/src/lib/kdb/kdb_dbm.c +++ b/src/lib/kdb/kdb_dbm.c @@ -370,7 +370,7 @@ krb5_dbm_db_init(context) /* * Check for presence of our context, if not present, allocate one. */ - if (kret = k5dbm_init_context(context)) + if ((kret = k5dbm_init_context(context))) return(kret); db_ctx = context->db_context; @@ -498,7 +498,7 @@ krb5_dbm_db_set_name(context, name) /* * Check for presence of our context, if not present, allocate one. */ - if (kret = k5dbm_init_context(context)) + if ((kret = k5dbm_init_context(context))) return(kret); db_ctx = context->db_context; if (name == NULL) @@ -655,7 +655,7 @@ krb5_dbm_db_end_read(context, age) time_t age2; krb5_error_code retval; - if (retval = krb5_dbm_db_get_age(context, NULL, &age2)) + if ((retval = krb5_dbm_db_get_age(context, NULL, &age2))) return retval; if (age2 != age || age == -1) { return KRB5_KDB_DB_CHANGED; @@ -903,7 +903,7 @@ krb5_dbm_db_destroy(context, dbname) tmpcontext = 0; if (!context->db_context) { tmpcontext = 1; - if (retval = k5dbm_init_context(context)) + if ((retval = k5dbm_init_context(context))) return(retval); } if (KDBM_DATA_EXT(context->db_context) && @@ -914,8 +914,8 @@ krb5_dbm_db_destroy(context, dbname) (retval = destroy_file_suffix(dbname, KDBM_INDEX_EXT(context->db_context)))) return(retval); - if (retval = destroy_file_suffix(dbname, - KDBM_LOCK_EXT(context->db_context))) + if ((retval = destroy_file_suffix(dbname, + KDBM_LOCK_EXT(context->db_context)))) return(retval); if (tmpcontext) { k5dbm_clear_context((db_context_t *) context->db_context); @@ -954,7 +954,7 @@ krb5_dbm_db_rename(context, from, to) tmpcontext = 0; if (!context->db_context) { tmpcontext = 1; - if (retval = k5dbm_init_context(context)) + if ((retval = k5dbm_init_context(context))) return(retval); } if (KDBM_INDEX_EXT(context->db_context)) { @@ -980,7 +980,7 @@ krb5_dbm_db_rename(context, from, to) goto errout; } - if (retval = krb5_dbm_db_start_update(context, to, &trans)) + if ((retval = krb5_dbm_db_start_update(context, to, &trans))) goto errout; if (((!fromdir && !todir) || @@ -1042,10 +1042,10 @@ krb5_boolean *more; /* are there more? */ db_ctx = (db_context_t *) context->db_context; for (try = 0; try < KRB5_DBM_MAX_RETRY; try++) { - if (retval = krb5_dbm_db_start_read(context, &transaction)) + if ((retval = krb5_dbm_db_start_read(context, &transaction))) return(retval); - if (retval = krb5_dbm_db_lock(context, KRB5_DBM_SHARED)) + if ((retval = krb5_dbm_db_lock(context, KRB5_DBM_SHARED))) return(retval); if (db_ctx->db_dbm_ctx) @@ -1062,7 +1062,7 @@ krb5_boolean *more; /* are there more? */ *more = FALSE; /* XXX deal with wildcard lookups */ - if (retval = krb5_encode_princ_dbmkey(context, &key, searchfor)) + if ((retval = krb5_encode_princ_dbmkey(context, &key, searchfor))) goto cleanup; contents = KDBM_FETCH(db_ctx, db, key); @@ -1070,7 +1070,8 @@ krb5_boolean *more; /* are there more? */ if (contents.dptr == NULL) found = 0; - else if (retval = krb5_decode_princ_contents(context,&contents,entries)) + else if ((retval = krb5_decode_princ_contents(context, + &contents,entries))) goto cleanup; else found = 1; @@ -1142,7 +1143,7 @@ krb5_dbm_db_put_principal(context, entries, nentries) errout(KRB5_KDB_DBNOTINITED); db_ctx = (db_context_t *) context->db_context; - if (retval = krb5_dbm_db_lock(context, KRB5_DBM_EXCLUSIVE)) + if ((retval = krb5_dbm_db_lock(context, KRB5_DBM_EXCLUSIVE))) errout(retval); if (db_ctx->db_dbm_ctx) @@ -1161,10 +1162,12 @@ krb5_dbm_db_put_principal(context, entries, nentries) /* for each one, stuff temps, and do replace/append */ for (i = 0; i < *nentries; i++) { - if (retval = krb5_encode_princ_contents(context, &contents, entries)) + if ((retval = krb5_encode_princ_contents(context, &contents, + entries))) break; - if (retval = krb5_encode_princ_dbmkey(context, &key, entries->princ)) { + if ((retval = krb5_encode_princ_dbmkey(context, &key, + entries->princ))) { krb5_free_princ_contents(context, &contents); break; } @@ -1208,7 +1211,7 @@ krb5_dbm_db_delete_principal(context, searchfor, nentries) return KRB5_KDB_DBNOTINITED; db_ctx = (db_context_t *) context->db_context; - if (retval = krb5_dbm_db_lock(context, KRB5_DBM_EXCLUSIVE)) + if ((retval = krb5_dbm_db_lock(context, KRB5_DBM_EXCLUSIVE))) return(retval); if (db_ctx->db_dbm_ctx) @@ -1222,7 +1225,7 @@ krb5_dbm_db_delete_principal(context, searchfor, nentries) } } - if (retval = krb5_encode_princ_dbmkey(context, &key, searchfor)) + if ((retval = krb5_encode_princ_dbmkey(context, &key, searchfor))) goto cleanup; contents = KDBM_FETCH(db_ctx, db, key); @@ -1231,7 +1234,8 @@ krb5_dbm_db_delete_principal(context, searchfor, nentries) *nentries = 0; } else { memset((char *)&entry, 0, sizeof(entry)); - if (retval = krb5_decode_princ_contents(context, &contents, &entry)) + if ((retval = krb5_decode_princ_contents(context, &contents, + &entry))) goto cleankey; *nentries = 1; /* Clear encrypted key contents */ @@ -1241,7 +1245,8 @@ krb5_dbm_db_delete_principal(context, searchfor, nentries) entry.key_data[i].key_data_length[0]); } } - if (retval = krb5_encode_princ_contents(context, &contents2, &entry)) + if ((retval = krb5_encode_princ_contents(context, &contents2, + &entry))) goto cleancontents; if (KDBM_STORE(db_ctx, db, key, contents2, DBM_REPLACE)) @@ -1282,7 +1287,7 @@ krb5_dbm_db_iterate (context, func, func_arg) return KRB5_KDB_DBNOTINITED; db_ctx = (db_context_t *) context->db_context; - if (retval = krb5_dbm_db_lock(context, KRB5_DBM_SHARED)) + if ((retval = krb5_dbm_db_lock(context, KRB5_DBM_SHARED))) return retval; if (db_ctx->db_dbm_ctx) @@ -1299,7 +1304,8 @@ krb5_dbm_db_iterate (context, func, func_arg) for (key = KDBM_FIRSTKEY (db_ctx, db); key.dptr != NULL; key = KDBM_NEXTKEY(db_ctx, db)) { contents = KDBM_FETCH (db_ctx, db, key); - if (retval = krb5_decode_princ_contents(context, &contents, &entries)) + if ((retval = krb5_decode_princ_contents(context, &contents, + &entries))) break; retval = (*func)(func_arg, &entries); krb5_dbe_free_contents(context, &entries); @@ -1321,7 +1327,7 @@ krb5_dbm_db_set_lockmode(context, mode) db_context_t *db_ctx; old = mode; - if (db_ctx = (db_context_t *) context->db_context) { + if ((db_ctx = (db_context_t *) context->db_context)) { old = db_ctx->db_nb_locks; db_ctx->db_nb_locks = mode; } diff --git a/src/lib/kdb/kdb_xdr.c b/src/lib/kdb/kdb_xdr.c index 4507b982f..8aadb2b96 100644 --- a/src/lib/kdb/kdb_xdr.c +++ b/src/lib/kdb/kdb_xdr.c @@ -32,13 +32,13 @@ krb5_dbe_create_key_data(context, entry) krb5_db_entry * entry; { if (entry->n_key_data) { - if (entry->key_data = (krb5_key_data *)realloc(entry->key_data, - sizeof(krb5_key_data) * (entry->n_key_data + 1))) + if ((entry->key_data = (krb5_key_data *)realloc(entry->key_data, + sizeof(krb5_key_data) * (entry->n_key_data + 1)))) memset(entry->key_data + entry->n_key_data,0,sizeof(krb5_key_data)); else return ENOMEM; } else { - if (entry->key_data = (krb5_key_data *)malloc(sizeof(krb5_key_data))) + if ((entry->key_data = (krb5_key_data *)malloc(sizeof(krb5_key_data)))) memset(entry->key_data, 0, sizeof(krb5_key_data)); else return ENOMEM; @@ -63,8 +63,8 @@ krb5_dbe_encode_mod_princ_data(context, mod_princ, entry) * Need 04 bytes for date * Need XX bytes for string */ - if (retval = krb5_unparse_name(context, mod_princ->mod_princ, - &unparse_mod_princ)) + if ((retval = krb5_unparse_name(context, mod_princ->mod_princ, + &unparse_mod_princ))) return(retval); unparse_mod_princ_size = (int) strlen(unparse_mod_princ) + 1; @@ -124,8 +124,8 @@ krb5_dbe_decode_mod_princ_data(context, entry, mod_princ) nextloc += 4; /* Mod Princ */ - if (retval = krb5_parse_name(context, (const char *) nextloc, - &((*mod_princ)->mod_princ))) + if ((retval = krb5_parse_name(context, (const char *) nextloc, + &((*mod_princ)->mod_princ)))) break; if ((strlen((char *) nextloc) + 1 + 4) != tl_data->tl_data_length) { @@ -202,7 +202,7 @@ krb5_encode_princ_contents(context, content, entry) */ content->dsize = entry->len + entry->e_length; - if (retval = krb5_unparse_name(context, entry->princ, &unparse_princ)) + if ((retval = krb5_unparse_name(context, entry->princ, &unparse_princ))) return(retval); unparse_princ_size = strlen(unparse_princ) + 1; @@ -451,7 +451,7 @@ krb5_decode_princ_contents(context, content, entry) /* Check for extra data */ if (entry->len > KRB5_KDB_V1_BASE_LENGTH) { entry->e_length = entry->len - KRB5_KDB_V1_BASE_LENGTH; - if (entry->e_data = (krb5_octet *)malloc(entry->e_length)) { + if ((entry->e_data = (krb5_octet *)malloc(entry->e_length))) { memcpy(entry->e_data, nextloc, entry->e_length); nextloc += entry->e_length; } else { @@ -473,7 +473,7 @@ krb5_decode_princ_contents(context, content, entry) i = (int) i16; nextloc += 2; - if (retval = krb5_parse_name(context, nextloc, &(entry->princ))) + if ((retval = krb5_parse_name(context, nextloc, &(entry->princ)))) goto error_out; if ((i != (strlen(nextloc) + 1)) || (sizeleft < i)) { retval = KRB5_KDB_TRUNCATED_RECORD; diff --git a/src/lib/kdb/setup_mkey.c b/src/lib/kdb/setup_mkey.c index ece8e2cca..ba1760d5f 100644 --- a/src/lib/kdb/setup_mkey.c +++ b/src/lib/kdb/setup_mkey.c @@ -61,7 +61,7 @@ krb5_db_setup_mkey_name(context, keyname, realm, fullname, principal) strcat(fname, REALM_SEP_STRING); strcat(fname, realm); - if (retval = krb5_parse_name(context, fname, principal)) + if ((retval = krb5_parse_name(context, fname, principal))) return retval; if (fullname) *fullname = fname; diff --git a/src/lib/kdb/verify_mky.c b/src/lib/kdb/verify_mky.c index dbac6ff35..121c72148 100644 --- a/src/lib/kdb/verify_mky.c +++ b/src/lib/kdb/verify_mky.c @@ -47,7 +47,8 @@ krb5_db_verify_master_key(context, mprinc, mkey, eblock) krb5_keyblock tempkey; nprinc = 1; - if (retval = krb5_db_get_principal(context, mprinc, &master_entry, &nprinc, &more)) + if ((retval = krb5_db_get_principal(context, mprinc, + &master_entry, &nprinc, &more))) return(retval); if (nprinc != 1) { @@ -60,13 +61,13 @@ krb5_db_verify_master_key(context, mprinc, mkey, eblock) } /* do any necessary key pre-processing */ - if (retval = krb5_process_key(context, eblock, mkey)) { + if ((retval = krb5_process_key(context, eblock, mkey))) { krb5_db_free_principal(context, &master_entry, nprinc); return(retval); } - if (retval = krb5_dbekd_decrypt_key_data(context, eblock, - &master_entry.key_data[0], - &tempkey, NULL)) { + if ((retval = krb5_dbekd_decrypt_key_data(context, eblock, + &master_entry.key_data[0], + &tempkey, NULL))) { (void) krb5_finish_key(context, eblock); krb5_db_free_principal(context, &master_entry, nprinc); return retval; diff --git a/src/lib/krb5/keytab/ChangeLog b/src/lib/krb5/keytab/ChangeLog index 92102b647..28c40dce2 100644 --- a/src/lib/krb5/keytab/ChangeLog +++ b/src/lib/krb5/keytab/ChangeLog @@ -1,3 +1,11 @@ +Fri Aug 4 21:48:41 1995 Tom Yu + + * read_servi.c (krb5_kt_read_service_key): add more parens to shut + up gcc -Wall + + * ktdefault.c (krb5_kt_default): add more parens to shut up gcc + -Wall + Fri Jun 9 19:33:33 1995 * configure.in: Remove standardized set of autoconf macros, which diff --git a/src/lib/krb5/keytab/file/ChangeLog b/src/lib/krb5/keytab/file/ChangeLog index 16ec9bf5b..ad1ce9f97 100644 --- a/src/lib/krb5/keytab/file/ChangeLog +++ b/src/lib/krb5/keytab/file/ChangeLog @@ -1,3 +1,16 @@ +Fri Aug 4 21:51:32 1995 Tom Yu + + * ktf_util.c: shut up gcc -Wall + + * ktf_remove.c: more stuff to shut up gcc -Wall + + * ktf_next.c: Add more parens to shut up gcc -Wall + + * ktf_g_ent.c (krb5_ktfile_get_entry): Add more parens to shut up + gcc -Wall + + * ktf_add.c (krb5_ktfile_add): Add parens to shut up gcc -Wall + Wed Jun 28 12:05:34 1995 * ktf_g_ent.c (krb5_ktfile_get_entry): If the key version number diff --git a/src/lib/krb5/keytab/file/ktf_add.c b/src/lib/krb5/keytab/file/ktf_add.c index 0de762918..aac429c04 100644 --- a/src/lib/krb5/keytab/file/ktf_add.c +++ b/src/lib/krb5/keytab/file/ktf_add.c @@ -35,7 +35,7 @@ krb5_ktfile_add(context, id, entry) { krb5_error_code retval; - if (retval = krb5_ktfileint_openw(context, id)) + if ((retval = krb5_ktfileint_openw(context, id))) return retval; if (fseek(KTFILEP(id), 0, 2) == -1) return KRB5_KT_END; diff --git a/src/lib/krb5/keytab/file/ktf_g_ent.c b/src/lib/krb5/keytab/file/ktf_g_ent.c index f05f0bd48..7f6120bbd 100644 --- a/src/lib/krb5/keytab/file/ktf_g_ent.c +++ b/src/lib/krb5/keytab/file/ktf_g_ent.c @@ -42,7 +42,7 @@ krb5_ktfile_get_entry(context, id, principal, kvno, keytype, entry) krb5_error_code kerror = 0; /* Open the keyfile for reading */ - if (kerror = krb5_ktfileint_openr(context, id)) + if ((kerror = krb5_ktfileint_openr(context, id))) return(kerror); /* @@ -53,7 +53,7 @@ krb5_ktfile_get_entry(context, id, principal, kvno, keytype, entry) cur_entry.vno = 0; cur_entry.key.contents = 0; while (TRUE) { - if (kerror = krb5_ktfileint_read_entry(context, id, &new_entry)) + if ((kerror = krb5_ktfileint_read_entry(context, id, &new_entry))) break; if (krb5_principal_compare(context, principal, new_entry.principal)) { diff --git a/src/lib/krb5/keytab/file/ktf_next.c b/src/lib/krb5/keytab/file/ktf_next.c index da23bb934..7b13ede5a 100644 --- a/src/lib/krb5/keytab/file/ktf_next.c +++ b/src/lib/krb5/keytab/file/ktf_next.c @@ -40,7 +40,7 @@ krb5_kt_cursor *cursor; if (fseek(KTFILEP(id), *fileoff, 0) == -1) return KRB5_KT_END; - if (kerror = krb5_ktfileint_read_entry(context, id, &cur_entry)) + if ((kerror = krb5_ktfileint_read_entry(context, id, &cur_entry))) return kerror; *fileoff = ftell(KTFILEP(id)); *entry = cur_entry; diff --git a/src/lib/krb5/keytab/file/ktf_remove.c b/src/lib/krb5/keytab/file/ktf_remove.c index 93704300a..a58cc1056 100644 --- a/src/lib/krb5/keytab/file/ktf_remove.c +++ b/src/lib/krb5/keytab/file/ktf_remove.c @@ -37,7 +37,7 @@ krb5_keytab_entry *entry; krb5_error_code kerror; krb5_int32 delete_point; - if (kerror = krb5_ktfileint_openw(context, id)) { + if ((kerror = krb5_ktfileint_openw(context, id))) { return kerror; } @@ -46,8 +46,9 @@ krb5_keytab_entry *entry; * is exited with a break statement. */ while (TRUE) { - if (kerror = krb5_ktfileint_internal_read_entry(context, id, &cur_entry, - &delete_point)) + if ((kerror = krb5_ktfileint_internal_read_entry(context, id, + &cur_entry, + &delete_point))) break; if ((entry->vno == cur_entry.vno) && diff --git a/src/lib/krb5/keytab/file/ktf_ssget.c b/src/lib/krb5/keytab/file/ktf_ssget.c index 67e3bb649..1001b2ee7 100644 --- a/src/lib/krb5/keytab/file/ktf_ssget.c +++ b/src/lib/krb5/keytab/file/ktf_ssget.c @@ -36,7 +36,7 @@ krb5_kt_cursor *cursorp; krb5_error_code retval; long *fileoff; - if (retval = krb5_ktfileint_openr(context, id)) + if ((retval = krb5_ktfileint_openr(context, id))) return retval; if (!(fileoff = (long *)malloc(sizeof(*fileoff)))) { diff --git a/src/lib/krb5/keytab/file/ktf_util.c b/src/lib/krb5/keytab/file/ktf_util.c index fa79ef0a0..cc738d924 100644 --- a/src/lib/krb5/keytab/file/ktf_util.c +++ b/src/lib/krb5/keytab/file/ktf_util.c @@ -122,8 +122,8 @@ int mode; } else /* some other error */ return errno; } - if (kerror = krb5_lock_file(context, KTFILEP(id), KTFILENAME(id), - mode)) { + if ((kerror = krb5_lock_file(context, KTFILEP(id), KTFILENAME(id), + mode))) { (void) fclose(KTFILEP(id)); KTFILEP(id) = 0; return kerror; @@ -737,7 +737,7 @@ krb5_int32 *commit_point; */ zero_point = ftell(KTFILEP(id)); setbuf(KTFILEP(id), iobuf); - while (size = xfread(iobuf, 1, sizeof(iobuf), KTFILEP(id))) { + while ((size = xfread(iobuf, 1, sizeof(iobuf), KTFILEP(id)))) { if (size != sizeof(iobuf)) { remainder = size % sizeof(krb5_int32); if (remainder) { diff --git a/src/lib/krb5/keytab/ktdefault.c b/src/lib/krb5/keytab/ktdefault.c index 868153553..1e34b76ce 100644 --- a/src/lib/krb5/keytab/ktdefault.c +++ b/src/lib/krb5/keytab/ktdefault.c @@ -35,7 +35,7 @@ krb5_kt_default(context, id) char defname[BUFSIZ]; krb5_error_code retval; - if (retval = krb5_kt_default_name(context, defname, sizeof(defname))) + if ((retval = krb5_kt_default_name(context, defname, sizeof(defname)))) return retval; return krb5_kt_resolve(context, defname, id); } diff --git a/src/lib/krb5/keytab/read_servi.c b/src/lib/krb5/keytab/read_servi.c index bd9331ece..e18d199b4 100644 --- a/src/lib/krb5/keytab/read_servi.c +++ b/src/lib/krb5/keytab/read_servi.c @@ -67,7 +67,7 @@ krb5_kt_read_service_key(context, keyprocarg, principal, vno, keytype, key) sizeof(keytabname) - 1); } - if (kerror = krb5_kt_resolve(context, (char *)keytabname, &id)) + if ((kerror = krb5_kt_resolve(context, (char *)keytabname, &id))) return (kerror); kerror = krb5_kt_get_entry(context, id, principal, vno, keytype, &entry); diff --git a/src/lib/krb5/krb/ChangeLog b/src/lib/krb5/krb/ChangeLog index 06ece936a..e40af558e 100644 --- a/src/lib/krb5/krb/ChangeLog +++ b/src/lib/krb5/krb/ChangeLog @@ -1,3 +1,6 @@ +Fri Aug 4 22:04:08 1995 Tom Yu + + * conv_princ.c: Add braces to initializer to shut up gcc -Wall Fri Jul 7 16:31:06 EDT 1995 Paul Park (pjpark@mit.edu) * Makefile.in - Find com_err in TOPLIBD. diff --git a/src/lib/krb5/krb/conv_princ.c b/src/lib/krb5/krb/conv_princ.c index 9465a0298..fb9072cfc 100644 --- a/src/lib/krb5/krb/conv_princ.c +++ b/src/lib/krb5/krb/conv_princ.c @@ -55,16 +55,16 @@ struct krb_convert { * we'll fix that in the next release. */ static struct krb_convert sconv_list[] = { - "kadmin", "kadmin", 0, - "rcmd", "host", DO_REALM_CONVERSION, - "discuss", "discuss", DO_REALM_CONVERSION, - "rvdsrv", "rvdsrv", DO_REALM_CONVERSION, - "sample", "sample", DO_REALM_CONVERSION, - "olc", "olc", DO_REALM_CONVERSION, - "pop", "pop", DO_REALM_CONVERSION, - "sis", "sis", DO_REALM_CONVERSION, - "rfs", "rfs", DO_REALM_CONVERSION, - 0, 0, + {"kadmin", "kadmin", 0}, + {"rcmd", "host", DO_REALM_CONVERSION}, + {"discuss", "discuss", DO_REALM_CONVERSION}, + {"rvdsrv", "rvdsrv", DO_REALM_CONVERSION}, + {"sample", "sample", DO_REALM_CONVERSION}, + {"olc", "olc", DO_REALM_CONVERSION}, + {"pop", "pop", DO_REALM_CONVERSION}, + {"sis", "sis", DO_REALM_CONVERSION}, + {"rfs", "rfs", DO_REALM_CONVERSION}, + {0, 0, 0}, }; /* diff --git a/src/lib/krb5/os/ChangeLog b/src/lib/krb5/os/ChangeLog index 128303b5e..5f39e02cc 100644 --- a/src/lib/krb5/os/ChangeLog +++ b/src/lib/krb5/os/ChangeLog @@ -1,3 +1,13 @@ +Fri Aug 4 22:51:15 1995 Tom Yu + + * kuserok.c (krb5_kuserok): Add parens to shut up gcc -Wall + + * genaddrs.c (krb5_auth_con_genaddrs): Add parens to shut up gcc + -Wall + + * an_to_ln.c: Include ctype.h to get some prototypes; also add + parens to shut up gcc -Wall + Fri Jul 28 23:28:11 1995 Sam Hartman * sn2princ.c (krb5_sname_to_principal): GDon't use default realm diff --git a/src/lib/krb5/os/an_to_ln.c b/src/lib/krb5/os/an_to_ln.c index 368ea0aaf..73c7fe846 100644 --- a/src/lib/krb5/os/an_to_ln.c +++ b/src/lib/krb5/os/an_to_ln.c @@ -25,6 +25,7 @@ */ #include "k5-int.h" +#include #if HAVE_REGEX_H #include #endif /* HAVE_REGEX_H */ @@ -84,7 +85,7 @@ aname_full_to_mapping_name(fprincname) atp = &fprincname[strlen(fprincname)]; mlen = (size_t) (atp - fprincname); - if (mname = (char *) malloc(mlen+1)) { + if ((mname = (char *) malloc(mlen+1))) { strncpy(mname, fprincname, mlen); mname[mlen] = '\0'; } @@ -113,7 +114,7 @@ db_an_to_ln(context, dbname, aname, lnsize, lname) datum key, contents; char *princ_name; - if (retval = krb5_unparse_name(context, aname, &princ_name)) + if ((retval = krb5_unparse_name(context, aname, &princ_name))) return(retval); key.dptr = princ_name; key.dsize = strlen(princ_name)+1; /* need to store the NULL for @@ -611,7 +612,7 @@ default_an_to_ln(context, aname, lnsize, lname) realm_length = krb5_princ_realm(context, aname)->length; - if (retval = krb5_get_default_realm(context, &def_realm)) { + if ((retval = krb5_get_default_realm(context, &def_realm))) { return(retval); } if (((size_t) realm_length != strlen(def_realm)) || @@ -681,7 +682,7 @@ krb5_aname_to_localname(context, aname, lnsize, lname) if (!(kret = krb5_get_default_realm(context, &realm))) { /* Flatten the name */ if (!(kret = krb5_unparse_name(context, aname, &pname))) { - if (mname = aname_full_to_mapping_name(pname)) { + if ((mname = aname_full_to_mapping_name(pname))) { /* * Search first for explicit mappings of the form: * diff --git a/src/lib/krb5/os/genaddrs.c b/src/lib/krb5/os/genaddrs.c index c5a42fd96..1b94e5143 100644 --- a/src/lib/krb5/os/genaddrs.c +++ b/src/lib/krb5/os/genaddrs.c @@ -53,7 +53,7 @@ krb5_auth_con_genaddrs(context, auth_context, fd, flags) ssize = sizeof(struct sockaddr); if ((flags & KRB5_AUTH_CONTEXT_GENERATE_LOCAL_FULL_ADDR) || (flags & KRB5_AUTH_CONTEXT_GENERATE_LOCAL_ADDR)) { - if (retval = getsockname(fd, (struct sockaddr *) &lsaddr, &ssize)) + if ((retval = getsockname(fd, (struct sockaddr *) &lsaddr, &ssize))) return retval; if (flags & KRB5_AUTH_CONTEXT_GENERATE_LOCAL_FULL_ADDR) { @@ -75,7 +75,7 @@ krb5_auth_con_genaddrs(context, auth_context, fd, flags) if ((flags & KRB5_AUTH_CONTEXT_GENERATE_REMOTE_FULL_ADDR) || (flags & KRB5_AUTH_CONTEXT_GENERATE_REMOTE_ADDR)) { - if (retval = getpeername(fd, (struct sockaddr *) &rsaddr, &ssize)) + if ((retval = getpeername(fd, (struct sockaddr *) &rsaddr, &ssize))) return retval; if (flags & KRB5_AUTH_CONTEXT_GENERATE_REMOTE_FULL_ADDR) { diff --git a/src/lib/krb5/os/kuserok.c b/src/lib/krb5/os/kuserok.c index 3fd26ef7a..321f438cc 100644 --- a/src/lib/krb5/os/kuserok.c +++ b/src/lib/krb5/os/kuserok.c @@ -122,7 +122,7 @@ krb5_kuserok(context, principal, luser) linebuf[BUFSIZ-1] = '\0'; newline = NULL; /* nuke the newline if it exists */ - if (newline = strchr(linebuf, '\n')) + if ((newline = strchr(linebuf, '\n'))) *newline = '\0'; if (!strcmp(linebuf, princname)) { isok = TRUE; diff --git a/src/lib/krb5/rcache/ChangeLog b/src/lib/krb5/rcache/ChangeLog index bc40a0c5f..2009b245b 100644 --- a/src/lib/krb5/rcache/ChangeLog +++ b/src/lib/krb5/rcache/ChangeLog @@ -1,3 +1,13 @@ +Fri Aug 4 22:07:46 1995 Tom Yu + + * rc_conv.c (krb5_auth_to_rep): Add parens to shut up gcc -Wall + + * rc_io.c: Add parens to shut up gcc -Wall + + * rc_dfl.c: Add parens to shut up gcc -Wall + + * rc_base.c: Add parens to shut up gcc -Wall + Thu Jul 20 22:34:47 1995 Mark Eichin * rc_dfl.c (rc_store): rename from store() to avoid conflict with diff --git a/src/lib/krb5/rcache/rc_base.c b/src/lib/krb5/rcache/rc_base.c index 1e53094c7..fd8f4bce7 100644 --- a/src/lib/krb5/rcache/rc_base.c +++ b/src/lib/krb5/rcache/rc_base.c @@ -91,7 +91,7 @@ char * krb5_rc_default_type(context) krb5_context context; { char *s; - if (s = getenv("KRB5RCACHETYPE")) + if ((s = getenv("KRB5RCACHETYPE"))) return s; else return "dfl"; @@ -101,7 +101,7 @@ char * krb5_rc_default_name(context) krb5_context context; { char *s; - if (s = getenv("KRB5RCACHENAME")) + if ((s = getenv("KRB5RCACHENAME"))) return s; else return (char *) 0; @@ -117,13 +117,13 @@ krb5_rc_default(context, id) if (!(*id = (krb5_rcache )malloc(sizeof(**id)))) return KRB5_RC_MALLOC; - if (retval = krb5_rc_resolve_type(context, id, - krb5_rc_default_type(context))) { + if ((retval = krb5_rc_resolve_type(context, id, + krb5_rc_default_type(context)))) { FREE(*id); return retval; } - if (retval = krb5_rc_resolve(context, *id, - krb5_rc_default_name(context))) + if ((retval = krb5_rc_resolve(context, *id, + krb5_rc_default_name(context)))) FREE(*id); return retval; } @@ -151,13 +151,13 @@ krb5_error_code krb5_rc_resolve_full(context, id, string_name) return KRB5_RC_MALLOC; } - if (retval = krb5_rc_resolve_type(context, id,type)) { + if ((retval = krb5_rc_resolve_type(context, id,type))) { FREE(type); FREE(*id); return retval; } FREE(type); - if (retval = krb5_rc_resolve(context, *id,residual + 1)) + if ((retval = krb5_rc_resolve(context, *id,residual + 1))) FREE(*id); return retval; } diff --git a/src/lib/krb5/rcache/rc_conv.c b/src/lib/krb5/rcache/rc_conv.c index 92cf77f8d..db20f3ffe 100644 --- a/src/lib/krb5/rcache/rc_conv.c +++ b/src/lib/krb5/rcache/rc_conv.c @@ -30,9 +30,10 @@ krb5_auth_to_rep(context, auth, rep) krb5_error_code retval; rep->cusec = auth->authenticator->cusec; rep->ctime = auth->authenticator->ctime; - if (retval = krb5_unparse_name(context, auth->ticket->server,&rep->server)) + if ((retval = krb5_unparse_name(context, auth->ticket->server, &rep->server))) return retval; /* shouldn't happen */ - if (retval = krb5_unparse_name(context, auth->authenticator->client,&rep->client)) { + if ((retval = krb5_unparse_name(context, auth->authenticator->client, + &rep->client))) { FREE(rep->server); return retval; /* shouldn't happen. */ } diff --git a/src/lib/krb5/rcache/rc_dfl.c b/src/lib/krb5/rcache/rc_dfl.c index 99eb9d30c..a6cd76cc1 100644 --- a/src/lib/krb5/rcache/rc_dfl.c +++ b/src/lib/krb5/rcache/rc_dfl.c @@ -191,10 +191,11 @@ krb5_deltat lifespan; t->lifespan = lifespan; #ifndef NOIOSTUFF - if (retval = krb5_rc_io_creat(context, &t->d,&t->name)) + if ((retval = krb5_rc_io_creat(context, &t->d,&t->name))) return retval; - if (krb5_rc_io_write(context, &t->d,(krb5_pointer) &t->lifespan,sizeof(t->lifespan)) - || krb5_rc_io_sync(context, &t->d)) + if ((krb5_rc_io_write(context, &t->d, + (krb5_pointer) &t->lifespan, sizeof(t->lifespan)) + || krb5_rc_io_sync(context, &t->d))) return KRB5_RC_IO; #endif return 0; @@ -210,7 +211,7 @@ krb5_error_code krb5_rc_dfl_close_no_free(context, id) FREE(t->h); if (t->name) FREE(t->name); - while (q = t->a) + while ((q = t->a)) { t->a = q->na; FREE(q->rep.client); @@ -390,7 +391,7 @@ krb5_rcache id; krb5_error_code retval; long max_size; - if (retval = krb5_rc_io_open(context, &t->d,t->name)) + if ((retval = krb5_rc_io_open(context, &t->d, t->name))) return retval; max_size = krb5_rc_io_size(context, &t->d); diff --git a/src/lib/krb5/rcache/rc_io.c b/src/lib/krb5/rcache/rc_io.c index d321eceea..efadead40 100644 --- a/src/lib/krb5/rcache/rc_io.c +++ b/src/lib/krb5/rcache/rc_io.c @@ -209,7 +209,8 @@ krb5_error_code krb5_rc_io_open (context, d, fn) goto fail; } } - if (retval = krb5_rc_io_read(context, d, (krb5_pointer) &rc_vno, sizeof(rc_vno))) + if ((retval = krb5_rc_io_read(context, d, (krb5_pointer) &rc_vno, + sizeof(rc_vno)))) goto unlk; -- 2.26.2