summaryrefslogtreecommitdiff
path: root/libavformat/ftp.c
Commit message (Collapse)AuthorAgeFilesLines
* lavf/ftp: check for truncation in snprintfAnton Khirnov2021-12-071-12/+52
| | | | | | | | | | | Silences e.g. the following warning in gcc 10: src/libavformat/ftp.c: In function ‘ftp_move’: src/libavformat/ftp.c:1122:46: warning: ‘%s’ directive output may be truncated writing up to 4095 bytes into a region of size 4091 [-Wformat-truncation=] 1122 | snprintf(command, sizeof(command), "RNTO %s\r\n", path); | ^~ ~~~~ src/libavformat/ftp.c:1122:5: note: ‘snprintf’ output between 8 and 4103 bytes into a destination of size 4096 1122 | snprintf(command, sizeof(command), "RNTO %s\r\n", path); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* avformat/ftp: Check for av_strtok() failureMichael Niedermayer2021-07-031-0/+2
| | | | | | Fixes: CID1396258 Dereference null return value Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/ftp: Fix for invalid use of av_strtokLimin Wang2020-05-101-6/+8
| | | | | | | | | | By the av_strtok() description: * On the first call to av_strtok(), s should point to the string to * parse, and the value of saveptr is ignored. In subsequent calls, s * should be NULL, and saveptr should be unchanged since the previous * call. Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/ftp: slightly rework file retrieval with seekingMarton Balint2020-02-151-29/+25
| | | | | | | | | | | - do not require a known file size for seek to work - read the files till the actual end, do not limit data at the queried file size - fix a bug which causes reading 0 byte files for non-existing files - properly check the return status of the FTP server at the end of the file retrieval Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/ftp: do not break protocol on username or password with newlinesMarton Balint2020-02-151-0/+6
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/ftp: add support for escaped credentialsMarton Balint2020-02-151-9/+17
| | | | | | Properly fixes ticket #7816. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/ftp: add AVOptions for authenticationNicolas Frattaroli2019-11-031-5/+16
| | | | | | | | | | | | | | | | | This introduces two new AVOption options for the FTP protocol, one named ftp-user to supply the username to be used for auth, one named ftp-password to supply the password to be used for auth. These are useful for when an API user does not wish to deal with URL manipulation and percent encoding. Setting them while also having credentials in the URL will use the credentials from the URL. The rationale for this is that credentials embedded in the URL are probably more specific to what the user is trying to do than anything set by some API user. Signed-off-by: Nicolas Frattaroli <ffmpeg@fratti.ch> Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/ftp: Fix Out-of-Bounds Access and Information Leak in ftp.c:393Wenxiang Qian2019-02-171-1/+1
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/ftp: allow nonstandard 202 reply to OPTS UTF8Marton Balint2018-11-041-2/+3
| | | | | | Fixes ticket #7481. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/ftp: return AVERROR_EOF for EOFMarton Balint2018-11-011-2/+2
| | | | | | Without this FTP just hangs on eof... Signed-off-by: Marton Balint <cus@passwd.hu>
* lavf/ftp: Remove an unneeded forward declaration.Carl Eugen Hoyos2018-10-091-2/+0
|
* avformat/ftp: Solve a crash bug when network occur a exceptiontiejun.peng@foxmail.com2017-04-051-0/+3
| | | | | | | | | | This fixes a proble where ffmpeg would cause crash to do a seek when the network disconnect. The log like this: 01-01 10:53:03.441 6580 6580 F DEBUG : backtrace: 01-01 10:53:03.441 6580 6580 F DEBUG : #00 pc 0002942e /system/lib/libavformat.so (ffurl_write+9) Signed-off-by: tiejun.peng <tiejun.peng@foxmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit 'fab8156b2f30666adabe227b3d7712fd193873b1'Derek Buitenhuis2016-04-211-2/+2
| | | | | | | * commit 'fab8156b2f30666adabe227b3d7712fd193873b1': avio: Copy URLContext generic options into child URLContexts Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* avformat/ftp: Support response code 125 for STOR and RETR commandsRaymond Hilseth2016-03-071-4/+8
| | | | | | | | | This fixes a problem where ffmpeg would hang if there is already an open data connection, and the server sends a 125 response code in reply to a STOR or RETR command. Signed-off-by: Raymond Hilseth <rhi@vizrt.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat: Add a protocol blacklisting APIDerek Buitenhuis2016-03-041-2/+2
| | | | Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* Merge commit '2758cdedfb7ac61f8b5e4861f99218b6fd43491d'Derek Buitenhuis2016-02-291-1/+1
| | | | | | | | | | | This commit also disables the async fate test, because it used internal APIs in a non-kosher way, which no longer exists. * commit '2758cdedfb7ac61f8b5e4861f99218b6fd43491d': lavf: reorganize URLProtocols Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* Update demuxers and protocols for protocol whitelist supportMichael Niedermayer2016-02-021-4/+7
| | | | | Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat: use AV_OPT_TYPE_BOOL in a bunch of placesClément Bœsch2015-12-041-1/+1
|
* avformat/ftp: use correct enum typeGanesh Ajjanagadde2015-08-201-1/+1
| | | | | | | | Fixes -Wenum-conversion from http://fate.ffmpeg.org/report.cgi?time=20150820031140&slot=arm64-darwin-clang-apple-5.1 Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf/ftp: implement move and delete callbacksMariusz Szczepańczyk2015-08-201-0/+61
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Replace av_dlog with ff_dlog.Ronald S. Bultje2015-08-181-11/+12
| | | | | ff_dlog checks compilability, and is non-public. av_dlog is deprecated and no longer exists if FF_API_DLOG=0.
* lavf/ftp: implement NLST methodMariusz Szczepańczyk2015-08-141-14/+81
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/ftp: Use av_freep() for dir_bufferMichael Niedermayer2015-08-101-1/+1
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf/ftp: properly read an empty pathMariusz Szczepańczyk2015-08-101-10/+8
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf/ftp: implement directory listing callbacksLukasz Marek2015-08-101-11/+182
| | | | | Signed-off-by: Lukasz Marek <lukasz.m.luki2 at gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf/ftp: remove fixed length buffers from contextLukasz Marek2015-04-031-7/+17
| | | | | | It saves some memory. Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
* lavf/ftp: parse user and password onceLukasz Marek2015-04-031-23/+31
| | | | Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
* libavformat/ftp: Do not leak memory in routine ftp_featuresAlexander Strasser2014-08-261-1/+6
| | | | | | | | | | | | | Setting the pointer to NULL inside both ftp_send_command and ftp_features is redundant. Generally always setting to NULL in ftp_send_command seems safer, but throughout the file that parameter was always passed initialized. So I do it here too for consistency. Should fix CID1231988 (RESOURCE_LEAK) OKed-by: Lukasz Marek <lukasz.m.luki2@gmail.com> Signed-off-by: Alexander Strasser <eclipse7@gmx.net>
* Use new av_dict_set_int helper function.Reimar Döffinger2014-08-161-6/+4
| | | | | | | Get rid of the many, slightly differing, implementations of basically the same thing. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* lavf/ftp: always treat all response codes >= 500 as errorLukasz Marek2014-07-041-16/+20
| | | | Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
* lavf/ftp: explicitly enable UTF-8Lukasz Marek2014-07-041-0/+17
| | | | | | | | Most FTP servers enable UTF-8 by default, but it is not required by the standard. Enabling it manually makes ffmpeg implementation more consistent when server doesn't enable it by default. Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
* lavf/ftp: make response parsing more RFC compliantLukasz Marek2014-07-041-18/+29
| | | | Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
* lavf/ftp: favour EPSV over PASV commandLukasz Marek2014-05-201-4/+47
| | | | | | EPSV is newer version of PASV and allows to use IPv6. Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
* lavf/ftp: fix seek to nagative positionLukasz Marek2014-02-281-3/+5
| | | | Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
* lavf/ftp: remove double spaceLukasz Marek2014-01-221-1/+1
| | | | Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
* avformat/ftp: add log regarding passive mode failureLukasz Marek2013-10-121-4/+4
| | | | Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
* avformat/ftp: fix possible deadlockLukasz Marek2013-10-121-8/+7
| | | | Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
* lavf/ftp: fix possible crashLukasz Marek2013-08-291-1/+2
|
* avformat/ftp: make const tables static constMichael Niedermayer2013-08-271-15/+15
| | | | | Reviewed-by: Lukasz M <lukasz.m.luki@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* ftp: warning about pure-ftp server used as and outputLukasz Marek2013-07-171-2/+7
|
* ftp: commentsLukasz Marek2013-07-171-4/+6
|
* ftp: remove unused headersLukasz Marek2013-07-171-4/+0
|
* ftp: fix interrupt callback misuseLukasz Marek2013-07-171-77/+32
| | | | | | | | | | FTP protocol used interrupt callback to simulate nonblock operation which is a misuse of this callback. This commit make FTP protocol fully blocking and removes invalid usage of interrutp callback Also adds support for multiline responses delimited with dashes
* ftp: add invalid code for RETR operationLukasz Marek2013-06-081-1/+1
| | | | | | | | | 554 is possible invalid code: - Restart not valid - Command terminated due to server shutdown in progress - etc... Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
* ftp: probe seek capabilityLukasz Marek2013-06-081-4/+8
| | | | | | Make FTP streamed when server doesn't accept REST command Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
* ftp: fix seeking beyond file sizeLukasz Marek2013-06-081-6/+10
| | | | | | adjust to ff* tools seek nature Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
* ftp: abort function optimalizationLukasz Marek2013-06-081-16/+48
| | | | | | | | | It seems some ftp servers doesn't respect ABOR command, but closing both connection is slow. This commit keeps control connection open when possible. Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
* ftp: explicit return code checksLukasz Marek2013-06-081-2/+2
| | | | Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
* ftp: fix flush control connection inputLukasz Marek2013-06-081-1/+1
| | | | Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
* ftp: reconnect on tcp read errorLukasz Marek2013-06-081-6/+9
| | | | | | | This commit reconnect both connections and retries before ftp_read returns an error. Practical use case: resume after lock screen on iOS devices. Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>