Re: tramp-parse-passwd does not seem to work if getent is available?

Michael Albinus <[email protected]>
Newsgroups gmane.emacs.tramp
Message-ID <[email protected]>
Tim Landscheidt <[email protected]> writes:

> Hi,

Hi Tim,

Thanks for the report!

> Looking at the code:
>
> | (defun tramp-parse-passwd (filename)
> |   "Return a list of (user host) tuples allowed to access.
> | Host is always \"localhost\"."
> |   (with-tramp-connection-property nil "parse-passwd"
> |     (if (executable-find "getent")
> |         (with-temp-buffer
> |           (when (zerop (tramp-call-process nil "getent" nil t nil "passwd"))
> |             (goto-char (point-min))
> |             (cl-loop while (not (eobp)) collect
> |                      (tramp-parse-etc-group-group))))
> |       (tramp-parse-file filename #'tramp-parse-passwd-group))))
>
> it is not clear to me why the output of "getent passwd" and
> the contents of /etc/passwd are parsed differently.
> Shouldn't the output of "getent passwd" (and its other vari-
> ants) be of the same structure as /etc/passwd?

You are right, it is a nasty cut'n'waste error. Of course,
tramp-parse-passwd-group must be used in both cases.

I've fixed this in the repositories. Will be available on GNU ELPA as
Tramp 2.6.2.1 later this month.

> Tim

Best regards, Michael.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.