unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Kostadin Ninev <k.ninev@cdots.bg>
Cc: Bastien <bzg@gnu.org>,
	63578@debbugs.gnu.org, Ihor Radchenko <yantar92@posteo.net>,
	Eli Zaretskii <eliz@gnu.org>
Subject: bug#63578: 29.0.91; Org Cannot tangle with tramp using sudo
Date: Sat, 20 May 2023 18:50:46 +0200	[thread overview]
Message-ID: <87y1ljndzt.fsf@gmx.de> (raw)
In-Reply-To: <875y8noy8p.fsf@gmx.de> (Michael Albinus's message of "Sat, 20 May 2023 16:48:06 +0200")

[-- Attachment #1: Type: text/plain, Size: 534 bytes --]

Michael Albinus <michael.albinus@gmx.de> writes:

Hi Kostadin,

> Thanks, I can reproduce the problem now. Let's see what analysis yields.

The problem happens, when tramp-add-hops is called with a
tramp-file-name structure which has not expanded the default user and
host names yet, like in "/sudo::". The appended patch should fix it,
could you pls check in your environment?

Since the change is very basic to Tramp, I'll let run all regression
tests for Tramp. This will take 2-3 days. I'll let you know.

Best regards, Michael.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1005 bytes --]

diff --git a/lisp/tramp.el b/lisp/tramp.el
index b70fd95a..90e497a9 100644
--- a/lisp/tramp.el
+++ b/lisp/tramp.el
@@ -1692,8 +1692,9 @@ The structure consists of method, user, domain, host, port,
 localname (file name on remote host), and hop.

 Unless NODEFAULT is non-nil, method, user and host are expanded
-to their default values.  For the other file name parts, no
-default values are used."
+to their default values.  Hop is set to nil if NODEFAULT is non-nil.
+
+For the other file name parts, no default values are used."
   (save-match-data
     (unless (tramp-tramp-file-p name)
       (tramp-user-error nil "Not a Tramp file name: \"%s\"" name))
@@ -1719,7 +1720,8 @@ default values are used."
 	  (when (string-match tramp-postfix-ipv6-regexp host)
 	    (setq host (replace-match "" nil t host))))

-	(unless nodefault
+	(if nodefault
+	    (setq hop nil)
 	  (when hop
 	    (setq v (tramp-dissect-hop-name hop)
 		  hop (and hop (tramp-make-tramp-hop-name v))))

  reply	other threads:[~2023-05-20 16:50 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-18 19:21 bug#63578: 29.0.91; Org Cannot tangle with tramp using sudo k.ninev@cdots.bg via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-19  5:54 ` Eli Zaretskii
2023-05-19  6:32   ` Ihor Radchenko
2023-05-19  6:55     ` Kostadin Ninev
2023-05-19  7:17       ` Ihor Radchenko
2023-05-19  7:18         ` Kostadin Ninev
2023-05-19  7:28           ` Ihor Radchenko
2023-05-19  9:12             ` Kostadin Ninev
2023-05-19  9:43               ` Michael Albinus
2023-05-19  9:49                 ` Kostadin Ninev
2023-05-19 10:57                 ` Kostadin Ninev
2023-05-20  8:30                 ` Kostadin Ninev
2023-05-20 11:16                   ` Michael Albinus
2023-05-20 11:26                     ` Kostadin Ninev
2023-05-20 11:50                       ` Michael Albinus
2023-05-20 11:53                         ` Kostadin Ninev
2023-05-20 14:48                           ` Michael Albinus
2023-05-20 16:50                             ` Michael Albinus [this message]
2023-05-20 17:09                               ` Kostadin Ninev
2023-05-22 10:44                                 ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y1ljndzt.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=63578@debbugs.gnu.org \
    --cc=bzg@gnu.org \
    --cc=eliz@gnu.org \
    --cc=k.ninev@cdots.bg \
    --cc=yantar92@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).