From: Platon Pronko <platon7pronko@gmail.com>
Date: Fri, 24 Jun 2022 15:18:19 +0000 (+0200)
Subject: Fix logic error in Tramp, setting file ownership
X-Git-Tag: emacs-29.0.90~1447^2~1488
X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=de0b7af169345442852622bb337483398c583a9e;p=emacs.git

Fix logic error in Tramp, setting file ownership

* lisp/net/tramp.el (tramp-skeleton-write-region): Fix logic in
changing file ownership.  (Bug#56180)

Copyright-paperwork-exempt: yes
---

diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 59a2710e00d..c6665c27924 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -3462,8 +3462,8 @@ BODY is the backend specific code."
 		  ;; `file-precious-flag' is set.
 		  (or (file-attribute-modification-time file-attr)
 		      (current-time)))
-		 (unless (and (= (file-attribute-user-id file-attr) uid)
-			      (= (file-attribute-group-id file-attr) gid))
+		 (when (and (= (file-attribute-user-id file-attr) uid)
+			    (= (file-attribute-group-id file-attr) gid))
 		   (setq need-chown nil))))
 
 	     ;; Set the ownership.