Commit Graph

22401 Commits

Author SHA1 Message Date
Efstathios Iosifidis
b7db04865d Update Greek translation 2020-08-08 16:06:14 +00:00
Yuri Chornoivan
55018d3f99 Update Ukrainian translation 2020-08-08 15:00:20 +00:00
Emin Tufan Çetin
b660ffe161 Update Turkish translation 2020-08-07 15:04:24 +00:00
Philip Withnall
b99008f57f 2.65.1
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-08-07 15:29:26 +01:00
Philip Withnall
e30fc2e116 Merge branch 'uri-tweaks' into 'master'
Various GUri code, documentation and API fixes

Closes #2149

See merge request GNOME/glib!1610
2020-08-07 14:14:29 +00:00
Philip Withnall
cacf9c2926 guri: Add various small new tests to increase branch coverage
Nothing particularly interesting or major.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-08-07 14:02:18 +01:00
Philip Withnall
b654eb1846 guri: Make G_URI_FLAGS_PARSE_STRICT the default
Make `G_URI_FLAGS_PARSE_RELAXED` available instead, for the
implementations which need to handle user-provided or incorrect URIs.
The default should nudge people towards being compliant with RFC 3986.

This required also adding a new `G_URI_PARAMS_PARSE_RELAXED` flag, as
previously parsing param strings *always* used relaxed mode and there
was no way to control it. Now it defaults to using strict mode, and the
new flag allows for relaxed mode to be enabled if needed.

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

Fixes: #2149
2020-08-07 14:02:18 +01:00
Philip Withnall
943b1e45ab guri: Don’t fail g_uri_is_valid() if URI is missing a hostname
According to my reading of
https://tools.ietf.org/html/rfc3986#section-4, the only requirement for
a URI to be ‘absolute’ (actually, not a relative reference) is for the
scheme to be specified. A hostname doesn’t have to be specified: see any
of the options in the `hier-part` production in
https://tools.ietf.org/html/rfc3986#appendix-A which don’t include
`authority`.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-08-07 14:02:18 +01:00
Philip Withnall
b5c59cc3fc guri: Use gssize for array/string lengths
This reduces the possibility for overflow, and makes the code a little
more conventional to read.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-08-07 14:02:18 +01:00
Philip Withnall
e446c3487b guri: Change type of g_uri_escape_bytes() to use guint8
`guint8` is the conventional way in modern GLib APIs to represent ‘a byte
which could contain arbitrary binary’. `guchar` is not advised for that
(even though it’s equivalent) because it could be misread as `gchar`.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-08-07 14:02:18 +01:00
Philip Withnall
ceda9755de guri: Clear return values on error from g_uri_params_iter_next()
This reduces the chance of the caller accidentally double-freeing or
use-after-free-ing something.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-08-07 14:02:18 +01:00
Philip Withnall
83597b9e57 guri: Use NONE values of flags rather than 0
This introduces no functional changes, but makes the code a little
easier to read.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-08-07 14:02:18 +01:00
Philip Withnall
41a21c3566 guri: Add links to RFC 3986 in code comments
This should make the RFC easier to refer to in future.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-08-07 14:02:18 +01:00
Philip Withnall
f873b88f89 guri: Add G_URI_HIDE_QUERY
Sometimes there are sensitive details in URI query components, so we
should provide the option for hiding them too.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-08-07 14:02:18 +01:00
Philip Withnall
ae6a0ef8b8 guri: Tweak quotes in error strings
Use nice curly Unicode quotes.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-08-07 14:02:18 +01:00
Philip Withnall
40873f8452 guri: Use g_steal_pointer() to make ownership transfer clearer
This introduces no functional changes, just makes the code a bit easier
to read.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-08-07 14:02:18 +01:00
Philip Withnall
de0ebf8a5f guri: Minor code formatting fixes
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-08-07 14:02:18 +01:00
Philip Withnall
1f1efbbb05 guri: Rename G_URI_ERROR_MISC to G_URI_ERROR_FAILED
This brings its naming in line with the ‘generic’ error codes in other
error domains.

This is not an API break since `GUriError` hasn’t been in a release yet.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-08-07 14:02:18 +01:00
Philip Withnall
ff60d2ebf5 guri: Various minor documentation tweaks and improvements
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-08-07 14:02:17 +01:00
Sebastian Dröge
602b7cca33 Merge branch 'uri-path-slashes' into 'master'
guri: Document and check restrictions on path prefixes

See merge request GNOME/glib!1612
2020-08-07 12:57:17 +00:00
Sebastian Dröge
cff78507dc Merge branch 'uri-bees' into 'master'
guri: Always prepend `//` to the host when building a URI

See merge request GNOME/glib!1611
2020-08-07 12:38:49 +00:00
Philip Withnall
89cf298b19 guri: Document and check restrictions on path prefixes
RFC 3986, section 3 says:
> The scheme and path components are required, though the path may be
> empty (no characters).  When authority is present, the path must
> either be empty or begin with a slash ("/") character.  When
> authority is not present, the path cannot begin with two slash
> characters ("//").  These restrictions result in five different ABNF
> rules for a path (Section 3.3), only one of which will match any
> given URI reference.

(See https://tools.ietf.org/html/rfc3986#section-3.)

Given that those conditions are almost always going to be true, and that
typically the number and form of arguments passed to g_uri_join() will
be known at compile time, it would be unnecessarily awkward to add a
`GError` argument to g_uri_join() to detect these situations.

Instead, add precondition checks and document the restrictions.
Developers are responsible for ensuring their paths are in the right
format themselves.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-08-07 13:24:12 +01:00
Philip Withnall
623cb10f55 guri: Always prepend // to the host when building a URI
This is needed to distinguish the host (‘authority’ in the terms of RFC
3986) from a path if a scheme is not present.

It can be seen from the grammar in RFC 3986
(https://tools.ietf.org/html/rfc3986#appendix-A) that `authority` only
ever appears after `"//"`.

Spotted by Simon McVittie in
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1606#note_884893.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-08-07 12:51:31 +01:00
Sebastian Dröge
13ad6ab83c Merge branch 'patch-1' into 'master'
Fix multiple typos in guri.c

See merge request GNOME/glib!1609
2020-08-06 14:36:51 +00:00
Felix Yan
161168c672 Fix multiple typos in guri.c 2020-08-06 14:18:01 +00:00
Sebastian Dröge
d7e0fde3ca Merge branch 'dont-use-gnulib-ios' into 'master'
meson: Don't use gnulib for printf on iOS

Closes #1868

See merge request GNOME/glib!1607
2020-08-06 06:07:46 +00:00
Nirbheek Chauhan
77f9b0b9d5 meson: Don't use gnulib for printf on iOS
iOS and tvOS use the same printf family as macOS, and these all have
been available on macOS for a long time.

Closes https://gitlab.gnome.org/GNOME/glib/-/issues/1868
2020-08-06 05:16:15 +05:30
Sebastian Dröge
a2c8f6f719 Merge branch 'guri-join-schemeless' into 'master'
uri: allow to join a partial URI, without scheme

Closes #2166

See merge request GNOME/glib!1606
2020-08-05 19:14:21 +00:00
Marc-André Lureau
0ba7ebfda9 uri: allow to join a partial URI, without scheme
Fixes: #2166

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-08-05 22:40:08 +04:00
Philip Withnall
bb1df0e515 Merge branch 'uri-params-iter' into 'master'
Add GUriParamsIter

See merge request GNOME/glib!1572
2020-08-05 16:07:42 +00:00
Philip Withnall
df8dc7fc38 Merge branch 'guri-gio' into 'master'
Replace _g_uri_parse_authority() with GUri

Closes #2156

See merge request GNOME/glib!1567
2020-08-05 16:06:02 +00:00
Philip Withnall
71d1a28afb Merge branch 'ipv6-zoneid' into 'master'
Make g_hostname_is_ip_address() accept ipv6 zoneid

See merge request GNOME/glib!1604
2020-08-05 16:00:32 +00:00
Philip Withnall
931496b93a Merge branch 'replace-destination' into 'master'
GFile: Document that G_FILE_CREATE_REPLACE_DESTINATION can only be used with...

See merge request GNOME/glib!1594
2020-08-05 15:39:34 +00:00
Marc-André Lureau
3bcc6fd39f guri: add a test to check ipv6 with zoneid URI to string
The test was failing since commit 20ae4b46d ("uri: do not add ipv6
brackets on non-ip host").

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-08-05 18:50:13 +04:00
Marc-André Lureau
03550ec097 hostutils: accept zoneid in IPv6 addresses
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-08-05 18:50:13 +04:00
Philip Withnall
1c08f55c6d Merge branch 'wip/oholy/x-gvfs-notrash' into 'master'
Add support to ignore trash for certain mounts

See merge request GNOME/glib!1549
2020-08-05 13:25:05 +00:00
Ondrej Holy
4602a5ee17 gfile: Add support for x-gvfs-notrash option to ignore mounts
Add support for x-gvfs-notrash mount option, which allows to disable
trash functionality for certain mounts. This might be especially useful
e.g. to prevent trash folder creation on enterprise shares, which are
also accessed from Windows...

https://bugzilla.redhat.com/show_bug.cgi?id=1096200
2020-08-05 13:07:04 +01:00
Ondrej Holy
0d6b17584a gunixmounts: Add g_unix_mount_point_at
There is already g_unix_mount_at function which allows to find certain
unix mount for given mount path. It would be useful to have similar
function for mount points, which will allow to replace custom codes in
gvfs. Let's add g_unix_mount_point_at.
2020-08-05 13:07:04 +01:00
Marc-André Lureau
5767eef895 uri: add GUriParamsIter
See also:
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1328#note_863735
2020-08-04 20:10:57 +04:00
Sebastian Dröge
50343afb6e Merge branch 'uri-userinfo-enc' into 'master'
uri: do not encode ':' and ';' from userinfo

See merge request GNOME/glib!1600
2020-08-04 13:33:18 +00:00
Sebastian Dröge
48ad40aca3 Merge branch 'uri-encoded-parts' into 'master'
uri: add ENCODED_PATH & ENCODED_FRAGMENT flags

See merge request GNOME/glib!1595
2020-08-04 13:13:52 +00:00
Marc-André Lureau
ef173e2e75 uri: do not encode ':' and ';' from userinfo
The g_uri_join_internal() function was making a simplification that
userinfo can be encoded with the same restricted character set as the
user field alone, fix this by allowing the correct character set.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-08-04 17:10:06 +04:00
Marc-André Lureau
c354c404c6 tests/uri: check user field is correctly encoded
Suggested-by: Dan Winship <danw@gnome.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-08-04 17:10:06 +04:00
Marc-André Lureau
4c20ea477c uri: always add G_URI_FLAGS_HAS_PASSWORD with build_with_user()
Otherwise, the to_string() encoding will not be reversible. Furthermore,
if no distinction is needed in the first place, g_uri_build() with
userinfo should be used instead.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-08-04 17:10:06 +04:00
Marc-André Lureau
b0f9af0e1d uri: do not encode userinfo fields
g_uri_build_with_user() builds a userinfo, but it shouldn't encode it
itself, but let the user flags declare what's there. Otherwise,
to_string() code paths may encode a second time.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-08-04 17:03:30 +04:00
Marc-André Lureau
c9c349aeaa uri: add ENCODED_PATH & ENCODED_FRAGMENT flags
Add encoded flags, similar to what was done in commit 7bee36b4 ("uri:
add G_FLAGS_ENCODED_QUERY").

SoupURI has manual handling of encoded path & fragment, but it can rely
on GUri decoding for the rest.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-08-04 16:56:19 +04:00
Sebastian Dröge
a97fe4e863 Merge branch 'uri-ipv6-bkt' into 'master'
uri: do not add ipv6 brackets on non-ip host

See merge request GNOME/glib!1599
2020-08-04 12:44:12 +00:00
Matthias Clasen
e3b6f20b77 Merge branch 'revert-8f960c79' into 'master'
Revert "Merge branch 'appinfo-properties' into 'master'"

See merge request GNOME/glib!1602
2020-08-02 21:14:43 +00:00
Matthias Clasen
96d39f86b5 Revert "Merge branch 'appinfo-properties' into 'master'"
This reverts merge request !1582
2020-08-02 21:02:03 +00:00
Matthias Clasen
5b3da6ea34 Merge branch 'fix-uninitialized-use' into 'master'
timezone: Fix an uninitialized use

See merge request GNOME/glib!1601
2020-08-02 02:18:19 +00:00