Search Results: "joey"

8 March 2009

Stefano Zacchiroli: zack for DPL

/me for DPL Given that it is now widespread news, I guess it's time to blog about it: I'm running for DPL in this year elections, i.e.: zack for DPL!. Am I out of my mind?
Possibly :-) It started as a joke at last DebConf, with my (naked or dressed ...) room mates spreading that rumor. Then the idea grows into me ... and now here I am. (IOW: I'm pretending I'm not entirely guilty of inflicting another platform to be read.) Apparently we are just two candidates: me and the "ticket" Steve-Luk. For the moment I've to spare a page where I will collect material about the election, and a couple of feelings: Version 1.0 of my platform has been submitted to the secretary, and is now available from my homepage. If you have questions, for me or the other candidates, just post them on -vote: campaigning has just started, I'm confident it will be fun! Update the platform is now available from the vote page

2 March 2009

Joey Hess: re: Declarative .deb maintainer scripts

Lars wonders about debhelper's approach of inserting script fragments into package maintainer scripts. It's really very interesting to survey debhelper's collection of fragments, in its autoscripts directory. Of the 55 fragments, the mean length is 4.5 lines, and the mode (and also shortest[1]) length is 3 lines. The 32 scripts that are each three lines follow a very simple pattern:
if [ "$1" = something ] && exists some-script; then
    some-script some-parameters
fi
It would be nice to get that down to Lar's more declarative one line approach:
some-script some-parameters $@
In practice though, many of these scripts are not always available, and so the postinst has to test for them before running them. And making them test the postinst's parameters to see if they should do anything makes them less general and less flexible (ie, not able to be run easily by a sysadmin), and so keeping the "$1" test in the postinst is reasonable. So, I think I've done a pretty good job at keeping debhelper script fragments short and keeping most of the possibly buggy bits that might need maintenace out of debhelper. The exceptions tend to be either older scripts, from a time when I was less careful about doing do, and fragments of code that I could not pawn off onto some other package, often because there was no package that owned the issue. (The dh_usrlocal code is the best example of that.) The most promising way to improve things seems to be using dpkg triggers, which is why I was very enthuisiastic when we finally got them, over a year ago. Triggers let many of these hooks into maintainer scripts go away completely. Rather than each package having to test for and call update-menus, menu can simply trigger on the modification of any menu file. Once menu finishes the conversion to using triggers, debhelper can drop those fragments entirely. Triggers seem likely to be able to eliminate well over 90% of the things we need to put into maintainer scripts, and I hope at least half of debhelper's script fragments can eventually go away thanks to them. The others seem more difficult. You probably cannot, for example, make a trigger that does something sane when an init script is installed. Debhelper has at least three different fragements that it can put into postinst scripts to handle init scripts, and these only cover the most common three cases (start, don't start, don't restart on upgrade). Moving even these things into a declarative form has long been a dream of mine. Maybe it could be done with a control file that specifies which of the methods for running the package's init script to use for this package. But it seems we can't do away with maintainer scripts entirely, no matter how hard we try. That's because maintainer scripts are our only way to deal with other crippling bugs in old versions of a package, and with upgrade issues, and with all the other myriad things that we put custom code in them to deal with. Pity.
[1] Slight oversimplification; two scripts cram the 3-line form in one line for no good reason and are counted as 3-lines above.

19 February 2009

Joey Hess: my stereo

Can you tell there's a whole linux machine loaded with hundreds of albums in there? Well, the USB ports on the front panel, and inside the cassete tape deck are a bit of a giveaway, as are all the blinkenlights. Details here. I'm still suprised I got it all squeezed in, put together, and working. Some things fit better than I had any right to expect:
tiny airgap between the QNAP computer and front panel control board

17 February 2009

Joey Hess: new project

So, I've had this plan for ages to follow up with what I did with my nslu2, and hide a Debian box inside a working stereo. Finally I've started work on this little project. I bought a cheap stereo with CD/tape/radio, mostly on the criteria: I got lucky.. after removing the CD drive, ripping out the battery compartment, and making other modifications to the interior of the case, I had just enough space to fit the qnap board, with centimeters to spare in some places, and millimeters in others. It fits perfectly. The board's LEDs and reset button will be accessible via the CD slot. I was able to keep the radio and amp working. Wiring up a USB sound card to that was easy. I could have kept the cassette deck working, but since I don't have any more of that media, I stripped it, and am planning to put a USB hub in there, accessible by pressing Stop/Eject. ;-) It seems I will even have a fair bit of empty space. Pondering adding a small UPS. Or, I might toss in an access point.

16 February 2009

Joey Hess: debhelper dh overrides

This is a followup to the earlier design of dh. After converting many packages to minimal rules files using dh, I find that it works very well for the 3 line rules file case, which works for 80% of packages. But getting from there to a slightly more complex rules file that 20% of packages need can be non-obvious. So, let's make it obvious. Suppose I want to run dh_compress -Xsomefile. But my rules file as it currently stands doesn't offer an easy place to run that command:
#!/usr/bin/make -f
%:
    dh $@
To use dh in this situation you had to go look up rather a lot of boilerplate, and to insert an explicit version of the right target, with the right dependencies, that called dh before and after your command:
#!/usr/bin/make -f
%:
    dh $@
binary: binary-indep
binary-indep:
    dh $@ --before dh_compress
    dh_compress -Xsomefile
    dh $@ --after dh_compress
That took me half an hour to come up with, and I wrote this stuff! Also, if I want to override a second command, I have to do it in the right order. So, the full flexability of debhelper is there, but it's too hard to get at. Here's the new new thing.
#!/usr/bin/make -f
%:
    dh $@
override_dh_compress:
        dh_compress -Xsomefile
What this does should be obvious. These override targets can be written for any debhelper command that you need to change the default behavior of, or even avoid running at all.
override_dh_auto_configure:
    ./configure --with-kitchen-sink
override_dh_auto_test:
    # The test suite for this package is busted on s390.
    if [ $DEB_BUILD_ARCH != s390 ]; then dh_auto_test; fi
The overrides can also be used to run additional stuff before, or after any debhelper command:
override_dh_clean:
    dh_clean
    rm -rf build_dir
So, I think that's beautiful. Simple, clean, no boilerplate, and intuitively obvious if you are familiar with debhelper.
FWIW, the implementation, which will be in the next debhelper release unless someone screams loudly, is not beautiful. Mostly because I sorta shot myself in the foot with the cute implicit "%:" rules. But, I got around it. :-)

Joey Hess: mmmmm

I took the package of blackberries from the freezer, where it had sat, neglected since I picked them from my fecund vines in August. They had some frost on top; it didn't seem that the wait could have improved them. But, I figured, let's do this right. No store-bought pie crust, made my own with lots of love, and no little trepidation, since pie crust is not my strong suite. Put it back in the fridge to rest as I melted the frozen berries. Added some honey, then worried I'd sweetened it too much. Seemed too runny, so added some flour. Spent what seemed a long time criss-crossing strips of the pastry on top. Which, now that I look at it, doesn't seem to be quite the way it's typically done, but whatever. 45 minutes later, it came out, and bliss, it's the most perfect pie I've ever made. Crust acceptably flaky, berries just the right mix of tart and sweet. But mostly, it tastes of summer and care, and the wait seems to have been worth it. So that's my Debian release pie.
On the software side of things, I didn't do anything much toward making this release happen. Indeed, I have forgotten most of what I put into the mix earlier. (Something to do with armel, and firmware, and maybe boot menus?) It was a nice change to sit back and watch and not worry (much) about doing anything myself. I think that someone fell asleep in his chair while running the CD builds and had to get a wakeup call early this morning to finish. Dedication. Seems like there should be a better way, but you can't argue with the result. Previously: Easter Etch, Releases and Such, Where was I When ..

8 February 2009

Joey Hess: focusing on the screen

Biella asks if I can read novels from a screen. Yes, I've read what has to be getting close to a thousand novels that way, over the past 8+ years. I was thinking about this just the other day as I read The once and future e-book: on reading in the digital age. That article does a good job arguing against many of the common complaints about ebooks, such as "I can't read an ebook in the bathtub".
my pile of paper
Right now, I have a pile of paper books I want to read or am in the middle of reading. But if I want something new to read, I don't reach for that pile, but for my (much larger) directory of ebooks. The pile of paper is reserved for special occasions: plane trips, camping, etc. I started reading ebooks in circumstances where it was too hard to get access to paper ones. Traveling in the third world, hauling along a lot of paper books wasn't practical. Living rural, where every book had to be backpacked in. I've stuck with it because it works for me and because I've enjoyed stretching my muscles of concentration on the screen. To me, the focus required to read an ebook from the screen is similar to the focus required to work on a program. And completly different than skimming through a web page. The best example of this that I have right now is Real World Haskell, which I've almost finished (hurrah!) reading in a combination of paper and web editions. I was only able to stick with reading this book when I got the paper version. I use the web version for reference, or for looking for help on a challenging part of the book. For reading, it's just too much a web page; too easy to skim, or be distracted by the comments that can be attached to every paragraph, or jump off to Wikipedia.
screenshot of my ebook reader
Just as most programmers tune their development environment so that it uniquely suites them, I've put a lot of thought, trial, and error into tuning my ebook reading environment. The most important thing seemed to be getting rid of anything that interfered with focusing on the text. Since I wasn't (easily) able to use that environment for reading Real World Haskell, I wasn't able to read it from the screen.

29 January 2009

Bdale Garbee: Facial Dignity

People keep asking me about the beard thing... Here's my take on what happened and why. Just before I left for LCA 2009, my wife offered to send along one of the limited edition prints of her award-winning waterfall photograph. She knew from prior years that the LCA organizers often host an auction or raffle to raise money for some worthy charity at the conference banquet. Since the photo was taken at Milford Sound on the way to last year's LCA in Melbourne, there was a connection between the photo and LCA. We had no idea what this year's charity might be, nor did we anticipate that her photo would become the centerpiece of the evening's fund-raising activities. The charity selected this year was an organization that is trying to save the Tasmanian Devil from extinction. Professor Hamish McCallum, the chief scientist with the program, gave a talk after dinner and before the auction began. The native population is suffering from a fatal facial tumor disease that results in horrible lesions, and is likely to kill off all the Devils within a decade or three. My family and I all have a strong love of nature, and Karen and I had the pleasure of touring Tasmania after LCA 2003 in Perth, so this seemed like a great charity to raise money for with her photo. As often happens at LCA, the auction and related fund-raising activities got complicated. This year, the photo alone was bid up to $2500 (which was very cool!), before people started offering things for higher bids. For years, going maybe as far back as Perth, I've been cajoled about shaving my beard if the bidding hit some level, and have always said no. This year, someone offered $5000 if I would shave my beard, and again I said no. Much later, after more cajoling and many counter offers, when the bids and various matching offers had us approaching $20,000 in total donation to the charity, I relented and announced that if we hit a total of $25,000 going to the charity I would consent to a shave. The resulting frenzy, including the suggestion that if it went high enough Linus should do the shaving, and the formation of a bidding consortium that kept raising more money and bidding against itself, was completely unexpected! Others have tried to capture details of the insanity, but the bottom line is that by the end of the evening, the total had blown way past anything we could have imagined, and by the end of the conference the total going to the charity was on the order of $40,000! Why did I agree to let Linus shave my beard? To be honest, I'm not entirely certain. I only had one beer that evening, so I can't blame intoxication. The fact that it would yield a worthy charity something over 10 times what my wife's photo alone had drawn as a maximum bid seemed significant to me. In hindsight, I also think I was at least a little bit curious to see what my face looked like after having a beard since sometime around September of 1982! In any case, I made the offer, insane amounts of money were raised, and on the last day of the conference, over the lunch hour, Linus took trimmers in hand and removed my beard in front of an audience. The reactions have been completely overwhelming. A local TV station and a local newspaper in Hobart were both there and ran stories. The ripple of mentions in the blogosphere was and is just astounding. There's even a silly Shaving Bdale game created overnight by the "Mad Scientists" at Secret Lab! And from all over the globe, people I do and don't know have been sending emails and finding me on IRC to plead with me to grow my beard again! Right after the shave, my good friend Keith Packard said "Bdale, grow it back!". Before I left Hobart, my wife emailed saying she and the kids hoped I wasn't waiting until I got home to start. Joey Hess blogged a hairy tale about how I'd scarred the minds of young Debian developers. The leader of Debian-RS sent word by email that the group all hoped I would re-grow my beard. And on and on and on... I'm really not used to being the center of so much attention! Being suddenly without beard felt weird in lots of silly little ways. I was hyper-sensitive to drafts. The feel of cold beverages hitting my upper lip was downright strange. And I kept wanting to scratch what wasn't there! After making faces at myself in the mirror for a while, I decided I really wasn't happy, and do prefer being bearded. So I haven't shaved since Saturday morning in Hobart, and am pretty scruffy looking. My wife said today that I'm "already starting to look like Bdale again". At the current growth rate, I have high hopes of having at least some facial dignity back by the time I speak at FOSDEM. And no, I won't be shaving my beard off again any time soon...

28 January 2009

Joey Hess: GSoC followups

Arthur Liu is doing a great series of posts following up on the results of Google Summer of Code '08 projects in Debian. (post 1 post 2) Most of them failed to produce code that's actually used in Debian, though there were some very successful projects, too. My experience with ikiwiki in '07 parallels that: latex Patrick Winnertz produced a working teximg (latex -> image) plugin that's in ikiwiki. The initial proposal also included doing latex -> html and wiki page -> latex conversions; that work never happened. file upload and image gallery Ben Coffey had an ambitious proposal to add file upload support to ikiwiki and also write an image gallery plugin using that. Ben did produce a working file upload interface, but that code never got into ikiwiki. This was due to a combination of at least three things:
  1. The only outside communication with the ikiwiki community was doing a design proposal at the beginning, and a code dump toward the end of the project.
  2. There was an existing complex spec for how to limit who could upload what files, but Ben didn't choose to implement those access controls.
  3. The code dump was not even noticed until much later, when I was putting the finishing touches on my own implementation of an attachments plugin.
By the way, since I happened to do that attachments plugin as a paid consultant, I have an interesting data point: It took me 19 hours total to implement it, vs roughly a summer of work for the GSoC project. I don't mean this to reflect poorly on Ben, it just shows that someone who is familar with a code base and has thought a lot about a problem can work on it much more efficiently than a newcomer. AFAICS, Ben never did get to the gallery part. His involvement in SoC was cut short for personal reasons. Wiki WYSIWYG Editor Taylor Killian produced a working interface to Wikiwyg, but it tragically never made it into ikiwiki. This seemed to be going swimmingly -- Taylor set up a subversion repository for his work and produced several revisions of the wikiwyg plugin in response to feedback. At the end of the summer, it was close to ready to be included in ikiwiki. Then we lost contact with Taylor, and his site fell off the net. Subversion repo: Gone. Tarballs: Gone. The final tragic part of this story is that I had a local copy of all of Taylor's work. And when I moved ikiwiki over from subversion to git, I set up a wikiwyg branch, and put his work into it, and happily deleted my other copies of his work. But I made some kind of newbie mistake pushing that branch, and so his work never made it onto my git server, and at this point seems completly lost. (I still hope to hear from Taylor..) gallery Arpit Jain produced a working gallery plugin for ikiwiki. But that code never made it into ikiwiki. The main stumbling block seems to be that it used the lightbox javascript library, which, at least at the time was licensed under a non-free CC license. The code is present in a branch in ikiwiki's git repo, but at this point there is still no image gallery plugin in ikiwiki, though others are now working on other implementations. Conclusions I learned some important things from participating in the '07 SoC:

27 January 2009

Joey Hess: ephemera vs the law

The changes to whitehouse.gov are being used as an example of ephemeral digital content.
At the exact moment Barack Obama was inaugurated, all traces of President Bush vanished from the White House website, replaced by images of and speeches by his successor. Attached to the website had been a booklet entitled 100 Things Americans May Not Know About the Bush Administration - they may never know them now. When the website changed, the link was broken and the booklet became unavailable.
At the same time, the Obama administration is chafing under rules that don't allow them to use Facebook, gmail, Blackberries, and Twitter. Because of this pesky Presidential Records Act.
Suddenly, they have to relearn how to communicate, because the law has not caught up with the way people live. They are being forced to return to older technologies (or they will once those technologies start working properly), and abandon or become more guarded in their use of newer technologies.
Anyone else find the dissonance am(az us)ing? Seems that anyone who really wants a copy of that missing booklet will be able to access it via FOIA in a few years (unless it got wiped with all of Cheney's files). Meanwhile, if the new guys find a way to stop being hobbled by the law, their digital content will likely be truely ephemeral, since they have become addicted to "newer technologies" that eliminate all expectations about data's preservation and privacy. I think this is one case of the law not keeping up with technology that I can support. It might be more fair to describe it though, as technology not keeping up with the law.

23 January 2009

Joey Hess: a hairy tale

When I was a kid, I had a daddy with this moustache. One day, he shaved it off. I looked at the pale, exposed strip of lip, and demanded he grow it back. There are no images of this event, besides those burned into my brain. It was in simpler times. Dad did grow it back, and a beard too, and and now he's (great)-Grandpa Hess. Who, come to think, looks similar to my tie-died friend Bdale. Bdale is one of the Debian grandfathers, those old guys who the young ones in the project look up to. And today, he scarred all their minds. The collective shout of "grow it back!" is gonna be huge. Did I mention that it all involves Tasmanian devils, charity, and the mean razor of Linus Torvalds? These are not simple times.

21 January 2009

Joey Hess: git as an alternative to unison

I've used unison for a long while for keeping things like my music in sync between machines. But it's never felt entirely safe, or right. (Or fast!) Using a VCS would be better, but would consume a lot more space. Well, space still matters on laptops, with their smallish SSDs, but I have terabytes of disk on my file servers, so VCS space overhead there is no longer of much concern for files smaller than videos. So, here's a way I've been experimenting with to get rid of unison in this situation.
    git clone --shared /mnt/fileserver/stuff.git stuff
Caveats: (Thanks to Ted T'so for the hint about using --shared, which makes this work significantly better, and simpler.)

18 January 2009

Steve Kemp: You didn't faint. That's always a good sign

Joey has implemented blogspam support for ikiwiki, which you can find here. He was also good enough to provide valuable & useful feedback so I can present a moderately updated API - most notably with the ability to train comments when/if they are incorrectly marked. I can imagine several other useful additions, but mostly I think the code should be cleaned up (written in an evening, posted to keep myself honest, didn't really expect anybody to be terribly interested) and then it should just tick over until comment submitters adapt and improve to the extent that my sites suffer again .. ObFilm: Kissed

Wouter Verhelst: Filesystems: the saga continues

Bernhard comes up with a few arguments in support of multiple filesystems which, in my arrogant opinion, make no sense. The first argument (about hardlinking a file to your homedirectory until something bad is discovered in one of the binaries) has been sufficiently debunked by Joey Hess. The second and third arguments are the same, really. Repeating your argument won't buy you any beer, sorry. Finally, all your arguments talk about server. I was talking about laptop. I don't know about you, but me, I'm not in the habit of loaning out my laptop to someone I don't trust. I'm not even in the habit of loaning out my laptop to someone I do trust, come to think of it. I do run some servers on my laptop, but I also have a firewall on my laptop that refuses incoming connections. This is a laptop. Not a machine in a data center. As such, the only person with access to my machine is me. Now I don't say I trust each and every bit of software that I run on my laptop, but I do trust myself. I won't start scanning my laptop's hard disk for rogue SetUID hardlinks in another user's home directory, because there isn't another user, stupid! Paranoid security is nice and dandy and totally useless. Security is all about trade-offs. Even Bruce says so: if the cost of a security measure (having to deal with with 73 filesystems) does not outweigh its benefit (protection against cosmic rays changing not only my firewall configuration, but also writing a suid CGI binary and installing that in /usr/lib/cgi-bin), then it's just not worth it. Now of course you might argue that 'having to deal with 73 filesystems' is no cost at all, in which case it would be worth it. But to me, it certainly is a cost, and one I'm not willing to take even if it did protect me against a real-life problem. And if someone were to break into my system, I'll just reformat it and recover from back-ups. I won't even have to revoke my GPG key, this time, since it's no longer on the disk.

17 January 2009

Joey Hess: investigation of an inelegant installer

Various people have been taken in by a pretend Debian installer/bootloader for the android G1 phone. What is it, really? Well, it's a 200+ mb zip file, containing a filesystem image of a Debian installation. About 100 mb of that is cached .debs in /var. A few minor changes have been made, and /root/.bash_history helpfully shows what was done. None of it seems to be malicious, but I did not check every file. Also included is a hilarious "boot loader" script that contains literally the following code:
echo "Custom Linux Pseudo Bootstrapper V1.0 - by Mark Walker"
echo "WEB: http://www.androidfanatic.com/"
echo "EML: admin@androidfanatic.com"
echo " "
sleep 1
echo "Starting init process"
sleep 1
echo "INIT: Debian booting....."
sleep 1
echo "Running Linux Kernel"
sysctl -w net.ipv4.ip_forward=1
sleep 1
echo "AutoMounter started"
sleep 1
echo "Type EXIT to end session"
echo "Make sure you do a proper EXIT for a clean kill of Debian!"
echo " "
chroot $mnt /bin/bash
That's worth the price of admission right there! I especially like how "init" is "started" before the "kernel". You can't make stuff like this up. So, in summary, this is a way to get a prebuilt Debian chroot at the expends of wasting bandwidth and space on your phone with unncessary bits. Running debootstrap on the phone is the correct way to accomplish the same thing. It's sad that there's such interest for Debian on the G1, and general lack of clue, that people will actually probably use this. And, like it or not, this "is" the Debian install for the G1 -- no further efforts are likely to get this kind of press. Sorta like that badly pressed CD back in the day stole the thunder of Debian 1.0. More generally, it's a pity that when people want to get Debian on a new device, be it the G1 phone or the EEE or OpenMoko or what have you; only about half of them seem to do it right, by modifying d-i and sending the modifications back to the installer team. For this rest, this kind of hand-built, unverifyable chroot gimmeckery is the de facto standard. This also shows you the kind of fact checking that slashdot and random blogs tend to do -- ie, none. (My own blog, of course, is rigorously fact-checked and edited by armies of lolcats.) (Sorry, this seems to be my week for posting corrections to other people's posts to Planet Debian. I don't mean to pick on you guys.)

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.

15 January 2009

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.

Kapil Paranjape: Securing Synchronisation with unison (Mostly Wrong)

There are a number of documents about how to permit ssh access to run rsync or unison for remote synchronisation by an appropriate configuration of the authorized_keys file. Of these the best two are probably those by St phane Kattoor and Christian 'Greek0' Aichinger. Joey Hess also explains some of the pitfalls. The problem is the familiar one: to limit the file-system hierarchy accessible. The humble chroot is a natural way to implement such restrictions which is probably what led "Greek0" to suggest the use of dchroot. This is indeed a fine solution ... except, how does one implement it if one is not root on the server machine? WARNING: The rest of this entry is wrong as was pointed out by Joey Hess. See the update at the bottom. The package fakechroot by Piotr Roszatycki provides a way out. The problem I had was as follows: A recent enough version of fakechroot (version 2.8 worked) allows one to do make use of environment variables as follows:
LD_PRELOAD=libfakechroot.so
LD_LIBRARY_PATH=/usr/lib/fakechroot:/usr/lib64/fakechroot:/usr/lib32/fakechroot:/usr/lib:/lib
FAKECHROOT=true
FAKECHROOT_VERSION=2.8
FAKECHROOT_EXCLUDE_PATH=/bin:/lib:/usr
export LD_LIBRARY_PATH LD_PRELOAD
export FAKECHROOT_EXCLUDE_PATH FAKECHROOT FAKECHROOT_VERSION

After this setup one can run
HOME=/ chroot $HOME/some/dir /usr/bin/unison -server

and the unison server1 will only be able to view /bin, /lib, /usr and $HOME/some/dir; the latter will be mapped to /. (One needs to set the $HOME variable to something sensible for unison to function.) One should not be tempted to create subdirectories of $HOME/some/dir containing only the "relevant" portions of the system directories for unison. The reason is that those files will be created as me and so could be overwritten by unison. The creation of a suitable entry in authorized_keys to use this is an easy exercise! UPDATE: As Joey Hess has noted:
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.
I had thought about the problem of uploading static-linked binaries and had imagined that it had been overcome. However, the basic facts in this case are:

  1. For those trying this out at $HOME with some terminal command like /bin/sh instead of /usr/bin/unison a suggestion is to add /dev to the FAKEROOT_EXCLUDE_PATH variable so that you have access to your terminal. Be aware that giving remote access to /dev may have unintended consequences!

7 January 2009

Felipe Augusto van de Wiel: 8 Jan 2009

Debian

Re: Blog rewrite upcoming
Erich, it seems that you got TONS of recommendations for different blog software, so you probably already received a recommendation for Chronicle: The Blog Compiler, it is written by Steve Kemp inspired by Joey's ikiwiki. I've been also wondering about using ikiwiki and/or chronicle. :-)


From the privacy-issues-department...
This is in my draft for a long time now...

Nico, I never understood what was so private about your debian.net page (Thanks WayBackMachine!).

PS: Happy 2009!

Joey Hess: rip your own adventure

I used to read Choose Your Own Adventure books straight through from page 1 to 100. Now, I wget -m websites, and less * ... same deal. PS, Thanks for the great feedback on rel-vcs. The spec has been updated, fixing many of your nits, and there's an implementation in gitweb, ikiwiki, and mr.

Next.

Previous.