News for hackers. Stuff that matters.
Re:How to destroy your OS with tar by cbsks on Wednesday May 22, 2024 @10:17PM (#40449659)
Any time you see a command starting with “sudo” and with a path of “/“ in the arguments, alarm bells should be going off. Here be dragons.
Re:How to destroy your OS with tar by vorakl on Thursday May 23, 2024 @01:06AM (#40450665)
Yes, but someone has to do the dirty work ;)
Re:How to destroy your OS with tar by millzlane on Thursday May 23, 2024 @08:30PM (#40461584)
Appreciate the sacrifice
Re:How to destroy your OS with tar by bigstrat2003 on Thursday May 23, 2024 @08:48PM (#40461708)
Right, I would be more surprised if this didn't break your system. I never would've tried unpacking a tarball to my FS root in the first place.
Re:How to destroy your OS with tar by klyrs on Thursday May 23, 2024 @10:48PM (#40462364)
What, you mean the increasingly popular install pattern

   curl ... | sudo bash
might have pitfalls? Gasp.
Re:How to destroy your OS with tar by mike256 on Friday May 24, 2024 @12:08AM (#40462715)
You shouldn't do that. At least download the installer first, have a short look at it and decide if you like to run it.

I personally avoid software whose manual suggests this type of install because I think of the developers as not that intelligent ones.

Re:How to destroy your OS with tar by klyrs on Friday May 24, 2024 @02:02AM (#40463277)
Yeah, no, you shouldn't do that. Kinda my point in writing that, right? But it's terrifyingly commonplace and needs to stop.
Re:How to destroy your OS with tar by prmoustache on Friday May 24, 2024 @02:17AM (#40463361)
I don't even understand the reasoning to do that.

Maintaining that kind of monstruosity of shell scripts that have to work on all kind of OS or linux distros must be a giant PITA compared to the simplicity of making an appimage/flatpak and a set of deb/rpm packages for the most popular distros and clear instructions for port maintainers to do the same for archlinux and BSD systems.

Re:How to destroy your OS with tar by Gormo on Friday May 24, 2024 @05:34PM (#40470666)
One should never pipe curl output into `sudo bash`, but I think you've got things quite backwards here. Barring some extreme edge cases, putting binaries in /usr/bin, icons in /usr/share/icons, config files in /etc, libraries in /usr/lib and so on, are standard across the the Linux workd, and simple utilities that are just archives of binaries, docs, and auxiliary files can easily be deployed to most distros with a common install script.

This is far, far less complex than having to maintain and distribute an entire bundled runtime environment, deal with inconsistent behavior with the local config, etc. Flatpak and AppImage have their use cases, but by no means are they simpler than just putting binaries in the right places -- they are in fact an entire additional layer of complexity.

Re:How to destroy your OS with tar by klyrs on Friday May 24, 2024 @08:28PM (#40471690)
Here's one I spotted a few weeks back, just so you know I'm not making shit up:

https://docs.waydro.id/usage/install-on-desktops (see Ubuntu section)

Re:How to destroy your OS with tar by prmoustache on Saturday May 25, 2024 @06:08PM (#40478210)
If it is not provided by the distribution, those things shouldn't go in /usr/bin|lib|share but in /usr/local/bin|lib|share
Re:How to destroy your OS with tar by Gormo on Sunday May 26, 2024 @01:19AM (#40479926)
That's a reasonable practice, yes, if you're doing a manual direct install. In situations like this, though, I typically just write a quick PKGBUILD script so the package manager can manage it, which means pointing things at the direct /usr/* paths, not /usr/local/*.
Re:How to destroy your OS with tar by vorakl on Friday May 24, 2024 @02:19AM (#40463372)
I don't recall ever seeing this approach with sudo. Is it really becoming popular? It used to be just bash, e.g. `curl ... | bash`. But now there is nothing stopping you from putting sudo in that bash script and expecting with a high probability that NOPASSWD: is also there ;)
Re:How to destroy your OS with tar by klyrs on Friday May 24, 2024 @11:28AM (#40467172)
Indeed, if you preface the curl | bash with sudo apt install, there's no difference!
Re:How to destroy your OS with tar by nightshift1 on Monday May 27, 2024 @05:45PM (#40495041)
The content of the file being served can easily be switched based on the user agent accessing the file (curl vs a browser)

Instead, you shoud wget, review and execute locally or something similar.

Re:How to destroy your OS with tar by plasticeagle on Friday May 24, 2024 @02:19AM (#40463373)
Well... Yes you're not wrong. But this isn't really any different from downloading an installer and entering your password to permit the install to proceed.

So I assume that you also never do that - and the downloaded installer is even worse, because you can't easily look inside the executable to determine what it does.

Shocking news : Installing software installs the software.

Re:How to destroy your OS with tar by pests on Friday May 24, 2024 @10:56AM (#40466884)
Yet we all npm install or run random binaries without a second thought.
Re:How to destroy your OS with tar by klyrs on Friday May 24, 2024 @01:48PM (#40468618)
I do neither of those things!
Re:How to destroy your OS with tar by rob74 on Friday May 24, 2024 @02:16AM (#40463354)
Yup... tar alone can't destroy your system, you need sudo (and the appropriate parameters) for that.
Re:How to destroy your OS with tar by nurb on Friday May 24, 2024 @02:33AM (#40463454)