Re:Show HN: A single command terminal configuration installer
by aaronkjones on Tuesday August 21, 2018 @06:21PM
(#17814362)
By safe do you mean there is something insecure with redirecting output in this manner or do you mean one shouldn’t sh -c $(wget... without first checking the source of what they’re downloading?
Re:Show HN: A single command terminal configuration installer
by aaronkjones on Tuesday August 21, 2018 @11:14PM
(#17815993)
*By unsafe
Re:Show HN: A single command terminal configuration installer
by tomsmeding on Wednesday August 22, 2018 @03:57AM
(#17817112)
Mostly the second, you should check what you're downloading and executing. But a server can send two different files on two similar requests, ans perhaps it sends you a "good" file when you view it in your browser and a malicious file when downloading it via wget.
When piping, there is a well-known trick how the server can detect the difference even disregarding stings like the user agent header, but that trick doesn't work when you do $(wget ...). But I won't guarantee there isn't some other trick that can be performed.
However, the script can't be overly long this way, since there is a limit to the command line length on Linux.
Safe, however, this is clearly still not.