News for hackers. Stuff that matters.
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