From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 21 03:03:34 2021 Received: (at submit) by debbugs.gnu.org; 21 Nov 2021 08:03:34 +0000 Received: from localhost ([127.0.0.1]:44064 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mohp0-0002lv-9K for submit@debbugs.gnu.org; Sun, 21 Nov 2021 03:03:34 -0500 Received: from lists.gnu.org ([209.51.188.17]:58600) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mohoy-0002ln-MT for submit@debbugs.gnu.org; Sun, 21 Nov 2021 03:03:32 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59166) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mohoy-0000A7-IT for bug-guix@gnu.org; Sun, 21 Nov 2021 03:03:32 -0500 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:45577) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mohow-0000w2-8V for bug-guix@gnu.org; Sun, 21 Nov 2021 03:03:32 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 905A35C00CB for ; Sun, 21 Nov 2021 03:03:27 -0500 (EST) Received: from imap44 ([10.202.2.94]) by compute4.internal (MEProxy); Sun, 21 Nov 2021 03:03:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pantherx.org; h= mime-version:message-id:date:from:to:subject:content-type; s= fm1; bh=RsJVCmKACiD9vePqZo3truO3tRgGJW9cYGt8jlK2cik=; b=fT1rU3Xj IN9/RFtyVgV8Y63cTZmN5fwfU4izCwVAwE7Brsrj81CC5Kl4BpsqZlmI+aW9maOd DBsn0WmP6VEvSk+YgUHakiTIYj00eTmYCtKUaIW5c/UGo+jE57VUFXaLjmnVd5Uz KHpbiZ+C0zBe1bFXvyLh8wXLp83xM/whQvQIjClewezO6eRT04b1gn0xnWGQ8mKJ Cl/pMAR+F7+xPYnQ9FldFMjj/jrsLSUA4K4UI05izvMyvwHDNq/C9lSPqIrfdtwL qqc8ByRC3wtxqpI2Xeqp3BniOjIIfYSmXuoyPJzCDHZwpYFuz+Xkf6e+xXDFh7PS OxPR7Cp0OMLXig== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=RsJVCmKACiD9vePqZo3truO3tRgGJ W9cYGt8jlK2cik=; b=jYaWVs2MM5Zo8tN9IrIKqoms55O8FJpCCvVRHUdUHnBOj QUVazKPoiOP10y3DBaCAZcTL3ARCtK1fCqKgFlSmrKgOyNdfpZ1BoQz0e1qgyOyo z3TpkI9OKugpf7rse5mKW2nIaV0yh2VaDdwVTGDw56t/X5dMYPWy9NVbdOlldxmk JkkZZiJuwTSu3YjclcHd68IIuLBONdCoZU4YXCnI2JuiYPDGwMcx6P9Wsl6fbShW nXSklRovbr6ynpF0DywXDfyXHKCk8A/cbQIDAwUmbVbgyCGz4U+6KrL6GEuPs60y ReABCfCDYdal7kLJLBpz4IaU4N5zBiukOQ3QvO0bA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrgedugdduudefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfffhffvufgtsehttdertd erredtnecuhfhrohhmpedfjfgrmhiivghhucfprghsrghjphhouhhrfdcuoehhrdhnrghs rghjphhouhhrsehprghnthhhvghrgidrohhrgheqnecuggftrfgrthhtvghrnhepgeehtd efiefgtdekvdfghedvgeelheekvdfhgffhjeeuleeltdevleefhfelveffnecuffhomhgr ihhnpehgihhthhhusgdrtghomhdpphgrshhsfihorhgurdhruhhnnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhephhdrnhgrshgrjhhpohhurhes phgrnhhthhgvrhigrdhorhhg X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 4E298FA0AA6; Sun, 21 Nov 2021 03:03:27 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-1371-g2296cc3491-fm-20211109.003-g2296cc34 Mime-Version: 1.0 Message-Id: <46b16bf3-e41c-4ccf-9817-879df6eeb8cb@www.fastmail.com> Date: Sun, 21 Nov 2021 11:33:05 +0330 From: "Hamzeh Nasajpour" To: bug-guix@gnu.org Subject: pkexec: PATH environment variable Content-Type: text/plain Received-SPF: pass client-ip=66.111.4.26; envelope-from=h.nasajpour@pantherx.org; helo=out2-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.6 (-) 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: -2.6 (--) The `PATH` environment variable is hard-code here: https://github.com/freedesktop/polkit/blob/master/src/programs/pkexec.c#L882-L886 We don't have any executable in these paths in guix: ``` /usr/sbin:/usr/bin:/sbin:/bin:/root/bin ``` Replicate the issue: 1. Run the `pkexec` 2. Enter your password 3. run `echo $PATH` in the opened terminal 4. You will see this path: `/usr/sbin:/usr/bin:/sbin:/bin:/root/bin` 5. You can't run most of the commands. (`ls`, `passwd`, `chpasswd` and so on.) Expected Behavior: Running all of the commands without any error. Isn't it? Should not we patch the `PATH` environment variable in `pkexec` source codes? Either way, some applications like `lxqt-admin-user` and `lxqt-admin-time` has an issue and they can't run the commands via `pkexec`. I get this error when I want to change user password via `lxqt-admin-user`. It's using `pkexec` to change password. ``` /run/current-system/profile/bin/lxqt-admin-user-helper: line 7: exec: passwd: not found ``` -- Hamzeh Nasajpour PantherX Team