diff options
author | Michael Albinus <michael.albinus@gmx.de> | 2022-10-15 18:21:13 +0200 |
---|---|---|
committer | Michael Albinus <michael.albinus@gmx.de> | 2022-10-15 18:21:13 +0200 |
commit | 215f65d1dcb70f29fa4919f5581d28ad27ba4db2 (patch) | |
tree | 8df6028994f8c7c042e9c8b2f029f4aebde5b4e3 /lisp/net/tramp-sh.el | |
parent | 5933055a3e7387b0095f0df7876a208ab15f4f45 (diff) | |
download | emacs-215f65d1dcb70f29fa4919f5581d28ad27ba4db2.tar.gz emacs-215f65d1dcb70f29fa4919f5581d28ad27ba4db2.tar.bz2 emacs-215f65d1dcb70f29fa4919f5581d28ad27ba4db2.zip |
Minor Tramp fixes
* lisp/net/tramp-sh.el (tramp-perl-id): Fix Perl script.
(tramp-sh-handle-expand-file-name):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-expand-file-name):
Check, that there's really a Tramp file name.
Diffstat (limited to 'lisp/net/tramp-sh.el')
-rw-r--r-- | lisp/net/tramp-sh.el | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 3240f5352a7..d74afc84126 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -789,8 +789,8 @@ use strict; use warnings; use POSIX qw(getgroups); -my ($user, $passwd, $uid, $gid) = getpwuid $< ; -my $group = getgrgid $gid ; +my ( $uid, $user ) = ( $>, scalar getpwuid $> ); +my ( $gid, $group ) = ( $), scalar getgrgid $) ); my @groups = map { $_ . \"(\" . getgrgid ($_) . \")\" } getgroups (); printf \"uid=%%d(%%s) gid=%%d(%%s) groups=%%s\\n\", @@ -2827,11 +2827,14 @@ the result will be a local, non-Tramp, file name." ;; Handle empty NAME. (when (zerop (length name)) (setq name ".")) ;; On MS Windows, some special file names are not returned properly - ;; by `file-name-absolute-p'. - (if (and (eq system-type 'windows-nt) - (string-match-p - (tramp-compat-rx bol (| (: alpha ":") (: (literal null-device) eol))) - name)) + ;; by `file-name-absolute-p'. If `tramp-syntax' is `simplified', + ;; there could be the falso positive "/:". + (if (or (and (eq system-type 'windows-nt) + (string-match-p + (tramp-compat-rx bol (| (: alpha ":") (: (literal null-device) eol))) + name)) + (and (not (tramp-tramp-file-p name)) + (not (tramp-tramp-file-p dir)))) (tramp-run-real-handler #'expand-file-name (list name dir)) ;; Unless NAME is absolute, concat DIR and NAME. (unless (file-name-absolute-p name) |