[Libosinfo] [osinfo-db v2] install-script: Use single quotes around passwords set from a shell

Fabiano Fidêncio fidencio at redhat.com
Wed Apr 19 18:20:58 UTC 2017


From: Fabiano Fidêncio <fabiano at fidencio.org>

We have to have single quotes around the passwords set from a shell
otherwise a password like "foo$bar" would be interpreted by the shell as
"foo" value of $bar.

Reported-by: Rafael Fonseca <fonsecasantos.rafael at gmail.com>
Signed-off-by: Fabiano Fidêncio <fabiano at fidencio.org>
---
 data/install-script/fedoraproject.org/fedora-kickstart-desktop.xml.in | 4 ++--
 data/install-script/redhat.com/rhel-kickstart-desktop.xml.in          | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/data/install-script/fedoraproject.org/fedora-kickstart-desktop.xml.in b/data/install-script/fedoraproject.org/fedora-kickstart-desktop.xml.in
index 6f53299..bdc9f5d 100644
--- a/data/install-script/fedoraproject.org/fedora-kickstart-desktop.xml.in
+++ b/data/install-script/fedoraproject.org/fedora-kickstart-desktop.xml.in
@@ -176,13 +176,13 @@ useradd -G wheel <xsl:value-of select="config/user-login"/> # Add user
 if test -z '<xsl:value-of select="config/user-password"/>'; then
     passwd -d <xsl:value-of select="config/user-login"/> # Make user account passwordless
 else
-    echo <xsl:value-of select="config/user-password"/> |passwd --stdin <xsl:value-of select="config/user-login"/>
+    echo '<xsl:value-of select="config/user-password"/>' |passwd --stdin <xsl:value-of select="config/user-login"/>
 fi
 
 if test -z '<xsl:value-of select="config/admin-password"/>'; then
     passwd -d root # Make root account passwordless
 else
-    echo <xsl:value-of select="config/admin-password"/> |passwd --stdin root
+    echo '<xsl:value-of select="config/admin-password"/>' |passwd --stdin root
 fi
 
 # Set user avatar
diff --git a/data/install-script/redhat.com/rhel-kickstart-desktop.xml.in b/data/install-script/redhat.com/rhel-kickstart-desktop.xml.in
index d4a9005..388d6d7 100644
--- a/data/install-script/redhat.com/rhel-kickstart-desktop.xml.in
+++ b/data/install-script/redhat.com/rhel-kickstart-desktop.xml.in
@@ -119,13 +119,13 @@ useradd -G wheel <xsl:value-of select="config/user-login"/> # Add user
 if test -z '<xsl:value-of select="config/user-password"/>'; then
     passwd -d <xsl:value-of select="config/user-login"/> # Make user account passwordless
 else
-    echo <xsl:value-of select="config/user-password"/> |passwd --stdin <xsl:value-of select="config/user-login"/>
+    echo '<xsl:value-of select="config/user-password"/>' |passwd --stdin <xsl:value-of select="config/user-login"/>
 fi
 
 if test -z '<xsl:value-of select="config/admin-password"/>'; then
     passwd -d root # Make root account passwordless
 else
-    echo <xsl:value-of select="config/admin-password"/> |passwd --stdin root
+    echo '<xsl:value-of select="config/admin-password"/>' |passwd --stdin root
 fi
 
 # Set user avatar
-- 
2.9.3




More information about the Libosinfo mailing list