Search Results: "ag"

16 January 2009

Joey Hess: little known fact

An apparently little known fact about dpkg is that it clears suid bits when upgrading packages. This defeats the hardlink-a-suid-binary-and-wait-for-exploit attack that used to be a worry, and which apparently still is to some.
joey@gnu:~>ln /usr/bin/sudo
joey@gnu:~>dir sudo
-rwsr-xr-x 3 root root 112K Jul  6  2008 sudo*
joey@gnu:~>sudo apt-get --reinstall install sudo
Reading package lists... Done
[...]
Get:1 http://ftp.egr.msu.edu unstable/main sudo 1.6.9p17-1 [177kB]
Fetched 177kB in 1s (91.0kB/s)    
Created commit e5523fe: saving uncommitted changes in /etc prior to apt run
 1 files changed, 14 insertions(+), 0 deletions(-)
(Reading database ... 167780 files and directories currently installed.)
Preparing to replace sudo 1.6.9p17-1 (using .../sudo_1.6.9p17-1_i386.deb) ...
Unpacking replacement sudo ...
Processing triggers for man-db ...
Setting up sudo (1.6.9p17-1) ...
joey@gnu:~>dir sudo 
-rw------- 1 root root 112K Jul  6  2008 sudo
dpkg has done this since version 1.10.18.1, released in 2004. PS, Can any rpm users tell me if rpm does this? PPS, If you find yourself making statements like "While noexec is only a weak defense, it gives a little bit more protection", you are probably not really talking about security, but instead about a warm fuzzy feeling. PPS, If shellcode can create a suid root executable, it can create it in /root or some other directory that is not mounted nosuid.

Michal Čihař: Gammu test version 1.22.91

After another week, new Gammu testing version is out. The biggest change is integration of python-gammu into Gammu. This makes easier to test everything together and new tests revealed lot of bugs and memory leaks which were immediately fixed. Besides these changes, Windows Service support has been fixed and added possibility to run more SMSD instances. You can download from usual place: http://cihar.com/gammu/, Debian users will find packages in experimental soon.

Petr Rockai: darcs 2.2.0

I am happy to announce general availability of darcs 2.2.0. Getting the release For this release, we have decided to provide two flavours, depending on the build system used:
  1. The source tarball, http://www.darcs.net/darcs-2.2.0.tar.gz, which can be built using the traditional autoconf-based system. This is the fully supported version. After downloading and unpacking, you can issue:
    $ ./configure
    $ make
    
    and possibly
    # make install
    
    More detailed instructions inside the tarball (file README). Please note that we had at least one report of build failure, with quickcheck-related message. The currently best workaround, if this happens to you, is to use the cabal version of the package instead, see below.
  2. Cabalised source. You can either download a tarball from http://hackage.haskell.org/packages/archive/darcs/2.2.0/darcs-2.2.0.tar.gz and build manually (see the build instructions in README inside the tarball), or, alternatively, you can use cabal-install to obtain a copy:
    $ cabal update
    $ cabal install darcs
    
    This will give you a darcs binary in ~/.cabal/bin you should probably add that to your PATH.
In addition to source tarballs, we expect binary packages for various UNIX platforms will be available in due time. For Windows users, Salvatore Insalaco has prepared a binary build, available from http://homepage.mac.com/kirby81_it/darcs/darcs-2.2.0-win1.zip. You just need to unpack the directory somewhere and add it to your path (if you like). Moreover, an experimental TortoiseDarcs release for darcs 2 has been made available by Kari Hoijarvi and is looking for home. It can be found at http://datafed.net/darcs (unfortunately, at the time of this writing, the site seemed unreachable If you can help with hosting, please mail Kari.) What s New The summary of changes since version 2.1.2 (released last November) follows: And a summary of issues that have been fixed in darcs since version 2.1.2 (compiled by Thorkil Naur): 525 amend-record => darcs patches show duplicate additions
971 darcs check fails (case sensitivity on filenames)
1006 darcs check and repair do not look for adds
1043 pull => mergeAfterConflicting failed in geteff (2.0.2+)
1101 darcs send cc recipient not included in success message
1117 Whatsnew should warn on non-recorded files
1144 Add darcs send in-reply-to or header In-Reply-To: x@y.z
1165 get should print last gotten tag
1196 Asking for changes in /. of directory that doesn t exist gives changes in entire repo
1198 Reproducible mergeConflictingNons failed in geteff with ix
1199 Backup files darcs added after external merge
1223 sporadic init.sh test failure (2.1.1rc2+472)
1238 wish: darcs help setpref should list all prefs
1247 make TAGS is broken
1249 2.1.2 (+ 342 patches) local drive detection on Windows error
1272 amend-record not the same as unrecord + record
1273 renameFile: does not exist (No such file or directory)
1223 sporadic init.sh test failure (2.1.1rc2+472) I would like to thank all contributors for making this release possible. Future The next release will be 2.2.1, fixing low-risk issues found in 2.2.0, or those that have been excluded for 2.2.0 due to freeze. This release will appear in two or three weeks time, depending on circumstances. The next major release will be 2.3, due in June or July this year. The focus of this release will be new features and further work on performance. Moreover, we expect that it will use Cabal as its default build system and will make first steps towards sustainable libdarcs API.

Bernhard R. Link: Multiple filesystems for the paranoid

Given the current discussion on planet.debian.org about having only one or multiple file-systems, I just wanted to add a plea for having multiple filesystems. In my (perhaps a bit overly paranoid) eyes, having multiple filesystems is mainly a security measure. I prefer having enough partitions so that the following properties hold: Admittedly, those arguments may not be as convincing for a laptop as for a server. But I personally like to have paranoia enacted everywhere. Uniformness makes live much easier sometimes. Update: If having paranoid in the title was not enough to hint you that I do not claim a system losing a significant amount of security compared to more important measures, let it be told to you know. It's all about thinking about even the little things and taking measures where they do not otherwise harm. To get the warm fuzzy fealing I got when e.g. CVE-2006-3626 was found and my computers had nosuid for /proc already set. ;->

Wouter Verhelst: Re: On filesystem layouts

Someone posted a comment to my previous post on ACLs; and now Andrew blogs about the same question: Why don't I believe in multiple filesystems for a laptop? Andrew's arguments don't really convince me. A filesystem eating itself? That's never happened to me yet. A hard disk dying on me, however, I've had that. Since I first owned a computer with a hard disk, I think there've been 5 of them. There's only one thing you can do against that -- have a proper backup strategy. That not only protects you against losing your data due to the somewhat likely event of a hard disk dying, it also protects you against losing your data due to the somewhat unlikely event of a filesystem eating itself. On the other hand, however, a laptop hard disk is usually slow, small, and painfully so. Partitioning already-small hard disks into even-smaller partitions therefore doesn't sound like a particularly bright idea to me. Losing half a gig on unused space for /, then 400M for /usr, and 600M for /home, and another 2G for /var, or some such, is pretty stupid if you want to store a 3G file that you want to burn to disk; you have the available space, but you don't have it in one partition, so you get to do the cleanup dance. And nobody likes to do that, right? Oh, and don't try to fool me I have yet to see a laptop that's been in use for more than a few months and whose disk is not filled to all but a few gigabytes. Nobody removes files until they're out of space, and then you only remove just as much as you need to be able to do the job at hand... Occasionally, I do install server systems with multiple filesystems, and with LVM. On a server, the inability of a run-away system process (or user) to 'accidentally' fill up the root filesystem with junk is definately a life-saver. But once you have lost data, you need to recover anyway, and having partitions doesn't particularly help you in doing that. Also, servers tend to have multiple huge disks in a RAID array, so loss is less likely, and disk space is plenty; as such, the loss of 10% on the LVM overhead isn't something I care about, which it is on my laptop. But, hey, to each their own preference. I won't look at you funny for preferring multiple partitions on your laptop. Promise!

Andrew Pollock: [tech] On filesystem layouts

Wouter's post prompted me to write this... I find it particularly strange to have a single filesystem for everything, especially so on a laptop. I worked with a guy once who had the single filesystem (I think it was ext2 or ext3), and his laptop crashed, and the filesystem was trashed so badly from the crash (I remember: it was a PowerBook, so I don't know if that had anything to do with it) that it was a write-off. One of the reasons I use multiple filesystems apply just as much to a laptop as to anywhere else: loss/damage compartmentalisation. If one of my filesystems decides to eat itself, odds are I can still get the others back. Wherever I go, I tend to have a root filesystem, one for /usr, one for /var, one for /tmp and one for /home. If it's a server, I may have a separate one for /srv as well. I always use LVM, and with ext3 supporting online resizing these days (well online enlarging at least), it's not a big problem to leave some logical extents unallocated, and just grow whichever filesystem needs it as it needs it.

Michael Casadevall: Re-enginneering my network ...

As I move to having more and more machines on my internal LAN, I felt the time had finally come that I sit down, and rebuild my network to take advantage of things such as gigabyte networking, LDAP, single-user sign on, and so forth. I'm doing partially for fun, and partially because its an interesting experiment to see how Linux from an IS environment compares to a Windows 200x IS environment (one of my former jobs was a 2000/XP/2003/Vista sysadmin position).

So, here's my current network setup
blacksteel <- *wireless* ---------------------------------------------- cerberus <-> Internet
/
dawn <------ *wired*-----------------------------------------------------
/
360 <---- *wired* -----------------------------------------------------

Online machines:
cerberus - WRT51GS
backsteel - My laptop
dawn - Development machine
360 - Xbox 360, used to play media from blacksteel

Offline machines (aka, machines I have, but haven't fired up since moving:
helios (PowerMac G4)
apollo (old Dell P3)
junker (RS/6000 rescued from the dumpster, might be dead)
alexandria (NSLU2; gave up its plug for dawn)
coldfusion (Coldfire Board, might be dead; ethernet controller is faulty, but might be able to use a USB based one to breath some life into it; can't autoreboot due to built in bootloader not supporting it; and no JTAG to sanely change the default bootloader).
siren (old MacBook Pro, has a dead internal HDD, but runs fine from an external hard drive. Was my Debian test box until its HDD went to dawn)
exodius - second WRT54GS used to be part of a WDS bridge.
unnamed dev box (not here yet, but likely soon).

Of all these machines, only apollo has a wireless card which ATM is non-functional. In addition, the wired bits of my network are 100Mbps, with a g based wireless hotspot (WPA secured). Futhermore, blacksteel, helios, and siren have gigabyte ethernet. apollo has 100MBps ethernet card. alexandria and dawn have 10MBps, which is painful, especially for NFS root.

I'll drop another 1Gbps NIC into apollo, replacing its wireless card, and give dawn, alexandria, and maybe coldfusion USB based NICs once I get around to resurrecting systems (alexandria and coldfusion don't have hard drives at the moment)

What I would like to do is use an Linux-based router and replace Cerberus. Helios has two gigabyte NICs, so it will take up this duty, as well as provide DHCPv4, and radvd (for IPv6) for the internal network. It's an old computer, and has an onboard model, and its position in my apartment will be close to a phone jack; maybe I'll set it up so I can dial in from outside the LAN in case something goes down (although my phones here are VoIP based so I dunno how useful that's going to be :-)).

Another box (I might task this to apollo, or helios) will run LDAP and NFS services, providing both a netboot based installation with preseed for fast re-installation, and NFS home folders for all machines except blacksteel (unless someone knows a great solution for having a laptop sync NFS and local home folders. helios will run mail, news, and any other untrusted net facing services, with everything else shielded behind it. All machines will run IPv4 and 6.

Anyway, this is the start of my plan in a nutshell, and I intend to continue discussion as I slowly build and implement this updated setup. Wish me luck :-).

15 January 2009

Jon Dowland: autoindex flood

Oops, ikiwiki's autoindex plugin generated pages in places that got picked up in my weblog feed. Sorry for the noise.

Jon Dowland: misc

Miriam Ruiz: Chatting in Facebook via Pidgin

Instant messaging through web interfaces is not really the most comfortable thing to use. While their ubiquity is nice, and they can be used from whatever computer you want without having to install anything, for my own computer I prefer a real desktop application. Pidgin (formerly called gaim) is a multi-platform instant messaging client that supports many commonly used instant messaging protocols, so different services can be used from the same application. Being a user of many different messaging systems, I kinda use Pidgin as an abstraction layer from the services I use. Yesterday I discovered pidgin-facebookchat, a Facebook chat plugin for Pidgin and libpurple messengers, that is able to connects to the new Facebook Chat IM service without the need for an API key. It works quite well, all things considered.

Alastair McKinstry: More exoplanets: super-Earths or Neptunes ?

From Today's Astronomy & Astrophysics there were two papers from the Geneva Observatory / Grenoble team on The HARPS search for southern extra-solar planets: These are probably part of the 45 super-Earths tentively announced by M. Mayor last June at the Nantes conference on super-Earths. He showed radial-velocity diagrams for 45 or so planets in an impressive display, but only gave details of three at the time, while the rest were being peer-reviewed, etc. Now they're drip-feeding out. Interestingly, this now makes 3 out of 7 super-Earths do far discovered as being around M dwarf stars, and another multiple planetary system. It looks more like the "metallicity" relation (larger and more frequent planets around more metallic stars) seems to be more true for gas giants than terrestrial planets. Super-Earths (potentially rocky planets, though heavier than Earth) look more abundant around low mass and less-metal stars. Now, down to work examining the characteristics of these planets. Rory Barnes and colleagues at LLPL, U. of Arizona have also been looking at these three planets around HD 40307, to determine if they are super-Earths or mini-Neptunes. They have an interesting technique of modelling the tidal circularisation of the planet backwards in time, based on its current measured or estimated eccentiricity. Tidal circularisation makes the orbit of close-in planets more circular (decreasing the eccentricity, e, to zero), dumping the energy into tidal heating of the planet (and the star). Doing this for Gl 437, for example, they showed that it would be hotter than Io, with a volcanic surface and couldn't be habitable. For HD 403007b, Hence they believe the planets are not terrestrial-like, but may be more Neptune-like. So, could these planets have oceans ? Tags , , ,

Ross Burton: 3G Woes

Has anyone out there used a recent Nokia phone (E65 to be precise) as a modem with Network Manager 0.7? I can't seem to get the magic right, and get one of two failures:
NetworkManager: <info>  (ttyACM0): powering up... 
NetworkManager: <info>  Registered on Home network 
an 15 10:50:04 blackadder NetworkManager: <info>  Associated with network: +COPS: 0,2,"23415" 
  NetworkManager: <WARN>  dial_done(): Dialing timed out </WARN>
Or:
NetworkManager: <info>  Activation (ttyACM0) Stage 1 of 5 (Device Prepare) complete. 
NetworkManager: <info>  (ttyACM0): powering up... 
NetworkManager: <info>  Registered on Home network 
NetworkManager: <info>  Associated with network: +COPS: 0,2,"23415" 
NetworkManager: <info>  Connected, Woo! 
NetworkManager: <info>  Activation (ttyACM0) Stage 2 of 5 (Device Configure) scheduled..
. 
NetworkManager: <info>  Activation (ttyACM0) Stage 2 of 5 (Device Configure) starting...
 
NetworkManager: <info>  (ttyACM0): device state change: 4 -> 5 
NetworkManager: <info>  Starting pppd connection 
NetworkManager: <debug> [1232015456.962700] nm_ppp_manager_start(): Command line: /usr/s
bin/pppd nodetach lock nodefaultroute user web ttyACM0 noipdefault usepeerdns lcp-echo-failure 0 lcp-echo-interval 
0 ipparam /org/freedesktop/NetworkManager/PPP/4 plugin /usr/lib/pppd/2.4.4/nm-pppd-plugin.so 
NetworkManager: <debug> [1232015456.964964] nm_ppp_manager_start(): ppp started with pid
 29590 
NetworkManager: <info>  Activation (ttyACM0) Stage 2 of 5 (Device Configure) complete. 
pppd[29590]: Plugin /usr/lib/pppd/2.4.4/nm-pppd-plugin.so loaded.
pppd[29590]: pppd 2.4.4 started by root, uid 0
NetworkManager: <WARN>  pppd_timed_out(): Looks like pppd didn't initialize our dbus mod
ule
Anyone know what the problem could be?

Julien Blache: Antec PSU suck

How not to start your day, from the all-hardware-sucks department. For years, I ve been struggling to keep my machines quiet. I ve miserably failed for years, and pretty much gave up once I realised that the quiet parts I was looking for just did not exist. Last year, I finally found what I was looking for: I ve been very happy with this hardware for both my workstation and my filer. Well, until today. No need to mention that this hardware is not exactly cheap, but the price is right for the quality. So, wake up today, do random things, grab my TomTom, unplug it from the workstation it s sucking its power from, do things, plug it back in the USB port so it won t draw its battery. This is how it went: Check machine temp, PSU temp, attempt to restart PSU, check UPS, check cables, replace power cable and bypass UPS. Admit defeat for this round and accept the PSU as dead. Pull out the machine, rip out the fscking damn PSU. Grab the tools, crack the PSU open. Notice bulging and leaking capacitors. Yes, this PSU is anything but cheap, yet it uses el-cheapo chinese capacitors. Antec, you suck, big time. For the past decade everybody in the industry has known that el-cheapo chinese capacitors manufactured after 1999 are total crap, using an electrolyte that isn t actually one because its formula was stolen by industrial spies who got totally PWNED and ended up stealing a bad formula. (If you need a reference, google for singing capacitors . Note that singing capacitors can also happen with good parts used in a crappy electronic design. Like that 100 Mbps D-Link switch over there, or that Sony-Ericsson mobile phone charger. Hmm. Not everybody can hear it, I do.) A healthy, young capacitor should not bulge nor leak. A capacitor that leaks, bulges or sings is a crappy capacitor and needs to be replaced with a quality part ASAP. I ve been routinely replacing such capacitors on my older motherboards (manufactured between 1999 and 2001) in the past years. I ve not had the problem in ANY of my el-cheapo PSU, and did not replace any capacitor in any of them to date. Fortunately, the machine did not suffer any further damage, nor did the TomTom. Everything is up and running again with a spare PSU. I m now going to replace the fscking capacitors on this PSU, replace the fuse, probably R&R a couple of high-voltage transistors too (they have a tendency to fry before the fuse blows out) and get it back up and running. Then I ll do the same with the other PSU in the filer, because that machine has 8 disks attached, so draws more power and hence is much more vulnerable. Fuck you Antec.

Adeodato Sim : Quality of commit messages

I ve been subscribed to the Git mailinglist for three weeks now, and I ve finally seen in action what was already imaginable by looking at their git log history: they not only review the code for the patches that go in (as in many other projects, that is), but also review the accompanying commit messages, in order to ensure they meet certain quality standards. More than once already I ve seen an otherwise-fine patch get resubmitted in order to gain a more meaningful or thorough commit message. I m sure there are more projects that do this, but alas, I haven t been in any of them (nor in that many projects in general, for that matter). It s very exciting for me to see it in action, because quality commit messages are high in my Grokking VCS list. Ideally, a commit message conveys all the necessary information the maintainer of a project needs to understand your patch and its benefits, in particular those bits that don t fit as comments in the code. If you have to accompany your patch with rationales, wouldn t it make sense to include a condensed version of them in your commit message? If you re writing messages for a project of your own, please think of future people dealing with your code, particularly if it s a public project. (It takes discipline in addition to being convinced of it, though.) Commit messages are also great because they allow you to be verbose, without cluttering the code with information that s only relevant in the context of the change, and not to the final code. There is however an (actually-not-so-fine) line between what should be in the commit message, and what should be as comments in the code, and I think we commit message enthusiasts should watch out for that. Take, for example, 39c19ce. I think a short comment saying Don t call rev-parse for each blamed line would have been a perfect companion. There must be somewhere a document explaining with more detail what makes a good commit message. If you would recommend any, please let me know (but I m not interested in documents that explain how to format your commit messages).

Wouter Verhelst: How not to enable ACLs

Yesterday, I wanted to test something involving ACLs on my laptop, so I had to enable them on my laptop's filesystem. Since I don't believe in multiple filesystems for a laptop, that meant changing mount options on the root filesystem. Changing fstab is easy enough, but for changing the options on the live filesystem, you need to remount it. No problem, I thought, there's '-o remount', right?
mount -o remount,acl /
Turns out that's not such a good idea. This morning, I boot up my laptop, and I'm greeted with the following message:
/dev/hda4 superblock features are different from backup, check forced
... which took quite a while, as usual. Sigh.

Roland Mas: Call for translations for GForge

Stuff happens quietly on the GForge front, but after some time we decided we're getting bored with not releasing. Since we seem to have run out of major problems in the codebase, the long-awaited GForge 4.7 release is probably round the corner. And so, since GForge migrated from its own in-house translation system to the more conventional gettext API, I'd like to take the opportunity to issue a call for translations, knowing that potential translators won't be too disturbed by unusual tools and formats. You can grab the current state of the translations from the GForge repository browser. Or, for more long-term involvement, checkout the code through Subversion or through Bzr (my gateway branch is available from bzr.debian.org. Current statistics are as follows: Results as patches to our patch tracker or the gforge-devel ML please. (Note to Debian-related readers: this translation work will be directly useful on Alioth when we upgrade it.)

MJ Ray: FS-4400 Satellite PVR

You may remember that I m quite a satellite TV fan, having installed it in 2004 and compiled a FAQ. Over the holidays, I replaced my 4-year-old Digiquest receiver (terrible website) with a FortecStar FS-4400 PVR from Maplin. I d love to build a MythTV but how am I ever going to build such a small, quiet receiver for anything like that price? The FS-4400 s decoder gives a dribblingly clear picture and (one firmware upgrade later) the recorder works flawlessly. I can even watch other channels on the same transponder while recording. It has a couple of small niggles (the file manager that appears every damn power-on, the pidgin English on-screen displays and it s too easy to activate the motor), but it seems pretty good value on the whole. Now I ve a dilemma. I put a 4Gb USB stick into it, just to see how I got on with the recording. I like it, but 4Gb is enough for only 2 or 3 hours and I don t want to get into swapping sticks around like video casettes. I still don t know what s where on half my tapes. I ve seen a few places report things like Solid State Drives Getting Ready to Take Over (by Jaymi Heimbuch) with much larger capacity just around the corner, but the best rate I found today is around 1 Gb/pound for SSDs up to about 32Gb, compared to nearly 10 Gb/pound for USB-powered hard disks from around 300Gb. On the flip side, SSDs are silent and I don t know how noisy or power-hungry the HDDs are. How would you play this? By the way, if you care about UK TV, BERR.gov.uk is consulting about reducing Sky s control of itv - what s to consult about? Sky s doing all they can through the courts to drag their feet, but we need to put the independent back into independent television! Tell them by Friday 23 January 2009, please.

Antti-Juhani Kaijanaho: Randomness, or not

Rules of the game:
Link to the person who tagged you.
Post the rules on your blog.
Write six random things about yourself.
Tag six people at the end of your post and link to them.
Let each person know they ve been tagged and leave a comment on their blog.
Let the tagger know when your entry is up. I have no idea how to select random things about myself, but I can select some non-randomly, by my own whim:
  1. I m 31 years old and I m only now in the process of getting my driving license (as my Finnish readers well know).
  2. I eat too much canned fish.
  3. I think I found perfection when I bought my current winter shoes they have extra-friction soles and they have saved me from many falls due to bad walking weather.
  4. I tend to get bored when I don t have way too much to do and when I do, I tend to get stressed.
  5. I could do better in my apartment cleaning.
  6. I was a teenager when the Finnish banking system (almost) collapsed in the early 1990 s. The current difficulties seem a bit ho-hum after that.
Via Niobe. I don t feel like tagging anybody just now feel free to consider yourself tagged if you feel like it.

Evan Prodromou: 26 Niv se CCXVII

I got tagged in the bunnymeme. I even got nagged about it. I have to admit, drawing a bunny is kind of a relief from a busy week. Here are the rules:
  1. Draw a Bunny (or more)
  2. Post it to your blog with the rules
  3. Name three other bloggers that should draw a bunny
Here is my bunny: My bunny And here are the three blogger friends I can think of who aren't too uptight and full of themselves to post a picture of a hand-drawn bunny: Update: there's a nice graph tracking the meme's progress. tags:

Montreal Startup invests in Control Yourself, Inc. On a more serious note, I'm glad that GigaOM has published a story about venture investment in my company, Control Yourself, Inc. ("Identi.ca Gets Funding to Make Open-source Twitter Variant"). I'm psyched to be working with Montreal Start Up to build CYI into a viable Open Source business. They've been really supportive of the Open Everything strategy, including building the OpenMicroBlogging standard. Thanks to everyone who's sent private and public congratulations. The fun part starts now! tags:

Open Source Jaiku The news came out on the same day that Google announced they're going to release the Jaiku code as Open Source software. I think this is great news. Hopefully, we can work together to build a federated network of microblogging sites running Open Source software connected with open standards. It's so important to have multiple implementations of any open standard, and I think Identica and Jaiku can be a good team for the microblogging world. tags:

Joey Hess: fakechroot warning label

fakechroot, or any similar tool that uses a facility such as LD_PRELOAD, is not suitable for use in a security context. Such tools are way cool, but can be trivially broken out of by the attacker. Kapil Paranjape suggests using fakechroot for locking down ssh authorized keys for unison. The idea being unison will run in a (fake)chroot, set up by a regular, non-root user, and will thus be limited to the files you want it to access. First problem is, any statically linked executable on the system (unison can be used to upload one too) is immune to the fakechroot.
joey@gnu:~>FAKECHROOT_EXCLUDE_PATH=/bin fakeroot fakechroot chroot /tmp/empty /bin/sh
sh-3.2# ls
sh-3.2# ls /
sh-3.2# cd ..
sh-3.2# ls
sh-3.2# sash
Stand-alone shell (version 3.7)
> cd ..
> ls
empty  gconfd-joey  gpg-XhukMB  keyring-ZxSuTB  orbit-joey
> cd ..
> ls
bin    etc         lib     opt   selinux  usr
Getting unison to run a static executable in a setup such as Kapil describes is left as an exercise for the more determined attacker than I. Here, though, is an easier way.
sh-3.2# ls /
sh-3.2# ls /bin/..
bin    etc         lib     opt   selinux  usr
To understand why this works, notice that I left /bin excluded when I ran fakechroot. (Still .. Is this a bug in fakechroot?) Or, you could use unison to upload a symlink:
joey@gnu:~>ln -s / /tmp/empty/root
joey@gnu:~>FAKECHROOT_EXCLUDE_PATH=/bin fakeroot fakechroot chroot /tmp/empty /bin/sh
sh-3.2# ls root
bin    etc         lib     opt   selinux  usr

Moral: Taking a program, be it fakechroot or unison, that was never designed with security in mind, and trying to use it as a security barrier, is an open invitation to pain.

Next.

Previous.