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

Holger Dengler holger at hdengler.de
Thu Jun 16 12:10:09 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.

Signed-off-by: Holger Dengler <holger at hdengler.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 38642e3ac..ed6423854 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