Commit Graph

7154 Commits

Author SHA1 Message Date
Philip Withnall
709df8eeb4 Merge branch 'docgen-fixes' into 'main'
Adapt documentation to gi-docgen

See merge request GNOME/glib!2206
2021-08-03 13:53:38 +00:00
Guido Günther
8704c521fd gfdonotificationbackend: Pass on category 2021-08-02 19:26:38 +02:00
Guido Günther
791218a5f5 GNotification: Allow to set a category
Some backends like the FDO one allow to set a category. This helps the
notification daemon to select a proper feedback type.
2021-08-02 19:26:38 +02:00
Emmanuele Bassi
d6f7f8e961 docs: Use the proper Markdown syntax for lists
You need to separate the first entry in the list from the preceding
paragraph, and you should add a space before the enumerating symbol.

GTK-Doc accepts a very lax Markdown syntax, but any other tool parsing
our documentation will likely fail.
2021-08-02 16:29:16 +01:00
Emmanuele Bassi
24a0c3a940 docs: Break GFileAttribute descriptions into paragraph
Keep the first paragraph short, to act as a summary.
2021-08-02 16:21:37 +01:00
Руслан Ижбулатов
ae5e016edc GWin32AppInfo: Fix missing initialization
The value should be initialized to NULL before calling
g_win32_registry_key_get_value_w(), to ensure that cleanup
can be done unconditionally afterward.
2021-08-02 14:19:35 +00:00
Emmanuele Bassi
6081e92daf docs: Match GZlib(De)Compressor section with the type name
Otherwise the introspection scanner won't be able to match the
documentation stanza to the corresponding type.
2021-08-02 13:27:55 +01:00
Руслан Ижбулатов
4e9e7bfd34 GWin32AppInfo: re-trigger registry watcher from the callback
To ensure that the watch is properly re-set every time, call
watch_keys() from the watch callback. Previously the watch was only
renewed after a data update was done in a worker thread, which made
no sense, since the update function was implemented in such a way
that it can (and should) be re-triggered on each key change, until
the changes stop coming, and that can only happen if we renew
the registry watcher right away.
2021-07-31 11:01:06 +00:00
Руслан Ижбулатов
6885a29428 GWin32RegistryKey: ensure reqeueing works correctly
If a key watch is renewed from the key watch callback, it results
in the callback being NULL, since we clear it after we call it.

Rearrange the function to make sure that the changes done by the
callback function are preserved properly.
2021-07-31 10:57:44 +00:00
Руслан Ижбулатов
8c25302726 GWin32RegistryKey: Change STATUS_SUCCESS handling
This function can, in fact, return STATUS_SUCCESS. We shouldn't
assert that it doesn't.

For now interpret it just like STATUS_PENDING (i.e. APC will be called),
see how it goes (it isn't documented how the function behaves in this
case, we have to play it by ear).

Note that while we *can* use a better-documented RegNotifyChangeKeyValue() here,
it communicates back to us via event objects, which means that the registry
watcher would have to interact with the main loop directly and insert its
events (plural; one event per key) there. That would make the API more complicated.
Whereas the internal NT function communicates by calling an APC - we're good
as long as something somewhere puts the thread in alertable state.
2021-07-31 10:50:12 +00:00
Patrick Griffis
889bdb994f Add GPowerProfileMonitor 2021-07-28 15:56:02 +02:00
Bastien Nocera
92399e7114 gio: Do not block when low-memory-monitor daemon appears 2021-07-28 15:31:16 +02:00
Bastien Nocera
a7000cd989 gio: g_clear_signal_handler() can handle NULL args 2021-07-28 15:31:01 +02:00
Bastien Nocera
2e500304e3 tests: Remove unused constant in GMemoryMonitor test 2021-07-28 15:04:46 +02:00
Emmanuele Bassi
39d5f34442 Fix doc stanzas for GDataInputStream properties
There's no such thing as a GDataStream.
2021-07-27 12:50:03 +01:00
Philip Withnall
808cde540a Merge branch 'source-static-name' into 'main'
Port internal uses to use g_source_set_static_name()

See merge request GNOME/glib!2198
2021-07-26 15:05:50 +00:00
Philip Withnall
ef6a551739 Merge branch 'main' into 'main'
Fix some test suite memory leaks

See merge request GNOME/glib!2195
2021-07-26 10:06:08 +00:00
Philip Withnall
8e963e0e31 Port internal uses to use g_source_set_static_name()
This should reduce allocations.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-07-26 11:01:07 +01:00
Chun-wei Fan
8093da7ce6 GResource compiler: Prefix static [con|de]strutors with c_name
When attempting to test Windows support for building libadwaita, since we are
using multiple GResource files, one would hit linker errors where multiple
definitions of the following symbols have been defined, when
glib-compile-resources was invoked without manual register:

resource_constructor_wrapper
resource_destructor_constructor
_arrayresource_constructor
_arrayresource_destructor

In order to avoid that, just prefix the definitions of resource_constructor
and resource_destructor, like what we do when --manual-register is used, with
what we pass in with --c-name so that we ensure that we do not end up in such
name collisions.
2021-07-26 17:05:23 +08:00
GOUJON Évan
dd69955e58 gio/tests/async-splice-output-stream: Fix a memory leak 2021-07-23 22:21:23 +02:00
Philip Withnall
e74c955335 Merge branch 'g_mod' into 'main'
API: Add g_module_open_full()

Closes #203

See merge request GNOME/glib!2169
2021-07-21 21:07:06 +00:00
Philip Withnall
be012a8067 giomodule: Port to new g_module_open_full() API
Port all existing calls in GLib to the new API so that they can receive
more detailed error information (although none of them actually make use
of it at the moment).

This also serves to test the new API better through use.

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

Helps: #203
2021-07-21 21:54:35 +01:00
Philip Withnall
bdbe65dd40 Merge branch 'nsec-typo' into 'main'
glocalfileinfo: Fix usec/nsec confusion with filetimes on Windows

See merge request GNOME/glib!2182
2021-07-14 10:45:47 +00:00
markus
648994dba4 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:08:25 +01:00
Philip Withnall
7e8163b30b glocalfileinfo: Fix usec/nsec confusion with filetimes on Windows
The function which calls `SetFileTime()` works with seconds and
nanosecond, but the functions which call it are doing so with seconds
and microseconds.

Fix them so they convert to nanoseconds first.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-07-09 12:00:31 +01:00
Philip Withnall
dda45b0493 glocalfileinfo: Fix a typo in a file time utility function
The code appears to be dealing with time in units of 100ns, not 100µs,
so name the variable accordingly.

The rest of the arithmetic in that function appears consistent and
correct.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-07-09 11:52:23 +01:00
Ross Burton
289f8be1b3 gio/tests/g-file-info: don't assume million-in-one events don't happen
The modification time test creates a file, gets the modification time in
seconds, then gets the modification time in microseconds and assumes
that the difference between the two has to be above 0.

As rare as this may be, it can happen:

$ stat g-file-info-test-50A450 -c %y
2021-07-06 18:24:56.000000767 +0100

Change the test to simply assert that the difference not negative to
handle this case.
2021-07-06 19:32:54 +01:00
Michael Olbrich
3b452cb164 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:42:54 +02:00
Guido Günther
693ca5eb01 gdbusobjectmanagerclient: Cancel GetManagedObjects on dispose
Make sure there's no async call lingering when disposing the object.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2021-06-28 17:04:17 +02:00
Guido Günther
c548ac0796 gdbusobjectmanagerclient: Call GetManagedObjects async
This helps to void deadlocks when two processes call interfaces on each
other one of them being org.freedesktop.DBus.ObjectManager.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2021-06-28 15:27:36 +02:00
Guido Günther
04a4da8065 gdbusobjectmanagerclient: Move weak ref helpers upwards
This allows it to be used in on_notify_g_name_owner() as well

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2021-06-28 15:27:36 +02:00
Michael Catanzaro
ed49de8b0f Merge branch 'mcatanzaro/gtlscertificate-introspection' into 'main'
gtlscertificate: Add more annotations to new properties

See merge request GNOME/glib!2166
2021-06-21 16:07:42 +00:00
Michael Catanzaro
5e19ccd237 gtlscertificate: Add more annotations to new properties 2021-06-21 16:07:42 +00:00
Michael Catanzaro
2cd187aa5e gio: add missing Since tags in GTlsConnection/GDtlsConnection 2021-06-21 09:31:17 -05:00
Michael Catanzaro
1ea88f46ff gdtlsconnection: document get_binding_data vfunc 2021-06-21 09:28:23 -05:00
Michael Catanzaro
09a4203b38 gtlsconnection: Add doc comment for GTlsConnectionClass 2021-06-21 09:28:23 -05:00
Michael Catanzaro
5e6c2e1e2c gtlsconnection: use a vfunc to implement get_negotiated_protocol()
The current code is unsafe to use from multiple threads at once.
GIOStream functions like this are supposed to be semi-threadsafe. It's
allowed for them to be called on both a reader thread and a writer
thread at the same time. Of course, it's still tricky and dangerous,
because it's only *really* threadsafe if the handshake has finished,
and API users have no plausible way to know that because the API
does not require performing an explicit handshake operation. But that's
a glib-networking problem. We can at least avoid the most obvious
threadsafety issue here in the API layer.

Note that we'll need to implement the new vfunc in glib-networking for
this to actually work.

Fixes #2393
2021-06-21 09:28:23 -05:00
Philip Withnall
72f692eae4 gdbusnamewatching: Ensure GDestroyNotify is called in correct context
The documentation for `g_bus_watch_name()` implies that the
`GDestroyNotify` for the user data will be called in the current thread
default `GMainContext`. Currently, it could be called in any thread, as
`client_unref()` can be called in any thread.

Fix that by deferring it to an idle source if `client_unref()` finalises
the `Client` object in a different thread.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-06-21 14:16:36 +01:00
Philip Withnall
323c5d7e21 tests: Add some missing main context iterations to gdbus-names
These were missing from the test before the previous commit ported from
`GMainLoop` to `GMainContext`.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-06-21 14:16:03 +01:00
Philip Withnall
32e8e4ad91 tests: Port gdbus-names test entirely to GMainContext
It makes combination exit conditions a lot easier than when using
`g_main_loop_quit()` from different callbacks.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-06-21 14:15:55 +01:00
Philip Withnall
9d694f636f Merge branch 'app_name' into 'main'
gfdonotificationbackend: set app_name if available

Closes #2069

See merge request GNOME/glib!2159
2021-06-16 11:07:55 +00:00
Philip Withnall
f6fdc9b5f2 Merge branch 'mcatanzaro/readable-private-key' into 'main'
gtlscertificate: make private key properties readable

See merge request GNOME/glib!2087
2021-06-16 11:01:40 +00:00
Philip Withnall
4d6dbe0904 Merge branch 'g_dbus' into 'main'
gdbus: Add g_dbus_is_error_name() symbol for g_dbus_is_interface_name()

Closes #402

See merge request GNOME/glib!2156
2021-06-16 10:58:04 +00:00
Philip Withnall
9c7caf540e gsettingsschema: Fix docs for g_settings_schema_key_range_check()
The first sentence incorrectly said that it checked the type of the
value, and then the second sentence explicitly said it was a programmer
error to give a value of the wrong type.

According to the code, the second sentence is correct.

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

Fixes: #2425
2021-06-16 11:14:03 +01:00
nitinosiris
a70df97c63 Added test case for g_dbus_is_error_name 2021-06-16 08:06:03 +05:30
nitinosiris
5b9a8e2048 gdbus: Add g_dbus_is_error_name() symbol for g_dbus_is_interface_name()
Closes #402
2021-06-16 08:05:50 +05:30
Michael Catanzaro
022ea47603 gtlscertificate: add some doc links to PKCS #11 specification 2021-06-15 16:06:52 -05:00
Michael Catanzaro
c50e543e9d gtlscertificate: make private key properties readable
WebKit wants these private key properties to be readable in order to
implement a deserialization function. Currently they are read-only
because at the time GTlsCertificate was originally designed, the plan
was to support PKCS#11-backed private keys: private keys that are stored
on a smartcard, where the private key is completely unreadable. The
design goal was to support both memory-backed and smartcard-backed
private keys with the same GTlsCertificate API, abstracting away the
implementation differences such that code using GTlsCertificate doesn't
need to know the difference.

The original PKCS#11 implementation was never fully baked and at some
point in the past I deleted it all. It has since been replaced with a
new implementation, including a GTlsCertificate:private-key-pkcs11-uri
property, which is readable. So our current API already exposes the
differences between normal private keys and PKCS#11-backed private keys.
The point of making the private-key and private-key-pem properties
write-only was to avoid exposing this difference.

Do we have to make this API function readable? No, because WebKit could
be just as well served if we were to expose serialize and deserialize
functions instead. But WebKit needs to support serializing and
deserializing the non-private portion of GTlsCertificate with older
versions of GLib anyway, so we can do whatever is nicest for GLib. And I
think making this property readable is nicest, since the original design
reason for it to not be readable is now obsolete. The disadvantage to
this approach is that it's now possible for an application to read the
private-key or private-key-pem property, receive NULL, and think "this
certificate must not have a private key," which would be incorrect if
the private-key-pkcs11-uri property is set. That seems like a minor
risk, but it should be documented.
2021-06-15 16:06:52 -05:00
André Apitzsch
53632c84d8 gfdonotificationbackend: set app_name if available
Fixes: #2069
2021-06-15 20:55:07 +02:00
Philip Withnall
00feb4d5a9 Merge branch 'wip/wait-status' into 'main'
Distinguish more clearly between wait status and exit status

See merge request GNOME/glib!1967
2021-06-15 18:22:02 +00:00
Ondrej Holy
757cc93520 Merge branch 'unix-mount-for-docs' into 'main'
gunixmounts: Document NULL return value for g_unix_mount_for()

See merge request GNOME/glib!2145
2021-06-15 15:29:58 +00:00
Simon McVittie
e0b6b8037d Distinguish more clearly between wait status and exit status
On Unix platforms, wait() and friends yield an integer that encodes
how the process exited. Confusingly, this is usually not the same as
the integer passed to exit() or returned from main(): conceptually it's
an integer encoding of this tagged union:

    enum { EXITED, SIGNALLED, ... } tag;
    union {
        int exit_status;         /* if EXITED */
        struct {
            int terminating_signal;
            bool core_dumped;
        } terminating_signal;    /* if SIGNALLED */
        ...
    } detail;

Meanwhile, on Windows, wait statuses and exit statuses are
interchangeable.

I find that it's clearer what is going on if we are consistent about
referring to the result of wait() as a "wait status", and the value
passed to exit() as an "exit status".

GSubprocess already gets this right: g_subprocess_get_status() returns
the wait status, while g_subprocess_get_exit_status() genuinely returns
the exit status. However, the GSpawn family of APIs has tended to
conflate the two.

Confusingly, g_spawn_check_exit_status() has always checked a wait
status, and it would not be correct to pass an exit status to it; so
let's deprecate it in favour of g_spawn_check_wait_status(), which
does the same thing that g_spawn_check_exit_status() always did.
Code that needs backwards-compatibility with older GLib can use:

    #if !GLIB_CHECK_VERSION(2, 69, 0)
    #define g_spawn_check_wait_status(x) (g_spawn_check_exit_status (x))
    #endif

Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-06-15 14:33:14 +01:00
Simon McVittie
f2be22ca52 subprocess test: Check wait status correctly
Confusingly, g_spawn_check_exit_status() takes a wait status, not an
exit status, so passing g_subprocess_get_exit_status() to it is
incorrect (although both encodings happen to use 0 to encode success
and a nonzero value to encode failure, so in practice this probably
had the desired effect).

Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-06-15 14:32:33 +01:00
Philip Withnall
bd8d139a77 tests: Add missing wakeup calls to gdbus-names.c
Following on from the previous commit, some explicit
`g_main_context_wakeup()` calls were missing from the test code which
only uses `GMainContext`.

Add them, and also add some assertions to check that these functions are
being called in the expected thread (as the code comments say).

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-06-15 13:48:03 +01:00
Philip Withnall
031e5020ee Merge branch 'wip/pwithnall/local-file-monitor-deadlock' into 'main'
glocalfilemonitor: Avoid a deadlock on finalization

See merge request GNOME/glib!2155
2021-06-15 12:24:51 +00:00
Philip Withnall
8530a6a8e4 tests: Add missing wakeup calls to gdbus-names test
The tests in `gdbus-names.c` use a mixture of `GMainLoop` and iterating
a `GMainContext` directly. Some of the helper functions based around the
`OwnNameData` struct use the `loop` `GMainLoop` even when called from
tests like `watch_with_different_context()` which themselves use
`GMainContext` directly.

Thus, it’s possible for the `GMainLoop` to not be running, while the
test is iterating on `g_main_context_iteration()`. In this case,
`g_main_loop_quit()` is a no-op and will not wake up the `GMainContext`.
This causes the test to livelock in around 1 in 1200 test runs.

Fix this by adding an explicit `g_main_context_wakeup()` call after each
`g_main_loop_quit()` call. A more comprehensive fix would be to port all
the tests in this file to iterating `GMainContext` directly, and drop
all the `GMainLoop` usage, but I don’t have time for that right now.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-06-15 13:01:28 +01:00
Philip Withnall
838dc04c76 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-14 15:09:52 +01:00
Philip Withnall
e522768ef4 tests: Allow GResource external data tests to use llvm-objcopy
Relax the requirement for the test to only be compiled/run under gcc,
since a version of LLVM was released which supports `--add-symbol`.

`objcopy` should be overrideable to be `llvm-objcopy` by using a machine
file as per https://mesonbuild.com/Machine-files.html#binaries.

Suggested and tested by Grigory Vasilyev.

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

Fixes: #2423
2021-06-14 14:49:59 +01:00
Philip Withnall
de74a70b7e Merge branch 'try-tls-binding-tests-again' into 'main'
Revert "tests: Deactivate tls-bindings test suite for windows"

See merge request GNOME/glib!2130
2021-06-10 12:46:12 +00:00
Philip Withnall
76ecdeffd0 Merge branch '2409-application-must-be-registered' into 'main'
gapplication: Guard g_application_mark_busy()

Closes #2409

See merge request GNOME/glib!2111
2021-06-10 12:44:13 +00:00
Philip Withnall
055f7c6bc5 gdbusconnection: Fix a typo in a code comment
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-06-10 12:37:23 +01:00
Philip Withnall
ee716d9159 docs: Fix capitalisation of ‘GUID’ in a few places
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-06-10 12:37:11 +01:00
Philip Withnall
c794261a40 docs: Expand documentation about D-Bus GUIDs
Clarify that the terms ‘GUID’ and ‘UUID’ are used interchangeably in the
context of D-Bus, and that neither of them are an RFC 4122 UUID.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-06-10 12:36:25 +01:00
Ross Wollman
4d3618cbd1 tls: expose SAN details on GTlsCertificate
This changeset exposes

* `dns-names`
* `ip-addresses`

on GTlsCertificate provided by the underlying TLS Backend.

See https://gitlab.gnome.org/GNOME/glib-networking/-/merge_requests/165 for the corresponding glib-networking changes.

Relates: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2113
Relates: https://gitlab.gnome.org/GNOME/glib-networking/-/merge_requests/156/diffs
Relates: https://github.com/microsoft/playwright/issues/6759
2021-06-10 00:54:45 +00:00
Philip Withnall
0362bf5d64 gunixmounts: Document when g_unix_mount_at() returns NULL
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-06-09 16:01:44 +01:00
Philip Withnall
165a0baa15 gunixmounts: Document NULL return value for g_unix_mount_for()
It will return `NULL` if the path doesn’t exist.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-06-09 15:53:32 +01:00
Philip Withnall
9ed66b21dd Merge branch 'confusing_errors' into 'main'
gdbusconnection: removed a confusing message

Closes #793

See merge request GNOME/glib!2118
2021-06-09 12:49:04 +00:00
nitinosiris
5e2986ea2c gdbusconnection: removed a confusing message
The message `No such interface %s on object at path %s`
displayed when requested object does not exist, which was kind of
confusing.

Closes #793
2021-06-08 21:07:21 +05:30
Philip Withnall
2b4e8521e8 Merge branch 'fix/accidental-dllexport' into 'main'
gdbus, win32: Fix accidental dllexport in static builds

See merge request GNOME/glib!2139
2021-06-07 14:54:46 +00:00
Philip Withnall
6e92c2c233 Merge branch '2348-rename-master' into 'master'
Rename default development branch to main

Closes #2348

See merge request GNOME/glib!2140
2021-06-07 13:22:34 +00:00
Philip Withnall
1a43d950b4 docs: Update various external links to use HEAD instead of master
Update several links to allow the remote to use its configured default
branch name, rather than specifying `master` as the default branch name.
This will help avoid breakage if any of these projects rename their
default branch in the future.

Fix a few of the links where they were hitting redirects or had moved.

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

Helps: #2348
2021-06-07 14:03:48 +01:00
Ole André Vadla Ravnås
92c4ae1c62 gdbus, win32: Fix accidental dllexport in static builds
Should only dllexport g_win32_run_session_bus() when building a DLL.
2021-06-07 13:57:59 +02:00
Philip Withnall
4fd789c160 tests: Add missing setlocale() call to file tests
This ensures that non-ASCII characters in the test output are printed
correctly in the logs.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-06-07 12:44:58 +01:00
Philip Withnall
b1ebb72522 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 12:44:52 +01:00
Philip Withnall
b407d46c9a Merge branch '2416-tls-certificate-fix-invalid-read' into 'master'
tests/tls-certificate: Add a unit test

Closes #2416

See merge request GNOME/glib!2136
2021-06-07 08:36:12 +00:00
Peter Bloomfield
f0a1671161 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-05 10:14:24 -04:00
Peter Bloomfield
39f661b070 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-04 20:46:44 -04:00
Peter Bloomfield
b9d07813d8 tests/tls-certificate: Add a unit test
Test whether g_tls_certificate_new_from_pem() can handle a
non-nul-terminated PEM.

Helps https://gitlab.gnome.org/GNOME/glib/-/issues/2416
2021-06-04 20:40:16 -04:00
Philip Withnall
205045e5c7 Merge branch 'wip/issue-1884' into 'master'
gsettings: Resolve child schemas from the parent's schema source

Closes #1884

See merge request GNOME/glib!2132
2021-06-04 12:09:24 +00:00
Christian Persch
2632ed7a69 gsettings: Resolve child schemas from the parent's schema source 2021-06-04 12:09:24 +00:00
Philip Withnall
02b298cf08 Merge branch 'mcatanzaro/tls-info' into 'master'
tls: add functions to get protocol version and ciphersuite name

See merge request GNOME/glib!2077
2021-06-04 11:14:46 +00:00
Gaël Bonithon
df500c68a4 inotify: Fix a memory leak
Fixes: #2311
2021-06-03 19:04:48 +02:00
Michael Catanzaro
bf37392045 tls: add functions to get protocol version and ciphersuite name
This adds g_tls_connection_get_protocol_version(),
g_tls_connection_get_ciphersuite_name(), and DTLS variants. This will
allow populating TLS connection information in the WebKit web inspector.

This is WIP because we found it's not quite possibly to implement
correctly with GnuTLS. See glib-networking!151.
2021-06-03 10:56:15 -05:00
Philip Withnall
e02b905b4b Revert "tests: Deactivate tls-bindings test suite for windows"
This reverts commit 7f2fef5c26.

There have been some changes to the gitlab-ci-win32-runner pre-clone
script which should be more successful at killing the remaining
processes after this test. See
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2008#note_1127126
2021-06-03 13:01:29 +01:00
Philip Withnall
04739eb4fd Merge branch '2227-gdbus-nullability' into 'master'
gdbus: Add various missing (nullable) or (not nullable) annotations

See merge request GNOME/glib!2123
2021-06-03 09:17:28 +00:00
Philip Withnall
ac8f4a0db5 gdbus: Add various missing (nullable) or (not nullable) annotations
This is the result of checking each `Returns:` line in these files. I’ve
only considered nullability and not other (potentially missing or
incorrect) annotations.

Including suggestions by Simon McVittie.

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

Helps: #2227
2021-06-03 10:02:37 +01:00
Philip Withnall
11c0b2e597 Merge branch 'pgriffis/pkcs11-password' into 'master'
gtlspassword: Add flags signifying PIN type for PKCS#11

See merge request GNOME/glib!2126
2021-06-02 10:06:06 +00:00
Michael Catanzaro
7a51163cf9 Merge branch 'feature/cert-info' into 'master'
tls: expose cert details on GTlsCertificate

See merge request GNOME/glib!2113
2021-06-01 20:25:21 +00:00
Patrick Griffis
e750f7a145 gtlspassword: Add flags signifying PIN type for PKCS#11
In a PKCS#11 operation there are multiple types of PINs possibly
needed and these flags add a way to expose them to the user.

This design exactly matches gnutls' gnutls_pin_flag_t API.
2021-06-01 14:56:56 -05:00
Ross A. Wollman
a17c28790a tls: expose cert details on GTlsCertificate
This changeset exposes

* `not-valid-before`
* `not-valid-after`
* `subject-name`
* `issuer-name`

on GTlsCertificate provided by the underlying TLS Backend.

In order to make use of these changes,
see the related [glib-networking MR][glib-networking].

This change aims to help populate more of the [`Certificate`][wk-cert]
info in the WebKit Inspector Protocol on Linux.

This changeset stems from work in Microsoft Playwright to [add more info
into its HAR capture][pw] generated from the Inspector Protocol events
and will bring feature parity across WebKit platforms.

[wk-cert]: 8afe31a018/Source/JavaScriptCore/inspector/protocol/Security.json
[pw]: https://github.com/microsoft/playwright/pull/6631
[glib-networking]: https://gitlab.gnome.org/GNOME/glib-networking/-/merge_requests/156
2021-06-01 16:24:33 +00:00
Emmanuel Fleury
aace697d7e Fix missing initializer warning in gio/tests/gdbus-exit-on-close.c
gio/tests/gdbus-exit-on-close.c:52:14: warning: missing field 'bug' initializer
      { NULL }
             ^
2021-05-27 10:16:52 +02:00
Emmanuel Fleury
652a7b7db1 Fix missing initializer warnings in gio/tests/socket.c
gio/tests/socket.c:505:36: warning: missing field 'size' initializer
    GOutputVector v[7] = { { NULL, }, };
                                   ^
gio/tests/socket.c:630:37: warning: missing field 'vectors' initializer
    GOutputMessage m[3] = { { NULL, }, };
                                    ^
gio/tests/socket.c:631:37: warning: missing field 'vectors' initializer
    GInputMessage im[3] = { { NULL, }, };
                                    ^
gio/tests/socket.c:632:36: warning: missing field 'size' initializer
    GOutputVector v[7] = { { NULL, }, };
                                   ^
gio/tests/socket.c:633:36: warning: missing field 'size' initializer
    GInputVector iv[7] = { { NULL, }, };
                                   ^
gio/tests/socket.c:871:32: warning: missing field 'vectors' initializer
    GInputMessage im = { NULL, };
                               ^
gio/tests/socket.c:872:31: warning: missing field 'size' initializer
    GInputVector iv = { NULL, };
                              ^
2021-05-27 10:16:52 +02:00
Peter Bloomfield
955307208f gapplication: Guard g_application_mark_busy()
The `GApplication` must be registered before calling
`g_application_mark_busy()`. Document that, and add a guard.

The same is true for `g_application_unmark_busy()`, but the existing
documentation and guard for `busy_count > 0` are enough.
2021-05-17 11:50:12 -04:00
Philip Withnall
f71faad46b Merge branch 'th/gdbus-doc-unsubscribe-idle' into 'master'
gdbus: document completion after idle action for g_dbus_connection_signal_unsubscribe()

See merge request GNOME/glib!2050
2021-05-17 10:49:38 +00:00
Philip Withnall
62571c71b5 Merge branch 'Docs' into 'master'
docs: Improved documentation of GNotification

Closes #2405

See merge request GNOME/glib!2102
2021-05-17 10:30:55 +00:00
Nitin Wartkar
e727a69a8b docs: Improved documentation of GNotification 2021-05-17 10:30:54 +00:00
nitinosiris
69be87dda1 docs: Improved the docs of helper getters optimization in g_file_info.c
g_file_info_get_name() gives result faster than g_file_info_get_attribute_byte_string()

Closes #310
2021-05-17 14:26:17 +05:30
Philip Withnall
87e994ef48 Merge branch '1036-dbus-proxy-docs' into 'master'
gdbusproxy: Recommend it is not used for stateless services

Closes #1036

See merge request GNOME/glib!386
2021-05-13 22:25:21 +00:00
Philip Withnall
43c28fcd5a gdbusproxy: Recommend it is not used for stateless services
For the reasons given in the new bit of documentation, GDBusProxy should
not be used for connecting to stateless D-Bus services which may be
restarted at any point.

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

https://gitlab.gnome.org/GNOME/glib/issues/1036
2021-05-13 22:24:26 +01:00
Philip Withnall
7e9585177d tests: Drop use of g_test_bug_base()
Include the base URI in the `g_test_bug()` calls instead. This resolves
inconsistencies between the old bug base (bugzilla.gnome.org) and the
new bug base (gitlab.gnome.org). It also has the advantage that the URI
passed to `g_test_bug()` is now clickable in the code editor, rather
than being split across two locations.

See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/275#note_303175

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-05-13 22:16:27 +01:00