Re: [osinfo-db 1/2] rhel: enclose strings used for shell ifs in quotes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 17, 2017 at 03:24:16PM +0000, Debarshi Ray wrote:
> Hey,
> 
> On Mon, Jan 16, 2017 at 07:29:55PM +0100, Fabiano Fid??ncio wrote:
> >  useradd -G wheel <xsl:value-of select="config/user-login"/> # Add user
> > -if test -z <xsl:value-of select="config/user-password"/>; then
> > +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"/>
> >  fi
> >  
> > -if test -z <xsl:value-of select="config/admin-password"/>; then
> > +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
> >  fi
> >  
> >  # Set user avatar
> > -if test -n <xsl:value-of select="config/avatar-location"/>; then
> > +if test -n "<xsl:value-of select="config/avatar-location"/>"; then
> >  mkdir /mnt/unattended-media
> >  mount <xsl:value-of select='config/avatar-disk'/> /mnt/unattended-media
> >  cp /mnt/unattended-media<xsl:value-of select="config/avatar-location"/> /home/<xsl:value-of select="config/user-login"/>/.face
> 
> Nested double quotes! So far it has generated valid Kickstart files, but
> I don't know if that is by accident or by design.

I think these files are valid XML files, so I would not be surprised if
this was parsed as

<xml-document>
    some text containing a "
      <some-xml-node attribute="foo"/>
    some other text with another "
</xml-document>

in other word, not an issue for an XML parser.

Christophe

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Libosinfo mailing list
Libosinfo@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libosinfo

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux