From: Michael Albinus Date: Tue, 23 Oct 2007 21:56:54 +0000 (+0000) Subject: * net/tramp.el (tramp-set-file-uid-gid): Protect `call-process' X-Git-Tag: emacs-pretest-23.0.90~10105 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3bde9f241ccde37986401c5b40caa82a2ea43d06;p=emacs.git * net/tramp.el (tramp-set-file-uid-gid): Protect `call-process' when we are local. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5288be5ad8f..258a6361427 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-10-23 Michael Albinus + + * net/tramp.el (tramp-set-file-uid-gid): Protect `call-process' + when we are local. + 2007-10-23 Stefan Monnier * progmodes/python.el (python-current-defun): Remove left-over diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 881fa6ceb5a..b54641b311e 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -2575,11 +2575,14 @@ and gid of the corresponding user is taken. Both parameters must be integers." ;; We handle also the local part, because there doesn't exist ;; `set-file-uid-gid'. (let ((uid (or (and (integerp uid) uid) (tramp-get-local-uid 'integer))) - (gid (or (and (integerp gid) gid) (tramp-get-local-uid 'integer))) + (gid (or (and (integerp gid) gid) (tramp-get-local-gid 'integer))) (default-directory (tramp-compat-temporary-file-directory))) - (call-process - "chown" nil nil nil - (format "%d:%d" uid gid) (tramp-shell-quote-argument filename))))) + ;; "chown" might not exist, for example on Win32. + (condition-case nil + (call-process + "chown" nil nil nil + (format "%d:%d" uid gid) (tramp-shell-quote-argument filename)) + (error nil))))) ;; Simple functions using the `test' command.