From patchwork Fri Jun 2 13:05:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 3795 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.10.2 with SMTP id 2csp186266vsk; Fri, 2 Jun 2017 06:05:41 -0700 (PDT) X-Received: by 10.28.71.91 with SMTP id u88mr2772912wma.9.1496408741339; Fri, 02 Jun 2017 06:05:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496408741; cv=none; d=google.com; s=arc-20160816; b=bmBrn2uFQtS8aUQ50NmGW3ENe0NFUZAPpiPaZ0qzVe1RyYIlTusVZhf5uDih0f7je3 dqySPhhq2JTpNdcQfrb2LElc07wKjP4Zz+jxmB2xSFhw9WfUbdp11r6gM+z1SAiNdvPv stzgya9oheu9s3f8gItLNj0iXCp3wvWFr6h0W4nhDuGwxWijG7oDvb20Q4txHS3d5eXE Ck6WYCyJ0eEDCkVnq4bOVwKc7RO0wFYpXX1ND4PYohOWlbd3fSJEz4l2aNCpfed/RA3z dFgbwPk0+UZ5BVILb4K7exdajID8IJ6Nda8DgnJ5/7RXltYyOE8vwinKRhVitpZ4RE4I noVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:delivered-to :arc-authentication-results; bh=mjziB0WOYjpMUyQvPPd+4OvmbEs/NbHZL1jpviHOO7w=; b=FOeLRqmTYxpD608iC/DyQ1Nfrfk4EkEUs8L08WAx4P/JyCB4bhgB/sAeNxN1ned/cH +lUatC8rbgbh1J8Bekk/58jz1HBolGnAAiem9m/LyDroQ7V5xL7eBbI/Jn7PcSYzo+t6 LwOSTxFawIyk3/XjheoYkwgGWsTxZD9n9HLgNZyr09xqswqMl1jJ6xys71Dw2GdRpldA /gthaXtZLukRWsGCSQgULa8nBpIQi9xP4NEC2B+3jo5Y/EtN7IxM3td13Ptm9hjZBGsR 6lcItsHud56NTUhgd3a/A7wkVnLMFUwo+Y51nRTPfI2tJ6OOHX4sUrQNbzos3mFXJ9SC hbvg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id j17si8436015wrc.8.2017.06.02.06.05.40; Fri, 02 Jun 2017 06:05:41 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4FDC36882DB; Fri, 2 Jun 2017 16:05:32 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe05-1.mx.upcmail.net (vie01a-dmta-pe08-1.mx.upcmail.net [84.116.36.20]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 97C66680765 for ; Fri, 2 Jun 2017 16:05:26 +0300 (EEST) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe08.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1dGmGh-000425-Rf for ffmpeg-devel@ffmpeg.org; Fri, 02 Jun 2017 15:05:31 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id Tp5T1v01y0S5wYM01p5Uth; Fri, 02 Jun 2017 15:05:28 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 2 Jun 2017 15:05:27 +0200 Message-Id: <20170602130527.25730-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.13.0 Subject: [FFmpeg-devel] [PATCH] avformat/options: log filename on open X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" The loglevel is choosen so that the main filename and any images of multi image sequences are shown only at debug level to avoid clutter. This makes exploits in playlists more visible. As they would show accesses to private/sensitive files Signed-off-by: Michael Niedermayer --- libavformat/options.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libavformat/options.c b/libavformat/options.c index 25a506eef8..07a8a1a46b 100644 --- a/libavformat/options.c +++ b/libavformat/options.c @@ -102,6 +102,17 @@ static const AVClass av_format_context_class = { static int io_open_default(AVFormatContext *s, AVIOContext **pb, const char *url, int flags, AVDictionary **options) { + int loglevel; + if (!strcmp(url, s->filename) || + s->iformat && !strcmp(s->iformat->name, "image2") || + s->oformat && !strcmp(s->oformat->name, "image2") + ) { + loglevel = AV_LOG_DEBUG; + } else + loglevel = AV_LOG_INFO; + + av_log(s, loglevel, "Opening \'%s\' for %s\n", url, flags & AVIO_FLAG_WRITE ? "writing" : "reading"); + #if FF_API_OLD_OPEN_CALLBACKS FF_DISABLE_DEPRECATION_WARNINGS if (s->open_cb)