Commit Graph

75 Commits

Author SHA1 Message Date
Roland C. Dowdeswell
e8779d5d4a Add -Wshadow and deal with the warnings. 2012-02-21 11:17:55 +00:00
Roland C. Dowdeswell
cc47c8fa7b Turn on -Wextra -Wno-sign-compare -Wno-unused-paramter and fix issues.
We turn on a few extra warnings and fix the fallout that occurs
when building with --enable-developer.  Note that we get different
warnings on different machines and so this will be a work in
progress.  So far, we have built on NetBSD/amd64 5.99.64 (which
uses gcc 4.5.3) and Ubuntu 10.04.3 LTS (which uses gcc 4.4.3).

Notably, we fixed

	1.  a lot of missing structure initialisers,

	2.  unchecked return values for functions that glibc
	    marks as __attribute__((warn-unused-result)),

	3.  made minor modifications to slc and asn1_compile
	    which can generate code which generates warnings,
	    and

	4.  a few stragglers here and there.

We turned off the extended warnings for many programs in appl/ as
they are nearing the end of their useful lifetime, e.g.  rsh, rcp,
popper, ftp and telnet.

Interestingly, glibc's strncmp() macro needed to be worked around
whereas the function calls did not.

We have not yet tried this on 32 bit platforms, so there will be
a few more warnings when we do.
2012-02-20 19:45:41 +00:00
Love Hörnquist Åstrand
c293aaa031 fixup symlink 2012-02-15 08:15:17 -08:00
Love Hörnquist Åstrand
a74456372a fixup variable name 2012-02-15 08:08:40 -08:00
Roland C. Dowdeswell
61f9a5d0b3 Fix compiler warnings. 2012-02-14 23:56:18 +00:00
Nicolas Williams
f4ba41ebdd Pluggable libheimbase interface for DBs and misc libheimbase enhancements
[Code reviewed by Love Hörnquist Åstrand <lha@kth.se>]

    Added heim_db_*() entry points for dealing with databases, and
    make krb5_aname_to_localname() use it.

    The following enhancements to libheimbase are included:

     - Add heim_data_t and heim_string_t "reference" variants to
       avoid memory copies of potentially large data/strings.

       See heim_data_ref_create() and heim_string_ref_create().

     - Added enhancements to heim_array_t to allow their use for
       queues and stacks, and to improve performance.  See
       heim_array_insert_value().

     - Added XPath-like accessors for heim_object_t.  See
       heim_path_get(), heim_path_copy(), heim_path_create(), and
       heim_path_delete().  These are used extensively in the DB
       framework's generic composition of ACID support and in the
       test_base program

     - Made libheimbase more consistent with Core Foundation naming
       conventions.  See heim_{dict, array}_{get, copy}_value() and
       heim_path_{get, copy}().

     - Added functionality to and fixed bugs in base/json.c:
        - heim_serialize();
        - depth limit for JSON parsing (for DoS protection);
        - pretty-printing;
        - JSON compliance (see below);
        - flag options for parsing and serializing; these are needed
          because of impedance mismatches between heim_object_t and
          JSON (e.g., heim_dict_t allows non-string keys, but JSON
          does not; heimbase supports binary data, while JSON does
          not).

     - Added heim_error_enomem().

     - Enhanced the test_base program to test new functionality and
       to use heim_path*() to better test JSON encoding.  This
       includes some fuzz testing of JSON parsing, and running the
       test under valgrind.

     - Started to add doxygen documentation for libheimbase (but doc
       build for libheimbase is still incomplete).

    Note that there's still some incomplete JSON support:

     - JSON string quoting is not fully implemented;

     - libheimbase lacks support for real numbers, while JSON has
       it -- otherwise libheimbase is a superset of JSON,
       specifically in that any heim_object_t can be a key for an
       associative array.

    The following DB backends are supported natively:

     - "sorted-text", a binary search of sorted (in C locale), flat
       text files;

     - "json", a backend that stores DB contents serialized as JSON
       (this is intended for configuration-like contents).

    The DB framework supports:

     - multiple key/value tables per-DB
     - ACID transactions

    The DB framework also natively implements ACID transactions for
    any DB backends that a) do not provide transactions natively, b)
    do provide lock/unlock/sync methods (even on Windows).  This
    includes autocommit of DB updates outside transactions.

    Future DB enhancements may include:

     - add backends for various DB types (BDB, CDB, MDB, ...);

     - make libhdb use heim_db_t;

     - add a command-line tool for interfacing to databases via
       libheimbase (e.g., to get/set/delete values, create/copy/
       backup DBs, inspect history, check integrity);

     - framework-level transaction logging (with redo and undo
       logging), for generic incremental replication;

     - framework-level DB integrity checking.

       We could store a MAC of the XOR of a hash function applied to
       {key, value} for every entry in the DB, then use this to check
       DB integrity incrementally during incremental replication, as
       well as for the whole DB.
2012-02-05 16:26:32 -06:00
Nicolas Williams
6dd66df594 Make master build on Windows
Add strtoll()/strtoull() to lib/roken
    Add stdint.h to lib/roken (Windows only)
    Add logic to detect whether to use lib/roken's stdint.h based on
        Visual Studio version
    Add include of stdint.h in generated ASN.1 code
    Export missing symbols for 64-bit integers in lib/asn1
    Export missing symbols for FAST
    Add missing sources to kdc/NTMakefile
    Fix issue in kuserok
    Fix bsearch issues
2012-01-17 12:10:14 -06:00
Nicolas Williams
11763aecc7 There's no HEIM_BOOL_TRUE; use heim_bool_create(1) instead 2012-01-13 16:18:50 -06:00
Love Hornquist Astrand
b6f3ca6712 add heim_show, sort lines 2011-12-15 21:51:06 -08:00
Love Hornquist Astrand
b780dddb9b add show 2011-12-15 21:48:20 -08:00
Love Hornquist Astrand
d05e64b967 move function pointer to last argument 2011-12-15 21:48:09 -08:00
Love Hornquist Astrand
8deda7a299 add show, move function pointer to last argument 2011-12-15 21:47:56 -08:00
Nicolas Williams
659c761213 Add private text file binary search API to libheimbase 2011-12-02 01:02:44 -06:00
Love Hörnquist Åstrand
206b22c9f5 add data object 2011-11-29 23:40:28 -08:00
Nicolas Williams
c930853dd1 Export heim_bool_val from libheimbase 2011-11-24 00:00:50 -06:00
Nicolas Williams
121ab46bb6 Add missing symbols needed for make check in base 2011-11-22 11:49:26 -06:00
Nicolas Williams
1572b762b6 Fix missing symbols. 2011-11-22 00:32:52 -06:00
Love Hörnquist Åstrand
e037054e8d disable printer 2011-11-21 21:50:23 -08:00
Love Hörnquist Åstrand
354ef711f3 restructure 2011-11-21 20:34:35 -08:00
Love Hörnquist Åstrand
3b38640e4b quoted string tests 2011-11-21 20:34:35 -08:00
Love Hörnquist Åstrand
5a744a9ca6 add heim_string_create_with_bytes 2011-11-21 20:34:35 -08:00
Love Hörnquist Åstrand
6ace66345b use get and set 2011-11-21 20:34:35 -08:00
Love Hörnquist Åstrand
40b0d518af use get and set, add json 2011-11-21 20:34:35 -08:00
Love Hörnquist Åstrand
58ea7f5b0c use get and set 2011-11-21 20:34:35 -08:00
Love Hörnquist Åstrand
9bb4b5aec8 basic handing of quoted strings 2011-11-21 20:34:35 -08:00
Love Hörnquist Åstrand
6a6bb430e7 test test_base 2011-11-21 20:34:35 -08:00
Love Hörnquist Åstrand
a56e097ae4 include json 2011-11-21 20:34:35 -08:00
Love Hörnquist Åstrand
3d1dbbfbc0 test json 2011-11-21 20:34:35 -08:00
Love Hörnquist Åstrand
43ac50913b handle quotes 2011-11-21 20:34:35 -08:00
Love Hornquist Astrand
3c0e9b8fd1 dont use bool since its c99 2011-09-30 11:49:01 +02:00
Nicolas Williams
4ae39ce0b3 Added one more export to libheimbase -- needed by tests 2011-09-27 16:29:11 -05:00
Love Hornquist Astrand
e138bed4c7 export error functions 2011-09-26 09:29:14 +02:00
Jeffrey Altman
91a9a11b75 avoid use of vasnprintf in base/error.c
commit c94f299fc8 uses vasnprintf
which was previously removed from the libheimbase directory in
order to prevent a dependency on libroken.

Replace vasnprintf with snprintf and malloc to avoid the
dependency.

Change-Id: I029e7e6883406ca7311490a3dab4b65cad3ba70b
2011-09-26 01:53:25 -04:00
Love Hornquist Astrand
c94f299fc8 add heim_error_t 2011-09-25 19:03:23 +02:00
Love Hornquist Astrand
8fc7fa27d1 include <stdlib.h> 2011-09-25 16:44:49 +02:00
Love Hornquist Astrand
d92ade5be9 don't use errx() since that require libroken 2011-09-23 13:15:50 +02:00
Love Hornquist Astrand
977227fc29 update (c) 2011-09-09 11:17:08 +02:00
Love Hornquist Astrand
c63d6e516f use __sync_swap if we have it 2011-09-09 10:03:28 +02:00
Linus Nordberg
2e35198908 Add version-script.map to _DEPENDENCIES.
Added to 11 out of 14 directories with map files.  Not lib/ntlm,
lib/hcrypto and kdc which have the map file as an explicit dependency
to _OBBJECTS.

Signed-off-by: Love Hörnquist Åstrand <lha@h5l.org>
2011-07-24 14:07:59 -07:00
Love Hörnquist Åstrand
7aaba443bc add NTMakefile and windows directories 2011-07-17 12:16:59 -07:00
Love Hörnquist Åstrand
4a6fa9a979 distribute version-script.map 2011-06-14 07:18:32 -07:00
Love Hörnquist Åstrand
27f3d822cf Maybe include <sys/types.h> and <sys/select.h> 2011-05-22 17:14:29 -07:00
Love Hornquist Astrand
0879b9831a remove trailing whitespace 2011-05-21 11:57:31 -07:00
Love Hornquist Astrand
7da5085f07 introduce heim_builtin_expect 2011-05-18 21:23:47 -07:00
Love Hornquist Astrand
f5f9014c90 Warning fixes from Christos Zoulas
- shadowed variables
- signed/unsigned confusion
- const lossage
- incomplete structure initializations
- unused code
2011-04-29 20:25:05 -07:00
Jelmer Vernooij
0c7e233195 base: Make heim_cmp global, as it is used by test_base.
"make checK" breaks without this symbol.

Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2010-12-19 22:49:41 -08:00
Love Hornquist Astrand
b2bca91672 no more tagged strings 2010-12-12 12:47:43 -08:00
Love Hornquist Astrand
25a79a1ba8 remove tag string 2010-12-12 12:29:09 -08:00
Love Hornquist Astrand
d69fcab43f use vsnprintf so that we dont need roken 2010-11-27 23:21:39 -08:00
Love Hornquist Astrand
7ae0574ac4 use _P in globrules ? 2010-11-27 18:56:46 -08:00