8 ms·
Don't tug on that, you never know what it might be attached to
- davidu 10y agoI read this, but seemed to skip over the part where he explains why this changed suddenly, when the behavior was documented? What changed to make the perl become capable whereas previously it lacked the low port capability?
- lmz 10y agoThat seems to be a site-specific configuration.
- ars 10y agoHe usually started emacs directly. In this case he started emacs via a perl command, very very indirectly. Also, a recent change was an admin setting TMPDIR, previously it had been left unset. So it was a combination of two things that triggered it, and not one alone.
- raarts 10y ago> So it was a combination of two things that triggered it, not one alone And this basically sums up all the troubleshooting time sinks I've experienced in my career.
- mjd 10y agoThat is a good point. I still don't know the answer to that! I _think_ it's that the sysadmins added the new capability to Perl sometime in the last few weeks, and the the problem then didn't appear until after the next time I reloaded the system configuration. I will confirm this with the sysadmins and add it to the article. Thanks!
- mjd 10y agoI checked with Frew on this, and we still don't know the answer.
- userbinator 10y agoGreat debugging, and an example of the sort of behaviour that long dependency chains can expose. Or rather, I did until this week, when it suddenly stopped working. When this happens to me, the first thing that I ask myself is "what changed?", and I'm usually able to track down the cause to some configuration change. Incidentally, this is also why I never like modifying a working system unless it's absolutely necessary. The fact that it ultimately was caused by some security features that would be very important for a multiuser shared server but nearly irrelevant for the (presumably) single-user local machine that he is using suggests that perhaps we shouldn't be thinking of "one size fits all" paradigm for OSs, since a lot of problems like this one stem from the unnecessary extra complexity introduced by such thinking.
- gohrt 10y ago> this is also why I never like modifying a working system unless it's absolutely necessary. this is safe, but it paints you into a corner over time, where you become paralyzed and can't improve anything. Needs better testing, so changes are safe.
- xyience 10y agoTests don't magically make changes safe or give the confidence to make changes.
- tamana 10y agoNo, they scientifically make changes safe and give confidence to make changes.
- TeMPOraL 10y agoDo you think that, in case of the problem from this article, Perl devs should have had a test checking if their update doesn't break someone's Emacs when they try to use it in client-server mode, launching one via a Perl script and other via some other means, on a Linux with "capabilities" feature? This story wasn't about trivial day-to-day developer bugs, but what kind of problems happen in really complex systems.
- kr0 10y agotl;dr Don't use unnecessary amount of scripts and tools to do what vim + git do just fine.
- mort96 10y agoWhy even bother to learn programming if you can't use it to automate common tasks?
- lfowles 10y ago> This computer stuff is amazingly complicated. I don't know how anyone gets anything done. Indeed.
- elliotec 10y agoQuote of the day for sure.
- venomsnake 10y agoMostly by accident.
- mturmon 10y agoIn particular, the set of exported shell environment variables is a sinkhole of state that can potentially affect every program we run.
- gosub 10y agoIf only we had a way to deal with state without it being mutable...
- vacri 10y agoWhen me and my colleagues are tearing our hair out over a problem, I'll often exclaim "These computer things are hard!". It's delivered both as a joke, and also a reminder that it's okay to take a while to figure out the problem in a particularly complex system. Eases the tension a touch.
- GavinMcG 10y agoThis drives home the point that (almost) no one actually knows the details of their full stack.
- digi_owl 10y agoAnd that present day computing is damn hard to reason about, because oh so much happens silently in the background.
- krylon 10y agoAs a sysadmin on a Windows network of ~100 computers, this story makes me want to cry, although maybe for the wrong reason: I see weird problems of the sort "It did work before I went on my lunch break" on a fairly regular basis. How often would I like to go down the rabbit hole and explore these problems in such depth, but if I did that, I would hardly get any work done. The frequency at which our users run into these problems is just too high. It is so frustrating so restart a computer or maybe re-install it and see the problem disappear, because now all hope to understand what caused the problem in the first place is gone. And problems that disappear for no good reason have a tendency to return for no good reason, most often on a Friday afternoon, just when you're about to call it a day. ;-/
- 616c 10y agoI am in a similar boat. With DSC, I am increasingly excited with the idea end user computers can also shift to immutable, or approaching what we call immutable, infrastructure that has logically valid weight in the communities represented here. The problem? Culture. So many people do not understand when I say the following things: - Do not install with the GUI, please use the deployment system to document unattended installation. - You should not have to log into a computer and manually install and customize things, especially if you forget to document. - You should not be doing things, install, configuration change, with following this AND updating the team in your notes, so when I ask you, you in fact remember. These things are the product of less fires, as I see it, and why I too have to re-image everything (although is largely out of concern for any malware, especially with the majority of our userbase).
- tikhonj 10y agoHonestly, this is what got me most excited about NixOS. I mean, the underlying technology is spiffy, of course, but the real key is that it lets you configure everything declaratively while keeping track of different versions and actively pushes you in that direction. Doing things the "right" way is also the path of least resistance. Sometimes this is a bit annoying when you just want something to work but can't just hack it because the system files are hidden all over the place and papered over with symlinks, but in the long run it means your system configuration is way easier to maintain.
- wtbob 10y agoWhat's funny is that in this case the dynamic loader was sanitising something irrelevant to the actual capability granted, which seems to me should be a bug. Also, I'll be an advocate for just starting emacs with systemd, and never worrying about it again.
- JoshTriplett 10y ago> What's funny is that in this case the dynamic loader was sanitising something irrelevant to the actual capability granted, which seems to me should be a bug. EDIT: fixed incorrect description of the yak-shaving conclusion. The dynamic loader did so because it ran with an extra capability that the user invoking it didn't already have. Most of that sanitizing exists to prevent the user from gaining those privileges themselves by invoking a more privileged program, such as by setting LD_LIBRARY_PATH. Sanitizing TMPDIR prevents a somewhat different class of vulnerabilities, such as using those extra privileges to write to files you normally couldn't. However, I don't think it makes sense to have a complex special case like "if you only have one of this subset of extra privileges, allow TMPDIR but don't allow all the other potentially dangerous environment variables"; that adds a significant amount of complexity and subtlety to already security-sensitive code. Giving /usr/bin/perl itself extra capabilities effectively grants them to every user on the system, since you can use Perl to run arbitrary code. At that point, it would make more sense to just allow all non-root users to bind to arbitrary ports. I'm somewhat surprised that there isn't a sysctl to disable the reservation of ports 0-1023.
- eridius 10y agoNo, it was the dynamic loader that did the sanitizing. Mark said that he thought of Perl's sanitizing, and had ruled it out, and then explicitly said it was the dynamic loader that did the sanitizing in this case.
- JoshTriplett 10y agoThanks for the correction; fixed. I misremembered that bit of the yak-shaving adventure when I went to write my comment. The conclusion still holds, though: I don't think special-casing particular capabilities makes sense. And in the case of the dynamic linker, it doesn't actually have that information available; it relies on the AT_SECURE bit set in the process's "auxiliary vector" (see "man getauxval"), which the kernel sets when the process has any privilege its caller didn't have.
- seany 10y agoNo reference to the full quote? :) "You can check your anatomy all you want, and even though there may be normal variation, when it comes right down to it, this far inside the head it all looks the same. No, no, no, don't tug on that. You never know what it might be attached to. " - Buckaroo Banzai
- krylon 10y agoWhich reminds me, I have to re-watch that movie!
- eridius 10y agoFantastic movie. I don't remember that quote though. My go-to quote has always been "Remember, no matter where you go, there you are."
- Animats 10y agoThe movie is quoting that from a neurosurgeon. I first saw that line in a book about the Massachusetts General Hospital.
- seany 10y agoIn the movie the lead character is also the neurosurgeon :)
- ivank 10y agoEnvironmental variables have caused some of my more troublesome debugging experiences: 1) On Windows, VisualVM not being able to find the IntelliJ IDEA process I had running. This happened because IDEA was started with Launchy, which had a different TMP directory set, because I used both RDP and the Console, or something. 2) On Linux, ibus IMEs not working at all in my browsers; happened because I was starting them in a tmux, and the tmux server was started in my previous login session, so the DBUS_SESSION_BUS_ADDRESS in the tmux was stale.
- makecheck 10y agoYou should definitely tug on things when you have a controlled test environment and the time to explore what-ifs. Much like companies should try to replace their own products (before a competitor does), infrastructure teams need to force “predictable” upgrades in a controlled environment on a regular basis. For example: look at your dependencies, imagine what upgrades are likely to be required in the near future, and try making those upgrades on test systems to see what could go wrong. That approach achieves three things. One, since you’re not in emergency mode and you’ve used a test environment, any problems that you do uncover are not going to cause a crisis. Two, if you do this semi-regularly then you’re likely to see only minor issues. Third, exploratory upgrades give you a lot of time to fix problems (whether it’s time for your own developers to make changes, or time to wait for an external open-source-project/vendor to make changes for you).
- deleted 10y ago[deleted]
- chris_wot 10y agoI almost hesitate to say this, but it seems to me that emacs needs a new command line parameter to allow the user to specify the location of the socket file.
- catern 10y agoIn case you're talking about emacsclient, that has one, --socket-name, as the article says. If you actually are talking about "emacs" and not "emacsclient", then the argument you want is --eval '(setq server-socket-dir "/what/ever")'
- carterehsmith 10y agoI did not quite get why is he starting emacs with "git re-edit" with re-edit being some Perl script. What is the role of git in this setup?
- borkabrak 10y agoJust that, when you run '$ git nonstandard-subcommand', then the git executable looks for anything executable in the path that is named 'git-nonstandard-subcommand'. Then it runs it. That's all. But at that point, git could have been doing something to the environment before invoking the custom script.
- fchopin 10y ago> This computer stuff is amazingly complicated. I don't know how anyone gets anything done.
- CoconutPilot 10y agoThe problem with "newish" features like capabilities, file attributes, SElinux is they haven't been integrated into the traditional nix utilities and almost nobody knows what is going on with them. A few examples of the poor integration: File attributes override the nix permissions such that you can set the immutable flag on a file and even root can't modify it. `chattr +i FILENAME && rm FILENAME` On distros that use capabilities copying a file doesn't copy capabilities by default. ie copy the ping program and it wont work unless you're root. When SElinux blocks an action the error message is almost always wrong. ie A program tries to make a TCP connection which it doesn't have permission for. Instead of an error message like "SElinux violation" you get an error like "No route to host". To debug you need to look at the SElinux audit.log and try to match up timestamps of violations to when your program died.
- vilhelm_s 10y agoChris Siebenmann has been arguing for a long time that SELinux should have it's own error code. (https://utcc.utoronto.ca/~cks/space/blog/linux/SELinuxSecurityErrno https://utcc.utoronto.ca/~cks/space/blog/linux/SELinuxSecuri...) It seems like a good idea to make it more user friendly.
- GavinMcG 10y agonix formatting suggests that the asterisk in nix needs to be escaped. Apparently on HN that requires putting a space after the * though, so you end up with * nix.
- digi_owl 10y agoApparently HN's markdown implementation is supposed to leave the * alone as long as here is not another the other end. But there seems to be no upper limit to where that end may be. Also, it seems to only check if the * is near something else, not if it is before or after. Nor if the after is after a before (if that made any sense at all).
- dozzie 10y ago
- dataharry 10y agoThe real question is why in the world you'd move tmp.
- legulere 10y agoA pretty good showcase that the more features you have the harder it is for them to keep working correctly together.
- digi_owl 10y agoIn the end it seems that all complexity stems from trying to enforce access privileges on a system that do not gives a rats ass about anything beyond 0s and 1s. IF we want to avoid said complexity we basically have to go back to running only one process at a time, loaded directly from dedicated, removable, storage when needed.