diff options
| author | Tom Yu <tlyu@mit.edu> | 2009-10-31 00:48:38 +0000 |
|---|---|---|
| committer | Tom Yu <tlyu@mit.edu> | 2009-10-31 00:48:38 +0000 |
| commit | 02d6bcbc98a214e7aeaaa9f45f0db8784a7b743b (patch) | |
| tree | 61b9147863cd8be3eff63903dc36cae168254bd5 /src/plugins | |
| parent | 162ab371748cba0cc6f172419bd6e71fa04bb878 (diff) | |
| download | krb5-02d6bcbc98a214e7aeaaa9f45f0db8784a7b743b.tar.gz krb5-02d6bcbc98a214e7aeaaa9f45f0db8784a7b743b.tar.xz krb5-02d6bcbc98a214e7aeaaa9f45f0db8784a7b743b.zip | |
make mark-cstyle
make reindent
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23100 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/plugins')
80 files changed, 454 insertions, 477 deletions
diff --git a/src/plugins/authdata/greet/greet_auth.c b/src/plugins/authdata/greet/greet_auth.c index 91b9a697fb..e759128e74 100644 --- a/src/plugins/authdata/greet/greet_auth.c +++ b/src/plugins/authdata/greet/greet_auth.c @@ -7,7 +7,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 @@ -21,7 +21,7 @@ * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" without express * or implied warranty. - * + * * * Sample authorization data plugin */ diff --git a/src/plugins/authdata/greet_server/greet_auth.c b/src/plugins/authdata/greet_server/greet_auth.c index 80a68a86f1..9a0533286e 100644 --- a/src/plugins/authdata/greet_server/greet_auth.c +++ b/src/plugins/authdata/greet_server/greet_auth.c @@ -7,7 +7,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 @@ -21,7 +21,7 @@ * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" without express * or implied warranty. - * + * * * Sample authorization data plugin */ diff --git a/src/plugins/kdb/db2/adb_openclose.c b/src/plugins/kdb/db2/adb_openclose.c index 453c73b02f..58c49328cb 100644 --- a/src/plugins/kdb/db2/adb_openclose.c +++ b/src/plugins/kdb/db2/adb_openclose.c @@ -1,7 +1,7 @@ /* * Copyright 1993 OpenVision Technologies, Inc., All Rights Reserved * - * $Header$ + * $Header$ */ #if !defined(lint) && !defined(__CODECENTER__) @@ -29,7 +29,7 @@ krb5_error_code osa_adb_create_db(char *filename, char *lockfilename, int lf; DB *db; BTREEINFO btinfo; - + memset(&btinfo, 0, sizeof(btinfo)); btinfo.flags = 0; btinfo.cachesize = 0; @@ -49,7 +49,7 @@ krb5_error_code osa_adb_create_db(char *filename, char *lockfilename, if (lf == -1) return errno; (void) close(lf); - + return OSA_ADB_OK; } @@ -104,7 +104,7 @@ krb5_error_code osa_adb_rename_db(char *filefrom, char *lockfrom, (void) osa_adb_fini_db(todb, magic); return ret; } - + (void) osa_adb_fini_db(fromdb, magic); (void) osa_adb_fini_db(todb, magic); return 0; @@ -117,7 +117,7 @@ krb5_error_code osa_adb_init_db(osa_adb_db_t *dbp, char *filename, static struct _locklist *locklist = NULL; struct _locklist *lockp; krb5_error_code code; - + if (dbp == NULL || filename == NULL) return EINVAL; @@ -222,7 +222,7 @@ krb5_error_code osa_adb_init_db(osa_adb_db_t *dbp, char *filename, db->magic = magic; *dbp = db; - + return OSA_ADB_OK; } @@ -255,8 +255,8 @@ krb5_error_code osa_adb_fini_db(osa_adb_db_t db, int magic) free(db->filename); free(db); return OSA_ADB_OK; -} - +} + krb5_error_code osa_adb_get_lock(osa_adb_db_t db, int mode) { int tries, gotlock, perm, krb5_mode, ret = 0; @@ -314,9 +314,9 @@ krb5_error_code osa_adb_get_lock(osa_adb_db_t db, int mode) KRB5_LOCKMODE_UNLOCK); return OSA_ADB_NOLOCKFILE; } - + /* we have the shared/exclusive lock */ - + if (perm) { if (unlink(db->lock->filename) < 0) { /* somehow we can't delete the file, but we already */ @@ -326,7 +326,7 @@ krb5_error_code osa_adb_get_lock(osa_adb_db_t db, int mode) (void) krb5_lock_file(db->lock->context, fileno(db->lock->lockfile), KRB5_LOCKMODE_UNLOCK); - + /* maybe we should return CANTLOCK_DB.. but that would */ /* look just like the db was already locked */ return ret; @@ -336,7 +336,7 @@ krb5_error_code osa_adb_get_lock(osa_adb_db_t db, int mode) /* now no one else can get one either */ (void) fclose(db->lock->lockfile); } - + db->lock->lockmode = mode; db->lock->lockcnt++; return OSA_ADB_OK; @@ -345,7 +345,7 @@ krb5_error_code osa_adb_get_lock(osa_adb_db_t db, int mode) krb5_error_code osa_adb_release_lock(osa_adb_db_t db) { int ret, fd; - + if (!db->lock->lockcnt) /* lock already unlocked */ return OSA_ADB_NOTLOCKED; @@ -363,7 +363,7 @@ krb5_error_code osa_adb_release_lock(osa_adb_db_t db) fileno(db->lock->lockfile), KRB5_LOCKMODE_UNLOCK))) return ret; - + db->lock->lockmode = 0; } return OSA_ADB_OK; diff --git a/src/plugins/kdb/db2/adb_policy.c b/src/plugins/kdb/db2/adb_policy.c index 04cc48970a..d585c08528 100644 --- a/src/plugins/kdb/db2/adb_policy.c +++ b/src/plugins/kdb/db2/adb_policy.c @@ -36,7 +36,7 @@ static char *rcsid = "$Header$"; /* * Function: osa_adb_create_policy - * + * * Purpose: create a policy entry in the policy db. * * Arguments: @@ -45,13 +45,13 @@ static char *rcsid = "$Header$"; * * Requires: * entry have a valid name. - * + * * Effects: * creates the entry in the db * * Modifies: * the policy db. - * + * */ krb5_error_code osa_adb_create_policy(osa_adb_policy_t db, osa_policy_ent_t entry) @@ -69,7 +69,7 @@ osa_adb_create_policy(osa_adb_policy_t db, osa_policy_ent_t entry) } dbkey.data = entry->name; dbkey.size = (strlen(entry->name) + 1); - + switch(db->db->get(db->db, &dbkey, &dbdata, 0)) { case 0: ret = OSA_ADB_DUP; @@ -110,7 +110,7 @@ error: /* * Function: osa_adb_destroy_policy - * + * * Purpose: destroy a policy entry * * Arguments: @@ -126,7 +126,7 @@ error: * * Modifies: * policy db. - * + * */ krb5_error_code osa_adb_destroy_policy(osa_adb_policy_t db, char *name) @@ -135,7 +135,7 @@ osa_adb_destroy_policy(osa_adb_policy_t db, char *name) int status, ret; OPENLOCK(db, KRB5_DB_LOCKMODE_EXCLUSIVE); - + if(name == NULL) { ret = EINVAL; goto error; @@ -167,7 +167,7 @@ error: /* * Function: osa_adb_get_policy - * + * * Purpose: retrieve policy * * Arguments: @@ -222,10 +222,10 @@ osa_adb_get_policy(osa_adb_policy_t db, char *name, ret = ENOMEM; goto error; } - memcpy(aligned_data, dbdata.data, dbdata.size); + memcpy(aligned_data, dbdata.data, dbdata.size); memset(*entry, 0, sizeof(osa_policy_ent_rec)); xdrmem_create(&xdrs, aligned_data, dbdata.size, XDR_DECODE); - if (!xdr_osa_policy_ent_rec(&xdrs, *entry)) + if (!xdr_osa_policy_ent_rec(&xdrs, *entry)) ret = OSA_ADB_FAILURE; else ret = OSA_ADB_OK; xdr_destroy(&xdrs); @@ -238,7 +238,7 @@ error: /* * Function: osa_adb_put_policy - * + * * Purpose: update a policy in the dababase * * Arguments: @@ -248,13 +248,13 @@ error: * * Requires: * [requires] - * + * * Effects: * [effects] * * Modifies: * [modifies] - * + * */ krb5_error_code osa_adb_put_policy(osa_adb_policy_t db, osa_policy_ent_t entry) @@ -266,7 +266,7 @@ osa_adb_put_policy(osa_adb_policy_t db, osa_policy_ent_t entry) int ret; OPENLOCK(db, KRB5_DB_LOCKMODE_EXCLUSIVE); - + if(entry->name == NULL) { ret = EINVAL; goto error; @@ -310,7 +310,7 @@ error: /* * Function: osa_adb_iter_policy - * + * * Purpose: iterate over the policy database. * * Arguments: @@ -352,7 +352,7 @@ osa_adb_iter_policy(osa_adb_policy_t db, osa_adb_iter_policy_func func, goto error; } memcpy(aligned_data, dbdata.data, dbdata.size); - + memset(entry, 0, sizeof(osa_policy_ent_rec)); xdrmem_create(&xdrs, aligned_data, dbdata.size, XDR_DECODE); if(!xdr_osa_policy_ent_rec(&xdrs, entry)) { @@ -364,7 +364,7 @@ osa_adb_iter_policy(osa_adb_policy_t db, osa_adb_iter_policy_func func, } (*func)(data, entry); xdr_destroy(&xdrs); - free(aligned_data); + free(aligned_data); osa_free_policy_ent(entry); ret = db->db->seq(db->db, &dbkey, &dbdata, R_NEXT); } diff --git a/src/plugins/kdb/db2/db2_exp.c b/src/plugins/kdb/db2/db2_exp.c index 2e1f3b5198..356f6dfcaf 100644 --- a/src/plugins/kdb/db2/db2_exp.c +++ b/src/plugins/kdb/db2/db2_exp.c @@ -6,7 +6,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 @@ -26,7 +26,7 @@ * * C %name: db2_exp.c % * Instance: idc_sec_2 -* Description: +* Description: * %created_by: spradeep % * %date_created: Tue Apr 5 11:44:00 2005 % * @@ -110,8 +110,8 @@ WRAP_K (krb5_db2_db_get_age, time_t *t), (ctx, s, t)); WRAP_K (krb5_db2_db_set_option, - ( krb5_context kcontext, - int option, + ( krb5_context kcontext, + int option, void *value ), (kcontext, option, value)); diff --git a/src/plugins/kdb/db2/kdb_db2.c b/src/plugins/kdb/db2/kdb_db2.c index b987039d15..363a1f3d15 100644 --- a/src/plugins/kdb/db2/kdb_db2.c +++ b/src/plugins/kdb/db2/kdb_db2.c @@ -246,7 +246,7 @@ k5db2_dbopen(krb5_db2_context *dbc, char *fname, int flags, int mode, int tempdb errno = ENOMEM; return NULL; } - + hashi.bsize = 4096; hashi.cachesize = 0; @@ -2009,4 +2009,3 @@ errout: return retval; } - diff --git a/src/plugins/kdb/db2/kdb_db2.h b/src/plugins/kdb/db2/kdb_db2.h index cef7b648a8..9f3cbc5c93 100644 --- a/src/plugins/kdb/db2/kdb_db2.h +++ b/src/plugins/kdb/db2/kdb_db2.h @@ -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 @@ -22,7 +22,7 @@ * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" without express * or implied warranty. - * + * * * KDC Database backend definitions for Berkely DB. */ @@ -53,37 +53,37 @@ typedef struct _krb5_db2_context { #define KDB2_LOCK_EXT ".ok" #define KDB2_TEMP_LOCK_EXT "~.ok" -krb5_error_code krb5_db2_db_init +krb5_error_code krb5_db2_db_init (krb5_context); -krb5_error_code krb5_db2_db_fini +krb5_error_code krb5_db2_db_fini (krb5_context); -krb5_error_code krb5_db2_db_get_age +krb5_error_code krb5_db2_db_get_age (krb5_context, char *, time_t * ); -krb5_error_code krb5_db2_db_create +krb5_error_code krb5_db2_db_create (krb5_context, char *, krb5_int32); -krb5_error_code krb5_db2_db_destroy +krb5_error_code krb5_db2_db_destroy (krb5_context, char * ); -krb5_error_code krb5_db2_db_rename +krb5_error_code krb5_db2_db_rename (krb5_context, char *, char *, int ); -krb5_error_code krb5_db2_db_get_principal +krb5_error_code krb5_db2_db_get_principal (krb5_context, krb5_const_principal, krb5_db_entry *, int *, krb5_boolean * ); -krb5_error_code krb5_db2_db_free_principal +krb5_error_code krb5_db2_db_free_principal (krb5_context, krb5_db_entry *, int ); -krb5_error_code krb5_db2_db_put_principal +krb5_error_code krb5_db2_db_put_principal (krb5_context, krb5_db_entry *, int *, @@ -99,21 +99,21 @@ krb5_error_code krb5_db2_db_iterate krb5_error_code (*) (krb5_pointer, krb5_db_entry *), krb5_pointer ); -krb5_error_code krb5_db2_db_set_nonblocking +krb5_error_code krb5_db2_db_set_nonblocking (krb5_context, krb5_boolean, krb5_boolean * ); krb5_boolean krb5_db2_db_set_lockmode (krb5_context, krb5_boolean ); -krb5_error_code krb5_db2_db_open_database +krb5_error_code krb5_db2_db_open_database (krb5_context); -krb5_error_code krb5_db2_db_close_database +krb5_error_code krb5_db2_db_close_database (krb5_context); -krb5_error_code -krb5_db2_set_master_key_ext ( krb5_context kcontext, - char *pwd, +krb5_error_code +krb5_db2_set_master_key_ext ( krb5_context kcontext, + char *pwd, krb5_keyblock *key); krb5_error_code @@ -146,7 +146,7 @@ krb5_error_code krb5_db2_lib_init(void); krb5_error_code krb5_db2_lib_cleanup(void); -krb5_error_code +krb5_error_code krb5_db2_db_unlock(krb5_context); krb5_error_code @@ -154,9 +154,9 @@ krb5_db2_promote_db(krb5_context kcontext, char *conf_section, char **db_args); -krb5_error_code -krb5_db2_db_set_option ( krb5_context kcontext, - int option, +krb5_error_code +krb5_db2_db_set_option ( krb5_context kcontext, + int option, void *value ); krb5_error_code @@ -164,7 +164,7 @@ krb5_db2_db_lock( krb5_context context, int in_mode); -krb5_error_code +krb5_error_code krb5_db2_open( krb5_context kcontext, char *conf_section, char **db_args, @@ -181,13 +181,13 @@ krb5_error_code krb5_db2_destroy( krb5_context kcontext, const char * krb5_db2_err2str( krb5_context kcontext, long err_code ); -void * -krb5_db2_alloc( krb5_context kcontext, - void *ptr, +void * +krb5_db2_alloc( krb5_context kcontext, + void *ptr, size_t size ); -void -krb5_db2_free( krb5_context kcontext, +void +krb5_db2_free( krb5_context kcontext, void *ptr ); diff --git a/src/plugins/kdb/db2/kdb_ext.c b/src/plugins/kdb/db2/kdb_ext.c index 9d73966b4d..69c5522ac1 100644 --- a/src/plugins/kdb/db2/kdb_ext.c +++ b/src/plugins/kdb/db2/kdb_ext.c @@ -96,4 +96,3 @@ krb5_db2_invoke(krb5_context context, return code; } - diff --git a/src/plugins/kdb/db2/kdb_xdr.c b/src/plugins/kdb/db2/kdb_xdr.c index f00131a004..38dc658fdb 100644 --- a/src/plugins/kdb/db2/kdb_xdr.c +++ b/src/plugins/kdb/db2/kdb_xdr.c @@ -1,14 +1,14 @@ /* * lib/kdb/kdb_xdr.c * - * Copyright 1995 by the Massachusetts Institute of Technology. + * Copyright 1995 by the Massachusetts Institute of Technology. * All Rights Reserved. * * Export of this software from the United States of America may * 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 @@ -22,7 +22,7 @@ * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" without express * or implied warranty. - * + * */ #include "k5-int.h" @@ -42,7 +42,7 @@ krb5_encode_princ_dbkey(context, key, principal) if (!(retval = krb5_unparse_name(context, principal, &princ_name))) { /* need to store the NULL for decoding */ - key->length = strlen(princ_name)+1; + key->length = strlen(princ_name)+1; key->data = princ_name; } return(retval); @@ -76,8 +76,8 @@ krb5_encode_princ_contents(context, content, entry) * compact and extensible. */ - /* - * First allocate enough space for all the data. + /* + * First allocate enough space for all the data. * Need 2 bytes for the length of the base structure * then 36 [ 8 * 4 + 2 * 2] bytes for the base information * [ attributes, max_life, max_renewable_life, expiration, @@ -95,7 +95,7 @@ krb5_encode_princ_contents(context, content, entry) unparse_princ_size = strlen(unparse_princ) + 1; content->length += unparse_princ_size; - content->length += 2; + content->length += 2; i = 0; /* tl_data is a linked list */ @@ -118,14 +118,14 @@ krb5_encode_princ_contents(context, content, entry) content->length += 4; /* type + length */ } } - + if ((content->data = malloc(content->length)) == NULL) { retval = ENOMEM; goto epc_error; } - /* - * Now we go through entry again, this time copying data + /* + * Now we go through entry again, this time copying data * These first entries are always saved regardless of version */ nextloc = (unsigned char *)content->data; @@ -137,31 +137,31 @@ krb5_encode_princ_contents(context, content, entry) /* Attributes */ krb5_kdb_encode_int32(entry->attributes, nextloc); nextloc += 4; - + /* Max Life */ krb5_kdb_encode_int32(entry->max_life, nextloc); nextloc += 4; - + /* Max Renewable Life */ krb5_kdb_encode_int32(entry->max_renewable_life, nextloc); nextloc += 4; - + /* When the client expires */ krb5_kdb_encode_int32(entry->expiration, nextloc); nextloc += 4; - + /* When its passwd expires */ krb5_kdb_encode_int32(entry->pw_expiration, nextloc); nextloc += 4; - + /* Last successful passwd */ krb5_kdb_encode_int32(entry->last_success, nextloc); nextloc += 4; - + /* Last failed passwd attempt */ krb5_kdb_encode_int32(entry->last_failed, nextloc); nextloc += 4; - + /* # of failed passwd attempt */ krb5_kdb_encode_int32(entry->fail_auth_count, nextloc); nextloc += 4; @@ -169,11 +169,11 @@ krb5_encode_princ_contents(context, content, entry) /* # tl_data strutures */ krb5_kdb_encode_int16(entry->n_tl_data, nextloc); nextloc += 2; - + /* # key_data strutures */ krb5_kdb_encode_int16(entry->n_key_data, nextloc); nextloc += 2; - + /* Put extended fields here */ if (entry->len != KRB5_KDB_V1_BASE_LENGTH) abort(); @@ -183,8 +183,8 @@ krb5_encode_princ_contents(context, content, entry) memcpy(nextloc, entry->e_data, entry->e_length); nextloc += entry->e_length; } - - /* + + /* * Now we get to the principal. * To squeze a few extra bytes out it is always assumed to come * after the base type. @@ -228,7 +228,7 @@ krb5_encode_princ_contents(context, content, entry) } } } - + epc_error:; free(unparse_princ); return retval; @@ -271,7 +271,7 @@ krb5_decode_princ_contents(context, content, entry) /* First do the easy stuff */ nextloc = (unsigned char *)content->data; sizeleft = content->length; - if ((sizeleft -= KRB5_KDB_V1_BASE_LENGTH) < 0) + if ((sizeleft -= KRB5_KDB_V1_BASE_LENGTH) < 0) return KRB5_KDB_TRUNCATED_RECORD; /* Base Length */ @@ -336,7 +336,7 @@ krb5_decode_princ_contents(context, content, entry) } /* - * Get the principal name for the entry + * Get the principal name for the entry * (stored as a string which gets unparsed.) */ if ((sizeleft -= 2) < 0) { @@ -434,7 +434,7 @@ krb5_decode_princ_contents(context, content, entry) retval = ENOMEM; goto error_out; } - memcpy(key_data->key_data_contents[j], nextloc, + memcpy(key_data->key_data_contents[j], nextloc, key_data->key_data_length[j]); nextloc += key_data->key_data_length[j]; } @@ -450,10 +450,10 @@ error_out:; krb5_dbe_free_contents(context, entry); return retval; } - + void krb5_dbe_free_contents(context, entry) - krb5_context context; + krb5_context context; krb5_db_entry * entry; { krb5_tl_data * tl_data_next; @@ -475,8 +475,8 @@ krb5_dbe_free_contents(context, entry) for (j = 0; j < entry->key_data[i].key_data_ver; j++) { if (entry->key_data[i].key_data_length[j]) { if (entry->key_data[i].key_data_contents[j]) { - memset(entry->key_data[i].key_data_contents[j], - 0, + memset(entry->key_data[i].key_data_contents[j], + 0, (unsigned) entry->key_data[i].key_data_length[j]); free (entry->key_data[i].key_data_contents[j]); } diff --git a/src/plugins/kdb/db2/libdb2/btree/bt_delete.c b/src/plugins/kdb/db2/libdb2/btree/bt_delete.c index d002a66edd..02ae2e9be6 100644 --- a/src/plugins/kdb/db2/libdb2/btree/bt_delete.c +++ b/src/plugins/kdb/db2/libdb2/btree/bt_delete.c @@ -154,7 +154,7 @@ __bt_stkacq(t, hp, c) db_pgno_t pgno; recno_t nextpg, prevpg; int exact, level; - + /* * Find the first occurrence of the key in the tree. Toss the * currently locked page so we don't hit an already-locked page. @@ -270,7 +270,7 @@ __bt_stkacq(t, hp, c) if ((h = mpool_get(t->bt_mp, prevpg, 0)) == NULL) return (1); } - + ret: mpool_put(t->bt_mp, h, 0); return ((*hp = mpool_get(t->bt_mp, c->pg.pgno, 0)) == NULL); @@ -402,7 +402,7 @@ __bt_pdelete(t, h) /* Get the parent page. */ if ((pg = mpool_get(t->bt_mp, parent->pgno, 0)) == NULL) return (RET_ERROR); - + idx = parent->index; bi = GETBINTERNAL(pg, idx); @@ -571,7 +571,7 @@ __bt_curdel(t, key, h, idx) key = &c->key; } /* Check previous key, if not at the beginning of the page. */ - if (idx > 0) { + if (idx > 0) { e.page = h; e.index = idx - 1; if (__bt_cmp(t, key, &e) == 0) { diff --git a/src/plugins/kdb/db2/libdb2/btree/bt_open.c b/src/plugins/kdb/db2/libdb2/btree/bt_open.c index 0f848d8adc..069b2dfde0 100644 --- a/src/plugins/kdb/db2/libdb2/btree/bt_open.c +++ b/src/plugins/kdb/db2/libdb2/btree/bt_open.c @@ -202,7 +202,7 @@ __bt_open(fname, flags, mode, openinfo, dflags) default: goto einval; } - + if ((t->bt_fd = open(fname, flags | O_BINARY, mode)) < 0) goto err; diff --git a/src/plugins/kdb/db2/libdb2/btree/bt_seq.c b/src/plugins/kdb/db2/libdb2/btree/bt_seq.c index bbfb9c6c63..6124f968bf 100644 --- a/src/plugins/kdb/db2/libdb2/btree/bt_seq.c +++ b/src/plugins/kdb/db2/libdb2/btree/bt_seq.c @@ -6,7 +6,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 @@ -419,7 +419,7 @@ __bt_first(t, key, erval, exactp) *erval = *ep; return (RET_SUCCESS); } - + /* * Walk backwards, as long as the entry matches and there are * keys left in the tree. Save a copy of each match in case diff --git a/src/plugins/kdb/db2/libdb2/hash/hash.c b/src/plugins/kdb/db2/libdb2/hash/hash.c index c1a66088a0..2343d223c0 100644 --- a/src/plugins/kdb/db2/libdb2/hash/hash.c +++ b/src/plugins/kdb/db2/libdb2/hash/hash.c @@ -428,7 +428,7 @@ hget_header(hashp, page_size) hdr_dest = (u_int8_t *)&hashp->hdr; - /* + /* * XXX * This should not be printing to stderr on a "normal" error case. */ @@ -514,14 +514,14 @@ hdestroy(hashp) free(hashp->bigkey_buf); if (hashp->bigdata_buf) free(hashp->bigdata_buf); - + /* XXX This should really iterate over the cursor queue, but it's not clear how to do that, and the only cursor a hash table ever creates is the one used by hash_seq(). Passing NULL as the first arg is also a kludge, but I know that it's never used, so I do it. The intent is to plug the memory leak. Correctness can come later. */ - + if (hashp->seq_cursor) hashp->seq_cursor->delete(NULL, hashp->seq_cursor, 0); @@ -532,7 +532,7 @@ hdestroy(hashp) if (hashp->fp != -1) (void)close(hashp->fp); - /* + /* * *** This may cause problems if hashp->fname is set in any case * other than the case that we are generating a temporary file name. * Note that the new version of mpool should support temporary @@ -704,7 +704,7 @@ hash_access(hashp, action, key, val) num_items = 0; - /* + /* * Set up item_info so that we're looking for space to add an item * as we cycle through the pages looking for the key. */ @@ -868,7 +868,7 @@ cursor_get(dbp, cursorp, key, val, flags) /* * This needs to be changed around. As is, get_item_next advances * the pointers on the page but this function actually advances - * bucket pointers. This works, since the only other place we + * bucket pointers. This works, since the only other place we * use get_item_next is in hash_access which only deals with one * bucket at a time. However, there is the problem that certain other * functions (such as find_bigpair and delpair) depend on the @@ -920,7 +920,7 @@ cursor_delete(dbp, cursor, flags) /* XXX this is empirically determined, so it might not be completely correct, but it seems to work. At the very least it fixes a memory leak */ - + free(cursor->internal); free(cursor); @@ -937,7 +937,7 @@ hash_seq(dbp, key, val, flag) /* * Seq just uses the default cursor to go sequecing through the - * database. Note that the default cursor is the first in the list. + * database. Note that the default cursor is the first in the list. */ hashp = (HTAB *)dbp->internal; diff --git a/src/plugins/kdb/db2/libdb2/hash/hash.h b/src/plugins/kdb/db2/libdb2/hash/hash.h index b202fc9f22..32793ca5b9 100644 --- a/src/plugins/kdb/db2/libdb2/hash/hash.h +++ b/src/plugins/kdb/db2/libdb2/hash/hash.h @@ -193,4 +193,4 @@ typedef struct item_info { #define ITEM_GET_N 4 #define UNKNOWN 0xffffffff /* for num_items */ -#define NO_EXPAND 0xfffffffe +#define NO_EXPAND 0xfffffffe diff --git a/src/plugins/kdb/db2/libdb2/hash/hash_bigkey.c b/src/plugins/kdb/db2/libdb2/hash/hash_bigkey.c index 06210a57cc..6874f47037 100644 --- a/src/plugins/kdb/db2/libdb2/hash/hash_bigkey.c +++ b/src/plugins/kdb/db2/libdb2/hash/hash_bigkey.c @@ -75,7 +75,7 @@ static int32_t collect_data __P((HTAB *, PAGE16 *, int32_t)); /* * Big_insert * - * You need to do an insert and the key/data pair is greater than + * You need to do an insert and the key/data pair is greater than * MINFILL * the bucket size * * Returns: diff --git a/src/plugins/kdb/db2/libdb2/hash/hash_page.c b/src/plugins/kdb/db2/libdb2/hash/hash_page.c index e25115d3f0..f27e7dd86a 100644 --- a/src/plugins/kdb/db2/libdb2/hash/hash_page.c +++ b/src/plugins/kdb/db2/libdb2/hash/hash_page.c @@ -102,7 +102,7 @@ __get_item(hashp, cursorp, key, val, item_info) cursorp->pgno = ADDR(cursorp->pagep); cursorp->ndx = 0; cursorp->pgndx = 0; - } else + } else cursorp->pagep = __get_page(hashp, cursorp->pgno, A_RAW); if (!cursorp->pagep) { @@ -140,7 +140,7 @@ __get_item(hashp, cursorp, key, val, item_info) KEY_OFF(cursorp->pagep, cursorp->pgndx); } - /* + /* * All of this information will be set incorrectly for big keys, but * it will be ignored anyway. */ @@ -183,7 +183,7 @@ __get_item_done(hashp, cursorp) __put_page(hashp, cursorp->pagep, A_RAW, 0); cursorp->pagep = NULL; - /* + /* * We don't throw out the page number since we might want to * continue getting on this page. */ @@ -354,7 +354,7 @@ __delpair(hashp, cursorp, item_info) * item on the page. */ src = (u_int8_t *)pagep + OFFSET(pagep) + 1; - /* + /* * Length is the distance between where to start * deleting and end of the data on the page. */ @@ -399,7 +399,7 @@ __delpair(hashp, cursorp, item_info) db_pgno_t to_find, next_pgno, link_page; /* - * We need to go back to the first page in the chain and + * We need to go back to the first page in the chain and * look for this page so that we can update the previous * page's NEXT_PGNO field. */ @@ -511,7 +511,7 @@ __split_page(hashp, obucket, nbucket) } /* - * Add the given pair to the page. + * Add the given pair to the page. * * * Returns: @@ -545,7 +545,7 @@ __addel(hashp, item_info, key, val, num_items, expanding) /* Advance to first page in chain with room for item. */ while (NUM_ENT(pagep) && NEXT_PGNO(pagep) != INVALID_PGNO) { - /* + /* * This may not be the end of the chain, but the pair may fit * anyway. */ @@ -577,9 +577,9 @@ __addel(hashp, item_info, key, val, num_items, expanding) return (-1); } } - + /* At this point, we know the page fits, so we just add it */ - + if (ISBIG(PAIRSIZE(key, val), hashp)) { if (__big_insert(hashp, pagep, key, val)) return (-1); @@ -624,7 +624,7 @@ __addel(hashp, item_info, key, val, num_items, expanding) return (0); } -/* +/* * Special __addel used in big splitting; this one just puts the pointer * to an already-allocated big page in the appropriate bucket. */ @@ -866,8 +866,8 @@ __pgin_routine(pg_cookie, pgno, page) pagep = (PAGE16 *)page; hashp = (HTAB *)pg_cookie; - /* - * There are the following cases for swapping: + /* + * There are the following cases for swapping: * 0) New page that may be unitialized. * 1) Bucket page or overflow page. Either swap * the header or initialize the page. @@ -906,8 +906,8 @@ __pgout_routine(pg_cookie, pgno, page) pagep = (PAGE16 *)page; hashp = (HTAB *)pg_cookie; - /* - * There are the following cases for swapping: + /* + * There are the following cases for swapping: * 1) Bucket page or overflow page. Just swap the header. * 2) Bitmap page. Swap the whole page! * 3) Header pages. Not handled here; these are written directly diff --git a/src/plugins/kdb/db2/libdb2/hash/page.h b/src/plugins/kdb/db2/libdb2/hash/page.h index 8ef8a2e294..989f967c56 100644 --- a/src/plugins/kdb/db2/libdb2/hash/page.h +++ b/src/plugins/kdb/db2/libdb2/hash/page.h @@ -57,7 +57,7 @@ * other (since we use that fact to compute key lengths). In the accessor * macros below, P means a pointer to the page, I means an index of the * particular entry being accessed. - * + * * Hash base page format * BYTE ITEM NBYTES TYPE ACCESSOR MACRO * ---- ------------------ ------ -------- -------------- @@ -167,7 +167,7 @@ typedef unsigned char PAGE8; #define FREESPACE(P) \ ((OFFSET((P)) + 1 - PAGE_OVERHEAD - (NUM_ENT((P)) * PAIR_OVERHEAD))) -/* +/* * Overhead on header pages is just one word -- the length of the * header info stored on that page. */ diff --git a/src/plugins/kdb/db2/libdb2/include/db-queue.h b/src/plugins/kdb/db2/libdb2/include/db-queue.h index 40d32ccb6e..65612ce6f3 100644 --- a/src/plugins/kdb/db2/libdb2/include/db-queue.h +++ b/src/plugins/kdb/db2/libdb2/include/db-queue.h @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * diff --git a/src/plugins/kdb/db2/libdb2/include/db.hin b/src/plugins/kdb/db2/libdb2/include/db.hin index ad86d0af9c..dca0b00677 100644 --- a/src/plugins/kdb/db2/libdb2/include/db.hin +++ b/src/plugins/kdb/db2/libdb2/include/db.hin @@ -154,7 +154,7 @@ typedef struct { int lorder; /* byte order */ size_t reclen; /* record length (fixed-length records) */ u_char bval; /* delimiting byte (variable-length records */ - char *bfname; /* btree file name */ + char *bfname; /* btree file name */ } RECNOINFO; #if defined(__cplusplus) diff --git a/src/plugins/kdb/db2/libdb2/mpool/mpool.c b/src/plugins/kdb/db2/libdb2/mpool/mpool.c index 3b0be3f55a..acdc1b8276 100644 --- a/src/plugins/kdb/db2/libdb2/mpool/mpool.c +++ b/src/plugins/kdb/db2/libdb2/mpool/mpool.c @@ -106,7 +106,7 @@ mpool_filter(mp, pgin, pgout, pgcookie) mp->pgout = pgout; mp->pgcookie = pgcookie; } - + /* * mpool_new -- * Get a new page of memory. @@ -173,8 +173,8 @@ mpool_delete(mp, page) free(bp); return (RET_SUCCESS); -} - +} + /* * mpool_get * Get a page. @@ -486,7 +486,7 @@ mpool_stat(mp) mp->pagealloc, mp->pageflush); if (mp->cachehit + mp->cachemiss) (void)fprintf(stderr, - "%.0f%% cache hit rate (%lu hits, %lu misses)\n", + "%.0f%% cache hit rate (%lu hits, %lu misses)\n", ((double)mp->cachehit / (mp->cachehit + mp->cachemiss)) * 100, mp->cachehit, mp->cachemiss); (void)fprintf(stderr, "%lu page reads, %lu page writes\n", @@ -506,7 +506,7 @@ mpool_stat(mp) cnt = 0; } else sep = ", "; - + } (void)fprintf(stderr, "\n"); } diff --git a/src/plugins/kdb/db2/libdb2/recno/rec_put.c b/src/plugins/kdb/db2/libdb2/recno/rec_put.c index e7fa75882f..bd710df842 100644 --- a/src/plugins/kdb/db2/libdb2/recno/rec_put.c +++ b/src/plugins/kdb/db2/libdb2/recno/rec_put.c @@ -170,7 +170,7 @@ einval: errno = EINVAL; if (flags == R_SETCURSOR) t->bt_cursor.rcursor = nrec; - + F_SET(t, R_MODIFIED); return (__rec_ret(t, NULL, nrec, key, NULL)); } diff --git a/src/plugins/kdb/db2/libdb2/recno/rec_search.c b/src/plugins/kdb/db2/libdb2/recno/rec_search.c index a328f1be06..15042627d8 100644 --- a/src/plugins/kdb/db2/libdb2/recno/rec_search.c +++ b/src/plugins/kdb/db2/libdb2/recno/rec_search.c @@ -92,7 +92,7 @@ __rec_search(t, recno, op) } BT_PUSH(t, pg, idx - 1); - + pg = r->pgno; switch (op) { case SDELETE: diff --git a/src/plugins/kdb/db2/libdb2/recno/rec_seq.c b/src/plugins/kdb/db2/libdb2/recno/rec_seq.c index 1edaa998e8..8af1378c34 100644 --- a/src/plugins/kdb/db2/libdb2/recno/rec_seq.c +++ b/src/plugins/kdb/db2/libdb2/recno/rec_seq.c @@ -107,7 +107,7 @@ __rec_seq(dbp, key, data, flags) einval: errno = EINVAL; return (RET_ERROR); } - + if (t->bt_nrecs == 0 || nrec > t->bt_nrecs) { if (!F_ISSET(t, R_EOF | R_INMEM) && (status = t->bt_irec(t, nrec)) != RET_SUCCESS) diff --git a/src/plugins/kdb/db2/libdb2/test/SEQ_TEST/t.c b/src/plugins/kdb/db2/libdb2/test/SEQ_TEST/t.c index f77b676f14..cfd1a4211a 100644 --- a/src/plugins/kdb/db2/libdb2/test/SEQ_TEST/t.c +++ b/src/plugins/kdb/db2/libdb2/test/SEQ_TEST/t.c @@ -8,7 +8,7 @@ #include <stdlib.h> #include <string.h> - + void main(int argc, char *argv[]) { char id1[] = {" "}, id2[] = {" "}; int i; @@ -27,13 +27,13 @@ void main(int argc, char *argv[]) { printf("\n Open error on test.db %d %s\n",errno,strerror(errno)); exit(25); } - + while (fscanf(fin," %10s%10s",id1,id2) > 0) { key.size = 11; data.size = 11; key.data = id1; data.data = id2; - printf("%10s %10s\n",key.data,data.data); + printf("%10s %10s\n",key.data,data.data); if (dbp->put(dbp, &key, &data,R_NOOVERWRITE) != 0) { printf("Error writing output\n"); } @@ -41,7 +41,7 @@ void main(int argc, char *argv[]) { } printf("%d Records in\n",out); dbp->close(dbp); - + if ((dbp = dbopen("test.db", O_RDWR | O_BINARY, 0664 , DB_BTREE, NULL )) == NULL) { printf("\n Error on dbopen %d %s\n",errno,strerror(errno)); @@ -56,7 +56,7 @@ void main(int argc, char *argv[]) { strcpy(id2,data.data); id2[0] = 'U'; datao.data=id2; - printf("%10s %10s\n",key.data,data.data); + printf("%10s %10s\n",key.data,data.data); in++; if (in > 10) break; #ifdef notdef @@ -74,11 +74,11 @@ void main(int argc, char *argv[]) { printf("%d Records copied\n",in); in = 0; dbp->seq(dbp, &key, &data,R_FIRST); - printf("%10s %10s\n",key.data,data.data); + printf("%10s %10s\n",key.data,data.data); in++; while (dbp->seq(dbp, &key, &data,R_NEXT) == 0) { in++; - printf("%10s %10s\n",key.data,data.data); + printf("%10s %10s\n",key.data,data.data); } printf("%d Records read\n",in); dbp->close(dbp); diff --git a/src/plugins/kdb/db2/libdb2/test/btree.tests/main.c b/src/plugins/kdb/db2/libdb2/test/btree.tests/main.c index 06f02b3ad0..0d78d59343 100644 --- a/src/plugins/kdb/db2/libdb2/test/btree.tests/main.c +++ b/src/plugins/kdb/db2/libdb2/test/btree.tests/main.c @@ -691,7 +691,7 @@ load(db, argv) key.size = sizeof(recno_t); data.data = lp; data.size = len + 1; - } else { + } else { key.data = lp; key.size = len + 1; for (p = lp + len - 1, t = buf; p >= lp; *t++ = *p--); diff --git a/src/plugins/kdb/db2/libdb2/test/dbtest.c b/src/plugins/kdb/db2/libdb2/test/dbtest.c index b0aee708dc..df92cd79e8 100644 --- a/src/plugins/kdb/db2/libdb2/test/dbtest.c +++ b/src/plugins/kdb/db2/libdb2/test/dbtest.c @@ -390,7 +390,7 @@ get(dbp, kp) exit(1); } else (void)fprintf(stderr, "%lu: %.*s: %s", - lineno, (int) MIN(kp->size, 20), (char *) kp->data, + lineno, (int) MIN(kp->size, 20), (char *) kp->data, NOSUCHKEY); #undef NOSUCHKEY break; @@ -447,8 +447,8 @@ rem(dbp, kp) if (ofd != STDOUT_FILENO) (void)write(ofd, NOSUCHKEY, sizeof(NOSUCHKEY) - 1); else if (flags != R_CURSOR) - (void)fprintf(stderr, "%lu: %.*s: %s", - lineno, (int) MIN(kp->size, 20), (char *) kp->data, + (void)fprintf(stderr, "%lu: %.*s: %s", + lineno, (int) MIN(kp->size, 20), (char *) kp->data, NOSUCHKEY); else (void)fprintf(stderr, @@ -492,8 +492,8 @@ seq(dbp, kp) if (ofd != STDOUT_FILENO) (void)write(ofd, NOSUCHKEY, sizeof(NOSUCHKEY) - 1); else if (flags == R_CURSOR) - (void)fprintf(stderr, "%lu: %.*s: %s", - lineno, (int) MIN(kp->size, 20), (char *) kp->data, + (void)fprintf(stderr, "%lu: %.*s: %s", + lineno, (int) MIN(kp->size, 20), (char *) kp->data, NOSUCHKEY); else (void)fprintf(stderr, @@ -534,7 +534,7 @@ dump(dbp, rev) } done: return; } - + u_int setflags(s) char *s; @@ -578,7 +578,7 @@ sflags(lflags) return ("UNKNOWN!"); } - + DBTYPE dbtype(s) char *s; @@ -608,7 +608,7 @@ setinfo(db_type, s) *eq++ = '\0'; if (!isdigit((int) *eq)) err("%s: structure set statement must be a number", s); - + switch (db_type) { case DB_BTREE: if (!strcmp("flags", s)) { diff --git a/src/plugins/kdb/db2/libdb2/test/hash1.tests/driver2.c b/src/plugins/kdb/db2/libdb2/test/hash1.tests/driver2.c index 34397ecaa5..02982b1620 100644 --- a/src/plugins/kdb/db2/libdb2/test/hash1.tests/driver2.c +++ b/src/plugins/kdb/db2/libdb2/test/hash1.tests/driver2.c @@ -109,6 +109,3 @@ main(argc, argv) } exit(0); } - - - diff --git a/src/plugins/kdb/db2/libdb2/test/hash1.tests/tcreat3.c b/src/plugins/kdb/db2/libdb2/test/hash1.tests/tcreat3.c index f11487b320..6767de5e91 100644 --- a/src/plugins/kdb/db2/libdb2/test/hash1.tests/tcreat3.c +++ b/src/plugins/kdb/db2/libdb2/test/hash1.tests/tcreat3.c @@ -97,7 +97,7 @@ char **argv; fprintf(stderr, "cannot enter: key %s\n", item.data); exit(1); - } + } } (dbp->close)(dbp); diff --git a/src/plugins/kdb/db2/libdb2/test/hash1.tests/tdel.c b/src/plugins/kdb/db2/libdb2/test/hash1.tests/tdel.c index 826611486d..32d8250fc4 100644 --- a/src/plugins/kdb/db2/libdb2/test/hash1.tests/tdel.c +++ b/src/plugins/kdb/db2/libdb2/test/hash1.tests/tdel.c @@ -99,7 +99,7 @@ char **argv; fprintf(stderr, "cannot enter: key %s\n", item.data); exit(1); - } + } } if ( --argc ) { @@ -113,7 +113,7 @@ char **argv; if (stat) { fprintf ( stderr, "Error retrieving %s\n", key.data ); exit(1); - } + } } fclose(fp); } diff --git a/src/plugins/kdb/db2/libdb2/test/hash1.tests/thash4.c b/src/plugins/kdb/db2/libdb2/test/hash1.tests/thash4.c index b15b617bc7..830d7a1854 100644 --- a/src/plugins/kdb/db2/libdb2/test/hash1.tests/thash4.c +++ b/src/plugins/kdb/db2/libdb2/test/hash1.tests/thash4.c @@ -85,8 +85,8 @@ char **argv; key.data = wp1; item.data = wp2; - while ( fgets(wp1, 8192, stdin) && - fgets(wp2, 8192, stdin) && + while ( fgets(wp1, 8192, stdin) && + fgets(wp2, 8192, stdin) && i++ < MAXWORDS) { /* * put info in structure, and structure in the item @@ -102,14 +102,14 @@ char **argv; item.data); fprintf(stderr, "\terrno: %d\n", errno); exit(1); - } + } } if ( --argc ) { fp = fopen ( argv[0], "r"); i = 0; - while ( fgets(wp1, 256, fp) && - fgets(wp2, 8192, fp) && + while ( fgets(wp1, 256, fp) && + fgets(wp2, 8192, fp) && i++ < MAXWORDS) { key.size = strlen(wp1); diff --git a/src/plugins/kdb/db2/libdb2/test/hash1.tests/tseq.c b/src/plugins/kdb/db2/libdb2/test/hash1.tests/tseq.c index d2d36862d1..bee41961ef 100644 --- a/src/plugins/kdb/db2/libdb2/test/hash1.tests/tseq.c +++ b/src/plugins/kdb/db2/libdb2/test/hash1.tests/tseq.c @@ -72,7 +72,7 @@ char **argv; /* * put info in structure, and structure in the item */ - for ( stat = (dbp->seq) (dbp, &res, &item, 1 ); + for ( stat = (dbp->seq) (dbp, &res, &item, 1 ); stat == 0; stat = (dbp->seq) (dbp, &res, &item, 0 ) ) { diff --git a/src/plugins/kdb/db2/libdb2/test/hash2.tests/bigtest.c b/src/plugins/kdb/db2/libdb2/test/hash2.tests/bigtest.c index 81c559ad2a..c8070c5038 100644 --- a/src/plugins/kdb/db2/libdb2/test/hash2.tests/bigtest.c +++ b/src/plugins/kdb/db2/libdb2/test/hash2.tests/bigtest.c @@ -33,9 +33,9 @@ main(void) returned.data = NULL; if (n == 4627) printf(""); - if (n % 50 == 0) + if (n % 50 == 0) printf("put n = %d\n", n); - if (db->put(db, &key, &value, 0) != 0) + if (db->put(db, &key, &value, 0) != 0) printf("put error, n = %d\n", n); if (db->get(db, &key, &returned, 0) != 0) printf("Immediate get error, n = %d\n", n); @@ -47,7 +47,7 @@ main(void) } for (n = 0; n < 200000; n++) { - if (n % 50 == 0) + if (n % 50 == 0) printf("seq n = %d\n", n); if ((db->seq(db, &key, &returned, 0)) != 0) printf("Seq error, n = %d\n", n); @@ -57,10 +57,10 @@ main(void) for (i = 0; i < 800; i++) if (((int *)returned.data)[i] != 0xDEADBEEF) printf("ERRORRRRRR!!! seq %d\n", n); - } + } for (n = 0; n < 2000; n++) { - if (n % 50 == 0) + if (n % 50 == 0) printf("get n = %d\n", n); if (db->get(db, &key, &returned, 0) != 0) printf("Late get error, n = %d\n", n); @@ -73,4 +73,3 @@ main(void) free(value.data); return(0); } - diff --git a/src/plugins/kdb/db2/libdb2/test/hash2.tests/passtest.c b/src/plugins/kdb/db2/libdb2/test/hash2.tests/passtest.c index adb72c004b..43895a4293 100644 --- a/src/plugins/kdb/db2/libdb2/test/hash2.tests/passtest.c +++ b/src/plugins/kdb/db2/libdb2/test/hash2.tests/passtest.c @@ -14,7 +14,7 @@ main(void) char *key_line, *val_line, *get_key, *get_val, *old, *key2; HASHINFO passwd; int n = 0, i = 0, expected; - + key_line = (char *)malloc(100); val_line = (char *)malloc(300); old = (char *)malloc(300); @@ -28,15 +28,15 @@ main(void) passwd.hash = NULL; passwd.nelem = 0; passwd.lorder = 4321; - - db = dbopen("/usr/tmp/passwd.db", O_RDWR|O_CREAT|O_TRUNC|O_BINARY, 0664, DB_HASH, + + db = dbopen("/usr/tmp/passwd.db", O_RDWR|O_CREAT|O_TRUNC|O_BINARY, 0664, DB_HASH, &passwd); if (!db) { fprintf(stderr, "create_db: couldn't create database file\n"); exit(1); } - + while ((key_line = fgets(key_line, 100, keys)) != NULL) { if (n % 1000 == 0) fprintf(stderr, "Putting #%d.\n", n); @@ -52,7 +52,7 @@ main(void) fprintf(stderr, "Immediate get error, n = %d\n", n); } fprintf(stderr, "Done with put!\n"); - free(key_line); + free(key_line); free(val_line); fclose(keys); fclose(vals); @@ -60,7 +60,7 @@ main(void) - + keys = fopen("yp.keys", "rt"); vals = fopen("yp.total", "rt"); get_key = (char *)malloc(100); @@ -81,7 +81,7 @@ main(void) fgets(get_val, 300, vals); if (memcmp(val.data, (void *)get_val, val.size)) { fprintf(stderr, "Unmatched get on %s.\n", get_key); - fprintf(stderr, "Input = %s\nOutput = %s\n", get_val, + fprintf(stderr, "Input = %s\nOutput = %s\n", get_val, (char *)val.data); } } @@ -107,7 +107,7 @@ main(void) if (n % 1000 == 0) fprintf(stderr, "Sequence getting #%d.\n", n); if (db->seq(db, &key, &val, 0) != 0) { - fprintf(stderr, + fprintf(stderr, "Exiting sequence retrieve; n = %d, expected = %d\n", n - 1 , expected); break; @@ -131,7 +131,7 @@ main(void) n+=2; key2 = fgets(get_key, 100, keys); if (!key2) - break; + break; key.data = (void *)key2; key.size = strlen(key2); if (db->del(db, &key, 0) != 0) @@ -150,7 +150,7 @@ main(void) keys = fopen("yp.keys", "rt"); vals = fopen("yp.total", "rt"); - + db = dbopen("/usr/tmp/passwd.db", O_RDWR|O_BINARY, 0664, DB_HASH, &passwd); n = 0; while ((get_key = fgets(get_key, 100, keys)) != NULL) { @@ -160,14 +160,14 @@ main(void) key2 = fgets(key2, 100, keys); if (!key2) break; - key.data = (void *)get_key; + key.data = (void *)get_key; key.size = strlen(get_key); - if (db->get(db, &key, &val, 0) != 0) + if (db->get(db, &key, &val, 0) != 0) fprintf(stderr, "Retrieval after delete error on %d\n", n); fgets(get_val, 300, vals); if (memcmp(val.data, (void *)get_val, val.size)) { fprintf(stderr, "Unmatched get after delete on %s.\n", get_key); - fprintf(stderr, "Input = %s\nOutput = %s\n", get_val, + fprintf(stderr, "Input = %s\nOutput = %s\n", get_val, (char *)val.data); } fgets(get_val, 300, vals); diff --git a/src/plugins/kdb/db2/libdb2/test/hash2.tests/passwd/genpass.c b/src/plugins/kdb/db2/libdb2/test/hash2.tests/passwd/genpass.c index da37676878..7d03e609cb 100644 --- a/src/plugins/kdb/db2/libdb2/test/hash2.tests/passwd/genpass.c +++ b/src/plugins/kdb/db2/libdb2/test/hash2.tests/passwd/genpass.c @@ -6,7 +6,7 @@ main(int argc, char **argv) { int i,j,n; char *pass[8], r; - + n = atoi(argv[1]); srandom(101173); @@ -20,4 +20,3 @@ main(int argc, char **argv) printf("\n"); } } - diff --git a/src/plugins/kdb/db2/lockout.c b/src/plugins/kdb/db2/lockout.c index 1e6602dcca..e6c4b65e04 100644 --- a/src/plugins/kdb/db2/lockout.c +++ b/src/plugins/kdb/db2/lockout.c @@ -193,4 +193,3 @@ krb5_db2_lockout_audit(krb5_context context, return 0; } - diff --git a/src/plugins/kdb/db2/pol_xdr.c b/src/plugins/kdb/db2/pol_xdr.c index 31856fbd2a..315d0d1c55 100644 --- a/src/plugins/kdb/db2/pol_xdr.c +++ b/src/plugins/kdb/db2/pol_xdr.c @@ -8,11 +8,11 @@ #endif #include <string.h> -static +static bool_t xdr_nullstring(XDR *xdrs, char **objp) { u_int size; - + if (xdrs->x_op == XDR_ENCODE) { if (*objp == NULL) size = 0; @@ -35,22 +35,22 @@ bool_t xdr_nullstring(XDR *xdrs, char **objp) } } return (xdr_opaque(xdrs, *objp, size)); - + case XDR_ENCODE: if (size != 0) return (xdr_opaque(xdrs, *objp, size)); return TRUE; - + case XDR_FREE: if (*objp != NULL) mem_free(*objp, size); *objp = NULL; return TRUE; } - + return FALSE; } - + static int osa_policy_min_vers(osa_policy_ent_t objp) { @@ -85,7 +85,7 @@ xdr_osa_policy_ent_rec(XDR *xdrs, osa_policy_ent_t objp) return FALSE; break; } - + if(!xdr_nullstring(xdrs, &objp->name)) return (FALSE); if (!xdr_u_int32(xdrs, &objp->pw_min_life)) diff --git a/src/plugins/kdb/db2/policy_db.h b/src/plugins/kdb/db2/policy_db.h index d841d7376f..54af70cd66 100644 --- a/src/plugins/kdb/db2/policy_db.h +++ b/src/plugins/kdb/db2/policy_db.h @@ -63,7 +63,7 @@ typedef struct _osa_adb_db_ent_t { /* * Return Code (the rest are in adb_err.h) */ - + #define OSA_ADB_OK 0 /* diff --git a/src/plugins/kdb/hdb/hdb.h b/src/plugins/kdb/hdb/hdb.h index 39fbec7e5d..6200808880 100644 --- a/src/plugins/kdb/hdb/hdb.h +++ b/src/plugins/kdb/hdb/hdb.h @@ -1,34 +1,34 @@ /* * Copyright (c) 1997 - 2007 Kungliga Tekniska Högskolan - * (Royal Institute of Technology, Stockholm, Sweden). - * All rights reserved. + * (Royal Institute of Technology, Stockholm, Sweden). + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. + * 3. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ /* $Id: hdb.h 22198 2007-12-07 13:09:25Z lha $ */ @@ -77,7 +77,7 @@ typedef struct HDB{ struct HDB*, int, mode_t); - krb5_error_code (*hdb_close)(heim_context, + krb5_error_code (*hdb_close)(heim_context, struct HDB*); void (*hdb_free)(heim_context, struct HDB*, @@ -116,10 +116,10 @@ typedef struct HDB{ heim_octet_string*); krb5_error_code (*hdb__put)(heim_context, struct HDB*, - int, + int, heim_octet_string, heim_octet_string); - krb5_error_code (*hdb__del)(heim_context, + krb5_error_code (*hdb__del)(heim_context, struct HDB*, heim_octet_string); krb5_error_code (*hdb_destroy)(heim_context, diff --git a/src/plugins/kdb/hdb/kdb_hdb.c b/src/plugins/kdb/hdb/kdb_hdb.c index d22489eec5..e42b055866 100644 --- a/src/plugins/kdb/hdb/kdb_hdb.c +++ b/src/plugins/kdb/hdb/kdb_hdb.c @@ -173,7 +173,7 @@ kh_db_context_init(krb5_context context, GET_PLUGIN_FUNC(libkrb5, "krb5_pac_parse", heim_pac_parse); GET_PLUGIN_FUNC(libkrb5, "krb5_pac_verify", heim_pac_verify); GET_PLUGIN_FUNC(libkrb5, "_krb5_pac_sign", heim_pac_sign); - + if (asprintf(&libhdb, "%s/libhdb%s", libdir, SHLIBEXT) < 0) goto cleanup; @@ -1423,4 +1423,3 @@ kdb_vftabl kdb_function_table = { kh_dbekd_encrypt_key_data, kh_db_invoke, }; - diff --git a/src/plugins/kdb/hdb/kdb_hdb.h b/src/plugins/kdb/hdb/kdb_hdb.h index 9cfbef6a34..6ba5fbcb57 100644 --- a/src/plugins/kdb/hdb/kdb_hdb.h +++ b/src/plugins/kdb/hdb/kdb_hdb.h @@ -169,4 +169,3 @@ kh_hdb_windc_init(krb5_context context, kh_db_context *kh); #endif /* KRB5_KDB_HDB_H */ - diff --git a/src/plugins/kdb/hdb/kdb_marshal.c b/src/plugins/kdb/hdb/kdb_marshal.c index 17bbdc8087..d5e469347f 100644 --- a/src/plugins/kdb/hdb/kdb_marshal.c +++ b/src/plugins/kdb/hdb/kdb_marshal.c @@ -108,7 +108,7 @@ kh_unmarshal_octet_string(krb5_context context, krb5_error_code code; *out_data = k5alloc(sizeof(krb5_data), &code); - if (code != 0) + if (code != 0) return code; code = kh_unmarshal_octet_string_contents(context, in_data, *out_data); @@ -807,4 +807,3 @@ cleanup: return code; } - diff --git a/src/plugins/kdb/hdb/kdb_windc.c b/src/plugins/kdb/hdb/kdb_windc.c index a419d29ded..9481876c62 100644 --- a/src/plugins/kdb/hdb/kdb_windc.c +++ b/src/plugins/kdb/hdb/kdb_windc.c @@ -370,7 +370,7 @@ kh_db_sign_auth_data(krb5_context context, &rep->auth_data); if (code != 0) goto cleanup; - + cleanup: if (req->client == NULL) kh_free_Principal(context, client_hprinc); @@ -612,4 +612,3 @@ kh_hdb_windc_init(krb5_context context, return code; } - diff --git a/src/plugins/kdb/hdb/windc_plugin.h b/src/plugins/kdb/hdb/windc_plugin.h index 7df2a21473..d2d5497032 100644 --- a/src/plugins/kdb/hdb/windc_plugin.h +++ b/src/plugins/kdb/hdb/windc_plugin.h @@ -1,34 +1,34 @@ /* * Copyright (c) 2006 Kungliga Tekniska Högskolan - * (Royal Institute of Technology, Stockholm, Sweden). - * All rights reserved. + * (Royal Institute of Technology, Stockholm, Sweden). + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. + * 3. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ /* $Id: windc_plugin.h 22693 2008-03-19 08:57:49Z lha $ */ @@ -52,17 +52,17 @@ struct hdb_entry_ex; struct _heim_pac_data; typedef struct _heim_pac_data *heim_pac; -typedef krb5_error_code +typedef krb5_error_code (*krb5plugin_windc_pac_generate)(void *, heim_context, struct hdb_entry_ex *, heim_pac *); -typedef krb5_error_code +typedef krb5_error_code (*krb5plugin_windc_pac_verify)(void *, heim_context, const Principal *, - struct hdb_entry_ex *, + struct hdb_entry_ex *, struct hdb_entry_ex *, heim_pac *); -typedef krb5_error_code +typedef krb5_error_code (*krb5plugin_windc_client_access)( void *, heim_context, struct hdb_entry_ex *, KDC_REQ *, heim_octet_string *); @@ -79,4 +79,3 @@ typedef struct krb5plugin_windc_ftable { } krb5plugin_windc_ftable; #endif /* HEIMDAL_WINDC_PLUGIN_H */ - diff --git a/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_list.c b/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_list.c index 835b2350bb..09b50797dc 100644 --- a/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_list.c +++ b/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_list.c @@ -284,4 +284,3 @@ int list_modify_int_array(destlist, sourcelist, mode) return tcount; } - diff --git a/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_list.h b/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_list.h index b6402e5923..a251fde3f3 100644 --- a/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_list.h +++ b/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_list.h @@ -1,33 +1,32 @@ - /* * kadmin/ldap_util/kdb5_ldap_list.h */ - + /* Copyright (c) 2004-2005, Novell, Inc. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without + * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * The copyright holder's name is not used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * POSSIBILITY OF SUCH DAMAGE. */ @@ -43,5 +42,5 @@ extern void krb5_free_list_entries(char **list); extern void list_modify_str_array(char ***destlist, const char **sourcelist, int mode); extern int list_modify_int_array(int *destlist, const int *sourcelist, int mode); extern int list_count_str_array(char **list); -extern int list_count_int_array(int *list); +extern int list_count_int_array(int *list); extern int compare_int(const void*, const void *); diff --git a/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_policy.c b/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_policy.c index e794e61592..b22e631840 100644 --- a/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_policy.c +++ b/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_policy.c @@ -47,7 +47,7 @@ static char *strdur(time_t duration); extern char *yes; extern kadm5_config_params global_params; - + static krb5_error_code init_ldap_realm (int argc, char *argv[]) { /* This operation is being performed in the context of a realm. So, * initialize the realm */ @@ -55,14 +55,14 @@ static krb5_error_code init_ldap_realm (int argc, char *argv[]) { krb5_error_code retval = 0; kdb5_dal_handle *dal_handle = NULL; krb5_ldap_context *ldap_context=NULL; - + dal_handle = util_context->dal_handle; ldap_context = (krb5_ldap_context *) dal_handle->db_context; if (!ldap_context) { retval = EINVAL; goto cleanup; } - + if (ldap_context->krbcontainer == NULL) { retval = krb5_ldap_read_krbcontainer_params (util_context, &(ldap_context->krbcontainer)); @@ -71,13 +71,13 @@ static krb5_error_code init_ldap_realm (int argc, char *argv[]) { goto cleanup; } } - + if (ldap_context->lrparams == NULL) { retval = krb5_ldap_read_realm_params(util_context, global_params.realm, &(ldap_context->lrparams), &mask); - + if (retval != 0) { goto cleanup; } diff --git a/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_realm.c b/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_realm.c index 60d9e25f72..017a5cddfa 100644 --- a/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_realm.c +++ b/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_realm.c @@ -939,7 +939,7 @@ void kdb5_ldap_modify(argc, argv) char **newadmindns = NULL; char **newpwddns = NULL; char **oldsubtrees = NULL; - char *oldcontainerref = NULL; + char *oldcontainerref = NULL; int rightsmask = 0; int subtree_changed = 0; #endif @@ -1558,7 +1558,7 @@ void kdb5_ldap_modify(argc, argv) } } } - + if (subtree_changed && (mask & LDAP_REALM_KDCSERVERS)) { char **newdns = rparams->kdcservers; @@ -1591,7 +1591,7 @@ void kdb5_ldap_modify(argc, argv) } if (subtree_changed || (mask & LDAP_REALM_ADMINSERVERS)) { - + if (!(mask & LDAP_REALM_ADMINSERVERS)) { if (rparams->adminservers != NULL) { char **admindns = rparams->adminservers; @@ -1692,7 +1692,7 @@ void kdb5_ldap_modify(argc, argv) } } } - + if (subtree_changed && (mask & LDAP_REALM_ADMINSERVERS)) { char **newdns = rparams->adminservers; @@ -1725,7 +1725,7 @@ void kdb5_ldap_modify(argc, argv) } if (subtree_changed || (mask & LDAP_REALM_PASSWDSERVERS)) { - + if (!(mask & LDAP_REALM_PASSWDSERVERS)) { if (rparams->passwdservers != NULL) { char **passwddns = rparams->passwdservers; @@ -1826,7 +1826,7 @@ void kdb5_ldap_modify(argc, argv) } } } - + if (subtree_changed && (mask & LDAP_REALM_PASSWDSERVERS)) { char **newdns = rparams->passwdservers; diff --git a/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_services.c b/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_services.c index 273400c185..48cbe5a885 100644 --- a/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_services.c +++ b/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_services.c @@ -509,7 +509,7 @@ void kdb5_ldap_modify_service(argc, argv) int argc; char *argv[]; { - char *me = progname; + char *me = progname; krb5_error_code retval = 0; krb5_ldap_service_params *srvparams = NULL; krb5_boolean print_usage = FALSE; diff --git a/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_services.h b/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_services.h index 934f1abeaa..0322558cc7 100644 --- a/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_services.h +++ b/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_services.h @@ -66,4 +66,3 @@ extern void kdb5_ldap_view_service(int argc, char **argv); extern int kdb5_ldap_set_service_password(int argc, char **argv); extern void kdb5_ldap_set_service_certificate(int argc, char **argv); extern void kdb5_ldap_stash_service_password(int argc, char **argv); - diff --git a/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_util.h b/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_util.h index d27dd52471..8eb65af5d5 100644 --- a/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_util.h +++ b/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_util.h @@ -1,4 +1,4 @@ -/* +/* * kadmin/ldap_util/kdb5_ldap_util.h */ @@ -42,7 +42,7 @@ #define LIST_REALM 5 #ifdef HAVE_EDIRECTORY -# define CREATE_SERVICE 6 +# define CREATE_SERVICE 6 # define MODIFY_SERVICE 7 # define VIEW_SERVICE 8 # define DESTROY_SERVICE 9 diff --git a/src/plugins/kdb/ldap/libkdb_ldap/kdb_ext.c b/src/plugins/kdb/ldap/libkdb_ldap/kdb_ext.c index 0009b59d68..717daee227 100644 --- a/src/plugins/kdb/ldap/libkdb_ldap/kdb_ext.c +++ b/src/plugins/kdb/ldap/libkdb_ldap/kdb_ext.c @@ -96,4 +96,3 @@ krb5_ldap_invoke(krb5_context context, return code; } - diff --git a/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap.c b/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap.c index 0d86801d64..8f7e3bdd39 100644 --- a/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap.c +++ b/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap.c @@ -105,7 +105,7 @@ krb5_ldap_read_startup_information(krb5_context context) kdb5_dal_handle *dal_handle=NULL; krb5_ldap_context *ldap_context=NULL; int mask = 0; - + SETUP_CONTEXT(); if ((retval=krb5_ldap_read_krbcontainer_params(context, &(ldap_context->krbcontainer)))) { prepend_err_str (context, "Unable to read Kerberos container", retval, retval); @@ -450,7 +450,7 @@ krb5_error_code krb5_ldap_open(krb5_context context, /* ignore hash argument. Might have been passed from create */ status = EINVAL; if (opt && !strcmp(opt, "temporary")) { - /* + /* * temporary is passed in when kdb5_util load without -update is done. * This is unsupported by the LDAP plugin. */ diff --git a/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap.h b/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap.h index d14b48bf97..ea6d3706af 100644 --- a/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap.h +++ b/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap.h @@ -161,7 +161,7 @@ extern void prepend_err_str (krb5_context ctx, const char *s, krb5_error_code er && ldap_context->server_info_list)) { \ return KRB5_KDB_DBNOTINITED; \ } - + #define HNDL_LOCK(lcontext) k5_mutex_lock(&lcontext->hndl_lock) #define HNDL_UNLOCK(lcontext) k5_mutex_unlock(&lcontext->hndl_lock) @@ -204,7 +204,7 @@ struct _krb5_ldap_server_info { /* ldap server structure */ -typedef enum {SERVICE_DN_TYPE_SERVER, SERVICE_DN_TYPE_CLIENT} krb5_ldap_servicetype; +typedef enum {SERVICE_DN_TYPE_SERVER, SERVICE_DN_TYPE_CLIENT} krb5_ldap_servicetype; typedef struct _krb5_ldap_context { krb5_ldap_servicetype service_type; @@ -250,16 +250,16 @@ krb5_ldap_rebind(krb5_ldap_context *, krb5_ldap_server_handle **); krb5_error_code krb5_ldap_db_get_age(krb5_context, char *, time_t *); -krb5_error_code +krb5_error_code krb5_ldap_lib_init(void); -krb5_error_code +krb5_error_code krb5_ldap_lib_cleanup(void); -void * +void * krb5_ldap_alloc( krb5_context kcontext, void *ptr, size_t size ); -void +void krb5_ldap_free( krb5_context kcontext, void *ptr ); krb5_error_code krb5_ldap_get_mkey(krb5_context, krb5_keyblock **); @@ -276,11 +276,11 @@ krb5_ldap_set_mkey_list(krb5_context, krb5_keylist_node *); krb5_error_code krb5_ldap_create(krb5_context , char *, char **); -krb5_error_code +krb5_error_code krb5_ldap_open( krb5_context , char *, char **db_args, int mode ); -krb5_error_code +krb5_error_code krb5_ldap_close( krb5_context ); krb5_error_code diff --git a/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap_conn.c b/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap_conn.c index db1f76a69e..d757a6ee36 100644 --- a/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap_conn.c +++ b/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap_conn.c @@ -129,9 +129,9 @@ krb5_ldap_bind(ldap_context, ldap_server_handle) /* password based simple bind */ bv.bv_val = ldap_context->bind_pwd; bv.bv_len = strlen(ldap_context->bind_pwd); - st = ldap_sasl_bind_s(ldap_server_handle->ldap_handle, + st = ldap_sasl_bind_s(ldap_server_handle->ldap_handle, ldap_context->bind_dn, - NULL, &bv, NULL, + NULL, &bv, NULL, NULL, NULL); } return st; diff --git a/src/plugins/kdb/ldap/libkdb_ldap/ldap_create.c b/src/plugins/kdb/ldap/libkdb_ldap/ldap_create.c index c048c9340a..9974b1721c 100644 --- a/src/plugins/kdb/ldap/libkdb_ldap/ldap_create.c +++ b/src/plugins/kdb/ldap/libkdb_ldap/ldap_create.c @@ -39,7 +39,7 @@ #include "ldap_krbcontainer.h" #include "ldap_err.h" -/* +/* * ****************************************************************************** * DAL functions * ****************************************************************************** @@ -214,7 +214,7 @@ krb5_ldap_create (krb5_context context, char *conf_section, char **db_args) /* ignore hash argument. Might have been passed from create */ status = EINVAL; if (opt && !strcmp(opt, "temporary")) { - /* + /* * temporary is passed in when kdb5_util load without -update is done. * This is unsupported by the LDAP plugin. */ diff --git a/src/plugins/kdb/ldap/libkdb_ldap/ldap_err.c b/src/plugins/kdb/ldap/libkdb_ldap/ldap_err.c index 15ea6b4b95..5bfaa78016 100644 --- a/src/plugins/kdb/ldap/libkdb_ldap/ldap_err.c +++ b/src/plugins/kdb/ldap/libkdb_ldap/ldap_err.c @@ -13,7 +13,7 @@ #define LDAP_NAME_ERROR(x) (0) #endif #endif - + #ifndef LDAP_SECURITY_ERROR #define LDAP_SECURITY_ERROR(x) (0) #endif diff --git a/src/plugins/kdb/ldap/libkdb_ldap/ldap_fetch_mkey.c b/src/plugins/kdb/ldap/libkdb_ldap/ldap_fetch_mkey.c index 6da0806641..ad90109da2 100644 --- a/src/plugins/kdb/ldap/libkdb_ldap/ldap_fetch_mkey.c +++ b/src/plugins/kdb/ldap/libkdb_ldap/ldap_fetch_mkey.c @@ -139,4 +139,3 @@ krb5_ldap_set_mkey_list(krb5_context context, krb5_keylist_node *key_list) r_params->mkey_list = key_list; return 0; } - diff --git a/src/plugins/kdb/ldap/libkdb_ldap/ldap_handle.c b/src/plugins/kdb/ldap/libkdb_ldap/ldap_handle.c index dac02498de..8187cdc02f 100644 --- a/src/plugins/kdb/ldap/libkdb_ldap/ldap_handle.c +++ b/src/plugins/kdb/ldap/libkdb_ldap/ldap_handle.c @@ -275,4 +275,3 @@ krb5_ldap_put_handle_to_pool(ldap_context, ldap_server_handle) } return; } - diff --git a/src/plugins/kdb/ldap/libkdb_ldap/ldap_handle.h b/src/plugins/kdb/ldap/libkdb_ldap/ldap_handle.h index a3b0885f42..c351c1fd78 100644 --- a/src/plugins/kdb/ldap/libkdb_ldap/ldap_handle.h +++ b/src/plugins/kdb/ldap/libkdb_ldap/ldap_handle.h @@ -31,7 +31,7 @@ #ifndef _LDAP_HANDLE_H_ #define _LDAP_HANDLE_H_ -krb5_error_code +krb5_error_code krb5_update_ldap_handle(krb5_ldap_server_handle *, krb5_ldap_server_info *); krb5_error_code diff --git a/src/plugins/kdb/ldap/libkdb_ldap/ldap_misc.h b/src/plugins/kdb/ldap/libkdb_ldap/ldap_misc.h index 7177af6014..27531a8da2 100644 --- a/src/plugins/kdb/ldap/libkdb_ldap/ldap_misc.h +++ b/src/plugins/kdb/ldap/libkdb_ldap/ldap_misc.h @@ -86,7 +86,7 @@ krb5_error_code is_principal_in_realm(krb5_ldap_context *, krb5_const_principal); krb5_error_code -krb5_get_subtree_info(krb5_ldap_context *, char ***, unsigned int *); +krb5_get_subtree_info(krb5_ldap_context *, char ***, unsigned int *); krb5_error_code krb5_ldap_read_server_params(krb5_context , char *, int); @@ -100,16 +100,16 @@ copy_arrays(char **, char ***, int); krb5_error_code krb5_ldap_list(krb5_context, char ***, char *, char *); -krb5_error_code +krb5_error_code krb5_ldap_get_value(LDAP *, LDAPMessage *, char *, int *); -krb5_error_code +krb5_error_code krb5_ldap_get_string(LDAP *, LDAPMessage *, char *, char **, krb5_boolean *); -krb5_error_code +krb5_error_code krb5_ldap_get_strings(LDAP *, LDAPMessage *, char *, char ***, krb5_boolean *); -krb5_error_code +krb5_error_code krb5_ldap_get_time(LDAP *, LDAPMessage *, char *, krb5_timestamp *, krb5_boolean *); krb5_error_code diff --git a/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal.c b/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal.c index 1cf67629bc..ecc4d3c8aa 100644 --- a/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal.c +++ b/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal.c @@ -143,7 +143,7 @@ krb5_ldap_iterate(context, match_expr, func, func_arg) { krb5_db_entry entry; krb5_principal principal; - char **subtree=NULL, *princ_name=NULL, *realm=NULL, **values=NULL, *filter=NULL; + char **subtree=NULL, *princ_name=NULL, *realm=NULL, **values=NULL, *filter=NULL; unsigned int tree=0, ntree=1, i=0; krb5_error_code st=0, tempst=0; LDAP *ld=NULL; @@ -169,7 +169,7 @@ krb5_ldap_iterate(context, match_expr, func, func_arg) } } - /* + /* * If no match_expr then iterate through all krb princs like the db2 plugin */ if (match_expr == NULL) @@ -179,7 +179,7 @@ krb5_ldap_iterate(context, match_expr, func, func_arg) filter = NULL; CHECK_NULL(filter); - if ((st = krb5_get_subtree_info(ldap_context, &subtree, &ntree)) != 0) + if ((st = krb5_get_subtree_info(ldap_context, &subtree, &ntree)) != 0) goto cleanup; GET_HANDLE(); diff --git a/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal2.c b/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal2.c index f81d399041..42a76859a0 100644 --- a/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal2.c +++ b/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal2.c @@ -294,11 +294,11 @@ process_db_args(context, db_args, xargs, optype) dptr = &xargs->tktpolicydn; } else { if (strcmp(arg, USERDN_ARG) == 0) { - if (optype == MODIFY_PRINCIPAL || - xargs->dn != NULL || xargs->containerdn != NULL || + if (optype == MODIFY_PRINCIPAL || + xargs->dn != NULL || xargs->containerdn != NULL || xargs->linkdn != NULL) { st = EINVAL; - snprintf(errbuf, sizeof(errbuf), + snprintf(errbuf, sizeof(errbuf), "%s option not supported", arg); krb5_set_error_message(context, st, "%s", errbuf); goto cleanup; @@ -308,7 +308,7 @@ process_db_args(context, db_args, xargs, optype) if (optype == MODIFY_PRINCIPAL || xargs->dn != NULL || xargs->containerdn != NULL) { st = EINVAL; - snprintf(errbuf, sizeof(errbuf), + snprintf(errbuf, sizeof(errbuf), "%s option not supported", arg); krb5_set_error_message(context, st, "%s", errbuf); goto cleanup; @@ -317,7 +317,7 @@ process_db_args(context, db_args, xargs, optype) } else if (strcmp(arg, LINKDN_ARG) == 0) { if (xargs->dn != NULL || xargs->linkdn != NULL) { st = EINVAL; - snprintf(errbuf, sizeof(errbuf), + snprintf(errbuf, sizeof(errbuf), "%s option not supported", arg); krb5_set_error_message(context, st, "%s", errbuf); goto cleanup; @@ -329,11 +329,11 @@ process_db_args(context, db_args, xargs, optype) krb5_set_error_message(context, st, "%s", errbuf); goto cleanup; } - + xargs->dn_from_kbd = TRUE; if (arg_val == NULL || strlen(arg_val) == 0) { st = EINVAL; - snprintf(errbuf, sizeof(errbuf), + snprintf(errbuf, sizeof(errbuf), "%s option value missing", arg); krb5_set_error_message(context, st, "%s", errbuf); goto cleanup; @@ -342,7 +342,7 @@ process_db_args(context, db_args, xargs, optype) if (arg_val == NULL) { st = EINVAL; - snprintf(errbuf, sizeof(errbuf), + snprintf(errbuf, sizeof(errbuf), "%s option value missing", arg); krb5_set_error_message(context, st, "%s", errbuf); goto cleanup; @@ -350,8 +350,8 @@ process_db_args(context, db_args, xargs, optype) arg_val_len = strlen(arg_val) + 1; if (strcmp(arg, TKTPOLICY_ARG) == 0) { - if ((st = krb5_ldap_name_to_policydn (context, - arg_val, + if ((st = krb5_ldap_name_to_policydn (context, + arg_val, dptr)) != 0) goto cleanup; } else { @@ -639,7 +639,7 @@ krb5_ldap_put_principal(context, entries, nentries, db_args) free(filter); goto cleanup; } - /* + /* * If it isn't found then assume a standalone princ entry is to * be created. */ @@ -648,7 +648,7 @@ krb5_ldap_put_principal(context, entries, nentries, db_args) free(filter); if (found_entry == FALSE && principal_dn != NULL) { - /* + /* * if principal_dn is null then there is code further down to * deal with setting standalone_principal_dn. Also note that * this will set create_standalone_prinicipal true for @@ -1011,7 +1011,7 @@ krb5_ldap_put_principal(context, entries, nentries, db_args) goto cleanup; } } else if (entries->mask & KADM5_LOAD && found_entry == TRUE) { - /* + /* * a load is special in that existing entries must have attrs that * removed. */ @@ -1403,4 +1403,3 @@ getstringtime(epochtime) strftime(strtime, 50, "%Y%m%d%H%M%SZ", &tme); return strtime; } - diff --git a/src/plugins/kdb/ldap/libkdb_ldap/ldap_pwd_policy.h b/src/plugins/kdb/ldap/libkdb_ldap/ldap_pwd_policy.h index 49fa85ecbd..846014eb63 100644 --- a/src/plugins/kdb/ldap/libkdb_ldap/ldap_pwd_policy.h +++ b/src/plugins/kdb/ldap/libkdb_ldap/ldap_pwd_policy.h @@ -30,7 +30,7 @@ #ifndef _LDAP_KRBPWDPOLICY_H_ #define _LDAP_KRBPWDPOLICY_H_ - + krb5_error_code krb5_ldap_get_password_policy (krb5_context , char *, osa_policy_ent_t *, int *); @@ -44,7 +44,7 @@ krb5_error_code krb5_ldap_delete_password_policy ( krb5_context kcontext, char *policy ); krb5_error_code -krb5_ldap_iterate_password_policy(krb5_context, char *, +krb5_ldap_iterate_password_policy(krb5_context, char *, void (*) (krb5_pointer, osa_policy_ent_t ), krb5_pointer); diff --git a/src/plugins/kdb/ldap/libkdb_ldap/ldap_realm.c b/src/plugins/kdb/ldap/libkdb_ldap/ldap_realm.c index e02a51a4a7..fc84019e5a 100644 --- a/src/plugins/kdb/ldap/libkdb_ldap/ldap_realm.c +++ b/src/plugins/kdb/ldap/libkdb_ldap/ldap_realm.c @@ -40,7 +40,7 @@ #include "ldap_err.h" #define END_OF_LIST -1 -char *realm_attributes[] = {"krbSearchScope","krbSubTrees", "krbPrincContainerRef", +char *realm_attributes[] = {"krbSearchScope","krbSubTrees", "krbPrincContainerRef", "krbMaxTicketLife", "krbMaxRenewableAge", "krbTicketFlags", "krbUpEnabled", "krbTicketPolicyReference", @@ -953,9 +953,9 @@ krb5_ldap_create_realm(context, rparams, mask) krb5_error_code st=0; char *dn=NULL; char *strval[4]={NULL}; - char *contref[2]={NULL}; + char *contref[2]={NULL}; LDAPMod **mods = NULL; - int i=0, objectmask=0, subtreecount=0; + int i=0, objectmask=0, subtreecount=0; kdb5_dal_handle *dal_handle=NULL; krb5_ldap_context *ldap_context=NULL; krb5_ldap_server_handle *ldap_server_handle=NULL; @@ -972,7 +972,7 @@ krb5_ldap_create_realm(context, rparams, mask) rparams == NULL || rparams->realm_name == NULL || ((mask & LDAP_REALM_SUBTREE) && rparams->subtree == NULL) || - ((mask & LDAP_REALM_CONTREF) && rparams->containerref == NULL) || + ((mask & LDAP_REALM_CONTREF) && rparams->containerref == NULL) || ((mask & LDAP_REALM_POLICYREFERENCE) && rparams->policyreference == NULL) || #ifdef HAVE_EDIRECTORY ((mask & LDAP_REALM_KDCSERVERS) && rparams->kdcservers == NULL) || @@ -1007,7 +1007,7 @@ krb5_ldap_create_realm(context, rparams, mask) strval[0] = "top"; strval[1] = "krbrealmcontainer"; - strval[2] = "krbticketpolicyaux"; + strval[2] = "krbticketpolicyaux"; strval[3] = NULL; if ((st=krb5_add_str_mem_ldap_mod(&mods, "objectclass", LDAP_MOD_ADD, strval)) != 0) @@ -1476,7 +1476,7 @@ krb5_ldap_free_realm_params(rparams) return; } -/* +/* * ****************************************************************************** * DAL functions * ****************************************************************************** diff --git a/src/plugins/kdb/ldap/libkdb_ldap/ldap_realm.h b/src/plugins/kdb/ldap/libkdb_ldap/ldap_realm.h index db17509aeb..cfdf39c55f 100644 --- a/src/plugins/kdb/ldap/libkdb_ldap/ldap_realm.h +++ b/src/plugins/kdb/ldap/libkdb_ldap/ldap_realm.h @@ -43,7 +43,7 @@ #define LDAP_REALM_MAXTICKETLIFE 0x0100 #define LDAP_REALM_MAXRENEWLIFE 0x0200 #define LDAP_REALM_KRBTICKETFLAGS 0x0400 -#define LDAP_REALM_CONTREF 0x0800 +#define LDAP_REALM_CONTREF 0x0800 extern char *policy_attributes[]; @@ -54,8 +54,8 @@ extern char *realm_attributes[]; typedef struct _krb5_ldap_realm_params { char *realmdn; char *realm_name; - char **subtree; - char *containerref; + char **subtree; + char *containerref; char *policyreference; int search_scope; int upenabled; diff --git a/src/plugins/kdb/ldap/libkdb_ldap/ldap_service_rights.c b/src/plugins/kdb/ldap/libkdb_ldap/ldap_service_rights.c index d670f59fb7..8d87d46ace 100644 --- a/src/plugins/kdb/ldap/libkdb_ldap/ldap_service_rights.c +++ b/src/plugins/kdb/ldap/libkdb_ldap/ldap_service_rights.c @@ -133,7 +133,7 @@ static char *kdcrights_realmcontainer[][2]={ {"2#subtree#","#krbMKey"}, {"2#subtree#","#krbUPEnabled"}, {"2#subtree#","#krbSubTrees"}, - {"2#subtree#","#krbPrincContainerRef"}, + {"2#subtree#","#krbPrincContainerRef"}, {"2#subtree#","#krbSearchScope"}, {"2#subtree#","#krbLdapServers"}, {"2#subtree#","#krbKdcServers"}, @@ -167,7 +167,7 @@ static char *adminrights_realmcontainer[][2]={ {"2#subtree#","#krbMKey"}, {"6#subtree#","#krbUPEnabled"}, {"2#subtree#","#krbSubTrees"}, - {"2#subtree#","#krbPrincContainerRef"}, + {"2#subtree#","#krbPrincContainerRef"}, {"2#subtree#","#krbSearchScope"}, {"2#subtree#","#krbLdapServers"}, {"2#subtree#","#krbKdcServers"}, @@ -208,7 +208,7 @@ static char *pwdrights_realmcontainer[][2]={ {"2#subtree#","#krbMKey"}, {"2#subtree#","#krbUPEnabled"}, {"2#subtree#","#krbSubTrees"}, - {"2#subtree#","#krbPrincContainerRef"}, + {"2#subtree#","#krbPrincContainerRef"}, {"2#subtree#","#krbSearchScope"}, {"2#subtree#","#krbLdapServers"}, {"2#subtree#","#krbKdcServers"}, @@ -271,8 +271,8 @@ krb5_ldap_add_service_rights(context, servicetype, serviceobjdn, realmname, subt int servicetype; char *serviceobjdn; char *realmname; - char **subtreeparam; - char *contref; + char **subtreeparam; + char *contref; int mask; { @@ -559,7 +559,7 @@ krb5_ldap_delete_service_rights(context, servicetype, serviceobjdn, realmname, s int servicetype; char *serviceobjdn; char *realmname; - char **subtreeparam; + char **subtreeparam; char *contref; int mask; { @@ -574,7 +574,7 @@ krb5_ldap_delete_service_rights(context, servicetype, serviceobjdn, realmname, s kdb5_dal_handle *dal_handle=NULL; krb5_ldap_context *ldap_context=NULL; krb5_ldap_server_handle *ldap_server_handle=NULL; - int subtreecount = 0; + int subtreecount = 0; SETUP_CONTEXT(); GET_HANDLE(); diff --git a/src/plugins/kdb/ldap/libkdb_ldap/ldap_service_stash.h b/src/plugins/kdb/ldap/libkdb_ldap/ldap_service_stash.h index bd7e3dc636..05dd40a958 100644 --- a/src/plugins/kdb/ldap/libkdb_ldap/ldap_service_stash.h +++ b/src/plugins/kdb/ldap/libkdb_ldap/ldap_service_stash.h @@ -42,14 +42,13 @@ struct data{ #define ERR_PWD_BAD 3 #define ERR_PWD_NOT_HEX 4 -int +int dec_password(struct data, struct data *); krb5_error_code krb5_ldap_readpassword(krb5_context, krb5_ldap_context *, unsigned char **); -int +int tohex(krb5_data, krb5_data *); #endif - diff --git a/src/plugins/kdb/ldap/libkdb_ldap/ldap_services.h b/src/plugins/kdb/ldap/libkdb_ldap/ldap_services.h index 0ad580d13e..5f0b1d7e6e 100644 --- a/src/plugins/kdb/ldap/libkdb_ldap/ldap_services.h +++ b/src/plugins/kdb/ldap/libkdb_ldap/ldap_services.h @@ -87,7 +87,7 @@ krb5_ldap_free_service( krb5_context, krb5_ldap_service_params *); krb5_error_code krb5_ldap_set_service_passwd( krb5_context, char *, char *); -krb5_error_code +krb5_error_code krb5_ldap_add_service_rights( krb5_context, int, char *, char *, char **, char *, int); krb5_error_code diff --git a/src/plugins/kdb/ldap/libkdb_ldap/princ_xdr.h b/src/plugins/kdb/ldap/libkdb_ldap/princ_xdr.h index 65a03f7ddc..5f40e4330a 100644 --- a/src/plugins/kdb/ldap/libkdb_ldap/princ_xdr.h +++ b/src/plugins/kdb/ldap/libkdb_ldap/princ_xdr.h @@ -34,7 +34,7 @@ ldap_xdr_krb5_ui_2(XDR *xdrs, krb5_ui_2 *objp); bool_t ldap_xdr_krb5_int16(XDR *xdrs, krb5_int16 *objp); -bool_t +bool_t ldap_xdr_nullstring(XDR *xdrs, char **objp); bool_t diff --git a/src/plugins/locate/python/py-locate.c b/src/plugins/locate/python/py-locate.c index 5167230a00..6f4943a756 100644 --- a/src/plugins/locate/python/py-locate.c +++ b/src/plugins/locate/python/py-locate.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/preauth/cksum_body/cksum_body_main.c b/src/plugins/preauth/cksum_body/cksum_body_main.c index 5239513515..77de0a8b65 100644 --- a/src/plugins/preauth/cksum_body/cksum_body_main.c +++ b/src/plugins/preauth/cksum_body/cksum_body_main.c @@ -235,7 +235,7 @@ client_gic_opt(krb5_context kcontext, { #ifdef DEBUG fprintf(stderr, "(cksum_body) client_gic_opt: received '%s' = '%s'\n", - attr, value); + attr, value); #endif return 0; } diff --git a/src/plugins/preauth/encrypted_challenge/encrypted_challenge_main.c b/src/plugins/preauth/encrypted_challenge/encrypted_challenge_main.c index 1229d2a7d3..45b309d8ba 100644 --- a/src/plugins/preauth/encrypted_challenge/encrypted_challenge_main.c +++ b/src/plugins/preauth/encrypted_challenge/encrypted_challenge_main.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 @@ -22,8 +22,8 @@ * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" without express * or implied warranty. - * - * + * + * * * Implement EncryptedChallenge fast factor from draft-ietf-krb-wg-preauth-framework */ @@ -64,7 +64,7 @@ static krb5_error_code process_preauth krb5_keyblock *challenge_key = NULL, *armor_key = NULL; krb5_data *etype_data = NULL; krb5int_access kaccess; - + if (krb5int_accessor(&kaccess, KRB5INT_ACCESS_VERSION) != 0) return 0; retval = fast_get_armor_key(context, get_data_proc, rock, &armor_key); @@ -174,10 +174,10 @@ static krb5_error_code process_preauth &etype_data); return retval; } - - - - + + + + static krb5_error_code kdc_include_padata (krb5_context context, krb5_kdc_req *request, @@ -222,10 +222,10 @@ static krb5_error_code kdc_verify_preauth krb5_data *client_data = NULL; krb5_keyblock *challenge_key = NULL; int i = 0; - + plain.data = NULL; if (krb5int_accessor(&kaccess, KRB5INT_ACCESS_VERSION) != 0) - return 0; + return 0; retval = fast_kdc_get_armor_key(context, get_entry_proc, request, client, &armor_key); if (retval == 0 &&armor_key == NULL) { @@ -243,7 +243,7 @@ static krb5_error_code kdc_verify_preauth retval = ENOMEM; } if (retval == 0) - retval = get_entry_proc(context, request, client, + retval = get_entry_proc(context, request, client, krb5plugin_preauth_keys, &client_data); if (retval == 0) { client_keys = (krb5_keyblock *) client_data->data; @@ -274,7 +274,7 @@ static krb5_error_code kdc_verify_preauth for (j = i+1; client_keys[j].enctype; j++) krb5_free_keyblock_contents(context, &client_keys[j]); } - + } if (retval == 0) retval = kaccess.decode_enc_ts(&plain, &ts); @@ -301,7 +301,7 @@ static krb5_error_code kdc_verify_preauth } if (armor_key) krb5_free_keyblock(context, armor_key); - if (plain.data) + if (plain.data) free(plain.data); if (enc) kaccess.free_enc_data(context, enc); @@ -332,7 +332,7 @@ static krb5_error_code kdc_return_preauth krb5_data *encoded = NULL; krb5_pa_data *pa = NULL; krb5int_access kaccess; - + if (krb5int_accessor(&kaccess, KRB5INT_ACCESS_VERSION) != 0) return 0; if (challenge_key == NULL) @@ -408,4 +408,3 @@ struct krb5plugin_preauth_client_ftable_v1 preauthentication_client_1 = { NULL, /* try_again function */ NULL /* get init creds opt function */ }; - diff --git a/src/plugins/preauth/fast_factor.h b/src/plugins/preauth/fast_factor.h index 4059b28768..1e7696f02c 100644 --- a/src/plugins/preauth/fast_factor.h +++ b/src/plugins/preauth/fast_factor.h @@ -30,7 +30,7 @@ static krb5_error_code fast_kdc_get_armor_key if (retval == 0) { *armor_key = (krb5_keyblock *) data->data; data->data = NULL; - get_entry(context, request, client, + get_entry(context, request, client, krb5plugin_preauth_free_fast_armor, &data); } return retval; diff --git a/src/plugins/preauth/pkinit/pkinit.h b/src/plugins/preauth/pkinit/pkinit.h index 04c64a4a8f..65984824e3 100644 --- a/src/plugins/preauth/pkinit/pkinit.h +++ b/src/plugins/preauth/pkinit/pkinit.h @@ -103,7 +103,7 @@ static inline void pkiDebug (const char *fmt, ...) { } /* #define pkiDebug (void) */ #endif -/* Solaris compiler doesn't grok __FUNCTION__ +/* Solaris compiler doesn't grok __FUNCTION__ * hack for now. Fix all the uses eventually. */ #define __FUNCTION__ __func__ @@ -125,15 +125,15 @@ extern const krb5_octet_data dh_oid; * (the kdc's identity is at the plugin level, the client's identity * information could change per-request.) * the identity context is meant to have the entity's cert, - * a list of trusted and intermediate cas, a list of crls, and any + * a list of trusted and intermediate cas, a list of crls, and any * pkcs11 information. the req context is meant to have the * received certificate and the DH related information. the plugin * context is meant to have global crypto information, i.e., OIDs * and constant DH parameter information. - */ + */ /* - * plugin crypto context should keep plugin common information, + * plugin crypto context should keep plugin common information, * eg., OIDs, known DHparams */ typedef struct _pkinit_plg_crypto_context *pkinit_plg_crypto_context; @@ -159,7 +159,7 @@ typedef struct _pkinit_plg_opts { int accept_secondary_eku;/* accept secondary EKU (default is false) */ int allow_upn; /* allow UPN-SAN instead of pkinit-SAN */ int dh_or_rsa; /* selects DH or RSA based pkinit */ - int require_crl_checking; /* require CRL for a CA (default is false) */ + int require_crl_checking; /* require CRL for a CA (default is false) */ int dh_min_bits; /* minimum DH modulus size allowed */ } pkinit_plg_opts; @@ -255,7 +255,7 @@ typedef struct _pkinit_kdc_req_context *pkinit_kdc_req_context; /* * Functions in pkinit_lib.c - */ + */ krb5_error_code pkinit_init_req_opts(pkinit_req_opts **); void pkinit_fini_req_opts(pkinit_req_opts *); diff --git a/src/plugins/preauth/pkinit/pkinit_clnt.c b/src/plugins/preauth/pkinit/pkinit_clnt.c index 935ed2faf5..7fa42f34ab 100644 --- a/src/plugins/preauth/pkinit/pkinit_clnt.c +++ b/src/plugins/preauth/pkinit/pkinit_clnt.c @@ -271,7 +271,7 @@ pkinit_as_req_create(krb5_context context, /* add List of CMS algorithms */ retval = create_krb5_supportedCMSTypes(context, plgctx->cryptoctx, - reqctx->cryptoctx, reqctx->idctx, + reqctx->cryptoctx, reqctx->idctx, &auth_pack->supportedCMSTypes); if (retval) goto cleanup; @@ -434,7 +434,7 @@ cleanup: free(auth_pack9); break; } - + pkiDebug("pkinit_as_req_create retval=%d\n", (int) retval); @@ -501,7 +501,7 @@ verify_kdc_san(krb5_context context, *need_eku_checking = 1; retval = pkinit_libdefault_strings(context, - krb5_princ_realm(context, kdcprinc), + krb5_princ_realm(context, kdcprinc), KRB5_CONF_PKINIT_KDC_HOSTNAME, &cfghosts); if (retval || cfghosts == NULL) { @@ -595,7 +595,7 @@ out: __FUNCTION__, retval, *valid_san, *need_eku_checking); return retval; } - + static krb5_error_code verify_kdc_eku(krb5_context context, pkinit_context plgctx, @@ -719,7 +719,7 @@ pkinit_as_rep_parse(krb5_context context, } if (need_eku_checking) { - retval = verify_kdc_eku(context, plgctx, reqctx, + retval = verify_kdc_eku(context, plgctx, reqctx, &valid_eku); if (retval) goto cleanup; @@ -729,7 +729,7 @@ pkinit_as_rep_parse(krb5_context context, retval = KRB5KDC_ERR_INCONSISTENT_KEY_PURPOSE; goto cleanup; } - } else + } else pkiDebug("%s: skipping EKU check\n", __FUNCTION__); OCTETDATA_TO_KRB5DATA(&dh_data, &k5data); @@ -863,7 +863,7 @@ cleanup: if (key_pack != NULL) { free_krb5_reply_key_pack(&key_pack); free(cksum.contents); - } + } if (key_pack9 != NULL) free_krb5_reply_key_pack_draft9(&key_pack9); @@ -1146,7 +1146,7 @@ pkinit_client_tryagain(krb5_context context, if (retval) goto cleanup; } - + retval = 0; cleanup: if (krb5_trusted_certifiers != NULL) @@ -1202,7 +1202,7 @@ pkinit_client_req_init(krb5_context context, retval = pkinit_init_req_opts(&reqctx->opts); if (retval) goto cleanup; - + reqctx->opts->require_eku = plgctx->opts->require_eku; reqctx->opts->accept_secondary_eku = plgctx->opts->accept_secondary_eku; reqctx->opts->dh_or_rsa = plgctx->opts->dh_or_rsa; @@ -1365,7 +1365,7 @@ add_string_to_array(krb5_context context, char ***array, const char *addition) free(*array); } *array = out; - + return 0; } static krb5_error_code diff --git a/src/plugins/preauth/pkinit/pkinit_crypto.h b/src/plugins/preauth/pkinit/pkinit_crypto.h index 779c08caed..83d2f1e19d 100644 --- a/src/plugins/preauth/pkinit/pkinit_crypto.h +++ b/src/plugins/preauth/pkinit/pkinit_crypto.h @@ -136,7 +136,7 @@ krb5_error_code cms_signeddata_create unsigned char **signed_data, /* OUT for CMS_SIGN_CLIENT receives DER encoded SignedAuthPack (CMS_SIGN_CLIENT) or DER - encoded DHInfo (CMS_SIGN_SERVER) */ + encoded DHInfo (CMS_SIGN_SERVER) */ unsigned int *signed_data_len); /* OUT receives length of signed_data */ @@ -177,12 +177,12 @@ krb5_error_code cms_signeddata_verify /* * this function creates a CMS message where eContentType is EnvelopedData */ -krb5_error_code cms_envelopeddata_create +krb5_error_code cms_envelopeddata_create (krb5_context context, /* IN */ pkinit_plg_crypto_context plg_cryptoctx, /* IN */ pkinit_req_crypto_context req_cryptoctx, /* IN */ pkinit_identity_crypto_context id_cryptoctx, /* IN */ - krb5_preauthtype pa_type, /* IN */ + krb5_preauthtype pa_type, /* IN */ int include_certchain, /* IN specifies whether the certificates field in SignedData should contain certificate path */ @@ -210,7 +210,7 @@ krb5_error_code cms_envelopeddata_verify unsigned char *envel_data, /* IN contains DER encoded encKeyPack */ unsigned int envel_data_len, /* IN - contains length of envel_data */ + contains length of envel_data */ unsigned char **signed_data, /* OUT receives ReplyKeyPack */ unsigned int *signed_data_len); /* OUT @@ -222,7 +222,7 @@ krb5_error_code cms_envelopeddata_verify * upn_sans, or kdc_hostnames must be non-NULL. */ krb5_error_code crypto_retrieve_cert_sans - (krb5_context context, /* IN */ + (krb5_context context, /* IN */ pkinit_plg_crypto_context plg_cryptoctx, /* IN */ pkinit_req_crypto_context req_cryptoctx, /* IN */ pkinit_identity_crypto_context id_cryptoctx, /* IN */ @@ -237,7 +237,7 @@ krb5_error_code crypto_retrieve_cert_sans unsigned char ***kdc_hostname); /* OUT if non-NULL, a null-terminated array of dNSName (hostname) SAN values found in the - certificate are returned */ + certificate are returned */ /* * this function checks for acceptable key usage values @@ -301,14 +301,14 @@ krb5_error_code client_create_dh unsigned int *dh_params_len, /* OUT contains length of dh_parmas */ unsigned char **dh_pubkey, /* OUT - receives DER encoded DH pub key */ + receives DER encoded DH pub key */ unsigned int *dh_pubkey_len); /* OUT receives length of dh_pubkey */ /* * this function completes client's the DH protocol. client * processes received DH pub key from the KDC and computes - * the DH secret key + * the DH secret key */ krb5_error_code client_process_dh (krb5_context context, /* IN */ @@ -353,7 +353,7 @@ krb5_error_code server_process_dh unsigned int received_pub_len, /* IN contains length of received_pubkey */ unsigned char **dh_pubkey, /* OUT - receives KDC's DER encoded DH pub key */ + receives KDC's DER encoded DH pub key */ unsigned int *dh_pubkey_len, /* OUT receives length of dh_pubkey */ unsigned char **server_key, /* OUT @@ -521,7 +521,7 @@ krb5_error_code crypto_load_cas_and_crls pkinit_req_crypto_context req_cryptoctx, /* IN */ pkinit_identity_opts *idopts, /* IN */ pkinit_identity_crypto_context id_cryptoctx, /* IN/OUT */ - int idtype, /* IN + int idtype, /* IN defines the storage type (file, directory, etc) */ int catype, /* IN defines the ca type (anchor, intermediate, crls) */ @@ -571,7 +571,7 @@ krb5_error_code pkinit_process_td_dh_params krb5_error_code pkinit_create_td_invalid_certificate (krb5_context context, /* IN */ pkinit_plg_crypto_context plg_cryptoctx, /* IN */ - pkinit_req_crypto_context req_cryptoctx, /* IN */ + pkinit_req_crypto_context req_cryptoctx, /* IN */ pkinit_identity_crypto_context id_cryptoctx, /* IN */ krb5_data **edata); /* OUT */ @@ -586,7 +586,7 @@ krb5_error_code pkinit_create_td_trusted_certifiers krb5_data **edata); /* OUT */ /* - * this function processes edata that contains either + * this function processes edata that contains either * TD-TRUSTED-CERTIFICATES or TD-INVALID-CERTIFICATES. * current implementation only decodes the received message * but does not act on it diff --git a/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c b/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c index 2f0f09d310..84259e63a2 100644 --- a/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c +++ b/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c @@ -415,7 +415,7 @@ pkinit_init_pkinit_oids(pkinit_plg_crypto_context ctx) } \ } \ ctx->vn = OBJ_nid2obj(nid); - + CREATE_OBJ_IF_NEEDED("1.3.6.1.5.2.2", id_pkinit_san, "id-pkinit-san", "KRB5PrincipalName"); @@ -771,9 +771,9 @@ cms_signeddata_create(krb5_context context, id_cryptoctx->intermediateCAs); X509_STORE_CTX_trusted_stack(&certctx, id_cryptoctx->trustedCAs); if (!X509_verify_cert(&certctx)) { - pkiDebug("failed to create a certificate chain: %s\n", + pkiDebug("failed to create a certificate chain: %s\n", X509_verify_cert_error_string(X509_STORE_CTX_get_error(&certctx))); - if (!sk_X509_num(id_cryptoctx->trustedCAs)) + if (!sk_X509_num(id_cryptoctx->trustedCAs)) pkiDebug("No trusted CAs found. Check your X509_anchors\n"); goto cleanup; } @@ -851,7 +851,7 @@ cms_signeddata_create(krb5_context context, V_ASN1_OCTET_STRING, (char *) digest_attr); /* create a content-type attr */ - PKCS7_add_signed_attribute(p7si, NID_pkcs9_contentType, + PKCS7_add_signed_attribute(p7si, NID_pkcs9_contentType, V_ASN1_OBJECT, oid); /* create the signature over signed attributes. get DER encoded value */ @@ -871,12 +871,12 @@ cms_signeddata_create(krb5_context context, * digestAlgorithm AlgorithmIdentifier, * digest OCTET STRING } */ - if (id_cryptoctx->pkcs11_method == 1 && + if (id_cryptoctx->pkcs11_method == 1 && id_cryptoctx->mech == CKM_RSA_PKCS) { pkiDebug("mech = CKM_RSA_PKCS\n"); EVP_MD_CTX_init(&ctx2); /* if this is not draft9 request, include digest signed attribute */ - if (cms_msg_type != CMS_SIGN_DRAFT9) + if (cms_msg_type != CMS_SIGN_DRAFT9) EVP_DigestInit_ex(&ctx2, md_tmp, NULL); else EVP_DigestInit_ex(&ctx2, EVP_sha1(), NULL); @@ -929,7 +929,7 @@ cms_signeddata_create(krb5_context context, #ifdef DEBUG_SIG print_buffer(sig, sig_len); #endif - if (cms_msg_type != CMS_SIGN_DRAFT9) + if (cms_msg_type != CMS_SIGN_DRAFT9) free(abuf); if (retval) goto cleanup2; @@ -1013,10 +1013,10 @@ cms_signeddata_create(krb5_context context, #endif cleanup2: - if (cms_msg_type != CMS_SIGN_DRAFT9) + if (cms_msg_type != CMS_SIGN_DRAFT9) EVP_MD_CTX_cleanup(&ctx); #ifndef WITHOUT_PKCS11 - if (id_cryptoctx->pkcs11_method == 1 && + if (id_cryptoctx->pkcs11_method == 1 && id_cryptoctx->mech == CKM_RSA_PKCS) { EVP_MD_CTX_cleanup(&ctx2); free(digest_buf); @@ -1029,7 +1029,7 @@ cms_signeddata_create(krb5_context context, if (alg != NULL) X509_ALGOR_free(alg); cleanup: - if (p7 != NULL) + if (p7 != NULL) PKCS7_free(p7); free(sig); @@ -1235,7 +1235,7 @@ cms_signeddata_verify(krb5_context context, #endif } else { /* retrieve verified certificate chain */ - if (cms_msg_type == CMS_SIGN_CLIENT || cms_msg_type == CMS_SIGN_DRAFT9) + if (cms_msg_type == CMS_SIGN_CLIENT || cms_msg_type == CMS_SIGN_DRAFT9) verified_chain = X509_STORE_CTX_get1_chain(&cert_ctx); } X509_STORE_CTX_cleanup(&cert_ctx); @@ -1248,7 +1248,7 @@ cms_signeddata_verify(krb5_context context, if (PKCS7_verify(p7, NULL, store, NULL, out, flags)) { int valid_oid = 0; - if (!OBJ_cmp(p7->d.sign->contents->type, oid)) + if (!OBJ_cmp(p7->d.sign->contents->type, oid)) valid_oid = 1; else if (cms_msg_type == CMS_SIGN_DRAFT9) { /* @@ -1266,11 +1266,11 @@ cms_signeddata_verify(krb5_context context, valid_oid = 1; } - if (valid_oid) + if (valid_oid) pkiDebug("PKCS7 Verification successful\n"); else { pkiDebug("wrong oid in eContentType\n"); - print_buffer(p7->d.sign->contents->type->data, + print_buffer(p7->d.sign->contents->type->data, (unsigned int)p7->d.sign->contents->type->length); retval = KRB5KDC_ERR_PREAUTH_FAILED; krb5_set_error_message(context, retval, "wrong oid\n"); @@ -1310,11 +1310,11 @@ cms_signeddata_verify(krb5_context context, /* generate authorization data */ if (cms_msg_type == CMS_SIGN_CLIENT || cms_msg_type == CMS_SIGN_DRAFT9) { - if (authz_data == NULL || authz_data_len == NULL) + if (authz_data == NULL || authz_data_len == NULL) goto out; *authz_data = NULL; - retval = create_identifiers_from_stack(verified_chain, + retval = create_identifiers_from_stack(verified_chain, &krb5_verified_chain); if (retval) { pkiDebug("create_identifiers_from_stack failed\n"); @@ -1447,18 +1447,18 @@ cms_envelopeddata_create(krb5_context context, } switch (pa_type) { case KRB5_PADATA_PK_AS_REQ: - p7->d.enveloped->enc_data->content_type = + p7->d.enveloped->enc_data->content_type = OBJ_nid2obj(NID_pkcs7_signed); break; case KRB5_PADATA_PK_AS_REP_OLD: case KRB5_PADATA_PK_AS_REQ_OLD: - p7->d.enveloped->enc_data->content_type = + p7->d.enveloped->enc_data->content_type = OBJ_nid2obj(NID_pkcs7_data); break; break; break; break; - } + } *out_len = i2d_PKCS7(p7, NULL); if (!*out_len || (p = *out = malloc(*out_len)) == NULL) { @@ -1485,7 +1485,7 @@ cleanup: free(enc_data); if (encerts != NULL) sk_X509_free(encerts); - + return retval; } @@ -1631,7 +1631,7 @@ cms_envelopeddata_verify(krb5_context context, if (!retval) pkiDebug("PKCS7 Verification Success\n"); - else { + else { pkiDebug("PKCS7 Verification Failure\n"); goto cleanup; } @@ -1774,7 +1774,7 @@ crypto_retrieve_X509_sans(krb5_context context, pkiDebug("%s: found dns name = %s\n", __FUNCTION__, gen->d.dNSName->data); dnss[d] = (unsigned char *) - strdup((char *)gen->d.dNSName->data); + strdup((char *)gen->d.dNSName->data); if (dnss[d] == NULL) { pkiDebug("%s: failed to duplicate dns name\n", __FUNCTION__); @@ -2937,7 +2937,7 @@ pkinit_pkcs7type2oid(pkinit_plg_crypto_context cryptoctx, int pkcs7_type) * We need this shadow version because our code * depends on the "other" type to be unknown to the * OpenSSL code. - */ + */ if (cryptoctx->id_pkinit_authData9 == NULL) { pkiDebug("%s: Creating shadow instance of pkcs7-data oid\n", __FUNCTION__); @@ -3954,7 +3954,7 @@ pkinit_get_certs_dir(krb5_context context, retval = 0; cleanup: - if (d) + if (d) closedir(d); return retval; @@ -4099,7 +4099,7 @@ pkinit_get_certs_pkcs11(krb5_context context, } for (i = 0; ; i++) { - if (i >= MAX_CREDS_ALLOWED) + if (i >= MAX_CREDS_ALLOWED) return KRB5KDC_ERR_PREAUTH_FAILED; /* Look for x.509 cert */ @@ -4338,7 +4338,7 @@ crypto_cert_iteration_next(krb5_context context, if (id_cryptoctx->creds[id->index] == NULL) return PKINIT_ITER_NO_MORE; - + cd = calloc(1, sizeof(*cd)); if (cd == NULL) return ENOMEM; @@ -4392,7 +4392,7 @@ crypto_retieve_X509_key_usage(krb5_context context, pkiDebug("%s: EKUs not requested, not checking\n", __FUNCTION__); goto check_kus; } - + /* Start with Extended Key usage */ i = X509_get_ext_by_NID(x, NID_ext_key_usage, -1); if (i >= 0) { @@ -4612,12 +4612,12 @@ crypto_cert_select(krb5_context context, cd = (struct _pkinit_cert_data *)md->ch; if (cd == NULL || cd->magic != CERT_MAGIC) return EINVAL; - - /* copy the selected cert into our id_cryptoctx */ + + /* copy the selected cert into our id_cryptoctx */ if (cd->idctx->my_certs != NULL) { sk_X509_pop_free(cd->idctx->my_certs, X509_free); } - cd->idctx->my_certs = sk_X509_new_null(); + cd->idctx->my_certs = sk_X509_new_null(); sk_X509_push(cd->idctx->my_certs, cd->cred->cert); cd->idctx->creds[cd->index]->cert = NULL; /* Don't free it twice */ cd->idctx->cert_index = 0; @@ -4625,7 +4625,7 @@ crypto_cert_select(krb5_context context, if (cd->idctx->pkcs11_method != 1) { cd->idctx->my_key = cd->cred->key; cd->idctx->creds[cd->index]->key = NULL; /* Don't free it twice */ - } + } #ifndef WITHOUT_PKCS11 else { cd->idctx->cert_id = cd->cred->cert_id; @@ -4662,11 +4662,11 @@ crypto_cert_select_default(krb5_context context, retval = EINVAL; goto errout; } - /* copy the selected cert into our id_cryptoctx */ + /* copy the selected cert into our id_cryptoctx */ if (id_cryptoctx->my_certs != NULL) { sk_X509_pop_free(id_cryptoctx->my_certs, X509_free); } - id_cryptoctx->my_certs = sk_X509_new_null(); + id_cryptoctx->my_certs = sk_X509_new_null(); sk_X509_push(id_cryptoctx->my_certs, id_cryptoctx->creds[0]->cert); id_cryptoctx->creds[0]->cert = NULL; /* Don't free it twice */ id_cryptoctx->cert_index = 0; @@ -4674,7 +4674,7 @@ crypto_cert_select_default(krb5_context context, if (id_cryptoctx->pkcs11_method != 1) { id_cryptoctx->my_key = id_cryptoctx->creds[0]->key; id_cryptoctx->creds[0]->key = NULL; /* Don't free it twice */ - } + } #ifndef WITHOUT_PKCS11 else { id_cryptoctx->cert_id = id_cryptoctx->creds[0]->cert_id; @@ -4757,7 +4757,7 @@ load_cas_and_crls(krb5_context context, */ for (i = 0; i < sk_X509_INFO_num(sk); i++) { X509_INFO *xi = sk_X509_INFO_value(sk, i); - if (xi != NULL && xi->x509 != NULL && catype != CATYPE_CRLS) { + if (xi != NULL && xi->x509 != NULL && catype != CATYPE_CRLS) { int j = 0, size = sk_X509_num(ca_certs), flag = 0; if (!size) { @@ -4770,7 +4770,7 @@ load_cas_and_crls(krb5_context context, flag = X509_cmp(x, xi->x509); if (flag == 0) break; - else + else continue; } if (flag != 0) { @@ -4804,7 +4804,7 @@ load_cas_and_crls(krb5_context context, case CATYPE_ANCHORS: if (sk_X509_num(ca_certs) == 0) { pkiDebug("no anchors in file, %s\n", filename); - if (id_cryptoctx->trustedCAs == NULL) + if (id_cryptoctx->trustedCAs == NULL) sk_X509_free(ca_certs); } else { if (id_cryptoctx->trustedCAs == NULL) @@ -4814,7 +4814,7 @@ load_cas_and_crls(krb5_context context, case CATYPE_INTERMEDIATES: if (sk_X509_num(ca_certs) == 0) { pkiDebug("no intermediates in file, %s\n", filename); - if (id_cryptoctx->intermediateCAs == NULL) + if (id_cryptoctx->intermediateCAs == NULL) sk_X509_free(ca_certs); } else { if (id_cryptoctx->intermediateCAs == NULL) @@ -4855,7 +4855,7 @@ load_cas_and_crls_dir(krb5_context context, pkinit_req_crypto_context req_cryptoctx, pkinit_identity_crypto_context id_cryptoctx, int catype, - char *dirname) + char *dirname) { krb5_error_code retval = EINVAL; DIR *d = NULL; @@ -4866,7 +4866,7 @@ load_cas_and_crls_dir(krb5_context context, return EINVAL; d = opendir(dirname); - if (d == NULL) + if (d == NULL) return ENOENT; while ((dentry = readdir(d))) { @@ -4893,7 +4893,7 @@ load_cas_and_crls_dir(krb5_context context, retval = 0; cleanup: - if (d != NULL) + if (d != NULL) closedir(d); return retval; @@ -4907,7 +4907,7 @@ crypto_load_cas_and_crls(krb5_context context, pkinit_identity_crypto_context id_cryptoctx, int idtype, int catype, - char *id) + char *id) { pkiDebug("%s: called with idtype %s and catype %s\n", __FUNCTION__, idtype2string(idtype), catype2string(catype)); @@ -5008,7 +5008,7 @@ if (longhorn == 0) { /* XXX Longhorn doesn't like this */ if ((p = krb5_cas[i]->subjectKeyIdentifier.data = malloc((size_t) len)) == NULL) goto cleanup; - i2d_ASN1_OCTET_STRING(ikeyid, &p); + i2d_ASN1_OCTET_STRING(ikeyid, &p); krb5_cas[i]->subjectKeyIdentifier.length = len; } if (ikeyid != NULL) @@ -5052,7 +5052,7 @@ create_krb5_invalidCertificates(krb5_context context, return KRB5KDC_ERR_PREAUTH_FAILED; sk = sk_X509_new_null(); - if (sk == NULL) + if (sk == NULL) goto cleanup; sk_X509_push(sk, req_cryptoctx->received_cert); @@ -5419,7 +5419,7 @@ pkcs7_dataDecode(krb5_context context, PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE); goto cleanup; } - + } /* If we haven't got a certificate try each ri in turn */ diff --git a/src/plugins/preauth/pkinit/pkinit_identity.c b/src/plugins/preauth/pkinit/pkinit_identity.c index b71f7c9457..48426e3481 100644 --- a/src/plugins/preauth/pkinit/pkinit_identity.c +++ b/src/plugins/preauth/pkinit/pkinit_identity.c @@ -459,7 +459,7 @@ static krb5_error_code process_option_ca_crl(krb5_context context, pkinit_plg_crypto_context plg_cryptoctx, pkinit_req_crypto_context req_cryptoctx, - pkinit_identity_opts *idopts, + pkinit_identity_opts *idopts, pkinit_identity_crypto_context id_cryptoctx, const char *value, int catype) @@ -558,7 +558,7 @@ pkinit_identity_initialize(krb5_context context, goto errout; } } - + retval = crypto_free_cert_info(context, plg_cryptoctx, req_cryptoctx, id_cryptoctx); if (retval) @@ -595,4 +595,3 @@ pkinit_identity_initialize(krb5_context context, errout: return retval; } - diff --git a/src/plugins/preauth/pkinit/pkinit_matching.c b/src/plugins/preauth/pkinit/pkinit_matching.c index 778ae38c96..806fcbb87c 100644 --- a/src/plugins/preauth/pkinit/pkinit_matching.c +++ b/src/plugins/preauth/pkinit/pkinit_matching.c @@ -135,10 +135,10 @@ typedef struct _rule_component { kw_value_type kwval_type; regex_t regexp; /* Compiled regular expression */ char *regsrc; /* The regular expression source (for debugging) */ - unsigned int ku_bits; + unsigned int ku_bits; unsigned int eku_bits; } rule_component; - + /* Set rule components */ typedef struct _rule_set { relation_type relation; @@ -180,7 +180,7 @@ free_rule_set(krb5_context context, static krb5_error_code parse_list_value(krb5_context context, - keyword_type type, + keyword_type type, char *value, rule_component *rc) { @@ -609,7 +609,7 @@ nextcert: pkiDebug("%s: After checking %d certs, we found %d matches\n", __FUNCTION__, certs_checked, total_cert_matches); if (total_cert_matches == 1) { - *match_found = 1; + *match_found = 1; *matching_cert = save_match; } @@ -764,7 +764,7 @@ pkinit_cert_matching(krb5_context context, if (retval) { if (retval == EINVAL) { pkiDebug("%s: Ignoring invalid rule pkinit_cert_match = '%s'\n", - __FUNCTION__, rules[x]); + __FUNCTION__, rules[x]); continue; } goto cleanup; diff --git a/src/plugins/preauth/pkinit/pkinit_srv.c b/src/plugins/preauth/pkinit/pkinit_srv.c index 1de10da1f0..8b74472142 100644 --- a/src/plugins/preauth/pkinit/pkinit_srv.c +++ b/src/plugins/preauth/pkinit/pkinit_srv.c @@ -118,7 +118,7 @@ pkinit_server_get_edata(krb5_context context, /* * If we don't have a realm context for the given realm, - * don't tell the client that we support pkinit! + * don't tell the client that we support pkinit! */ plgctx = pkinit_find_realm_context(context, pa_plugin_context, request->server); @@ -142,7 +142,7 @@ verify_client_san(krb5_context context, #ifdef DEBUG_SAN_INFO char *client_string = NULL, *san_string; #endif - + retval = crypto_retrieve_cert_sans(context, plgctx->cryptoctx, reqctx->cryptoctx, plgctx->idctx, &princs, @@ -295,7 +295,7 @@ pkinit_server_verify_padata(krb5_context context, krb5_data **e_data, krb5_authdata ***authz_data) { - krb5_error_code retval = 0; + krb5_error_code retval = 0; krb5_octet_data authp_data = {0, 0, NULL}, krb5_authz = {0, 0, NULL}; krb5_data *encoded_pkinit_authz_data = NULL; krb5_pa_pk_as_req *reqp = NULL; @@ -363,7 +363,7 @@ pkinit_server_verify_padata(krb5_context context, reqctx->cryptoctx, plgctx->idctx, CMS_SIGN_CLIENT, plgctx->opts->require_crl_checking, reqp->signedAuthPack.data, reqp->signedAuthPack.length, - &authp_data.data, &authp_data.length, &krb5_authz.data, + &authp_data.data, &authp_data.length, &krb5_authz.data, &krb5_authz.length); break; case KRB5_PADATA_PK_AS_REP_OLD: @@ -385,7 +385,7 @@ pkinit_server_verify_padata(krb5_context context, reqctx->cryptoctx, plgctx->idctx, CMS_SIGN_DRAFT9, plgctx->opts->require_crl_checking, reqp9->signedAuthPack.data, reqp9->signedAuthPack.length, - &authp_data.data, &authp_data.length, &krb5_authz.data, + &authp_data.data, &authp_data.length, &krb5_authz.data, &krb5_authz.length); break; default: @@ -433,7 +433,7 @@ pkinit_server_verify_padata(krb5_context context, } /* check dh parameters */ - if (auth_pack->clientPublicValue != NULL) { + if (auth_pack->clientPublicValue != NULL) { retval = server_check_dh(context, plgctx->cryptoctx, reqctx->cryptoctx, plgctx->idctx, &auth_pack->clientPublicValue->algorithm.parameters, @@ -450,12 +450,12 @@ pkinit_server_verify_padata(krb5_context context, * came from the client. Therefore, we use the original * packet contents. */ - retval = k5int_decode_krb5_as_req(req_pkt, &tmp_as_req); + retval = k5int_decode_krb5_as_req(req_pkt, &tmp_as_req); if (retval) { pkiDebug("decode_krb5_as_req returned %d\n", (int)retval); goto cleanup; } - + retval = k5int_encode_krb5_kdc_req_body(tmp_as_req, &der_req); if (retval) { pkiDebug("encode_krb5_kdc_req_body returned %d\n", (int) retval); @@ -514,7 +514,7 @@ pkinit_server_verify_padata(krb5_context context, pkiDebug("failed to decode krb5_auth_pack_draft9\n"); goto cleanup; } - if (auth_pack9->clientPublicValue != NULL) { + if (auth_pack9->clientPublicValue != NULL) { retval = server_check_dh(context, plgctx->cryptoctx, reqctx->cryptoctx, plgctx->idctx, &auth_pack9->clientPublicValue->algorithm.parameters, @@ -567,7 +567,7 @@ pkinit_server_verify_padata(krb5_context context, */ pkinit_authz_data->contents = krb5_authz.data; pkinit_authz_data->length = krb5_authz.length; - retval = k5int_encode_krb5_authdata_elt(pkinit_authz_data, + retval = k5int_encode_krb5_authdata_elt(pkinit_authz_data, &encoded_pkinit_authz_data); #ifdef DEBUG_ASN1 print_buffer_bin((unsigned char *)encoded_pkinit_authz_data->data, @@ -586,12 +586,12 @@ pkinit_server_verify_padata(krb5_context context, (krb5_octet *) encoded_pkinit_authz_data->data; my_authz_data[0]->length = encoded_pkinit_authz_data->length; *authz_data = my_authz_data; - pkiDebug("Returning %d bytes of authorization data\n", + pkiDebug("Returning %d bytes of authorization data\n", krb5_authz.length); encoded_pkinit_authz_data->data = NULL; /* Don't free during cleanup*/ free(encoded_pkinit_authz_data); break; - default: + default: *authz_data = NULL; } /* remember to set the PREAUTH flag in the reply */ @@ -619,7 +619,7 @@ pkinit_server_verify_padata(krb5_context context, free_krb5_pa_pk_as_req_draft9(&reqp9); } if (tmp_as_req != NULL) - k5int_krb5_free_kdc_req(context, tmp_as_req); + k5int_krb5_free_kdc_req(context, tmp_as_req); free(authp_data.data); free(krb5_authz.data); if (reqctx != NULL) @@ -684,7 +684,7 @@ pkinit_server_return_padata(krb5_context context, pkiDebug("missing request context \n"); return EINVAL; } - + plgctx = pkinit_find_realm_context(context, pa_plugin_context, request->server); if (plgctx == NULL) { @@ -762,14 +762,14 @@ pkinit_server_return_padata(krb5_context context, pkiDebug("received DH key delivery AS REQ\n"); retval = server_process_dh(context, plgctx->cryptoctx, reqctx->cryptoctx, plgctx->idctx, subjectPublicKey, - subjectPublicKey_len, &dh_pubkey, &dh_pubkey_len, + subjectPublicKey_len, &dh_pubkey, &dh_pubkey_len, &server_key, &server_key_len); if (retval) { pkiDebug("failed to process/create dh paramters\n"); goto cleanup; } } - + if ((rep9 != NULL && rep9->choice == choice_pa_pk_as_rep_draft9_dhSignedData) || (rep != NULL && rep->choice == choice_pa_pk_as_rep_dhInfo)) { @@ -846,7 +846,7 @@ pkinit_server_return_padata(krb5_context context, pkiDebug("%s: return checksum instead of nonce = %d\n", __FUNCTION__, fixed_keypack); - /* if this is an RFC reply or draft9 client requested a checksum + /* if this is an RFC reply or draft9 client requested a checksum * in the reply instead of the nonce, create an RFC-style keypack */ if ((int)padata->pa_type == KRB5_PADATA_PK_AS_REQ || fixed_keypack) { @@ -873,7 +873,7 @@ pkinit_server_return_padata(krb5_context context, pkiDebug("calculating checksum on buf size = %d\n", req_pkt->length); print_buffer(req_pkt->data, req_pkt->length); pkiDebug("checksum size = %d\n", key_pack->asChecksum.length); - print_buffer(key_pack->asChecksum.contents, + print_buffer(key_pack->asChecksum.contents, key_pack->asChecksum.length); pkiDebug("encrypting key (%d)\n", encrypting_key->length); print_buffer(encrypting_key->contents, encrypting_key->length); @@ -894,7 +894,7 @@ pkinit_server_return_padata(krb5_context context, case KRB5_PADATA_PK_AS_REQ: rep->choice = choice_pa_pk_as_rep_encKeyPack; retval = cms_envelopeddata_create(context, plgctx->cryptoctx, - reqctx->cryptoctx, plgctx->idctx, padata->pa_type, 1, + reqctx->cryptoctx, plgctx->idctx, padata->pa_type, 1, (unsigned char *)encoded_key_pack->data, encoded_key_pack->length, &rep->u.encKeyPack.data, &rep->u.encKeyPack.length); @@ -902,7 +902,7 @@ pkinit_server_return_padata(krb5_context context, case KRB5_PADATA_PK_AS_REP_OLD: case KRB5_PADATA_PK_AS_REQ_OLD: /* if the request is from the broken draft9 client that - * expects back a nonce, create it now + * expects back a nonce, create it now */ if (!fixed_keypack) { init_krb5_reply_key_pack_draft9(&key_pack9); @@ -920,11 +920,11 @@ pkinit_server_return_padata(krb5_context context, pkiDebug("failed to encode reply_key_pack\n"); goto cleanup; } - } + } rep9->choice = choice_pa_pk_as_rep_draft9_encKeyPack; retval = cms_envelopeddata_create(context, plgctx->cryptoctx, - reqctx->cryptoctx, plgctx->idctx, padata->pa_type, 1, + reqctx->cryptoctx, plgctx->idctx, padata->pa_type, 1, (unsigned char *)encoded_key_pack->data, encoded_key_pack->length, &rep9->u.encKeyPack.data, &rep9->u.encKeyPack.length); |
