[elbe-devel] [PATCH v3 3/7] commands: check-build: move password to login value

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


The plain-text passwords in XML will be replaced by hashed variants, so
that they are no longer usable for the login action. Use the value in
the login element for storing the plain-text root password. If no
password is set, the default password ("root") is used for the action.

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

diff --git a/elbepack/commands/check-build.py b/elbepack/commands/check-build.py
index ce2fe6da2..e619f3139 100644
--- a/elbepack/commands/check-build.py
+++ b/elbepack/commands/check-build.py
@@ -447,10 +447,9 @@ class CheckImage(CheckBase):
 
     def do_login(self, _element, img_name, qemu, opts):
 
-        # TODO - We might want to have encrypted password in source.xml
         passwd = "root"
-        if self.xml.has("./target/passwd"):
-            passwd = self.xml.text("./target/passwd")
+        if self.xml.find(".//action/login").text:
+            passwd = self.xml.find(".//action/login").text
 
         comm = [
             ("expect", ".*[Ll]ogin:.*"),
diff --git a/schema/dbsfed.xsd b/schema/dbsfed.xsd
index f3984528f..69f4a5ee0 100644
--- a/schema/dbsfed.xsd
+++ b/schema/dbsfed.xsd
@@ -606,7 +606,9 @@
       <element name="login" type="rfs:string" minOccurs="0" maxOccurs="1">
         <annotation>
           <documentation>
-            Try to login into root session and shutdown the machine
+            Try to login into root session and shutdown the machine.  The
+            element takes an (optional) plain-text password for root.
+            Default password is "root".
           </documentation>
         </annotation>
       </element>
-- 
2.36.1



More information about the elbe-devel mailing list