Commit Graph

22274 Commits

Author SHA1 Message Date
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
Matthias Clasen
0992978202 timezone: Fix an uninitialized use
GTK ci rightly complains about this when ti builds
GLib as a subproject with -Werror=maybe-uninitialized.

subkey_dynamic_w will be freed without being initialized
when the first goto is taken.
2020-07-31 14:04:21 -04:00
Marc-André Lureau
20ae4b46d4 uri: do not add ipv6 brackets on non-ip host
The heuristic is a bit too agressive, as we may have hostname with
%-encoded ':' (as shown in GVfs URI tests).

Add an extra test to check :-decoding as well.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-07-30 21:37:34 +04:00
Daniel Mustieles
7ce6a01f99 Updated Spanish translation 2020-07-29 12:07:49 +02:00
Matthias Clasen
8f960c79e9 Merge branch 'appinfo-properties' into 'master'
appinfo: Add properties

See merge request GNOME/glib!1582
2020-07-29 01:20:50 +00:00
Matthias Clasen
9193fd529f Add a missing include 2020-07-28 17:29:47 -04:00
Hans Petter Jansson
4c5ccd3e8f gslice: Allow inlining of memset() in g_slice_new0() macro
Inlining the memset() is beneficial since the size here is constant
and usually small.

Closes #5
2020-07-28 18:22:21 +02:00
Marc-André Lureau
0fea3d71e4 guri: add some IPv6 scope-id tests
Add a few ipv6 scope parsing corner test cases.

- checking incorrect scoped IPv6 ending with only %25 isn't decoded.
- checking valid scoped IPv6 is passing g_uri_is_valid()

As discussed in
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1567#note_860499,
for historical reasons, GUri accepts the % preceding the zone-id in the
unescaped form as well.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-07-28 16:48:01 +04:00
Marc-André Lureau
dd0fae1303 gio: remove _g_uri_parse_authority()
It is now unused and redundant with GUri.

Fixes: #2156

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-07-28 16:35:13 +04:00
Marc-André Lureau
aa0b09ebef gio: use g_uri_split_network() in g_simple_proxy_resolver_lookup()
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-07-28 16:35:05 +04:00
Marc-André Lureau
1b6a0535e8 gio: use g_uri_split_with_user() in save_userinfo()
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-07-28 16:32:50 +04:00
Marc-André Lureau
6f419e7e2f gio: use g_uri_split_network() in g_network_address_parse_uri()
_g_uri_parse_authority() can be replaced with g_uri_split_network() &
PARSE_STRICT. Keep the original error code, for compatibility reasons.

Notice that GUri uses gint for the port, and value -1 if the port value
is missing. However, GNetworkAddress::port is a guint.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-07-28 16:31:11 +04:00
Marc-André Lureau
a173a6f617 gio: use g_uri_is_valid()
_g_uri_parse_authority() without argument is actually checking that the
URI is valid, by checking it parses successfully

We keep the existing error domain / code for compatibility reasons,
instead of raising the underlying G_URI_ERROR.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-07-28 16:15:50 +04:00
Marc-André Lureau
034a4dcdc0 gio: replace _g_uri_from_authority() with g_uri_join()
_g_uri_from_authority() is doing the same work as g_uri_join(): taking
URI components and merging them in a legit URI string, with encoding.

It turns out g_uri_from_authority was unnecessarily complex, since no
caller used the userinfo field.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-07-28 16:12:37 +04:00
Marc-André Lureau
82ad7853ba uri: change g_uri_is_valid() to check absolute URI
g_uri_is_valid() should check the given URI is valid following RFC-3986,
and reject relative references.

Fixes: https://gitlab.gnome.org/GNOME/glib/-/issues/2169

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-07-28 15:44:43 +04:00
Marc-André Lureau
44d4640c47 uri: rename absolute & relative uri_string to uri_ref
Let's reserve the term URI for absolute URIs, following rfc3986
terminology.

See:
https://gitlab.gnome.org/GNOME/glib/-/issues/2169

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-07-28 15:07:08 +04:00
Marc-André Lureau
d625a29b28 uri: add a comment about temporary GUri construction
As pointed out in the discussion of:
https://gitlab.gnome.org/GNOME/glib/-/issues/2169

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-07-28 14:54:55 +04:00
Marc-André Lureau
19c0db3185 uri: improve some documentation about absolute URIs
As pointed out in the discussion
https://gitlab.gnome.org/GNOME/glib/-/issues/2169.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-07-28 14:54:55 +04:00
Marc-André Lureau
3521763532 uri: add some note about the API scope
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-07-28 14:54:42 +04:00
Matthias Clasen
df7f35e81a Apply 1 suggestion(s) to 1 file(s) 2020-07-27 19:49:05 +00:00
Matthias Clasen
b5fc5d6423 Apply 1 suggestion(s) to 1 file(s) 2020-07-27 19:48:50 +00:00
Matthias Clasen
c10a0a390a Apply 1 suggestion(s) to 1 file(s) 2020-07-27 19:48:41 +00:00
Matthias Clasen
65263ced54 Apply 1 suggestion(s) to 1 file(s) 2020-07-27 19:48:36 +00:00
Matthias Clasen
2301d75a94 Apply 1 suggestion(s) to 1 file(s) 2020-07-27 19:48:31 +00:00
Matthias Clasen
c213000e25 Apply 1 suggestion(s) to 1 file(s) 2020-07-27 19:48:26 +00:00
Matthias Clasen
d9757ab033 Apply 1 suggestion(s) to 1 file(s) 2020-07-27 19:48:21 +00:00
Matthias Clasen
921e2ee6e3 Apply 1 suggestion(s) to 1 file(s) 2020-07-27 19:48:15 +00:00
Matthias Clasen
bad7efc0ea Apply 1 suggestion(s) to 1 file(s) 2020-07-27 19:48:11 +00:00