crater icon indicating copy to clipboard operation
crater copied to clipboard

Crates which create files in build scripts can't be cargobombed

Open Marwes opened this issue 8 years ago • 5 comments
trafficstars

For instance any crate using LALRPOP needs to generate a .rs file from the grammar file but due to the file system being read-only.

Marwes avatar Nov 22 '17 22:11 Marwes

At minimum we should allow (say) 100MB in /tmp.

aidanhs avatar Nov 24 '17 11:11 aidanhs

At minimum we should allow (say) 100MB in /tmp.

In the case of LALRPOP it needs access to write into the source directory as it is an actual source file that gets created which rustc compiles afterwards.

Marwes avatar Nov 24 '17 12:11 Marwes

Got a link? Usually if you're generating source files you can use OUT_DIR to not pollute your source dir, e.g. https://github.com/sfackler/rust-phf#phf_codegen

(was also talking about this to @tglman who creates temporary databases for testing)

aidanhs avatar Nov 24 '17 13:11 aidanhs

That's true, currently I just .gitignore it so I never see it but generating to OUT_DIR and including it is probably a better idea. I could just add a dummy grammar.rs module in this case whose sole contents is a include! call.

https://github.com/gluon-lang/gluon/blob/master/parser/build.rs

I assume cargobomb will work in that case?, as OUT_DIR is a place which must be writable for any compilation to work at all?

Marwes avatar Nov 24 '17 13:11 Marwes

I assume cargobomb will work in that case?, as OUT_DIR is a place which must be writable for any compilation to work at all?

Yup, OUT_DIR is under target so should work.

aidanhs avatar Nov 24 '17 18:11 aidanhs