Commit Graph

20335 Commits

Author SHA1 Message Date
Michael Catanzaro
f5631ecb94 gdbus: improve an error message
Namespace is one word.
2019-06-17 12:08:06 -05:00
Michael Catanzaro
99b580a0b2 gdbus: Stop server on dispose
This is not going to have much any effect currently since stop() just
disconnects a signal handler (that is going to be disconnected in
finalize anyway) and stops the socket service (that is going to be
destroyed in finalize), but it makes sense to do here for robustness.
2019-06-17 12:08:06 -05:00
Michael Catanzaro
fc597fa5f9 gdbus: support unix:dir= addresses
unix:dir= addresses are exactly the same as unix:tmpdir= addresses,
already supported by GDBus, except they forbid use of abstract sockets.
This is convenient for situations where abstract sockets are
impermissible, such as when a D-Bus client inside a network namespace
needs to connect to a server running in a different network namespace.
An abstract socket cannot be shared between two processes in different
network namespaces.

Applications could use unix:path= addresses instead, so this is only a
convenience, but there's no good reason not to support unix:dir=.
Currently it is not supported simply because unix:dir= is a relatively
recent addition to the D-Bus spec.
2019-06-17 12:07:10 -05:00
Emmanuele Bassi
d2450c8124 Merge branch 'contributing-irc' into 'master'
docs: Fix name of IRC channel in CONTRIBUTING.md

See merge request GNOME/glib!917
2019-06-13 11:49:40 +00:00
Philip Withnall
88f2010f1a docs: Fix name of IRC channel in CONTRIBUTING.md
It’s been renamed from `#gtk+` to `#gtk`.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-06-13 12:24:09 +01:00
Simon McVittie
5ca6ea0937 Merge branch 'fix-scan-build' into 'master'
ci: Run scan-build in a different build directory

See merge request GNOME/glib!914
2019-06-13 10:03:12 +00:00
Philip Withnall
e8a4f34952 Merge branch 'gvariant_text_typo_arrays' into 'master'
docs: fix typo on arrays examples in gvariant-text

See merge request GNOME/glib!915
2019-06-12 16:19:32 +00:00
Simental Magana, Marcos
51e7ce2c20 docs: fix typo on arrays examples in gvariant-text
example lists [(1, 2), (3, 4.0)], but mentions numbers
1 and 4 being parsed as integrers, this seems wrong as
4.0 its explicitly parsed as double.

Signed-off-by: Simental Magana, Marcos <marcos.simental.magana@intel.com>
2019-06-12 10:56:07 -05:00
Philip Withnall
82906e5d5d ci: Run scan-build in a different build directory
The build artifacts from earlier jobs in the pipeline all use the
`_build` directory. When they are copied in to the scan-build job, they
are probably marked as read-only. This means that the `meson scan-build`
run can’t write to `_build/meson-logs/meson-log.txt` and fails.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-06-12 14:31:42 +01:00
Emmanuele Bassi
94a56ae4f5 Merge branch '1807-dbus-server-docs' into 'master'
gdbusserver: Drop reference to non-existing function from documentation

Closes #1807

See merge request GNOME/glib!913
2019-06-12 12:05:56 +00:00
Philip Withnall
b1fbb36ba3 Merge branch 'prop-action-state-hints' into 'master'
property action: Add state hints

See merge request GNOME/glib!906
2019-06-12 11:59:58 +00:00
Philip Withnall
6e25d936fa gdbusserver: Drop reference to non-existing function from documentation
Spotted by Michael Catanzaro.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Fixes: #1807
2019-06-12 12:48:49 +01:00
Sebastian Dröge
c11f5321dd Merge branch 'ci-scan-build' into 'master'
ci: Add scan-build job in a new ‘analysis’ pipeline stage

See merge request GNOME/glib!563
2019-06-11 11:59:46 +00:00
Sebastian Dröge
03ce878736 Merge branch '1729-mime-result-prio' into 'master'
Resolve "g_content_type_guess segfaults when passed an empty data buffer on Mac OS"

Closes #1729

See merge request GNOME/glib!733
2019-06-11 11:38:33 +00:00
Philip Withnall
9740b58814 Merge branch '77-wrap-on-linux' into 'master'
glib: Rename G_STDIO_NO_WRAP_ON_UNIX → G_STDIO_WRAP_ON_UNIX

Closes #77

See merge request GNOME/glib!830
2019-06-11 11:37:35 +00:00
Sebastian Dröge
f78194e8d0 Merge branch 'settings-list-order' into 'master'
gsettings: Document that lists are returned in no defined order

See merge request GNOME/glib!851
2019-06-11 11:35:58 +00:00
Sebastian Dröge
e85f1ced5f Merge branch 'compile-schemas-strings' into 'master'
glib-compile-schemas: Improve translatable strings

See merge request GNOME/glib!678
2019-06-11 11:34:05 +00:00
Sebastian Dröge
65c80701ca Merge branch '1438-deprecate-gtime' into 'master'
gdate: Officially mark GTime as deprecated

See merge request GNOME/glib!817
2019-06-11 11:29:35 +00:00
Sebastian Dröge
db27933236 Merge branch 'docs-typo-fix' into 'master'
gobject: Fix apostrophe usage in a few small bits of documentation

See merge request GNOME/glib!853
2019-06-11 11:21:52 +00:00
Sebastian Dröge
5fb5641de2 Merge branch 'post-release-version-bump' into 'master'
Post-release version bump

See merge request GNOME/glib!867
2019-06-11 11:20:29 +00:00
Sebastian Dröge
943de74113 Merge branch 'source-destroy-docs' into 'master'
gmain: Clarify that g_source_destroy() doesn’t drop a reference

See merge request GNOME/glib!901
2019-06-11 11:16:44 +00:00
Philip Withnall
155d4c66c7 Merge branch 'dbus-security-master' into 'master'
D-Bus auth mechanism improvements

See merge request GNOME/glib!909
2019-06-11 10:30:45 +00:00
Simon McVittie
11233f572d gdbusdaemon: Only authorize anonymous users on Windows, not Unix
On Unix, we expect EXTERNAL authentication to work.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-06-11 11:06:36 +01:00
Simon McVittie
a5923d4e49 gdbus-example-peer: Provide an example GDBusAuthObserver
It's somewhat unrealistic to use a GDBusServer without a
GDBusAuthObserver, because most D-Bus servers want to be like the
standard session bus (the owning user can connect) rather than being
like the standard system bus (all users can connect, the server is a
security boundary, and many bugs are security vulnerabilities).

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-06-11 11:06:36 +01:00
Simon McVittie
281a03d603 GDBusAuthObserver: Document how to restrict authentication to EXTERNAL
This is simpler and more robust than DBUS_COOKIE_SHA1, which relies
on assumptions about random numbers and a secure home directory.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-06-11 11:06:36 +01:00
Simon McVittie
1da3280b9e GDBusAuthObserver: Fix mixup between authentication and authorization
Authentication is about proving who I am; authorization is about
whether, given the knowledge of who I am, I am allowed to do something.
GDBusServer and GDBusConnection carry out authentication automatically,
but rely on the library user to carry out authorization.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-06-11 11:06:35 +01:00
Simon McVittie
f5a01e0e4a GDBusServer: Document that a GDBusAuthObserver is usually desirable
Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-06-11 11:06:35 +01:00
Simon McVittie
5e24d7cd14 Document where we expect credentials-passing to be supported
This is useful information for implementors of portable software to know
whether they can rely on credentials-passing.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-06-11 11:06:35 +01:00
Emmanuele Bassi
686bf2a665 Merge branch '1793-genmarshal-variant' into 'master'
Add glib-genmarshal tests and fix some valist marshaller bugs

Closes #1792 and #1793

See merge request GNOME/glib!904
2019-06-10 17:32:24 +00:00
Emmanuele Bassi
3b5535c5bb Merge branch '1634-testfilemonitor-race' into 'master'
Improve testfilemonitor test repeatability and debuggability

See merge request GNOME/glib!908
2019-06-10 17:04:57 +00:00
Philip Withnall
f6736a2589 tests: Use a temporary directory for testfilemonitor
Previously, its tests were being run in the build directory, which is
fine (it should always be writable). If multiple tests were run in
parallel, for example with Meson’s `--repeat` option, their test files
would collide.

Fix that by running each test instance in a separate subdirectory of
`/tmp`.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #1634
2019-06-10 15:19:34 +01:00
Philip Withnall
f124349fa1 tests: Improve debug output on testfilemonitor failure
Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #1634
2019-06-10 14:58:45 +01:00
Matthias Clasen
459c4f296a property action: Add state hints
We have this information in the param specs,
we might as well pass it on to give consumers
a chance to present meaningful UIs for these
actions.
2019-06-10 00:03:25 +00:00
Philip Withnall
1e10d6b6dd glib-genmarshal: Avoid a string copy for static string valist arguments
When building a valist marshaller, we can avoid a string copy if the
argument is known to always be static. The marshaller we ship in
`gmarshal.c` got this right, but marshallers generated by
glib-genmarshal were missing the optimisation. Fix that, and add a unit
test.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Fixes: #1792
2019-06-08 00:31:03 +01:00
Philip Withnall
f044ddc1ee glib-genmarshal: Fix ref-sinking of GVariants in valist marshallers
The old (Perl) implementation of glib-genmarshal used
g_variant_ref_sink() to correctly handle floating inputs; the Python
version should do the same.

Includes a unit test.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Fixes: #1793
2019-06-08 00:30:59 +01:00
Philip Withnall
e34839f8f4 tests: Add basic test for glib-genmarshal
This is a basic test suite for the `glib-genmarshal` utility, lifted
mostly directly from the tests for `glib-mkenums`.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-06-08 00:11:13 +01:00
Philip Withnall
e3171ee08c build: Add installed-tests support for mkenums.py
This makes the Meson build code for it a little more generic, and adds
support for installed tests.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-06-08 00:11:13 +01:00
Philip Withnall
3f02660ea5 tests: Fix hard-coded install path in glib-mkenums test
While this was useful for local testing while developing the test, it’s
not widely applicable. Look the binary up in the current `${PATH}` if
it’s not specified using `G_TEST_BUILDDIR`.

This is needed to get the `mkenums.py` test working as an
installed-test.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-06-08 00:11:13 +01:00
Philip Withnall
71973c722a gmain: Clarify that g_source_destroy() doesn’t drop a reference
This always confuses people.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-06-07 11:26:47 +01:00
Philip Withnall
4e00fdea9b Merge branch 'filio' into 'master'
Include <sys/filio.h> for FIONREAD

See merge request GNOME/glib!889
2019-06-05 11:24:56 +00:00
Philip Withnall
973406ab58 Merge branch 'dboles/atomit' into 'master'
garcbox.c: Fix typo atomit => atomic

See merge request GNOME/glib!884
2019-06-04 19:50:41 +00:00
Philip Withnall
032d275e21 Merge branch 'wip/desrt/happier-eyeballs' into 'master'
gnetworkaddress: fix "happy eyeballs" logic

See merge request GNOME/glib!865
2019-06-04 19:45:48 +00:00
Philip Withnall
2ac3cf8222 Merge branch 'issue-737' into 'master'
Allow calling get_property() with an uninitialized GValue

Closes #737

See merge request GNOME/glib!892
2019-06-04 19:35:53 +00:00
Philip Withnall
fc59d3ee3d Merge branch 'fix-glib-win32-test' into 'master'
glib/tests/win32.c: Fix test variable types

Closes #1797

See merge request GNOME/glib!891
2019-06-04 19:26:45 +00:00
Allison Karlitskaya
efeaf8f747 network-address test: add ipv6-fail ipv4-slow case
Add a case for when the IPv6 result comes back negative and the IPv4
result is significantly delayed.  This is exactly the case that causes
the bug addressed by GNOME/glib!865
2019-06-04 20:09:26 +01:00
Allison Karlitskaya
97f8d3e1d8 gnetworkaddress: fix "happy eyeballs" logic
The "happy eyeballs" RFC states that on receiving a negative response
for an IPv6 address lookup, we should wait for the IPv4 lookup to
complete and use any results we get from there.

The current code was not doing that: it was rather setting a timeout for
failing the resolution entirely.  In scenarios where the IPv4 response
comes more than 50ms after the IPv6 response (which is easily attainable
under valgrind in certain configurations) this means that the IPv4
response will never come.

Remove the timeout and just wait.

See merge request GNOME/glib!865
2019-06-04 20:09:26 +01:00
Daniel Boles
c9b255f6c6 garcbox.c: Fix typo atomit => atomic 2019-06-04 20:08:46 +01:00
Chun-wei Fan
5e0f384f88 glib/tests/win32.c: Fix test variable types
The variable types for the PID (bp) and event (be) are accidentally
reversed in the test program.  Correct their types so that tests do not
fail on Visual Studio x64 builds.

Fixes issue #1797
2019-06-04 20:08:20 +01:00
Emmanuele Bassi
56a56f1ee5 Allow calling get_property() with an uninitialized GValue
We already have the GType with which the GValue should be initialized,
so requiring an initialized GValue is not really necessary, and it
actually complicates code that wraps GObject, by requiring the retrieval
of the GParamSpec in order to get the property type. Additionally, it
introduces a mostly unnecessary g_value_reset().

We already changed g_object_getv() to allow passing uninitialized
GValues, but this fell through the cracks.

Closes: #737
2019-06-04 20:05:24 +01:00
Philip Withnall
0bb8ada1f5 Merge branch 'freebsd-gunichar-wchart-fixes' into 'master'
gunicollate: work around FreeBSD wchar_t not matching our gunichar type

Closes #1798

See merge request GNOME/glib!893
2019-06-04 18:56:09 +00:00