[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r108909: * net/tramp.el (tramp-restri
From: |
Michael Albinus |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r108909: * net/tramp.el (tramp-restricted-shell-hosts-alist): New defcustom. |
Date: |
Fri, 06 Jul 2012 15:16:13 +0200 |
User-agent: |
Bazaar (2.5.0) |
------------------------------------------------------------
revno: 108909
committer: Michael Albinus <address@hidden>
branch nick: trunk
timestamp: Fri 2012-07-06 15:16:13 +0200
message:
* net/tramp.el (tramp-restricted-shell-hosts-alist): New defcustom.
* net/tramp-sh.el (tramp-maybe-open-connection): Handle it.
modified:
lisp/ChangeLog
lisp/net/tramp-sh.el
lisp/net/tramp.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2012-07-06 07:08:10 +0000
+++ b/lisp/ChangeLog 2012-07-06 13:16:13 +0000
@@ -1,3 +1,9 @@
+2012-07-06 Michael Albinus <address@hidden>
+
+ * net/tramp.el (tramp-restricted-shell-hosts-alist): New defcustom.
+
+ * net/tramp-sh.el (tramp-maybe-open-connection): Handle it.
+
2012-07-06 Glenn Morris <address@hidden>
* Makefile.in (compile-one-process): Rename from "recompile".
=== modified file 'lisp/net/tramp-sh.el'
--- a/lisp/net/tramp-sh.el 2012-07-05 06:57:57 +0000
+++ b/lisp/net/tramp-sh.el 2012-07-06 13:16:13 +0000
@@ -4340,7 +4340,8 @@
(set-process-sentinel p 'tramp-process-sentinel)
(tramp-compat-set-process-query-on-exit-flag p nil)
(setq tramp-current-connection
- (cons (butlast (append vec nil)) (current-time)))
+ (cons (butlast (append vec nil)) (current-time))
+ tramp-current-host (system-name))
(tramp-message
vec 6 "%s" (mapconcat 'identity (process-command p) " "))
@@ -4387,7 +4388,7 @@
(expand-file-name
tramp-temp-name-prefix
(tramp-compat-temporary-file-directory)))))
- spec)
+ spec r-shell)
;; Add arguments for asynchronous processes.
(when (and process-name async-args)
@@ -4403,6 +4404,11 @@
(setq l-port (match-string 2 l-host)
l-host (match-string 1 l-host)))
+ ;; Check, whether there is a restricted shell.
+ (dolist (elt tramp-restricted-shell-hosts-alist)
+ (when (string-match elt tramp-current-host)
+ (setq r-shell t)))
+
;; Set variables for computing the prompt for
;; reading password. They can also be derived
;; from a gateway.
@@ -4421,7 +4427,7 @@
(concat
;; We do not want to see the trailing local
;; prompt in `start-file-process'.
- (unless (memq system-type '(windows-nt)) "exec ")
+ (unless r-shell "exec ")
command " "
(mapconcat
(lambda (x)
@@ -4430,9 +4436,10 @@
login-args " ")
;; Local shell could be a Windows COMSPEC. It
;; doesn't know the ";" syntax, but we must exit
- ;; always for `start-file-process'. "exec" does
- ;; not work either.
- (if (memq system-type '(windows-nt)) " && exit || exit")))
+ ;; always for `start-file-process'. It could
+ ;; also be a restricted shell, which does not
+ ;; allow "exec".
+ (when r-shell " && exit || exit")))
;; Send the command.
(tramp-message vec 3 "Sending command `%s'" command)
=== modified file 'lisp/net/tramp.el'
--- a/lisp/net/tramp.el 2012-07-05 06:57:57 +0000
+++ b/lisp/net/tramp.el 2012-07-06 13:16:13 +0000
@@ -405,6 +405,18 @@
:group 'tramp
:type 'boolean)
+(defcustom tramp-restricted-shell-hosts-alist
+ (when (memq system-type '(windows-nt))
+ (list (concat "\\`" (regexp-quote (system-name)) "\\'")))
+ "List of hosts, which run a restricted shell.
+This is a list of regular expressions, which denote hosts running
+a registered shell like \"rbash\". Those hosts can be used as
+proxies only, see `tramp-default-proxies-alist'. If the local
+host runs a registered shell, it shall be added to this list, too."
+ :version "24.2"
+ :group 'tramp
+ :type '(repeat (regexp :tag "Host regexp")))
+
;;;###tramp-autoload
(defconst tramp-local-host-regexp
(concat
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r108909: * net/tramp.el (tramp-restricted-shell-hosts-alist): New defcustom.,
Michael Albinus <=