New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to install camlp5 with latest version of ocaml delete everything on the file system #11440

Closed
LukeXuan opened this Issue Feb 18, 2018 · 6 comments

Comments

Projects
None yet
6 participants
@LukeXuan

LukeXuan commented Feb 18, 2018

I'm not familiar with the internal mechanics of opam install. But it seems like the camlp5 is not compatible with ocaml 4.06.1, and it complains about it during configuration. As a result, several variables is not set in the Makefile. The opam will execute "make uninstall" then which essentially runs "rm -rf /" on my computer.

@mseri

This comment has been minimized.

Contributor

mseri commented Feb 18, 2018

I think this should be fixed also in the camlp5 makefile, maybe setting the DESTDIR to some dummy tmp value or aborting the commands if DESTDIR and/or CAMLP5N are not set.

@thierry-martinez

This comment has been minimized.

Contributor

thierry-martinez commented Feb 20, 2018

Camlp5 Makefile is now fixed (@roglo): camlp5/camlp5@d561693

@mseri

This comment has been minimized.

Contributor

mseri commented Feb 20, 2018

Thanks!

@AltGr

This comment has been minimized.

Member

AltGr commented Feb 22, 2018

Ref: ocaml/opam#3231
Maybe we need to enable sandboxing where available ASAP. This is really not nice...

For the story, this happened to me a long time ago (exactly the same: undefined variable in a Makefile resulting in rm -rf /. Plus it was running from emacs so I didn't notice it was taking suspiciously long before it was too late). That was a few days before the end of a project... I have adopted a very defensive style whenever I need to use rm -rf in scripts or Makefiles ever since. I always use rm -rf /tmp/${VAR#/tmp/} to remove temp dir $VAR from scripts.

@avsm

This comment has been minimized.

Member

avsm commented Feb 22, 2018

Indeed, this is a strong case to enable sandboxing in opam2 where at all possible.

@polkovnikov-ph

This comment has been minimized.

polkovnikov-ph commented Mar 17, 2018

I know of a good strictly typed programming language that can avoid such issues and is already in your PATH. It's shell script, obviously. Let's use more of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment