From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.devel Subject: Re: master 588a0363d9a: Improve SELinux handling in Tramp Date: Thu, 03 Aug 2023 15:08:28 +0200 Message-ID: <87zg38clyr.fsf@gmx.de> References: <169106143410.16457.9843450418997998201@vcs2.savannah.gnu.org> <20230803111715.B86F3C038BB@vcs2.savannah.gnu.org> <877cqcbb2i.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40860"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Aug 03 15:09:23 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qRY4x-000AUk-Fr for ged-emacs-devel@m.gmane-mx.org; Thu, 03 Aug 2023 15:09:23 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qRY4C-00045Q-BX; Thu, 03 Aug 2023 09:08:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRY4A-000451-JI for emacs-devel@gnu.org; Thu, 03 Aug 2023 09:08:34 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRY48-0002y3-R9 for emacs-devel@gnu.org; Thu, 03 Aug 2023 09:08:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691068109; x=1691672909; i=michael.albinus@gmx.de; bh=Z7aT4Bgs2pUH+RLlcbN9ulPVoJAQhVg3DtYJWSPQNG0=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=Tw3iM2jb1GJbdWuSkHFHS3tyJWiRZwgeXJYfDEb8Q6BNPAUqAniROTH+Atp3jokf6cOmFig jeVo+jTiiBT3pt9O6NIYtRoCm3PaMQnkSSZ9vaHlFeZ7uXAevywL0BvXUEgab9L2ombar5oiL 9N629kdkkflLiFboETqLei5U1ROyzB3A4Y9K6TbFwYCf//JJdIy+n8TvDycDaUg9Co0rA+NkW fGPPdrL0x6Q8xgnvRlRiP0CokpnmdFwoJcRlzsMjkT/gptgr7hRN8G5rWJKvF9LYhCn4SHjSM 6jzUxxUcTP/jgyY4nCxZrIOSPJYa254AHEUabX4fvB5sMJPf9NKw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from gandalf.gmx.de ([185.89.39.27]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1Mqs4Z-1q57Yi0taT-00mv9W; Thu, 03 Aug 2023 15:08:29 +0200 In-Reply-To: <877cqcbb2i.fsf@yahoo.com> (Po Lu's message of "Thu, 03 Aug 2023 19:49:09 +0800") X-Provags-ID: V03:K1:Iz+TrV7ZcYPJ4g/nX0NFwu6msPEsHIwEtooex6Tg/yH15uyQe4F H5yPRXYXRtL4Bb3GafQyTKe4E7kHPWwEJg2wWa43MYVulAOuek/UdDBWcYzlR/n6kQqT0+j AMDw6Dy4FiU0E1RIVo0PW5yRH0gabDJHH5AyF0t2Dbg2onaC5cZg9koEoKd6yeI8mMuL5uB PLMHSV7vwsgq1iLclV4Ew== UI-OutboundReport: notjunk:1;M01:P0:88dfX0pV7uk=;4dTS4DYkUq575FalXX7944ijiCj Qsdo9DILN0wrIPsruQBJZUfE4v2oCBSHp7lK18a/h8RHtf9DsKTrsvAxwNWp0vM01Ah1mXIlH OggDlLjW4oEkZLlIkrRcr5sbZqyy03cu5gScj+SX3kgTdhbmHUgPjJzDzQBreIDeoRXW9Lt+l 7dKELr24Fh++fk7bNSd0C3WMUVWG4wPnmcX/KNFl8vB9XWItjn8QUuAcLfdKCqMX3YR5TC6v0 hjpilz9Oma/mSvQIHu2EbrE7eVE+qh6oqBsvhoAKYDsyIcgXX/Y5iLrDQVDnsfzBnb/fQcuIL QKU5m6fA/r3NussTz1Kc6RDFU0VYmIcNZeLttaT0he/tN6/M3eZ+0Q6GjnYylMMFhN+IsenAO 4GYup8/UFZzYpjLGen0yft6V9xY9ITWCB1J8RCBObPmfmwzOmjNuDqvNs0LMvbV+lwNA6diUN rJLsyHRVHFUAB5vUbs4MiieasL0D/A56KXI8w0BW9AemB2YZX//J9so9pj01g226kAYB/1RCZ yShe6ZrK+o2u4q0I4/mtEx8iVmXe1Ybw727V4YLDc1sttsLJnp3QOK4v2KtaxabkvQOT9z1UT W2Cu0g5OlVzTJu+s/IOlZRVXiC+7/sZMLJ+bt5jrNX/AKPkV+Ilr0LeSBfk+NhH+pyjPMKd0Z jEYV8mD7TaA3utpHnXBZs4QJ9w9O7jO4ZNQXeJBF3cVfguKoaYt9FkYCc09Y32EwSMZU5td8l LJpu8swxRJ2NbBNK8JtJn2cUg/+p4TFEYo/YgvPqGrjaNnKBuxBmGrMcNh4YQ+ke1//Ojr/z Received-SPF: pass client-ip=212.227.15.15; envelope-from=michael.albinus@gmx.de; helo=mout.gmx.net 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:308256 Archived-At: Po Lu writes: Hi, > If my understanding is correct, then with this change Tramp starts to > return SELinux context information from file-attributes. No. There's no visible change outside Tramp, it still returns the SELinux context with file-selinux-context calls only. This patch is part of Tramp optimizations I'm working on the last days. One observation from the traces is, that file-selinux-context calls almost always happen shortly after file-attributes calls. So I've adapted Tramp's file-attributes implementations to use also the "-Z" option (for ls) or "%C" option (for stat) on the remote side. From the result, the SELinux context is extracted and cached inside Tramp. It is not returned with file-attributes. When the next file-selinux-context call happens, Tramp checks first the cache, before it sends the respective remote command. By this, often a network roundtrip can be avoided. > Doesn't this mean Dired and similar should be adjusted to refrain from > trying to restore SELinux attributes when performing a copy from a > remote directory, given that different machines can have completely > incompatible SELinux configurations? I don't believe so. Outside Tramp, nothing has changed. Best regards, Michael.