Search Results: "ag"

22 November 2005

Erich Schubert: More SELinux backporting

I've found a couple of issures with my SELinux backports. One is actually a bug present in sysvinit and cron (at least): The debian/rules makefiles uses dpkg-architecture to detect a Linux system (as opposed to GNU hurd or FreeBSD or Solaris) since SELinux only works on Linux. This code queries the DEB_HOST_ARCH_OS variable via dpkg-architecture, but this variable isn't available on sarge (yet)... When building with either my dpkg backport or by using code similar to the following:
dpkg-architecture -qDEB_HOST_ARCH_OS   dpkg-architecture -qDEB_HOST_GNU_SYSTEM
the packages will actually have SELinux support enabled. I've already filed a bug against sysvinit, but should I also file bugs against logrotate and cron, who apparently use the same code to detect SELinux? (openssh and coreutils have better fallback code than suggested above in place)

David Welton: When you need to get something done quick...

I went to the local Java Users Group meeting last Saturday to check it out. I hope to give a presentation on Hecl sometime soon, so I figured it was fair to go once or twice before showing up to recount about what I've been hacking on. The meeting started off with presentations on first Java Server Faces, then Tapestery. Lots of "then include this, configure that XML file, add these". The final presentation was two guys who had volunteered to redo the user group web site. After poking around at a few different things, they built it with Ruby on Rails, and gave a presentation on their experience. I was once again surprised at the uptake of that system in the Java world. The response amongst the people with whom I chatted afterwards was that it's really Rails itself that's so attractive. I see Tcl and Tk as being a lot faster than Java for GUI work, but perhaps Java folks are used to using some kind of GUI builder for that, so the difference is less pronounced... and Java's uptake has probably been greatest in the web world, so it stands to reason that something like Rails would really garner a lot of attention.

Aigars Mahinovs: Otaku girls


Otaku girls
Today I am preparing for tomorrows big event - opening of Latvia's third Anime Festival. A bunch of otaku girls is begging me to cosplay Jiraiya - the super pervert ninja from the very popular Naruto series. I already have most needed components - white hair (false) and a pervert mind (true). It is gonna be fun :)

Wouter Verhelst: Wanted: an NBD dissector for Ethereal

I could probably write it myself, given time, but I'm guessing it's going to cost me a lot more time understanding the Ethereal API than it is going to cost someone else undestanding the NBD protocol. Which is really simple. So, here's a short description of the protocol; now if someone could write me an Ethereal dissector, I'd be very happy. And if you need it, just ask for more information.
"Negotiation" phase:
  • Connection is opened by the client
  • The server sends out the literal string NBDMAGIC to the client (which is the "INIT_PASSWD" in the code and in error messages), followed by the the 'cliserv_magic', 0x00420281861253LL. The NBDMAGIC is there to identify a server; the cliserv_magic may be updated when the protocol changes incompatibly.
  • The server sends the size of the device as a 64 bit unsigned integer.
  • The server sends 128 bytes of zeroes (discarded by the client currently; these are reserved for further use)
(whether or not the above are all in one packet is something I don't know and don't really care about; they're all done using different write calls, so can technically be in different packets)
After that, the client is expected to be happy with the connection (if it isn't, it'll just drop the connection without explanation).
Main data pushing phase:
(I just made that name up, give it a reasonable name please ;-)
  • Clients sends a struct nbd_request to the server (which is defined in <linux/nbd.h>. The fields in that struct are:
    magic (32bit unsigned int)
    must be NBD_REQUEST_MAGIC aka 0x25609513 (again defined in <linux/nbd.h>); if it isn't, the server disconnects (this should really be handled better, but at the moment it isn't; and changing the protocol to do this might be less than trivial). It is possible that previous versions of the protocol used 0x12560953 instead (the header file mentions that as something not to be used, but I don't know where it comes from).
    type (32 bit unsigned int)
    is NBD_CMD_READ aka 0 (to read data), NBD_CMD_WRITE (to write data) aka 1, or NBD_CMD_DISC aka 2 (to request a clean disconnect).
    handle (char array of eight bytes)
    used to uniquely identify a request; this is later sent back in the reply, and can be used to associate a reply with a request.
    from (64 bit unsigned int)
    the offset in the export where the read or the write should start.
    len (32 bit unsigned int)
    the length of the requested read or write.
  • If struct nbd_request.type==NBD_CMD_WRITE, the client will then send struct nbd_request.len bytes to the server, containing the data it wants to see written.
  • Server sends a struct nbd_reply to the client:
    magic (32 bit unsigned int)
    functions similar to struct nbd_request.magic, only its value is supposed to be 0x67446698. Analoguous to struct nbd_request.magic, there's a value, possibly from a previous version of the protocol, which says 0x96744668 instead.
    error (32 bit unsigned integer)
    is zero, unless an error occurred
    handle (char array of eight bytes)
    the exact same value that was received in struct nbd_request.handle
  • If struct nbd_request.type==NBD_CMD_READ, the server will then send struct nbd_request.len bytes to the client, containing the data it read.
As you can see, a very simple protocol really... now if only somebody could write me a dissector—having to dissect it by hand isn't very funny, really.

Clint Adams: GUI music players

First, I should point out that I hate GUIs. Then I should point out that I don't want to play music with a GUI music player. I'm including ncurses-type things like cplay in the GUI category. They've always made my skin crawl. So, why am I testing out GUI music players? It's because I didn't didn't realize that I misread the Audioscrobbler spec. Now that we've established that I don't know what I'm talking about, let's move on. Yesterday, I followed the suggestion of some KDE people and tried amaroK. I was pleasantly surprised. It was pretty, it was functional, the UI didn't piss me off, and it kept showing me a picture of Mako for some reason I still can't figure out. Here's where it fell down: it wanted me to select tracks based on album/artist info in the file tags; the musicbrainz lookup function is not as useful as tp_tagger; when I tried to play tracks off of a slow networked filesystem, it skipped a bit, then it shoved its head up its ass and ate itself. It managed to finish the track before it disabled its frontal lobe, but it didn't send the data to last.fm. So, amaroK was a lot better than I expected, but unacceptable. People seem to like Quod Libet. Joey and Erinn. So when I tried it today, I didn't expect it to be awful. Here's what it has over amaroK: it doesn't fall over and die when trying to deal with files on a slow networked filesystem. It just skips. You may be thinking that this could be easily solved with proper buffering. I'd think that too, if it didn't skip when playing files on the local hard drive. You may be wondering why I'm trying to play music on an old 486. I'm not. This is a Pentium 4 2.8GHz under almost no load. This is ridiculous. Compared to amaroK, this thing is ugly as sin, and incredibly awkward. That includes the metadata editor that people keep raving about for some reason. Furthermore, when I rearrange songs in the Play Queue, it occasionally ignores me and plays the track that used to be at the top of the list. Rhythmbox also has problems with skipping, so I guess that gstreamer is the devil. I'm not filing bugs because I don't intend to ever use these programs again.

Andres Salomon: My self-worth is based upon you.

According to this page, my blog is worth $2,822.70. Now, I have no idea what metric they use to determine that, but that’s not really important. What is important is that you freeloaders start paying up. For far too long, I’ve put my blood and sweat into producing this fine verbiage, without any sort of compensation for my labor. As we all know, if humans aren’t compensated for their art (and trust me, this blog is pure art), they have absolutely no incentive to continue creating it. So, I demand payment in return for my hard work, or Toby gets it! I hereby announce that this blog is for sale. Once purchased, you may claim ownership over any past and future ideas, anecdotes, and pictures presented on here. I will entertain the best offer. I am such a whore. For the humor impaired: yes, this is a joke.

Ian Murdock: The writable web

Who says a web-based office suite doesn’t make sense? I’m writing this post in Writely, a web-based word processor that supports posting to weblogs (complete with preview mode) as well as real-time collaboration, basic document management, and several other very nice features. It even does auto-save, and there’s a spell checker too, complete with squiggly lines underneath misspelled words. I decided to give Writely a try after Steve Rubel explained how he uses it to draft blog posts, thinking it might make a nice alternative to the antiquated TEXTAREA widget that is, remarkably enough, still the primary interface for editing the web after all these years. Now that I’m using it, though, I’m beginning to see how it could grow into more than that, at least for me. Sure, it’s fairly simplistic, but it does all the basics reasonably well, so that’s actually a feature (Steve says: “Think of it as Microsoft Word for the Web - except with just the parts you need!”). Combine that with the ability to access my documents from any computer, as well as the collaboration facilities (which look interesting and appear to go above and beyond the heavyweight email-based collaboration features found in more traditional office suites, though I haven’t tried them yet), and I’m intrigued. Now, if there were only a Writely component I could include in other web applications, or maybe even graft in as a substitute for the TEXTAREAs on arbitrary webpages using some sort of Firefox extension or Greasemonkey script. I’d love to see support for the Open Document Format too, so I could use Writely as a sort of document store and pass documents between thin client and fat client seamlessly. Then we’d be getting into really intriguing territory. (While I’m at it, a way to pull down the templates and style sheets from my weblog for a true WYSIWYG editing experience would be very nice too. Heck, as long as we’re thinking outside the box, why not just allow me to edit the page directly?) (As I’m writing this, I can’t help but think of the Innovator’s Dilemma, i.e., market leaders continuing to stuff more and more features into products that fewer and fewer people actually need to fuel the relentless drive upmarket, opening themselves up to attacks from below by providers of “good enough” products..) Update: I couldn’t get the blog posting feature of Writely to work, so I ended up copying-and-pasting the HTML into Wordpress. Oh, well. On a brighter note, while I was fiddling with the blog posting feature, CNET News.com reported that Writely is adding support for the Open Document Format and intends to add support for PDF too. Suite!

Steve Kemp: Things I have never written: #4

Weblog Software
I’ve been keeping an online journal over at LiveJournal since 23rd February 2002. To support them I actually bought a “Permanent Account” a while back, an example of putting money behind companies and/or services which are useful - even when it isn’t required. After getting into the swing of things there I started the blog which is used upon Planet Debian and have also been enjoying that. Livejournal is a nice service, and they have great software powering the site. The Livejournal code is available and it is reasonably simple to install. (I’ve setup a few installations of the codebase, and played with them. I admit I’ve never run it in anger). Obviously it is completely overkill to run your own installation of Livejournal - unless, perhaps, you’re a school or a large company. So for my personal blog I use Wordpress. I don’t particularly enjoy using wordpress. To be honest I need only four features/abilities of weblog software:
  • The ability to create posts.
  • The ability for users to be able to leave comments upon entries.
  • The ability to search previous entries.
  • The ability to export the blog entries as a feed.
Everything else is utterly overkill. The downside of using Wordpress is threefold:
  • Because it is popular there are multiple bots crawling the web and leaving spammy comments.
  • Because it uses some funky addressing system any replacement would leave lots of broken links.
  • It has historically had a couple of security issues.
I’ve been telling mysefl for the past few months:
  • This software has got to go.
  • I’ll wait until there is another security hole discovered.
So .. HTML::Template & CGI::Application will at some point come to the rescue. I’m just not sure when. I guess this means I’ve not yet written a bloggin system…. ;) I want to only cover the basics:
  • Multiple users.
  • Multiple catagories/tags.
  • Comments with a sane anti-spam system.
PS - The Sisters of Mercy rock.

Steve Kemp: The Chronicles of Steve

Apathy
I’m sleeping a lot more than I should be which is making me pretty apathetic at the moment. Even checking email is a real effort. Let alone replying.
Last Post
As previously mentioned I’m utterly unfranchised with WordPress. This will be my last post using it. All future updates will be made using Chronicle, a simple Perl-based application I’ve been working on for a while. (The best part is the name!) So far I’ve got code to : TODO:
  • Import old comments.
  • Add code to handle displaying/editting/deleting comments.
  • Add some mod_rewrite magic so that all my old links still work.
The application is pretty nice, comprised of several perl modules and built using the CGI::Application base-class. I realise this contradicts the apathetic stanza above …

Matthew Palmer: Rhetorical Quiz No. 1

What does this shell fragment do?
 watch "iwlist scan  grep :off -B 5 -A 1"
I've only really learnt about the power of watch(1) in the last week or so. Me likee.

Edd Dumbill: Opinions and opinionated software

Since interviewing the creator of Ruby on Rails, David Heinemeier Hansson, I've been thinking a little more about what he calls "opinionated software." That handy little phrase seems to sum up what attracts me to a lot of technology, at all levels. What I like Free software--it's not really economics that drew me to free software, but the principles and aims. When you release or use free software, you're exercising your right to free speech and adding your voice to an argument. Desktop environments--GNOME 2.0: The move from GNOME 1.0 to version 2.0 was highly opinionated (Mac users, think OS 9 to OS X). Complexity of user interface was thrown out in favour of sensible defaults. Web standards--CSS, RDF, XHTML: not only is there a right way to do things, but it turns out to be better too! I don't automatically fall in love with everything that emerges from the W3C, but some things are so obviously the right way it's impossible not to love them--warts and all. Muine music player--this player throws out the paraphernalia of iTunes clones and gets you close to the music. Queue, play. What I want to do. Epiphany web browser--a simple text bar does for bookmark lookup, search and URLs. The bookmarks work like del.icio.us tags. Despite the lure of Firefox extensions, simplicity and efficiency keeps me with Epiphany. Make friends and enemies The thing about opinions is that people are inclined to disagree with them. Opinions won't please everybody and, being opinionated, you will never carry everybody with you. But opinions give you something with which to scythe through indifference. In both my writing and software development work taking a particular stance enables me to create interest, and gives direction to my projects. I tend to get bored easily, and if I'm bored, then my readers and users will never make it. Being opinionated in software development is easier when there's a strong leader, or it's a one-person project. It's more of a dilemma if you're running a free software project with multiple contributors. Such projects need such contributions, but run a risk of losing focus and style. I think that there we need to be brave again. If being opinionated means losing potential users, it also means losing potential contributors. Opinions help in dealing with users, too. It's obvious that the mere act of listening to users isn't good enough. They often won't say what they mean, or their requests mask a deeper issue. How often have you given your boss exactly what he asked for, to find it wasn't what he wanted? A combination of reading-between-the-lines and having opinions helps cut a way through the noise of user feedback. Stirring the pot Here are a few wishes for some free software projects that I want to see succeed further, but which really need to get opinionated to be effective. These projects aren't failing, but they're not reaching the potential I know is there. Each of them are infrastructural in some way, and that's probably where the temptation to avoid being opinionated is strongest. But here's the genius: the rewards of being opinionated here are high. Ruby on Rails is the existence proof. What's better? A handful of users with the "right" idea about how fundamentally important you are to everything, or loads of users who only see a portion of the capabilities of a project? Copy the experts It may seem like cheating to copy Apple's lead, but a lot of what they've done in OS X is to take a stand on what's useful and not. On many occasions this has inconvenienced people, but it's not eroded that special lure that Apple products hold. There's not harm in asking "What have Apple done?" with some of our projects. Another poster-child for being opinionated is Ubuntu Linux. Technically, it's only marginally better than other Linux distributions. Strategically, it's miles ahead. Its founder, Mark Shuttleworth, had very solid opinions about where Ubuntu should go, and pursued them. Over time, these have pervaded the product itself, but at the start it was the message and the style that made the difference. Opinions not expressed are rarely effective.

Andrew Pollock: [life/americania] My kingdom for a bayonet light bulb

So, they're obviously very proud of the fact that Thomas Edison invented the light bulb, as they're all Edison Screw over here. Nary a bayonet to be found anywhere. Difference illustrated here. On Sunday we went to Home Depot (the one we walked into at Milpitas could have been Bunnings at Fyshwick if it were green instead of orange), and when I asked someone about light bulbs with bayonet fittings, he made noises about auto shops and stuff, which suggests that they just don't do house lighting with them at all. Why do I want a bayonet light bulb so badly? I have a lamp that was made by my late grandfather, which is one of the few non-dual voltage items I didn't jettison (probably the only one actually), and I was rather keen to actually use it. I don't expect the bulb that was in it to survive the shipping process, and even if it did, if it didn't instantly blow up at 110V, I suspect it would be a bit dim. If anyone knows of any bayonet-to-edison adapters, please let me know. Update: Google is my friend

Antti-Juhani Kaijanaho: Driving While Intoxicated &ndash; A Glimpse of Finnish Criminal Justice, Part One

This posting is part of my Finnish criminal court series. See the introductory essay for more information and an overview of the Finnish criminal court system. The following is a fictional account of a criminal case, one of the most frequent ones, written in the form of a play script. A PDF is also available. There is also an OpenOffice-generated XHTML renderition, which may be more pleasant to read than the version below (but lacks most of its logical markup). DRIVING WHILE INTOXICATED
A glimpse of Finnish criminal justice
Part One Dramatis personae
Presiding judge
Prosecutor
Defendant Extras
Three lay judges
Court reporter Sets
Courtroom
Courthouse lobby DISCLAIMER This is a work of fiction. Although this play is based in general terms on real life, all the specific characters and events portrayed or described in this play are fictitious, and any resemblance to real people or events is purely coincidental. The verdict presented is fictitious, and while it is based on the author's understanding of the law, it may be erroneus. No legal advice should be inferred from this work of fiction. Scene One: And so it begins The courtroom is about the size of a large school classroom, and shaped as a rectangle in terms of floor layout. The judges' bench, a long wooden table, lays near one of the short walls; the space between the bench and the wall is enough to give the judges and the court clerks comfortable room to sit and to move behind the sitting judges. At the center of the bench is the seat of the presiding judge, who has easy access to a telephone, a public address system and a panel for controlling the LED display visible in the lobby above the courtroom door. To his or her right is the court reporter's seat in front of a PC and in control of recording equipment. To the reporter's right there is room for one additional individual. To the presiding judge's left, there are three chairs for the lay judges. If one were to stand directly opposite the presiding judge, on the other side of the bench, one would find an open Bible. In front of the bench, disregarding the Bible, there is some room, approximately two meters or so. Along each long wall there is a small table, and those two tables face each other, and are therefore turned sideways from the bench's point of view. By the desk on the bench's right is the seat of the prosecutor, and the other, facing desk is reserved for the witness being examined. Facing the bench, separated from it by that empty space, are two rows of tables with chairs. Beyond them there are two rows of seats for the audience without tables; the farther row is right at the other short wall. The long wall to the judges' right contains one double door leading to the court building lobby, and the other long wall contains two sets of double doors at each end of the wall, leading to a part of the building not accessible to the public. We'll call the door closer to the bench the judges' door. The PRESIDING JUDGE is a 50-something man dressed formally in black and blue. The three LAY JUDGES are more casually but still essentially formally clothed. LAY JUDGE ONE is a sixty-something male, LAY JUDGE TWO is a female in her fourties and LAY JUDGE THREE is a female just under thirty. The COURT REPORTER is a female in her fifties, also dressed formally. It is 9:00. The four JUDGES and the COURT REPORTER are sitting on the bench. Each JUDGE has papers in front of him or her, the PRESIDING JUDGE's stack being by far the thickest. The PROSECUTOR, fourty-something man, enters through the judges' door, carrying law books and a large stack of paper. He sits down at his desk. PRESIDING JUDGE (Nodding to the prosecutor.) Okay. Let's start. (Enters codes on the LED machine. Then picks up the public address microphone.) The criminal case 'prosecutor against Matti Meik l inen' begins in room three. Parties to room three. Scene Two: Main hearing The DEFENDANT enters through the double door from the lobby. He feels a little lost. PRESIDING JUDGE (To the defendant:) Matti Vihtori Meik l inen? (DEFENDANT nods.) Please, take a seat in the front row. (He waits for the defendant to comply.) This case will be tried as follows. First, the prosecutor will read the charge. You will then respond by telling us if the charge is correct or not, that is, if you in fact did commit the acts specified in the charges, and if you did not, or the charge is only partially correct, you should state briefly why the charge is in error. The prosecutor will then present the case, he will describe us his understanding of the events in question. When he is finished, you will again have opportunity to state if the prosecutor is correct or not, and if not, in what way is he wrong. If there is disagreement between you and the prosecutor, we will hear the evidence. After that, the prosecutor will state his or her concluding opinion of the case as presented here. Again, you will have the opportunity to respond. We will conclude with discussion of what punishment, if any, would be appropriate. The court will then discuss the case alone, and will finally announce the verdict. Is this understood? (DEFENDANT nods.) Okay. Prosecutor? PROSECUTOR (Reads the charge from a paper everyone has in front of his or her.) I demand punishment to Matti Vihtori Meik l inen for driving while intoxicated. Matti Vihtori Meik l inen had on the first of May this year operated his car while his exhaled air contained 0,597 milligrams of alcohol per liter. Matti Vihtori Meik l inen's driving license must be suspended. PRESIDING JUDGE (To the defendant.) Is the charge correct? DEFENDANT Yes, it is. PRESIDING JUDGE Okay. The prosecutor will now tell us the circumstances and events in detail. PROSECUTOR Thank you. It was to my understanding late evening on May day, and the defendant had come from a bar and was apparently trying to move his car to a cost-free parking space. A police patrol happened to observe this and the defendant had apparently been a little shaky in his walking, so the officers gave him a breathalyzer test, which showed significant alcohol content. The defendant was brought in the station where a precision test was performed. The first reading was 0,597 and the second reading was 0,617; the mean of these two is 0,607, and after performing the confidence subtraction, the reading 0,597 milligrams per liter was obtained. PRESIDING JUDGE (To DEFENDANT) Well then, is what the prosecutor just said true? DEFENDANT (Speaking in a colloquial manner and very somberly. He is ashamed and wishes this would be over soon.) Yeah, it is. PRESIDING JUDGE All right. It seems to me that there are no points of disagreement, so we don't need to hear witnesses. (The PROSECUTOR nods.) Okay, it's time for the concluding statements. I think we will hear consequence opinions at the same time. Prosecutor? PROSECUTOR Thank you. I don't think there is much to say. The case has been shown beyond reasonable doubt, in my opinion. We have the precision test readings and the defendant's admission. As to the penalty... the amount of alcohol we are talking about is just below the limit for serious intoxication, so this is no small deal. On the other hand, the circumstances were not very dangerous. I think suspended imprisonment could well be considered, though a stiff fine would probably be more appropriate. The driving ban must be fairly long, obviously. PRESIDING JUDGE All right. (To the defendant.) Do you have anything to say before we adjourn to consider the case? DEFENDANT Well, I suppose it's clear that something is going to be given to me. I prefer a fine, naturally. PRESIDING JUDGE Naturally. The court will consider all options. Do you have any special requests concerning a driving ban? DEFENDANT As short as possible, of course. PRESIDING JUDGE Do you have a particular need for a car, do you need it for work, for example? DEFENDANT No. PRESIDING JUDGE Okay. Now, your income. We have here the last completed tax report for you, it says you earned 500 euros a month and had no children. Has this changed? DEFENDANT No change. PRESIDING JUDGE Okay, thank you. If you will then go outside to wait while we consider this case, thank you. The DEFENDANT exits to the lobby, the PROSECUTOR exits through the judges' door. Scene Three: Deliberation We are now in the lobby outside the courtroom. There are many doors that lead to many courtrooms. Above each door, attached to the wall, is a display showing the current case number; there is also a light saying do not enter, which is lit for most of the rooms, including Three. Also there is a numeric display which is out at the moment for most of the rooms. For some rooms, they indicate when the session will resume. Each courtroom door also has a paper pasted to the door frame listing the cases for the day. The door leading outside is separated from the lobby by a routine security check area, and one of the courthouse police guards stands there waiting for people to enter. Some other guards and janitors sit in their glass booth. There are many people sitting on the chairs, waiting for their turn to enter one of the courtrooms. DEFENDANT enters from the Courtroom Three door and sits down, waiting. It takes about fifteen minutes. During this time, announcements from other courtrooms could be occasionally heard, and people would enter or exit other courtrooms. Then... PRESIDING JUDGE (Over the PA) Verdict in the case 'prosecutor against Matti Meik l inen' in Courtroom 3. DEFENDANT exits through the Courtroom Three door. Scene Four: The Verdict The DEFENDANT enters from the lobby and sits down. After a minute, the PROSECUTOR rushes through the judges' door. PRESIDING JUDGE (Announcing to all people present.) The District Court has examined this case and has decided that Matti Vihtori Meik l inen did in fact commit the crime he was accused of in the way specified in the charge. The justification is the combination of the measured alcohol content in Meik l inen's breath and his own admission of guilt. Matti Vihtori Meik l inen is therefore sentenced to pay sixty-five day-fines, that is three hundred and ninety euros. Penal code, Chapter 23, Section 3. His driving license is suspended until the first of November this year. Road Traffic Act Section 75 Paragraph 1. One who is dissatisfied with this verdict can appeal it to the Vaasa Apellate Court within thirty days. Dissatisfaction must be declared, however, either right now to me or within a week to the Office of this District Court. (To DEFENDANT) Come and take the fine ticket and written appeal instructions (DEFENDANT takes those from the COURT REPORTER.) This hearing is concluded. The DEFENDANT leaves, as the court and the prosecutor prepare for the next case. TO BE CONTINUED
(with the next case)

Erich Schubert: Alioth SSH is too slow.

When I want to upload new packages to my sarge SELinux repository on alioth, it usually takes me around 10 tries. Something is seriously wrong with LDAP on that box - it just goes totally crazy. This almost unbearable... Maybe I should move the repository to people.debian.org instead?

Sam Hocevar: Suspicious Activity? Indeed

The Bad Plus I spent the whole weekend looking for a DRM-encumbered Sony CD so that I could check for myself whether my code was really being redistributed without permission. I eventually found one: Suspicious Activity?, by The Bad Plus. A rather enjoyable post-modern jazz album. I am rather lucky, it could have been C line Dion. As expected, installing the CD s custom player also installed a stealth aries.sys driver along with a few other interesting files such as $sys$DRMServer.exe, all hidden in a $sys$filesystem directory. I rapidly got rid of this cruft and started studying the really important file, ECDPlayerControl.ocx. It is the file Sebastian Porst and Matti Nikki found to be containing parts of mpglib, LAME, faad2, VLC... Suspicious Installer? Evidence that the DRMS code comes from VLC There are of course obvious similarities between some functions and structures of ECDPlayerControl.ocx and the ones in VLC s source. However, given how precise the implementation of a cryptographic protocol needs to be, the possibility that two separate implementations show many similarities must not be dismissed. The data structures and constant tables especially are likely to be identical. I think however that I found strong enough evidence that this is not the case here. The original drms.c was written by Jon on 01/05/04. I then hacked on that file on 01/18/04 and reorganised it, also replacing the reverse-engineered MD5 and AES functions with clean implementations, then Jon added DRMSv2 support on 05/05/04 and I reorganised the code again on 05/08/04. Some of these changes were specific to VLC (not in that they made the code unusable outside of VLC, but rather that they made it possible to use an external MD5 hash provider, for instance), so they were the bits I was looking for in ECDPlayerControl.ocx. For instance, Jon s original code had the following instruction:
p_acei[ 4 ] = 0x5476212A;
Since all bytes of this long word are comprised between 0x20 and 0x7f, it was later rewritten like this:
char p_secret1[] = "Tv!*";
This change makes the code more human-readable because many other secrets in the Apple DRMS protocol are ASCII strings. Also, I know how to look for binaries that use the string "Tv!*", but it takes me some more time to think of a way to find binaries that use 0x5476212A. And the Sony rootkit uses the following (only relevant lines shown):
 .text:100883B8   mov   cl, byte ptr ds:xxxxx+4 ; 0
 .text:100883C2   mov   eax, dword ptr ds:xxxxx ; "Tv!*"
 .text:100883C8   mov   [esp+70h+yyyyy], eax
 .text:100883DC   mov   [esp+7Ch+zzzzz], cl
The use of xxxxx+4 shows that ECDPlayerControl.ocx uses a string instead of a 32 bits integer to store the secret, disregarding the fact that the 5th character of the string (a null char) is never used. Another example: in this commit I reorganised the DoExtShuffle() function, merging FourthPass() and FifthPass() and discarding a structure allocated on the stack. What is important here is that DoExtShuffle() was built by a complex combination of choices, the main purpose of which being to reduce the size of the C functions:
 static void DoExtShuffle( uint32_t * p_bordel )
  
     uint32_t i_ret;
     i_ret = FirstPass( p_bordel );
     SecondPass( p_bordel, i_ret );
     ThirdPass( p_bordel );
     FourthPass( p_bordel );
  
Note how i_ret is not reused and could be merged into the p_bordel array, or maybe SecondPass() merged into FirstPass(). This choice is definitely a legacy of how the code evolved. And the Sony equivalent: a perfect match.
 .text:10089F3C xxxxx:
 .text:10089F3C   mov   ecx, esi
 .text:10089F3E   call  yyyyy
 .text:10089F43   push  eax
 .text:10089F44   mov   eax, esi
 .text:10089F46   call  zzzzz
 .text:10089F4B   add   esp, 4
 .text:10089F4E   call  ttttt
 .text:10089F53   call  uuuuu
After having studied the Sony code for a while, I have of course gathered dozens of such examples. But I also discovered a few new things. Where does the DRMS code come from? The code undoubtedly comes originally from VLC, but it has traveled a lot. I would be surpried if it came directly from VLC, as no other part of VLC is included with the rootkit. And although there are parts of FAAC in the Sony code and FAAC includes VLC s drms.c, the version currently in the FAAC CVS is horribly outdated. Sebastian Porst also noticed a few obvious differences between the Sony code and the version of drms.c present in VLC. The most obvious being this one:
 if( p_shuffle->i_version == 0x01000300 )
  
     DoExtShuffle( p_bordel );
  
Which became:
 .text:10089F2E   cmp   eax, 1000300h
 .text:10089F33   jz    short DoExtShuffle
 .text:10089F35   cmp   eax, 1000400h
 .text:10089F3A   jnz   short skip
 .text:10089F3C DoExtShuffle:
 .text:10089F3C   ...
 .text:10089F58 skip:
 .text:10089F58   ...
That 0x01000400 is a version check for 4th generation iPods firmwares. I also discovered at least 40 KB of new lookup tables that seem to be used for more buffer shuffling. At first I thought it was simply F4I s DRM implementation, but the shuffling calls are nested with iPod hardware information retrieval from our DRMS code, so they re really part of drms.c. Sony distributing a DRMSv3 descrambler? The only explanation I can think of is that someone took the VLC code, added support for an upcoming Apple DRMS format version and redistributed the software without letting the VLC authors know, probably violating the GPL (I only say that because I have not found the software yet, but I feel pretty safe in saying it). Since it is based on GPL software, I was already entitled to ask Sony for the source code of ECDPlayerControl.ocx. But as the copyright holder of a significant part of the software they counterfeited, maybe I have a greater chance of being heard. Not that it would be difficult to reverse-engineer it yet another time, but it would be awesome if the next opensource iTunes Music Store file player was contributed by Sony!

Erich Schubert: What SSH scanners try to do

I've been recently investigating a poorly maintained box (granted, it was just a workstation used for surfing the web) which was behaving oddly. In fact you could not longer login via SSH. I quickly noticed that there was a non-working sshd on it, in /usr/local/bin. So I thought - why would a badly maintained box have a non-standard SSH on it? This made me very suspicious, so I immedeately ran chkrootkit. It didn't find anything except it told me that someone had tampered with the wtmp file. The "tampering dates" aligned with the creation times of the ssh. A quick "find" run came up with the tool to do so, too. A quick check in the logfiles - which were fine, since they were not standard syslog, probably - showed that a SSH scanner had managed to login into an unprivileged account with a weak password, then used a kernel exploit from january to gain root privileges. Apparently he was unsatisfied with the sshd on the box, so he tried to put a different version on it, which, well, didn't work and he could no longer logon to the box himself. A rootkit was apparently not yet installed (verified after a clean boot), he was just about to setup his own sshd... maybe he had noticed that the box was just a stupid surfing box and then didn't care enough to cover his tracks (or just shoot himself in the foot by breaking the sshd) So if you are running boxes on the internet: (PHP guys: yes, I know that there are some good PHP scripts. But there are tons of badly written ones, too... and PHP is a major intrusion vector, and the privilege escalation I've seen here would have worked just fine with a PHP installation not using safe mode and safe_mode_exec_dir) A firewall I maintain at our university has been tracking ssh connections using the recent match for quite some time, and a nice side effect is that it reduces all their "spam" in your logs, too (in case you bother to read them. Do at least read the logcheck results!)

21 November 2005

Wouter Verhelst: Sick people

No, I'm not talking about sick, as in, crazy people. I'm talking about real, actual, sick people. Two guys that are rather close to me and that are in hospital currently. One of them is my dad. Some infection to his intestines, and they need to check him up. Hopefully it's not all too serious. The other is my best friend that I should try to see way more often. He's had issues with his health for quite a while now, and is in hospital (again). I'm not going to add any details, not unless they ask me to. Me, I'm healthy as a baby. However, I'm so busy these days that I don't even have the time to show the decency to pay both of you a visit. And that sucks. Hang in there. Both of you.

Christine Spang: SPI

I found in my mailbox this morning an announcement of my acceptance as an SPI Contributing Member. I was actually somewhat suprised as it was a while ago that I applied (sometime around July or August, IIRC); I’d almost forgotten that I’d even done so. Happy times.

Wouter Verhelst: Blog value

I knew it for a while already, but now it's official:

My blog is worth $0.00.
How much is your blog worth?
The point of this exercise? To point out how silly most of those memes really are. I mean, my blog would be worth nothing 'cause I don't use any technorati tags? What's next, I'm not officially using a computer if it doesn't run Windows? Hah.

Norbert Tretkowski: Immortel

I have to fully agree with Meikes estimation about Immortel. I saw the movie in the sneak preview half a year ago, and really liked it. Two weeks ago, I bought the DVD, and watched the movie about ten times since then. It's just great. And I'm just now watching it again.

Next.

Previous.