Commit Graph

25990 Commits

Author SHA1 Message Date
Marco Trevisan
23fff2024b Merge branch 'backport-2887-content-type-sniffing-glib-2-74' into 'glib-2-74'
Backport !2887 “glocalfileinfo: Ensure we always sniff some data to get the content type” to glib-2-74

See merge request GNOME/glib!2982
2022-10-19 15:25:23 +00:00
Marco Trevisan (Treviño)
3057273816 glocalfileinfo: Ensure we always sniff some data to get the content type
In case the XDG database is not initialized yet we may try to sniff a
0-length data, making our content-type routines to mark non-empty files
as `application/x-zerosize`.

This is wrong, so in case the sniff size is not set, let's just
try to read the default value. To avoid false-application/x-zerosize
results (that are not something we want as per legacy assumptions).

See: https://bugzilla.gnome.org/show_bug.cgi?id=755795

Fixes: https://gitlab.gnome.org/GNOME/glib/-/issues/2742
2022-10-19 10:11:43 +01:00
Marco Trevisan
d0b81a8bfd Merge branch 'backport-2959-leak-fixes-glib-2-74' into 'glib-2-74'
Backport !2959 “Some leaks fixes” to glib-2-74

See merge request GNOME/glib!2960
2022-10-18 15:32:44 +00:00
Marco Trevisan
4ea5bac34a Merge branch 'backport-2955-timezone-toolbox-glib-2-74' into 'glib-2-74'
Backport !2955 “gtimezone: Reject weird /etc/localtime configurations” to glib-2-74

See merge request GNOME/glib!2973
2022-10-18 14:51:13 +00:00
Philip Withnall
d3ecfdf1a1 Merge branch 'backport-2782-gvariant-recursion-typedecl-fix-glib-2-74' into 'glib-2-74'
Backport !2974 “gvariant-parser: Reject deeply-nested typedecls in text form variants” to glib-2-74

See merge request GNOME/glib!2975
2022-10-18 14:33:51 +00:00
Philip Withnall
777606419d gvariant-parser: Reject deeply-nested typedecls in text form variants
Return `G_VARIANT_PARSE_ERROR_RECURSION` from `g_variant_parse()` if a
typedecl is found within a text-form variant which would cause any part
of the variant to exceed the maximum allowed recursion/nesting depth.

This fixes an oversight when `G_VARIANT_MAX_RECURSION_DEPTH` was
implemented, which allowed typedecls to effectively multiply the size of
an array if `g_variant_parse()` was parsing a text-form variant without
a top-level concrete type specified.

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

Fixes: #2782
oss-fuzz#49462
2022-10-18 14:53:02 +01:00
Ray Strode
1143a8a666 gtimezone: Reject weird /etc/localtime configurations
At the moment, glib assumes that if /etc/localtime is a symlink,
that it's a symlink to zoneinfo file.

Toolbx containers add an extra layer of indirection though, making
it a symlink to a symlink to a zoneinfo file.

This commit deals with the problem, by performing additional checks
on /etc/localtime and ignoring it if those check fail, falling back
instead to reading /etc/timezone.
2022-10-18 14:43:21 +01:00
Marc-André Lureau
8c9769605f tests/gmenumodel: fix various leaks
Found thanks to ASAN.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-10-17 11:52:18 +01:00
Philip Withnall
21e89b9bfd Merge branch 'th/ghash-steal-extended-doc' into 'main'
ghash: document g_hash_table_steal_extended() behavior for sets

See merge request GNOME/glib!2948
2022-10-14 08:03:44 +00:00
Thomas Haller
99bedd110c ghash: document g_hash_table_steal_extended() behavior for sets 2022-10-14 08:03:43 +00:00
Sebastian Dröge
fdf503a141 Merge branch 'ebassi/for-main' into 'main'
doc: Correctly annotate g_async_queue_push()

See merge request GNOME/glib!2949
2022-10-14 07:37:31 +00:00
Emmanuele Bassi
80f56c9eb4 doc: Correctly annotate GAsyncQueue methods
Generic pointers are assumed to be nullable unless explicitly marked as
not nullable.
2022-10-13 23:56:18 +01:00
Marco Trevisan
9fb7edd845 Merge branch 'fileutils-fwrite-retval' into 'main'
tests: Check the return value of fwrite() in a test

See merge request GNOME/glib!2946
2022-10-13 21:04:39 +00:00
Philip Withnall
d6c29b538a tests: Check the return value of fwrite() in a test
Not that we ever expect it to fail. This is basically just to silence a
compiler warning with `-Werror=unused-result`.

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

Helps: #2758
2022-10-13 15:48:47 +01:00
Philip Withnall
c16f524034 Merge branch 'static' into 'main'
tests: skip shared libs if default_library=static

See merge request GNOME/glib!2867
2022-10-12 16:19:02 +00:00
Alyssa Ross
1dc8d69edb tests: skip shared libs if default_library=static
Otherwise, the build will fail when the toolchain is static-only, even
with -Ddefault_library=static.  I talked to a Meson developer in their
IRC channel, who told me that the correct fix was to ensure that
shared_library is only used if default_library != static.
2022-10-12 16:49:39 +01:00
Philip Withnall
057a9e5773 Merge branch 'test-actions-parallel-fix' into 'main'
tests/desktop-app-info: Use unique temporary paths for action files

See merge request GNOME/glib!2885
2022-10-12 14:41:27 +00:00
Philip Withnall
350b92821c Merge branch 'wip/smcv/deprecated-construct-prop' into 'main'
gobject: Only emit deprecation warnings for user-specified properties

Closes #2748

See merge request GNOME/glib!2912
2022-10-12 13:56:46 +00:00
Philip Withnall
0cdbc530ca Merge branch 'regex-errors-msg-cleanups' into 'main'
gregex: Use pcre2 error messages if we don't provide a specific one

See merge request GNOME/glib!2913
2022-10-12 13:48:29 +00:00
Philip Withnall
5d504709ab Merge branch 'more-gio-thumbnail-sizes' into 'main'
glocalfileinfo: Add support for xx-large and x-large thumbnails

Closes #2767

See merge request GNOME/glib!2941
2022-10-12 13:43:07 +00:00
Philip Withnall
e90733a457 Merge branch 'atomic-older-cplusplus' into 'main'
gatomic: fix the atomic compare_and_exchange macros on older C++ standard versions

See merge request GNOME/glib!2864
2022-10-12 09:56:19 +00:00
Philip Withnall
90ae06a9f6 Merge branch 'null-param-handle-test' into 'main'
gobject/tests/param: Add unit test for handling invalid NULL param spec

See merge request GNOME/glib!2939
2022-10-11 20:06:27 +00:00
Philip Withnall
61ef7a7ec2 Merge branch 'strugee-main-patch-02389' into 'main'
Fix style warning in gvariant.c

See merge request GNOME/glib!2933
2022-10-11 19:50:10 +00:00
Philip Withnall
41d1cd02a0 Merge branch 'ebassi/static-docs' into 'main'
Build API docs only with shared libraries

See merge request GNOME/glib!2896
2022-10-11 19:31:31 +00:00
Marco Trevisan (Treviño)
e7a68531b3 glocalfileinfo: Add support for xx-large and x-large thumbnails
Co-Authored-by: António Fernandes <antoniof@gnome.org>

Closes: #2767
2022-10-11 20:58:58 +02:00
Marco Trevisan (Treviño)
9bb1410c54 gio/tests: Add file-thumbnail tests
Check if thumbnails are created in the path we expect and that we can
retrieve their information, but also that we try to get the biggest size
available when multiple are available.
2022-10-11 20:58:58 +02:00
Matthias Clasen
db1aadaa5e Merge branch 'str-equal-only' into 'main'
g_str_equal: Provide macro for optimization

Closes #2775

See merge request GNOME/glib!2940
2022-10-11 18:19:25 +00:00
Xavier Claessens
6e341750df g_str_equal: Provide macro for optimization
g_str_equal() is a nicer API than strcmp()==0, and less error prone.
However, forcing a function call prevents compiler from doing
optimizations. In the case it is not used as callback to GHashTable,
provide a macro that calls strcmp directly. This also has the side
effect that it forces arguments to be `const char *` instead of
`gconstpointer` in the case it is not used as callback, which adds type
safety.

Fixes: #2775
2022-10-11 10:55:56 -04:00
Marco Trevisan
cf4d8a3bdc Merge branch 'osx-declaration-mixes-fix' into 'main'
gosxcontenttype: Do not mix declarations with code

Closes #2759

See merge request GNOME/glib!2909
2022-10-11 13:24:57 +00:00
Marco Trevisan
10e3715bc1 Merge branch 'utimensat2' into 'main'
glocalfileinfo: In set_mtime_atime(), don't use utimensat() if it's not available

See merge request GNOME/glib!2911
2022-10-11 13:11:07 +00:00
Marco Trevisan (Treviño)
60587d5965 tests/file: Include config.h so tests checking HAVE_* definitions are ran
We have tests depending on HAVE_UTIMES and HAVE_UTIMENSAT that were
currently not compiled because these were always undefined
2022-10-11 14:37:12 +02:00
Marco Trevisan (Treviño)
b1d4b4bb3b glocalfileinfo: Avoid getting unused type values 2022-10-11 14:24:17 +02:00
Jared Wahlstrand
15cb123c82 glocalfileinfo: don't call both utimes and utimensat
also split us precision and ns precision code to make this cleaner
2022-10-11 14:10:28 +02:00
Marco Trevisan
4231426abe Merge branch 'optimize_g_double_hash' into 'main'
Optimize the implementation of `g_double_hash`

See merge request GNOME/glib!2924
2022-10-11 11:26:41 +00:00
星外之神
e02db8ea22 Add tests for hash collisions in simple cases 2022-10-11 13:12:20 +02:00
wszqkzqk
c1af4b2b88 Optional optimization for g_int64_hash 2022-10-11 13:12:20 +02:00
wszqkzqk
dd1f4f709e Optimize g_double_hash implementation 2022-10-11 13:12:20 +02:00
Marco Trevisan (Treviño)
80cf66034b gobject/tests/param: Add unit test for handling invalid NULL param spec
This was fixed by !2921 but there was no test with the MR, so add one.
2022-10-10 21:01:10 +02:00
Marco Trevisan
db259b5925 Merge branch 'atime' into 'main'
tests: skip g-file-info test if atime unsupported

See merge request GNOME/glib!2866
2022-10-10 15:32:06 +00:00
Marco Trevisan
cc02e8720d Merge branch 'unicode-15' into 'main'
Unicode 15 support

Closes #2735

See merge request GNOME/glib!2877
2022-10-10 14:20:17 +00:00
Marco Trevisan
8f2711bf72 Merge branch 'log-field-nul-termination-2' into 'main'
Update version in the docs to 2.74.1 for the fixed handling of...

See merge request GNOME/glib!2916
2022-10-10 12:33:57 +00:00
Philip Withnall
1d2ea6518c Merge branch 'fix-unix-streams-error-leak' into 'main'
tests/unix-streams: Free the cancelled error on cancelled cancellable

See merge request GNOME/glib!2892
2022-10-10 12:02:56 +00:00
Philip Withnall
b321ba1d1f Merge branch 'ignore-dirs-leaks+valgrind-ci' into 'main'
glib.supp: Ignore gutils leaks for user and system dirs

Closes #333

See merge request GNOME/glib!2897
2022-10-10 12:01:49 +00:00
Sebastian Dröge
aaf1bc0331 Merge branch 'fix-localfileinfo' into 'main'
gio: properly guard use of utimensat()

Closes #2766

See merge request GNOME/glib!2914
2022-10-10 06:57:48 +00:00
Sebastian Dröge
2f284193a7 Merge branch 'date-time-new-now' into 'main'
gdatetime: add NULL guard in g_date_time_new_now()

See merge request GNOME/glib!2938
2022-10-10 06:52:56 +00:00
Peter Bloomfield
574a2ecfa9 gdatetime: add NULL guard in g_date_time_new_now()
Add a missing g_return_() check in g_date_time_new_now().
A clear warning is better than a NULL pointer dereference.
2022-10-09 19:39:58 -04:00
Yaron Shahrabani
2b8b866bae Update Hebrew translation 2022-10-06 13:23:20 +00:00
Sebastian Dröge
07e3ec6e04 Merge branch 'aleksander/gdatetime-return-if-fail' into 'main'
gdatetime: add missing g_return_() check in g_date_time_format_iso8601

See merge request GNOME/glib!2931
2022-10-05 07:09:47 +00:00
AJ Jordan
e052dddd1d Fix style warning in gvariant.c 2022-10-05 06:47:26 +00:00
Aleksander Morgado
737ca7de91 gdatetime: add missing g_return_() check in g_date_time_format_iso8601
A clear warning is better than a NULL pointer dereference.

Signed-off-by: Aleksander Morgado <aleksandermj@chromium.org>
2022-10-04 21:37:58 +00:00