From unknown Tue Jun 17 22:27:37 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34377: (ledger|trezor|keepkey)-agent execute shell code with python interpreter Resent-From: Vagrant Cascadian Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 08 Feb 2019 01:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 34377 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 34377@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.154958970210386 (code B ref -1); Fri, 08 Feb 2019 01:36:01 +0000 Received: (at submit) by debbugs.gnu.org; 8 Feb 2019 01:35:02 +0000 Received: from localhost ([127.0.0.1]:38727 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1grv4I-0002hR-0e for submit@debbugs.gnu.org; Thu, 07 Feb 2019 20:35:02 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45374) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1grv4F-0002gr-C2 for submit@debbugs.gnu.org; Thu, 07 Feb 2019 20:35:00 -0500 Received: from lists.gnu.org ([209.51.188.17]:44094) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1grv4A-0002xa-3M for submit@debbugs.gnu.org; Thu, 07 Feb 2019 20:34:54 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59721) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1grv48-0007Y8-Po for bug-guix@gnu.org; Thu, 07 Feb 2019 20:34:53 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_40,RCVD_IN_DNSWL_NONE, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1grv47-0002u5-U3 for bug-guix@gnu.org; Thu, 07 Feb 2019 20:34:52 -0500 Received: from cascadia.aikidev.net ([173.255.214.101]:51656) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1grv44-0002qX-Jj for bug-guix@gnu.org; Thu, 07 Feb 2019 20:34:50 -0500 Received: from localhost (unknown [IPv6:2600:3c01:e000:21:21:21:0:100e]) (Authenticated sender: vagrant@cascadia.debian.net) by cascadia.aikidev.net (Postfix) with ESMTPSA id C1F0C1AAC0 for ; Thu, 7 Feb 2019 17:34:38 -0800 (PST) From: Vagrant Cascadian Date: Thu, 07 Feb 2019 17:34:33 -0800 Message-ID: <87mun76p1y.fsf@ponder> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 173.255.214.101 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: 0.0 (/) 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 When running trezor-agent (or any of the others), I get a bizarre python traceback with a bunch of code that looks to be shell code. $ trezor-agent Traceback (most recent call last): File "/gnu/store/77i5pm165ljn8fx030z41yqaja77lb99-trezor-agent-0.10.0/bin/.trezor-agent-real", line 11, in load_entry_point('trezor-agent==0.10.0', 'console_scripts', 'trezor-agent')() File "/gnu/store/9z98cvjm7p7z21xdid1ryydxy5vyz6wr-python-3.7.0/lib/python3.7/site-packages/pkg_resources/__init__.py", line 480, in load_entry_point ... module = __import__(self.module_name, fromlist=['__name__'], level=0) File "/gnu/store/77i5pm165ljn8fx030z41yqaja77lb99-trezor-agent-0.10.0/bin/trezor_agent.py", line 2 export PYTHONPATH="/gnu/store/ ... site-packages${PYTHONPATH:+:}$PYTHONPATH" ^ SyntaxError: invalid syntax It looks to me that .trezor-agent-real is trying to import trezor_agent.py as a python module, and obviously failing, because it is also a shell wrapper around .trezor_agent.py-real My guess is the correct way to fix this is to not install the shell wrapper around trezor_agent.py and/or put trezor_agent.py into a proper module in PYTHONPATH, rather than in /bin. I'm not sure how to do that in the packaging, but I've manually hacked around this by copying all of the .*-real files from /bin into another directory, renaming them to their original names, adding the directory to PATH, and setting PYTHONPATH manually to what the shell wrappers were doing, and then I'm able to at least use the ssh-agent and gpg-agent functionality... Currently, none of these packages build in master because python-trezor doesn't build anymore, but I've submitted a patch to update and fix python-trezor(#34326), and have local patches dependent on that to update python-trezor-agent, trezor-agent, ledger-agent and keepkey-agent that at least get it to build. live well, vagrant --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQRlgHNhO/zFx+LkXUXcUY/If5cWqgUCXFzcqgAKCRDcUY/If5cW qol8APoDPr4QepdOX2GPRqwkOdJ/xWFR/7V0RMbAGK5Z5neXkgEA6nTByGsNqHHx Kx7AelUtJibCLFhbov9Ixri41NQtxAU= =QKEz -----END PGP SIGNATURE----- --=-=-=-- From unknown Tue Jun 17 22:27:37 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34377: (ledger|trezor|keepkey)-agent execute shell code with python interpreter Resent-From: Vagrant Cascadian Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 08 Feb 2019 03:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34377 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 34377@debbugs.gnu.org Received: via spool by 34377-submit@debbugs.gnu.org id=B34377.154959649521765 (code B ref 34377); Fri, 08 Feb 2019 03:29:02 +0000 Received: (at 34377) by debbugs.gnu.org; 8 Feb 2019 03:28:15 +0000 Received: from localhost ([127.0.0.1]:38755 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1grwpr-0005ez-Ec for submit@debbugs.gnu.org; Thu, 07 Feb 2019 22:28:15 -0500 Received: from cascadia.aikidev.net ([173.255.214.101]:33332) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1grwpp-0005ej-CB for 34377@debbugs.gnu.org; Thu, 07 Feb 2019 22:28:14 -0500 Received: from localhost (unknown [IPv6:2600:3c01:e000:21:21:21:0:100e]) (Authenticated sender: vagrant@cascadia.debian.net) by cascadia.aikidev.net (Postfix) with ESMTPSA id 2EA991AAC0 for <34377@debbugs.gnu.org>; Thu, 7 Feb 2019 19:28:06 -0800 (PST) From: Vagrant Cascadian In-Reply-To: References: <87mun76p1y.fsf@ponder> Date: Thu, 07 Feb 2019 19:28:00 -0800 Message-ID: <87k1ib6jsv.fsf@ponder> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) 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 Quick fix/workaround is the following patch, simply overwriting the wrapped trezor_agent.py with the real thing. live well, vagrant commit ef39a4dc42dcd2daaa7a626c923f1115f8540091 Author: Vagrant Cascadian Date: Fri Feb 8 03:23:14 2019 +0000 trezor-agent: Overwrite trezor_agent.py wrapper with real thing. diff --git a/gnu/packages/finance.scm b/gnu/packages/finance.scm index 035f6f5965..88b365dfb7 100644 --- a/gnu/packages/finance.scm +++ b/gnu/packages/finance.scm @@ -805,6 +805,17 @@ Then set the environment variable GNUPGHOME to (sha256 (base32 "144657c7bn0a667dq5fv5r6j7iilxf3h9agj29v1m2qpq40g0az8")))) + (arguments + ;; Tests fail with "AttributeError: module 'attr' has no attribute 's'". + `(#:phases + (modify-phases %standard-phases + (add-after 'wrap 'fixup-agent-py + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out"))) + ;; overwrite the wrapper with the real thing. + (install-file "./trezor_agent.py" + (string-append out "/bin/")) + #t)))))) (build-system python-build-system) (inputs `(("python-trezor" ,python-trezor) --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQRlgHNhO/zFx+LkXUXcUY/If5cWqgUCXFz3QQAKCRDcUY/If5cW qv5fAQCUKe278zg/hb93RcoGCTd21fXhOu+3uCJQUq2gFpUXNgD9Fu3mGhdbZn/L WjVa9tq3m1Np65zr4uCFWcVhj0ObaAk= =OELS -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 26 09:37:39 2019 Received: (at control) by debbugs.gnu.org; 26 Feb 2019 14:37:40 +0000 Received: from localhost ([127.0.0.1]:52389 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gydrX-0003DL-KD for submit@debbugs.gnu.org; Tue, 26 Feb 2019 09:37:39 -0500 Received: from dd26836.kasserver.com ([85.13.145.193]:57390) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gydrW-0003DC-4b for control@debbugs.gnu.org; Tue, 26 Feb 2019 09:37:38 -0500 Received: from localhost (77.117.193.67.wireless.dyn.drei.com [77.117.193.67]) by dd26836.kasserver.com (Postfix) with ESMTPSA id C73D23360AAF for ; Tue, 26 Feb 2019 15:37:35 +0100 (CET) Date: Tue, 26 Feb 2019 15:37:31 +0100 From: Danny Milosavljevic To: Message-ID: <20190226153731.38996f79@scratchpost.org> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/V6mxv2JTaZfsb_/VlJ5E+ud"; protocol="application/pgp-signature" X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: close 34377 Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [85.13.145.193 listed in list.dnswl.org] 1.8 MISSING_SUBJECT Missing Subject: header 0.2 NO_SUBJECT Extra score for no subject 0.0 TVD_SPACE_RATIO No description available. 0.0 TVD_SPACE_RATIO_MINFP Space ratio X-Debbugs-Envelope-To: control 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: 0.3 (/) --Sig_/V6mxv2JTaZfsb_/VlJ5E+ud Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable close 34377 --Sig_/V6mxv2JTaZfsb_/VlJ5E+ud Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAlx1TysACgkQ5xo1VCww uqXrRQgAnPiVzmWL29Q2p8KPRBy2jmc13/9Yk7fwdW1zBqae3HGt9lrhRnBXbQwQ 4Zs9U4ay7y3GQPkCZKweJq/gUcXI7Nwj0VMzrVBHkCPHHpgSCm5Hi28RT98DCY0z LNT3HL/MfkeLPQdWZv1WIZToeYXqFpBGL7LKoS6fFcciAHRtXJe1v7effAx1QkNV KSm5bAIDcRgRaBKKmWr9+lCxz/zsRLjStX6K9tdJxeB5AdMlGfyK9gs+myDYG1a1 D7027KDg2SW+mFIV27QmnstEVRFdNPMPJmRfpmhwnZuYBf7wKZt+Pqx6Z3GQNSZ2 I2t3CCJuGS7FZk+3WP6ISqx2Aho/OA== =MbUq -----END PGP SIGNATURE----- --Sig_/V6mxv2JTaZfsb_/VlJ5E+ud--