tramp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Michael Albinus
Subject: Re: tramp-parse-passwd does not seem to work if getent is available?
Date: Mon, 22 Jan 2024 10:20:01 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Tim Landscheidt <tim@tim-landscheidt.de> 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]