History log of /freebsd-14.2/lib/libfetch/fetch.c (Results 1 – 25 of 58)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: release/13.4.0-p5, release/13.5.0-p1, release/14.2.0-p3, release/13.5.0, release/14.2.0-p2, release/14.1.0-p8, release/13.4.0-p4, release/14.1.0-p7, release/14.2.0-p1, release/13.4.0-p3, release/14.2.0, release/13.4.0
# ab7a7980 21-Aug-2024 Pietro Cerutti <[email protected]>

libfetch: don't include fragments in HTTP requests

Fragments are reserved for client-side processing, see
https://www.rfc-editor.org/rfc/rfc9110.html#section-7.1

Also, some servers don't like to re

libfetch: don't include fragments in HTTP requests

Fragments are reserved for client-side processing, see
https://www.rfc-editor.org/rfc/rfc9110.html#section-7.1

Also, some servers don't like to receive HTTP requests with fragments.

```
$ fetch 'https://dropbox.com/a/b'
fetch: https://dropbox.com/a/b: Not Found

$ fetch 'https://dropbox.com/a/b#'
fetch: https://dropbox.com/a/b#: Bad Request
```

This is a real-world scenario, where some download link from dropbox
(eventually) redirects to an URL with a fragment:

```
$ fetch -v 'https://www.dropbox.com/sh/<some>/<thing>?dl=1' 2>&1 | grep requesting
requesting https://www.dropbox.com/sh/<some>/<thing>?dl=1
requesting https://www.dropbox.com/scl/fo/<foo>/<bar>?rlkey=<baz>&dl=1
requesting https://<boo>.dl.dropboxusercontent.com/zip_download_get/<some-long-strig>#
```

See how the last redirect ends with a `#`.

Currently, libfetch includes the ending fragment and makes it impossible
to download the file.

Differential Revision: https://reviews.freebsd.org/D46318
MFC after: 2 weeks

(cherry picked from commit 1af7d5f389536a2f391153513d95d92ffdf360e4)

show more ...


Revision tags: release/14.1.0
# 72c3d912 25-Mar-2024 Ka Ho Ng <[email protected]>

libfetch: parse scheme://domain:/ correctly

This improves URL-parsing compability with cURL, and unbreaks parsing of
similar kinds of URLs after commit 8d9de5b10a24.

Sponsored by: Juniper Networks,

libfetch: parse scheme://domain:/ correctly

This improves URL-parsing compability with cURL, and unbreaks parsing of
similar kinds of URLs after commit 8d9de5b10a24.

Sponsored by: Juniper Networks, Inc.
Reviewed by: des
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D44493

(cherry picked from commit fb860ed0c52c2c1e7792ef86718620a439663c7f)

show more ...


Revision tags: release/13.3.0, release/14.0.0
# 1d386b48 16-Aug-2023 Warner Losh <[email protected]>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


Revision tags: release/13.2.0, release/12.4.0, release/13.1.0, release/12.3.0, release/13.0.0, release/12.2.0, release/11.4.0
# 83372bda 05-Feb-2020 Ed Maste <[email protected]>

libfetch: disallow invalid escape sequences

Per RFC1738 escape is "% hex hex"; other sequences do not form a valid URL.

Suggested by: Matthew Dillon
Reviewed by: Matthew Dillon
MFC after: 1 week


# 6fb3f994 28-Jan-2020 Gordon Tetlow <[email protected]>

Fix urldecode buffer overrun.

Reported by: Duncan Overbruck
Security: CVE-2020-7450


Revision tags: release/12.1.0, release/11.3.0, release/12.0.0
# 8d9de5b1 27-Nov-2018 Dag-Erling Smørgrav <[email protected]>

Improve URL parsing. In particular, convert scheme and host to lowercase.

MFC after: 1 week


Revision tags: release/11.2.0
# 5f04ebd4 29-May-2018 Dag-Erling Smørgrav <[email protected]>

Fix an inverted conditional in the netrc code, which would ignore the
value of $HOME and always use the home directory from the passwd
database, unless $HOME was unset, in which case it would use (nu

Fix an inverted conditional in the netrc code, which would ignore the
value of $HOME and always use the home directory from the passwd
database, unless $HOME was unset, in which case it would use (null).

While there, clean up handling of netrcfd and add debugging aids.

MFC after: 3 weeks

show more ...


# c5712d6d 29-May-2018 Dag-Erling Smørgrav <[email protected]>

Use __VA_ARGS__ to simplify the DEBUG macro.

MFC after: 3 weeks


# 5e53a4f9 26-Nov-2017 Pedro F. Giffuni <[email protected]>

lib: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using mis-identified many licenses so this was mostly a manual - error
pr

lib: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using mis-identified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

show more ...


Revision tags: release/10.4.0, release/11.1.0
# 08a49957 17-Mar-2017 Dag-Erling Smørgrav <[email protected]>

r308996 broke IP literals by assuming that a colon could only occur as
a separator between host and port, and using strchr() to search for it.
Rewrite fetch_resolve() so it handles bracketed literals

r308996 broke IP literals by assuming that a colon could only occur as
a separator between host and port, and using strchr() to search for it.
Rewrite fetch_resolve() so it handles bracketed literals correctly, and
remove similar code elsewhere to avoid passing unbracketed literals to
fetch_resolve(). Remove #ifdef INET6 so we still parse IP literals
correctly even if we do not have the ability to connect to them.

While there, fix an off-by-one error which caused HTTP 400 errors to be
misinterpreted as redirects.

PR: 217723
MFC after: 1 week
Reported by: bapt, bz, cem, ngie

show more ...


# 5d1ce10b 03-Mar-2017 Baptiste Daroussin <[email protected]>

Properly initialize netrcfd in fetchParseURL

This fixes ftp with fetch(1) which was broken after r313974

Submitted by: dim
Reported by: olivier
Pointyhat to: bapt


# d8713bf3 20-Feb-2017 Baptiste Daroussin <[email protected]>

Add a file descriptor in struct url for netrc

When using libfetch in an application that drops privileges when fetching
like pkg(8) then user complain because the application does not read anymore
$

Add a file descriptor in struct url for netrc

When using libfetch in an application that drops privileges when fetching
like pkg(8) then user complain because the application does not read anymore
${HOME}/.netrc. Now a caller can prepare a fd to the said file and manually
assign it to the structure.

It is also a first step to allow to capsicumize libfetch applications

Reviewed by: allanjude, des
Approved by: des
Differential Revision: https://reviews.freebsd.org/D9678

show more ...


Revision tags: release/11.0.1, release/11.0.0, release/10.3.0, release/10.2.0, release/10.1.0, release/9.3.0, release/10.0.0, release/9.2.0
# 9bc22394 29-Jun-2013 Tim Kientzle <[email protected]>

Fix -Wunsequenced warning.

Submitted by: [email protected]


Revision tags: release/8.4.0, release/9.1.0
# 0fa39199 11-Apr-2012 Ed Maste <[email protected]>

Support percent-encoded user and password

RFC 1738 specifies that any ":", "@", or "/" within a user name or
password in a URL is percent-encoded, to avoid ambiguity with the use
of those characters

Support percent-encoded user and password

RFC 1738 specifies that any ":", "@", or "/" within a user name or
password in a URL is percent-encoded, to avoid ambiguity with the use
of those characters as URL component separators.

Reviewed by: rstone@
MFC after: 1 month

show more ...


Revision tags: release/8.3.0_cvs, release/8.3.0, release/9.0.0
# 578153f1 19-Oct-2011 Dag-Erling Smørgrav <[email protected]>

latin1 -> utf8


# 6337341d 27-Sep-2011 Dag-Erling Smørgrav <[email protected]>

Update copyright dates and strip my middle name.


Revision tags: release/7.4.0_cvs, release/8.2.0_cvs, release/7.4.0, release/8.2.0, release/8.1.0_cvs, release/8.1.0, release/7.3.0_cvs, release/7.3.0, release/8.0.0_cvs, release/8.0.0, release/7.2.0_cvs, release/7.2.0, release/7.1.0_cvs, release/7.1.0
# e8f612b6 17-Dec-2008 Murray Stokely <[email protected]>

1. Update fetch to consistently return 1 on error, as the man page states,
rather than usually returning 1 but in a few instances using a sysexits(3)
return value.

2. Remove a few unused varia

1. Update fetch to consistently return 1 on error, as the man page states,
rather than usually returning 1 but in a few instances using a sysexits(3)
return value.

2. Remove a few unused variables from libfetch.

PR: docs/122470 (1, only)
Reviewed by: des

show more ...


Revision tags: release/6.4.0_cvs, release/6.4.0, release/7.0.0_cvs, release/7.0.0, release/6.3.0_cvs, release/6.3.0
# facd9827 19-Dec-2007 Dag-Erling Smørgrav <[email protected]>

As several people pointed out, I did all the ctype casts the wrong
way (not for the first time...)

Noticed by: bde, ru ++
MFC after: 1 week


# 836e34ee 18-Dec-2007 Dag-Erling Smørgrav <[email protected]>

Old patch I had lying around: correctly cast the argument to is*().
IWBNI gcc could warn about this the way it warns about printf() abuse.

MFC after: 1 week


# a1b37df2 14-Dec-2007 Dag-Erling Smørgrav <[email protected]>

Clean up namespace violations.

MFC after: 1 week


Revision tags: release/6.2.0_cvs, release/6.2.0, release/5.5.0_cvs, release/5.5.0, release/6.1.0_cvs, release/6.1.0, release/6.0.0_cvs, release/6.0.0, release/5.4.0_cvs, release/5.4.0, release/4.11.0_cvs, release/4.11.0, release/5.3.0_cvs, release/5.3.0
# 2cbbf9da 21-Sep-2004 Dag-Erling Smørgrav <[email protected]>

Update copyright years.


Revision tags: release/4.10.0_cvs, release/4.10.0, release/5.2.1_cvs, release/5.2.1, release/5.2.0_cvs, release/5.2.0, release/4.9.0_cvs, release/4.9.0, release/5.1.0_cvs, release/5.1.0, release/4.8.0_cvs, release/4.8.0
# 930105c1 28-Jan-2003 Dag-Erling Smørgrav <[email protected]>

style(9): add parentheses to sizeof even when not strictly required.

MFC after: 3 days


# 02e6bec1 22-Jan-2003 Dag-Erling Smørgrav <[email protected]>

Initialization paranoia.


Revision tags: release/5.0.0_cvs, release/5.0.0, release/4.7.0_cvs, release/4.6.2_cvs, release/4.6.2, release/4.6.1, release/4.6.0_cvs
# 111e2510 05-Jun-2002 Dag-Erling Smørgrav <[email protected]>

Add SSL support + slight cleanup.

Submitted by: Henry Whincup <[email protected]> (in principle)


# e19e6098 05-Feb-2002 Dag-Erling Smørgrav <[email protected]>

Reindent, and add parentheses to return statements. Some functions in
ftp.c and http.c now have exceedingly long lines due to deep nesting;
this will be corrected by reorganizing the code in a later

Reindent, and add parentheses to return statements. Some functions in
ftp.c and http.c now have exceedingly long lines due to deep nesting;
this will be corrected by reorganizing the code in a later revision.

show more ...


123