summaryrefslogtreecommitdiff
path: root/gio/gdocumentportal.c
AgeCommit message (Collapse)Author
2022-09-02documentportal: Fix small leak in add_documents with empty URI listSebastian Keller
When called with an empty URI list (or only inaccessible files), g_document_portal_add_documents would not call g_variant_builder_end, leaking the memory allocated by the variant builder. Closes: https://gitlab.gnome.org/GNOME/glib/-/issues/2733
2022-05-18gio: Add SPDX license headers automaticallyPhilip Withnall
Add SPDX license (but not copyright) headers to all files which follow a certain pattern in their existing non-machine-readable header comment. This commit was entirely generated using the command: ``` git ls-files gio/*.[ch] | xargs perl -0777 -pi -e 's/\n \*\n \* This library is free software; you can redistribute it and\/or\n \* modify it under the terms of the GNU Lesser General Public/\n \*\n \* SPDX-License-Identifier: LGPL-2.1-or-later\n \*\n \* This library is free software; you can redistribute it and\/or\n \* modify it under the terms of the GNU Lesser General Public/igs' ``` Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #1415
2019-12-17gio: do not cache document portal D-Bus proxyJames Henstridge
By removing the cached global proxy in gdocumentportal.c, we can re-enable the checks for proper shutdown of the session bus connection in the dbus-appinfo.c test.
2019-01-25gio: make g_document_portal_add_documents() fall back to read-only accessJames Henstridge
2019-01-15gio: don't pass O_PATH descriptors to the document portalJames Henstridge
Like for the OpenURI portal, O_PATH file descriptors do not prove access to the underlying file data. I've used O_RDWR file descriptors here to mirror the requested read/write permissions.
2018-03-28Do not use g_autofreeEmmanuele Bassi
The g_auto macros are available only with GCC-compatible compilers on Unix, but having __attribute__((cleanup)) is not part of our toolchain requirements, so we shouldn't use it — even if we are building on Unix-compatible systems. https://bugzilla.gnome.org/show_bug.cgi?id=794732
2017-08-03Consistently save errno immediately after the operation setting itPhilip Withnall
Prevent the situation where errno is set by function A, then function B is called (which is typically _(), but could be anything else) and it overwrites errno, then errno is checked by the caller. errno is a horrific API, and we need to be careful to save its value as soon as a function call (which might set it) returns. i.e. Follow the pattern: int errsv, ret; ret = some_call_which_might_set_errno (); errsv = errno; if (ret < 0) puts (strerror (errsv)); This patch implements that pattern throughout GLib. There might be a few places in the test code which still use errno directly. They should be ported as necessary. It doesn’t modify all the call sites like this: if (some_call_which_might_set_errno () && errno == ESOMETHING) since the refactoring involved is probably more harmful than beneficial there. It does, however, refactor other call sites regardless of whether they were originally buggy. https://bugzilla.gnome.org/show_bug.cgi?id=785577
2017-05-29Add a wrapper for the AddFull document portal apiMatthias Clasen
This is a wrapper which takes a list of uris and rewrites them by calling AddFull with the file:// uris. https://bugzilla.gnome.org/show_bug.cgi?id=783130
2017-05-29gio/: LGPLv2+ -> LGPLv2.1+Sébastien Wilmet
Sub-directories inside gio/ already processed in a previous commit: - fam/ - gdbus-2.0/ (which contains only codegen/) - gvdb/ - inotify/ - tests/ - win32/ - xdgmime/ Other sub-directories inside gio/: - completion/: no license headers - kqueue/: not LGPL, BSD-style license https://bugzilla.gnome.org/show_bug.cgi?id=776504
2016-07-21Deal with lack of O_CLOEXECMatthias Clasen
Some platforms don't have it. We fall back to fcntl() in other places, so do it here as well. https://bugzilla.gnome.org/show_bug.cgi?id=769042
2016-07-13documents portal: Make sure O_PATH is definedMatthias Clasen
FreeBSD doesn't have it. https://bugzilla.gnome.org/show_bug.cgi?id=768780
2016-07-12documentportal: print warnings when document portal fails to initializeCosimo Cecchi
Instead of siletly failing or calling a method on a NULL instance.
2016-07-11appinfo: support opening files through document portalCosimo Cecchi
In addition to URIs, we now also support opening files internal to the sandboxed application through the document portal.