[rtmpdump] [PATCH] Add quotes to -o value

NhJm nhjm449 at gmail.com
Sun May 20 22:31:57 CEST 2012


Looks like this is only an issue when manually copying/pasting the command
rtmpsrv produces, or when the operating system is Windows (where fork/exec
is not being used).

Anyways, adding quotes is *not* a sufficient method of escaping characters.
(And most of the other parameters suffer from this issue as well.)

Example: Calling

rtmpdump -r "rtmp://localhost/a\"pp/\"bl"\!"ah&echo hi.flv" -o /dev/null

will cause rtmpsrv to output

rtmpdump -r "rtmp://localhost:1935/a"pp" -a "a"pp" -f "LNX 10,0,32,18" -y
""bl!ah&echo hi" -o ""bl!ah&echo hi.flv"

which is obviously wrong. (And I threw in the exclamation point because
bash will react negatively to it, even if it's within quotes!)

-NhJm

On Sun, May 20, 2012 at 1:39 PM, Steven Penny <svnpenn at gmail.com> wrote:

> If the -o value from rtmpsrv contains an ampersand (&), it will be
> interpreted
> as a command separator instead of part of the filename. This can be fixed
> by
> using quotes with the value.
>
> WRONG
> -o sparams=id%2Citag%2Crtmpe%2Csource%2Cexpire&expire=1337537678.flv
>
> RIGHT
> -o "sparams=id%2Citag%2Crtmpe%2Csource%2Cexpire&expire=1337537678.flv"
>
> I have seen this on YouTube.
> ---
>  rtmpsrv.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/rtmpsrv.c b/rtmpsrv.c
> index 9aa62f3..2ab80db 100644
> --- a/rtmpsrv.c
> +++ b/rtmpsrv.c
> @@ -725,7 +725,7 @@ ServeInvoke(STREAMING_SERVER *server, RTMP * r,
> RTMPPacket *packet, unsigned int
>          argv[argc++].av_len = 2;
>          argv[argc].av_val = file;
>          argv[argc].av_len = av.av_len;
> -         ptr += sprintf(ptr, " -o %s", file);
> +         ptr += sprintf(ptr, " -o \"%s\"", file);
>          now = RTMP_GetTime();
>          if (now - server->filetime < DUPTIME && AVMATCH(&argv[argc],
> &server->filename))
>            {
> --
> 1.7.9
>
> _______________________________________________
> rtmpdump mailing list
> rtmpdump at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/rtmpdump
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mplayerhq.hu/pipermail/rtmpdump/attachments/20120520/6dcf62f8/attachment.html>


More information about the rtmpdump mailing list