From: Jan Kiszka <jan.kiszka@siemens.com>
To: isar-users <isar-users@googlegroups.com>
Subject: [PATCH] image-account-extension: Avoid deprecated crypt module
Date: Sat, 28 Oct 2023 10:59:30 +0200 [thread overview]
Message-ID: <d290e4d1-eaa2-4591-a2c1-a4ae0d1d527e@siemens.com> (raw)
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
next reply other threads:[~2023-10-28 8:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-28 8:59 Jan Kiszka [this message]
2023-11-01 7:13 ` Uladzimir Bely
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=d290e4d1-eaa2-4591-a2c1-a4ae0d1d527e@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=isar-users@googlegroups.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