Mercurial > emacs
changeset 85600:f5efd5792003
* net/tramp.el (tramp-set-file-uid-gid): Protect `call-process'
when we are local.
author | Michael Albinus <michael.albinus@gmx.de> |
---|---|
date | Tue, 23 Oct 2007 21:56:54 +0000 |
parents | 106a0ce6ac7e |
children | 7b879ab0abb9 |
files | lisp/ChangeLog lisp/net/tramp.el |
diffstat | 2 files changed, 12 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/ChangeLog Tue Oct 23 21:54:24 2007 +0000 +++ b/lisp/ChangeLog Tue Oct 23 21:56:54 2007 +0000 @@ -1,3 +1,8 @@ +2007-10-23 Michael Albinus <michael.albinus@gmx.de> + + * net/tramp.el (tramp-set-file-uid-gid): Protect `call-process' + when we are local. + 2007-10-23 Stefan Monnier <monnier@iro.umontreal.ca> * progmodes/python.el (python-current-defun): Remove left-over
--- a/lisp/net/tramp.el Tue Oct 23 21:54:24 2007 +0000 +++ b/lisp/net/tramp.el Tue Oct 23 21:56:54 2007 +0000 @@ -2575,11 +2575,14 @@ ;; 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.