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

Fabiano Fidêncio fabiano at fidencio.org
Wed Apr 19 18:04:58 UTC 2017


On Wed, Apr 19, 2017 at 12:53 PM, Daniel P. Berrange
<berrange at redhat.com> wrote:
> On Wed, Apr 19, 2017 at 12:49:53PM +0200, Fabiano Fidêncio wrote:
>> 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/fedoraproject.org/fedora-kickstart-jeos.xml.in    | 2 +-
>>  data/install-script/redhat.com/rhel-kickstart-desktop.xml.in          | 4 ++--
>>  data/install-script/redhat.com/rhel-kickstart-jeos.xml.in             | 2 +-
>>  4 files changed, 6 insertions(+), 6 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/fedoraproject.org/fedora-kickstart-jeos.xml.in b/data/install-script/fedoraproject.org/fedora-kickstart-jeos.xml.in
>> index 8b99dfe..f4d95e0 100644
>> --- a/data/install-script/fedoraproject.org/fedora-kickstart-jeos.xml.in
>> +++ b/data/install-script/fedoraproject.org/fedora-kickstart-jeos.xml.in
>> @@ -108,7 +108,7 @@ mouse generic3ps/2 --device psaux
>>  </xsl:if>
>>  skipx
>>  network --bootproto dhcp
>> -rootpw <xsl:value-of select="config/admin-password"/>
>> +rootpw '<xsl:value-of select="config/admin-password"/>'
>>  firewall --disabled
>>  authconfig --enableshadow --enablemd5
>>  <xsl:if test="os/version > 1">
>
> IIUC, this bit isn't shell code but rather kickstart config so do we actually
> want quoting here ?

Indeed, this part is kickstart config and I wasn't sure whether I
should quote it or not.
I just did one test and as you noticed it's not necessary.

I'm sending a v2 soon.

>
>> diff --git a/data/install-script/redhat.com/rhel-kickstart-jeos.xml.in b/data/install-script/redhat.com/rhel-kickstart-jeos.xml.in
>> index db7ec7f..dfe9534 100644
>> --- a/data/install-script/redhat.com/rhel-kickstart-jeos.xml.in
>> +++ b/data/install-script/redhat.com/rhel-kickstart-jeos.xml.in
>> @@ -63,7 +63,7 @@ keyboard us
>>  lang <xsl:value-of select="config/l10n-language"/>
>>  skipx
>>  network --bootproto dhcp
>> -rootpw <xsl:value-of select="config/admin-password"/>
>> +rootpw '<xsl:value-of select="config/admin-password"/>'
>>  firewall --disabled
>>  authconfig --enableshadow --enablemd5
>>  selinux --enforcing
>
> Same question here
>
>
> Regards,
> Daniel
> --
> |: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
> |: https://libvirt.org         -o-            https://fstop138.berrange.com :|
> |: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



-- 
Fabiano Fidêncio




More information about the Libosinfo mailing list