Commit Graph

23585 Commits

Author SHA1 Message Date
Philip Withnall
ee716d9159 docs: Fix capitalisation of ‘GUID’ in a few places
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-06-10 12:37:11 +01:00
Philip Withnall
c794261a40 docs: Expand documentation about D-Bus GUIDs
Clarify that the terms ‘GUID’ and ‘UUID’ are used interchangeably in the
context of D-Bus, and that neither of them are an RFC 4122 UUID.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-06-10 12:36:25 +01:00
Philip Withnall
71edc3ffe1 Merge branch 'fix_more_warnings' into 'main'
Fix more warnings

See merge request GNOME/glib!2119
2021-06-10 09:37:34 +00:00
Michael Catanzaro
c816ee5bd1 Merge branch 'feature/tls-cert-additional-fields' into 'main'
tls: expose SAN details on GTlsCertificate

See merge request GNOME/glib!2142
2021-06-10 00:54:45 +00:00
Ross Wollman
4d3618cbd1 tls: expose SAN details on GTlsCertificate
This changeset exposes

* `dns-names`
* `ip-addresses`

on GTlsCertificate provided by the underlying TLS Backend.

See https://gitlab.gnome.org/GNOME/glib-networking/-/merge_requests/165 for the corresponding glib-networking changes.

Relates: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2113
Relates: https://gitlab.gnome.org/GNOME/glib-networking/-/merge_requests/156/diffs
Relates: https://github.com/microsoft/playwright/issues/6759
2021-06-10 00:54:45 +00:00
Emmanuele Bassi
eff19df205 Merge branch '229-regex-match' into 'main'
gregex: Fix return from g_match_info_fetch() for unmatched subpatterns

Closes #229

See merge request GNOME/glib!1751
2021-06-09 14:08:56 +00:00
Philip Withnall
b052620398 gregex: Fix return from g_match_info_fetch() for unmatched subpatterns
If there were more subpatterns in the regex than matches (which can
happen if one or more of the subpatterns are optional),
`g_match_info_fetch()` was erroneously returning `NULL` rather than the
empty string. It should only return `NULL` when the `match_num`
specifies a subpattern which doesn’t exist in the regex.

This is complicated slightly by the fact that when using
`g_regex_match_all()`, more matches can be returned than there are
subpatterns, due to one or more subpatterns matching multiple times at
different offsets in the string.

This includes a fix for a unit test which was erroneously checking the
broken behaviour.

Thanks to Allison Karlitskaya for the minimal reproducer.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Fixes: #229
2021-06-09 14:39:20 +01:00
Philip Withnall
9ed66b21dd Merge branch 'confusing_errors' into 'main'
gdbusconnection: removed a confusing message

Closes #793

See merge request GNOME/glib!2118
2021-06-09 12:49:04 +00:00
Philip Withnall
78d43a0502 Merge branch 'utkarsh181-main-patch-34260' into 'main'
compiling.xml: Don't recommend backticks

See merge request GNOME/glib!2143
2021-06-09 10:13:27 +00:00
Utkarsh Singh
47e161d082 compiling.xml: Don't recommend backticks 2021-06-09 10:13:27 +00:00
Emmanuel Fleury
f4d6680f13 Fix dropped 'const' qualifier warning in glib/tests/once.c
glib/tests/once.c(199): warning C4090: 'function': different 'const' qualifiers
2021-06-09 11:11:06 +02:00
Emmanuel Fleury
6d8caf6482 Fix comparison of unsigned expression < 0 is always false warning in glib/gunicollate.c
glib/gunicollate.c:444:17: warning: comparison of unsigned expression < 0 is always false
          if (xfrm_len < 0 || xfrm_len >= G_MAXINT - 2)
              ~~~~~~~~ ^ ~
2021-06-09 11:11:06 +02:00
nitinosiris
5e2986ea2c gdbusconnection: removed a confusing message
The message `No such interface %s on object at path %s`
displayed when requested object does not exist, which was kind of
confusing.

Closes #793
2021-06-08 21:07:21 +05:30
Philip Withnall
601ef3b6be Merge branch 'resimplify-w32-veh' into 'main'
Re-simplify exception handling on Windows

See merge request GNOME/glib!2031
2021-06-08 12:10:41 +00:00
LRN
0908e6a8e7 Fix the math in copy_chars
Now we end up returning a pointer to the end of the buffer
after we run out of space. On subsequent calls copy_count will
end up being 0.
2021-06-08 08:38:59 +00:00
Руслан Ижбулатов
fbd7a37e1a Test the wchar_t version of pid-event subst routine
Also move env setup earlier in the test, to ensure that
the child gets the envvars during initialization.

Also, don't look for exception codes in stderr, since
OutputDebugStringA() doesn't dump stuff there.
2021-06-08 08:38:59 +00:00
Руслан Ижбулатов
5c187b9385 Convert the crash handler to UTF-16, mostly 2021-06-08 08:38:59 +00:00
Руслан Ижбулатов
6d9c3e3226 W32: Remove allocations from the crash handler
Use OutputDebugStringA() instead of fprintf.

The goal for this code is to inform the person running the debugger
about the exception that caused the debugger to be attached.
This is useful for debugging with gdb, because gdb does not catch Windows
exception information (it just displays "Segmentation fault").

OutputDebugStringA() ensures that the output goes to the debugger,
and the (ab)use of strcpy() with a stack-allocated buffer ensures
that we do not allocate anything while the crash handler is running,
nor to we call CRT functions that can be reasinably expected to allocate
anything.
2021-06-08 08:38:59 +00:00
Руслан Ижбулатов
891e3a0bba W32: Initialize debugger stuff in advance
Since VEH is invoked when an exception occurs (which, for us,
is mostly when the program is already crashing), we should
try to avoid doing much processing at that point. Since these
things (debugger commandline, a list of extra exceptions to catch)
are known in advance, set them up during initialization.
2021-06-08 08:38:59 +00:00
Руслан Ижбулатов
1955ede43b W32: Don't use g_getenv() in crash handler or during initialization
The first is to avoid any non-trivial code in the crash handler.
The second is to avoid the use of quarks and hash tables (brought
in by g_getenv()) during GLib initialization.
2021-06-08 08:38:59 +00:00
Emmanuele Bassi
ff8b43a154 Merge branch '2418-more-stupid-atomics' into 'main'
gbitlock: Drop unnecessary volatile qualifiers

Closes #2418

See merge request GNOME/glib!2131
2021-06-07 17:21:50 +00:00
Philip Withnall
2e8feda5d1 Merge branch 'Garray' into 'main'
doc: example for GArray and g_array_set_clear_func()

Closes #626

See merge request GNOME/glib!2124
2021-06-07 15:52:43 +00:00
Nitin Wartkar
b1d7a57cdf doc: example for GArray and g_array_set_clear_func() 2021-06-07 15:52:43 +00:00
Philip Withnall
2b4e8521e8 Merge branch 'fix/accidental-dllexport' into 'main'
gdbus, win32: Fix accidental dllexport in static builds

See merge request GNOME/glib!2139
2021-06-07 14:54:46 +00:00
Philip Withnall
6e92c2c233 Merge branch '2348-rename-master' into 'master'
Rename default development branch to main

Closes #2348

See merge request GNOME/glib!2140
2021-06-07 13:22:34 +00:00
Emmanuele Bassi
8bb4e7519e Merge branch '2417-file-replace-contents-etags' into 'master'
glocalfileoutputstream: Fix ETag check when replacing through a symlink

Closes #2417

See merge request GNOME/glib!2138
2021-06-07 13:15:52 +00:00
Philip Withnall
d81165216d docs: Add a section to the README about the branch rename
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Helps: #2348
2021-06-07 14:03:48 +01:00
Philip Withnall
24e459e3d8 Rename the master branch to main
It’s a more inclusive name, has the same tab-completion prefix, and is
the default choice for new repositories created locally by git, and on
GitHub and GitLab.

https://sfconservancy.org/news/2020/jun/23/gitbranchname/

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Fixes: #2348
2021-06-07 14:03:48 +01:00
Philip Withnall
1a43d950b4 docs: Update various external links to use HEAD instead of master
Update several links to allow the remote to use its configured default
branch name, rather than specifying `master` as the default branch name.
This will help avoid breakage if any of these projects rename their
default branch in the future.

Fix a few of the links where they were hitting redirects or had moved.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Helps: #2348
2021-06-07 14:03:48 +01:00
Philip Withnall
f551a60380 ci: Allow origin to choose default branch for gobject-introspection
Rather than specifying the default branch explicitly, allow the origin
to choose it. Specify the `--single-branch` option explicitly to make it
clear the CI only needs one branch; this is however already implied by
the `--depth` option so is not strictly necessary.

This will help avoid breakage if gobject-introspection changes its
default branch name in future.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Helps: #2348
2021-06-07 13:14:26 +01:00
Philip Withnall
533f377a82 subprojects: Pin gtk-doc to a specific version
One of the points of subprojects is to allow building against a version
of a dependency that the project has been tested against, so don’t try
and build against gtk-doc master. Building against master is actually
currently fine, but is a slight risk. Making this change also removes
one more instance of `master` from `git grep master` results, which
helps #2348.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Helps: #2348
2021-06-07 13:12:11 +01:00
Ole André Vadla Ravnås
92c4ae1c62 gdbus, win32: Fix accidental dllexport in static builds
Should only dllexport g_win32_run_session_bus() when building a DLL.
2021-06-07 13:57:59 +02:00
Philip Withnall
4fd789c160 tests: Add missing setlocale() call to file tests
This ensures that non-ASCII characters in the test output are printed
correctly in the logs.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-06-07 12:44:58 +01:00
Philip Withnall
b1ebb72522 glocalfileoutputstream: Fix ETag check when replacing through a symlink
Since commit 87e19535fe, the ETag check when writing out a file through
a symlink (following the symlink) has been incorrectly using the ETag
value of the symlink, rather than the target file. This is incorrect
because the ETag should represent the file content, not its metadata or
links to it.

Fix that, and add a unit test.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Fixes: #2417
2021-06-07 12:44:52 +01:00
Philip Withnall
b407d46c9a Merge branch '2416-tls-certificate-fix-invalid-read' into 'master'
tests/tls-certificate: Add a unit test

Closes #2416

See merge request GNOME/glib!2136
2021-06-07 08:36:12 +00:00
Peter Bloomfield
f0a1671161 tests/tls-certificate: Add context to the new test
Add a comment to `pem_parser_no_sentinel()` to explain what it is
testing and how it works.
2021-06-05 10:14:24 -04:00
Peter Bloomfield
39f661b070 tlscertificate: Avoid possible invalid read
In various places, do not read past the end of the data.
Fixes https://gitlab.gnome.org/GNOME/glib/-/issues/2416
2021-06-04 20:46:44 -04:00
Peter Bloomfield
b9d07813d8 tests/tls-certificate: Add a unit test
Test whether g_tls_certificate_new_from_pem() can handle a
non-nul-terminated PEM.

Helps https://gitlab.gnome.org/GNOME/glib/-/issues/2416
2021-06-04 20:40:16 -04:00
Philip Withnall
205045e5c7 Merge branch 'wip/issue-1884' into 'master'
gsettings: Resolve child schemas from the parent's schema source

Closes #1884

See merge request GNOME/glib!2132
2021-06-04 12:09:24 +00:00
Christian Persch
2632ed7a69 gsettings: Resolve child schemas from the parent's schema source 2021-06-04 12:09:24 +00:00
Philip Withnall
02b298cf08 Merge branch 'mcatanzaro/tls-info' into 'master'
tls: add functions to get protocol version and ciphersuite name

See merge request GNOME/glib!2077
2021-06-04 11:14:46 +00:00
Philip Withnall
8e6214aa30 Merge branch 'fix-memory-leak' into 'master'
inotify: Fix a memory leak

Closes #2311

See merge request GNOME/glib!2128
2021-06-04 10:53:38 +00:00
Gaël Bonithon
df500c68a4 inotify: Fix a memory leak
Fixes: #2311
2021-06-03 19:04:48 +02:00
Michael Catanzaro
bf37392045 tls: add functions to get protocol version and ciphersuite name
This adds g_tls_connection_get_protocol_version(),
g_tls_connection_get_ciphersuite_name(), and DTLS variants. This will
allow populating TLS connection information in the WebKit web inspector.

This is WIP because we found it's not quite possibly to implement
correctly with GnuTLS. See glib-networking!151.
2021-06-03 10:56:15 -05:00
Philip Withnall
942501bec7 gbitlock: Minor improvement to documentation formatting
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-06-03 15:15:34 +01:00
Philip Withnall
11cd751203 gbitlock: Drop unnecessary volatile qualifiers
This follows on from !1719. It drops volatile qualifiers on internal
functions in `gbitlock.c`, and casts volatile public arguments to
non-volatile versions to avoid the `g_atomic_*()` macros from
propagating the volatile qualifier.

We can’t drop the `volatile` qualifier from the public API in
`gbitlock.h`, as that would unfortunately be an API break.

Update the documentation in `gbitlock` to mention that users of the API
should not use `volatile`. See http://c.isvolatileusefulwiththreads.com/

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Fixes: #2418
2021-06-03 15:15:21 +01:00
Philip Withnall
91759dbd63 tests: Ignore warning about use of volatile from a test for exactly that
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Helps: #2418
2021-06-03 13:44:15 +01:00
Sebastian Dröge
fbcd653bd9 Merge branch '2414-wrap-code-example' into 'master'
docs: Wrap a code example more tightly to reduce minimum page width

Closes #2414

See merge request GNOME/glib!2129
2021-06-03 12:23:06 +00:00
Philip Withnall
be24b0c622 docs: Wrap a code example more tightly to reduce minimum page width
Otherwise the page has a horizontal scrollbar in Devhelp on some
machines.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Fixes: #2414
2021-06-03 12:52:51 +01:00
Philip Withnall
04739eb4fd Merge branch '2227-gdbus-nullability' into 'master'
gdbus: Add various missing (nullable) or (not nullable) annotations

See merge request GNOME/glib!2123
2021-06-03 09:17:28 +00:00