23377 Commits

Author SHA1 Message Date
Ondrej Holy
7cce6b5c7f Merge branch 'backport-2185-trash-fix-glib-2-68' into 'glib-2-68'
Backport !2185 “glocalfile: Fix the global trash dir detection” to glib-2-68

See merge request GNOME/glib!2186
2021-07-12 11:10:23 +00:00
markus
d7ba35360a glocalfile: Fix the global trash dir detection
The `g_file_trash` function fails with the `Unable to find or create trash
directory` error when the global `.Trash` directory exists. This is because
the commit 7f2af262 introduced the `gboolean success` variable to signalize
the detection of the trash folder, but didn't set it in all code branches.
Since for a time this variable was not initialized the bug wasn't visible
when the trash folder existed. The bug became effective after the `success`
variable was initialized with `FALSE` by the commit c983ded0. Let's explicitly
set the `success` variable in all branches to fix the global trash dir
detection.

Fixes: https://gitlab.gnome.org/GNOME/glib/-/issues/2439
2021-07-12 11:35:03 +01:00
Chao-Hsiung Liao
ebe1dbd860 Update Chinese (Taiwan) translation 2021-07-10 05:18:32 +00:00
Emmanuele Bassi
63e7864d1a Merge branch 'backport-2180-close_range-glib-2-68' into 'glib-2-68'
Backport !2180 “correctly use 3 parameters for close_range” to glib-2-68

See merge request GNOME/glib!2183
2021-07-09 12:27:02 +00:00
Khem Raj
6e59d21b27 correctly use 3 parameters for close_range
libc implementation has 3 parameter e.g.
https://www.freebsd.org/cgi/man.cgi?query=close_range&sektion=2&format=html

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-07-09 12:24:56 +01:00
Michael Olbrich
0d236c39ee data-to-c.py: generate new-line at the end of the file
This is necessary when building glib with icecc. Icecc splits the build
process into two parts. The file is locally preprocessed with
-fdirectives-only to resolve any includes. This adds linemarkers to the
intermediate file. Without the new-line at the end of the file this:

 #include "gconstructor_as_data.h"
 #include "glib/glib-private.h"

Is turned into this:

const char gconstructor_code[] = "...";# 1 "glib/glib-private.h"
...

The result is a compile error:

In file included from ../glib/gio/glib-compile-resources.c:45:
gio/gconstructor_as_data.h:1: error: stray '#' in program
gio/gconstructor_as_data.h:1: error: expected identifier or '(' before numeric constant
In file included from ../glib/glib/glib-private.h:22,
                 from gio/gconstructor_as_data.h:2,
                 from ../glib/gio/glib-compile-resources.c:45:
../glib/glib/gwakeup.h:27:1: error: unknown type name 'GWakeup'
../glib/glib/gwakeup.h:28:42: error: unknown type name 'GWakeup'
../glib/glib/gwakeup.h:30:42: error: unknown type name 'GWakeup'
../glib/glib/gwakeup.h:32:42: error: unknown type name 'GWakeup'
../glib/glib/gwakeup.h:33:42: error: unknown type name 'GWakeup'
In file included from gio/gconstructor_as_data.h:2,
                 from ../glib/gio/glib-compile-resources.c:45:
../glib/glib/glib-private.h:98:3: error: unknown type name 'GWakeup'
../glib/glib/glib-private.h:99:58: error: unknown type name 'GWakeup'
../glib/glib/glib-private.h💯58: error: unknown type name 'GWakeup'
../glib/glib/glib-private.h:102:58: error: unknown type name 'GWakeup'
../glib/glib/glib-private.h:103:58: error: unknown type name 'GWakeup'
In file included from gio/gconstructor_as_data.h:2,
                 from ../glib/gio/glib-compile-resources.c:45:
../glib/glib/glib-private.h:164:53: warning: file "../glib/gio/glib-compile-resources.c" linemarker ignored due to incorrect nesting

To avoid this, generate gconstructor_as_data.h with a new-line at the end
of the file.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2021-07-02 14:29:29 +01:00
Dingzhong Chen
d3dc7a8727 Update Chinese (China) translation 2021-06-24 23:17:59 +08:00
Simon McVittie
14a1eb525e Merge branch 'backport-2155-local-file-monitor-deadlock-glib-2-68' into 'glib-2-68'
Backport !2155 “glocalfilemonitor: Avoid a deadlock on finalization” to glib-2-68

See merge request GNOME/glib!2158
2021-06-15 18:40:11 +00:00
Philip Withnall
f49710b8aa glocalfilemonitor: Avoid a deadlock on finalization
If `g_file_monitor_source_dispatch()` drops the last reference to its
`GLocalFileMonitor`, a deadlock will occur, because disposing the
`GLocalFileMonitor` causes synchronous disposal of the
`GFileMonitorSource`, and hence an attempt to re-lock the already-locked
mutex in the `GFileMonitorSource`.

Fix that by dropping the reference to the `GLocalFileMonitor` after
unlocking.

Diagnosed by Ting-Wei Lan. The bug was originally introduced by me in
commit 592a13b483.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-06-15 13:26:23 +01:00
Philip Withnall
8249f624ed 2.68.3
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2.68.3
2021-06-10 19:55:29 +01:00
Emmanuele Bassi
b2c7013fbc Merge branch 'backport-2140-file-replace-contents-etags-glib-2-68' into 'glib-2-68'
Backport !2138 “glocalfileoutputstream: Fix ETag check when replacing through a symlink” to glib-2-68

See merge request GNOME/glib!2141
2021-06-10 12:49:34 +00:00
Philip Withnall
aa4aafe30b 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 14:28:03 +01:00
Emmanuele Bassi
bb6aa99e2c Merge branch 'backport-2128-inotify-leak-glib-2-68' into 'glib-2-68'
Backport !2128 “inotify: Fix a memory leak” to glib-2-68

See merge request GNOME/glib!2133
2021-06-07 13:23:41 +00:00
Emmanuele Bassi
599910dfea Merge branch 'backport-2136-tls-cert-parsing-glib-2-68' into 'glib-2-68'
Backport !2136 “tlscertificate: Avoid possible invalid read” to glib-2-68

See merge request GNOME/glib!2137
2021-06-07 13:22:58 +00:00
Peter Bloomfield
afd31d93b5 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-07 09:38:37 +01:00
Peter Bloomfield
bdd36797fc 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-07 09:38:37 +01:00
Peter Bloomfield
955d376b85 tests/tls-certificate: Add a unit test
Test whether g_tls_certificate_new_from_pem() can handle a
non-nul-terminated PEM.

(Fixed minor conflict when cherry-picking.)

Helps https://gitlab.gnome.org/GNOME/glib/-/issues/2416
2021-06-07 09:38:09 +01:00
Gaël Bonithon
d25d6d70f3 inotify: Fix a memory leak
Fixes: #2311
2021-06-04 11:57:41 +01:00
Philip Withnall
36c2b737fa 2.68.2
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2.68.2
2021-05-11 11:55:43 +01:00
Sebastian Dröge
942026a2eb Merge branch 'backport-2078-threaded-resolver-flags-glib-2-68' into 'glib-2-68'
Backport !2078 “gthreadedresolver: don't ignore flags in lookup_by_name_with_flags” to glib-2-68

See merge request GNOME/glib!2079
2021-05-03 11:59:57 +00:00
Clayton Craft
9383b9a955 gthreadedresolver: don't ignore flags in lookup_by_name_with_flags
This fixes a bug where the family flag was ignored in lookup_data_new,
causing the resolver to call getaddrinfo with no hints set when clearly
the family hint should have been set.
2021-05-03 11:36:04 +01:00
Pawan Chitrakar
5e00581980 Update Nepali translation 2021-05-02 07:16:50 +00:00
Sebastian Dröge
faac8f7b41 Merge branch 'nacho/gmacros-glib-2-68' into 'glib-2-68'
gmacros: missing check if __STDC_VERSION__ is defined

See merge request GNOME/glib!2068
2021-04-27 11:28:25 +00:00
Ignacio Casal Quinteiro
7d392d7ebc gmacros: missing check if __STDC_VERSION__ is defined
This fixes warnings when compiling on old distros like centos 7
2021-04-27 13:11:03 +02:00
Sebastian Dröge
1816c1e555 Merge branch 'nacho/gmacros' into 'glib-2-68'
gmacros: check that __cplusplus or _MSC_VER is defined

See merge request GNOME/glib!2060
2021-04-23 08:40:31 +00:00
Ignacio Casal Quinteiro
f954aff882 gmacros: check that __cplusplus or _MSC_VER is defined
Otherwise it will fail to compile in old distros like Centos 7
Fixes #2387
2021-04-23 10:09:49 +02:00
Pawan Chitrakar
e9587a480a Update Nepali translation 2021-04-15 22:03:49 +00:00
Мирослав Николић
463b714e8e Update Serbian translation 2021-04-11 18:19:51 +00:00
Philip Withnall
c2954ecb04 2.68.1
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2.68.1
2021-04-08 14:50:44 +01:00
Philip Withnall
ffc9ac5599 Merge branch 'backport-2026-log-lines-glib-2-68' into 'glib-2-68'
Backport !2026 “Split g_test_log() messages that contain multiple lines” to glib-2-68

See merge request GNOME/glib!2035
2021-04-08 13:41:05 +00:00
Emmanuele Bassi
2e37754261 Split g_test_log() messages that contain multiple lines
When using TAP we want every single line to be one of the following:

 - a valid TAP clause
 - a comment
 - a blank line

Typical explicit test logs are single line comments, but in some cases
we might end up printing debug messages from libraries, and those may
contain multiple lines. When that happens, we break the TAP and fail the
test in conditions entirely outside of our control.

One option to avoid outright failure is to always prepend each line of a
messge with `#`, to ensure that the whole thing is considered a comment.
2021-04-07 16:36:06 +01:00
Philip Withnall
484531600c Merge branch 'glib-2-68-mr-2032' into 'glib-2-68'
Backport MR !2032 (gkeyfile: Drop a redundant check) into glib-2-68

See merge request GNOME/glib!2034
2021-04-07 13:44:36 +00:00
Benjamin Berg
56fe8cccc5 gsocks5proxy: Handle EOF when reading from a stream
The code did not handle EOF (0 byte read) correctly. This can e.g. cause
an infinite loop if an incorrect socks proxy is configured.

Add the appropriate checks and return an G_IO_ERROR_CONNECTION_CLOSED
error if EOF is encountered.
2021-04-07 16:29:40 +03:00
Bruce Cowan
e0c0342688 Update British English translation 2021-04-02 13:24:48 +00:00
Philip Withnall
3da1f2595f Merge branch 'vs2012-2-68' into 'glib-2-68'
Few fixes and notes for building on Visual Studio 2012 and earlier

See merge request GNOME/glib!2022
2021-03-31 15:52:23 +00:00
Chun-wei Fan
8da16a4f80 README.win32.md: Restore Visual Studio 2008/2010 support
It turns out that it is possible to use the Windows 8.0 SDK in Visual
Studio 2008 and 2010 officially, but requires a special setup in the
build command prompt.

Tell people how that special setup can be achieved, and restore the
extra instructions on building with Visual Studio 2008, as it is now
possible again.
2021-03-31 21:48:52 +08:00
Chun-wei Fan
a54af2f36f README.win32.md: Add info on roapi.h
The roapi.h that is included with the Windows 8.0 SDK mostly works under
plain C with one exception, so let people know the fix for that.  Note
that the Windows 8.1 and 10 SDKs contain copies of roapi.h that is
directly usable under plain C.
2021-03-31 21:48:52 +08:00
Chun-wei Fan
ce660066f2 gsocket.c: Declare variables at the top-of-block
This will allow the code to build on C89 compilers, since they do not
allow declaring a variable within a for loop initializer.
2021-03-31 21:48:52 +08:00
Chun-wei Fan
20bd716d4c option-context.c: Define NAN if not defined on MSVC
This will enable the build to succeed on older Visual Studio versions
that don't support NAN yet.  Other supported compilers should support
this.
2021-03-31 21:47:49 +08:00
Sebastian Dröge
d51c3b01fe Merge branch 'cherry-pick-e42aff25' into 'glib-2-68'
Backport MR !2016 (GIO W32: Pin gio DLL) into glib-2-68

See merge request GNOME/glib!2021
2021-03-31 06:25:09 +00:00
Philip Withnall
d4043d622a Merge branch 'gio-appinfo-thread-crash' into 'master'
GIO W32: Pin gio DLL

Closes #2300 and #2359

See merge request GNOME/glib!2016

(cherry picked from commit e42aff259223af6213ccb91b1453d2363f782a22)

f701d6c4 GIO W32: Pin gio DLL
03b574ae Don't leak a handle from _g_io_win32_get_module()
2021-03-31 02:55:28 +00:00
Sebastian Dröge
d84fbe0ee9 Merge branch 'backport-2009-key-file-locale-caching-glib-2-68' into 'glib-2-68'
Backport !2009 “gkeyfile: Fix crash when parsing translations on a second load” to glib-2-68

See merge request GNOME/glib!2010
2021-03-23 17:15:44 +00:00
Philip Withnall
77649d3d3d gkeyfile: Fix crash when parsing translations on a second load
If the same `GKeyFile` is reused to load multiple different key files,
any loads after the first which encounter translated keys will crash,
because clearing the data from the first load cleared the cached
language names, but didn’t clear `checked_locales`, so they were never
reloaded.

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

Fixes: #2361
2021-03-23 16:56:33 +00:00
Philip Withnall
07ab2e26c9 gkeyfile: Drop a redundant check
It should not be possible for `->locales` to be set without
`->checked_locales` being set, so drop the redundant check. This helps
with branch code coverage.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-03-23 16:56:33 +00:00
Sebastian Dröge
76b3b72621 Merge branch 'backport-1996-ghost-utils-includes-glib-2-68' into 'glib-2-68'
Backport !1996 “Include glibconfig.h to get the G_OS_UNIX token” to glib-2-68

See merge request GNOME/glib!1997
2021-03-19 07:40:23 +00:00
Andy Fiddaman
08f2ed7535 Include glibconfig.h to get the G_OS_UNIX token 2021-03-18 19:42:18 +00:00
Philip Withnall
a58a47fd6d 2.68.0
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2.68.0
2021-03-18 13:27:26 +00:00
Matej Urbančič
840d50b8d8 Update Slovenian translation 2021-03-17 17:44:17 +00:00
Sebastian Dröge
c53711492c Merge branch 'coverity-localfileoutputstream-error-handling' into 'master'
glocalfileoutputstream: Tidy up error handling

See merge request GNOME/glib!1994
2021-03-17 07:43:03 +00:00
Philip Withnall
2696384e0e Merge branch 'mcatanzaro/queue' into 'master'
tests: Fix copy/paste error in queue test

See merge request GNOME/glib!1995
2021-03-16 18:11:55 +00:00