Commit Graph

21263 Commits

Author SHA1 Message Date
Michael Catanzaro
bbbaae9fb7 Fully deprecate TLS rehandshakes
Previously, the documentation indicated that it was possible to call
g_tls_connection_handshake() after an initial handshake to trigger a
rehandshake, but only if TLS 1.2 or older is in use. However, there is
no documented way to ensure TLS 1.2 gets used. Nowadays, TLS 1.3 is used
by default.

I'm removing support for rehandshaking from glib-networking, as part of
a large refactoring where keeping rehandshakes would have entailed
significant additional complexity. So let's update the documentation to
indicate this is no longer ever supported. Applications should not
notice any difference.

Also, sync some previous handshake and rehandshake changes from
GTlsConnection to GDtlsConnection that were missed by mistake. I
try to remember to always update GDtlsConnection when touching
GTlsConnection documentation, but it's easy to forget.
2020-01-07 14:52:20 -06:00
Bastien Nocera
e706cc9cf2 Merge branch 'wip/hadess/fix-gmemory-monitor-example' into 'master'
GMemoryMonitor docs fixes

See merge request GNOME/glib!1294
2020-01-07 17:51:51 +00:00
Bastien Nocera
2394bc755a docs: Add full code example for GMemoryMonitor 2020-01-07 18:29:53 +01:00
Bastien Nocera
b04be9efc7 docs: Fix markup that led to unreadable example
We used XML to markup when we should have used our own brand of markdown
instead. This fixes the example being unreadable unless we trimmed the
XML away from it.
2020-01-07 18:29:53 +01:00
Philip Withnall
4151dfea82 Merge branch 'wip/hadess/test-fixes' into 'master'
gio: Fix socket test

See merge request GNOME/glib!1295
2020-01-07 16:21:20 +00:00
Philip Withnall
a7880d84d0 Merge branch 'wip/smcv/gvariant-memcpy0' into 'master'
gvariant-core: Don't pass NULL second argument to memcpy

See merge request GNOME/glib!1303
2020-01-07 16:16:35 +00:00
Philip Withnall
9761ecad75 Merge branch 'mcatanzaro/gsocketclient-improvement' into 'master'
gsocketclient: run timeout source on the task's main context

See merge request GNOME/glib!1308
2020-01-07 15:37:50 +00:00
Bastien Nocera
e537716540 tests: Fix error path not setting an error
This failure path should have set the GError but did not.
2020-01-07 15:07:37 +00:00
Bastien Nocera
b3197f2740 tests: Fix incomplete failure check in socket test
For the check "if (error != NULL)" to work as expected, the
create_server() (and create_server_full()) functions need to make
sure to return an error for all the possible failures, but this
might not always be the case.

Catch all the failures by testing for a non-NULL return value if there
was no error.
2020-01-07 15:07:37 +00:00
Simon McVittie
e9337a9c1d gvariant-core: Don't pass NULL second argument to memcpy
Similar to 3837b83f, glibc memcpy is declared with the first two
arguments annotated as non-null via an attribute, which results in the
undefined behaviour sanitizer considering it to be UB to pass a null
pointer there (even if we are copying no bytes, and hence not actually
dereferencing the pointer).

Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-01-07 15:06:51 +00:00
Michael Catanzaro
cc3cf6b8b2 gsocketclient: run timeout source on the task's main context
This shouldn't make any difference, because this code should only ever
be running in the main context that was thread-default at the time the
task was created, so it should already match the task's context. But
let's make sure, just in case.
2020-01-07 15:05:22 +00:00
Simon McVittie
027c3f8d59 Merge branch '1983-fix-fake-document-portal' into 'master'
tests: Fix callback arguments in fake-document-portal

Closes #1983

See merge request GNOME/glib!1312
2020-01-07 14:38:05 +00:00
Philip Withnall
7d0a1c5c58 tests: Fix callback arguments in fake-document-portal
They didn’t match the prototype generated by `gdbus-codegen`, which
meant that the FD list was being iterated incorrectly. Secondly, the
document ID list returned by the method was not NULL terminated, which
could lead to reading off the end of the list.

Somehow, neither of these bugs caused problems on Linux, but they did
cause problems on FreeBSD.

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

Fixes: #1983
2020-01-07 11:20:45 +00:00
Michael Catanzaro
85c19a7977 Sync GDtlsConnection handshake docs with GTlsConnection
Sadly, I forgot to update the documentation of
g_dtls_connection_handshake() last time I touched
g_tls_connection_handshake().

Let's also drop mention of STARTTLS, since that would use normal TLS,
not DTLS.
2020-01-02 20:26:09 -06:00
Kukuh Syafaat
7ff3875591 Update Indonesian translation 2020-01-02 00:58:06 +00:00
Balázs Úr
3e2f443af1 Update Hungarian translation 2019-12-30 18:10:59 +00:00
Daniel Mustieles
8f3e553a06 Updated Spanish translation 2019-12-30 12:48:18 +01:00
Fran Dieguez
b9227e687e Update Galician translation 2019-12-25 03:05:56 +00:00
Rafael Fontenelle
cafb0e64d3 Update Brazilian Portuguese translation
(cherry picked from commit e1899a4196)
2019-12-24 10:13:58 +00:00
Nirbheek Chauhan
338203e04e Merge branch '198-fopen-docs' into 'master'
docs: Improve g_fopen description for Win32

Closes #198

See merge request GNOME/glib!1292
2019-12-23 10:07:08 +00:00
Piotr Drąg
135c04608c Update Polish translation 2019-12-19 18:05:39 +01:00
Philip Withnall
f4ff348546 Merge branch 'fix-prop-set-error' into 'master'
tests: Fix an error message set by foo_set_property()

See merge request GNOME/glib!1279
2019-12-18 16:39:56 +00:00
Matthew Leeds
a28c34ba88 tests: Fix an error message set by foo_set_property()
The property name and value were mistakenly swapped.
2019-12-18 16:39:56 +00:00
Philip Withnall
51c3921022 Merge branch 'appinfo-doc-portal-test' into 'master'
gio: test that launch_uris() exports files with the document portal when launching a flatpak

See merge request GNOME/glib!1111
2019-12-17 15:30:11 +00:00
Emmanuele Bassi
78fa941c86 Merge branch '833-gobject-set-docs' into 'master'
docs: Clarify handling of 64-bit integer literals with g_object_new()

Closes #833

See merge request GNOME/glib!1293
2019-12-17 13:16:29 +00:00
James Henstridge
e24db62363 gio: do not cache document portal D-Bus proxy
By removing the cached global proxy in gdocumentportal.c, we can
re-enable the checks for proper shutdown of the session bus connection
in the dbus-appinfo.c test.
2019-12-17 21:03:03 +08:00
James Henstridge
926ff8c6a7 gio/tests: add a test for document portal use when launching flatpaks
We can't use session_bus_down() in the test since gdocumentportal.c
holds a reference to the session bus connection, preventing it from
being finalised.
2019-12-17 20:59:22 +08:00
James Henstridge
27db702ceb gio/tests: add a fake implementation of the document portal 2019-12-17 20:56:49 +08:00
James Henstridge
457d4c9fe0 gio: update dbus interfaces from xdg-desktop-portal tree
This removes the need to manually specify org.gtk.GDBus.C.UnixFD
annotations in the gdbus-codegen invocations.
2019-12-17 20:48:22 +08:00
Philip Withnall
2474c65037 docs: Clarify handling of 64-bit integer literals with g_object_new()
As with `g_variant_new()` (or any varargs function which takes integer
literals of differing widths), callers need to be careful to ensure
their integer literals have the right width.

Tweak the documentation for `g_object_new()`, `g_object_set()` and
`g_object_get()` to clarify this. The documentation for `g_object_get()`
shows that it is not subject to the same caveats, since it operates on
pointers.

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

Closes: #833
2019-12-17 12:23:19 +00:00
Philip Withnall
78be7f5022 docs: Improve documentation formatting for g_fopen()
Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #198
2019-12-17 11:37:09 +00:00
David King
6d3f67dae8 docs: Improve g_fopen description for Win32
Tweaked by Philip Withnall.

Closes: #198
2019-12-17 11:36:06 +00:00
Philip Withnall
c597b0e552 Merge branch 'wip/oholy/gio-tool-list-display-names' into 'master'
gio-tool-list: Add an option to print display names

See merge request GNOME/glib!1291
2019-12-17 10:56:33 +00:00
Ondrej Holy
e6f5b9bf89 gio-tool-list: Add an option to print display names
There are some GVfs locations (i.e. google-drive://, recent://), where
G_FILE_ATTRIBUTE_STANDARD_NAME is something tottaly different than
G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME. Thus it would be nice to have
an easy way to show the display names. The only way currently to show
the display names is to use --attributes option, which is a bit
cumbersome. Let's add new --show-display-names option.

https://gitlab.gnome.org/GNOME/gvfs/issues/402
2019-12-17 11:07:10 +01:00
Simon McVittie
5bae85eccc Merge branch 'ossfuzz-14870-dbus-message-variant-nesting' into 'master'
gdbusmessage: Limit recursion of variants in D-Bus messages

See merge request GNOME/glib!1201
2019-12-16 19:50:38 +00:00
Philip Withnall
de7d7dbd6c 2.63.3
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-12-16 13:57:28 +00:00
Philip Withnall
eda096243b docs: Add g_source_set_dispose_function() to documentation
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-12-16 13:57:28 +00:00
Philip Withnall
467b4d6789 docs: Update GMemoryMonitor listings in docs
Fix a few things missed in code review.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-12-16 13:57:28 +00:00
Emmanuele Bassi
988dd6adf8 Merge branch 'ci-docker-fun-times' into 'master'
ci: Build Docker images rather than OCI images if using podman

See merge request GNOME/glib!1255
2019-12-16 12:44:16 +00:00
Emmanuele Bassi
b3981e97ac Merge branch 'format-diff-many-files-better-than-one' into 'master'
clang-format-diff: Output diff for multiple files, not just one

See merge request GNOME/glib!1280
2019-12-16 12:41:55 +00:00
Emmanuele Bassi
829ec978ed Merge branch '650-signal-lookup-warnings' into 'master'
gsignal: Drop unnecessary warnings from g_signal_lookup()

Closes #650

See merge request GNOME/glib!1247
2019-12-16 12:41:31 +00:00
Emmanuele Bassi
a172aa3662 Merge branch '1130-codegen-docs' into 'master'
Resolve "gdbus-codegen: Add an option to strictly generate markdown in source comments"

Closes #1130

See merge request GNOME/glib!1264
2019-12-16 12:39:23 +00:00
Emmanuele Bassi
4ad429c7ca Merge branch 'revert-1277-i-got-it-wrong' into 'master'
Revert "Revert "docs: remove GDBusObjectManager example""

See merge request GNOME/glib!1282
2019-12-16 12:37:34 +00:00
Philip Withnall
a097342ae9 Merge branch 'autocleanup-class' into 'master'
gtype: Define auto-cleanup functions for Module class

See merge request GNOME/glib!1289
2019-12-16 12:13:08 +00:00
Philip Withnall
7aa91a0289 Merge branch 'th/atomic-compare-and-exchange' into 'master'
atomic/tests: test g_atomic_pointer_compare_and_exchange() with const pointers

See merge request GNOME/glib!1287
2019-12-16 11:14:58 +00:00
Philip Withnall
8deebeca17 Merge branch 'master' into 'master'
Fix typo: threfore -> therefore

Closes #1961

See merge request GNOME/glib!1285
2019-12-13 23:48:25 +00:00
Marco Trevisan (Treviño)
ab25fa42cc gtype: Define auto-cleanup functions for Module class
While we automatically define cleanup functions for the module, we don't
do it for the module class.

This will allow to manage the ownership of the class when reffing it
without having to cast it to GTypeClass.
2019-12-13 20:07:51 +01:00
Thomas Haller
ef9ce8ea00 atomic/tests: test g_atomic_pointer_compare_and_exchange() with const pointers
g_atomic_pointer_compare_and_exchange() should work with const pointers.
Add a test for that.

It seems clang 9.0.0-2.fc32 does not like this:

    ../glib/tests/atomic.c:93:9: warning: incompatible pointer types passing 'typeof ((((void *)0))) *' (aka 'void **') to parameter of type 'const char **' [-Wincompatible-pointer-types]
      res = g_atomic_pointer_compare_and_exchange (&vp_str, NULL, str);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../glib/gatomic.h:192:44: note: expanded from macro 'g_atomic_pointer_compare_and_exchange'
        __atomic_compare_exchange_n ((atomic), &gapcae_oldval, (newval), FALSE, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST) ? TRUE : FALSE; \
                                               ^~~~~~~~~~~~~~
    ../glib/tests/atomic.c:96:9: warning: incompatible pointer types passing 'typeof ((((void *)0))) *' (aka 'void **') to parameter of type 'const char **' [-Wincompatible-pointer-types]
      res = g_atomic_pointer_compare_and_exchange (&vp_str_vol, NULL, str);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../glib/gatomic.h:192:44: note: expanded from macro 'g_atomic_pointer_compare_and_exchange'
        __atomic_compare_exchange_n ((atomic), &gapcae_oldval, (newval), FALSE, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST) ? TRUE : FALSE; \
                                               ^~~~~~~~~~~~~~

Note that this clang version already issues various compiler warnings for
this test. This merely adds another case to check.

Eventually g_atomic_pointer_compare_and_exchange() should be fixed to
avoid compiler warnings.

Actually there is a problem. When you try to use g_atomic_pointer_compare_and_exchange()
with const pointers, it is also not working, because the implementation
as a function expects "void *" arguments. As the test also shows. As such,
it's probably not portable to use g_atomic_pointer_compare_and_exchange()
with const pointers at all. However, the macro implementation is (with the right
compiler) fine with that, so it's an easy "mistake" to make.
2019-12-13 15:07:35 +01:00
Christoph Reiter
a8263add45 Merge branch 'fix-gio-module-path-msvc' into 'master'
giomodule: gio modules are no longer installed in bindir on MSVC

See merge request GNOME/glib!1254
2019-12-12 18:29:07 +00:00
Philip Withnall
1810c80832 Merge branch 'piotrdrag/update-potfiles-191212' into 'master'
Update POTFILES.in 191212

See merge request GNOME/glib!1284
2019-12-12 16:39:47 +00:00