mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-02 07:23:41 +02:00
gapplication: Validate types of well-known platform data keys
The platform data comes from the parent process, which should normally be considered trusted (if we don’t trust it, it can do all sorts of other things to mess this process up, such as setting `LD_LIBRARY_PATH`). However, it can also come from any process which calls `CommandLine` over D-Bus, so always has to be able to handle untrusted input. In particular, `v`-typed `GVariant`s must always have their dynamic type validated before having values of a static type retrieved from them. Includes unit tests. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #1904
This commit is contained in:
@@ -95,8 +95,11 @@ struct _GApplicationClass
|
||||
gchar ***arguments,
|
||||
int *exit_status);
|
||||
|
||||
/* @platform_data comes from an external process and is untrusted. All value types
|
||||
* must be validated before being used. */
|
||||
void (* before_emit) (GApplication *application,
|
||||
GVariant *platform_data);
|
||||
/* Same as for @before_emit. */
|
||||
void (* after_emit) (GApplication *application,
|
||||
GVariant *platform_data);
|
||||
void (* add_platform_data) (GApplication *application,
|
||||
|
Reference in New Issue
Block a user