[elbe-devel] [PATCH v2 7/8] preprocess: migrate login action

Bastian Germann bage at linutronix.de
Fri Jun 24 12:12:38 CEST 2022


Am 16.06.22 um 12:10 schrieb Holger Dengler:
> Support legacy XMLs with a login action by moving the plain-text root
> password to the login node.
> 
> XMLs with only hashed passwords will not be changed by the
> preprocessing.
> 
> Signed-off-by: Holger Dengler <holger at hdengler.de>

Reviewed-by: Bastian Germann <bage at linutronix.de>

> ---
>   elbepack/xmlpreprocess.py | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/elbepack/xmlpreprocess.py b/elbepack/xmlpreprocess.py
> index 947b3cfce..e00faedb1 100644
> --- a/elbepack/xmlpreprocess.py
> +++ b/elbepack/xmlpreprocess.py
> @@ -259,6 +259,10 @@ def preprocess_passwd(xml):
>   
>       # migrate root password
>       for passwd in xml.iterfind(".//target/passwd"):
> +        # legacy support: move plain-text password to login action
> +        if xml.find(".//action/login") is not None:
> +            xml.find(".//action/login").text = passwd.text
> +
>           passwd_hashed = '%s' % crypt(passwd.text, METHOD_SHA512)
>           passwd.tag = "passwd_hashed"
>           passwd.text = passwd_hashed


More information about the elbe-devel mailing list