Commit Graph

23565 Commits

Author SHA1 Message Date
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
Philip Withnall
ac8f4a0db5 gdbus: Add various missing (nullable) or (not nullable) annotations
This is the result of checking each `Returns:` line in these files. I’ve
only considered nullability and not other (potentially missing or
incorrect) annotations.

Including suggestions by Simon McVittie.

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

Helps: #2227
2021-06-03 10:02:37 +01:00
Philip Withnall
89fe74fdc0 Merge branch 'master' into 'master'
gutils: ensure g_find_program_in_path() return an absolute path

See merge request GNOME/glib!2127
2021-06-02 12:57:46 +00:00
Luke Yue
3321fb561e tests: Add a test case for g_find_program_in_path()
Signed-off-by: Luke Yue <lukedyue@gmail.com>
2021-06-02 20:10:38 +08:00
Luke Yue
dba1fce993 gutils: ensure g_find_program_in_path() return an absolute path
Fix a possibility of returning a relative path, according to the
doc, the function should return an absolute path.

Signed-off-by: Luke Yue <lukedyue@gmail.com>
2021-06-02 20:10:38 +08:00
Philip Withnall
11c0b2e597 Merge branch 'pgriffis/pkcs11-password' into 'master'
gtlspassword: Add flags signifying PIN type for PKCS#11

See merge request GNOME/glib!2126
2021-06-02 10:06:06 +00:00
Michael Catanzaro
7a51163cf9 Merge branch 'feature/cert-info' into 'master'
tls: expose cert details on GTlsCertificate

See merge request GNOME/glib!2113
2021-06-01 20:25:21 +00:00
Patrick Griffis
e750f7a145 gtlspassword: Add flags signifying PIN type for PKCS#11
In a PKCS#11 operation there are multiple types of PINs possibly
needed and these flags add a way to expose them to the user.

This design exactly matches gnutls' gnutls_pin_flag_t API.
2021-06-01 14:56:56 -05:00
Philip Withnall
bc0d9376b7 Merge branch 'add_g_prefix_error_literal' into 'master'
Add g_prefix_error_literal()

Closes #663

See merge request GNOME/glib!2121
2021-06-01 19:08:16 +00:00
Emmanuel Fleury
1e90d9cd74 Add test case for g_prefix_error_literal() function 2021-06-01 19:00:37 +02:00
Ross A. Wollman
a17c28790a tls: expose cert details on GTlsCertificate
This changeset exposes

* `not-valid-before`
* `not-valid-after`
* `subject-name`
* `issuer-name`

on GTlsCertificate provided by the underlying TLS Backend.

In order to make use of these changes,
see the related [glib-networking MR][glib-networking].

This change aims to help populate more of the [`Certificate`][wk-cert]
info in the WebKit Inspector Protocol on Linux.

This changeset stems from work in Microsoft Playwright to [add more info
into its HAR capture][pw] generated from the Inspector Protocol events
and will bring feature parity across WebKit platforms.

[wk-cert]: 8afe31a018/Source/JavaScriptCore/inspector/protocol/Security.json
[pw]: https://github.com/microsoft/playwright/pull/6631
[glib-networking]: https://gitlab.gnome.org/GNOME/glib-networking/-/merge_requests/156
2021-06-01 16:24:33 +00:00
Philip Withnall
94e90422b9 Merge branch 'new_patch' into 'master'
gobject: Allow passing %NULL for @data in g_object_remove_toggle_ref

Closes #817

See merge request GNOME/glib!2117
2021-06-01 14:31:13 +00:00
Yaron Shahrabani
9bb69aff63 Update Hebrew translation 2021-05-28 19:58:35 +00:00
Dan Williams
9cb1bb0fb2 Add g_prefix_error_literal()
Because sometimes you don't want a lone "%s", and you don't
want the compiler yelling at you about format strings that
don't have any format in them.

Closes #663
2021-05-28 17:15:46 +02:00
Sebastian Dröge
0d7f3e74e0 Merge branch '399-dlerror-thread-safety' into 'master'
gmodule: Add locking around dlerror() for some libc implementations

Closes #399

See merge request GNOME/glib!2122
2021-05-28 10:02:59 +00:00
Philip Withnall
483843c282 gmodule: Add locking around dlerror() for some libc implementations
Specifically, for uclibc at the moment. Other implementations may need
locking, but I haven’t checked any aside from uclibc-ng and glibc.

POSIX.1-2001 specifies that `dlerror()` is not thread-safe, but the
glibc (and likely other libc) implementation is.

Issue #399 was originally reported about eglibc, but that project has
since died and been merged back into glibc. So that’s one less thing to
worry about.

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

Fixes: #399
2021-05-28 09:58:21 +01:00
Jasper St. Pierre
edb40c7171 gobject: Allow passing %NULL for @data in g_object_remove_toggle_ref
gjs has some situations where it's not always aware of the @data that
was passed into g_object_add_toggle_ref, so allow passing %NULL to
just match on @notify.

Rebased and updated by Nitin Wartkar

Closes #817
2021-05-27 21:09:45 +05:30
Philip Withnall
73a78f7470 gmodule: Add some missing consts
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-05-27 13:46:28 +01:00
Philip Withnall
0c8740dc83 Merge branch 'fix_more_warnings' into 'master'
Fix more warnings

See merge request GNOME/glib!2106
2021-05-27 10:00:28 +00:00
Emmanuel Fleury
bf536a5ce2 Fix incompatible pointer to integer conversion warning in glib/tests/atomic.c
lib/tests/atomic.c:115:9: warning: incompatible pointer to integer conversion passing 'void *' to parameter of type 'gsize' (aka 'unsigned long')
  res = g_atomic_pointer_compare_and_exchange (&gs, NULL, NULL);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
glib/gatomic.h:225:34: note: expanded from macro 'g_atomic_pointer_compare_and_exchange'
                                 (newval), FALSE,                            \
                                 ^~~~~~~~
2021-05-27 10:16:52 +02:00
Emmanuel Fleury
2b4bf535f1 Fix discard qualifier warning in glib/tests/atomic.c
glib/tests/atomic.c:132:18: warning: passing 'typeof (*(cspp)) *' (aka 'const int *const *') to parameter of type 'const gint **' (aka 'const int **') discards qualifiers
  g_assert_true (g_atomic_pointer_get (cspp) == csp);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
glib/gatomic.h:117:38: note: expanded from macro 'g_atomic_pointer_get'
    __atomic_load (gapg_temp_atomic, (&(gapg_temp_newval)), __ATOMIC_SEQ_CST); \
                                     ^~~~~~~~~~~~~~~~~~~~~
2021-05-27 10:16:52 +02:00