aboutsummaryrefslogtreecommitdiffstats
path: root/context.go
diff options
context:
space:
mode:
authorJeff Gaston <jeffrygaston@google.com>2017-11-30 17:31:43 -0800
committerJeff Gaston <jeffrygaston@google.com>2017-12-04 17:16:21 -0800
commitf23e36690e1e76551535b9479e3285425331a862 (patch)
treea7c42932be39d4cf355370edcde9d0cb8e4302f5 /context.go
parent3c8c3346d2c3eef85ce99ab58bd8aa07a53d6bc1 (diff)
downloadandroid_build_blueprint-f23e36690e1e76551535b9479e3285425331a862.tar.gz
android_build_blueprint-f23e36690e1e76551535b9479e3285425331a862.tar.bz2
android_build_blueprint-f23e36690e1e76551535b9479e3285425331a862.zip
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
Diffstat (limited to 'context.go')
-rw-r--r--context.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/context.go b/context.go
index 30cc973..5a7e558 100644
--- a/context.go
+++ b/context.go
@@ -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 {