Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 608666 - Repoman should warn about unquoted variables that could contain spaces
Summary: Repoman should warn about unquoted variables that could contain spaces
Status: RESOLVED WONTFIX
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Repoman (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-08 21:44 UTC by David Seifert
Modified: 2022-07-12 03:25 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Seifert gentoo-dev 2017-02-08 21:44:27 UTC
Repoman currently does not warn about stuff such as

  cd ${ED}

This is potentially dangerous, as ${ED}, ${D} and a stack of other variables can potentially contain spaces. This is also somewhat inconsistent behaviour as

  OPTIONS+=" --boost-build=${EPREFIX}/usr/share/boost-build --prefix=\"${ED}usr\""

for instance causes repoman to warn about "Unquoted Variable on line: 174".

Reproducible: Always
Comment 1 Mike Gilbert gentoo-dev 2017-02-08 22:08:07 UTC
(In reply to David Seifert from comment #0)
> Repoman currently does not warn about stuff such as
> 
>   cd ${ED}

This works for me.

floppym@naomi foo % cat foo-0.ebuild
EAPI=6
src_install() {
        cd ${ED}
}
floppym@naomi foo % repoman full

RepoMan scours the neighborhood...
...
  ebuild.minorsyn               1
   app-misc/foo/foo-0.ebuild: Unquoted Variable on line: 3
...
Comment 2 Zac Medico gentoo-dev 2017-02-08 22:13:07 UTC
(In reply to Mike Gilbert from comment #1)
> (In reply to David Seifert from comment #0)
> > Repoman currently does not warn about stuff such as
> > 
> >   cd ${ED}
> 
> This works for me.

Yeah it works for me too.

Can we get a sample ebuild that reproduces the problem?

The code responsible for this is the EbuildQuote class:

https://gitweb.gentoo.org/proj/portage.git/tree/repoman/pym/repoman/modules/scan/ebuild/checks.py?h=repoman-2.3.1#n153
Comment 3 Mike Gilbert gentoo-dev 2017-02-08 22:24:32 UTC
It looks like ${ED} gets detected, but not ${ED%/}.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-12 03:18:37 UTC
repoman support has been removed per bug 835013.

Please file a new bug (or, I suppose, reopen this one) if you feel this check is still applicable to pkgcheck and doesn't already exist.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-12 03:25:01 UTC
pkgcheck now has UnquotedVariable.