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.bugs Subject: bug#58132: 29.0.50; Tramp: not preserving remote chmod attributes when copy Date: Mon, 31 Oct 2022 09:32:44 +0100 Message-ID: <87leowjsur.fsf@gmx.de> References: <86sfkcxjrc.fsf@protected.rcdrun.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31303"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 58132@debbugs.gnu.org To: Jean Louis Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 31 09:34:20 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1opQFP-0007yM-HL for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 31 Oct 2022 09:34:19 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opQFD-0007Gl-Aa; Mon, 31 Oct 2022 04:34:07 -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 1opQFA-0007FJ-3F for bug-gnu-emacs@gnu.org; Mon, 31 Oct 2022 04:34:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1opQF8-0007wT-UX for bug-gnu-emacs@gnu.org; Mon, 31 Oct 2022 04:34:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1opQF8-0000Hk-En for bug-gnu-emacs@gnu.org; Mon, 31 Oct 2022 04:34:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 31 Oct 2022 08:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58132 X-GNU-PR-Package: emacs Original-Received: via spool by 58132-submit@debbugs.gnu.org id=B58132.16672052131058 (code B ref 58132); Mon, 31 Oct 2022 08:34:02 +0000 Original-Received: (at 58132) by debbugs.gnu.org; 31 Oct 2022 08:33:33 +0000 Original-Received: from localhost ([127.0.0.1]:39453 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1opQEe-0000Gz-C7 for submit@debbugs.gnu.org; Mon, 31 Oct 2022 04:33:32 -0400 Original-Received: from mout.gmx.net ([212.227.15.18]:47531) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1opQEU-0000GJ-KT for 58132@debbugs.gnu.org; Mon, 31 Oct 2022 04:33:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1667205166; bh=57AZbHNMqMs93+38QA8XEk8uv22HLRUBAkOcwg0E5Nk=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=lpONhTvlOF2B13mE1WoG3V+KggPt/kTUnWNMFToPplZm6EyDR7JE5VRevLv8U9BSg ZaGre69cq9F+DKgC2BufdemFaEr63ZbypGgVxnSNL6XCuesZsBtFybGyZ4q6e322f8 qGRaPDjAaSro3VhDUMeqLQlB3IjoytQRBDxx6yilKxJoer4nLFNPd+9YIsd/RIzdL3 IIuGGuUTjFWi3nkjCVot8dyIQvnopI4Sq8zI83dgcuEH/xfrC4kYyjq8VbBqgxsKKq C8+jNQG/mJlC8ZvlUY3uBY7TBaR5PBBnDx+wozk5o5CyJuO666b3ktaDPHLIHD0P9B Z0GL+Ut798glw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from gandalf.gmx.de ([213.220.151.1]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1M7sDg-1okUXv3nxS-0055Oz; Mon, 31 Oct 2022 09:32:46 +0100 In-Reply-To: <86sfkcxjrc.fsf@protected.rcdrun.com> (Jean Louis's message of "Wed, 28 Sep 2022 06:25:43 +0300") X-Provags-ID: V03:K1:hX/mEGo6uYQoLMEl5sOmEHz2MD4w5bHy8yy7iciD3t9XS6qGVJ8 4hXOX3GMOvBctr+neBYfWSN6YojJNroIrqPtsp0g1gX4IGSJgBkl9G/hjhmUaOFoM/iphp1 StY2Rwdf/35aSPQzNmF559YbkA0Y7nZi5IcamxmKB1UxGY+B40zddpvGxaLJckMv6MncQOq 7YnzVJBihxSDHj84zHitw== UI-OutboundReport: notjunk:1;M01:P0:29ohObLnBFQ=;uKeCbL16HH9v1d6MuOA9aTnEPcE TEn78aQHvU92nSPadvLa4+CXXA/w21wwHsQIgZ68pnAJkEWlmOF+ec6eYSYjsXHwstFfP9Kys Zjm5vd6X0FtyMQ/0Jg0Bll7BKT6f/ixhImX8nWA9dLuYjREmoYagqdPNHV/e8jws5lzXlFehm KqHwDjdAWU7kx56f3LqfIJQp8GBSmBKDrGwHiUo6Ye12r6fchP6qE7OGwIIWlXm+iJxh0kS+Z ckFk7xYMEz78/6/Eb3S/ZgPbPcoUhg6PGIQwU34S5ELaAM90l9FK8whaL0Za71XRlAqAp9jJg y1R4xFmxlNHWBys57AczYwug6I6xJYfMCyuFuqhZfJuE3dDte9MyqIgS+Y/JhbZU/ryU4DyRu sO93SRwI+d1vPOoj7/d4er/jjpuSeB7GiBn7S4McS1jHeewF6RCGh3tpaHkxPdpMmTXkkTVBu 4sqOTWwWQCxxBN+T84Dw6+Dgp2zmP/8/44tnCrOT6w4tfjKFzdoR+/SKinUkqCEvSG60qJiP2 HYkuuwPqSzAmjjvtmrAaeUEpcDhFsQOcfyWE2UQJp6xn6rK7FWkxziGUtCWMrSMfzqgkLxFka Yx3mfP8R/jzQSjjTJBaNVZCwttApwDgDiR2cANjc26PlejRQCTM+BfeSSgMXjAM7gBtHfPDgy LrI71ML4GQs3w6Ei+oLHsC1Ilgum34AG1CD8rNTm/dvKDU6SoYjELHuEt31zgUwB3qP7xMdH2 LNIy2URFyKzK/8mgKrQG+qFNW+TaOmDZdEasqy/dpXtDQ6IJwdTMTl1gXetBnSTYyIXfGrS9 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: "bug-gnu-emacs" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:246669 Archived-At: Jean Louis writes: Hi Jean, > Normal behavior with local `copy' command is to preserve attributes of > the destination file, if such file exists. > > Normal behavior of ssh/scp is to preserve file attributes of destination > file if such file exists: > > $ ssh stw1 ls -l /home/admin/diff.sql > -rwxr-xr-x 1 admin admin 6240 Sep 27 20:22 /home/admin/diff.sql > ~ > $ ls -l diff.sql > -rw-r--r-- 1 admin admin 6240 Jun 20 2021 diff.sql > ~ > $ scp diff.sql stw1:~/ > diff.sql 100% 62= 40 20.6KB/s 00:00=20=20=20=20 > ~ > $ ssh stw1 ls -l /home/admin/diff.sql > -rwxr-xr-x 1 admin admin 6240 Sep 27 20:23 /home/admin/diff.sql > ~ > > I have noticed that Tramp transfers file attributes from local file to > remote file. This causes server errors, as it is out of the habit that > file attributes on existing file are to be preserved. Tramp does what it is instructed. Copying a file is triggered by the `copy-file' function. If the argument PRESERVE-PERMISSIONS is non-nil, Tramp tries to preserve the permissions. See the docstring of `copy-file': --8<---------------cut here---------------start------------->8--- copy-file is an interactive built-in function in =E2=80=98src/fileio.c=E2= =80=99. (copy-file FILE NEWNAME &optional OK-IF-ALREADY-EXISTS KEEP-TIME PRESERVE-UID-GID PRESERVE-PERMISSIONS) Copy FILE to NEWNAME. Both args must be strings. If NEWNAME is a directory name, copy FILE to a like-named file under NEWNAME. For NEWNAME to be recognized as a directory name, it should end in a slash. This function always sets the file modes of the output file to match the input file. The optional third argument OK-IF-ALREADY-EXISTS specifies what to do if file NEWNAME already exists. If OK-IF-ALREADY-EXISTS is nil, signal a =E2=80=98file-already-exists=E2=80=99 error without overwriting. = If OK-IF-ALREADY-EXISTS is an integer, request confirmation from the user about overwriting; this is what happens in interactive use with M-x. Any other value for OK-IF-ALREADY-EXISTS means to overwrite the existing file. Fourth arg KEEP-TIME non-nil means give the output file the same last-modified time as the old one. (This works on only some systems.) A prefix arg makes KEEP-TIME non-nil. If PRESERVE-UID-GID is non-nil, try to transfer the uid and gid of FILE to NEWNAME. If PRESERVE-PERMISSIONS is non-nil, copy permissions of FILE to NEWNAME; this includes the file modes, along with ACL entries and SELinux context if present. Otherwise, if NEWNAME is created its file permission bits are those of FILE, masked by the default file permissions. --8<---------------cut here---------------end--------------->8--- So it isn't an error per se. Best regards, Michael.