From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 09 05:53:11 2018 Received: (at submit) by debbugs.gnu.org; 9 Dec 2018 10:53:11 +0000 Received: from localhost ([127.0.0.1]:39243 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gVwhx-0000nO-ND for submit@debbugs.gnu.org; Sun, 09 Dec 2018 05:53:11 -0500 Received: from eggs.gnu.org ([208.118.235.92]:57669) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gVwhv-0000n9-0l for submit@debbugs.gnu.org; Sun, 09 Dec 2018 05:53:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gVwhp-0007pD-5I for submit@debbugs.gnu.org; Sun, 09 Dec 2018 05:53:01 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=1.0 required=5.0 tests=BAYES_40,FROM_EXCESS_BASE64 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:46638) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gVwhp-0007p7-2A for submit@debbugs.gnu.org; Sun, 09 Dec 2018 05:53:01 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39045) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gVwho-0001Mn-C3 for bug-gnu-emacs@gnu.org; Sun, 09 Dec 2018 05:53:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gVwhl-0007ki-4q for bug-gnu-emacs@gnu.org; Sun, 09 Dec 2018 05:53:00 -0500 Received: from eastern.maple.relay.mailchannels.net ([23.83.214.55]:47921) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gVwhk-0007jJ-Ri for bug-gnu-emacs@gnu.org; Sun, 09 Dec 2018 05:52:57 -0500 X-Sender-Id: dreamhost|x-authsender|jidanni@jidanni.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id A587E42393 for ; Sun, 9 Dec 2018 10:52:54 +0000 (UTC) Received: from pdx1-sub0-mail-a21.g.dreamhost.com (unknown [100.96.30.62]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 71EB7422F2 for ; Sun, 9 Dec 2018 10:52:54 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jidanni@jidanni.org Received: from pdx1-sub0-mail-a21.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.16.2); Sun, 09 Dec 2018 10:52:54 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jidanni@jidanni.org X-MailChannels-Auth-Id: dreamhost X-Dime-Desert: 0e4f76172dadfef5_1544352774531_2715135381 X-MC-Loop-Signature: 1544352774531:710070356 X-MC-Ingress-Time: 1544352774530 Received: from pdx1-sub0-mail-a21.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a21.g.dreamhost.com (Postfix) with ESMTP id 32D9980972 for ; Sun, 9 Dec 2018 02:52:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=jidanni.org; h=from:to :subject:date:message-id:mime-version:content-type; s= jidanni.org; bh=l209fS9lYfRleTm4WQT9Le8dVQM=; b=pLg7tSvTdsxySkGn 6m7iquC9BGcLQ7JuyqvT8MNbjrh+hKBLwWJOnq0DsP+GNFckz3R0o8PlgYnTzUOZ F0dn8B5AaqwGLfQ41PGEfS7ocyhCKi58T2Kc8wjIwvhR++2w23YDhLp1NOYQrj6E bTYOD7UgZ76RpdWMFEYLG0zgc5Y= Received: from jidanni.org (114-41-21-116.dynamic-ip.hinet.net [114.41.21.116]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jidanni@jidanni.org) by pdx1-sub0-mail-a21.g.dreamhost.com (Postfix) with ESMTPSA id CD07180975 for ; Sun, 9 Dec 2018 02:52:53 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a21 From: =?utf-8?B?56mN5Li55bC8?= Dan Jacobson To: bug-gnu-emacs@gnu.org Subject: DocView bombs out upon password protected PDFs Date: Sun, 09 Dec 2018 18:52:50 +0800 Message-ID: <87d0qb3rb1.fsf@jidanni.org> MIME-Version: 1.0 Content-Type: text/plain X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 0 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtkedrudegfedgvddvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkgggtsehttdertddttdejnecuhfhrohhmpejnnjjnucffrghnucflrggtohgsshhonhcuoehjihgurghnnhhisehjihgurghnnhhirdhorhhgqeenucfkphepuddugedrgedurddvuddrudduieenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepjhhiuggrnhhnihdrohhrghdpihhnvghtpeduudegrdeguddrvddurdduudeipdhrvghtuhhrnhdqphgrthhhpeeprehuthhfqdekreeureehiehmpfehnfhiheehsgevkeerpecuffgrnhculfgrtghosghsohhnuceojhhiuggrnhhnihesjhhiuggrnhhnihdrohhrgheqpdhmrghilhhfrhhomhepjhhiuggrnhhnihesjhhiuggrnhhnihdrohhrghdpnhhrtghpthhtohepsghughdqghhnuhdqvghmrggtshesghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedt X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) When trying to view a password protected PDF: DocView: process pdf/ps->png changed status to exited abnormally with code 1. Maybe it should ask for the password. emacs-version "25.2.2" From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 26 21:15:01 2019 Received: (at 33684) by debbugs.gnu.org; 27 Jan 2019 02:15:01 +0000 Received: from localhost ([127.0.0.1]:46884 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gnZyO-0002qp-U9 for submit@debbugs.gnu.org; Sat, 26 Jan 2019 21:15:01 -0500 Received: from mail-qk1-f173.google.com ([209.85.222.173]:46761) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gnZyN-0002qd-K5 for 33684@debbugs.gnu.org; Sat, 26 Jan 2019 21:15:00 -0500 Received: by mail-qk1-f173.google.com with SMTP id q1so7592200qkf.13 for <33684@debbugs.gnu.org>; Sat, 26 Jan 2019 18:14:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version; bh=m7y4vR5df5BvPcnSahjWjVzGoe1jq0nGMGyVQeHlhE8=; b=ZdCDgYyYJWKoJhrq4ErMAxgAg/33ima5wr28izYE4mFZvmMrYLg7VEFbSBh5UNDtvH rBc+1OsuOIrwd/2G5JnvRFqL0oD2hg5rjEHbL8XRMhbR6D5XBM3Z1WkcK27Z5ZAntSi9 fRsdmwWkrI/UtmF/d0aPejQFWc7isAxElzQbboIb4KFW+pzBKngdIEkZOKEVSyet8pbz sXM6NCh0GoQrHf10K7TM7jz91rdQForSEAR/RvZbauLgSXSmnGb0+3QF7XCznDYrdg6H 3syfH4WtkrbYA3BNgoRamQkiL/qrmvaXX9QBsUUMxzQOsFEEN67809ZMSO4VfwGkPaet 34eA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=m7y4vR5df5BvPcnSahjWjVzGoe1jq0nGMGyVQeHlhE8=; b=YdHzaC+PCpKv771YXp/c3U18QZivOThsP+H1YvZl9PqAwdxV1bMLstAu4hJbK96Zcq aLjL3cE+n3FASbagJUmWWsWdywjvlq0zQGAcL1+XVMsSBpRcrhNSAHrfo9Hum5tVlL6F zsJzuxu/aRE065NZ0vOS1gYyB/aJG4B2HAdoaNyuCPdxcwDZM74oKh8KyTVIeWQb/C57 16nLNgR64YWHrhZpkj4Xr7ulct8viuyLtwnIEddAbIDKNGSWGUxdjEUaVVjHy1NPp23g 6AMPuQ2oltFaa7U/UKFsekVQ4yNwl3Z3vo/u+ntTid0XLU8tqTWz0VjX3A3+Sej/rXYW NCnQ== X-Gm-Message-State: AJcUukebZI3hsQ88TWObcFcFtCLZLbxOxnKXXRe1Bbsx59mwmrpNMDMw jyIHQ6wzIRSGURfbEScXMB7wR3pQZ2I= X-Google-Smtp-Source: ALg8bN4F4GoRsHs/xYg0m8CrQPjaRD4X7DKmwOXHErALix57QA1b4c/6A4NdkeQzUhw3bZ722FwbpA== X-Received: by 2002:ae9:d804:: with SMTP id u4mr15320502qkf.322.1548555293391; Sat, 26 Jan 2019 18:14:53 -0800 (PST) Received: from hideo ([181.167.176.220]) by smtp.gmail.com with ESMTPSA id m49sm77707221qtb.40.2019.01.26.18.14.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 26 Jan 2019 18:14:51 -0800 (PST) From: Federico Tedin To: =?utf-8?B?56mN5Li55bC8?= Dan Jacobson , 33684@debbugs.gnu.org Subject: Re: bug#33684: DocView bombs out upon password protected PDFs References: <87d0qb3rb1.fsf@jidanni.org> Date: Sat, 26 Jan 2019 23:14:49 -0300 In-Reply-To: <87d0qb3rb1.fsf@jidanni.org> (=?utf-8?B?IuepjeS4ueWwvA==?= Dan Jacobson"'s message of "Sun, 09 Dec 2018 18:52:50 +0800") Message-ID: <87sgxesv6u.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 33684 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable =E7=A9=8D=E4=B8=B9=E5=B0=BC Dan Jacobson writes: > When trying to view a password protected PDF: > DocView: process pdf/ps->png changed status to exited abnormally with cod= e 1. > Maybe it should ask for the password. > emacs-version "25.2.2" Would something like this make sense? A short patch that adds `doc-view-pdf-password-protected-p', and an extra option to pass to Ghostscript (-sPDFPassword=3D) when the command is invoked (only when the PDF file is password protected). I tried it out by creating a password-protected PDF using LibreOffice Writer, and then opening it with find-file. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=pdf-passwd.patch Content-Description: patch diff --git a/lisp/doc-view.el b/lisp/doc-view.el index df8a9fc70f..8691d2a3a6 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -183,11 +183,16 @@ doc-view-pdf->png-converter-function (defcustom doc-view-ghostscript-options '("-dSAFER" ;; Avoid security problems when rendering files from untrusted ;; sources. - "-dNOPAUSE" "-sDEVICE=png16m" "-dTextAlphaBits=4" - "-dBATCH" "-dGraphicsAlphaBits=4" "-dQUIET") + "-dNOPAUSE" "-dTextAlphaBits=4" "-dBATCH" + "-dGraphicsAlphaBits=4" "-dQUIET") "A list of options to give to ghostscript." :type '(repeat string)) +(defcustom doc-view-ghostscript-device "png16m" + "Output device to give to ghostscript." + :type 'string + :version "27.1") + (defcustom doc-view-resolution 100 "Dots per inch resolution used to render the documents. Higher values result in larger images." @@ -950,16 +955,30 @@ doc-view-dvi->pdf (list "-o" pdf dvi) callback))) +(defun doc-view-pdf-password-protected-p (pdf) + "Using Ghostscript, check if a PDF file is password-protected." + (with-temp-buffer + (apply #'call-process doc-view-ghostscript-program nil (current-buffer) + nil `(,@doc-view-ghostscript-options + "-sNODISPLAY" + ,pdf)) + (goto-char (point-min)) + (search-forward "This file requires a password for access." nil t))) + (defun doc-view-pdf->png-converter-ghostscript (pdf png page callback) - (doc-view-start-process - "pdf/ps->png" doc-view-ghostscript-program - `(,@doc-view-ghostscript-options - ,(format "-r%d" (round doc-view-resolution)) - ,@(if page `(,(format "-dFirstPage=%d" page))) - ,@(if page `(,(format "-dLastPage=%d" page))) - ,(concat "-sOutputFile=" png) - ,pdf) - callback)) + (let ((pdf-passwd (if (doc-view-pdf-password-protected-p pdf) + (read-passwd "Enter password for PDF file: ")))) + (doc-view-start-process + "pdf/ps->png" doc-view-ghostscript-program + `(,@doc-view-ghostscript-options + ,(concat "-sDEVICE=" doc-view-ghostscript-device) + ,(format "-r%d" (round doc-view-resolution)) + ,@(if page `(,(format "-dFirstPage=%d" page))) + ,@(if page `(,(format "-dLastPage=%d" page))) + ,@(if pdf-passwd `(,(format "-sPDFPassword=%s" pdf-passwd))) + ,(concat "-sOutputFile=" png) + ,pdf) + callback))) (defalias 'doc-view-ps->png-converter-ghostscript 'doc-view-pdf->png-converter-ghostscript) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 01 04:34:06 2019 Received: (at 33684) by debbugs.gnu.org; 1 Feb 2019 09:34:07 +0000 Received: from localhost ([127.0.0.1]:53731 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gpVD4-00066u-Jl for submit@debbugs.gnu.org; Fri, 01 Feb 2019 04:34:06 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38641) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gpVD2-00066P-S4 for 33684@debbugs.gnu.org; Fri, 01 Feb 2019 04:34:05 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55176) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gpVCx-0006I8-Df; Fri, 01 Feb 2019 04:33:59 -0500 Received: from [176.228.60.248] (port=3205 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gpVCw-0006h3-Ud; Fri, 01 Feb 2019 04:33:59 -0500 Date: Fri, 01 Feb 2019 11:33:55 +0200 Message-Id: <83womjyhrw.fsf@gnu.org> From: Eli Zaretskii To: Federico Tedin , Tassilo Horn In-reply-to: <87sgxesv6u.fsf@gmail.com> (message from Federico Tedin on Sat, 26 Jan 2019 23:14:49 -0300) Subject: Re: bug#33684: DocView bombs out upon password protected PDFs References: <87d0qb3rb1.fsf@jidanni.org> <87sgxesv6u.fsf@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 33684 Cc: 33684@debbugs.gnu.org, jidanni@jidanni.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > From: Federico Tedin > Date: Sat, 26 Jan 2019 23:14:49 -0300 Thanks. Tassilo, any comments on the proposal below? Should I push it? > 積丹尼 Dan Jacobson writes: > > > When trying to view a password protected PDF: > > DocView: process pdf/ps->png changed status to exited abnormally with code 1. > > Maybe it should ask for the password. > > emacs-version "25.2.2" > > Would something like this make sense? A short patch that adds > `doc-view-pdf-password-protected-p', and an extra option to pass to > Ghostscript (-sPDFPassword=) when the command is invoked (only when the > PDF file is password protected). I tried it out by creating a > password-protected PDF using LibreOffice Writer, and then opening it > with find-file. > > > diff --git a/lisp/doc-view.el b/lisp/doc-view.el > index df8a9fc70f..8691d2a3a6 100644 > --- a/lisp/doc-view.el > +++ b/lisp/doc-view.el > @@ -183,11 +183,16 @@ doc-view-pdf->png-converter-function > (defcustom doc-view-ghostscript-options > '("-dSAFER" ;; Avoid security problems when rendering files from untrusted > ;; sources. > - "-dNOPAUSE" "-sDEVICE=png16m" "-dTextAlphaBits=4" > - "-dBATCH" "-dGraphicsAlphaBits=4" "-dQUIET") > + "-dNOPAUSE" "-dTextAlphaBits=4" "-dBATCH" > + "-dGraphicsAlphaBits=4" "-dQUIET") > "A list of options to give to ghostscript." > :type '(repeat string)) > > +(defcustom doc-view-ghostscript-device "png16m" > + "Output device to give to ghostscript." > + :type 'string > + :version "27.1") > + > (defcustom doc-view-resolution 100 > "Dots per inch resolution used to render the documents. > Higher values result in larger images." > @@ -950,16 +955,30 @@ doc-view-dvi->pdf > (list "-o" pdf dvi) > callback))) > > +(defun doc-view-pdf-password-protected-p (pdf) > + "Using Ghostscript, check if a PDF file is password-protected." > + (with-temp-buffer > + (apply #'call-process doc-view-ghostscript-program nil (current-buffer) > + nil `(,@doc-view-ghostscript-options > + "-sNODISPLAY" > + ,pdf)) > + (goto-char (point-min)) > + (search-forward "This file requires a password for access." nil t))) > + > (defun doc-view-pdf->png-converter-ghostscript (pdf png page callback) > - (doc-view-start-process > - "pdf/ps->png" doc-view-ghostscript-program > - `(,@doc-view-ghostscript-options > - ,(format "-r%d" (round doc-view-resolution)) > - ,@(if page `(,(format "-dFirstPage=%d" page))) > - ,@(if page `(,(format "-dLastPage=%d" page))) > - ,(concat "-sOutputFile=" png) > - ,pdf) > - callback)) > + (let ((pdf-passwd (if (doc-view-pdf-password-protected-p pdf) > + (read-passwd "Enter password for PDF file: ")))) > + (doc-view-start-process > + "pdf/ps->png" doc-view-ghostscript-program > + `(,@doc-view-ghostscript-options > + ,(concat "-sDEVICE=" doc-view-ghostscript-device) > + ,(format "-r%d" (round doc-view-resolution)) > + ,@(if page `(,(format "-dFirstPage=%d" page))) > + ,@(if page `(,(format "-dLastPage=%d" page))) > + ,@(if pdf-passwd `(,(format "-sPDFPassword=%s" pdf-passwd))) > + ,(concat "-sOutputFile=" png) > + ,pdf) > + callback))) > > (defalias 'doc-view-ps->png-converter-ghostscript > 'doc-view-pdf->png-converter-ghostscript) From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 01 05:13:03 2019 Received: (at 33684) by debbugs.gnu.org; 1 Feb 2019 10:13:03 +0000 Received: from localhost ([127.0.0.1]:53755 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gpVol-00074e-3D for submit@debbugs.gnu.org; Fri, 01 Feb 2019 05:13:03 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48358) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gpVoi-000749-D5 for 33684@debbugs.gnu.org; Fri, 01 Feb 2019 05:13:01 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:56771) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gpVoc-0005Y6-U2; Fri, 01 Feb 2019 05:12:54 -0500 Received: from auth2-smtp.messagingengine.com ([66.111.4.228]:52991) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.82) (envelope-from ) id 1gpVoc-00018M-QG; Fri, 01 Feb 2019 05:12:54 -0500 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailauth.nyi.internal (Postfix) with ESMTP id 2A893217CF; Fri, 1 Feb 2019 05:12:54 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Fri, 01 Feb 2019 05:12:54 -0500 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrjeekgddufecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthenuceurghilhhouhhtmecufedt tdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhfffgjkf gfgggtgfesthhqredttderjeenucfhrhhomhepvfgrshhsihhlohcujfhorhhnuceothhs ughhsehgnhhurdhorhhgqeenucfkphepvdduvddrudekhedrvddtfedrudefgeenucfrrg hrrghmpehmrghilhhfrhhomhepthhhohhrnhdomhgvshhmthhprghuthhhphgvrhhsohhn rghlihhthidqkeeijeefkeejkeegqdeifeehvdelkedqthhsughhpeepghhnuhdrohhrgh esfhgrshhtmhgrihhlrdhfmhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from pchta-and (portal.shd.de [212.185.203.134]) by mail.messagingengine.com (Postfix) with ESMTPA id 746E1E4068; Fri, 1 Feb 2019 05:12:52 -0500 (EST) From: Tassilo Horn To: Eli Zaretskii Subject: Re: bug#33684: DocView bombs out upon password protected PDFs References: <87d0qb3rb1.fsf@jidanni.org> <87sgxesv6u.fsf@gmail.com> <83womjyhrw.fsf@gnu.org> Date: Fri, 01 Feb 2019 11:12:51 +0100 In-Reply-To: <83womjyhrw.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 01 Feb 2019 11:33:55 +0200") Message-ID: <87h8dn7r6k.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 33684 Cc: 33684@debbugs.gnu.org, jidanni@jidanni.org, Federico Tedin X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: Hi Federico, Dan & Eli, >> From: Federico Tedin >> Date: Sat, 26 Jan 2019 23:14:49 -0300 > > Thanks. > > Tassilo, any comments on the proposal below? Should I push it? It would be great if we could support opening password protected PDFs also when we're using mupdf as a converter. That has a "-p" option for the very same sake which could be set analogously in `doc-view-pdf->png-converter-mupdf'. So, yes, please push it with that small addition. Bye, Tassilo >> =E7=A9=8D=E4=B8=B9=E5=B0=BC Dan Jacobson writes: >>=20 >> > When trying to view a password protected PDF: >> > DocView: process pdf/ps->png changed status to exited abnormally with = code 1. >> > Maybe it should ask for the password. >> > emacs-version "25.2.2" >>=20 >> Would something like this make sense? A short patch that adds >> `doc-view-pdf-password-protected-p', and an extra option to pass to >> Ghostscript (-sPDFPassword=3D) when the command is invoked (only when the >> PDF file is password protected). I tried it out by creating a >> password-protected PDF using LibreOffice Writer, and then opening it >> with find-file. >>=20 >>=20 >> diff --git a/lisp/doc-view.el b/lisp/doc-view.el >> index df8a9fc70f..8691d2a3a6 100644 >> --- a/lisp/doc-view.el >> +++ b/lisp/doc-view.el >> @@ -183,11 +183,16 @@ doc-view-pdf->png-converter-function >> (defcustom doc-view-ghostscript-options >> '("-dSAFER" ;; Avoid security problems when rendering files from untr= usted >> ;; sources. >> - "-dNOPAUSE" "-sDEVICE=3Dpng16m" "-dTextAlphaBits=3D4" >> - "-dBATCH" "-dGraphicsAlphaBits=3D4" "-dQUIET") >> + "-dNOPAUSE" "-dTextAlphaBits=3D4" "-dBATCH" >> + "-dGraphicsAlphaBits=3D4" "-dQUIET") >> "A list of options to give to ghostscript." >> :type '(repeat string)) >>=20=20 >> +(defcustom doc-view-ghostscript-device "png16m" >> + "Output device to give to ghostscript." >> + :type 'string >> + :version "27.1") >> + >> (defcustom doc-view-resolution 100 >> "Dots per inch resolution used to render the documents. >> Higher values result in larger images." >> @@ -950,16 +955,30 @@ doc-view-dvi->pdf >> (list "-o" pdf dvi) >> callback))) >>=20=20 >> +(defun doc-view-pdf-password-protected-p (pdf) >> + "Using Ghostscript, check if a PDF file is password-protected." >> + (with-temp-buffer >> + (apply #'call-process doc-view-ghostscript-program nil (current-buf= fer) >> + nil `(,@doc-view-ghostscript-options >> + "-sNODISPLAY" >> + ,pdf)) >> + (goto-char (point-min)) >> + (search-forward "This file requires a password for access." nil t))) >> + >> (defun doc-view-pdf->png-converter-ghostscript (pdf png page callback) >> - (doc-view-start-process >> - "pdf/ps->png" doc-view-ghostscript-program >> - `(,@doc-view-ghostscript-options >> - ,(format "-r%d" (round doc-view-resolution)) >> - ,@(if page `(,(format "-dFirstPage=3D%d" page))) >> - ,@(if page `(,(format "-dLastPage=3D%d" page))) >> - ,(concat "-sOutputFile=3D" png) >> - ,pdf) >> - callback)) >> + (let ((pdf-passwd (if (doc-view-pdf-password-protected-p pdf) >> + (read-passwd "Enter password for PDF file: ")))) >> + (doc-view-start-process >> + "pdf/ps->png" doc-view-ghostscript-program >> + `(,@doc-view-ghostscript-options >> + ,(concat "-sDEVICE=3D" doc-view-ghostscript-device) >> + ,(format "-r%d" (round doc-view-resolution)) >> + ,@(if page `(,(format "-dFirstPage=3D%d" page))) >> + ,@(if page `(,(format "-dLastPage=3D%d" page))) >> + ,@(if pdf-passwd `(,(format "-sPDFPassword=3D%s" pdf-passwd))) >> + ,(concat "-sOutputFile=3D" png) >> + ,pdf) >> + callback))) >>=20=20 >> (defalias 'doc-view-ps->png-converter-ghostscript >> 'doc-view-pdf->png-converter-ghostscript) > From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 01 05:34:55 2019 Received: (at 33684) by debbugs.gnu.org; 1 Feb 2019 10:34:55 +0000 Received: from localhost ([127.0.0.1]:53761 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gpW9v-0007az-4P for submit@debbugs.gnu.org; Fri, 01 Feb 2019 05:34:55 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53193) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gpW9t-0007am-6Z for 33684@debbugs.gnu.org; Fri, 01 Feb 2019 05:34:53 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:58229) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gpW9l-0008Eq-V6; Fri, 01 Feb 2019 05:34:47 -0500 Received: from [176.228.60.248] (port=3192 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gpW9f-0002Qh-Iz; Fri, 01 Feb 2019 05:34:41 -0500 Date: Fri, 01 Feb 2019 12:34:34 +0200 Message-Id: <83pnsbyeyt.fsf@gnu.org> From: Eli Zaretskii To: Tassilo Horn In-reply-to: <87h8dn7r6k.fsf@gnu.org> (message from Tassilo Horn on Fri, 01 Feb 2019 11:12:51 +0100) Subject: Re: bug#33684: DocView bombs out upon password protected PDFs References: <87d0qb3rb1.fsf@jidanni.org> <87sgxesv6u.fsf@gmail.com> <83womjyhrw.fsf@gnu.org> <87h8dn7r6k.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 33684 Cc: 33684@debbugs.gnu.org, jidanni@jidanni.org, federicotedin@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > From: Tassilo Horn > Cc: Federico Tedin , jidanni@jidanni.org, 33684@debbugs.gnu.org > Date: Fri, 01 Feb 2019 11:12:51 +0100 > > Eli Zaretskii writes: > > Hi Federico, Dan & Eli, > > >> From: Federico Tedin > >> Date: Sat, 26 Jan 2019 23:14:49 -0300 > > > > Thanks. > > > > Tassilo, any comments on the proposal below? Should I push it? > > It would be great if we could support opening password protected PDFs > also when we're using mupdf as a converter. That has a "-p" option for > the very same sake which could be set analogously in > `doc-view-pdf->png-converter-mupdf'. > > So, yes, please push it with that small addition. Thanks. Federico, would you please like to propose a patch with the addition requested by Tassilo? From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 01 05:43:12 2019 Received: (at 33684) by debbugs.gnu.org; 1 Feb 2019 10:43:12 +0000 Received: from localhost ([127.0.0.1]:53765 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gpWHw-0007mj-2b for submit@debbugs.gnu.org; Fri, 01 Feb 2019 05:43:12 -0500 Received: from mail-qt1-f181.google.com ([209.85.160.181]:42929) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gpWHu-0007mW-HO for 33684@debbugs.gnu.org; Fri, 01 Feb 2019 05:43:10 -0500 Received: by mail-qt1-f181.google.com with SMTP id d19so6848498qtq.9 for <33684@debbugs.gnu.org>; Fri, 01 Feb 2019 02:43:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Y778Y1qQidZMFQ8goQaNccOFsJEGq2KmiTIIJTEw4vc=; b=ESsy+9ZWaSxTK8HufATIlyAlAWhRs0zQ+oMP0L54qaZYz92kA2q1f80GLI6xRr5yg/ El4n4a+r7njG+r1Mhm98oEbuXEDjJ93g5L/ug1DVO1OBeBNOzFthLMzyw/E6SxjA6b/E obMNIyqspv20jUwbS2d6hoprAVM7qQKME05oiUA3rr8vXdVxzsF0Fj30k5KwNwCw1nYO HlkMo6CBTJ1Qs1DpKRPsORhyCvge7o5as5NrxKr5clDpy1EQ8ad0bLG8XNs10zlQoH65 iLuk4qzwXYcJUt8PNaluGRsJOE512LedhE7R6pOzA4Re44Cj7yIotyii1zjue/UmkKgb 0cXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Y778Y1qQidZMFQ8goQaNccOFsJEGq2KmiTIIJTEw4vc=; b=qGoPOZgkDPrCIZEKNo9UEDSJugouKVl/9/wVym82uSf2draWFc2pXmPHZkJjvG5eKY mqKxpXmshJ6jdhTk2/TeCd5QH52y1Itv8cahZqO5UFwmQgPvMUpcUHDdcBVvlCY2n1ih +OpyViNN5A8mYkyxvofX49JltXkGYsbiIoKanDECy4rkb5io4sPvbExH8GSx3hKqhGgu kJoiYDBgKs0r9QFmVBn0hFx77T1DrAOcRMZRnbL2QzBgWBvo1HLZjG6BnxAhIkRN8Jkd U5MRSXV5v5eKHf77/iRYvhnLTBAn5P09/AN3JoPguThTD09y7Uzxc4h2KH2YQhl/s+/j GaVQ== X-Gm-Message-State: AJcUukf5a9RISwmTtGPb7LXyqrOjM1S7s+oJfvAeEgCTxQCqp/pntn3c vfuj8OrQOWesKdffOvNP37BwktCEBkdNYCZb0LnD1w== X-Google-Smtp-Source: ALg8bN4SgWNbRiLw9806Wc3DawTuZR9pJKwGHjamgqfoECMlvdFmZeVWzViyGESSG4Ts0dW8yMJNSNssJR3cTJsN2DY= X-Received: by 2002:a0c:c60b:: with SMTP id v11mr35897916qvi.198.1549017784859; Fri, 01 Feb 2019 02:43:04 -0800 (PST) MIME-Version: 1.0 References: <87d0qb3rb1.fsf@jidanni.org> <87sgxesv6u.fsf@gmail.com> <83womjyhrw.fsf@gnu.org> <87h8dn7r6k.fsf@gnu.org> <83pnsbyeyt.fsf@gnu.org> In-Reply-To: <83pnsbyeyt.fsf@gnu.org> From: Federico Tedin Date: Fri, 1 Feb 2019 07:42:54 -0300 Message-ID: Subject: Re: bug#33684: DocView bombs out upon password protected PDFs To: Eli Zaretskii Content-Type: multipart/alternative; boundary="000000000000d13f010580d2ce56" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 33684 Cc: 33684@debbugs.gnu.org, jidanni@jidanni.org, Tassilo Horn X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --000000000000d13f010580d2ce56 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sure! I=E2=80=99ll look into it. --000000000000d13f010580d2ce56 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Sure! I=E2=80=99ll look into it.
--000000000000d13f010580d2ce56-- From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 02 15:58:13 2019 Received: (at 33684) by debbugs.gnu.org; 2 Feb 2019 20:58:13 +0000 Received: from localhost ([127.0.0.1]:56624 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gq2Me-0005lL-Mf for submit@debbugs.gnu.org; Sat, 02 Feb 2019 15:58:13 -0500 Received: from mail-qt1-f179.google.com ([209.85.160.179]:33045) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gq2Mc-0005l8-Hc for 33684@debbugs.gnu.org; Sat, 02 Feb 2019 15:58:10 -0500 Received: by mail-qt1-f179.google.com with SMTP id l11so11734304qtp.0 for <33684@debbugs.gnu.org>; Sat, 02 Feb 2019 12:58:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=ITR5IlfZ3IzL6OTlQPXGvW6lKBIirM23Tywe6ov0ik8=; b=Jq2R4ixZL5yHMTF+vo5mD8pk3efJ+fBhHIRvuspA3O0yQjfQGgJNJZ2wa8Ylv3ui4g hUoAYEulmJZH4FtJ+tchbpuFyYg/sGCfyK9VfbsDQOKXMl0lvxWsOwYz9iGo82HSbQoV 96Gn24Hx8OupezY47i0zI5WHzUMK0rRtm6KanCNxsQO3HuEtZf0RdmxvmTEkcr1OoKFU IA7llPht0GCUy6sGc4gFVtyiiF9ww9Ei/DkSz3eyNhJfSpI/fkFTZ0exmyPkIr3D4Uk4 2b2G6HNhsyvc1KiMAcOmK6Z4vWF6QMTuKT1OVSxwZwVx4XWw4C1oPTIb5dybQqe4dF0E ligA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=ITR5IlfZ3IzL6OTlQPXGvW6lKBIirM23Tywe6ov0ik8=; b=ialac5rnx4svkAOonVZY7VqVBHEGivVqy04EIHd7VmxGjAQk7HA0cK2zFwnWSBUosX HIorFpxwM4MIfIddSFJvEVhHIC0gx7vkX6LAdxSt/cVDtn64UDcK5kR0du8Y5F+SPV3Q 61JwVOxdhD3Dpl7qtsr/gqFm/WVPQ0H+9Cm/QIKt5ynNnAK1zPBhqNEPN2AIpCbl4NI6 Kdd3s8j4qoq1QoGD6HeEAvKsBHqXjkTovcNAO540ZPIZXvjuf9vakEufqpvnIkgpvsm/ /AJzGzKbzaSTr+AT+9cN1sSqJxf2L83Bhni3NKJmlTUhl1Ux41dCM43fzUvLW4po6UT7 Ju/g== X-Gm-Message-State: AHQUAuZQXXWbU74RbKM4wuubo1RGtJUrhq7FfIula5HqVvw22SDxFpgp 5SZrUEzt0gG5fqtpodpG2rc= X-Google-Smtp-Source: AHgI3IZluAKPfeRZrv4+lJHClrvltV76izveAcGWJeMwbYoSwceYj6QSYCghMJ22dfLHcvpspnfNKQ== X-Received: by 2002:ac8:191d:: with SMTP id t29mr850337qtj.387.1549141083878; Sat, 02 Feb 2019 12:58:03 -0800 (PST) Received: from hideo ([181.167.176.220]) by smtp.gmail.com with ESMTPSA id f33sm1036069qta.91.2019.02.02.12.58.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 02 Feb 2019 12:58:03 -0800 (PST) From: Federico Tedin To: Eli Zaretskii Subject: Re: bug#33684: DocView bombs out upon password protected PDFs References: <87d0qb3rb1.fsf@jidanni.org> <87sgxesv6u.fsf@gmail.com> <83womjyhrw.fsf@gnu.org> <87h8dn7r6k.fsf@gnu.org> <83pnsbyeyt.fsf@gnu.org> Date: Sat, 02 Feb 2019 17:58:00 -0300 In-Reply-To: <83pnsbyeyt.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 01 Feb 2019 12:34:34 +0200") Message-ID: <875zu1x607.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 33684 Cc: 33684@debbugs.gnu.org, jidanni@jidanni.org, Tassilo Horn X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Here's the new version of the patch, which enables using MuPDF to open password-protected PDF files. One problem I encountered while writing it is that function `doc-view-pdf->png-converter-mupdf' uses a small hack to add "draw" to the arguments list passed to `doc-view-start-process', only when `doc-view-pdfdraw-program' has the value "mutool". This is because the "mudraw" command has been replaced at some point by the "mutool" command, which requires passing "draw" as a subcommand to do the same work. I ended up using the same hack in the new function I created, with a reference to the original one, but I'm not sure this was the best possible approach. Is there a cleaner way to solve this? - Federico --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=pdf.patch Content-Description: patch diff --git a/lisp/doc-view.el b/lisp/doc-view.el index df8a9fc70f..b690fb1bd6 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -183,11 +183,16 @@ doc-view-pdf->png-converter-function (defcustom doc-view-ghostscript-options '("-dSAFER" ;; Avoid security problems when rendering files from untrusted ;; sources. - "-dNOPAUSE" "-sDEVICE=png16m" "-dTextAlphaBits=4" + "-dNOPAUSE" "-dTextAlphaBits=4" "-dBATCH" "-dGraphicsAlphaBits=4" "-dQUIET") "A list of options to give to ghostscript." :type '(repeat string)) +(defcustom doc-view-ghostscript-device "png16m" + "Output device to give to ghostscript." + :type 'string + :version "27.1") + (defcustom doc-view-resolution 100 "Dots per inch resolution used to render the documents. Higher values result in larger images." @@ -950,16 +955,31 @@ doc-view-dvi->pdf (list "-o" pdf dvi) callback))) +(defun doc-view-pdf-password-protected-ghostscript-p (pdf) + "Using Ghostscript, check if a PDF file is password-protected. If it +is, return non-nil." + (with-temp-buffer + (apply #'call-process doc-view-ghostscript-program nil (current-buffer) + nil `(,@doc-view-ghostscript-options + "-sNODISPLAY" + ,pdf)) + (goto-char (point-min)) + (search-forward "This file requires a password for access." nil t))) + (defun doc-view-pdf->png-converter-ghostscript (pdf png page callback) - (doc-view-start-process - "pdf/ps->png" doc-view-ghostscript-program - `(,@doc-view-ghostscript-options - ,(format "-r%d" (round doc-view-resolution)) - ,@(if page `(,(format "-dFirstPage=%d" page))) - ,@(if page `(,(format "-dLastPage=%d" page))) - ,(concat "-sOutputFile=" png) - ,pdf) - callback)) + (let ((pdf-passwd (if (doc-view-pdf-password-protected-ghostscript-p pdf) + (read-passwd "Enter password for PDF file: ")))) + (doc-view-start-process + "pdf/ps->png" doc-view-ghostscript-program + `(,@doc-view-ghostscript-options + ,(concat "-sDEVICE=" doc-view-ghostscript-device) + ,(format "-r%d" (round doc-view-resolution)) + ,@(if page `(,(format "-dFirstPage=%d" page))) + ,@(if page `(,(format "-dLastPage=%d" page))) + ,@(if pdf-passwd `(,(format "-sPDFPassword=%s" pdf-passwd))) + ,(concat "-sOutputFile=" png) + ,pdf) + callback))) (defalias 'doc-view-ps->png-converter-ghostscript 'doc-view-pdf->png-converter-ghostscript) @@ -980,17 +1000,33 @@ doc-view-djvu->tiff-converter-ddjvu ,tiff) callback)) +(defun doc-view-pdf-password-protected-pdfdraw-p (pdf) + "Using MuPDF, check if a PDF file is password-protected. If it is, +return non-nil." + (with-temp-buffer + (apply #'call-process doc-view-pdfdraw-program nil (current-buffer) nil + ;; FIXME: See FIXME comment in `doc-view-pdf->png-converter-mupdf'. + `(,@(if (string-match "mutool[^/\\]*$" doc-view-pdfdraw-program) '("draw")) + ,(concat "-o" null-device) + ;; In case PDF isn't password-protected, "draw" only one page. + ,pdf "1")) + (goto-char (point-min)) + (search-forward "error: cannot authenticate password" nil t))) + (defun doc-view-pdf->png-converter-mupdf (pdf png page callback) - (doc-view-start-process - "pdf->png" doc-view-pdfdraw-program - ;; FIXME: Ugly hack: recent mupdf distribution replaced "mudraw" with - ;; "mutool draw". - `(,@(if (string-match "mutool[^/\\]*$" doc-view-pdfdraw-program) '("draw")) - ,(concat "-o" png) - ,(format "-r%d" (round doc-view-resolution)) - ,pdf - ,@(if page `(,(format "%d" page)))) - callback)) + (let ((pdf-passwd (if (doc-view-pdf-password-protected-pdfdraw-p pdf) + (read-passwd "Enter password for PDF file: ")))) + (doc-view-start-process + "pdf->png" doc-view-pdfdraw-program + ;; FIXME: Ugly hack: recent mupdf distribution replaced "mudraw" with + ;; "mutool draw". + `(,@(if (string-match "mutool[^/\\]*$" doc-view-pdfdraw-program) '("draw")) + ,(concat "-o" png) + ,(format "-r%d" (round doc-view-resolution)) + ,@(if pdf-passwd `("-p" ,pdf-passwd)) + ,pdf + ,@(if page `(,(format "%d" page)))) + callback))) (defun doc-view-odf->pdf-converter-unoconv (odf callback) "Convert ODF to PDF asynchronously and call CALLBACK when finished. --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 03 03:40:22 2019 Received: (at 33684) by debbugs.gnu.org; 3 Feb 2019 08:40:22 +0000 Received: from localhost ([127.0.0.1]:56744 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqDK9-0000R6-Po for submit@debbugs.gnu.org; Sun, 03 Feb 2019 03:40:22 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39898) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqDK8-0000Qr-Dc for 33684@debbugs.gnu.org; Sun, 03 Feb 2019 03:40:20 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:33438) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gqDK0-0008N1-OO; Sun, 03 Feb 2019 03:40:12 -0500 Received: from auth2-smtp.messagingengine.com ([66.111.4.228]:58109) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.82) (envelope-from ) id 1gqDK0-0005MO-Fe; Sun, 03 Feb 2019 03:40:12 -0500 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailauth.nyi.internal (Postfix) with ESMTP id AF14D20F25; Sun, 3 Feb 2019 03:40:11 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Sun, 03 Feb 2019 03:40:11 -0500 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrkedugdduudefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffufhffjg fkfgggtgesthdtredttdertdenucfhrhhomhepvfgrshhsihhlohcujfhorhhnuceothhs ughhsehgnhhurdhorhhgqeenucfkphepleefrddvfeeirdduvdelrdehvdenucfrrghrrg hmpehmrghilhhfrhhomhepthhhohhrnhdomhgvshhmthhprghuthhhphgvrhhsohhnrghl ihhthidqkeeijeefkeejkeegqdeifeehvdelkedqthhsughhpeepghhnuhdrohhrghesfh grshhtmhgrihhlrdhfmhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from thinkpad-t440p (p5dec8134.dip0.t-ipconnect.de [93.236.129.52]) by mail.messagingengine.com (Postfix) with ESMTPA id 04FBA100BB; Sun, 3 Feb 2019 03:40:09 -0500 (EST) From: Tassilo Horn To: Federico Tedin Subject: Re: bug#33684: DocView bombs out upon password protected PDFs References: <87d0qb3rb1.fsf@jidanni.org> <87sgxesv6u.fsf@gmail.com> <83womjyhrw.fsf@gnu.org> <87h8dn7r6k.fsf@gnu.org> <83pnsbyeyt.fsf@gnu.org> <875zu1x607.fsf@gmail.com> Date: Sun, 03 Feb 2019 09:40:08 +0100 In-Reply-To: <875zu1x607.fsf@gmail.com> (Federico Tedin's message of "Sat, 02 Feb 2019 17:58:00 -0300") Message-ID: <87lg2x5kpj.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 33684 Cc: Eli Zaretskii , 33684@debbugs.gnu.org, jidanni@jidanni.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Federico Tedin writes: Hi Federico, > Here's the new version of the patch, which enables using MuPDF to open > password-protected PDF files. > > One problem I encountered while writing it is that function > `doc-view-pdf->png-converter-mupdf' uses a small hack to add "draw" to > the arguments list passed to `doc-view-start-process', only when > `doc-view-pdfdraw-program' has the value "mutool". This is because the > "mudraw" command has been replaced at some point by the "mutool" > command, which requires passing "draw" as a subcommand to do the same > work. I ended up using the same hack in the new function I created, > with a reference to the original one, but I'm not sure this was the > best possible approach. Is there a cleaner way to solve this? You could have extracted that into its own function, e.g., (defun doc-view-pdfdraw-program-subcommand () "Return the mutool subcommand replacing mudraw. Recent mupdf distribution replaced mudraw with `mutool draw'." (when (string-match "mutool[^/\\]*$" doc-view-pdfdraw-program) '("draw"))) and use that at those two places. Could you please commit the patch locally (including the ChangeLog style commit message) and send it exported with "git format-patch"? Bye, Tassilo PS: I had acually also accepted using the ghostscript password check with mupdf, too. But since you don't need ghostscript for PDFs if you have mupdf, your approach is even better. From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 03 11:55:33 2019 Received: (at 33684) by debbugs.gnu.org; 3 Feb 2019 16:55:33 +0000 Received: from localhost ([127.0.0.1]:57730 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqL3N-0006s3-4r for submit@debbugs.gnu.org; Sun, 03 Feb 2019 11:55:33 -0500 Received: from mail-qk1-f176.google.com ([209.85.222.176]:46522) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqL3L-0006rm-50 for 33684@debbugs.gnu.org; Sun, 03 Feb 2019 11:55:31 -0500 Received: by mail-qk1-f176.google.com with SMTP id q1so6987173qkf.13 for <33684@debbugs.gnu.org>; Sun, 03 Feb 2019 08:55:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=e6uKqwc+498wLNUSlxCwd7HEEsgn25FCg3MifNi3/R4=; b=ZP3Rpusz2M0xOcVWbgZk3RAJ4Wg8LvJXW27MHz71jU32nm12lOxdk5xb7fESKj+G/r Pg5GKir3w/Wksc8pyJnqXG7KzRruT6PBgdgrB/IM1kA7NJko21wocI3B6HPflRhlaXwH qvrOX25a/uj51egoyXp2WcJz51ETtzysdiTs6l5Ep5S1wv/tU4MIjdT3EmgzcrQ5aI7G 95+WxE+dEFsmAzFyKHv54dR45z807Fy2rrNd/bOxPl+LxX/+xaeYhRsZDQCHTYVPjYRs 0uFlsQjNO9/nzSUFoPAs/WT5dhwZ83q+zWdQKNv7xqIK0b0ZasdTzLmniYwBXxDl1z// 61JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=e6uKqwc+498wLNUSlxCwd7HEEsgn25FCg3MifNi3/R4=; b=FfMZKPli/+msWzCIiqQ+65fpgo9GE7GCOdNgKcheiQ4igNFTGArvRwLCiEOfYMjU6Q tsAiPzjjBMd2K6ei6PBuDW0TghXMbBNN02pv8zcDhw2eHpCCsirdmEAsuJGig3WrErJH qNXiL5LfaokoLZCpCZRJ7cYnXWEDsrwJjhS09yuf1J0+dzAElCiCeKtTwA8Z49xb1/Fi ZMGRO2D0Ovmm5LNQmZvWC0y0Vv744cyKJp5ijJK56ksVnxkwNBEq7YH5DkB6jWcHt4GK nypn7lWsJoWdzmu50DeArmmg22qKBdvBBDoFV6lr9YLt8EqlzhFkCLbD43c0Hi4w8JXJ 3EpQ== X-Gm-Message-State: AJcUukeQWtgi2epKf9FeaVrZOYkG4jImFRxC0e5oiB1B257wmA5jejHX 4asSJF7ekZa8SqyVzA3m4RE= X-Google-Smtp-Source: ALg8bN6q6m/AhUhGkyQc7TyyPuSI+GMs7DWhqgxk8eFTbfQCzpfyaDK5OgFFYtGHdlJSxIOMakA6PQ== X-Received: by 2002:a37:bf81:: with SMTP id p123mr43254068qkf.125.1549212925560; Sun, 03 Feb 2019 08:55:25 -0800 (PST) Received: from hideo ([181.167.176.220]) by smtp.gmail.com with ESMTPSA id m68sm12969719qte.49.2019.02.03.08.55.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 03 Feb 2019 08:55:24 -0800 (PST) From: Federico Tedin To: Tassilo Horn Subject: Re: bug#33684: DocView bombs out upon password protected PDFs References: <87d0qb3rb1.fsf@jidanni.org> <87sgxesv6u.fsf@gmail.com> <83womjyhrw.fsf@gnu.org> <87h8dn7r6k.fsf@gnu.org> <83pnsbyeyt.fsf@gnu.org> <875zu1x607.fsf@gmail.com> <87lg2x5kpj.fsf@gnu.org> Date: Sun, 03 Feb 2019 13:55:14 -0300 In-Reply-To: <87lg2x5kpj.fsf@gnu.org> (Tassilo Horn's message of "Sun, 03 Feb 2019 09:40:08 +0100") Message-ID: <87zhrcyfpp.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 33684 Cc: Eli Zaretskii , 33684@debbugs.gnu.org, jidanni@jidanni.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Hi Tassilo, thanks for your feedback. I've created a new patch with the commit message, and also added an entry to NEWS. I'm attaching it here. - Federico --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=pdf.patch Content-Description: patch >From 0fb8d45a3ab0868e0f1d81f00b0f43771510deb1 Mon Sep 17 00:00:00 2001 From: Federico Tedin Date: Sun, 3 Feb 2019 13:48:31 -0300 Subject: [PATCH 1/1] Allow doc-view to open password-protected PDF files - lisp/doc-view.el (doc-view-ghostscript-options): Removed "-sDEVICE" option. (doc-view-ghostscript-device): New customizable variable, passed as "-sDEVICE" option to GhostScript. (doc-view-pdf-password-protected-ghostscript-p): New function. (doc-view-pdf->png-converter-ghostscript): Can now open password-protected PDF files. (doc-view-pdfdraw-program-subcommand): New function. (doc-view-pdf-password-protected-pdfdraw-p): New function. (doc-view-pdf->png-converter-mupdf): Can now open password-protected PDF files. - etc/NEWS: Mention new doc-view-mode feature. --- etc/NEWS | 1 + lisp/doc-view.el | 79 ++++++++++++++++++++++++++++++++++++------------ 2 files changed, 60 insertions(+), 20 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index cac379fe7e..8aa646776c 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -329,6 +329,7 @@ the node "(emacs) Directory Variables" of the user manual. ** doc-view-mode *** New commands doc-view-presentation and doc-view-fit-window-to-page +*** Added support for password-protected PDF files ** map.el *** Now also understands plists. diff --git a/lisp/doc-view.el b/lisp/doc-view.el index df8a9fc70f..a5fdb91a36 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -183,11 +183,16 @@ doc-view-pdf->png-converter-function (defcustom doc-view-ghostscript-options '("-dSAFER" ;; Avoid security problems when rendering files from untrusted ;; sources. - "-dNOPAUSE" "-sDEVICE=png16m" "-dTextAlphaBits=4" + "-dNOPAUSE" "-dTextAlphaBits=4" "-dBATCH" "-dGraphicsAlphaBits=4" "-dQUIET") "A list of options to give to ghostscript." :type '(repeat string)) +(defcustom doc-view-ghostscript-device "png16m" + "Output device to give to ghostscript." + :type 'string + :version "27.1") + (defcustom doc-view-resolution 100 "Dots per inch resolution used to render the documents. Higher values result in larger images." @@ -950,16 +955,31 @@ doc-view-dvi->pdf (list "-o" pdf dvi) callback))) +(defun doc-view-pdf-password-protected-ghostscript-p (pdf) + "Using Ghostscript, check if a PDF file is password-protected. If it +is, return non-nil." + (with-temp-buffer + (apply #'call-process doc-view-ghostscript-program nil (current-buffer) + nil `(,@doc-view-ghostscript-options + "-sNODISPLAY" + ,pdf)) + (goto-char (point-min)) + (search-forward "This file requires a password for access." nil t))) + (defun doc-view-pdf->png-converter-ghostscript (pdf png page callback) - (doc-view-start-process - "pdf/ps->png" doc-view-ghostscript-program - `(,@doc-view-ghostscript-options - ,(format "-r%d" (round doc-view-resolution)) - ,@(if page `(,(format "-dFirstPage=%d" page))) - ,@(if page `(,(format "-dLastPage=%d" page))) - ,(concat "-sOutputFile=" png) - ,pdf) - callback)) + (let ((pdf-passwd (if (doc-view-pdf-password-protected-ghostscript-p pdf) + (read-passwd "Enter password for PDF file: ")))) + (doc-view-start-process + "pdf/ps->png" doc-view-ghostscript-program + `(,@doc-view-ghostscript-options + ,(concat "-sDEVICE=" doc-view-ghostscript-device) + ,(format "-r%d" (round doc-view-resolution)) + ,@(if page `(,(format "-dFirstPage=%d" page))) + ,@(if page `(,(format "-dLastPage=%d" page))) + ,@(if pdf-passwd `(,(format "-sPDFPassword=%s" pdf-passwd))) + ,(concat "-sOutputFile=" png) + ,pdf) + callback))) (defalias 'doc-view-ps->png-converter-ghostscript 'doc-view-pdf->png-converter-ghostscript) @@ -980,17 +1000,36 @@ doc-view-djvu->tiff-converter-ddjvu ,tiff) callback)) +(defun doc-view-pdfdraw-program-subcommand () + "Return the mutool subcommand replacing mudraw. +Recent MuPDF distributions replaced 'mudraw' with 'mutool draw'." + (when (string-match "mutool[^/\\]*$" doc-view-pdfdraw-program) + '("draw"))) + +(defun doc-view-pdf-password-protected-pdfdraw-p (pdf) + "Using MuPDF, check if a PDF file is password-protected. If it is, +return non-nil." + (with-temp-buffer + (apply #'call-process doc-view-pdfdraw-program nil (current-buffer) nil + `(,@(doc-view-pdfdraw-program-subcommand) + ,(concat "-o" null-device) + ;; In case PDF isn't password-protected, "draw" only one page. + ,pdf "1")) + (goto-char (point-min)) + (search-forward "error: cannot authenticate password" nil t))) + (defun doc-view-pdf->png-converter-mupdf (pdf png page callback) - (doc-view-start-process - "pdf->png" doc-view-pdfdraw-program - ;; FIXME: Ugly hack: recent mupdf distribution replaced "mudraw" with - ;; "mutool draw". - `(,@(if (string-match "mutool[^/\\]*$" doc-view-pdfdraw-program) '("draw")) - ,(concat "-o" png) - ,(format "-r%d" (round doc-view-resolution)) - ,pdf - ,@(if page `(,(format "%d" page)))) - callback)) + (let ((pdf-passwd (if (doc-view-pdf-password-protected-pdfdraw-p pdf) + (read-passwd "Enter password for PDF file: ")))) + (doc-view-start-process + "pdf->png" doc-view-pdfdraw-program + `(,@(doc-view-pdfdraw-program-subcommand) + ,(concat "-o" png) + ,(format "-r%d" (round doc-view-resolution)) + ,@(if pdf-passwd `("-p" ,pdf-passwd)) + ,pdf + ,@(if page `(,(format "%d" page)))) + callback))) (defun doc-view-odf->pdf-converter-unoconv (odf callback) "Convert ODF to PDF asynchronously and call CALLBACK when finished. -- 2.17.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 04 00:44:53 2019 Received: (at 33684) by debbugs.gnu.org; 4 Feb 2019 05:44:53 +0000 Received: from localhost ([127.0.0.1]:57973 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqX3s-0004k2-RE for submit@debbugs.gnu.org; Mon, 04 Feb 2019 00:44:53 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59301) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqX3r-0004jn-1x for 33684@debbugs.gnu.org; Mon, 04 Feb 2019 00:44:51 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:57328) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gqX3l-0006tF-O5; Mon, 04 Feb 2019 00:44:45 -0500 Received: from auth2-smtp.messagingengine.com ([66.111.4.228]:38817) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.82) (envelope-from ) id 1gqX3l-0000UR-K1; Mon, 04 Feb 2019 00:44:45 -0500 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailauth.nyi.internal (Postfix) with ESMTP id E1DD122012; Mon, 4 Feb 2019 00:44:44 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Mon, 04 Feb 2019 00:44:44 -0500 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrkeefgdekiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthenuceurghilhhouhhtmecufedt tdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhfffgjkf gfgggtsehttdertddtredtnecuhfhrohhmpefvrghsshhilhhoucfjohhrnhcuoehtshgu hhesghhnuhdrohhrgheqnecukfhppedvuddvrddukeehrddvtdefrddufeegnecurfgrrh grmhepmhgrihhlfhhrohhmpehthhhorhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgr lhhithihqdekieejfeekjeekgedqieefhedvleekqdhtshguhheppehgnhhurdhorhhgse hfrghsthhmrghilhdrfhhmnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from pchta-and (portal.shd.de [212.185.203.134]) by mail.messagingengine.com (Postfix) with ESMTPA id DC80210288; Mon, 4 Feb 2019 00:44:43 -0500 (EST) From: Tassilo Horn To: Federico Tedin Subject: Re: bug#33684: DocView bombs out upon password protected PDFs References: <87d0qb3rb1.fsf@jidanni.org> <87sgxesv6u.fsf@gmail.com> <83womjyhrw.fsf@gnu.org> <87h8dn7r6k.fsf@gnu.org> <83pnsbyeyt.fsf@gnu.org> <875zu1x607.fsf@gmail.com> <87lg2x5kpj.fsf@gnu.org> <87zhrcyfpp.fsf@gmail.com> Date: Mon, 04 Feb 2019 06:44:43 +0100 In-Reply-To: <87zhrcyfpp.fsf@gmail.com> (Federico Tedin's message of "Sun, 03 Feb 2019 13:55:14 -0300") Message-ID: <87k1igyuno.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 33684 Cc: Eli Zaretskii , 33684@debbugs.gnu.org, jidanni@jidanni.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Federico Tedin writes: Hi Federico, > Hi Tassilo, thanks for your feedback. I've created a new patch with > the commit message, and also added an entry to NEWS. I'm attaching it > here. Looks perfect. Small nitpick: we use * for bullet points instead of - in the commit message, but I can amend that. I can't push it from work, so I'll do it this evening. Thanks a lot for improving doc-view! Tassilo From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 04 01:29:57 2019 Received: (at 33684) by debbugs.gnu.org; 4 Feb 2019 06:29:57 +0000 Received: from localhost ([127.0.0.1]:57989 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqXlV-00066c-2z for submit@debbugs.gnu.org; Mon, 04 Feb 2019 01:29:57 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43705) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqXlT-00066P-TA for 33684@debbugs.gnu.org; Mon, 04 Feb 2019 01:29:56 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:58025) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gqXlO-0002hA-9n; Mon, 04 Feb 2019 01:29:50 -0500 Received: from [176.12.202.20] (port=51527 helo=[10.164.143.235]) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1gqXlN-0003Qg-NA; Mon, 04 Feb 2019 01:29:50 -0500 Date: Mon, 04 Feb 2019 08:29:46 +0200 User-Agent: K-9 Mail for Android In-Reply-To: <87k1igyuno.fsf@gnu.org> References: <87d0qb3rb1.fsf@jidanni.org> <87sgxesv6u.fsf@gmail.com> <83womjyhrw.fsf@gnu.org> <87h8dn7r6k.fsf@gnu.org> <83pnsbyeyt.fsf@gnu.org> <875zu1x607.fsf@gmail.com> <87lg2x5kpj.fsf@gnu.org> <87zhrcyfpp.fsf@gmail.com> <87k1igyuno.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: bug#33684: DocView bombs out upon password protected PDFs To: Tassilo Horn ,Federico Tedin From: Eli Zaretskii Message-ID: <56A449C2-6DF7-4073-BD68-14216F8746F8@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 33684 Cc: 33684@debbugs.gnu.org, jidanni@jidanni.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On February 4, 2019 7:44:43 AM GMT+02:00, Tassilo Horn wro= te: > Federico Tedin writes: >=20 > Hi Federico, >=20 > > Hi Tassilo, thanks for your feedback=2E I've created a new patch with > > the commit message, and also added an entry to NEWS=2E I'm attaching > it > > here=2E >=20 > Looks perfect=2E Small nitpick: we use * for bullet points instead of - > in the commit message, but I can amend that=2E I can't push it from > work, > so I'll do it this evening=2E When you do, please be sure to amend the log message to mention the bug nu= mber=2E Also, the doc strings of 2 of the new functions need to be reformatted to = have the first line be a complete sentence=2E (Just move the second senten= ce to the next line, I'd say=2E) Thanks=2E From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 04 01:52:52 2019 Received: (at 33684) by debbugs.gnu.org; 4 Feb 2019 06:52:52 +0000 Received: from localhost ([127.0.0.1]:57994 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqY7g-0006mu-2H for submit@debbugs.gnu.org; Mon, 04 Feb 2019 01:52:52 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48425) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqY7e-0006mi-R5 for 33684@debbugs.gnu.org; Mon, 04 Feb 2019 01:52:51 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:58280) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gqY7Z-0005Gq-7Y; Mon, 04 Feb 2019 01:52:45 -0500 Received: from auth2-smtp.messagingengine.com ([66.111.4.228]:51441) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.82) (envelope-from ) id 1gqY7X-0005F6-CP; Mon, 04 Feb 2019 01:52:44 -0500 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailauth.nyi.internal (Postfix) with ESMTP id D1B402188F; Mon, 4 Feb 2019 01:52:42 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Mon, 04 Feb 2019 01:52:42 -0500 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrkeefgddutddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffufhffjg fkfgggtgesthdtredttdertdenucfhrhhomhepvfgrshhsihhlohcujfhorhhnuceothhs ughhsehgnhhurdhorhhgqeenucfkphepvdduvddrudekhedrvddtfedrudefgeenucfrrg hrrghmpehmrghilhhfrhhomhepthhhohhrnhdomhgvshhmthhprghuthhhphgvrhhsohhn rghlihhthidqkeeijeefkeejkeegqdeifeehvdelkedqthhsughhpeepghhnuhdrohhrgh esfhgrshhtmhgrihhlrdhfmhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from pchta-and (portal.shd.de [212.185.203.134]) by mail.messagingengine.com (Postfix) with ESMTPA id 44D1EE4650; Mon, 4 Feb 2019 01:52:41 -0500 (EST) From: Tassilo Horn To: Eli Zaretskii Subject: Re: bug#33684: DocView bombs out upon password protected PDFs References: <87d0qb3rb1.fsf@jidanni.org> <87sgxesv6u.fsf@gmail.com> <83womjyhrw.fsf@gnu.org> <87h8dn7r6k.fsf@gnu.org> <83pnsbyeyt.fsf@gnu.org> <875zu1x607.fsf@gmail.com> <87lg2x5kpj.fsf@gnu.org> <87zhrcyfpp.fsf@gmail.com> <87k1igyuno.fsf@gnu.org> <56A449C2-6DF7-4073-BD68-14216F8746F8@gnu.org> Date: Mon, 04 Feb 2019 07:52:40 +0100 In-Reply-To: <56A449C2-6DF7-4073-BD68-14216F8746F8@gnu.org> (Eli Zaretskii's message of "Mon, 04 Feb 2019 08:29:46 +0200") Message-ID: <87ftt4yrif.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 33684 Cc: 33684@debbugs.gnu.org, jidanni@jidanni.org, Federico Tedin X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> Looks perfect. Small nitpick: we use * for bullet points instead of - >> in the commit message, but I can amend that. I can't push it from >> work, so I'll do it this evening. > > When you do, please be sure to amend the log message to mention the > bug number. Ah, right! > Also, the doc strings of 2 of the new functions need to be reformatted > to have the first line be a complete sentence. (Just move the second > sentence to the next line, I'd say.) Will do. Bye, Tassilo From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 04 10:49:57 2019 Received: (at 33684-done) by debbugs.gnu.org; 4 Feb 2019 15:49:57 +0000 Received: from localhost ([127.0.0.1]:59623 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqgVQ-0002z6-PC for submit@debbugs.gnu.org; Mon, 04 Feb 2019 10:49:57 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52492) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqgVP-0002yt-2v for 33684-done@debbugs.gnu.org; Mon, 04 Feb 2019 10:49:55 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:39360) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gqgVJ-0006ES-Fz; Mon, 04 Feb 2019 10:49:49 -0500 Received: from auth2-smtp.messagingengine.com ([66.111.4.228]:48055) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.82) (envelope-from ) id 1gqgV0-0005oJ-Ii; Mon, 04 Feb 2019 10:49:36 -0500 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailauth.nyi.internal (Postfix) with ESMTP id 09CB721E07; Mon, 4 Feb 2019 10:49:30 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Mon, 04 Feb 2019 10:49:30 -0500 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrkeeggdekvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthenuceurghilhhouhhtmecufedt tdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhfffgjkf gfgggtsehttdertddtredtnecuhfhrohhmpefvrghsshhilhhoucfjohhrnhcuoehtshgu hhesghhnuhdrohhrgheqnecukfhppeelfedrvdefiedruddvledrhedvnecurfgrrhgrmh epmhgrihhlfhhrohhmpehthhhorhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhi thihqdekieejfeekjeekgedqieefhedvleekqdhtshguhheppehgnhhurdhorhhgsehfrg hsthhmrghilhdrfhhmnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from thinkpad-t440p (p5dec8134.dip0.t-ipconnect.de [93.236.129.52]) by mail.messagingengine.com (Postfix) with ESMTPA id 47B7210288; Mon, 4 Feb 2019 10:49:28 -0500 (EST) From: Tassilo Horn To: Eli Zaretskii Subject: Re: bug#33684: DocView bombs out upon password protected PDFs References: <87d0qb3rb1.fsf@jidanni.org> <87sgxesv6u.fsf@gmail.com> <83womjyhrw.fsf@gnu.org> <87h8dn7r6k.fsf@gnu.org> <83pnsbyeyt.fsf@gnu.org> <875zu1x607.fsf@gmail.com> <87lg2x5kpj.fsf@gnu.org> <87zhrcyfpp.fsf@gmail.com> <87k1igyuno.fsf@gnu.org> <56A449C2-6DF7-4073-BD68-14216F8746F8@gnu.org> Date: Mon, 04 Feb 2019 16:49:25 +0100 In-Reply-To: <56A449C2-6DF7-4073-BD68-14216F8746F8@gnu.org> (Eli Zaretskii's message of "Mon, 04 Feb 2019 08:29:46 +0200") Message-ID: <87h8djeepm.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 33684-done Cc: jidanni@jidanni.org, 33684-done@debbugs.gnu.org, Federico Tedin X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> > Hi Tassilo, thanks for your feedback. I've created a new patch with >> > the commit message, and also added an entry to NEWS. I'm attaching >> it >> > here. >> >> Looks perfect. Small nitpick: we use * for bullet points instead of >> - in the commit message, but I can amend that. I can't push it from >> work, so I'll do it this evening. > > When you do, please be sure to amend the log message to mention the > bug number. > > Also, the doc strings of 2 of the new functions need to be reformatted > to have the first line be a complete sentence. (Just move the second > sentence to the next line, I'd say.) Pushed with the aforementioned changes. Thanks again, Federico! Tassilo From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 04 16:24:15 2019 Received: (at 33684-done) by debbugs.gnu.org; 4 Feb 2019 21:24:15 +0000 Received: from localhost ([127.0.0.1]:59765 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqliw-0000GX-1f for submit@debbugs.gnu.org; Mon, 04 Feb 2019 16:24:15 -0500 Received: from mail-qt1-f170.google.com ([209.85.160.170]:40674) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqliu-0000GD-QV for 33684-done@debbugs.gnu.org; Mon, 04 Feb 2019 16:24:13 -0500 Received: by mail-qt1-f170.google.com with SMTP id k12so1631918qtf.7 for <33684-done@debbugs.gnu.org>; Mon, 04 Feb 2019 13:24:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=OI7wIjAJkRyNfN82IDxAVLR/UDyX6NvXbZjDcfxjRv0=; b=DLWGLjiJ2pyfElRGxu736PE/RdHm/gytWoluSi0w4zZ5PUSf9YZciEjLS2cUxtcE7b lVKocHsXdOeo2lwgbWgDwgEjvnHslpQnJbPJFJmiNHJ9ImcRJj09JWqkgAQcYnQggcJl jMGiFvhebvWJANguJ8nZQhw2SIEaQ3/9uImAG/5Vt/qrewBpO9PJzWklfjdLCO5WDHDt iN+buhYbWCb84cS0FX6/dgRir5kjm2JxK7xgaeIFbUQZyAaGpxV5ObVZJkR4xOud20Wy OGty69FfbLF8ILRuZNI+U3HpoL+gX/jlDUbOJrPcDJVauj2hZGWfowNId/CEAo4W314W +/wQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=OI7wIjAJkRyNfN82IDxAVLR/UDyX6NvXbZjDcfxjRv0=; b=H73rW2aE5pToWAlNhGzSaTvau7Nxd232gfifM6EV2TRUra7D8OszmZ8EW+fAAONgUe 6aKerlDgIuo7ezuxIeYnkBWdkD7OZp9Fs9F7dX9xxqNGppKCAw5fNwEa/DI55Lylb5Lf x2T/9KqnHWz3qS6ltP227H7Q1FTzKxx7ZjnKGikiyg0FI1VjVEyepBjefjxL2iWfsBPt mx2g1uFxaHKUcwsf/a9Ch2MomnNQAhYlFHydTnOf2XbswtLZm/cazYY8yET43T00iyJA pLjrLDvY/J8Z2LbMB0DqQ9SKn+9tefSNhpa72NPrLjygpAfHo04CkgAFQ2PJuqJgEMPV PiCA== X-Gm-Message-State: AHQUAuZIiw5n69IC+tbMyYvG7kZOlySKp44+6JBGoj2EhDa4TBwl+qHc /xRwsQBltNrVZrR3ukzd+3Y= X-Google-Smtp-Source: AHgI3IbmwKNZM+p8JGdjvtH3U5D11MrkJZQAOTYpC7kVmqm7iz5XnV8YACeGq8oaeE2Lms3mrMZDsA== X-Received: by 2002:ac8:5354:: with SMTP id d20mr1093613qto.73.1549315446770; Mon, 04 Feb 2019 13:24:06 -0800 (PST) Received: from hideo ([181.167.176.220]) by smtp.gmail.com with ESMTPSA id k185sm12247693qkd.62.2019.02.04.13.24.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Feb 2019 13:24:06 -0800 (PST) From: Federico Tedin To: Tassilo Horn Subject: Re: bug#33684: DocView bombs out upon password protected PDFs References: <87d0qb3rb1.fsf@jidanni.org> <87sgxesv6u.fsf@gmail.com> <83womjyhrw.fsf@gnu.org> <87h8dn7r6k.fsf@gnu.org> <83pnsbyeyt.fsf@gnu.org> <875zu1x607.fsf@gmail.com> <87lg2x5kpj.fsf@gnu.org> <87zhrcyfpp.fsf@gmail.com> <87k1igyuno.fsf@gnu.org> <56A449C2-6DF7-4073-BD68-14216F8746F8@gnu.org> <87h8djeepm.fsf@gnu.org> Date: Mon, 04 Feb 2019 18:24:03 -0300 In-Reply-To: <87h8djeepm.fsf@gnu.org> (Tassilo Horn's message of "Mon, 04 Feb 2019 16:49:25 +0100") Message-ID: <87sgx3xn64.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 33684-done Cc: Eli Zaretskii , 33684-done@debbugs.gnu.org, jidanni@jidanni.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > Pushed with the aforementioned changes. > > Thanks again, Federico! > Tassilo No problem! Thank you. From unknown Fri Jun 13 10:45:44 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 05 Mar 2019 12:24:08 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator