[Libosinfo] [osinfo-db 1/2] rhel: enclose strings used for shell ifs in quotes
Christophe Fergeau
cfergeau at redhat.com
Tue Feb 7 16:18:47 UTC 2017
On Tue, Jan 17, 2017 at 04:35:47PM +0100, Fabiano Fidêncio wrote:
> On Tue, Jan 17, 2017 at 4:35 PM, Fabiano Fidêncio <fabiano at fidencio.org> wrote:
> > On Tue, Jan 17, 2017 at 4:24 PM, Debarshi Ray <rishi.is at lostca.se> 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'll replace one of the " by ' before pushing in case this is the only problem.
> > Better be safe than sorry here.
> >
> > Thanks for the catch!
>
> And, of course, the comments apply to the Fedora patch as well :-)
For the two patches,
Acked-by: Christophe Fergeau <cfergeau at redhat.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libosinfo/attachments/20170207/e7dd05c5/attachment.sig>
More information about the Libosinfo
mailing list