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/kdb/db2 | |
| parent | 162ab371748cba0cc6f172419bd6e71fa04bb878 (diff) | |
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/kdb/db2')
35 files changed, 187 insertions, 195 deletions
diff --git a/src/plugins/kdb/db2/adb_openclose.c b/src/plugins/kdb/db2/adb_openclose.c index 453c73b02..58c49328c 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 04cc48970..d585c0852 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 2e1f3b519..356f6dfca 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 b987039d1..363a1f3d1 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 cef7b648a..9f3cbc5c9 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 9d73966b4..69c5522ac 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 f00131a00..38dc658fd 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 d002a66ed..02ae2e9be 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 0f848d8ad..069b2dfde 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 bbfb9c6c6..6124f968b 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 c1a66088a..2343d223c 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 b202fc9f2..32793ca5b 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 06210a57c..6874f4703 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 e25115d3f..f27e7dd86 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 8ef8a2e29..989f967c5 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 40d32ccb6..65612ce6f 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 ad86d0af9..dca0b0067 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 3b0be3f55..acdc1b827 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 e7fa75882..bd710df84 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 a328f1be0..15042627d 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 1edaa998e..8af1378c3 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 f77b676f1..cfd1a4211 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 06f02b3ad..0d78d5934 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 b0aee708d..df92cd79e 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 34397ecaa..02982b162 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 f11487b32..6767de5e9 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 826611486..32d8250fc 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 b15b617bc..830d7a185 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 d2d36862d..bee41961e 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 81c559ad2..c8070c503 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 adb72c004..43895a429 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 da3767687..7d03e609c 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 1e6602dcc..e6c4b65e0 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 31856fbd2..315d0d1c5 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 d841d7376..54af70cd6 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 /* |
