[elbe-devel] [PATCH v3 4/7] schema: switch to hashed password for root

Holger Dengler holger at hdengler.de
Thu Jun 30 08:00:04 CEST 2022


Replace the plain-text password with its hashed variant in the XML
schema. Adapt the password processing for root accordingly.

Signed-off-by: Holger Dengler <holger at hdengler.de>
Reviewed-by: Bastian Germann <bage at linutronix.de>
---
 elbepack/rfs.py   | 4 ++--
 schema/dbsfed.xsd | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/elbepack/rfs.py b/elbepack/rfs.py
index 4704eed61..dd12e4f5a 100644
--- a/elbepack/rfs.py
+++ b/elbepack/rfs.py
@@ -325,9 +325,9 @@ class BuildEnv:
 
 
     def seed_etc(self):
-        passwd = self.xml.text("target/passwd")
+        passwd = self.xml.text("target/passwd_hashed")
         stdin = "root:%s" % (passwd)
-        chroot(self.rfs.path, "chpasswd", stdin=stdin)
+        chroot(self.rfs.path, "chpasswd --encrypted", stdin=stdin)
 
         hostname = self.xml.text("target/hostname")
         fqdn = hostname
diff --git a/schema/dbsfed.xsd b/schema/dbsfed.xsd
index 69f4a5ee0..497bc5d05 100644
--- a/schema/dbsfed.xsd
+++ b/schema/dbsfed.xsd
@@ -982,10 +982,10 @@
           </documentation>
         </annotation>
       </element>
-      <element name="passwd" type="rfs:string" minOccurs="1" maxOccurs="1">
+      <element name="passwd_hashed" type="rfs:string" minOccurs="1" maxOccurs="1">
         <annotation>
           <documentation>
-            root password
+            hashed root password
           </documentation>
         </annotation>
       </element>
-- 
2.36.1



More information about the elbe-devel mailing list