[augeas-devel] passwd lens patch

David Lutterkort lutter at redhat.com
Tue Apr 13 23:32:51 UTC 2010


On Tue, 2010-04-13 at 09:55 -0400, Jimmy Dorff wrote:
> Hi Folks,
> 
> I've been learning to use augeas and I've come across one issue. When I 
> manipulate Unix passwords files, the lens has a problem when the 
> password file contains a MD5 style password common on newer unix 
> systems. An example of this type of password can be obtained from 
> "openssl passwd -1".
> 
> My "fix" for this was to change the "password" from a "word" to a 
> "sto_to_col?" in "lenses/passwd.aug":
> 
> 34c34
> <                 . [ label "password" . store word    . colon ]
> ---
>  >                 . [ label "password" . sto_to_col?   . colon ]
> 
> I don't know if this is the best solution, but it is working for me.

Looks good; I don't think there's any reason to try and split the value
further (glibc tells you the encryption algorithm, the salt and the
hash)

Out of curiosity: why did you make the value optional ? AFAIK, there
will always be some sort of entry.

David




More information about the augeas-devel mailing list