Commit Graph

23429 Commits

Author SHA1 Message Date
Michael Catanzaro
3a74ad128e tests: Fix copy/paste error in queue test
Coverity is pretty good at detecting copy/paste errors.
2021-03-16 12:53:44 -05:00
Philip Withnall
c4b4fecaef glocalfileoutputstream: Tidy up error handling
After the recent reworking of this code it was possible for `g_close()`
to be called on `fd == -1`, which is invalid. It would have reported an
error, were errors not ignored. So it was harmless, but still best to
fix.

Simplify the error handling by combining both error labels and checking
the state of `fd` dynamically.

Coverity CID: #1450834

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-03-16 11:36:27 +00:00
Milo Casagrande
01101813a5 Update Italian translation 2021-03-15 08:06:09 +00:00
Philip Withnall
4784da5047 Merge branch 'valgrind-updates' into 'master'
glib.supp: Generalize some suppressions

See merge request GNOME/glib!1989
2021-03-14 17:18:57 +00:00
Sebastian Dröge
094206f1eb Merge branch 'bytes-icon-docs' into 'master'
gbytesicon: Fix error in g_bytes_icon_new() documentation

See merge request GNOME/glib!1992
2021-03-14 16:20:12 +00:00
Philip Withnall
d26d70d66a gbytesicon: Fix error in g_bytes_icon_new() documentation
It said that `NULL` could be returned, but actually `g_bytes_icon_new()`
can never fail.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-03-14 15:53:24 +00:00
Aurimas Černius
7bd4a2b146 Updated Lithuanian translation 2021-03-14 12:30:22 +02:00
Piotr Drąg
1a1824ce6e Update Polish translation 2021-03-13 19:40:16 +01:00
Jiri Grönroos
e31936eeaf Update Finnish translation 2021-03-13 12:38:43 +00:00
Marek Černocký
cc060c6cb9 Updated Czech translation 2021-03-13 11:50:53 +01:00
Daniel Șerbănescu
366d5e1fdf Update Romanian translation 2021-03-13 10:49:59 +00:00
Changwoo Ryu
68fccd6559 Update Korean translation 2021-03-13 06:15:27 +00:00
Philip Chimento
ad96f02bdb glib.supp: Generalize some suppressions
Some versions of compilers inline gobject_init_ctor() and
type_class_init_Wm(), so the existing suppression rules would no longer
match. Try to generalize them to handle these cases.
2021-03-12 15:41:28 -08:00
Sebastian Dröge
986694d7b2 Merge branch 'gconstructor-fix' into 'master'
build: Drop gconstructor_as_data_h usage from glib-compile-schemas

See merge request GNOME/glib!1987
2021-03-12 13:06:41 +00:00
Philip Withnall
39ecc25383 build: Drop gconstructor_as_data_h usage from glib-compile-schemas
The variable `gconstructor_code` (which is what’s defined by
`gconstructor_as_data_h`) is not used at all inside
`glib-compile-schemas`.

This looks like a copy/paste error from the build definition for
`glib-compile-resources` below, which does need it.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-03-12 12:42:17 +00:00
Sabri Ünal
e85c4a550f Update Turkish translation 2021-03-11 20:20:44 +00:00
Philip Withnall
dec66d325f docs: Add a policy for handling security issues
This also gives details of how to report a security issue, including the
key point that merge requests are (unfortunately) not confidential.

Heavily based on the flatpak security policy which just landed:
https://github.com/flatpak/flatpak/blob/master/SECURITY.md

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-03-11 17:38:51 +00:00
Philip Withnall
b3384e5797 2.67.6
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-03-11 16:52:09 +00:00
Hugo Carvalho
cdfa8a627d Update Portuguese translation 2021-03-11 14:48:08 +00:00
Emmanuele Bassi
327ea4e30d Merge branch '2327-mkenums-version-macros' into 'master'
glib-mkenums: Parse and skip deprecation/availability annotations

Closes #2327

See merge request GNOME/glib!1984
2021-03-11 14:40:57 +00:00
Fran Dieguez
f1b2909e04 Update Galician translation 2021-03-11 14:21:56 +00:00
Philip Withnall
c92d9dc267 enums: Add missing GLIB_AVAILABLE_ENUMERATOR_IN_2_68 annotations
In the 2.68 cycle we’d added 3 new enumerator elements. Due to the
preceding commit, they can now be annotated with
`GLIB_AVAILABLE_ENUMERATOR_IN_2_68`, which will make it a bit easier for
third party projects to notice when they’re using these symbols without
having bumped their GLib dependency.

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

Fixes: #2327
2021-03-11 13:37:49 +00:00
Philip Withnall
856aeba9e4 glib-mkenums: Parse and skip deprecation/availability annotations
Teach `glib-mkenums` how to parse and ignore:
 - `GLIB_AVAILABLE_ENUMERATOR_IN_x_xx`
 - `GLIB_DEPRECATED_ENUMERATOR_IN_x_xx`
 - `GLIB_DEPRECATED_ENUMERATOR_IN_x_xx_FOR(x)`

Future work could expose the deprecation/availability information as
substitutions in the template file, but this commit does not do that.

It does, however, add some unit tests for the annotations.

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

Fixes: #2327
2021-03-11 13:37:49 +00:00
Sebastian Dröge
db0ec9528e Merge branch '2328-file-new-empty-path' into 'master'
glocalvfs: Create a dummy file for g_file_new_for_path("")

Closes #2328

See merge request GNOME/glib!1983
2021-03-11 09:42:19 +00:00
Tim Sabsch
3cf65c4989 Update German translation 2021-03-10 19:57:52 +00:00
Guillaume Bernard
f041188bbd Update French translation 2021-03-10 19:41:52 +00:00
Philip Withnall
519bdf665b Merge branch 'work-out-libutil-soname-at-build-time' into 'master'
gio/tests/{meson.build,pollable.c}: Determine libutil SONAME at build time

See merge request GNOME/glib!1977
2021-03-10 19:35:18 +00:00
Asier Sarasua Garmendia
e72c235734 Update Basque translation 2021-03-10 19:10:57 +00:00
Philip Withnall
d52728f994 glocalvfs: Create a dummy file for g_file_new_for_path("")
`""` is not a valid path (`stat()` on it returns `ENOENT`). Previously,
a full `GLocalFile` was being created, which ended up resolving to
`$CWD`, through path canonicalisation. That isn’t right.

Fix it by creating a `GDummyFile` instead, and adding a unit test.

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

Fixes: #2328
2021-03-10 19:10:38 +00:00
Philip Withnall
628e1c5893 gdummyfile: Return NULL from get_basename() if no path is stored
Rather than returning a URI, which definitely won’t be a valid basename.

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

Helps: #2328
2021-03-10 19:10:04 +00:00
Philip Withnall
c80528f17b Merge branch '2325-symlink-replace-file' into 'master'
Resolve "file-roller symlink attack"

Closes #2325

See merge request GNOME/glib!1981
2021-03-10 18:42:33 +00:00
Iain Lane
373e46c2b2
gio/tests/{meson.build,pollable.c}: Determine libutil SONAME at build time
Calling `dlopen()` with `libutil.so` makes the installed tests depend on
having glibc's development files installed. To avoid this, we can work
out the runtime library name at build time and `dlopen` that instead.

This approach is [taken from libfprint][1], thanks to Marco Trevisan.

[1]: f401f399a8
2021-03-10 18:04:17 +00:00
Philip Withnall
8f57a5b9ad ci: Set localstatedir to the system directory on FreeBSD CI machines
These changes were missing from commit 62cc3158e9 and broke CI on
FreeBSD.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-03-10 17:55:51 +00:00
Philip Withnall
57a53ec964 gioerror: Add conversion from ENXIO to G_IO_ERROR_NOT_REGULAR_FILE
`ENXIO` can be returned from `open(2)` for special files (FIFOs, device
files and domain sockets) which are not backed by anything.

This fixes the error returned by `g_file_replace()` when trying to
replace such a file, so that it now matches the documentation.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-03-10 17:55:51 +00:00
Philip Withnall
730015a8ed tests: Add comprehensive tests for static behaviour of g_file_replace()
These test all the functionality and combinations of flags I can think
of. They do not cover dynamic behaviour (for example, what would happen
if the source file is deleted by another process part-way through a call
to `g_file_replace()`).

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-03-10 17:55:51 +00:00
Philip Withnall
ac505e88c4 glocalfileoutputstream: Add a missing O_CLOEXEC flag to replace()
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-03-10 17:55:51 +00:00
Philip Withnall
87e19535fe glocalfileoutputstream: Fix CREATE_REPLACE_DESTINATION with symlinks
The `G_FILE_CREATE_REPLACE_DESTINATION` flag is equivalent to unlinking
the destination file and re-creating it from scratch. That did
previously work, but in the process the code would call `open(O_CREAT)`
on the file. If the file was a dangling symlink, this would create the
destination file (empty). That’s not an intended side-effect, and has
security implications if the symlink is controlled by a lower-privileged
process.

Fix that by not opening the destination file if it’s a symlink, and
adjusting the rest of the code to cope with
 - the fact that `fd == -1` is not an error iff `is_symlink` is true,
 - and that `original_stat` will contain the `lstat()` results for the
   symlink now, rather than the `stat()` results for its target (again,
   iff `is_symlink` is true).

This means that the target of the dangling symlink is no longer created,
which was the bug. The symlink itself continues to be replaced (as
before) with the new file — this is the intended behaviour of
`g_file_replace()`.

The behaviour for non-symlink cases, or cases where the symlink was not
dangling, should be unchanged.

Includes a unit test.

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

Fixes: #2325
2021-03-10 17:55:51 +00:00
Philip Withnall
a5f1f1e47c glocalfileoutputstream: Factor out a flag check
This clarifies the code a little. It introduces no functional changes.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-03-10 16:05:55 +00:00
Philip Withnall
5f2eae1156 tests: Stop using g_test_bug_base() in file tests
Since a following commit is going to add a new test which references
Gitlab, so it’s best to move the URI bases inside the test cases.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-03-10 16:02:35 +00:00
Philip Withnall
d523ed4543 glocalfileoutputstream: Fix a typo in a comment
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-03-10 16:02:35 +00:00
Daniel Mustieles
098bd29fe7 Updated Spanish translation 2021-03-10 12:47:52 +01:00
Kukuh Syafaat
b3c00135b1 Update Indonesian translation 2021-03-10 10:12:46 +00:00
Balázs Úr
64473e7b80 Update Hungarian translation 2021-03-10 01:06:53 +00:00
Anders Jonsson
7ae5db749b Update Swedish translation 2021-03-09 21:27:18 +00:00
Jordi Mas
a882fd4fb0 Update Catalan translation 2021-03-09 20:16:30 +01:00
Yuri Chornoivan
bba0b7c7bd Update Ukrainian translation 2021-03-09 16:51:14 +00:00
Rafael Fontenelle
d811e7df73 Update Brazilian Portuguese translation 2021-03-09 15:13:34 +00:00
Sebastian Dröge
f5bb3c353d Merge branch 'suppressions' into 'master'
glib.supp: Add another system thread suppression

See merge request GNOME/glib!1980
2021-03-09 13:00:11 +00:00
Sebastian Dröge
0dc86cded2 Merge branch 'machine-id-test' into 'master'
Validate D-Bus machine ID after loading

See merge request GNOME/glib!1962
2021-03-09 12:49:51 +00:00
Sebastian Dröge
40573a8b8b Merge branch 'fix-glib-genmarshal-empty-output' into 'master'
glib-genmarshal: close output file

Closes #2341

See merge request GNOME/glib!1978
2021-03-09 12:47:22 +00:00