Skip to content

Commit dc30834

Browse files
committed
Adapt tramp-use-file-attributes
* doc/misc/tramp.texi: Fix indentation. (Bug Reports): Mention Gmane group gmane.emacs.tramp. (Frequently Asked Questions): Precise tramp-use-file-attributes entry. * lisp/net/tramp-sh.el (tramp-open-connection-setup-interactive-shell): Dump os-release when `tramp-verbose' is at least 9. * lisp/net/tramp.el (tramp-use-file-attributes): Adapt docstring. Use connection-local value.
1 parent fb04a51 commit dc30834

File tree

3 files changed

+76
-46
lines changed

3 files changed

+76
-46
lines changed

doc/misc/tramp.texi

Lines changed: 63 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2420,24 +2420,26 @@ You could define your own search directories like this:
24202420

24212421
@lisp
24222422
@group
2423-
(connection-local-set-profile-variables 'remote-path-with-bin
2424-
'((tramp-remote-path . ("~/bin" tramp-default-remote-path))))
2423+
(connection-local-set-profile-variables
2424+
'remote-path-with-bin
2425+
'((tramp-remote-path . ("~/bin" tramp-default-remote-path))))
24252426
@end group
24262427
24272428
@group
2428-
(connection-local-set-profile-variables 'remote-path-with-apply-pub-bin
2429-
'((tramp-remote-path . ("/appli/pub/bin" tramp-default-remote-path))))
2429+
(connection-local-set-profile-variables
2430+
'remote-path-with-apply-pub-bin
2431+
'((tramp-remote-path . ("/appli/pub/bin" tramp-default-remote-path))))
24302432
@end group
24312433
24322434
@group
24332435
(connection-local-set-profiles
2434-
'(:application tramp :machine "randomhost") 'remote-path-with-bin)
2436+
'(:application tramp :machine "randomhost") 'remote-path-with-bin)
24352437
@end group
24362438
24372439
@group
24382440
(connection-local-set-profiles
2439-
'(:application tramp :user "anotheruser" :machine "anotherhost")
2440-
'remote-path-with-apply-pub-bin)
2441+
'(:application tramp :user "anotheruser" :machine "anotherhost")
2442+
'remote-path-with-apply-pub-bin)
24412443
@end group
24422444
@end lisp
24432445

@@ -2554,18 +2556,18 @@ example below:
25542556
@group
25552557
(customize-set-variable
25562558
'tramp-password-prompt-regexp
2557-
(concat
2558-
"^.*"
2559-
(regexp-opt
2560-
'("passphrase" "Passphrase"
2561-
;; English
2562-
"password" "Password"
2563-
;; Deutsch
2564-
"passwort" "Passwort"
2565-
;; Français
2566-
"mot de passe" "Mot de passe")
2567-
t)
2568-
".*:\0? *"))
2559+
(concat
2560+
"^.*"
2561+
(regexp-opt
2562+
'("passphrase" "Passphrase"
2563+
;; English
2564+
"password" "Password"
2565+
;; Deutsch
2566+
"passwort" "Passwort"
2567+
;; Français
2568+
"mot de passe" "Mot de passe")
2569+
t)
2570+
".*:\0? *"))
25692571
@end group
25702572
@end lisp
25712573

@@ -2872,8 +2874,8 @@ allows you to set the @option{ControlPath} provided the variable
28722874
(customize-set-variable
28732875
'tramp-ssh-controlmaster-options
28742876
(concat
2875-
"-o ControlPath=/tmp/ssh-ControlPath-%%r@@%%h:%%p "
2876-
"-o ControlMaster=auto -o ControlPersist=yes"))
2877+
"-o ControlPath=/tmp/ssh-ControlPath-%%r@@%%h:%%p "
2878+
"-o ControlMaster=auto -o ControlPersist=yes"))
28772879
@end group
28782880
@end lisp
28792881

@@ -4155,29 +4157,29 @@ of @code{explicit-shell-file-name} for different remote hosts.
41554157
@lisp
41564158
@group
41574159
(connection-local-set-profile-variables
4158-
'remote-bash
4159-
'((explicit-shell-file-name . "/bin/bash")
4160-
(explicit-bash-args . ("-i"))))
4160+
'remote-bash
4161+
'((explicit-shell-file-name . "/bin/bash")
4162+
(explicit-bash-args . ("-i"))))
41614163
@end group
41624164
41634165
@group
41644166
(connection-local-set-profile-variables
4165-
'remote-ksh
4166-
'((explicit-shell-file-name . "/bin/ksh")
4167-
(explicit-ksh-args . ("-i"))))
4167+
'remote-ksh
4168+
'((explicit-shell-file-name . "/bin/ksh")
4169+
(explicit-ksh-args . ("-i"))))
41684170
@end group
41694171
41704172
@group
41714173
(connection-local-set-profiles
4172-
'(:application tramp :protocol "ssh" :machine "localhost")
4173-
'remote-bash)
4174+
'(:application tramp :protocol "ssh" :machine "localhost")
4175+
'remote-bash)
41744176
@end group
41754177
41764178
@group
41774179
(connection-local-set-profiles
4178-
`(:application tramp :protocol "sudo"
4179-
:user "root" :machine ,(system-name))
4180-
'remote-ksh)
4180+
`(:application tramp :protocol "sudo"
4181+
:user "root" :machine ,(system-name))
4182+
'remote-ksh)
41814183
@end group
41824184
@end lisp
41834185

@@ -4536,8 +4538,8 @@ which must be set to a non-@code{nil} value. Example:
45364538
@lisp
45374539
@group
45384540
(connection-local-set-profile-variables
4539-
'remote-direct-async-process
4540-
'((tramp-direct-async-process . t)))
4541+
'remote-direct-async-process
4542+
'((tramp-direct-async-process . t)))
45414543
@end group
45424544
45434545
@group
@@ -5047,6 +5049,9 @@ To subscribe to the mailing list, visit:
50475049
@uref{https://lists.gnu.org/mailman/listinfo/tramp-devel/, the
50485050
@value{tramp} Mail Subscription Page}.
50495051

5052+
There is also a @acronym{Gmane} group, mirroring the mailing list.
5053+
Its name is @samp{gmane.emacs.tramp}.
5054+
50505055
@ifset installchapter
50515056
Before sending a bug report, run the test suite first @ref{Testing}.
50525057
@end ifset
@@ -5222,8 +5227,8 @@ connections, apply the following code.
52225227
@lisp
52235228
@group
52245229
(connection-local-set-profile-variables
5225-
'my-auto-save-profile
5226-
'((buffer-auto-save-file-name . nil)))
5230+
'my-auto-save-profile
5231+
'((buffer-auto-save-file-name . nil)))
52275232
@end group
52285233
52295234
@group
@@ -5519,8 +5524,8 @@ Since @w{Emacs 30}, these options can be set connection-local.
55195524
@lisp
55205525
@group
55215526
(connection-local-set-profile-variables
5522-
'my-dired-profile
5523-
'((dired-listing-switches . "-ahl")))
5527+
'my-dired-profile
5528+
'((dired-listing-switches . "-ahl")))
55245529
@end group
55255530
55265531
@group
@@ -5552,10 +5557,26 @@ readable
55525557

55535558
@vindex tramp-use-file-attributes
55545559
Internally, @value{tramp} uses commands like @command{ls} or
5555-
@command{stat} in order to determine file permissions. On some file
5556-
systems, like @acronym{GPFS}, they don't report proper information.
5557-
Set the user option @code{tramp-use-file-attributes} to @code{nil} in
5558-
such a case.
5560+
@command{stat} in order to determine file permissions. When
5561+
@acronym{NFS4_ACL} is enabled on the remote host, more fine-grained
5562+
information is used which cannot be reflected by the permission string
5563+
returned from those commands. Set the user option
5564+
@code{tramp-use-file-attributes} to @code{nil} in such a case. This
5565+
can also be set host-wise, like in:
5566+
5567+
@lisp
5568+
@group
5569+
(connection-local-set-profile-variables
5570+
'my-file-attributes-profile
5571+
'((tramp-use-file-attributes . nil)))
5572+
@end group
5573+
5574+
@group
5575+
(connection-local-set-profiles
5576+
'(:application tramp :machine "remotehost")
5577+
'my-file-attributes-profile)
5578+
@end group
5579+
@end lisp
55595580

55605581

55615582
@item

lisp/net/tramp-sh.el

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4455,6 +4455,12 @@ process to set up. VEC specifies the connection."
44554455
(tramp-cleanup-connection vec t t)
44564456
(throw 'uname-changed (tramp-maybe-open-connection vec)))
44574457

4458+
;; Dump /etc/os-release in the traces.
4459+
(when (>= tramp-verbose 9)
4460+
(tramp-send-command
4461+
vec (format "cat /etc/os-release 2>%s" (tramp-get-remote-null-device vec))
4462+
t))
4463+
44584464
;; Try to set up the coding system correctly.
44594465
;; CCC this can't be the right way to do it. Hm.
44604466
(tramp-message vec 5 "Determining coding system")

lisp/net/tramp.el

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3446,15 +3446,18 @@ BODY is the backend specific code."
34463446

34473447
(defcustom tramp-use-file-attributes t
34483448
"Whether to use \"file-attributes\" file property for check.
3449-
This is relevant for `file-directory-p', `file-executable-p',
3450-
`file-exists-p', and `file-readable-p'. On some file systems, like
3451-
GPFS, the permission string is not trustworthy."
3449+
This is relevant for read, write, and execute permissions. On some file
3450+
systems using NFS4_ACL, the permission string as returned from `stat' or
3451+
`ls', is not sufficient to provide more fine-grained information.
3452+
This variable is intended as connection-local variable."
34523453
:version "30.1"
34533454
:type 'boolean)
34543455

34553456
(defsubst tramp-use-file-attributes (vec)
34563457
"Whether to use \"file-attributes\" file property for check."
3457-
(and tramp-use-file-attributes
3458+
(and ;; We assume, that connection-local variables are set in this buffer.
3459+
(with-current-buffer (tramp-get-connection-buffer vec)
3460+
tramp-use-file-attributes)
34583461
(tramp-file-property-p
34593462
vec (tramp-file-name-localname vec) "file-attributes")))
34603463

0 commit comments

Comments
 (0)