Commit Graph

19042 Commits

Author SHA1 Message Date
Philip Withnall
61a348f287 glocalfile: Only ignore FS full information for FUSE and ncpfs
Previously, glocalfile.c would not set file system metadata for
the free/used key for file systems which reported 0 free space. This is
because some file systems don’t set that metadata when you call
statfs(), so we can’t reliably report it. However, some do, and they
can legitimately set f_bavail and f_bfree to 0 if the file system is
full.

In order to avoid that, always set the file system metadata unless the
file system is FUSE or ncpfs.

This is a partial revert of commit 0b9f24c1e1: instead of the changes
made in that commit, I think we should maintain a blacklist of file
systems which are known to not correctly report free space.

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

https://gitlab.gnome.org/GNOME/glib/issues/328
2018-08-17 12:41:20 +01:00
Rafael Fontenelle
d1618c93fa Update Brazilian Portuguese translation 2018-08-17 08:30:15 +00:00
Matthias Clasen
76419d7d7d Merge branch 'network-monitor-fix' into 'master'
network monitor portal: update properties initially

See merge request GNOME/glib!248
2018-08-16 23:31:57 +00:00
Matthias Clasen
18997de7e9 network monitor portal: update properties initially
With version 2, we need to query the values explicitly.
The properties made this automatic.
2018-08-16 21:36:13 +00:00
Philip Withnall
1a30a6a1d0 Merge branch 'fix-gdbus-unix-address' into 'master'
Fix failing tests when G_MESSAGES_DEBUG is set (again)

See merge request GNOME/glib!247
2018-08-16 21:27:47 +00:00
Xavier Claessens
9a3c7eca14 Merge branch '1444-install-tests' into 'master'
Resolve "the meson build doesn't support installed tests"

Closes #1444

See merge request GNOME/glib!245
2018-08-16 20:01:06 +00:00
Xavier Claessens
9f208e9f2b Fix failing tests when G_MESSAGES_DEBUG is set (again)
Similar issue was fixed with commit f929d148, but it's happening again.
Define G_MESSAGES_DEBUG=all when running CI to ensure we won't regress
anymore.
2018-08-16 15:55:51 -04:00
Xavier Claessens
c908ce8f8c Meson: install gio tests 2018-08-16 10:53:31 -04:00
Philip Withnall
faa383936e Merge branch '1454-gvdb-corruption' into 'master'
gvdb: Fix error handling in gvdb_table_new()

Closes #1454

See merge request GNOME/glib!214
2018-08-16 14:52:50 +00:00
Matthias Clasen
3664b017e3 Merge branch '1488-o-cloexec-again' into 'master'
gspawn: Use fcntl() to work around systems which don’t support O_CLOEXEC

Closes #1488

See merge request GNOME/glib!242
2018-08-16 12:31:27 +00:00
Philip Withnall
59a23bf24d gclosure: Minor documentation formatting improvements
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-08-16 10:59:45 +01:00
Philip Withnall
5b7c109e1c gclosure: Clarify when destroy notifiers are called in documentation
They’re called in finalize, not invalidate.

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

https://gitlab.gnome.org/GNOME/glib/issues/277
2018-08-16 10:58:43 +01:00
Philip Withnall
ed6903f6fb Merge branch 'bindung-unbind-fix' into 'master'
g_binding_unbind: make it more introspection friendly; allow calling it multiple times. Fixes #1373

Closes #1373

See merge request GNOME/glib!244
2018-08-16 09:38:04 +00:00
Christoph Reiter
0319dac01d g_binding_unbind: make it more introspection friendly; allow calling it multiple times. Fixes #1373
g_object_bind_property() (transfer none) returns a GBinding with an existing internal
reference which is active as long as the "binding" is. This allows to optionally use
the binding without any memory management, as it will remove itself when it is no longer
needed.

There are currently three ways to remove the "binding" and as a result the reference:

1) Either the source or target dies and we get notified by a weakref callback
2) The user unrefs the binding until it is destroyed (which is semi-legal,
   but worked and is used in the test suite)
3) The user calls g_binding_unbind()

In case (3) the problem was that it always calls unref even if the "binding" is already
gone, leading to crashes when called from bindings multiple times.
In #1373 and !197 it was noticed that a function always unrefs which would be a
"transfer full" annotation, but the problem here is that it should only remove the
ref when removing the "binding" and the annotation should stay "transfer none".

As a side effect of this fix it is now also possible to call g_binding_unbind() multiple
times where every call after the first is a no-op.

This also adds explicit tests for case (1) and (3) - only case (3) is affected by this change.
2018-08-16 11:27:34 +02:00
Xavier Claessens
44228dbc3c Meson: install gobject tests 2018-08-15 09:45:06 -04:00
Mario Blättermann
9eb483b82d Update German translation 2018-08-15 12:54:14 +00:00
Ondrej Holy
4a77dd6799 Merge branch 'fix-overlayfs-trashing-1027' into 'master'
Fix trashing on overlayfs

Closes #1027

See merge request GNOME/glib!182
2018-08-13 18:01:31 +00:00
Iain Lane
1152d99ded Fix trashing on overlayfs
In order to determine whether to trash a file to the home directory, we
compare its st_dev to our home directory's st_dev field.

This is the wrong thing to do on overlayfs when deleting files, because
st_dev contains the ID of the filesystem providing the file (which can
be the lower or upper filesystem), but directories always return the ID
of the overlayfs. Thus the comparison fails and we are unable to trash
the file.

Fix this by checking st_dev of the parent directory when we are deleting
a file.

Also adjust `test_trash_not_supported` for this - make its st_dev check
look at the parent directory's `st_dev` rather than the temporary file's
own.

Fixes #1027.
2018-08-13 17:41:59 +01:00
Iain Lane
93f3cb7c6d Revert "glocalfile: Check that parent device is the same when trashing"
This reverts commit 15cdcd2e0b.
2018-08-13 17:23:21 +01:00
Philip Withnall
614adf8a75 gvdb: Fix error handling in gvdb_table_new()
The documentation was unclear about what error codes would be returned
on attempting to open an empty or corrupt GVDB file. Previous versions
of the documentation incorrectly said that corrupt GVDB files were
considered equivalent to empty ones.

A recent commit has clarified the documentation to include its error
handling behaviour.

Update the two users of GVDB within GLib, GResource and GSettingsSource,
to follow this change, and add unit tests for them both.

Other users of the GVDB copylib will need to update their copy and make
appropriate changes if they have bugs in their handling of this
situation. dconf is one example of this. GVDB should be updated from
https://gitlab.gnome.org/GNOME/gvdb.

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

https://gitlab.gnome.org/GNOME/glib/issues/1454
2018-08-13 15:38:34 +01:00
Philip Withnall
c652d45c97 gsettingsschema: Port to new GVDB API
This should introduce no functional changes.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-08-13 15:37:05 +01:00
Philip Withnall
705dd2b9a9 gresource: Port to new GVDB API
This should introduce no functional changes.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-08-13 15:37:05 +01:00
Philip Withnall
ce86a3aed7 glib-compile-schemas: Fix a minor memory leak
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-08-13 15:37:05 +01:00
Philip Withnall
c9834f234d Merge remote-tracking branch 'gvdb/master' into update-gvdb
Minor merge conflicts in gvdb-reader.c with the documentation.
2018-08-13 15:35:52 +01:00
Philip Withnall
57962aac85 docs: Clarify error values for empty files when loading
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-08-13 14:34:19 +01:00
Philip Withnall
d2f0461ec0 docs: Use ‘Returns:’ instead of the invalid ‘@returns’
This is based on the commit 59a24ab5a3 in GLib.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-08-13 14:34:19 +01:00
Philip Withnall
c78664e101 Update FSF’s address
(This is based on commit 892fc2e4 from dconf.)

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-08-13 14:34:19 +01:00
Sébastien Wilmet
4763db8a4c gio/gvdb/: LGPLv2+ -> LGPLv2.1+
https://bugzilla.gnome.org/show_bug.cgi?id=776504
2018-08-13 14:34:19 +01:00
Philip Withnall
7fd9f61dbd Avoid calling Standard C string/array functions with NULL arguments
glibc string.h declares memcpy() with attribute(nonnull(1,2)), causing
calls with NULL arguments to be treated as undefined behaviour.
This is consistent with ISO C99 and C11, which state that passing 0
to string functions as an array length does not remove the requirement
that the pointer to the array is a valid pointer.
gcc -fsanitize=undefined catches this while running OSTree's test suite.

Similarly, running the GLib test suite reports similar issues for
qsort(), memmove(), memcmp().

(This is a partial cherry-pick of commit e5ed410c8c from GLib.)

Signed-off-by: Simon McVittie <smcv@debian.org>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=775510
Reviewed-by: Colin Walters
2018-08-13 14:34:19 +01:00
Philip Withnall
355228121e doap: Update maintainers list to synchronise with GLib
GVDB is essentially part of GLib, so should have the same maintainer
list.

At least this way, it’s not just maintained by one absentee maintainer.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-08-13 14:29:51 +01:00
Arnaud B
438547641f Fix indicative gschema.dtd regarding range.
The range can have only a "min" or only a "max" attribute, and can even have no attributes at all.
2018-08-13 08:19:57 +00:00
Claude Paroz
ef45c909db Update French translation 2018-08-12 19:03:17 +00:00
Emmanuele Bassi
e49f9c9cd7 Merge branch '225-iso-8601-test-tz' into 'master'
tests: Explicitly set TZ=UTC for g_time_val_from_iso8601() testing

See merge request GNOME/glib!243
2018-08-12 11:55:08 +00:00
Emin Tufan Çetin
e98401f90f Update Turkish translation 2018-08-12 10:20:09 +00:00
Piotr Drąg
ae6439c83a Update Polish translation 2018-08-12 01:21:05 +02:00
Philip Withnall
f92359b593 Merge branch 'wjt/glib-mkenums-filename-basename-in-fhead-ftail' into 'master'
glib-mkenums: forbid @filename@/@basename@ in fhead and ftail

See merge request GNOME/glib!241
2018-08-11 21:25:05 +00:00
Philip Withnall
b1bfebc61c tests: Explicitly set TZ=UTC for g_time_val_from_iso8601() testing
Some of the test vectors don’t specify a timezone, so the local one is
used; the comparisons to the expected results (which are in UTC) then
fail.

See discussion in
https://gitlab.gnome.org/GNOME/glib/merge_requests/225.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-08-11 22:00:52 +01:00
Philip Withnall
4afe429d7c gspawn: Use fcntl() to work around systems which don’t support O_CLOEXEC
Somehow, we are still limping along with partial support for OS X
<10.7.

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

https://gitlab.gnome.org/GNOME/glib/issues/1488
2018-08-11 21:52:17 +01:00
Will Thompson
de62a95d5e
glib-mkenums: improve and correct argument documentation
ftail is not per-input-file, it is the footer for the entire output
file.

You cannot have fewer informations.
2018-08-10 17:18:36 +01:00
Will Thompson
7928fee2a8
glib-mkenums: don't support @filename@/@basename@ in fhead/ftail
As discussed in
https://gitlab.gnome.org/GNOME/glib/merge_requests/135#note_253986 it
doesn't really make sense to support these outside the templates for any
particular header file. Leave them unsubstituted, with a warning.
2018-08-10 17:05:59 +01:00
Will Thompson
cbd335c8c9
tests: mkenums: placate flake8 2018-08-10 17:05:59 +01:00
Will Thompson
12a2a984f2
tests: refactor running glib-mkenums
Part of runMkenumsWithHeader() was duplicated in test_reproducible(),
and would otherwise need to be duplicated again in upcoming tests.  Many
places duplicated decoding stdout/stderr and checking the exit code.

Introduce a named tuple for the returned fields; and factor out writing
a template file to pass with --template.
2018-08-10 17:05:59 +01:00
Xavier Claessens
cce309aebb Merge branch 'ossfuzz-9815-time-signed-arithmetic' into 'master'
gtimer: Ensure arithmetic is correctly signed for ISO 8601 parsing

See merge request GNOME/glib!240
2018-08-10 13:35:36 +00:00
Philip Withnall
8c844291b7 gtimer: Ensure arithmetic is correctly signed for ISO 8601 parsing
When calculating the value of a timezone offset, ensure that any offsets
done with negative numbers are done in a signed integer.

oss-fuzz#9815

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-08-10 10:43:37 +01:00
Philip Withnall
a9108f8bfd gvariant: Fix more bounds checking in GVariant text format parser
token_stream_prepare() was over-reading at the start of bytestring
literals (`b'blah'`).

Add tests for that, and for some other situations regarding bytestring
literal parsing, in order to try and get full branch coverage of that
bit of code.

oss-fuzz#9805

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-08-10 10:30:13 +01:00
Emmanuele Bassi
0d271223d8 Merge branch '1481-variant-parse-overflow' into 'master'
gvariant: Fix bounds checking in GVariant text format parser

Closes #1481

See merge request GNOME/glib!236
2018-08-09 10:25:48 +00:00
LRN
8defa46e6e Merge branch 'issue-1452' into 'master'
Issue 1452

Closes #1452

See merge request GNOME/glib!235
2018-08-09 00:25:05 +00:00
Philip Withnall
10ee7301e8 gvariant: Fix bounds checking in GVariant text format parser
The token_stream_peek() functions were not doing any bounds checking, so
could potentially read 1 byte off the end of the input blob. This was
never noticed, since the input stream is almost always a nul-terminated
string. However, g_variant_parse() does allow non-nul-terminated strings
to be used with a @limit parameter, and the bugs become apparent under
valgrind if that parameter is used.

This includes modifications to the test cases to cover the
non-nul-terminated case.

Spotted by ossfuzz.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-08-09 01:08:46 +01:00
Руслан Ижбулатов
075bb0f751 W32: consider NTFS mounpoints to be symlinks
While mountpoints are *not* symlinks, strictly speaking,
they works in a similar enough way, so consider them to be
symlinks for the purpose of querying local file info.
2018-08-08 23:41:07 +00:00
Руслан Ижбулатов
929844fdf7 W32: correctly use st_ctime
On Windows st_ctime field is the file creation time.
POSIX mandates that field to be the file state change time.
Naturally, glib code interpreted st_ctime as POSIX suggested,
and the result was bad.
Fix this by introducing special W32-only logic for setting
attributes from st_ctime field.

Fixes issue #1452.
2018-08-08 23:41:02 +00:00