summaryrefslogtreecommitdiff
path: root/dbus/dbus-marshal-validate.h
Commit message (Collapse)AuthorAgeFilesLines
* Add DBUS_PRIVATE_EXPORT decoration to symbols used by dbus-daemon or testsSimon McVittie2015-02-201-0/+9
| | | | | | | | | | | | | | | | | | The rules are: * symbols in libdbus-1 with neither decoration are private to libdbus-1 * symbols in libdbus-1 with DBUS_EXPORT are public API * symbols in libdbus-1 with DBUS_PRIVATE_EXPORT are private to the dbus source package, but may be used by other programs in the dbus source tree, including tests * symbols in libdbus-internal must not have DBUS_EXPORT or DBUS_PRIVATE_EXPORT, and should be used by as few things as possible Thanks to Ralf Habacker for his contributions to this rather large commit. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=83115 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
* Merge remote-tracking branch 'wjt/arg0namespace' into arg0namespace-24317Simon McVittie2011-04-071-0/+3
|\
| * Validate arg0namespace matches' values.Will Thompson2010-11-231-0/+3
| | | | | | | | | | I could be convinced that this is overkill, but it seems sensible to forbid obviously-broken arg0namespace matches.
* | dbus_message_iter_append_basic: check string-like arguments for validitySimon McVittie2011-03-041-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Strings: UTF-8 with no embedded NULs, by adding a new internal function, _dbus_check_is_valid_utf8 Object paths, signatures: the obvious syntactic checks This moves some of the burden of validation to the sender. When sending <http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-demo.txt> 10240 times with up to 1024 parallel calls pending, on a single-core ARM Linux device, I found that user CPU time in dbus-spam increased by up to 80% as a result of the validation. However, when sending messages to dbus-daemon, overall throughput only reduced by 15%, and when sending messages to an echo service, overall throughput actually improved by around 14% (presumably because making the sender CPU-bound influenced kernel scheduling). Bug: https://bugs.freedesktop.org/show_bug.cgi?id=16338 Bug-NB: NB#223152 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
* | CVE 2010-4352: Reject deeply nested variantsHavoc Pennington2010-12-201-0/+1
|/ | | | | | | | | | | | | | | | | | Add DBUS_INVALID_NESTED_TOO_DEEPLY validity problem and a test that should generate it. Previously, we rejected deep nesting in the signature, but variants allow dynamic message nesting, conditional only on the depth of the message body. The nesting limit is 64, which was also the limit in static signatures. Empirically, dynamic nesting depth observed on my Fedora 14 system doesn't exceed 2; 64 is really a huge limit. https://bugs.freedesktop.org/show_bug.cgi?id=32321 Signed-Off-By: Colin Walters <walters@verbum.org> Signed-off-by: Will Thompson <will.thompson@collabora.co.uk>
* Consistently include <config.h> in all C source files and never in header files.Marcus Brinkmann2010-03-191-2/+0
|
* Merge branch 'fd-passing'Thiago Macieira2009-07-161-4/+1
|\ | | | | | | | | | | | | Conflicts: dbus/dbus-connection.c dbus/dbus-message-util.c dbus/dbus-sysdeps-unix.c
| * unix-fd: add message encoding/decoding for unix fdsLennart Poettering2009-05-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When appending unix fds to the message a new entry in the fd array will be allocated and the index to it will be written to the message payload. When parsing unix fds from the message the index will be read from the payload and then looked up in the fd array. When we read fds we put them in a queue first. Since each message knows how many fds are attached to it we will then pop enough fds from this queue each time we decode a message from the stream. This should make sending and receiving more portable since we don't make any strong requirements on the exact semantics of the SCM_RIGHTS implementation: as long as fds are recieved in order, none or lost and the arrive at the same time as at least one byte from the actual message dat we should be able to handle them correctly.
| * build-system: get rid of config.h inclusion checksLennart Poettering2009-05-151-4/+0
| | | | | | | | | | | | | | | | | | These header files include config.h explicitly anyway. These checks are hence pointless. Of course one could argue that including config.h from header files sucks, but D-Bus generally seems not to have a problem with that, so let's unify this.
* | Bug 21161 - Update the FSF addressTobias Mueller2009-07-101-1/+1
|/ | | | | | No comment. Signed-off-by: Colin Walters <walters@verbum.org>
* bfo20738 - Translate DBusValidity into error messageFederico Mena Quintero2009-04-211-0/+2
| | | | Signed-off-by: Federico Mena Quintero <federico@novell.com>
* 2007-07-13 Havoc Pennington <hp@redhat.com>Havoc Pennington2007-07-141-1/+1
| | | | * Add indent-tabs-mode: nil to all file headers.
* 2006-10-21 Havoc Pennington <hp@redhat.com>Havoc Pennington2006-10-211-0/+6
| | | | | * Documentation! Whee! Doxygen now 100% silent. If you make it angry again, you will be punished.
* 2006-10-21 Havoc Pennington <hp@redhat.com>Havoc Pennington2006-10-211-1/+1
| | | | * Document a bunch of undocumented stuff
* 2006-10-21 Havoc Pennington <hp@redhat.com>Havoc Pennington2006-10-211-3/+11
| | | | | | | * Clean up Doxygen group markers for public API so Doxygen finds everything (not comprehensively fixed for private API). Means all remaining Doxygen warnings are just about missing docs and thus pretty simple to resolve.
* * dbus/dbus-marshal-validate.h: Added a new validationJohn (J5) Palmieri2005-06-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | | error code DBUS_VALIDITY_UNKNOWN_OOM_ERROR = -4 for out of memory errors when validating signitures * dbus/dbus-marshal-header.c: use DBUS_VALIDITY_UNKNOWN_OOM_ERROR in places where we previously used DBUS_VALID and a FALSE return value to indicate OOM * dbus/dbus-marshal-validate.c (_dbus_validate_signature_with_reason): Use a stack to track the number of elements inside containers. The stack values are then used to validate that dict entries have only two elements within them. (validate_body_helper): check the reason for failure when validating varients * dbus/dbus-message.c (load_message): use DBUS_VALIDITY_UNKNOWN_OOM_ERROR in places where we previously used DBUS_VALID and a FALSE return value to indicate OOM * doc/TODO: remove "- validate dict entry number of fields" as this patch fixes it
* 2005-02-10 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-02-111-0/+1
| | | | | | | | | | | | | | * dbus/dbus-message-factory.c (generate_special): modify test to avoid using a non-basic dict key * dbus/dbus-marshal-validate-util.c: add test for the below * doc/dbus-specification.xml: require that dict keys are a basic type * dbus/dbus-marshal-validate.c (_dbus_validate_signature_with_reason): require that dict key is a basic type
* 2005-02-06 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-02-061-22/+23
| | | | | | | * dbus/dbus-message-factory.c (generate_special): more tests * dbus/dbus-marshal-validate.c (validate_body_helper): detect array length that exceeds the maximum
* 2005-02-05 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-02-061-17/+18
| | | | | | | | | | | | | | | | | * dbus/dbus-message-factory.c (generate_special): more test cases, increasing coverage * dbus/dbus-marshal-validate.c (validate_body_helper): return the reason why a signature was invalid * dbus/dbus-marshal-header.c (load_and_validate_field): fix to skip the length of the string before we look at it in validation * dbus/dbus-string-util.c (_dbus_string_test): add tests for equal_substring * dbus/dbus-message.c (_dbus_message_loader_new): default max_message_length to DBUS_MAXIMUM_MESSAGE_LENGTH
* 2005-01-28 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-281-1/+8
| | | | | | | | | | | | | * doc/dbus-specification.xml: update to describe 16-bit types and dict entries * dbus/dbus-marshal-basic.c (_dbus_unpack_uint16): fix broken assertion * dbus/dbus-protocol.h (DBUS_TYPE_DICT_ENTRY): add DICT_ENTRY as a type * dbus/dbus-marshal-recursive.c: implement
* 2005-01-27 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-271-1/+0
| | | | | | | | | | * dbus/dbus-message.c: byteswap the message if you init an iterator to read/write from it * dbus/dbus-marshal-byteswap.c: new file implementing _dbus_marshal_byteswap() * dbus/dbus-marshal-basic.c: add _dbus_swap_array()
* 2005-01-23 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-231-1/+4
| | | | | * dbus/dbus-message-factory.c, dbus/dbus-message-util.c: get this all working, not many tests in the framework yet though
* 2005-01-21 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-211-0/+9
| | | | | | | | | | | * dbus/dbus-bus.c: add more return_if_fail checks * dbus/dbus-message.c (load_message): have the "no validation" mode (have to edit the code to toggle the mode for now though) * dbus/dbus-marshal-header.c (_dbus_header_load): have a mode that skips all validation; I want to use this at least for benchmark baseline, I'm not sure if it should be a publicly-available switch.
* 2005-01-18 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-181-2/+2
| | | | | | | | | | | | * Throughout, grand renaming to strip out the use of "service", just say "name" instead (or "bus name" when ambiguous). Did not change the internal code of the message bus itself, only the programmer-facing API and messages. * doc/dbus-specification.xml: further update the message bus section * bus/config-parser.c (all_are_equiv): fix bug using freed string in error case
* 2005-01-16 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-161-1/+3
| | | | | | | | | | | | | | | | | * Add and fix docs according to Doxygen warnings throughout source. * dbus/dbus-marshal-recursive.c (_dbus_type_reader_array_is_empty): change this to just call array_reader_get_array_len() and make it static * dbus/dbus-message.c (dbus_message_iter_get_element_type): rename from get_array_type (dbus_message_iter_init_append): rename from append_iter_init * dbus/dbus-marshal-recursive.c (_dbus_type_reader_get_element_type): rename from _dbus_type_reader_get_array_type
* 2005-01-15 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-151-0/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Land the new message args API and type system. This patch is huge, but the public API change is not really large. The set of D-BUS types has changed somewhat, and the arg "getters" are more geared toward language bindings; they don't make a copy, etc. There are also some known issues. See these emails for details on this huge patch: http://lists.freedesktop.org/archives/dbus/2004-December/001836.html http://lists.freedesktop.org/archives/dbus/2005-January/001922.html * dbus/dbus-marshal-*: all the new stuff * dbus/dbus-message.c: basically rewritten * dbus/dbus-memory.c (check_guards): with "guards" enabled, init freed blocks to be all non-nul bytes so using freed memory is less likely to work right * dbus/dbus-internals.c (_dbus_test_oom_handling): add DBUS_FAIL_MALLOC=N environment variable, so you can do DBUS_FAIL_MALLOC=0 to skip the out-of-memory checking, or DBUS_FAIL_MALLOC=10 to make it really, really, really slow and thorough. * qt/message.cpp: port to the new message args API (operator<<): use str.utf8() rather than str.unicode() (pretty sure this is right from the Qt docs?) * glib/dbus-gvalue.c: port to the new message args API * bus/dispatch.c, bus/driver.c: port to the new message args API * dbus/dbus-string.c (_dbus_string_init_const_len): initialize the "locked" flag to TRUE and align_offset to 0; I guess we never looked at these anyhow, but seems cleaner. * dbus/dbus-string.h (_DBUS_STRING_ALLOCATION_PADDING): move allocation padding macro to this header; use it to implement (_DBUS_STRING_STATIC): ability to declare a static string. * dbus/dbus-message.c (_dbus_message_has_type_interface_member): change to return TRUE if the interface is not set. * dbus/dbus-string.[hc]: move the D-BUS specific validation stuff to dbus-marshal-validate.[hc] * dbus/dbus-marshal-basic.c (_dbus_type_to_string): move here from dbus-internals.c * dbus/Makefile.am: cut over from dbus-marshal.[hc] to dbus-marshal-*.[hc] * dbus/dbus-object-tree.c (_dbus_decompose_path): move this function here from dbus-marshal.c
* add a file to hold the validation routinesHavoc Pennington2005-01-031-0/+35