Commit Graph

19 Commits

Author SHA1 Message Date
Matthias Clasen
ed08538f92 Merge pull request #900 from pwithnall/lan-and-usb-preparation
LAN/USB preparation refactoring
2017-07-08 20:54:28 -04:00
Philip Withnall
81301f0ef4 general: Remove trailing \n from GLib log messages
The GLib logging framework automatically appends a \n to messages, so it
doesn’t need to be added by callers.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-07-07 17:18:24 +01:00
Philip Withnall
548f60ebc0 general: Add missing static modifier to various local methods
The compiler warning flag which was supposed to warn about this was not
being included in the CFLAGS for these targets. That will be fixed in an
upcoming commit.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-07-06 14:41:21 +01:00
Simon McVittie
501399a808 dbus-proxy: Don't clear dbus_address twice
It's sufficient to g_free it, which we do further down finalize().
This is not a double-free, because we used g_clear_pointer(),
but it's redundant.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-06-30 21:17:38 +02:00
Simon McVittie
c02920f28c dbus-proxy: Make miscellaneous globals static
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-06-30 21:17:38 +02:00
Alexander Larsson
bd22ff8d42 dbus-portal: Fix return value type of filtered NameHasOwner
Fixes https://github.com/flatpak/flatpak/issues/817
2017-05-31 08:58:08 +02:00
Matthias Clasen
f15d1b78ec Remove an unused autoptr definition
This makes clang complain about an unused function.
2017-05-11 08:38:32 +02:00
Alexander Larsson
6a63a905bf dbus-proxy: Fix leak in setup phase
Sometimes we get an EAGAIN error in the due to the socket being
nonblocking. In the setup phase we just allocated the new buffer
and this causes a leak. Free it in this case.
2017-03-31 13:06:44 +02:00
Alexander Larsson
a87c15da87 dbus-proxy: Fix leak of get_arg0_string return value
In one place this was not freed. This converts both current
callers to g_autofree to make it consistent.
2017-03-31 13:06:44 +02:00
Alexander Larsson
0c05d48aca dbus: proxy fix leak in get_arg0_string
g_variant_get_child_value returns a new reference, so we have to free
it.
2017-03-31 13:06:44 +02:00
Alexander Larsson
18a45712cc dbus-proxy: Fix use-after free in header parsing
The header returned from parse_header contains references
to the buffer it was used to parse from, and in some
cases we dereference these headers after freeing the buffer.
For instance this happens when we're filtering a message, and
then we later look at the destination to figure out what
kind of error to send back.

I couldn't find any cases where this would let the client
do anything other than return a different error value, but
this is still possibly a security issue.
2017-03-31 13:06:44 +02:00
Alexander Larsson
557f9231a2 dbus-proxy: Make Buffer refcounted
This will be needed to fix some user-after-free issues.
2017-03-31 13:06:44 +02:00
Alexander Larsson
b337c95d78 dbus proxy: Tight down what is allowed to send to the bus
Make sure we can only send message calls (not e.g. unicast signals)
to the bus. Also, whitelist the list of allowed interfaces to
org.freedesktop.DBus and org.freedesktop.DBus.Introspectable

See https://github.com/flatpak/flatpak/issues/343 for the origin
discussion of this.
2016-10-17 12:19:46 +02:00
Alexander Larsson
f17390b70c Remove duplicate code 2016-10-06 12:31:54 +02:00
Christian Hergert
227da7359c dbus-proxy: alignment bit-twiddling to remove multiple and divide
Common bit-twiddling to remove the multiply and divide for realignment.
2016-09-08 14:50:15 -07:00
Matthias Clasen
75218c4a65 Fix license headers
We were referring to the nonexisting "version 2" of the
Lesser GPL. It should be "version 2.1".
2016-07-29 14:27:49 -04:00
Josh Soref
c874ea7130 spelling: incoming 2016-05-27 06:44:02 +00:00
Josh Soref
147bf4fdf0 spelling: description 2016-05-27 06:39:37 +00:00
Alexander Larsson
c24528d369 Rename source files to flatpak 2016-05-09 09:00:20 +02:00