1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-26 10:49:33 +00:00

* net/tramp.el (tramp-set-file-uid-gid): Protect `call-process'

when we are local.
This commit is contained in:
Michael Albinus 2007-10-23 21:56:54 +00:00
parent 03b5badef8
commit 3bde9f241c
2 changed files with 12 additions and 4 deletions

View File

@ -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

View File

@ -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.