From 4ba58f9b6b7ccb372f09e31ee3d302ffafd50b15 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Sun, 4 Sep 2011 23:52:34 +0000 Subject: [PATCH] Reindent per krb5-batch-reindent.el. Some minor reformatting added in places to avoid exceeding 80 columns. Used Emacs 22.1 built-in C mode. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25144 dc483132-0cff-0310-8789-dd5450dbe970 --- src/appl/gss-sample/gss-client.c | 2 +- src/include/k5-int.h | 4 +- src/kadmin/cli/kadmin.c | 13 +-- src/kadmin/server/ovsec_kadmd.c | 8 +- src/kdc/kdc_preauth.c | 2 +- src/kdc/kdc_util.c | 2 +- src/kdc/kdc_util.h | 2 +- src/lib/gssapi/generic/gssapi_generic.c | 10 +- src/lib/gssapi/krb5/accept_sec_context.c | 1 - src/lib/gssapi/krb5/acquire_cred.c | 1 - src/lib/gssapi/krb5/gssapi_krb5.c | 16 ++-- src/lib/gssapi/krb5/import_name.c | 2 +- src/lib/gssapi/krb5/init_sec_context.c | 1 - src/lib/gssapi/krb5/prf.c | 1 - src/lib/gssapi/krb5/store_cred.c | 1 - .../gssapi/mechglue/g_acquire_cred_with_pw.c | 2 +- src/lib/gssapi/mechglue/g_mechattr.c | 28 +++--- src/lib/kadm5/srv/pwqual_princ.c | 2 +- src/lib/krb5/asn.1/asn1_k_decode_fast.c | 1 - src/lib/krb5/asn.1/asn1_k_decode_kdc.c | 4 +- src/lib/krb5/asn.1/asn1_k_decode_macros.h | 10 +- src/lib/krb5/asn.1/asn1_k_decode_sam.c | 1 - src/lib/krb5/asn.1/asn1_k_encode.c | 2 +- src/lib/krb5/asn.1/krb5_decode_kdc.c | 3 +- src/lib/krb5/asn.1/krb5_decode_macros.h | 6 +- src/lib/krb5/krb/authdata.c | 2 +- src/lib/krb5/krb/authdata_dec.c | 2 +- src/lib/krb5/krb/copy_auth.c | 4 +- src/lib/krb5/krb/fast.c | 2 +- src/lib/krb5/krb/gic_opt.c | 4 +- src/lib/krb5/krb/init_ctx.c | 12 +-- src/lib/krb5/krb/int-proto.h | 2 +- src/lib/krb5/krb/rd_cred.c | 18 ++-- src/lib/krb5/krb/s4u_authdata.c | 11 +-- src/lib/krb5/krb/s4u_creds.c | 18 ++-- src/lib/krb5/krb/t_expire_warn.c | 20 ++-- src/lib/krb5/krb/t_vfy_increds.c | 2 +- src/lib/krb5/krb/val_renew.c | 62 ++++++------- src/lib/krb5/os/locate_kdc.c | 4 +- src/lib/krb5/os/trace.c | 2 +- src/plugins/kdb/db2/kdb_db2.c | 2 +- src/plugins/kdb/hdb/kdb_hdb.c | 2 +- .../preauth/pkinit/pkinit_crypto_openssl.c | 2 +- src/plugins/preauth/securid_sam2/securid2.c | 22 ++--- .../preauth/securid_sam2/securid_sam2_main.c | 92 ++++++++++--------- src/slave/kprop_sock.c | 22 ++--- src/tests/gssapi/t_imp_cred.c | 12 +-- src/tests/gssapi/t_spnego.c | 2 +- src/tests/threads/init_ctx.c | 12 +-- src/tests/threads/profread.c | 20 ++-- src/util/gss-kernel-lib/t_kgss_kernel.c | 4 +- src/util/profile/profile_tcl.c | 1 - src/util/profile/test_vtable.c | 42 ++++----- src/util/profile/testmod/testmod_main.c | 6 +- src/util/support/path.c | 90 +++++++++--------- src/util/windows/getopt.c | 2 +- 56 files changed, 309 insertions(+), 314 deletions(-) diff --git a/src/appl/gss-sample/gss-client.c b/src/appl/gss-sample/gss-client.c index 79c01d6f3..d2eaab3fa 100644 --- a/src/appl/gss-sample/gss-client.c +++ b/src/appl/gss-sample/gss-client.c @@ -72,7 +72,7 @@ static int verbose = 1; static int spnego = 0; static gss_OID_desc gss_spnego_mechanism_oid_desc = - {6, (void *)"\x2b\x06\x01\x05\x05\x02"}; +{6, (void *)"\x2b\x06\x01\x05\x05\x02"}; static void usage() diff --git a/src/include/k5-int.h b/src/include/k5-int.h index 17a0abe45..c153a7e51 100644 --- a/src/include/k5-int.h +++ b/src/include/k5-int.h @@ -372,9 +372,9 @@ typedef INT64_TYPE krb5_int64; #define KDC_ERR_DIGEST_IN_SIGNED_DATA_NOT_ACCEPTED 80 /* bad digest algorithm in SignedData */ #define KDC_ERR_PUBLIC_KEY_ENCRYPTION_NOT_SUPPORTED 81 #define KRB_AP_ERR_IAKERB_KDC_NOT_FOUND 85 /* The IAKERB proxy could -not find a KDC */ + not find a KDC */ #define KRB_AP_ERR_IAKERB_KDC_NO_RESPONSE 86 /* The KDC did not respond -to the IAKERB proxy */ + to the IAKERB proxy */ /* * This structure is returned in the e-data field of the KRB-ERROR diff --git a/src/kadmin/cli/kadmin.c b/src/kadmin/cli/kadmin.c index 5240c2ff9..baaac0bab 100644 --- a/src/kadmin/cli/kadmin.c +++ b/src/kadmin/cli/kadmin.c @@ -1136,12 +1136,13 @@ kadmin_addprinc_usage() { fprintf(stderr, _("usage: add_principal [options] principal\n")); fprintf(stderr, _("\toptions are:\n")); - fprintf(stderr, _("\t\t[-x db_princ_args]* [-expire expdate] " - "[-pwexpire pwexpdate] [-maxlife maxtixlife]\n" - "\t\t[-kvno kvno] [-policy policy] [-clearpolicy] [-randkey]\n" - "\t\t[-pw password] [-maxrenewlife maxrenewlife]\n" - "\t\t[-e keysaltlist]\n\t\t[{+|-}attribute]\n") - ); + fprintf(stderr, + _("\t\t[-x db_princ_args]* [-expire expdate] " + "[-pwexpire pwexpdate] [-maxlife maxtixlife]\n" + "\t\t[-kvno kvno] [-policy policy] [-clearpolicy] [-randkey]\n" + "\t\t[-pw password] [-maxrenewlife maxrenewlife]\n" + "\t\t[-e keysaltlist]\n\t\t[{+|-}attribute]\n") + ); fprintf(stderr, _("\tattributes are:\n")); fprintf(stderr, _("\t\tallow_postdated allow_forwardable allow_tgs_req " diff --git a/src/kadmin/server/ovsec_kadmd.c b/src/kadmin/server/ovsec_kadmd.c index 2800f8778..fac5ccd24 100644 --- a/src/kadmin/server/ovsec_kadmd.c +++ b/src/kadmin/server/ovsec_kadmd.c @@ -363,7 +363,7 @@ int main(int argc, char *argv[]) _("%s: could not initialize loop, aborting"), whoami); fprintf(stderr, _("%s: could not initialize loop, aborting\n"), - whoami); + whoami); kadm5_destroy(global_server_handle); krb5_klog_close(context); exit(1); @@ -373,12 +373,12 @@ int main(int argc, char *argv[]) if ((ret = loop_add_udp_port(server_handle->params.kpasswd_port)) || (ret = loop_add_tcp_port(server_handle->params.kpasswd_port)) || (ret = loop_add_rpc_service(server_handle->params.kadmind_port, - KADM, KADMVERS, kadm_1)) + KADM, KADMVERS, kadm_1)) #ifndef DISABLE_IPROP || (server_handle->params.iprop_enabled ? (ret = loop_add_rpc_service(server_handle->params.iprop_port, - KRB5_IPROP_PROG, KRB5_IPROP_VERS, - krb5_iprop_prog_1)) + KRB5_IPROP_PROG, KRB5_IPROP_VERS, + krb5_iprop_prog_1)) : 0) #endif #undef server_handle diff --git a/src/kdc/kdc_preauth.c b/src/kdc/kdc_preauth.c index d0a57b5fc..72c1752e9 100644 --- a/src/kdc/kdc_preauth.c +++ b/src/kdc/kdc_preauth.c @@ -298,7 +298,7 @@ static preauth_system static_preauth_systems[] = { #endif }; -#define NUM_STATIC_PREAUTH_SYSTEMS (sizeof(static_preauth_systems) / \ +#define NUM_STATIC_PREAUTH_SYSTEMS (sizeof(static_preauth_systems) / \ sizeof(*static_preauth_systems)) static preauth_system *preauth_systems; diff --git a/src/kdc/kdc_util.c b/src/kdc/kdc_util.c index bfc48c5d0..e18fb2c86 100644 --- a/src/kdc/kdc_util.c +++ b/src/kdc/kdc_util.c @@ -2457,7 +2457,7 @@ kdc_handle_protected_negotiation(krb5_data *req_pkt, krb5_kdc_req *request, krb5_data *out = NULL; krb5_pa_data pa, *pa_in; pa_in = krb5int_find_pa_data(kdc_context, request->padata, - KRB5_ENCPADATA_REQ_ENC_PA_REP); + KRB5_ENCPADATA_REQ_ENC_PA_REP); if (pa_in == NULL) return 0; pa.magic = KV5M_PA_DATA; diff --git a/src/kdc/kdc_util.h b/src/kdc/kdc_util.h index 20e8ac46d..e2790e23d 100644 --- a/src/kdc/kdc_util.h +++ b/src/kdc/kdc_util.h @@ -144,7 +144,7 @@ kdc_err(krb5_context call_context, errcode_t code, const char *fmt, ...) #if !defined(__cplusplus) && (__GNUC__ > 2) __attribute__((__format__(__printf__, 3, 4))) #endif -; + ; /* policy.c */ int diff --git a/src/lib/gssapi/generic/gssapi_generic.c b/src/lib/gssapi/generic/gssapi_generic.c index 3ef2c0c8e..dd254cf97 100644 --- a/src/lib/gssapi/generic/gssapi_generic.c +++ b/src/lib/gssapi/generic/gssapi_generic.c @@ -371,11 +371,11 @@ static struct mech_attr_info_desc { OM_uint32 generic_gss_display_mech_attr( - OM_uint32 *minor_status, - gss_const_OID mech_attr, - gss_buffer_t name, - gss_buffer_t short_desc, - gss_buffer_t long_desc) + OM_uint32 *minor_status, + gss_const_OID mech_attr, + gss_buffer_t name, + gss_buffer_t short_desc, + gss_buffer_t long_desc) { size_t i; diff --git a/src/lib/gssapi/krb5/accept_sec_context.c b/src/lib/gssapi/krb5/accept_sec_context.c index 3d4158163..a41968ed8 100644 --- a/src/lib/gssapi/krb5/accept_sec_context.c +++ b/src/lib/gssapi/krb5/accept_sec_context.c @@ -1374,4 +1374,3 @@ krb5_gss_accept_sec_context(minor_status, context_handle, delegated_cred_handle, &exts); } - diff --git a/src/lib/gssapi/krb5/acquire_cred.c b/src/lib/gssapi/krb5/acquire_cred.c index e71420881..b95a5397e 100644 --- a/src/lib/gssapi/krb5/acquire_cred.c +++ b/src/lib/gssapi/krb5/acquire_cred.c @@ -875,4 +875,3 @@ gss_krb5int_import_cred(OM_uint32 *minor_status, k5_mutex_destroy(&name.lock); return code; } - diff --git a/src/lib/gssapi/krb5/gssapi_krb5.c b/src/lib/gssapi/krb5/gssapi_krb5.c index 8dccc60d0..4d4f545f5 100644 --- a/src/lib/gssapi/krb5/gssapi_krb5.c +++ b/src/lib/gssapi/krb5/gssapi_krb5.c @@ -647,8 +647,8 @@ krb5_gss_inquire_mech_for_saslname(OM_uint32 *minor_status, *mech_type = (gss_OID)gss_mech_krb5; return GSS_S_COMPLETE; } else if (sasl_mech_name->length == GS2_IAKERB_SASL_NAME_LEN && - memcmp(sasl_mech_name->value, - GS2_IAKERB_SASL_NAME, GS2_IAKERB_SASL_NAME_LEN) == 0) { + memcmp(sasl_mech_name->value, + GS2_IAKERB_SASL_NAME, GS2_IAKERB_SASL_NAME_LEN) == 0) { if (mech_type != NULL) *mech_type = (gss_OID)gss_mech_iakerb; return GSS_S_COMPLETE; @@ -668,7 +668,8 @@ krb5_gss_inquire_saslname_for_mech(OM_uint32 *minor_status, if (!g_make_string_buffer(GS2_IAKERB_SASL_NAME, sasl_mech_name) || !g_make_string_buffer("iakerb", mech_name) || !g_make_string_buffer("Initial and Pass Through Authentication " - "Kerberos Mechanism (IAKERB)", mech_description)) + "Kerberos Mechanism (IAKERB)", + mech_description)) goto fail; } else { if (!g_make_string_buffer(GS2_KRB5_SASL_NAME, sasl_mech_name) || @@ -703,10 +704,11 @@ krb5_gss_inquire_attrs_for_mech(OM_uint32 *minor_status, if (GSS_ERROR(major)) goto cleanup; -#define MA_SUPPORTED(ma) do { \ - major = gss_add_oid_set_member(minor_status, (gss_OID)ma, mech_attrs); \ - if (GSS_ERROR(major)) \ - goto cleanup; \ +#define MA_SUPPORTED(ma) do { \ + major = gss_add_oid_set_member(minor_status, (gss_OID)ma, \ + mech_attrs); \ + if (GSS_ERROR(major)) \ + goto cleanup; \ } while (0) MA_SUPPORTED(GSS_C_MA_MECH_CONCRETE); diff --git a/src/lib/gssapi/krb5/import_name.c b/src/lib/gssapi/krb5/import_name.c index 7583be72d..0e730f98e 100644 --- a/src/lib/gssapi/krb5/import_name.c +++ b/src/lib/gssapi/krb5/import_name.c @@ -219,7 +219,7 @@ krb5_gss_import_name(minor_status, input_name_buffer, goto do_getpwuid; #endif } else if (g_OID_equal(input_name_type, gss_nt_exported_name)) { -#define BOUNDS_CHECK(cp, end, n) \ +#define BOUNDS_CHECK(cp, end, n) \ do { if ((end) - (cp) < (n)) goto fail_name; } while (0) cp = (unsigned char *)tmp; end = cp + input_name_buffer->length; diff --git a/src/lib/gssapi/krb5/init_sec_context.c b/src/lib/gssapi/krb5/init_sec_context.c index ea00c22af..0133bf084 100644 --- a/src/lib/gssapi/krb5/init_sec_context.c +++ b/src/lib/gssapi/krb5/init_sec_context.c @@ -1135,4 +1135,3 @@ krb5_gss_init_sec_context(minor_status, claimant_cred_handle, time_rec, &exts); } - diff --git a/src/lib/gssapi/krb5/prf.c b/src/lib/gssapi/krb5/prf.c index 66cbe7078..6fd34e954 100644 --- a/src/lib/gssapi/krb5/prf.c +++ b/src/lib/gssapi/krb5/prf.c @@ -132,4 +132,3 @@ cleanup: *minor_status = (OM_uint32)code; return (code == 0) ? GSS_S_COMPLETE : GSS_S_FAILURE; } - diff --git a/src/lib/gssapi/krb5/store_cred.c b/src/lib/gssapi/krb5/store_cred.c index 94cfd4326..5b4dfe8f7 100644 --- a/src/lib/gssapi/krb5/store_cred.c +++ b/src/lib/gssapi/krb5/store_cred.c @@ -182,4 +182,3 @@ krb5_gss_store_cred(OM_uint32 *minor_status, return GSS_S_COMPLETE; } - diff --git a/src/lib/gssapi/mechglue/g_acquire_cred_with_pw.c b/src/lib/gssapi/mechglue/g_acquire_cred_with_pw.c index 3030ee741..92b30bafe 100644 --- a/src/lib/gssapi/mechglue/g_acquire_cred_with_pw.c +++ b/src/lib/gssapi/mechglue/g_acquire_cred_with_pw.c @@ -177,7 +177,7 @@ OM_uint32 * time_rec; /* for each requested mech attempt to obtain a credential */ for (i = 0; i < mechs->count; i++) { major = gss_add_cred_with_password(minor_status, (gss_cred_id_t)creds, - desired_name, + desired_name, &mechs->elements[i], password, cred_usage, time_req, time_req, NULL, diff --git a/src/lib/gssapi/mechglue/g_mechattr.c b/src/lib/gssapi/mechglue/g_mechattr.c index 663e02ad4..64bb03bc3 100644 --- a/src/lib/gssapi/mechglue/g_mechattr.c +++ b/src/lib/gssapi/mechglue/g_mechattr.c @@ -90,11 +90,11 @@ testMechAttrsKnown(gss_const_OID_set critical, OM_uint32 KRB5_CALLCONV gss_indicate_mechs_by_attrs( - OM_uint32 *minor, - gss_const_OID_set desired_mech_attrs, - gss_const_OID_set except_mech_attrs, - gss_const_OID_set critical_mech_attrs, - gss_OID_set *mechs) + OM_uint32 *minor, + gss_const_OID_set desired_mech_attrs, + gss_const_OID_set except_mech_attrs, + gss_const_OID_set critical_mech_attrs, + gss_OID_set *mechs) { OM_uint32 status, tmpMinor; gss_OID_set allMechs = GSS_C_NO_OID_SET; @@ -154,10 +154,10 @@ cleanup: OM_uint32 KRB5_CALLCONV gss_inquire_attrs_for_mech( - OM_uint32 *minor, - gss_const_OID mech_oid, - gss_OID_set *mech_attrs, - gss_OID_set *known_mech_attrs) + OM_uint32 *minor, + gss_const_OID mech_oid, + gss_OID_set *mech_attrs, + gss_OID_set *known_mech_attrs) { OM_uint32 status, tmpMinor; gss_mechanism mech; @@ -214,11 +214,11 @@ gss_inquire_attrs_for_mech( OM_uint32 KRB5_CALLCONV gss_display_mech_attr( - OM_uint32 *minor, - gss_const_OID mech_attr, - gss_buffer_t name, - gss_buffer_t short_desc, - gss_buffer_t long_desc) + OM_uint32 *minor, + gss_const_OID mech_attr, + gss_buffer_t name, + gss_buffer_t short_desc, + gss_buffer_t long_desc) { return generic_gss_display_mech_attr(minor, mech_attr, name, short_desc, long_desc); diff --git a/src/lib/kadm5/srv/pwqual_princ.c b/src/lib/kadm5/srv/pwqual_princ.c index f733a393f..cbf2d7205 100644 --- a/src/lib/kadm5/srv/pwqual_princ.c +++ b/src/lib/kadm5/srv/pwqual_princ.c @@ -61,7 +61,7 @@ princ_check(krb5_context context, krb5_pwqual_moddata data, krb5_error_code pwqual_princ_initvt(krb5_context context, int maj_ver, int min_ver, - krb5_plugin_vtable vtable) + krb5_plugin_vtable vtable) { krb5_pwqual_vtable vt; diff --git a/src/lib/krb5/asn.1/asn1_k_decode_fast.c b/src/lib/krb5/asn.1/asn1_k_decode_fast.c index 6d9ddd436..57546ac93 100644 --- a/src/lib/krb5/asn.1/asn1_k_decode_fast.c +++ b/src/lib/krb5/asn.1/asn1_k_decode_fast.c @@ -76,4 +76,3 @@ asn1_decode_fast_finished_ptr(asn1buf *buf, krb5_fast_finished **valptr) { decode_ptr( krb5_fast_finished *, asn1_decode_fast_finished); } - diff --git a/src/lib/krb5/asn.1/asn1_k_decode_kdc.c b/src/lib/krb5/asn.1/asn1_k_decode_kdc.c index 52c371b9b..1711ca04a 100644 --- a/src/lib/krb5/asn.1/asn1_k_decode_kdc.c +++ b/src/lib/krb5/asn.1/asn1_k_decode_kdc.c @@ -25,7 +25,7 @@ */ #include "asn1_k_decode_macros.h" - + asn1_error_code asn1_decode_kdc_req(asn1buf *buf, krb5_kdc_req *val) { @@ -47,7 +47,7 @@ error_out: val->padata = NULL; return retval; } - + asn1_error_code asn1_decode_kdc_req_body(asn1buf *buf, krb5_kdc_req *val) { diff --git a/src/lib/krb5/asn.1/asn1_k_decode_macros.h b/src/lib/krb5/asn.1/asn1_k_decode_macros.h index de433c2da..e7c8a54eb 100644 --- a/src/lib/krb5/asn.1/asn1_k_decode_macros.h +++ b/src/lib/krb5/asn.1/asn1_k_decode_macros.h @@ -41,11 +41,11 @@ #define clean_return(val) { retval = val; goto error_out; } /* Declare useful decoder variables. */ -#define setup() \ - asn1_error_code retval; \ - asn1_class asn1class; \ - asn1_construction construction KRB5_ATTR_UNUSED; \ - asn1_tagnum tagnum; \ +#define setup() \ + asn1_error_code retval; \ + asn1_class asn1class; \ + asn1_construction construction KRB5_ATTR_UNUSED; \ + asn1_tagnum tagnum; \ unsigned int length, taglen KRB5_ATTR_UNUSED #define unused_var(x) if (0) { x = 0; x = x - x; } diff --git a/src/lib/krb5/asn.1/asn1_k_decode_sam.c b/src/lib/krb5/asn.1/asn1_k_decode_sam.c index ae4e42f4b..70405eb2f 100644 --- a/src/lib/krb5/asn.1/asn1_k_decode_sam.c +++ b/src/lib/krb5/asn.1/asn1_k_decode_sam.c @@ -270,4 +270,3 @@ error_out: krb5_free_predicted_sam_response_contents(NULL, val); return retval; } - diff --git a/src/lib/krb5/asn.1/asn1_k_encode.c b/src/lib/krb5/asn.1/asn1_k_encode.c index 746b9128c..fffe9474c 100644 --- a/src/lib/krb5/asn.1/asn1_k_encode.c +++ b/src/lib/krb5/asn.1/asn1_k_encode.c @@ -1419,7 +1419,7 @@ static unsigned int iakerb_finished_optional(const void *p) } DEFSEQTYPE(iakerb_finished, krb5_iakerb_finished, iakerb_finished_fields, -iakerb_finished_optional); + iakerb_finished_optional); /* Exported complete encoders -- these produce a krb5_data with the encoding in the correct byte order. */ diff --git a/src/lib/krb5/asn.1/krb5_decode_kdc.c b/src/lib/krb5/asn.1/krb5_decode_kdc.c index 36380c2fb..ac6ef2056 100644 --- a/src/lib/krb5/asn.1/krb5_decode_kdc.c +++ b/src/lib/krb5/asn.1/krb5_decode_kdc.c @@ -95,7 +95,7 @@ decode_krb5_kdc_req_body(const krb5_data *code, krb5_kdc_req **repptr) cleanup(free); } - + krb5_error_code decode_krb5_fast_req(const krb5_data *code, krb5_fast_req **repptr) { @@ -167,4 +167,3 @@ decode_krb5_pa_pk_as_req_draft9(const krb5_data *code, cleanup(free); } #endif /* DISABLE_PKINIT */ - diff --git a/src/lib/krb5/asn.1/krb5_decode_macros.h b/src/lib/krb5/asn.1/krb5_decode_macros.h index 16ae6fe2f..aada1be62 100644 --- a/src/lib/krb5/asn.1/krb5_decode_macros.h +++ b/src/lib/krb5/asn.1/krb5_decode_macros.h @@ -53,9 +53,9 @@ retval = asn1buf_wrap_data(&buf,code); \ if (retval) return retval -#define setup_no_tagnum(type) \ - asn1_class asn1class KRB5_ATTR_UNUSED; \ - asn1_construction construction KRB5_ATTR_UNUSED; \ +#define setup_no_tagnum(type) \ + asn1_class asn1class KRB5_ATTR_UNUSED; \ + asn1_construction construction KRB5_ATTR_UNUSED; \ setup_buf_only(type) #define setup_no_length(type) \ diff --git a/src/lib/krb5/krb/authdata.c b/src/lib/krb5/krb/authdata.c index 351762eb1..a24143062 100644 --- a/src/lib/krb5/krb/authdata.c +++ b/src/lib/krb5/krb/authdata.c @@ -1199,7 +1199,7 @@ krb5_ser_authdata_context_init(krb5_context kcontext) krb5_error_code krb5int_copy_authdatum(krb5_context context, - const krb5_authdata *inad, krb5_authdata **outad) + const krb5_authdata *inad, krb5_authdata **outad) { krb5_authdata *tmpad; diff --git a/src/lib/krb5/krb/authdata_dec.c b/src/lib/krb5/krb/authdata_dec.c index 5c9efbb16..9809b3376 100644 --- a/src/lib/krb5/krb/authdata_dec.c +++ b/src/lib/krb5/krb/authdata_dec.c @@ -105,7 +105,7 @@ grow_find_authdata(krb5_context context, struct find_authdata_context *fctx, } fctx->out[fctx->length+1] = NULL; retval = krb5int_copy_authdatum(context, elem, - &fctx->out[fctx->length]); + &fctx->out[fctx->length]); if (retval == 0) fctx->length++; return retval; diff --git a/src/lib/krb5/krb/copy_auth.c b/src/lib/krb5/krb/copy_auth.c index a22d8cbb8..06a06450c 100644 --- a/src/lib/krb5/krb/copy_auth.c +++ b/src/lib/krb5/krb/copy_auth.c @@ -86,7 +86,7 @@ krb5_merge_authdata(krb5_context context, if (inauthdat1) { for (nelems = 0; inauthdat1[nelems]; nelems++) { retval = krb5int_copy_authdatum(context, inauthdat1[nelems], - &tempauthdat[nelems]); + &tempauthdat[nelems]); if (retval) { krb5_free_authdata(context, tempauthdat); return retval; @@ -97,7 +97,7 @@ krb5_merge_authdata(krb5_context context, if (inauthdat2) { for (nelems2 = 0; inauthdat2[nelems2]; nelems2++) { retval = krb5int_copy_authdatum(context, inauthdat2[nelems2], - &tempauthdat[nelems++]); + &tempauthdat[nelems++]); if (retval) { krb5_free_authdata(context, tempauthdat); return retval; diff --git a/src/lib/krb5/krb/fast.c b/src/lib/krb5/krb/fast.c index 0d04cc2b0..2290d4874 100644 --- a/src/lib/krb5/krb/fast.c +++ b/src/lib/krb5/krb/fast.c @@ -153,7 +153,7 @@ krb5int_fast_as_armor(krb5_context context, &ccache); if (retval == 0) { retval = krb5int_tgtname(context, target_realm, target_realm, - &target_principal); + &target_principal); } if (retval == 0) { krb5_data config_data; diff --git a/src/lib/krb5/krb/gic_opt.c b/src/lib/krb5/krb/gic_opt.c index acb6f126d..a98a47ed2 100644 --- a/src/lib/krb5/krb/gic_opt.c +++ b/src/lib/krb5/krb/gic_opt.c @@ -228,8 +228,8 @@ krb5_get_init_creds_opt_free(krb5_context context, static krb5_error_code gic_opte_copy(krb5_context context, - krb5_get_init_creds_opt *opt, - krb5_gic_opt_ext **opte) + krb5_get_init_creds_opt *opt, + krb5_gic_opt_ext **opte) { krb5_gic_opt_ext *oe; diff --git a/src/lib/krb5/krb/init_ctx.c b/src/lib/krb5/krb/init_ctx.c index 4896bef02..f244d566e 100644 --- a/src/lib/krb5/krb/init_ctx.c +++ b/src/lib/krb5/krb/init_ctx.c @@ -143,12 +143,12 @@ krb5_init_context_profile(profile_t profile, krb5_flags flags, * The context being NULL is ok. */ krb5_win_ccdll_load(ctx); -p - /* - * krb5_vercheck() is defined in win_glue.c, and this is - * where we handle the timebomb and version server checks. - */ - retval = krb5_vercheck(); + p + /* + * krb5_vercheck() is defined in win_glue.c, and this is + * where we handle the timebomb and version server checks. + */ + retval = krb5_vercheck(); if (retval) return retval; #endif diff --git a/src/lib/krb5/krb/int-proto.h b/src/lib/krb5/krb/int-proto.h index 4a3cea80d..336c04571 100644 --- a/src/lib/krb5/krb/int-proto.h +++ b/src/lib/krb5/krb/int-proto.h @@ -29,7 +29,7 @@ krb5_error_code krb5int_tgtname(krb5_context context, const krb5_data *, const krb5_data *, - krb5_principal *); + krb5_principal *); krb5_error_code krb5int_libdefault_boolean(krb5_context, const krb5_data *, const char *, diff --git a/src/lib/krb5/krb/rd_cred.c b/src/lib/krb5/krb/rd_cred.c index df9497b2d..22eb4ec7c 100644 --- a/src/lib/krb5/krb/rd_cred.c +++ b/src/lib/krb5/krb/rd_cred.c @@ -208,15 +208,15 @@ krb5_rd_cred(krb5_context context, krb5_auth_context auth_context, * If decrypting with the subsession key fails, perhaps the * credentials are stored in the session key so try decrypting with that. */ - if (auth_context->recv_subkey == NULL || - (retval = krb5_rd_cred_basic(context, pcreddata, - auth_context->recv_subkey, - &replaydata, pppcreds))) { - retval = krb5_rd_cred_basic(context, pcreddata, - auth_context->key, - &replaydata, pppcreds); - if (retval) - return retval; + if (auth_context->recv_subkey == NULL || + (retval = krb5_rd_cred_basic(context, pcreddata, + auth_context->recv_subkey, + &replaydata, pppcreds))) { + retval = krb5_rd_cred_basic(context, pcreddata, + auth_context->key, + &replaydata, pppcreds); + if (retval) + return retval; } if (auth_context->auth_context_flags & KRB5_AUTH_CONTEXT_DO_TIME) { diff --git a/src/lib/krb5/krb/s4u_authdata.c b/src/lib/krb5/krb/s4u_authdata.c index 54713cc85..d93e75816 100644 --- a/src/lib/krb5/krb/s4u_authdata.c +++ b/src/lib/krb5/krb/s4u_authdata.c @@ -190,7 +190,7 @@ s4u2proxy_export_authdata(krb5_context kcontext, *out_authdata = authdata; - return 0; + return 0; } static krb5_error_code @@ -287,8 +287,8 @@ s4u2proxy_get_attribute(krb5_context kcontext, const krb5_data *attribute, krb5_boolean *authenticated, krb5_boolean *complete, - krb5_data *value, - krb5_data *display_value, + krb5_data *value, + krb5_data *display_value, int *more) { struct s4u2proxy_context *s4uctx = (struct s4u2proxy_context *)request_context; @@ -423,7 +423,7 @@ s4u2proxy_size(krb5_context kcontext, if (code != 0) return code; } - + *sizep += sizeof(krb5_int32); /* authenticated flag */ return code; @@ -463,7 +463,7 @@ s4u2proxy_externalize(krb5_context kcontext, if (code != 0) return code; } - + krb5_ser_pack_int32(s4uctx->authenticated, &bp, &remain); /* authenticated */ *buffer = bp; @@ -599,4 +599,3 @@ krb5plugin_authdata_client_ftable_v0 krb5int_s4u2proxy_authdata_client_ftable = s4u2proxy_internalize, s4u2proxy_copy }; - diff --git a/src/lib/krb5/krb/s4u_creds.c b/src/lib/krb5/krb/s4u_creds.c index 57e8b92d4..e4cc8a14b 100644 --- a/src/lib/krb5/krb/s4u_creds.c +++ b/src/lib/krb5/krb/s4u_creds.c @@ -82,7 +82,7 @@ s4u_identify_user(krb5_context context, return krb5_copy_principal(context, anonymous ? in_creds->server - : in_creds->client, + : in_creds->client, canon_user); } @@ -685,14 +685,14 @@ krb5_get_credentials_for_user(krb5_context context, krb5_flags options, if (in_creds->client != NULL && in_creds->client->type == KRB5_NT_ENTERPRISE_PRINCIPAL) { - /* Post-canonicalisation check for enterprise principals */ - krb5_creds mcreds = *in_creds; - mcreds.client = realm; - code = krb5_get_credentials(context, options | KRB5_GC_CACHED, - ccache, &mcreds, out_creds); - if ((code != KRB5_CC_NOTFOUND && code != KRB5_CC_NOT_KTYPE) - || (options & KRB5_GC_CACHED)) - goto cleanup; + /* Post-canonicalisation check for enterprise principals */ + krb5_creds mcreds = *in_creds; + mcreds.client = realm; + code = krb5_get_credentials(context, options | KRB5_GC_CACHED, + ccache, &mcreds, out_creds); + if ((code != KRB5_CC_NOTFOUND && code != KRB5_CC_NOT_KTYPE) + || (options & KRB5_GC_CACHED)) + goto cleanup; } code = krb5_get_self_cred_from_kdc(context, options, ccache, diff --git a/src/lib/krb5/krb/t_expire_warn.c b/src/lib/krb5/krb/t_expire_warn.c index c6ff8242e..1e59acba1 100644 --- a/src/lib/krb5/krb/t_expire_warn.c +++ b/src/lib/krb5/krb/t_expire_warn.c @@ -30,7 +30,7 @@ static int exp_dummy, prompt_dummy; static krb5_error_code prompter_cb(krb5_context ctx, void *data, const char *name, - const char *banner, int num_prompts, krb5_prompt prompts[]) + const char *banner, int num_prompts, krb5_prompt prompts[]) { /* Not expecting any actual prompts, only banners. */ assert(num_prompts == 0); @@ -41,7 +41,7 @@ prompter_cb(krb5_context ctx, void *data, const char *name, static void expire_cb(krb5_context ctx, void *data, krb5_timestamp password_expiration, - krb5_timestamp account_expiration, krb5_boolean is_last_req) + krb5_timestamp account_expiration, krb5_boolean is_last_req) { printf("password_expiration = %ld\n", (long)password_expiration); printf("account_expiration = %ld\n", (long)account_expiration); @@ -59,26 +59,26 @@ main(int argc, char **argv) krb5_creds creds; if (argc < 4) { - fprintf(stderr, "Usage: %s username password {1|0} [service]\n", - argv[0]); - return 1; + fprintf(stderr, "Usage: %s username password {1|0} [service]\n", + argv[0]); + return 1; } user = argv[1]; password = argv[2]; use_cb = atoi(argv[3]); if (argc >= 5) - service = argv[4]; + service = argv[4]; assert(krb5_init_context(&ctx) == 0); assert(krb5_get_init_creds_opt_alloc(ctx, &opt) == 0); if (use_cb) { - assert(krb5_get_init_creds_opt_set_expire_callback(ctx, opt, expire_cb, - &exp_dummy) == 0); + assert(krb5_get_init_creds_opt_set_expire_callback(ctx, opt, expire_cb, + &exp_dummy) == 0); } assert(krb5_parse_name(ctx, user, &client) == 0); assert(krb5_get_init_creds_password(ctx, &creds, client, password, - prompter_cb, &prompt_dummy, 0, service, - opt) == 0); + prompter_cb, &prompt_dummy, 0, service, + opt) == 0); krb5_get_init_creds_opt_free(ctx, opt); krb5_free_principal(ctx, client); krb5_free_cred_contents(ctx, &creds); diff --git a/src/lib/krb5/krb/t_vfy_increds.c b/src/lib/krb5/krb/t_vfy_increds.c index 4fb2498f2..e5d68777a 100644 --- a/src/lib/krb5/krb/t_vfy_increds.c +++ b/src/lib/krb5/krb/t_vfy_increds.c @@ -51,6 +51,6 @@ main(int argc, char **argv) assert(krb5_cc_close(context, ccache) == 0); if (krb5_verify_init_creds(context, &creds, NULL, NULL, NULL, NULL) != 0) - return 1; + return 1; return 0; } diff --git a/src/lib/krb5/krb/val_renew.c b/src/lib/krb5/krb/val_renew.c index ef37bdfed..39912aaa8 100644 --- a/src/lib/krb5/krb/val_renew.c +++ b/src/lib/krb5/krb/val_renew.c @@ -46,7 +46,7 @@ */ static krb5_error_code get_new_creds(krb5_context context, krb5_ccache ccache, krb5_creds *in_creds, - krb5_flags kdcopt, krb5_creds **out_creds) + krb5_flags kdcopt, krb5_creds **out_creds) { krb5_error_code code; krb5_creds old_creds, *new_creds = NULL; @@ -55,19 +55,19 @@ get_new_creds(krb5_context context, krb5_ccache ccache, krb5_creds *in_creds, /* Retrieve an existing cached credential matching in_creds. */ code = krb5_cc_retrieve_cred(context, ccache, KRB5_TC_SUPPORTED_KTYPES, - in_creds, &old_creds); + in_creds, &old_creds); if (code != 0) - return code; + return code; /* Use KDC options from old credential as well as requested options. */ kdcopt |= (old_creds.ticket_flags & KDC_TKT_COMMON_MASK); /* Use the old credential to get a new credential from the KDC. */ code = krb5_get_cred_via_tkt(context, &old_creds, kdcopt, - old_creds.addresses, in_creds, &new_creds); + old_creds.addresses, in_creds, &new_creds); krb5_free_cred_contents(context, &old_creds); if (code != 0) - return code; + return code; *out_creds = new_creds; return code; @@ -80,7 +80,7 @@ get_new_creds(krb5_context context, krb5_ccache ccache, krb5_creds *in_creds, */ static krb5_error_code gc_valrenew(krb5_context context, krb5_ccache ccache, krb5_creds *in_creds, - krb5_flags kdcopt, krb5_creds **out_creds) + krb5_flags kdcopt, krb5_creds **out_creds) { krb5_error_code code; krb5_creds *new_creds = NULL; @@ -89,7 +89,7 @@ gc_valrenew(krb5_context context, krb5_ccache ccache, krb5_creds *in_creds, /* Get the validated or renewed credential. */ code = get_new_creds(context, ccache, in_creds, kdcopt, &new_creds); if (code != 0) - goto cleanup; + goto cleanup; /* Reinitialize the cache without changing its default principal. */ code = krb5_cc_get_principal(context, ccache, &default_princ); @@ -102,7 +102,7 @@ gc_valrenew(krb5_context context, krb5_ccache ccache, krb5_creds *in_creds, /* Store the validated or renewed cred in the now-empty cache. */ code = krb5_cc_store_cred(context, ccache, new_creds); if (code != 0) - goto cleanup; + goto cleanup; *out_creds = new_creds; new_creds = NULL; @@ -135,29 +135,29 @@ krb5_get_credentials_renew(krb5_context context, krb5_flags options, */ static krb5_error_code get_valrenewed_creds(krb5_context context, krb5_creds *out_creds, - krb5_principal client, krb5_ccache ccache, - char *in_tkt_service, int kdcopt) + krb5_principal client, krb5_ccache ccache, + char *in_tkt_service, int kdcopt) { krb5_error_code code; krb5_creds in_creds, *new_creds; krb5_principal server = NULL; if (in_tkt_service != NULL) { - /* Parse in_tkt_service, but use the client's realm. */ - code = krb5_parse_name(context, in_tkt_service, &server); - if (code != 0) - goto cleanup; - krb5_free_data_contents(context, &server->realm); - code = krb5int_copy_data_contents(context, &client->realm, - &server->realm); - if (code != 0) - goto cleanup; + /* Parse in_tkt_service, but use the client's realm. */ + code = krb5_parse_name(context, in_tkt_service, &server); + if (code != 0) + goto cleanup; + krb5_free_data_contents(context, &server->realm); + code = krb5int_copy_data_contents(context, &client->realm, + &server->realm); + if (code != 0) + goto cleanup; } else { - /* Use the TGT name for the client's realm. */ - code = krb5int_tgtname(context, &client->realm, &client->realm, - &server); - if (code != 0) - goto cleanup; + /* Use the TGT name for the client's realm. */ + code = krb5int_tgtname(context, &client->realm, &client->realm, + &server); + if (code != 0) + goto cleanup; } memset(&in_creds, 0, sizeof(krb5_creds)); @@ -167,7 +167,7 @@ get_valrenewed_creds(krb5_context context, krb5_creds *out_creds, /* Get the validated or renewed credential from the KDC. */ code = get_new_creds(context, ccache, &in_creds, kdcopt, &new_creds); if (code != 0) - goto cleanup; + goto cleanup; /* Fill in *out_creds and free the unwanted new_creds container. */ *out_creds = *new_creds; @@ -180,18 +180,18 @@ cleanup: krb5_error_code KRB5_CALLCONV krb5_get_validated_creds(krb5_context context, krb5_creds *creds, - krb5_principal client, krb5_ccache ccache, - char *in_tkt_service) + krb5_principal client, krb5_ccache ccache, + char *in_tkt_service) { return get_valrenewed_creds(context, creds, client, ccache, - in_tkt_service, KDC_OPT_VALIDATE); + in_tkt_service, KDC_OPT_VALIDATE); } krb5_error_code KRB5_CALLCONV krb5_get_renewed_creds(krb5_context context, krb5_creds *creds, - krb5_principal client, krb5_ccache ccache, - char *in_tkt_service) + krb5_principal client, krb5_ccache ccache, + char *in_tkt_service) { return get_valrenewed_creds(context, creds, client, ccache, - in_tkt_service, KDC_OPT_RENEW); + in_tkt_service, KDC_OPT_RENEW); } diff --git a/src/lib/krb5/os/locate_kdc.c b/src/lib/krb5/os/locate_kdc.c index 8bcfb2678..acfce8c87 100644 --- a/src/lib/krb5/os/locate_kdc.c +++ b/src/lib/krb5/os/locate_kdc.c @@ -186,8 +186,8 @@ add_host_to_list(struct serverlist *list, const char *hostname, int port, static krb5_error_code locate_srv_conf_1(krb5_context context, const krb5_data *realm, - const char * name, struct serverlist *serverlist, - int socktype, int udpport, int sec_udpport) + const char * name, struct serverlist *serverlist, + int socktype, int udpport, int sec_udpport) { const char *realm_srv_names[4]; char **hostlist, *host, *port, *cp; diff --git a/src/lib/krb5/os/trace.c b/src/lib/krb5/os/trace.c index 83df52eb7..a31b0059f 100644 --- a/src/lib/krb5/os/trace.c +++ b/src/lib/krb5/os/trace.c @@ -8,7 +8,7 @@ * require a specific license from the United States Government. * It is the responsibility of any person or organization contemplating * export to obtain such a license before exporting. - * + * * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and * distribute this software and its documentation for any purpose and * without fee is hereby granted, provided that the above copyright diff --git a/src/plugins/kdb/db2/kdb_db2.c b/src/plugins/kdb/db2/kdb_db2.c index c7756f595..f24b6575d 100644 --- a/src/plugins/kdb/db2/kdb_db2.c +++ b/src/plugins/kdb/db2/kdb_db2.c @@ -684,7 +684,7 @@ ctx_create_db(krb5_context context, krb5_db2_context *dbc) return retval; dbc->db_lf_file = open(dbc->db_lf_name, O_CREAT | O_RDWR | O_TRUNC, - 0600); + 0600); if (dbc->db_lf_file < 0) { retval = errno; goto cleanup; diff --git a/src/plugins/kdb/hdb/kdb_hdb.c b/src/plugins/kdb/hdb/kdb_hdb.c index 31c67ebc0..a001ee316 100644 --- a/src/plugins/kdb/hdb/kdb_hdb.c +++ b/src/plugins/kdb/hdb/kdb_hdb.c @@ -1088,7 +1088,7 @@ kh_dbekd_decrypt_key_data(krb5_context context, if (mkey->enctype != ENCTYPE_UNKNOWN) code = krb5_dbe_def_decrypt_key_data(context, mkey, key_data, - kkey, keysalt); + kkey, keysalt); else code = kh_decrypt_key(context, kh, key_data, kkey, keysalt); diff --git a/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c b/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c index 51c0ee1d0..2f2446ab7 100644 --- a/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c +++ b/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c @@ -69,7 +69,7 @@ #define CMS_get1_crls(_p7) (_p7->d.sign->crl) #define CMS_get1_certs(_p7) (_p7->d.sign->cert) #define CMS_ContentInfo_free(_p7) PKCS7_free(_p7) -#define pkinit_CMS_SignerInfo_get_cert(_p7,_si,_x509_pp) \ +#define pkinit_CMS_SignerInfo_get_cert(_p7,_si,_x509_pp) \ (*_x509_pp) = PKCS7_cert_from_signer_info(_p7,_si) #endif diff --git a/src/plugins/preauth/securid_sam2/securid2.c b/src/plugins/preauth/securid_sam2/securid2.c index be6a32b4a..816946eeb 100644 --- a/src/plugins/preauth/securid_sam2/securid2.c +++ b/src/plugins/preauth/securid_sam2/securid2.c @@ -363,11 +363,11 @@ verify_securid_data_2(krb5_context context, krb5_db_entry *client, if ((sr2->sam_enc_nonce_or_sad.ciphertext.data == NULL) || (sr2->sam_enc_nonce_or_sad.ciphertext.length <= 0)) { - retval = KRB5KDC_ERR_PREAUTH_FAILED; - krb5_set_error_message(context, retval, - "No preauth data supplied in " - "verify_securid_data_2 (%s)", user); - goto cleanup; + retval = KRB5KDC_ERR_PREAUTH_FAILED; + krb5_set_error_message(context, retval, + "No preauth data supplied in " + "verify_securid_data_2 (%s)", user); + goto cleanup; } retval = krb5_dbe_find_enctype(context, client, @@ -463,7 +463,7 @@ verify_securid_data_2(krb5_context context, krb5_db_entry *client, com_err("krb5kdc", retval, "while decrypting SecurID trackID in " "verify_securid_data_2 (%s)", user); - goto cleanup; + goto cleanup; } if (track_id_data.length < sizeof (struct securid_track_data)) { retval = KRB5KDC_ERR_PREAUTH_FAILED; @@ -682,11 +682,11 @@ verify_securid_data_2(krb5_context context, krb5_db_entry *client, retval = securid_encrypt_track_data_2(context, client, &tmp_data, &sc2b.sam_track_id); if (retval) { - com_err("krb5kdc", retval, - "while encrypting SecurID track " - "data for SAM_CHALLENGE_2 (%s)", - securid_user); - goto cleanup; + com_err("krb5kdc", retval, + "while encrypting SecurID track " + "data for SAM_CHALLENGE_2 (%s)", + securid_user); + goto cleanup; } retval = securid_make_sam_challenge_2_and_cksum(context, sc2p, &sc2b, diff --git a/src/plugins/preauth/securid_sam2/securid_sam2_main.c b/src/plugins/preauth/securid_sam2/securid_sam2_main.c index 6bc65e85e..0c420d226 100644 --- a/src/plugins/preauth/securid_sam2/securid_sam2_main.c +++ b/src/plugins/preauth/securid_sam2/securid_sam2_main.c @@ -61,7 +61,7 @@ sam_get_db_entry(krb5_context context, krb5_principal client, krb5_error_code retval; if (db_entry) - *db_entry = NULL; + *db_entry = NULL; retval = krb5_copy_principal(context, client, &newp); if (retval) { com_err("krb5kdc", retval, "copying client name for preauth probe"); @@ -71,45 +71,45 @@ sam_get_db_entry(krb5_context context, krb5_principal client, probeslot = krb5_princ_size(context, newp)++; ptr = realloc(krb5_princ_name(context, newp), krb5_princ_size(context, newp) * sizeof(krb5_data)); - if (ptr == NULL) { - retval = ENOMEM; - goto cleanup; - } - krb5_princ_name(context, newp) = ptr; + if (ptr == NULL) { + retval = ENOMEM; + goto cleanup; + } + krb5_princ_name(context, newp) = ptr; - for(sam_ptr = sam_inst_map; sam_ptr->name; sam_ptr++) { - if (*sam_type && *sam_type != sam_ptr->sam_type) - continue; + for(sam_ptr = sam_inst_map; sam_ptr->name; sam_ptr++) { + if (*sam_type && *sam_type != sam_ptr->sam_type) + continue; - krb5_princ_component(context,newp,probeslot)->data = sam_ptr->name; - krb5_princ_component(context,newp,probeslot)->length = - strlen(sam_ptr->name); - retval = krb5_db_get_principal(context, newp, 0, &assoc); - if (!retval) - break; - } + krb5_princ_component(context,newp,probeslot)->data = sam_ptr->name; + krb5_princ_component(context,newp,probeslot)->length = + strlen(sam_ptr->name); + retval = krb5_db_get_principal(context, newp, 0, &assoc); + if (!retval) + break; + } cleanup: - if (ptr) { - krb5_princ_component(context,newp,probeslot)->data = 0; - krb5_princ_component(context,newp,probeslot)->length = 0; - krb5_free_principal(context, newp); - } - if (probeslot) - krb5_princ_size(context, newp)--; - if (retval) - return retval; - if (sam_ptr->sam_type) { - /* Found entry of type sam_ptr->sam_type */ - if (sam_type) - *sam_type = sam_ptr->sam_type; - if (db_entry) - *db_entry = assoc; - else - krb5_db_free_principal(context, assoc); - return 0; - } else { - return KRB5KDC_ERR_C_PRINCIPAL_UNKNOWN; - } + if (ptr) { + krb5_princ_component(context,newp,probeslot)->data = 0; + krb5_princ_component(context,newp,probeslot)->length = 0; + krb5_free_principal(context, newp); + } + if (probeslot) + krb5_princ_size(context, newp)--; + if (retval) + return retval; + if (sam_ptr->sam_type) { + /* Found entry of type sam_ptr->sam_type */ + if (sam_type) + *sam_type = sam_ptr->sam_type; + if (db_entry) + *db_entry = assoc; + else + krb5_db_free_principal(context, assoc); + return 0; + } else { + return KRB5KDC_ERR_C_PRINCIPAL_UNKNOWN; + } } static krb5_error_code @@ -247,14 +247,16 @@ kdc_verify_preauth(krb5_context context, struct _krb5_db_entry_new *client, break; } - /* - * It is up to the method-specific verify routine to set the ticket flags to - * indicate TKT_FLG_HW_AUTH and/or TKT_FLG_PRE_AUTH. Some methods may - * require more than one round of dialog with the client and must return - * successfully from their verify routine. If does not set the TGT flags, - * the required_preauth conditions will not be met and it will try again to - * get enough preauth data from the client. Do not set TGT flags here. - */ + /* + * It is up to the method-specific verify routine to set the + * ticket flags to indicate TKT_FLG_HW_AUTH and/or + * TKT_FLG_PRE_AUTH. Some methods may require more than one round + * of dialog with the client and must return successfully from + * their verify routine. If does not set the TGT flags, the + * required_preauth conditions will not be met and it will try + * again to get enough preauth data from the client. Do not set + * TGT flags here. + */ cleanup: /* * Note that e_data is an output even in error conditions. If we diff --git a/src/slave/kprop_sock.c b/src/slave/kprop_sock.c index abd53af5d..a439b378c 100644 --- a/src/slave/kprop_sock.c +++ b/src/slave/kprop_sock.c @@ -40,29 +40,29 @@ */ krb5_error_code sockaddr2krbaddr(krb5_context context, int family, struct sockaddr *sa, - krb5_address **dest) + krb5_address **dest) { krb5_address addr; addr.magic = KV5M_ADDRESS; if (family == AF_INET) { - struct sockaddr_in *sa4 = (struct sockaddr_in *) sa; - addr.addrtype = ADDRTYPE_INET; - addr.length = sizeof(sa4->sin_addr); - addr.contents = (krb5_octet *) &sa4->sin_addr; + struct sockaddr_in *sa4 = (struct sockaddr_in *) sa; + addr.addrtype = ADDRTYPE_INET; + addr.length = sizeof(sa4->sin_addr); + addr.contents = (krb5_octet *) &sa4->sin_addr; } else if (family == AF_INET6) { - struct sockaddr_in6 *sa6 = (struct sockaddr_in6 *) sa; + struct sockaddr_in6 *sa6 = (struct sockaddr_in6 *) sa; if (IN6_IS_ADDR_V4MAPPED(&sa6->sin6_addr)) { addr.addrtype = ADDRTYPE_INET; addr.contents = (krb5_octet *) &sa6->sin6_addr + 12; addr.length = 4; } else { - addr.addrtype = ADDRTYPE_INET6; - addr.length = sizeof(sa6->sin6_addr); - addr.contents = (krb5_octet *) &sa6->sin6_addr; - } + addr.addrtype = ADDRTYPE_INET6; + addr.length = sizeof(sa6->sin6_addr); + addr.contents = (krb5_octet *) &sa6->sin6_addr; + } } else - return KRB5_PROG_ATYPE_NOSUPP; + return KRB5_PROG_ATYPE_NOSUPP; return krb5_copy_addr(context, &addr, dest); } diff --git a/src/tests/gssapi/t_imp_cred.c b/src/tests/gssapi/t_imp_cred.c index 063fd9ff6..f15a274f9 100644 --- a/src/tests/gssapi/t_imp_cred.c +++ b/src/tests/gssapi/t_imp_cred.c @@ -113,17 +113,17 @@ main(int argc, char *argv[]) /* Acquire the krb5 objects we need. */ ret = krb5_init_context(&context); if (ret) - exit_kerr(NULL, "krb5_init_context", ret); + exit_kerr(NULL, "krb5_init_context", ret); ret = krb5_cc_default(context, &cc); if (ret) - exit_kerr(context, "krb5_cc_default", ret); + exit_kerr(context, "krb5_cc_default", ret); ret = krb5_kt_default(context, &kt); if (ret) - exit_kerr(context, "krb5_kt_default", ret); + exit_kerr(context, "krb5_kt_default", ret); if (argc >= 3) { - ret = krb5_parse_name(context, argv[2], &princ); - if (ret) - exit_kerr(context, "krb5_parse_name", ret); + ret = krb5_parse_name(context, argv[2], &princ); + if (ret) + exit_kerr(context, "krb5_parse_name", ret); } /* Get initiator cred. */ diff --git a/src/tests/gssapi/t_spnego.c b/src/tests/gssapi/t_spnego.c index 91690b786..54ab14739 100644 --- a/src/tests/gssapi/t_spnego.c +++ b/src/tests/gssapi/t_spnego.c @@ -122,7 +122,7 @@ displayOID(OM_uint32 *minor, gss_OID oid, char *tag) static OM_uint32 initAcceptSecContext(OM_uint32 *minor, - gss_name_t target_name, + gss_name_t target_name, gss_cred_id_t verifier_cred_handle) { OM_uint32 major; diff --git a/src/tests/threads/init_ctx.c b/src/tests/threads/init_ctx.c index 92c0ef6f1..7a59a1dd4 100644 --- a/src/tests/threads/init_ctx.c +++ b/src/tests/threads/init_ctx.c @@ -165,12 +165,12 @@ static void run_iterations (struct resource_info *r) r->start_time = now (); for (i = 0; i < iter_count; i++) { - err = krb5_init_context(&ctx); - if (err) { - com_err(prog, err, "initializing krb5 context"); - exit(1); - } - krb5_free_context(ctx); + err = krb5_init_context(&ctx); + if (err) { + com_err(prog, err, "initializing krb5 context"); + exit(1); + } + krb5_free_context(ctx); } r->end_time = now (); } diff --git a/src/tests/threads/profread.c b/src/tests/threads/profread.c index a9ce3d6b2..3909f236e 100644 --- a/src/tests/threads/profread.c +++ b/src/tests/threads/profread.c @@ -168,22 +168,22 @@ static void run_iterations (struct resource_info *r) err = krb5_init_context(&ctx); if (err) { - com_err(prog, err, "initializing krb5 context"); - exit(1); + com_err(prog, err, "initializing krb5 context"); + exit(1); } err = krb5_get_profile(ctx, &prof); if (err) { - com_err(prog, err, "fetching profile from context"); - exit(1); + com_err(prog, err, "fetching profile from context"); + exit(1); } r->start_time = now (); for (i = 0; i < iter_count; i++) { - int ival; - err = profile_get_integer(prof, "one", "two", "three", 42, &ival); - if (err) { - com_err(prog, err, "fetching value from profile"); - exit(1); - } + int ival; + err = profile_get_integer(prof, "one", "two", "three", 42, &ival); + if (err) { + com_err(prog, err, "fetching value from profile"); + exit(1); + } } r->end_time = now (); profile_release (prof); diff --git a/src/util/gss-kernel-lib/t_kgss_kernel.c b/src/util/gss-kernel-lib/t_kgss_kernel.c index b529620d9..890a7d949 100644 --- a/src/util/gss-kernel-lib/t_kgss_kernel.c +++ b/src/util/gss-kernel-lib/t_kgss_kernel.c @@ -44,7 +44,7 @@ check(OM_uint32 major, OM_uint32 minor, const char *fn) if (!GSS_ERROR(major)) return; fprintf(stderr, "t_kgss_kernel: %s: major %u, minor %u\n", fn, major, - minor); + minor); /* libkgss doesn't have gss_display_status. */ exit(1); } @@ -175,7 +175,7 @@ send_wrap_token(gss_ctx_id_t ctx) buf.value = "kernelwrap"; buf.length = 10; major = krb5_gss_wrap(&minor, ctx, 1, GSS_C_QOP_DEFAULT, &buf, NULL, - &wrapped); + &wrapped); check(major, minor, "krb5_gss_wrap"); send_data(STDOUT_FILENO, wrapped.value, wrapped.length); free(wrapped.value); diff --git a/src/util/profile/profile_tcl.c b/src/util/profile/profile_tcl.c index 613124a0a..505fb801f 100644 --- a/src/util/profile/profile_tcl.c +++ b/src/util/profile/profile_tcl.c @@ -3363,4 +3363,3 @@ SWIGEXPORT int SWIG_init(Tcl_Interp *interp) { return TCL_OK; } - diff --git a/src/util/profile/test_vtable.c b/src/util/profile/test_vtable.c index 6370f2788..9a0b2278a 100644 --- a/src/util/profile/test_vtable.c +++ b/src/util/profile/test_vtable.c @@ -60,7 +60,7 @@ free_values(void *cbdata, char **values) char **v; for (v = values; *v; v++) - free(*v); + free(*v); free(values); } @@ -70,14 +70,14 @@ full_get_values(void *cbdata, const char *const *names, char ***ret_values) assert(cbdata == &full_cbdata); *ret_values = calloc(2, sizeof(*ret_values)); if (names[0] == name_string) - (*ret_values)[0] = strdup("string result"); + (*ret_values)[0] = strdup("string result"); else if (names[0] == name_int) - (*ret_values)[0] = strdup("23"); + (*ret_values)[0] = strdup("23"); else if (names[0] == name_bool) - (*ret_values)[0] = strdup("on"); + (*ret_values)[0] = strdup("on"); else { - free(*ret_values); - return PROF_NO_RELATION; + free(*ret_values); + return PROF_NO_RELATION; } (*ret_values)[1] = NULL; return 0; @@ -103,7 +103,7 @@ struct iterator { static long full_iterator_create(void *cbdata, const char *const *names, int flags, - void **ret_iter) + void **ret_iter) { struct iterator *iter; @@ -124,14 +124,14 @@ full_iterator(void *cbdata, void *iter_arg, char **ret_name, char **ret_value) assert(cbdata == &full_cbdata); assert(iter->count >= 0 && iter->count <= 2); if (iter->count == 0) { - *ret_name = strdup("name1"); - *ret_value = strdup("value1"); + *ret_name = strdup("name1"); + *ret_value = strdup("value1"); } else if (iter->count == 1) { - *ret_name = strdup("name2"); - *ret_value = NULL; + *ret_name = strdup("name2"); + *ret_value = NULL; } else { - *ret_name = NULL; - *ret_value = NULL; + *ret_name = NULL; + *ret_value = NULL; } iter->count++; return 0; @@ -141,7 +141,7 @@ static void full_iterator_free(void *cbdata, void *iter_arg) { struct iterator *iter = iter_arg; - + assert(cbdata == &full_cbdata); assert(iter->count == 3); free(iter); @@ -172,7 +172,7 @@ full_modified(void *cbdata, int *modified) static long full_update_relation(void *cbdata, const char **names, - const char *old_value, const char *new_value) + const char *old_value, const char *new_value) { assert(cbdata == &full_cbdata); assert(names == empty_names); @@ -246,13 +246,13 @@ int main() assert(values[2] == NULL); profile_free_list(values); assert(profile_iterator_create(profile, NULL, 0, &iter) == - PROF_UNSUPPORTED); + PROF_UNSUPPORTED); assert(profile_is_writable(profile, &intval) == 0); assert(intval == 0); assert(profile_is_modified(profile, &intval) == 0); assert(intval == 0); assert(profile_update_relation(profile, NULL, NULL, NULL) == - PROF_UNSUPPORTED); + PROF_UNSUPPORTED); assert(profile_clear_relation(profile, NULL) == PROF_UNSUPPORTED); assert(profile_rename_section(profile, NULL, NULL) == PROF_UNSUPPORTED); assert(profile_add_relation(profile, NULL, NULL) == PROF_UNSUPPORTED); @@ -261,14 +261,14 @@ int main() assert(profile_init_vtable(&full_vtable, &full_cbdata, &profile) == 0); assert(profile_get_string(profile, name_string, NULL, NULL, "wrong", - &str) == 0); + &str) == 0); assert(strcmp(str, "string result") == 0); profile_release_string(str); assert(profile_get_integer(profile, name_int, NULL, NULL, 24, - &intval) == 0); + &intval) == 0); assert(intval == 23); assert(profile_get_boolean(profile, name_bool, NULL, NULL, 0, - &intval) == 0); + &intval) == 0); assert(intval == 1); assert(profile_get_integer(profile, "xxx", NULL, NULL, 62, &intval) == 0); assert(intval == 62); @@ -293,7 +293,7 @@ int main() assert(profile_is_modified(profile, &intval) == 0); assert(intval == 6); assert(profile_update_relation(profile, empty_names, name_string, - NULL) == 0); + NULL) == 0); assert(profile_clear_relation(profile, empty_names) == 0); assert(profile_rename_section(profile, empty_names, name_int) == 0); assert(profile_add_relation(profile, empty_names, name_bool) == 0); diff --git a/src/util/profile/testmod/testmod_main.c b/src/util/profile/testmod/testmod_main.c index c58ac0487..126b199dc 100644 --- a/src/util/profile/testmod/testmod_main.c +++ b/src/util/profile/testmod/testmod_main.c @@ -56,7 +56,7 @@ free_values(void *cbdata, char **values) char **v; for (v = values; *v; v++) - free(*v); + free(*v); free(values); } @@ -83,11 +83,11 @@ copy(void *cbdata, void **ret_cbdata) long profile_module_init(const char *residual, struct profile_vtable *vtable, - void **cb_ret); + void **cb_ret); long profile_module_init(const char *residual, struct profile_vtable *vtable, - void **cb_ret) + void **cb_ret) { struct data *d; diff --git a/src/util/support/path.c b/src/util/support/path.c index 221fb4a6a..7a051abc9 100644 --- a/src/util/support/path.c +++ b/src/util/support/path.c @@ -54,9 +54,9 @@ find_sep(const char *path) slash = strrchr(path, '/'); backslash = strrchr(path, '\\'); if (slash != NULL && backslash != NULL) - return (slash > backslash) ? slash : backslash; + return (slash > backslash) ? slash : backslash; else - return (slash != NULL) ? slash : backslash; + return (slash != NULL) ? slash : backslash; #else return strrchr(path, '/'); #endif @@ -70,50 +70,50 @@ k5_path_split(const char *path, char **parent_out, char **basename_out) char *parent = NULL, *basename = NULL; if (parent_out != NULL) - *parent_out = NULL; + *parent_out = NULL; if (basename_out != NULL) - *basename_out = NULL; + *basename_out = NULL; pathstart = path; #ifdef WINDOWS_PATHS if (*path != '\0' && path[1] == ':') - pathstart = path + 2; + pathstart = path + 2; #endif sep = find_sep(pathstart); if (sep != NULL) { - bstart = sep + 1; - /* Strip off excess separators before the one we found. */ - pend = sep; - while (pend > pathstart && IS_SEPARATOR(pend[-1])) - pend--; - /* But if we hit the start, keep the whole separator sequence. */ - if (pend == pathstart) - pend = sep + 1; + bstart = sep + 1; + /* Strip off excess separators before the one we found. */ + pend = sep; + while (pend > pathstart && IS_SEPARATOR(pend[-1])) + pend--; + /* But if we hit the start, keep the whole separator sequence. */ + if (pend == pathstart) + pend = sep + 1; } else { - bstart = pathstart; - pend = pathstart; + bstart = pathstart; + pend = pathstart; } if (parent_out) { - parent = malloc(pend - path + 1); - if (parent == NULL) - return ENOMEM; - memcpy(parent, path, pend - path); - parent[pend - path] = '\0'; + parent = malloc(pend - path + 1); + if (parent == NULL) + return ENOMEM; + memcpy(parent, path, pend - path); + parent[pend - path] = '\0'; } if (basename_out) { - basename = strdup(bstart); - if (basename == NULL) { - free(parent); - return ENOMEM; - } + basename = strdup(bstart); + if (basename == NULL) { + free(parent); + return ENOMEM; + } } if (parent_out) - *parent_out = parent; + *parent_out = parent; if (basename_out) - *basename_out = basename; + *basename_out = basename; return 0; } @@ -125,24 +125,24 @@ k5_path_join(const char *path1, const char *path2, char **path_out) *path_out = NULL; if (k5_path_isabs(path2) || *path1 == '\0') { - /* Discard path1 and return a copy of path2. */ - path = strdup(path2); - if (path == NULL) - return ENOMEM; + /* Discard path1 and return a copy of path2. */ + path = strdup(path2); + if (path == NULL) + return ENOMEM; } else { - /* - * Compose path1 and path2, adding a separator if path1 is non-empty - * there's no separator between them already. (*path2 can be a - * separator in the weird case where it starts with /: or \: on - * Windows, and Python doesn't insert a separator in this case.) - */ - c = path1[strlen(path1) - 1]; - if (IS_SEPARATOR(c) || IS_SEPARATOR(*path2)) - ret = asprintf(&path, "%s%s", path1, path2); - else - ret = asprintf(&path, "%s%c%s", path1, SEP, path2); - if (ret < 0) - return ENOMEM; + /* + * Compose path1 and path2, adding a separator if path1 is non-empty + * there's no separator between them already. (*path2 can be a + * separator in the weird case where it starts with /: or \: on + * Windows, and Python doesn't insert a separator in this case.) + */ + c = path1[strlen(path1) - 1]; + if (IS_SEPARATOR(c) || IS_SEPARATOR(*path2)) + ret = asprintf(&path, "%s%s", path1, path2); + else + ret = asprintf(&path, "%s%c%s", path1, SEP, path2); + if (ret < 0) + return ENOMEM; } *path_out = path; return 0; @@ -153,7 +153,7 @@ k5_path_isabs(const char *path) { #ifdef WINDOWS_PATHS if (*path != '\0' && path[1] == ':') - path += 2; + path += 2; return (*path == '/' || *path == '\\'); #else return (*path == '/'); diff --git a/src/util/windows/getopt.c b/src/util/windows/getopt.c index 3724a4ba5..4f9f0627e 100644 --- a/src/util/windows/getopt.c +++ b/src/util/windows/getopt.c @@ -144,7 +144,7 @@ getopt(nargc, nargv, ostr) __progname, optopt); return (BADCH); } - else /* white space */ + else /* white space */ optarg = nargv[optind]; place = EMSG; ++optind; -- 2.26.2