Disallow bp 'build' includes to reference other dirs

Bug: 65683273
Test: add 'build = ["sub/nope.bp"]' to an Android.bp; notice the error

Change-Id: Ic0f171f283edda074f65a76029e660dfaab2504b
This commit is contained in:
Jeff Gaston 2017-11-30 17:31:43 -08:00
parent 3c8c3346d2
commit f23e36690e

View file

@ -954,6 +954,14 @@ func (c *Context) parseOne(rootDir, filename string, reader io.Reader,
if err != nil {
errs = append(errs, err)
}
for _, buildEntry := range build {
if strings.Contains(buildEntry, "/") {
errs = append(errs, &BlueprintError{
Err: fmt.Errorf("illegal value %v. The '/' character is not permitted", buildEntry),
Pos: buildPos,
})
}
}
subBlueprintsName, _, err := getStringFromScope(scope, "subname")
if err != nil {