Commit Graph

5521 Commits

Author SHA1 Message Date
Matthias Clasen
8f2393b9b6 Whitespace fixup 2018-08-27 10:48:06 -04:00
Iñigo Martínez
64e9e1f482 gio: Provide schemas directory information in pkg-config file
GSettings XML schema files are installed in a well known directory
under Glib's installation directory: `glib-2.0/schemas`. However,
the Glib installation directory might vary, so the exact location of
the schema files might be unknown.

The information regarding this directory has been added to GIO's
pkg-config file, so it can be checked, and also overrided, by using
the command line utility.
2018-08-27 13:50:34 +02:00
Marco Trevisan (Treviño)
5cc4cca9c6 subprocess: Fix communicate_cancelled signature
The source callback for a GCancellable should have the cancellable itself
as first argument.
This was not the case, and when this code was hit, we were instead trying
to treat the pointer as a CommunicateState reference and thus wrongly
deferencing it, causing a memory error and a crash.
2018-08-24 06:05:03 +02:00
Ninja-Koala
0d685b4946
glib-compile-resources: encode data as string
Some Testing revealed encoding resource data with string
escape codes to compile significantly quicker compared
to the same data encoded as an array with hexadecimal numbers.
See #1489
2018-08-23 10:02:56 +02:00
Matthias Clasen
3c1902fcf9 Add a gnet utility
This is currently just a wrapper around GNetworkMonitor.
2018-08-23 02:59:28 +00:00
Philip Withnall
2df9d38635 build: Clean files left behind after gio/tests/gresource.c test
This is a follow-up to commit 614adf8a75,
which started generating two new files as part of the test; they need to
be cleaned up before distcheck will pass.

Ideally, the test should run a temporary directory and wipe that
directory itself before exiting, but that’s a bit of a big change to
make right now. Deferred to
https://gitlab.gnome.org/GNOME/glib/issues/1495.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-08-22 15:01:56 +01:00
Ting-Wei Lan
9147403893 gtestdbus: Fix watcher crash on FreeBSD
In file gio/gtestdbus.c, function watch_parent, there is a loop which
waits for commands sent from the parent process and kills all processes
recorded in 'pids_to_kill' array on parent process exit. The detection
of parent process exit is done by calling g_poll and checking whether
the returned event is G_IO_HUP. However, 'revents' is a bit mask, and
we should use a bitwise-AND check instead of the equality check here.

It seems to work fine on Linux, but it fails on FreeBSD because the
g_poll returns both G_IO_IN and G_IO_HUP on pipe close. This means the
watcher process continues waiting for commands after the parent process
exit, and g_io_channel_read_line returns G_IO_STATUS_EOF with 'command'
set to NULL. Then the watcher process crashes with segfault when calling
sscanf because 'command' is NULL. Since the test result is already
reported by the parent process as 'OK', this kind of crash is likely to
be unnoticed unless someone checks dmesg messages after the test:

pid 57611 (defaultvalue), uid 1001: exited on signal 11
pid 57935 (actions), uid 1001: exited on signal 11
pid 57945 (gdbus-bz627724), uid 1001: exited on signal 11
pid 57952 (gdbus-connection), uid 1001: exited on signal 11
pid 57970 (gdbus-connection-lo), uid 1001: exited on signal 11
pid 57976 (gdbus-connection-sl), uid 1001: exited on signal 11
pid 58039 (gdbus-exit-on-close), uid 1001: exited on signal 11
pid 58043 (gdbus-exit-on-close), uid 1001: exited on signal 11
pid 58047 (gdbus-exit-on-close), uid 1001: exited on signal 11
pid 58051 (gdbus-exit-on-close), uid 1001: exited on signal 11
pid 58055 (gdbus-export), uid 1001: exited on signal 11
pid 58059 (gdbus-introspection), uid 1001: exited on signal 11
pid 58065 (gdbus-names), uid 1001: exited on signal 11
pid 58071 (gdbus-proxy), uid 1001: exited on signal 11
pid 58079 (gdbus-proxy-threads), uid 1001: exited on signal 11
pid 58083 (gdbus-proxy-well-kn), uid 1001: exited on signal 11
pid 58091 (gdbus-test-codegen), uid 1001: exited on signal 11
pid 58095 (gdbus-threading), uid 1001: exited on signal 11
pid 58104 (gmenumodel), uid 1001: exited on signal 11
pid 58108 (gnotification), uid 1001: exited on signal 11
pid 58112 (gdbus-test-codegen-), uid 1001: exited on signal 11
pid 58116 (gapplication), uid 1001: exited on signal 11
pid 58132 (dbus-appinfo), uid 1001: exited on signal 11

If the watcher process crashes before killing the dbus-daemon process
spawned by the parent process, the dbus-daemon process will keep running
after all tests complete. Due to the implementation of 'communicate'
function in Python subprocess, it causes meson to crash. 'communicate'
assumes the stdout and stderr pipes are closed when the child process
exits, but it is not true if processes forked by the child process
doesn't exit. It causes Python subprocess 'communicate' function to
block on the call to poll until the timeout expires even if the test
finishes in a few seconds. Meson assumes the timeout exception always
means the test is still running. It calls 'communicate' again and
crashes because pipes no longer exist.

https://gitlab.gnome.org/Infrastructure/GitLab/issues/286
https://github.com/mesonbuild/meson/issues/3967
https://bugs.python.org/issue30154
2018-08-20 11:13:19 +01:00
Christoph Reiter
6b833bc2f1 tests: fix gnotification tests broken due to the recent icon name fallback changes
In !72 themed icons were changed to fall back to the symbolic variant.
The gnotification tests were still testing for the old list of names.
2018-08-19 20:04:41 +02:00
Matthias Clasen
dd3e565e94 Use an existing enum value
We have an enum for this, no need to hardcode numbers.
2018-08-18 20:16:03 -04:00
Philip Withnall
f876f4174f Merge branch 'master' into 'master'
gio: icons should fallback to non-preferred style appropriately.

See merge request GNOME/glib!72
2018-08-17 12:49:03 +00:00
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
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
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
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
Руслан Ижбулатов
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
Pavlo Solntsev
7e2dfa8c44 DOC: Documentation fix in GTask description 2018-08-08 00:17:15 -05:00
Michael Catanzaro
4536deb5af Add a new GTlsError to indicate protocol downgrade attacks
G_TLS_ERROR_MISC suffices, but it's nicer to have a new error here.
2018-08-07 08:20:03 -05:00
Philip Withnall
ab09a5f5a9 gdbusmessage: Fix a typo in the documentation
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-08-07 11:04:00 +01:00
Philip Withnall
a5f824451f Merge branch 'mcatanzaro/tls-docs' into 'master'
Update TLS documentation

See merge request GNOME/glib!199
2018-08-07 09:46:30 +00:00
Michael Catanzaro
08fe93589e Update documentation of g_tls_client_connection_set_use_ssl3()
We now send the fallback SCSV, meaning use of this function will cause
modern servers to immediately terminate the connection, so let's warn
API users to expect that behavior and be crystal clear that this
function should only be used as a fallback when a normal connection
attempt has already failed.

Also, the documentation is mostly duplicated between the property and
the function, so let's just reference the function documentation from
the property.
2018-08-04 16:33:28 -05:00
Christoph Reiter
99caee2819 build: only test for broken ip_mreq_source on Android. Fixes #1472
7efd76dd67 added these configure time tests to work around a bug
with older Android. Since the test didn't take Windows into account it
wrongfully applied the workaround on Windows too, breaking the build.
With meson this wasn't an issue since the check is skipped on Windows there
and our CI didn't catch this issue.

Change the test to run on Android only for meson and autotools.
This also makes it clear that the test+code can be dropped again if we stop
supporting older Android versions at some point.
2018-08-03 10:24:00 +02:00
Philip Withnall
7f5296d055 Merge branch 'wip/oholy/update-mounts' into 'master'
Be sure that g_volume_get_mount succeed after g_volume_mount

See merge request GNOME/glib!217
2018-08-02 15:40:50 +00:00
Ondrej Holy
3edc50498f glocalfilemonitor: Fallback to poll file monitor for NFS
GLib currently tries to use FAM volume monitor for monitoring files
within home on NFS. If FAM support is not available, it fallbacks by
default to GInotifyFileMonitor. I think we should fallback to
GPollFileMonitor instead, because inotify is not reliable on NFS,
which may cause issues for dconf. With this patch, it should be safe to
not build libgiofam and still be sure that dconf works properly if home
is mounted on NFS. I think this might be a first step to remove FAM
support from GLib completely, because gamin is buggy and dead for
several years already. Gamin just polls files on NFS anyway. This
change applies on files only, because GPollFileMonitor seems doesn't
support dirs, however it should be enough for dconf. The other
drawback is that one can't set poll timeout currently. Just a note
that this can still be overwritten by GIO_USE_FILE_MONITOR.
2018-08-02 13:14:10 +02:00
Ondrej Holy
88b8ebb5dd gio-tool: Hold GVolumeMonitor reference during operations
Releasing GVolumeMonitor before g_volume_mount finish cause that
g_volume_get_mount returns NULL, because the mount is not correctly
propagated to the volume.

https://gitlab.gnome.org/GNOME/glib/issues/1458
2018-08-02 11:35:48 +02:00
Christoph Reiter
70ad484508 gresource-tool: fix build in case libelf is available on Windows. Fixes #1466
The gresource code uses libelf if available but that also depends on mmap but isn't
guarded with HAVE_MMAP. This can make the build fail under MSYS2 where a mingw version
of libelf exists but there is no mmap.

Instead of guarting the libelf code with HAVE_LIBELF add a new macro named USE_LIBELF
which is only defined if libelf and mmap support are available.

Also install the mingw libelf version for CI so we catch similar errors in the future.
2018-08-01 19:08:39 +02:00
Emmanuele Bassi
26c3f2f1b1 Install gioenumtypes.h
We're re-defining nodist_gioinclude_HEADERS and Automake will use the
last definition of the target.
2018-07-31 09:40:22 +01:00
Philip Withnall
2a69cdb1cd build: Stop distributing generated files in autotools tarballs
It is a bug if we distribute files which are generated at build time —
they should be built on the machine which is compiling GLib, not be
shipped in the tarball.

This brings the autotools-generated tarball in line with the
ninja-generated one, with the exception of man pages and gtk-doc HTML
output.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-07-30 19:58:24 +01:00
Mohammed Sadiq
24f5dbca2c gio/tests: Use the right format specifier
dev_t - the type of st_dev - is always 8 byte.
Use G_GUINT64_FORMAT to ensure 8 byte and thus not fail on i386.
2018-07-30 20:53:15 +05:30
Ondrej Holy
9b6b282e0a gio: Update mounts after g_volume_mount
The documentation claims that g_volume_get_mount should	succeed	after
g_volume_mount. Let's update mounts before releasing g_volume_mount to
be sure that the mount is added to the corresponding volume. The same
is done in GVfsUDisks2VolumeMonitor.

https://gitlab.gnome.org/GNOME/glib/issues/1458
2018-07-30 16:05:41 +02:00
Michael Catanzaro
94a99ae917 Update documentation of g_tls_connection_handshake
Rehandshaking is not a thing in TLS 1.3. In that case,
g_tls_connection_handshake() should instead perform a re-key.
2018-07-27 10:48:50 -05:00
Matthias Clasen
56092b8529 Revert "Add a gnet utility"
This reverts commit 1db3b6def6.

I had forgotten to remove this from the branch before merging.
2018-07-25 07:18:38 -04:00
Matthias Clasen
2480ece23d Merge branch 'new-network-portal' into 'master'
New network portal

See merge request GNOME/glib!192
2018-07-25 11:16:51 +00:00
Nirbheek Chauhan
4e1488eebb Merge branch 'meson-python-module' into 'master'
meson: use the new 'python' module instead of the 'python3' one

Closes #1455

See merge request GNOME/glib!187
2018-07-23 11:17:47 +00:00
Matthias Clasen
1db3b6def6 Add a gnet utility
This is currently just a wrapper around GNetworkMonitor.
2018-07-21 08:21:58 -04:00
Matthias Clasen
7217fe56e0 Stop generating code for NetworkMonitor
The portal implementation no longer uses generated
code for org.freedesktop.portal.NetworkMonitor.
2018-07-21 08:21:43 -04:00
Matthias Clasen
5ed808d7c4 network monitor: Update portal implementation
The network monitor portal interface is changing.
Version 2 is no longer using properties, but getters
instead (this lets the portal apply access control
and avoid sending information to non-networked
sandboxes).

To support both version 1 and 2 of the interface,
we stop using generated code and instead deal with
the api differences in our own code, which is not
too difficult.

Support version 1 as well
2018-07-21 08:19:16 -04:00
Matthias Clasen
e0b120cc3c Add debug spew to module loading
This is useful to verify which modules are loaded, and why.
2018-07-20 18:53:09 -04:00
Christoph Reiter
631c3534b7 meson: use the new 'python' module instead of the 'python3' one. Closes #1455
The new python module, added with 0.46, works with Python 2 and 3 and
allows to pass a path for the interpreter to use, if the need arises.

Previously the meson build set PYTHON, used in the shebang line of
the scripts installed by glib, to the full path of the interpreter.
The new meson module doesn't expose that atm, but we should set it to
a executable name anyway, and not a full path.
2018-07-19 12:32:29 +02:00
Nirbheek Chauhan
057f393bbb meson: Provide our Python tools for builds
Several of our tools are installed and are used by other projects to
generate code. However, there is no 'install' when projects use glib
as a subproject.

We need some way for glib to 'provide' these tools so that when some
project uses glib as a subproject, find_program('glib-mkenums') will
transparently return the glib-mkenums we just built.

Starting from Meson 0.46, this can be done with the
`meson.override_find_program()` function.

As a bonus, the Meson GNOME module will also use these
'overriden'/'provided' programs instead of looking for them in PATH.
2018-07-19 15:53:37 +05:30
Javier Jardón
5f6895d741 gio/Makefile.am: Use PYTHON to call python script 2018-07-17 12:26:34 +01:00
Philip Withnall
b5948c1a39 gsettings: Fix some memory leaks on error paths
Coverity CID: #1393949
Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
2018-07-17 12:14:07 +02:00
Philip Withnall
2c79b357b2 gio-tool: Fix a memory leak when returning command line help
Coverity CID: #1393952
Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
2018-07-17 12:13:21 +02:00
Xavier Claessens
f456e311cd Meson: Use environment() for test_env 2018-07-16 15:04:03 -04:00
Xavier Claessens
c96f987f0d Merge branch '786-gio-test-leaks' into 'master'
Fix memory leaks in libgio tests and ensure tests are run under Meson

Closes #786

See merge request GNOME/glib!151
2018-07-13 15:46:21 +00:00
Thomas Hindoe Paaboel Andersen
a8b416f9fe python: avoid equality check for None
PEP8 says that:
"Comparisons to singletons like None should always be done with is or
is not, never the equality operators."

glib uses a mix of "== None" and "is None". This patch changes all
cases to the latter.
2018-07-12 23:48:41 +02:00
Philip Withnall
3890f7f5cb tests: Fix skipping of appinfo tests when DISPLAY is unset
Use g_test_skip() so that the TAP output is correct for the tests,
rather than printing using g_printerr().

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

https://gitlab.gnome.org/GNOME/glib/issues/640
2018-07-11 15:58:48 +02:00
Emmanuele Bassi
ad3947c42e Merge branch '927-resource-path-fix' into 'master'
gresource: Fix potential array overflow if using empty paths

Closes #927

See merge request GNOME/glib!150
2018-07-11 09:24:03 +00:00
Philip Withnall
3475afc255 Merge branch '1402-real-time' into 'master'
glib: Don’t use time(NULL) to get current time

Closes #1402

See merge request GNOME/glib!154
2018-07-11 07:51:06 +00:00
Philip Withnall
034bbfd873 gdbusconnection: Drop an outdated TODO comment
Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://gitlab.gnome.org/GNOME/glib/issues/340
2018-07-10 19:16:35 +02:00
Philip Withnall
92e059280f glib: Don’t use time(NULL) to get current time
Use either g_get_real_time() or g_date_time_new_now_local(). This means
we don’t need to worry about time_t being 32b in future (the year 2038
problem), and it makes the need for error handling a bit more explicit.
Improve the error handling in several cases.

Based on a patch by Niels De Graef
(https://gitlab.gnome.org/GNOME/glib/merge_requests/142).

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

https://gitlab.gnome.org/GNOME/glib/issues/1402
2018-07-09 13:28:02 +02:00
Philip Withnall
9d6a69b73e gio: Link inotify file monitor to GLib and GObject
Apparently this is needed for building PE libraries. It makes no
difference on Linux, where linking of the GLib symbols in the inotify
file monitor code is done lazily.

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

https://gitlab.gnome.org/GNOME/glib/issues/1201
2018-07-09 10:38:04 +01:00
Adrian Perez de Castro
657be4f5fc
gio: Add missing autocleanup definition for GResource
Fixes #1435
2018-07-07 19:44:19 +03:00
Philip Withnall
6438e2c731 tests: Mark gdbus-threading test as slow
It often takes a bit more than 30s on my local machine to run.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-07-06 15:01:40 +01:00
Philip Withnall
5422838e8d tests: Move two tests from GIO uninstalled helpers to test cases list
These are built and run as tests in the autotools build, and use GTest.
They are tests.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-07-06 14:58:25 +01:00
Philip Withnall
cfc26b5a41 tests: Rework slow test handling for GIO tests
Make it follow the same pattern as in glib/tests/meson.build, using a
slow_tests array.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-07-05 17:14:53 +01:00
Philip Withnall
cf4f6d4808 tests: Ensure GIO tests which need dbus-daemon are run
The tests array was being wiped out by an assignment instead of an
append. This adds another 19 tests to what’s typically being run
already.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-07-05 13:26:48 +01:00
Philip Withnall
eeb5015ebe build: Make actions and gdbus-export GIO tests as slow
Increase their timeout.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-07-05 13:26:48 +01:00
Philip Withnall
a0cebdf4b6 tests: Use Unicode typography in gdbus-export test
This was missed in !137 because some of the GIO tests weren’t being run
under Meson (see following commits).

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-07-05 13:14:22 +01:00
Stef Walter
92a01e2280 gdbus-connection-loss: Fix leak in test
https://gitlab.gnome.org/GNOME/glib/issues/786
2018-07-05 13:13:59 +01:00
Philip Withnall
ab87af1734 gresource: Fix potential array overflow if using empty paths
Adds tests to cover this case and similar cases for various GResource
methods in future.

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

https://gitlab.gnome.org/GNOME/glib/issues/927
2018-07-05 12:03:10 +01:00
Philip Withnall
f62d7c1e2a gresource: Fix wrapping of function return type
This introduces no functional changes.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-07-05 11:19:20 +01:00
Xavier Claessens
deccba2807 Meson: Use subdir_done() now that it has been fixed 2018-07-03 11:06:48 -04:00
Xavier Claessens
95fa229f34 Meson: Fix warnings introduced in 0.47.0 2018-07-03 11:00:54 -04:00
Philip Withnall
4dc927fc2f Merge branch 'ci-memcheck-preparation' into 'master'
Preparation for adding valgrind/memcheck to CI

See merge request GNOME/glib!143
2018-06-29 13:31:43 +00:00
Philip Withnall
f7bd41fdaa tests: Fix leak when checking for du binary
g_find_program_in_path() returns a pointer, not a boolean.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-06-29 12:13:32 +01:00
Philip Withnall
93b519b104 tests: Various minor leak fixes in the GIO tests
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-06-29 12:13:32 +01:00
Philip Withnall
68526565f4 tests: Fix use-after-free in the appinfo tests
When changing the locale using setlocale(), duplicate the old locale
value before updating it, so that we can safely restore the old locale
after running the test.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-06-29 12:13:32 +01:00
Philip Withnall
61da8748fd glocalfile: Fix a minor memory leak
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-06-29 12:13:32 +01:00
Ondrej Holy
51132b1d49 Merge branch 'cifs-is-not-a-system-fs' into 'master'
gunixmounts: Stop considering cifs/nfs as system file systems

See merge request GNOME/glib!125
2018-06-29 07:07:24 +00:00
Philip Withnall
6db2412b41 gdesktopappinfo: Fix a minor command line leak
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-06-27 15:01:09 +01:00
Philip Withnall
c1d8b9c806 gbufferedoutputstream: Fix jump conditional on uninitialised data
The flush data structures were not zero-initialised, which meant the
branch in flush_buffer_thread() was based on an uninitialised condition.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-06-27 15:01:08 +01:00
Philip Withnall
208a6e815a gmain: Add names to various GSources constructed in GLib
For the purposes of debugging, it is quite useful for every GSource to
have a name set. Ensure that any GSource we construct inside GLib has a
name set. For GSources which are then returned to the caller, this name
can then be overridden with something even more useful by the caller.

Since this data is only used for debugging, avoid doing any allocations
for it; just use static strings.

https://gitlab.gnome.org/GNOME/glib/issues/1175
2018-06-26 09:25:39 +01:00
Piotr Drąg
d9fc99256e Use Unicode typography in new translatable strings
See https://developer.gnome.org/hig/stable/typography.html
2018-06-25 16:51:00 +02:00
Philip Withnall
4993f2b7e5 Merge branch 'wip/muktupavels/per-desktop-overrides' into 'master'
GSettings: per-desktop overrides

Closes #1013

See merge request GNOME/glib!105
2018-06-25 10:32:44 +00:00
Alberts Muktupāvels
b618ec40a7 Add a test for per-desktop overrides 2018-06-22 22:02:31 +03:00
Philip Withnall
04c8691208 Revert "build: Look for copied Objective-C files in builddir again"
This reverts commit fe72b8772e.

It still fails on GNOME Continuous:
http://build.gnome.org/continuous/buildmaster/builds/2018/06/21/44/build/.

See https://gitlab.gnome.org/GNOME/glib/merge_requests/129 for
discussion.
2018-06-22 00:21:05 +01:00
Philip Chimento
fe72b8772e build: Look for copied Objective-C files in builddir again
This reverts commit 03c324c64a and fixes
the original problem with e004d5f397 that
caused the revert.

We use $(builddir) instead of $(abs_builddir) so that Automake's
dependency generation works correctly.

See !127.
2018-06-21 14:48:29 -07:00
Philip Withnall
ca98ce4280 Merge branch 'master' into 'master'
Use posix_spawn for optimized process launching

See merge request GNOME/glib!95
2018-06-21 17:10:43 +00:00
Daniel Drake
156d009696 gdesktopappinfo: add g_desktop_app_info_launch_uris_as_manager_with_fds variant
Add an app-launching function which allows standard file descriptors
to be passed to the child process.

This will be used by gnome-shell to pass systemd journal descriptors
as stdout/stderr. gnome-shell's child_setup function can then be
eliminated, which will enable use of the posix_spawn optimized
gspawn codepath for desktop app launching.
2018-06-21 11:44:59 -05:00
Daniel Drake
742efe6232 gdesktopappinfo: enable fast posix_spawn gspawn codepath
In order to use the new posix_spawn gspawn codepath, for more robust
app launching when available memory is low, we need to meet some
conditions.

child_setup needs to be NULL for this optimization to work, so drop
the internal child_setup that is used here. Replace it with a lightweight
wrapper binary (gio-launch-desktop) that sets GIO_LAUNCHED_DESKTOP_FILE_PID
before executing the app.

Adjust PATH for gio tests so that it can execute the new binary from the
build directory.
2018-06-21 11:44:28 -05:00
segfault
76b4d0ab3f Add support for TCRYPT volumes to GMountOperation
Add G_ASK_PASSWORD_TCRYPT flag to GAskPasswordFlags and add the
following properties to GMountOperation:

- hidden_volume [1]
- system_volume [2]
- pim [3]

[1] https://www.veracrypt.fr/en/Hidden%20Volume.html
[2] https://www.veracrypt.fr/en/System%20Encryption.html
[3] https://www.veracrypt.fr/en/Personal%20Iterations%20Multiplier%20(PIM).html
2018-06-21 15:32:04 +02:00
Philip Withnall
a3a6c516c4 gunixmounts: Stop considering cifs/nfs as system file systems
They’re network file systems, but not system file systems (in the sense
that procfs is a system file system). This fixes them disappearing from
the sidebar in the UI.

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

https://gitlab.gnome.org/GNOME/glib/issues/1424
2018-06-20 12:16:34 +01:00
Allison Lortie
83a2e85ec8 glib-compile-schemas: Handle per-desktop overrides
Add a new syntax to override files: if the group name has a ':' in it,
it indicates that we want to override the default values of keys for
only one desktop. For example:

[org.gnome.desktop.interface:Unity]
font-name='Ubuntu 12'

Will override the settings, only if "Unity" is found in
XDG_CURRENT_DESKTOP. Multiple per-desktop overrides can be specified
for a given key: the one which comes first in XDG_CURRENT_DESKTOP will
be used.

https://bugzilla.gnome.org/show_bug.cgi?id=746592
2018-06-19 19:18:58 +03:00
Allison Lortie
6ca449672d gsettingsschema: Allow per-desktop overrides
Recognise a new 'd' option in schema keys which gives a dictionary of
per-desktop default values. This dictionary is searched for the items
found in XDG_CURRENT_DESKTOP, in the order. If nothing matches (or if
the option is missing) then the default value is used as before.

This feature was requested by Alberts Muktupāvels and this patch is
based on an approach devised by them.

https://bugzilla.gnome.org/show_bug.cgi?id=746592
2018-06-19 19:18:58 +03:00
Allison Lortie
c2e7f31697 gsettings: cleanup default value lookup
There are a couple of different ways (and soon one more) to access the
default value of a key. Clean up the various places that access this to
avoid duplication.

https://bugzilla.gnome.org/show_bug.cgi?id=746592
2018-06-19 19:18:58 +03:00
Philip Withnall
1c673535fe tests: Add basic tests for GMountOperation
There were previously no tests for it. These take gmountoperation.c up
to 85.5% coverage of lines.

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

https://gitlab.gnome.org/GNOME/glib/issues/1423
2018-06-19 15:46:59 +01:00
Philip Withnall
6284749487 gfile: Document usefulness of g_file_dup()
Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://gitlab.gnome.org/GNOME/glib/issues/807
2018-06-19 12:36:37 +01:00
Philip Withnall
40a84b3d1c Merge branch 'wip/lantw/freebsd-kqueue-complex' into 'master'
FreeBSD kqueue file monitor fixes: the complex parts

See merge request GNOME/glib!77
2018-06-19 11:19:43 +00:00