News for hackers. Stuff that matters.
Re:Don't Copy-Paste from Website to Terminal by NelsonMinar on Sunday April 07, 2013 @04:03PM (#5508505)
Why would I bother copying and pasting the code to my clipboard when common industry practice now is just to invoke the output of curl directly?

ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)

Re:Don't Copy-Paste from Website to Terminal by subway on Sunday April 07, 2013 @04:08PM (#5508528)
C'mon... That is nothing like the industry standard -- you used SSL.
Re:Don't Copy-Paste from Website to Terminal by somesay on Sunday April 07, 2013 @04:33PM (#5508637)
Watch out. Does curl check the key chain against any key store? I bet not.
Re:Don't Copy-Paste from Website to Terminal by lnguyen on Sunday April 07, 2013 @04:35PM (#5508646)
Actually it does. You turn off checking via -k
Re:Don't Copy-Paste from Website to Terminal by somesay on Sunday April 07, 2013 @04:49PM (#5508689)
Oh, nice, you are right, should be compiled against OS' key storage. Actually it's wget who often doesn't care of that.
Re:Don't Copy-Paste from Website to Terminal by LukeShu on Sunday April 07, 2013 @04:57PM (#5508722)
Um, GNU wget does check the key, and it requires the lengthy `--no-check-certificate` to disable it.

Perhaps busybox wget doesn't check the key? But if you're using busybox, that's a whole other can of worms.

Re:Don't Copy-Paste from Website to Terminal by 0xbadcafebee on Sunday April 07, 2013 @05:29PM (#5508856)
Wget does not validate certificates by default because there's no CA bundle provided with wget. It does check for /etc/ssl/cert.pem, but it doesn't provide one. So you have to provide one or set up /etc/ssl/certs/ as OpenSSL libraries expect.

Curl does provide a CA bundle (/usr/share/curl/ca-bundle.crt) and by default libcurl validates certs against it.

Re:Don't Copy-Paste from Website to Terminal by halfasleep on Monday April 08, 2013 @03:50AM (#5510459)
cURL doesn't provide a CA bundle any more [1], it's the job of your OS to provide this. As I understand it, all tools that provide SSL support will fail safe if there are no root CAs on your system. [1] http://curl.haxx.se/docs/sslcerts.html
Re:Don't Copy-Paste from Website to Terminal by LukeShu on Monday April 08, 2013 @11:46AM (#5512411)
Though, to be fair:

    $ pacman -Qi ca-certificates | grep 'Required By'
    Required By    : ca-certificates-java  curl  glib-networking  neon  qca  qt4
Note that curl is on that list but wget isn't.
Re:Don't Copy-Paste from Website to Terminal by 0xbadcafebee on Monday April 08, 2013 @01:48PM (#5513247)
Pacman lists ca-certificates as an optional requirement of wget: https://www.archlinux.org/packages/extra/x86_64/wget/

But the point halfasleep is making is important: Don't assume either wget or curl will validate your SSL connection because it may not have been set up by your OS/distribution.

Re:Don't Copy-Paste from Website to Terminal by somesay on Monday April 08, 2013 @06:51PM (#5515230)
I wasn't that wrong then. ;)
Re:Don't Copy-Paste from Website to Terminal by stock_toaster on Tuesday April 09, 2013 @12:36AM (#5516462)
They do still provide a bundle[1] though, for cases where you need it (eg homebrew's curl-ca-bundle package).

  [1]: http://curl.haxx.se/docs/caextract.html
Re:Don't Copy-Paste from Website to Terminal by lukeschlather on Sunday April 07, 2013 @04:56PM (#5508719)
Wget has the --no-check-certificate flag, I've had to use it to work with self-signed certs before.
Re:Don't Copy-Paste from Website to Terminal by somesay on Sunday April 07, 2013 @05:05PM (#5508756)
Touché!
Re:Don't Copy-Paste from Website to Terminal by comice on Sunday April 07, 2013 @06:21PM (#5509011)
It does if you're on a proper operating system like Debian :)
Re:Don't Copy-Paste from Website to Terminal by charlieok on Sunday April 07, 2013 @05:30PM (#5508862)
I dislike this whole trend. How about we start thinking in terms of leaving the user's default environment, and system, alone, and “installing” software into nice sandboxed areas where we can easily enable/disable it, or delete it with a simple “rm -rf directory/path”
Re:Don't Copy-Paste from Website to Terminal by csense on Sunday April 07, 2013 @08:41PM (#5509397)
I put all my sensitive files under my home directory. Every subdirectory of my home directory is non-world-accessible, and I have a cron job which chmod's world privileges away from new files and directories that don't match a whitelist of directories I wish to publish (e.g. ~/public_html).

I've started giving each application its own user and group, and do the git checkout, compile, and install as that user. (You don't need root for "make install" if you ran configure with the --prefix option.) Then I know it's not going to be able to write anywhere but its own directories, and won't be able to see my browsing activities or sensitive files, because UNIX permissions won't let it. For added security, once the software is built, move it to a location where only root can write, and chown -R root:root.

You can also use VM's for added security. With the new namespaces in 3.8 (the kernel for Ubuntu Raring Ringtail), it should (in theory) be safe to let untrusted software have root in a Linux container (LXC). (LXC is like chroot but you can virtualize stuff like the network, and since the guest uses the host's kernel memory allocator, you don't have to dedicate a block of memory to running the guest as you would with Xen or Virtualbox.)

Re:Don't Copy-Paste from Website to Terminal by trotsky on Sunday April 07, 2013 @11:36PM (#5509868)
It seems like you've been putting a lot of effort in, but posix uid/gid isolation is increasingly pourous with the typical desktop environment these days. It sounds like you are ready for real RBAC - if you put the time in selinux (or apparmor or grsec) is leaps and bounds more effective.
Re:Don't Copy-Paste from Website to Terminal by sliverstorm on Monday April 08, 2013 @01:18AM (#5510095)
uid/gid is generally a sound system, the problem IMO is basically that no one uses it for serious security, so a lot of things are not set up to be properly careful by default.
Re:Don't Copy-Paste from Website to Terminal by XorNot on Monday April 08, 2013 @06:15AM (#5510875)
uid/gid on Linux also is terrible for trying to enforce inheritance. POSIX ACLs help, but they're strikingly poorly documented/supported.
Re:Don't Copy-Paste from Website to Terminal by sliverstorm on Sunday April 07, 2013 @08:58PM (#5509445)
It sounds like you really want BSD jails.
Re:Don't Copy-Paste from Website to Terminal by wulczer on Sunday April 07, 2013 @06:05PM (#5508969)
Re:Don't Copy-Paste from Website to Terminal by duskwuff on Sunday April 07, 2013 @06:25PM (#5509019)
Homebrew (http://mxcl.github.io/homebrew/) does largely the same thing for third-party source installs on Mac OS X.
Re:Don't Copy-Paste from Website to Terminal by NelsonMinar on Sunday April 07, 2013 @07:08PM (#5509129)
To be fair to Homebrew (the example I'm picking on here), it does install to a nice sandboxed area. That area is named "/usr/local", but you can give it its own path and everything works pretty well. (I find I have to completely remove and reinstall Homebrew about every two months, generally because libgettext changed yet again.)
Re:Don't Copy-Paste from Website to Terminal by charlieok on Sunday April 07, 2013 @08:15PM (#5509330)
Homebrew is ok, and it has arguably improved the situation on Mac OS X a great deal, but I think we can do better still.

Using homebrew, one tweaks recipes in ruby code until they work.

Why do we not have a common (and widely adopted!) way for software projects to tell other software how to install/uninstall them, and what other projects they depend on for what particular operations (e.g. configure, build, install, test etc), with reusable data rather than code.

Why is (some of) this information captured in bits of ruby, useful for a particular OS X package management system, but not when you want to deploy a similar stack to a IaaS provider where you'll use a different incompatible system like Puppet or Chef to set up the same stuff.

I think we have made this whole situation more complicated and fractured than it needs to be.

Re:Don't Copy-Paste from Website to Terminal by ricardobeat on Sunday April 07, 2013 @09:09PM (#5509476)
Code is reusable data, and regardless of language is much more useful than an arbitrary data format. There was an attempt to port homebrew to linux, but it didn't go far.

dotCloud has just open-sourced Docker[1], an attempt at solving the deployment issue.

[1] http://docker.io

Re:Don't Copy-Paste from Website to Terminal by Thrall on Monday April 08, 2013 @06:08AM (#5510855)
> There was an attempt to port homebrew to linux, but it didn't go far.

Linux already has more package managers than you can shake a stick at. To gain traction on linux, homebrew would have to offer useful features that other package managers don't have. Even then, people are more likely to copy the features into an existing linux package manager.

I don't think people tend to shop around when it comes to package managers; you use whatever your distro provides. If it sucks, you find a better distro or submit patches, depending how involved you are.

Re:Don't Copy-Paste from Website to Terminal by dasil003 on Monday April 08, 2013 @11:08AM (#5512129)
I don't know why anyone would want Homebrew on Linux anyway. The whole point of it is that OS X is a mostly-serviceable UNIX without a decent package manager. So if you have a handful of UNIX packages you just want a lightweight way to install them using the system headers where applicable.

But if you need to install tons of stuff the cracks start to show, because you have no conflict resolution or sophisticated versioning. Linux leans heavily on its package managers, so I just don't see what Homebrew has to offer.

Re:Don't Copy-Paste from Website to Terminal by ricardobeat on Monday April 08, 2013 @06:23PM (#5515064)
Homebrew formulas are much more frequently up-to-date than other package managers due to the crowd-sourced pull-request updates - there isn't a package mantainer that has to do all the work. Formulas are straight-forward and don't have a million conditionals for different system configurations (this would be hard to maintain on linux). These two things already make it much more pleasant to use than apt-get/yum/pacman.
Re:Don't Copy-Paste from Website to Terminal by dasil003 on Tuesday April 09, 2013 @04:21AM (#5516986)
Yes, I am familiar with homebrew and use it every day including submitting pull requests back. However you missed the point of my comment. The point is, it's more pleasant until you run into a conflict which existing Linux version managers tend to handle much better (out of experience and necessity). At that threshold of complexity you need something more sophisticated than homebrew to avoid pulling your hair out. OS X benefits from a certain homogeneity that puts homebrew in a sweet spot.
Re:Don't Copy-Paste from Website to Terminal by voltagex_ on Tuesday April 09, 2013 @03:02AM (#5516818)
Homebrew seems more akin to Arch's PKGBUILD or Gentoo's ebuilds than other package managers.
Re:Don't Copy-Paste from Website to Terminal by talex5 on Tuesday April 09, 2013 @07:04AM (#5517311)
I don't know about "widely adopted", but we do have a common language for expressing how to build/install/test software across Linux, Unix, Windows and OS X:

http://0install.net/interface-spec.html

The tools to read this are in most Linux distribution repositories already (usually under the name "zeroinstall-injector"), and do dependency resolution, conflict resolution (via a SAT solver), GPG signature checking, etc. And each package unpacks to its own directory, so they don't interfere with system packages.

Re:Don't Copy-Paste from Website to Terminal by csense on Sunday April 07, 2013 @08:57PM (#5509442)
That's not a sandbox. If you have ten programs installed in /usr/local, and you want to uninstall one of them, rm -Rf /usr/local is not the tool for the job. (At least on Linux. I'm assuming UNIX-like Macs are the same.)
Re:Don't Copy-Paste from Website to Terminal by NelsonMinar on Sunday April 07, 2013 @09:10PM (#5509480)
Like I said, Homebrew installs in its own directory pretty well. I chose /usr/homebrew, explicitly so I can rm -rf. I think for most Homebrew users their Macs have nothing else in /usr/local and so that's why it's not an unreasonable default.
Re:Don't Copy-Paste from Website to Terminal by cmsj on Monday April 08, 2013 @04:15AM (#5510513)
Changing the prefix still doesn't mean that each app is sandboxed. That is what the parent comment was talking about.

You can't do rm -rf /usr/homebrew/$SOMEAPP/ and know that it is all gone.

Re:Don't Copy-Paste from Website to Terminal by ricardobeat on Sunday April 07, 2013 @09:06PM (#5509469)
Homebrew actually uses /usr/local/Cellar, so rm -Rf /usr/local/Cellar/pypy is what you'd want, except that it won't remove symlinks to /usr/bin, launch scripts and such; you still need some kind of uninstall script (brew uninstall).
Re:Don't Copy-Paste from Website to Terminal by arjunbajaj on Sunday April 07, 2013 @05:38PM (#5508884)
I would love to use such a thing!

I'm bugged with programs I don't use anymore which start on system boot. Even after removing some programs, they just don't go away.

A sandboxed environment would be really good to use!

Re:Don't Copy-Paste from Website to Terminal by laumars on Sunday April 07, 2013 @06:15PM (#5508991)
That's just bad administration as even on Windows, you can easily disable them (msconfig). With Linux, this isn't even an issue unless you're blindly installing dozens of daemons (which, again, can easily be disabled) as Linux doesn't have hundreds of application launchers that install themselves like Windows does (again, daemons being the exception).

The only example I can think of where you might run into problems is if your desktop environment is doing some weird sessions. But that's usually fixed pretty easily in the system settings for whatever desktop environment you're running.

This is all pretty basic stuff; you shouldn't need a sandboxed environment to prevent applications from auto-launching unless you're going around installing malware (and if you are deliberately installing malware on your main bare-metal OS, then you're insane).

Re:Don't Copy-Paste from Website to Terminal by dredmorbius on Sunday April 07, 2013 @11:15PM (#5509813)
> With Linux, this isn't even an issue

That's a problem systemd is trying very hard to solve.

/sarcasm

SysV init may be old, crufty, and inelegant, but it's reasonably straightforward to parse and troubleshoot manually (and BSD-style rc inits are even more straightforward). Making the bootstrap process nondeterministic strikes me as tremendously unwise.

Re:Don't Copy-Paste from Website to Terminal by fein on Monday April 08, 2013 @12:21AM (#5509965)
I agree here. I really enjoyed the explicit control granted by sysV. The switch to systemd just seems like fixing something that isn't broken.

I will probably be proved wrong as systemd matures, but right now it's just not the case.

Re:Don't Copy-Paste from Website to Terminal by apotheon on Monday April 08, 2013 @04:28AM (#5510560)
> I will probably be proved wrong as systemd matures, but right now it's just not the case.

Yeah . . . I doubt it. I made the switch to FreeBSD as my primary OS of choice back in 2005 or 2006 without being 100% certain why I decided to try to live on BSD Unix pretty much full-time right then (there were reasons, but I think the timing of the migration was largely whim). I never even missed the Linux world for the next half decade or so. I then tried living with Debian again for a while (long story why), and I discovered that everything of substance that had gone on in the Linux world since then seemed almost tailor-made to annoy the shit out of me. It was a real shock that destroyed the fondness I still harbored for Debian.

I poked around at some other Linux distributions I hadn't tried, or handn't used in years, and discovered they were even worse -- and systemd is sorta the apotheosis (no relation) of exactly the sort of nondeterministic, "the software knows better than the user" BS that I remembered with severe loathing from my distant past primarily using (and fixing, for a living) MS Windows. Between Red Hat developers like Drepper and Poettering, the agenda of Canonical and Ubuntu, and the GNU project's strange synthesis of superficially opposed concepts like stagnation and invidious undermining of anything related to the (so-called) Unix philosophy of system design, I ultimately came to the conclusion that outside of a professional capacity (that is, writing code and/or managing servers, and that only if I'm paid) I'm simply not interested in screwing around with Linux-based systems any longer.

Your tolerance may be higher than mine but, given your comment about what you dislike about systemd, I rather suspect you'll only grow more frustrated with the direction of Linux development community efforts over time. You might want to think about diversifying your OS experience in the near future (if you haven't already) so you have a place to ready and waiting for you to go when the Linux world has finally pushed you to the point of just wanting to escape.

Re:Don't Copy-Paste from Website to Terminal by laumars on Monday April 08, 2013 @03:53AM (#5510466)
100% both those comments.

I used to be a huge ArchLinux fan but them switching away from their rc.conf model to systemd felt like a real kick in the teeth.

Re:Don't Copy-Paste from Website to Terminal by apotheon on Monday April 08, 2013 @04:30AM (#5510570)
Yeah . . . it looks like Arch has gotten to the point where it just kinda violates all the points of the so-called Arch Way wholesale, even worse than the mainstream (supposedly) Unix-like OSes tend to violate the so-called Unix Philosophy these days.
Re:Don't Copy-Paste from Website to Terminal by trotsky on Monday April 08, 2013 @03:14PM (#5513820)
Offering a random anecdote:

I wasn't particularly aware of systemd's emergence and the squabbling that went on at the time, but I got exposed to it a gen or 2 after it first hit fedora through a fedora centric project. At first I was non-plussed and sort of annoyed that I didn't know how things worked, and primarily relied on the compatibility bridge with service that worked well enough.

At one stage I ended up having to do some tweaking with rc init scripts would have required a fair amount of haks (in the pejorative sense) and since these wouldn't work in systemd i decided it was the time to get to know it.

It only took me a couple of hours to get a good overall sense of the system and mindset, and the minor things I needed to get accomplished ended up being much cleaner in systemd once I "got it".

Once I had a good new mental model of it, I found that I liked working with systemd much more than the old guard. Ignoring the technical and performant advantages, I find the framework for discovering and resolving problems to be much more effective and easy to deal with once you got over the hump of the confusing bits of information overload and changed grammars.

I've never been a huge fan of Lennart Poettering in the way that he seems to optimize for friction in certain communities, but I think systemd is a real step forward and we need people like him to drag up forward kicking and screaming at times.

I user a lot of different posix systems day to say, and it's gotten to the point that I now groan when i have to deal with one still using a traditional init approach.

I'm not saying systemd is without issues, but if you give it some time with an open mind I think you may find out it has a lot going for it (and not just the marketing bullet points - thats part of lennart's problem)

Re:Don't Copy-Paste from Website to Terminal by nitrogen on Sunday April 07, 2013 @09:02PM (#5509454)
This may have been true 5-10 years ago, but modern desktops are removing the ability to manage services, sessions, and startup apps easily and clearly.
Re:Don't Copy-Paste from Website to Terminal by cmsj on Monday April 08, 2013 @04:21AM (#5510546)
To be fair, some of this is driven by real needs. People want fast boots, so you have to work tightly in parallel. That requires a clear and complex dependency graph. That requires significantly more than some symlinks in /etc/rc?.d/. Also as distros aim to pare down their default installs, you end up in a situation where there is very little that you actually can disable without breaking your ability to boot.

Furthermore, given typical CPU/RAM overheads on modern hardware, disabling something that takes a fraction of a second to start and consumes almost no RAM can seem slightly pointless!

I'm not familiar with systemd, but upstart takes a similar approach to sysvinit - don't want something to start? Just move it out of /etc/init/ like you would have rm'd the symlink in /etc/rc?.d/ :)

Re:Don't Copy-Paste from Website to Terminal by nitrogen on Monday April 08, 2013 @08:07PM (#5515593)
I'm referring more to the GUI sessions, startup apps, etc. It seems when I first started using Linux, most of the DEs made it very clear how to edit menu entries, where startup apps were located, what data and apps were restored when a session was restarted... At least in the Ubuntu variants, those options are less obvious.
Re:Don't Copy-Paste from Website to Terminal by cmsj on Tuesday April 09, 2013 @12:43PM (#5519306)
Ah right, then yeah, that stuff is now pretty opaque and has changed a bunch since the old desktop days.
Re:Don't Copy-Paste from Website to Terminal by laumars on Monday April 08, 2013 @03:46AM (#5510450)
Unless they're blocking access to [insert your favourite terminal emulator] and deinstalling su, rm and unlink, then they are not removing any such ability.
Re:Don't Copy-Paste from Website to Terminal by jhasse on Sunday April 07, 2013 @06:06PM (#5508972)
http://www.gobolinux.org/

unfortunately it seems to be dead.

Re:Don't Copy-Paste from Website to Terminal by rits on Sunday April 07, 2013 @06:27PM (#5509026)
You can't just enable/disable software if it depends on other software or vice versa. But your package manager may have facilities for that, like Nix [ http://nixos.org/ ].
Re:Don't Copy-Paste from Website to Terminal by thatthatis on Tuesday April 09, 2013 @12:39AM (#5516469)
Like regularly backed up virtual machines?
Re:Don't Copy-Paste from Website to Terminal by peterkelly on Monday April 08, 2013 @01:42AM (#5510145)
It's called iOS
Re:Don't Copy-Paste from Website to Terminal by somesay on Sunday April 07, 2013 @04:52PM (#5508702)
You are trusting some third-party everytime you download a proprietary or just big open-source app. Even on Open Source, you just have trust in the public review.

In that example you can read the source before, the chances of an evil change just when loading it with your terminal is quite limited, MITM doesn't work that well on SSL, too.

Re:Don't Copy-Paste from Website to Terminal by rytis on Sunday April 07, 2013 @04:58PM (#5508728)
Really sad, especially when something like Chef-client is also installed in a similar fashion [0], one would expect these guys to know better:

    sudo true && curl -L https://www.opscode.com/chef/install.sh | sudo bash
[0] http://wiki.opscode.com/display/chef/Installing+Omnibus+Chef...
Re:Don't Copy-Paste from Website to Terminal by trotsky on Sunday April 07, 2013 @05:35PM (#5508880)
So you're trusting opscode to provide the primary centralized control system of your entire server ecosystem but you're concerned they might be embedding something malicious in their installer shell script?

Don't get me wrong, i'm no fan of the practice especially sans tls, but this seems like a poor example.

Re:Don't Copy-Paste from Website to Terminal by nicksergeant on Sunday April 07, 2013 @05:48PM (#5508912)
It's not that you don't trust opscode, it's that it's possible that someone could hack opscode's installer script...
Re:Don't Copy-Paste from Website to Terminal by trotsky on Sunday April 07, 2013 @05:58PM (#5508941)
just like they could replace a binary, backdoor the Makefile or hide something bad deep in the repo. And of course their hash of their signing key for their apt repo and any shasums are provided on the same webserver.
Re:Don't Copy-Paste from Website to Terminal by cmsj on Monday April 08, 2013 @04:17AM (#5510523)
Of course that is always a risk, but with most FOSS software being maintained in public revision control systems, it's difficult to truly hide something.

Even if you discard the security angle of wget | bash (which you would be a foolish choice) there is the simple problem of repeatability.

If you are deploying 50 new servers and OpsCode releases a new version of Chef after 25 of the servers have performed the wget, the next 25 will get a different client that might be incompatible with the server.

Re:Don't Copy-Paste from Website to Terminal by trotsky on Monday April 08, 2013 @03:21PM (#5513871)
For what it's worth, that curl install is a "beachhead" install. When you provision servers you load chef on them using knife bootsrap, which carefully ensures it installs the revision of chef on the server that you're using on the management workstation. You have to go out of your way to get a brand new release installed on a node if you haven't installed it on your workstation.
Re:Don't Copy-Paste from Website to Terminal by FooBarWidget on Sunday April 07, 2013 @05:02PM (#5508748)
Know better... in order to do what? They also provide an APT repository, which you can choose to use instead of the curl command. The curl command exists solely for convenience, because it autodetects your OS, distro version, and automatically registers the right APT repository for you if you're on Debian.

As I've mentioned here (https://news.ycombinator.com/item?id=5508680), people often freak out at curl commands, yet at the same time I've yet to see a viable proposal for an alternative.

Re:Don't Copy-Paste from Website to Terminal by mscarborough on Sunday April 07, 2013 @05:11PM (#5508784)
Well, the downloaded bash script does all that, and a user is always free to leave the last piping-into-bash command off. They can review it first, and then run as sudo (or whoever) if it passes muster.

It's not that much different, so I don't understand the huge problem. Most likely if tutorial writers added a second step, the user would just copypasta the second step also.

Thankfully I followed this procedure after a co-worker sent me this: `curl -L http://bit.ly/10hA8iC | bash` ... was able to turn my speakers down first ;)

Re:Don't Copy-Paste from Website to Terminal by laumars on Sunday April 07, 2013 @06:26PM (#5509023)
That's one of the better rickrolling I've seen!

One of my mates rickrolled me by post (aka snail mail) just days after I moved house. It took me 2 years to find out who was behind that.

Re:Don't Copy-Paste from Website to Terminal by cmsj on Monday April 08, 2013 @04:24AM (#5510550)
Allow me to show you a viable proposal for an alternative:

http://manpages.ubuntu.com/manpages/precise/man8/apturl.8.ht...

Re:Don't Copy-Paste from Website to Terminal by FooBarWidget on Monday April 08, 2013 @07:23AM (#5511051)
As I've mentioned in https://news.ycombinator.com/item?id=5508680, for any alternative to be viable it must "work on all major platforms". APT is only used in Debian derivatives. How do you want to handle OS X users?
Re:Don't Copy-Paste from Website to Terminal by cmsj on Tuesday April 09, 2013 @12:42PM (#5519299)
Give them a DMG?

It would be lovely if there was a One True Software Distribution Format, but it's not going to happen. wgetting into a bash script is a terrible way to not really support any users properly :)

Re:Don't Copy-Paste from Website to Terminal by FooBarWidget on Friday April 12, 2013 @05:53AM (#5537498)
Neither is it going to happen that every developer spends considerable resources on creating packages for every platform. Just look at the popularity of curl installs, or even at the number of developers who don't bother to provide binaries and stick to source tarballs.
Re:Don't Copy-Paste from Website to Terminal by q_revert on Sunday April 07, 2013 @04:41PM (#5508661)
one of the recommended ways to install oh-my-zsh

   wget --no-check-certificate https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh
Re:Don't Copy-Paste from Website to Terminal by fnordfnordfnord on Sunday April 07, 2013 @04:57PM (#5508725)
Don't forget 'sudo'!
Re:Don't Copy-Paste from Website to Terminal by zsiciarz on Monday April 08, 2013 @03:28AM (#5510404)
You don't need sudo as this is your user's shell.
Re:Don't Copy-Paste from Website to Terminal by anonymoushn on Sunday April 07, 2013 @04:38PM (#5508655)
I was quite surprised when this was the normal way of installing rvm:

https://rvm.io/rvm/install/

Re:Don't Copy-Paste from Website to Terminal by SkyMarshal on Sunday April 07, 2013 @07:39PM (#5509225)
Re:Don't Copy-Paste from Website to Terminal by Zr40 on Sunday April 07, 2013 @08:12PM (#5509323)
For me, the method of installation is one of the less important reasons why I started using rbenv instead of rvm. rbenv's simplicity and speed appealed to me, and the trigger for switching was rvm destroying itself again (or otherwise rendering itself unusable) after updating it.
Re:Don't Copy-Paste from Website to Terminal by nkvoll on Sunday April 07, 2013 @04:42PM (#5508665)
Are you going to type that string into your terminal manually, or are you just copy/pasting that line from a web page, still leaving yourself open to this issue?

I find it hard to believe anyone will be reading that line on a web page, then typing it out correctly in their own terminal instead of just saying, "ok that line looks fine copy paste"

Re:Don't Copy-Paste from Website to Terminal by hac on Sunday April 07, 2013 @05:28PM (#5508850)
I might copy the command, quickly paste it in my URL bar to make sure it is indeed what I expected, and then paste it into Terminal
Re:Don't Copy-Paste from Website to Terminal by Kiro on Monday April 08, 2013 @02:50AM (#5510312)
I don't understand what this has to do with copying or pasting at all. I would still copy-paste it.
Re:Don't Copy-Paste from Website to Terminal by ivix on Sunday April 07, 2013 @04:28PM (#5508607)
Why would you say that is industry practice when it is not?
Re:Don't Copy-Paste from Website to Terminal by carb on Sunday April 07, 2013 @04:37PM (#5508652)
It's the suggested install for homebrew. http://mxcl.github.io/homebrew/
Re:Don't Copy-Paste from Website to Terminal by FooBarWidget on Sunday April 07, 2013 @04:46PM (#5508680)
There are legit criticisms against the copy-paste-curl-command style of installations. But on the other hand, I've yet to see a critic proposing a viable alternative. With viable I mean that said proposal must:

1. Work on all major platforms.

2. Be easy for the developer to create.

3. Be easy for the user to execute, with as few steps as possible.

There are those who advocate that the developer should create a platform-specific package for every platform. While this fits their purist views in which only their own platform matters, this is not a good solution for the developer, who often has users from multiple platforms. Creating platform-specific packages places an unbelievable maintenance burden on the developer.

This is not to mention that platform-specific packages, too, have their own security flaws.

Re:Don't Copy-Paste from Website to Terminal by NelsonMinar on Sunday April 07, 2013 @07:10PM (#5509137)
The most viable alternative is "apt-get" which provides simple downloads from a central package repository with signature checking. I believe pip and cpan are comparable. In this case I'm picking on homebrew, and the quoted curl command is the command to install that very package tool. The brew package manager does some lightweight checksum verification on subsequent downloads.
Re:Don't Copy-Paste from Website to Terminal by FooBarWidget on Monday April 08, 2013 @07:24AM (#5511054)
And apt-get directly violates point 1, "must work on all major platforms". APT is not widely used on e.g. OS X, Red Hat derivates, etc.
Re:Don't Copy-Paste from Website to Terminal by NelsonMinar on Monday April 08, 2013 @10:14AM (#5511765)
I look forward to you boiling the ocean. (Sadly, the only reason I know about this Homebrew stuff at all is that the APT-based Fink, for MacOS, is not very popular.)
Re:Don't Copy-Paste from Website to Terminal by Scaevolus on Sunday April 07, 2013 @05:15PM (#5508799)
The only difference between "wget | sh" and "download and run our installer" is that you could inspect the installer before running it. You can still do that, "wget | sh" just simplifies the process for most users.
Re:Don't Copy-Paste from Website to Terminal by FooBarWidget on Sunday April 07, 2013 @05:26PM (#5508847)
You can also inspect the wgetted/curl'ed script if you so choose. It's just a URL. I don't understand your point.

Even with the "exploit" in the article, it will be detected as soon as the user pastes the URL in his browser location bar. People who don't inspect what they run are screwed no matter what.

Re:Don't Copy-Paste from Website to Terminal by tiredofcareer on Sunday April 07, 2013 @06:00PM (#5508954)
The point, especially in a non-SSL environment, is not that you're not trusting Opscode or Homebrew. It's that a malicious attacker has a vector, because he knows people will be doing something with that URL.

If I own Opscode and I'm smart, I plant something like this on that URL:

    if request.user_agent.startswith("Curl or wget or..."):
        return deliver_malicious_script(request)
    return deliver_everything_is_fine_script(request)
Nearly everybody's workflow for "checking" this is putting the URL in your bar, looking at it, then jumping over to terminal and running it. (Sounds suspiciously like what you just described.) I just owned that with three lines of effort.

We can do this dance all day where people point out specifics, or we can all just recognize it's a bad idea (a lot of people are saying it's a bad idea; might be worth considering it's a bad idea).

Re:Don't Copy-Paste from Website to Terminal by webreac on Monday April 08, 2013 @03:39AM (#5510430)
I like very much the "copy-paste-curl-command style of installations" because it is as simple as possible, and it invites to be more creative during installation. I do not envisage to perform a copy-paste-curl-command installation, except perhaps in a not throw away VM. I generally perform the curl toward a temporary file, read the file and if it does look suspicious, I do not run it.