20820 Commits

Author SHA1 Message Date
Alan Coopersmith
8e49fba3f3 gunixmounts: Handle Solaris name of mnt_mntopts in place of mnt_opts
Fixes build failure:
../gio/gunixmounts.c: In function ‘_g_get_unix_mounts’:
../gio/gunixmounts.c:742:53: error: ‘struct mnttab’ has no member named ‘mnt_opts’; did you mean ‘mnt_mntopts’?
  742 |                                              mntent.mnt_opts,
      |                                                     ^~~~~~~~
      |                                                     mnt_mntopts

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-10-07 19:13:59 +01:00
Christoph Reiter
e605f779ab Merge branch 'backport-1152-winhttpvfs-prgname-glib-2-62' into 'glib-2-62'
Backport !1152 “gwinhttpvfs: Handle g_get_prgname() returning NULL” to glib-2-62

See merge request GNOME/glib!1154
2019-10-07 16:26:29 +00:00
Christoph Reiter
32fe7ad936 gwinhttpvfs: Handle g_get_prgname() returning NULL
When prgname wasn't set NULL would be passed to g_utf8_to_utf16()
resulting in "g_utf8_to_utf16: assertion 'str != NULL' failed"
2019-10-07 10:05:31 +01:00
Philip Withnall
2a0e33360d 2.62.1
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2.62.1
2019-10-04 12:41:16 +01:00
Ondrej Holy
43530c09dd Merge branch 'backport-1134-file-copy-fix-glib-2-62' into 'glib-2-62'
Backport !1134 Fix for file copy permissions to glib-2-62

See merge request GNOME/glib!1142
2019-10-03 06:36:33 +00:00
Philip Withnall
3b3e3cad4c Merge branch 'cherry-pick-42d8e177' into 'glib-2-62'
[2.62] Always build tests if we enabled installed-tests

See merge request GNOME/glib!1141
2019-10-02 15:55:30 +00:00
Philip Withnall
56e244ecdf gfile: Don’t copy files as private if using default permissions
If a copy operation is started with `G_FILE_COPY_TARGET_DEFAULT_PERMS`,
don’t create the destination file as private. Instead, create it with
the process’ current umask (i.e. ‘default permissions’).

This is a partial re-work of commit d8f8f4d637ce43f8699ba94c9b, with
input from Ondrej Holy.

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

Fixes: #174
2019-10-02 16:42:40 +01:00
Philip Withnall
1b6d8e58b2 gfile: Factor out flags when copying files
This introduces no functional changes; just reduces duplication in the
code a little.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-10-02 16:42:40 +01:00
Sebastian Dröge
ab2d85ebfd Merge branch 'cherry-pick-14609b0b' into 'glib-2-62'
[2.62] g_file_info_get_modification_date_time: Calculate in integer domain

See merge request GNOME/glib!1140
2019-10-02 10:10:30 +00:00
Simon McVittie
db46306b47 Always build tests if we enabled installed-tests
If we're cross-compiling, the installed-tests are useful even if we
can't run them on the build machine: we can copy them to the host
machine (possibly via a distro package like Debian's libglib2.0-tests)
and run them there.

While I'm changing the build-tests condition anyway, deduplicate it.

Based on a patch by Helmut Grohne.

Bug-Debian: https://bugs.debian.org/941509
Signed-off-by: Simon McVittie <smcv@collabora.com>


(cherry picked from commit 42d8e17795254ed1590241347b34d19479b9b575)
2019-10-02 08:57:36 +00:00
Simon McVittie
5625760f12 g_file_info_get_modification_date_time: Calculate in integer domain
g_date_time_add_seconds() and g_date_time_add_full() use floating-point
seconds, which can result in the value varying slightly from what's
actually on disk. This causes intermittent test failures in
gio/tests/g-file-info.c on Debian i386, where we set a file's mtime
to be 50µs later, then read it back and sometimes find that it is only
49µs later than the previous value.

I've only seen this happen on i386, which means it might be to do with
different floating-point rounding when a value is stored in the 80-bit
legacy floating point registers rather than in double precision.

g_date_time_add() takes a GTimeSpan, which is in microseconds;
conveniently, that's exactly what we get from the GFileInfo.

Bug-Debian: https://bugs.debian.org/941547
Signed-off-by: Simon McVittie <smcv@collabora.com>


(cherry picked from commit 14609b0b256b9c13162719868d4dfc2b419d885f)
2019-10-02 08:56:14 +00:00
Ask Hjorth Larsen
514880671c Updated Danish translation 2019-10-02 05:54:08 +02:00
Sebastian Dröge
2de58d25b3 Merge branch 'backport-1125-date-time-error-handling-again-glib-2-62' into 'glib-2-62'
Backport !1125 and !1115 GDateTime parsing fixes to glib-2-62

See merge request GNOME/glib!1127
2019-09-26 08:17:35 +00:00
Sebastian Dröge
ed8c69eb03 Merge branch 'backport-1043-variant-bytes-glib-2-62' into 'glib-2-62'
Backport !1043 “gvariant: Handle empty serialisations in get_child_value()” to glib-2-62

See merge request GNOME/glib!1128
2019-09-26 07:57:40 +00:00
Philip Withnall
f2d9f16e61 gvariant: Handle empty serialisations in get_child_value()
When g_variant_get_child_value() is called for a child whose
serialisation is an empty byte string (which is possible), `bytes_data`
will be non-`NULL`, but `data` may be `NULL`. This results in a negative
offset being passed to `g_bytes_new_from_bytes()`, and a critical
warning.

So if `data` is `NULL`, set it to point to `bytes_data` so the offset is
calculated as zero. The actual value of the offset doesn’t matter, since
in this situation the size is always zero. An offset of zero is never
going to cause problems.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Fixes: #1865
2019-09-25 14:49:59 +01:00
Philip Withnall
7b393fce31 gdatetime: Fix error handling in g_date_time_new_week()
It was possible to pass in (for example) an invalid year to
g_date_time_new_week(), which would be passed on to g_date_time_new(),
which would (correctly) return `NULL` — but then
g_date_time_get_week_number() would try to dereference that.

Includes a test case.

oss-fuzz#17648

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-09-25 14:45:25 +01:00
Philip Withnall
c39f1b6e69 gdatetime: Fix error handling in g_date_time_new_ordinal()
It was possible to pass in (for example) an invalid hour to
g_date_time_new_ordinal(), which would be passed on to
g_date_time_new(), which would (correctly) return `NULL` — but then
g_date_time_new_ordinal() would try to dereference that.

Includes some test cases.

oss-fuzz#16103
oss-fuzz#17183

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-09-25 14:45:21 +01:00
Philip Withnall
58f12912a9 Merge branch 'gobject-tutorial-no-priv-2-60' into 'glib-2-62'
docs: Remove priv pointers from the tutorial example

See merge request GNOME/glib!1021
2019-09-20 10:17:23 +00:00
Emmanuele Bassi
ad58fee969 docs: Remove priv pointers from the tutorial example
We define `ViewerFile` as a final type with fields directly in the
instance structure. This means we don't have a `priv` pointer to
dereference.
2019-09-20 11:40:33 +02:00
Марко Костић
c8abd972d7 Update Serbian translation 2019-09-15 09:02:03 +00:00
Sebastian Dröge
e2e51082be Merge branch 'backport-1085-xdgmime-glib-2-62' into 'glib-2-62'
Backport !1085 “xdgmime: Prevent infinite loops from badly-formed MIME registrations” to glib-2-62

See merge request GNOME/glib!1103
2019-09-13 13:58:26 +00:00
Philip Withnall
a105470155 xdgmime: Prevent infinite loops from badly-formed MIME registrations
Signed-off-by: Philip Withnall <withnall@endlessm.com>

Closes: #1875
2019-09-13 14:16:40 +01:00
Sebastian Dröge
90bafcf586 Merge branch 'backport-1080-mkdir-with-parents-test-fix-glib-2-62' into 'glib-2-62'
Backport !1080 “tests: Fix skipping mkdir-with-parents-permission test” to glib-2-62

See merge request GNOME/glib!1102
2019-09-13 12:00:41 +00:00
Sebastian Dröge
a194ee212e Merge branch 'backport-1092-win32-doc-build-glib-2-62' into 'glib-2-62'
Backport !1092 “Fix doc build on Windows” to glib-2-62

See merge request GNOME/glib!1101
2019-09-13 11:27:06 +00:00
Philip Withnall
62eb3bc3b6 tests: Fix skipping mkdir-with-parents-permission test
If the user has `CAP_DAC_OVERRIDE` or similar (for example, if running
the tests as root), the `mkdir-with-parents-permission` test is skipped.

The check for `CAP_DAC_OVERRIDE` was by creating a subdirectory of the
test directory. That subdirectory, however, was never removed, which
caused a ‘directory not empty’ error when trying to delete the test
directory.

Fix that by correctly deleting the subdirectory if skipping the test.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-09-13 11:39:39 +01:00
Xavier Claessens
c89a8efe1a Fix doc build on Windows
This is a work around for this Meson bug:
https://github.com/mesonbuild/meson/issues/5893

Closes: #1888
2019-09-13 11:38:37 +01:00
Milo Casagrande
0698d561f3 Update Italian translation 2019-09-10 06:51:39 +00:00
A S Alam
e75a6b546f Update Punjabi translation 2019-09-09 05:41:25 +00:00
Nirbheek Chauhan
c99607c43a Merge branch 'glib-2-62-fix-gmodule-macos' into 'glib-2-62'
Backport to 2.62: gmodule: use dl implementation on macOS

See merge request GNOME/glib!1094
2019-09-08 00:59:16 +00:00
Tom Schoonjans
e9ba9bf80f gmodule: write test for shared libraries 2019-09-07 19:13:55 +03:00
Tom Schoonjans
a18a4a6bee gmodule: use dl implementation on macOS
Closes #1887
2019-09-07 19:13:55 +03:00
Emin Tufan Çetin
13090a22fd Update Turkish translation 2019-09-07 13:37:59 +00:00
Philip Withnall
a1af0be78c 2.62.0
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2.62.0
2019-09-05 17:54:38 +01:00
Philip Withnall
fcae793cb1 Merge branch 'wip/chergert/fix-modification-date-time' into 'master'
fileinfo: ignore USEC if not available

See merge request GNOME/glib!1087
2019-09-05 16:41:44 +00:00
Philip Withnall
475b9b5f7c tests: Add tests for GFileInfo modification time
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-09-05 17:13:08 +01:00
Philip Withnall
b99cdf56dc tests: Use g_assert_*() rather than g_assert() in g-file-info test
They provide more detailed failure messages, and aren’t compiled out
when building with `G_DISABLE_ASSERT`.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-09-05 17:13:08 +01:00
Christian Hergert
b933b0f369 fileinfo: ignore USEC if not available
When future porting deprecated code to use
g_file_info_get_modification_date_time() we risk a number of breakages
because the current implementation also requires the additional use of
G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC. This handles that situation gracefully
and returns a GDateTime with less precision.

Applications that want the additional precision, are already using the
additional attribute.

(Minor tweaks by Philip Withnall.)
2019-09-05 17:13:08 +01:00
Rafael Fontenelle
7a33239bab Update Brazilian Portuguese translation 2019-09-05 05:26:09 +00:00
Philip Withnall
8c9bf7f741 Merge branch 'gobject_init-suppression' into 'master'
glib.supp: make gobject_init() calloc also of the possible kind

See merge request GNOME/glib!1086
2019-09-04 18:24:22 +00:00
Claudio Saavedra
9cc863e59a glib.supp: make gobject_init() calloc also of the possible kind
It's currently marked only as reachable but Valgrind also finds it as
possible:

==18842== 96 bytes in 1 blocks are possibly lost in loss record 2,029 of 2,284
==18842==    at 0x4837B65: calloc (vg_replace_malloc.c:762)
==18842==    by 0x49614AD: g_malloc0 (gmem.c:129)
==18842==    by 0x4A7013B: type_node_any_new_W (gtype.c:439)
==18842==    by 0x4A70609: type_node_fundamental_new_W (gtype.c:550)
==18842==    by 0x4A7855A: gobject_init (gtype.c:4406)
==18842==    by 0x4A78672: gobject_init_ctor (gtype.c:4493)
2019-09-04 16:36:39 +03:00
Fabio Tomat
ef47ecd665 Update Friulian translation 2019-09-03 09:13:57 +00:00
Philip Withnall
3e6fe8cd27 Merge branch 'fix-sizeof-check' into 'master'
garray: Fix reference to GLIB_SIZEOF_INT

See merge request GNOME/glib!1084
2019-09-02 15:17:23 +00:00
Alexander Larsson
4f5a2c19e4 garray: Fix reference to GLIB_SIZEOF_INT
This doesn't ever get set. SIZEOF_INT is set though, so use that instead.
2019-09-02 16:05:07 +02:00
Sebastian Dröge
daa308dd6e Merge branch '487-ci-memcheck' into 'master'
Add CI job for running tests under Valgrind

Closes #487

See merge request GNOME/glib!169
2019-09-02 13:52:35 +00:00
Philip Withnall
39052a1cfc tests: Fix some minor memory leaks in tests
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-09-02 14:16:33 +01:00
Philip Withnall
8ae07a727a glib.supp: Add some fundamental type suppressions
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-09-02 14:16:33 +01:00
Philip Withnall
c8c75dc7ad glib.supp: Fix some indentation
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-09-02 14:16:33 +01:00
Philip Withnall
adb9264d12 glib.supp: Add leak types
Mark all the memcheck leaks as ‘reachable’, so the suppressions will not
apply if that memory is no longer reachable on exit(). This feature was
introduced in Valgrind 3.9, and is documented here:

http://valgrind.org/docs/manual/mc-manual.html#mc-manual.suppfiles

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-09-02 14:16:33 +01:00
Philip Withnall
a6ecfeea4c tests: Don’t run Python tests under Valgrind
The Python runtime is not amenable to Valgrind, and leak checking is a
lot less relevant in Python compared to C.

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

Helps: #487
2019-09-02 14:16:33 +01:00
Philip Withnall
0cc745f6cb ci: Include stderr output in JUnit XML report
When running tests under valgrind, the valgrind summary is printed in
stderr, and the TAP output is printed in stdout. The valgrind summary is
useful to include in the GitLab test report, so append it to the
textual failure information for failed tests.

I can’t find a better XML element in the [JUnit
schema](https://github.com/windyroad/JUnit-Schema/blob/master/JUnit.xsd)
for representing it.

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

Helps: #487
2019-09-02 14:16:33 +01:00