From: Uladzimir Bely <ubely@ilbers.de>
To: Jan Kiszka <jan.kiszka@siemens.com>,
isar-users <isar-users@googlegroups.com>
Subject: Re: [PATCH] image-account-extension: Avoid deprecated crypt module
Date: Wed, 01 Nov 2023 10:13:38 +0300 [thread overview]
Message-ID: <b53c82fe206c2f8e680155092c3923ea00387305.camel@ilbers.de> (raw)
In-Reply-To: <d290e4d1-eaa2-4591-a2c1-a4ae0d1d527e@siemens.com>
On Sat, 2023-10-28 at 10:59 +0200, 'Jan Kiszka' via isar-users wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> crypt will be dropped from Python 13. Switch to 'openssl passwd' to
> avoid extra dependencies like python3-passlib.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
> meta/classes/image-account-extension.bbclass | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/meta/classes/image-account-extension.bbclass
> b/meta/classes/image-account-extension.bbclass
> index 6f67f459..412aa06d 100644
> --- a/meta/classes/image-account-extension.bbclass
> +++ b/meta/classes/image-account-extension.bbclass
> @@ -72,7 +72,6 @@ def image_create_users(d: "DataSmart") -> None:
> None
> """
> import hashlib
> - import crypt
>
> entries = (d.getVar("USERS") or "").split()
> rootfsdir = d.getVar("ROOTFSDIR")
> @@ -137,7 +136,7 @@ def image_create_users(d: "DataSmart") -> None:
> if source_date_epoch:
> command.append("-e")
> salt =
> hashlib.sha256("{}\n".format(source_date_epoch).encode()).hexdigest()
> [0:15]
> - password = crypt.crypt(password,
> "$6${}".format(salt))
> + password = bb.process.run('openssl passwd -6 --
> salt {} {}'.format(salt, password))[0].strip()
>
> else:
> command.append("-e")
> --
> 2.35.3
>
Applied to next, thanks.
prev parent reply other threads:[~2023-11-01 7:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-28 8:59 Jan Kiszka
2023-11-01 7:13 ` Uladzimir Bely [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b53c82fe206c2f8e680155092c3923ea00387305.camel@ilbers.de \
--to=ubely@ilbers.de \
--cc=isar-users@googlegroups.com \
--cc=jan.kiszka@siemens.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox