6 ms·
But it's not really dangerous, no more so than downloading an arbitrary binary and executing it at least. The script is delivered over https, so you're not goin
by maccard 4y ago
But it's not really dangerous, no more so than downloading an arbitrary binary and executing it at least. The script is delivered over https, so you're not going to be MITM'ed, and you're trusting rustup to provide you the valid install script. If you _are_ MITM'ed, it doesn't really matter what your delivery method is unless you do a verification from another device/network, and if you don't trust rustup then why are you downloading and executing their installer?
- ducktective 4y agoIf they `shellcheck` their bash script, then sure. Aside from unquoted $vars, usually random shell scripts have a habit of polluting home and creating arbitrary dirs under god-knows-where and not respecting XDG. They are almost always irreversible too. Like you can't undo the steps the shell scripts have done.
- __ryan__ 4y agoAny software you choose to run could not respect your desires and leave a mess. This is not a random shell script. It's the officially recommended way to install Rust [0], vetted and maintained by the community. You're free to audit the script before running it, or even check out the source [1]. If this doesn't satisfy you, check out the other installation methods [2]. Edit: I realize you're not speaking specifically about rustup, but what I said can and should apply to anything you choose to install this way. 0: https://www.rust-lang.org/tools/install#rustup https://www.rust-lang.org/tools/install#rustup 1: https://github.com/rust-lang/rustup https://github.com/rust-lang/rustup 2: https://forge.rust-lang.org/infra/other-installation-methods.html https://forge.rust-lang.org/infra/other-installation-methods...
- marcosdumay 4y ago> Any software you choose to run could not respect your desires and leave a mess. On most languages, you must decide to do it to create a mess. Bash is almost alone on the place where you can do it by accident.
- maccard 4y agoA syntax error in any scripting language will have the exact same problem.
- woojoo666 4y agoIt's arguably easier to fall into such errors in Bash though. That's just my experience at least
- marcosdumay 4y agoProblems like removing a large directory instead of a file, creating your files on random places instead of the directory you pass on, or creating more files than you intended? The one mess you see from other languages is creating files on the wrong place (or all over the place). But not those above.
- maccard 4y ago> Problems like removing a large directory instead of a file rm doens't do that unless you explicitly tell it to. > Problems like removing a large directory instead of a file, creating your files on random places instead of the directory you pass on, or creating more files than you intended? But yes, all of these can and do exist in other languages. Using python as an example, if you read an environment variable without checking it's set (as in the infamous steam bug) [0], you'll end up with pretty much the exact same behaviour. You can misindent your loop in python and not create/remove files that you intend to, or your script can have a syntax error halfway through and the interpreter will happily proceed until it halts, and leave you in a half baked state just like bash does. [0] https://github.com/valvesoftware/steam-for-linux/issues/3671 https://github.com/valvesoftware/steam-for-linux/issues/3671
- __ryan__ 4y agoAny tool can be dangerous in inexperienced or careless hands. The issues you described could just as likely be caused by logic errors or typos in any other language. You’re talking as if all bash scripts are hacked together carelessly and work by accident. You can actually learn bash. Thankfully the script we’re discussing is written with care and vetted by the community. Problems like removing a large directory instead of a file The rm command doesn’t even remove directories by default, you have to specify a flag. Not knowing a tool is not a good reason to bash it.
- maccard 4y agoThe same can be said for any badly written python script, or golang binary too.