[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Tramp 24.4: /usr/bin/id: cannot find name for group ID
From: |
Michael Albinus |
Subject: |
Re: Tramp 24.4: /usr/bin/id: cannot find name for group ID |
Date: |
Sat, 01 Nov 2014 17:53:07 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
Michael Albinus <address@hidden> writes:
> Better suited seems to be stat, which returns "UNKNOWN":
>
> # stat -c "%U %G" xxx
> UNKNOWN UNKNOWN
>
> So I will add this as alternative to `tramp-get-remote-uid' and
> `tramp-get-remote-gid'.
Well, I've committed the following patch to the repositories, which
should fix this:
--8<---------------cut here---------------start------------->8---
***
/home/albinus/src/tramp/lisp/tramp-sh.el.~3b182d0b508308d40d07b14fff22f48e44c70465~
2014-11-01 17:50:08.706595545 +0100
--- /home/albinus/src/tramp/lisp/tramp-sh.el 2014-11-01 17:24:57.668587920
+0100
***************
*** 5289,5305 ****
(defun tramp-get-remote-uid (vec id-format)
(with-tramp-connection-property vec (format "uid-%s" id-format)
! (let ((res (cond
! ((tramp-get-remote-id vec)
! (tramp-get-remote-uid-with-id vec id-format))
! ((tramp-get-remote-perl vec)
! (tramp-get-remote-uid-with-perl vec id-format))
! ((tramp-get-remote-python vec)
! (tramp-get-remote-uid-with-python vec id-format))
! (t (tramp-error
! vec 'file-error "Cannot determine remote uid")))))
! ;; The command might not always return a number.
! (if (and (equal id-format 'integer) (not (integerp res))) -1 res))))
(defun tramp-get-remote-gid-with-id (vec id-format)
(tramp-send-command-and-read
--- 5289,5308 ----
(defun tramp-get-remote-uid (vec id-format)
(with-tramp-connection-property vec (format "uid-%s" id-format)
! (let ((res
! (ignore-errors
! (cond
! ((tramp-get-remote-id vec)
! (tramp-get-remote-uid-with-id vec id-format))
! ((tramp-get-remote-perl vec)
! (tramp-get-remote-uid-with-perl vec id-format))
! ((tramp-get-remote-python vec)
! (tramp-get-remote-uid-with-python vec id-format))))))
! ;; Ensure there is a valid result.
! (cond
! ((and (equal id-format 'integer) (not (integerp res))) -1)
! ((and (equal id-format 'string) (not (stringp res))) "UNKNOWN")
! (t res)))))
(defun tramp-get-remote-gid-with-id (vec id-format)
(tramp-send-command-and-read
***************
*** 5330,5346 ****
(defun tramp-get-remote-gid (vec id-format)
(with-tramp-connection-property vec (format "gid-%s" id-format)
! (let ((res (cond
! ((tramp-get-remote-id vec)
! (tramp-get-remote-gid-with-id vec id-format))
! ((tramp-get-remote-perl vec)
! (tramp-get-remote-gid-with-perl vec id-format))
! ((tramp-get-remote-python vec)
! (tramp-get-remote-gid-with-python vec id-format))
! (t (tramp-error
! vec 'file-error "Cannot determine remote gid")))))
! ;; The command might not always return a number.
! (if (and (equal id-format 'integer) (not (integerp res))) -1 res))))
;; Some predefined connection properties.
(defun tramp-get-inline-compress (vec prop size)
--- 5333,5352 ----
(defun tramp-get-remote-gid (vec id-format)
(with-tramp-connection-property vec (format "gid-%s" id-format)
! (let ((res
! (ignore-errors
! (cond
! ((tramp-get-remote-id vec)
! (tramp-get-remote-gid-with-id vec id-format))
! ((tramp-get-remote-perl vec)
! (tramp-get-remote-gid-with-perl vec id-format))
! ((tramp-get-remote-python vec)
! (tramp-get-remote-gid-with-python vec id-format))))))
! ;; Ensure there is a valid result.
! (cond
! ((and (equal id-format 'integer) (not (integerp res))) -1)
! ((and (equal id-format 'string) (not (stringp res))) "UNKNOWN")
! (t res)))))
;; Some predefined connection properties.
(defun tramp-get-inline-compress (vec prop size)
--8<---------------cut here---------------end--------------->8---
Best regards, Michael.