Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8285)

Unified Diff: cipd/client/cipd/local/builder.go

Issue 2681803003: [cipd] make creating instances from cipd installations work. (Closed)
Patch Set: windows tests Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | cipd/client/cipd/local/files.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cipd/client/cipd/local/builder.go
diff --git a/cipd/client/cipd/local/builder.go b/cipd/client/cipd/local/builder.go
index ec0b3f0df53c61818aaa97559c05f42360286336..cbfb2c2224a93a9ec8b287e47359829a3d51be5f 100644
--- a/cipd/client/cipd/local/builder.go
+++ b/cipd/client/cipd/local/builder.go
@@ -55,11 +55,16 @@ func BuildInstance(ctx context.Context, opts BuildInstanceOptions) error {
return err
}
- // Make sure no files are written to package service directory.
+ // Sanitize the Inputs.
for _, f := range opts.Input {
+ // Make sure no files are written to package service directory.
if strings.HasPrefix(f.Name(), packageServiceDir+"/") {
return fmt.Errorf("can't write to %s: %s", packageServiceDir, f.Name())
}
+ // Make sure no files are written to cipd's internal state directory.
+ if strings.HasPrefix(f.Name(), SiteServiceDir+"/") {
+ return fmt.Errorf("can't write to %s: %s", SiteServiceDir, f.Name())
+ }
}
// Generate the manifest file, add to the list of input files.
« no previous file with comments | « no previous file | cipd/client/cipd/local/files.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698