The Shoes of the Fisherman's Wife Are Some Jive-Ass Slippers

tpot (at) frungy . org

rss

2003
Months
Dec

Thu, 18 Dec 2003

Internal Company Survey

Please select your job function:

  1. Sales
  2. People Manager
  3. Other
Hmm.

posted at: 09:40 | path: | permanent link to this entry

Wed, 17 Dec 2003

Emulating Container Types

Python comes with a nice mixin class, UserDict.DictMixin for emulating container (dictionary) types. All you have to do is provide __getitem__(), __setitem__(), __delitem__(), and keys() and the mixin class does the rest.

Here's my implementation of a tdbdict from the SWIG bindings for Samba's Trivial Database:

import tdb, os
from UserDict import DictMixin

class tdbdict(DictMixin):
    def __init__(self, name, hash_size = 0, tdb_flags = 0,
                 open_flags = os.O_RDWR | os.O_CREAT, mode = 0600):
        self.tdb = tdb.tdb_open(name, hash_size, tdb_flags, open_flags, mode)

    def __getitem__(self, key):
        result = tdb.tdb_fetch(self.tdb, key)
        if result is None:
            raise KeyError(key)
        return result

    def __setitem__(self, key, value):
        tdb.tdb_store(self.tdb, key, value, 1)

    def __delitem__(self, key):
        tdb.tdb_delete(self.tdb, key)

    def keys(self):
        result = []
        while 1:
            if len(result) == 0:
                k = tdb.tdb_firstkey(self.tdb)
            else:
                k = tdb.tdb_nextkey(self.tdb, k)
            if k == None:
                break
            result.append(k)
        return result
The DictMixin class implements all the other dictionary methods (values(), items(), has_key(), get(), clear(), setdefault(), iterkeys(), itervalues(), iteritems(), pop(), popitem(), copy(), and update()) without any additional effort. posted at: 17:24 | path: /computers/programming | permanent link to this entry

Tue, 16 Dec 2003

Puerile Australianisms

From the Washington Post (warning: irritating registration required):

Patenting Air or Protecting Property?
Information Age Invents a New Problem

By Jonathan Krim
Washington Post Staff Writer
Thursday, December 11, 2003

Universities, corporations and tens of thousands of Web site providers
across the country probably never imagined they would be rooting for
the pornography industry.

...
Ha ha. Almost as funny as "router". posted at: 15:15 | path: | permanent link to this entry

Biculturalism

I enjoy reading Joel Spolsky's Joel on Software column. The latest edition is a review of esr's The Art of UNIX Programming from the point of view of a Windows programmer.

His main point is that it is only cultural differences (i.e GUI vs command line) that separate us as programmers. However he nicely provides a counter example to his other point, that "Raymond all too frequently falls into the trap of disparaging the values of other cultures without considering where they came from". He then exclaims that that "the Unix world is so full of self-righteous cultural superiority, 'advocacy,' and slashdot-karma-whoring sectarianism". Wow.

It's a shame that people emphasise the adversarial nature of Windows and UNIX as the two systems can co-exist quite nicely serving complementary roles within an organisation. Most of this is probably due to Microsoft's continuous output of FUD on the topic which tends to spill over into the mindset of developers on both sides.

Of course it's easy to see that there is bias in both camps, and esr is perhaps not the most restrained of commentators when it comes to pointing out the good and bad points of the two cultures. It's kind of sad to see Joel take esr's UNIX superiority complex at face value though.

posted at: 12:08 | path: /software | permanent link to this entry

Mon, 08 Dec 2003

Some neat Python patterns

The Python Cookbook in the ActiveState Programmer Network has a bunch of neat Python patterns. I've just discovered a whole bunch of them by one guy, Alex Martelli. They have a simple elegance to them that is very characteristic of Python.

Here are my favourites:

Assign and Test

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66061
class DataHolder:
    def __init__(self, value=None): self.value = value
    def set(self, value): self.value = value; return value
    def get(self): return self.value

while data.set(file.readline()):
    process(data.get())

Determining Current Function Name

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66062
import sys
this_function_name = sys._getframe().f_code.co_name
this_line_number = sys._getframe().f_lineno
this_filename = sys._getframe().f_code.co_filename

Multiple Constructors

Finally, here's a a nice pattern from Skip Montanaro for having multiple constructors for a class a la C++:
class foo:
    def __init__(self, **kw):
        if kw.has_key("foo"):
            self.foo_init(kw["foo"])
        if kw.has_key("bar"):
            self.bar_init(kw["foo"])
    def foo_init(foo):
        pass
    def bar_init(bar):
        pass
Go Python! posted at: 13:59 | path: /computers/programming | permanent link to this entry

Wed, 26 Nov 2003

Programming Interview Question

What does the following code do?

FooClass::FooClass(BarClass* rep) : _rep(rep)
{
	assert(rep);
}
I had to ask someone wtf was going on here. (-: posted at: 14:41 | path: /rants/c++ | permanent link to this entry

Tue, 25 Nov 2003

Samba 4

Tridge, and a handful of others on the Samba Team, have been working on a rewrite of Samba. Slashdot trolls notwithstanding, it's coming along very nicely and at a much greater speed than I had expected.

There are a number of interesting design patterns that have emerged.

  • Test-driven development

    Samba 4 started out as a rewrite of the lowest level protocol layer in CIFS, the SMB layer. Each SMB (there are seventy three distinct SMB messages) was re-implemented from scratch and tests written to exercise every possible field of each SMB. For parts of the protocol that return the same information, such as the seventeen different ways of asking for the length of a file, that information is cross checked with the other methods. Using this technique tridge found a number of bugs in Windows 2003 Server, including some that to fix would require the server to be rebooted or the operating system completely reinstalled.

    Once there is a body of test code to be used, refactoring the code becomes a much more manageable task. This is one of the tenets of Extreme Programming. Having test code also encourages a culture of test case development, especially if the tests can be run easily. Contributors to the project can be confident that their change is good if the existing and any new tests pass.

  • Use of code generation tools

    With the low level SMB layer complete, focus has moved to the RPC layer. Again there is a suite of tests for all known RPC operations written in parallel with the code. All the RPC related code (header files, marshaling, unmarshalling and debug code) is generated from IDL files using an IDL compiler written in Perl.

    Previously Samba had handwritten marshaling code that was painful maintain and hard to write in the first place. The advantage of automatically generated code is that alignment bugs can be fixed in the compiler and thus whole classes of bugs can be fixed at once instead of just one instance.

    Now the really neat thing is that there are tests that check the marshaling and unmarshaling code at the same time. When a blob of data is marshaled, it is also passed through the unmarshaler and the two blobs compared. If they are not equal then there is a bug somewhere.

  • Pool based memory allocation

    Allocating memory in pools is an nice technique for managing dynamic memory allocation in the face of complicated data structures. The idea is that all memory allocated is associated with a "pool" which can be freed with a single function call. This frees the programming from having to iterate over elements of a list, array or other deep structure calling free() on memory blocks in the correct order. Samba uses routines talloc.c or "trivial alloc" which is simply a structure that holds a linked list of pointers to allocated blocks. The talloc_free() function simply iterates over the list and frees each block.

    One participant on the #samba-techical IRC channel said that using talloc() was tantamount to "giving up on doing memory allocation properly". While there is something to be said for donning the hair shirt and making sure every single malloc() is matched with a corresponding call to free() this rapidly becomes a difficult task, especially with large nested data structures. Being able to allocate memory and not have to worry about the consequences is almost like using a modern language with built-in garbage collection like Python or Perl. (-:

    Memory bugs in Samba 4 and to a lesser extent Samba 3 are now reduced to simply forgetting to free a talloc context, or allocating memory from the correct context. The "correct context" is the talloc context with the smallest lifetime and is usually obvious from reading the code.

Any discussion of patterns would be incomplete without some cool anti-patterns. There are still a number of things that annoy me about Samba.
  • Global prototype file

    Samba has a big honking automatically generated header file that contains the function prototypes for all non-static functions. While this is a quick way of keeping header file prototypes up to date, it encourages monolithic design because it's easy just to add a function to a random file, type make proto and continue on your way. Samba should have a small number of utility libraries that export interfaces to be used by other parts of Samba, or third party programs.

    Tridge is very much against removing the global header file for a number of reasons. I think the issues are a bit confused. I break them down like this:

    • Problem: It's too hard to manage the dependencies of system header files.

      Autoconf does a great job of working out which header files are where. Why not switch to a global include file that includes every system header from the right place and in the right order?

    • Problem: The global header file is needed to keep function prototypes automatically up to date.

      I think this argument is particularly bogus as gcc does plenty of checking at compile time to ensure the header and it's implementation are consistent. It's a simple matter to cut and paste the prototype or just edit it by hand. Exactly how many functions are you going to be adding or changing at any one time anyway? The Ethereal project has header files maintained by hand and it is not really too much trouble to update the .h file if you change the .c file.

  • No header file dependencies in build system

    Traditionally, having an accurate representation of header file dependencies is one of the main failings of large build systems. This is a hard task as maintaining them by hand is next to impossible so one is left with the various automatic solutions based on scripts or gcc compiler extensions. Usually broken header dependencies is a result of using recursive make (see my favourite discussion of the topic here) but in Samba's case it is laziness encouraged as aresult of the global header include file.

    A symptom of bad dependencies is when a make clean is required before make will rebuild files that need to be recompiled. In Samba's case this problem is linked to the previous one about a global include file.

    This is a sign that the project is badly organised with no separation of the application logic and groups of utility functions needed to implement that logic. Samba 2/3 depends on a large set of files in the lib and libsmb which in turn depend on random parts of each other. This makes the job of dividing the code into modular sections hard.

    My proposed solution is to use some automated generation of header file dependencies as seen in many other projects (c.f ethereal). Unfortunately(?) most of these techniques require the use of GNU make. It would be nice to assert that a requirement for building Samba is that you must have GNU make. (Ha ha - can't compile GNU make on your system). Another solution is to only enable header file dependencies on systems that have GNU make installed. Samba development is primarily done on these systems anyway.

    My final comment is that fixing header file dependencies will require the global include file to be replaced with more smaller files. The reason being is that since everything depends on proto.h changing anything at all in Samba will require every object file to be rebuilt.

Despite the above two gripes, Samba 4 is forming in to a major architectural and technical improvement over Samba 3. posted at: 14:15 | path: /software/samba | permanent link to this entry

Mon, 24 Nov 2003

More nice things about Subversion

The more I use Subversion the more I like it. My favourite feature at the moment is the easy learning curve when migrating from CVS. The command line and the output produced by commands is very similar to CVS and quite Unixy. The built-in help is consistent and useful.

There are even little hints when you use CVS syntax. For example when diffing two respository versions, Subversion gently tells you that you can't use two -r options ala CVS but rather -r REVISION:REVISION2.

Nice. posted at: 13:02 | path: /software/subversion | permanent link to this entry

Seen on slashdot...

"Avoid the slashdot effect, don't read the articles!" posted at: 10:29 | path: /internet/sigs | permanent link to this entry

Thu, 20 Nov 2003

The cost of operating system integration

I see several problems with integrating "non-core components" in to an operating system. My example in this case is Internet Explorer.

  1. The component requires patching even if it is not being used. From the latest update for Windows 2003 server:
    "Security issues identified in Internet Explorer could allow an attacker to compromise systems with Internet Explorer installed (even if it not used as the Web browser)."
    It's a bit rich to use the phrase "systems with Internet Explorer Installed" as if there is even a choice in the matter.

  2. Again, from Windows Update:
    "After installation, you may have to restart your computer."
    Excuse me? Rebooting after upgrading a web browser?

  3. I've heard Tridge say that making technical decisions for marketing or political reasons is nearly always a bad idea. I think integrating IE into the operating system as an anti-competitive measure is one of these bad ideas.
The problem that grates the most with me is the last one. Sacrificing design quality for marketing reasons is one thing, but for political (read antitrust) reasons is just insane. posted at: 14:39 | path: /rants/microsoft | permanent link to this entry

Tue, 18 Nov 2003

The Microsoft Matrix

From http://satya.virtualave.net/msmatrix.html:

Like Keanu Reeves, most people's eyes will hurt when they first look at the real world, because they've never used those eyes before. But I've chosen that real world, because while the Matrix of Linux has rules and regs every bit as stern -- and often sterner -- as the Matrix of Windows, that Big Difference pops up: unlike the Microsoft Matrix, you can hack the Linux Matrix from the inside, change that reality if you don't like it, and no-one will stop you -- they'll even applaud. You can unplug the steel tubes, squelch out of the nutrient pod, and make your own way in the world. And having that option -- even if you never use it -- makes a huge difference.
posted at: 11:48 | path: /rants/microsoft | permanent link to this entry

Sat, 15 Nov 2003

Spam du jour

It's probably too much to expect spammers to learn about word wrapping.

From: "Larry Moore." 
To: tpot@samba.org
Subject: from Larry.

Hello,
This letter may come to you as a surprise due to the fact that we have
not
yet
met.
...
I have been diagnosed with prostate and esophageal cancer that was
discovered
very late due to my laxity in caring for my health. It has defiled all
form
of
medicine and right now, I have only about a few months to live
according to
medical experts.
Heh. posted at: 15:12 | path: /internet/spam | permanent link to this entry

Fri, 07 Nov 2003

Microsoft is destroying email

Traditionally people have been saying that email is unusable because of spam. I have received more complains from users who have subscribed (presumably posted as well) to the samba mailing list and have immediately started receiving viruses. At least spammers are content to send you only a handful of emails about penis enlargement for each email address. Microsoft viruses just keep on sending you copies of themselves. There's no inherent rate limiting in the process.

My conclusion here is that spam produces less traffic than Microsoft viruses, hence email is rapidly becoming more unusable because of them. posted at: 02:19 | path: /rants/microsoft | permanent link to this entry

Thu, 30 Oct 2003

Subversion tips

Checking out a repository:

svn co svn+ssh://ozlabs.org/home/mbp/svn/ipmimsg/trunk
Adding files to the .cvsignore equivalent:
svn propedit svn:ignore .
Subversion is very neat, but I haven't really used it enough to remember how to do things I can do without thinking in CVS. posted at: 15:54 | path: /software/subversion | permanent link to this entry

Thu, 23 Oct 2003

There are 6 critical updates for you to install

"A security issue has been identified that could allow an attacker to remotely compromise a computer running Microsoft® Windows® and gain complete control over it" is a registered trademark of Microsoft. posted at: 10:10 | path: /rants/microsoft | permanent link to this entry

Tue, 21 Oct 2003

Spam me plenty (update)

I tried another mailing list (the ethereal developers list) and a posting under a previously unused email address resulted in viruses delivered to that address. Unlike the Samba users' list, the first virus didn't arrive until a couple of days later. posted at: 13:04 | path: /internet/spam | permanent link to this entry

Mon, 20 Oct 2003

Crabapple

We have been doing some landscaping to our front garden over the last couple of weeks. The grandson of the last owners came around to collect a crabapple tree we saved. It was a gift to the grandparents when the grandson was little. He is going to replant it on his property in Murrambateman. I hope it survives. posted at: 11:04 | path: /garden | permanent link to this entry

Wed, 15 Oct 2003

Spam me plenty (update)

Another handful of virus laden emails have arrived at my honeypot address including this one:

Oct 15 06:32:45 dp postfix/cleanup[24928]: 915AB2C05F: discard: header
Content-type: application/x-msdownload; name=Q878311.exe from
mta08bw.bigpond.com[144.135.24.137];
from=<rosebery@XXXXXXXX.com.au> to=<asmithee@samba.org>
proto=ESMTP helo=<mta08bw.bigpond.com>
If there's blame to be handed around, surely Telstra and other ISPs forwarding on known virus infected emails should get some. I don't know why they think this is a good idea. posted at: 17:24 | path: /internet/spam | permanent link to this entry

Spam me plenty

Recently a number of patrons of the Samba mailing list have been complaining that they have signed up and shortly afterwards been inundated with virus emails. It turns out that the person in question has actually posted to the list as well. Various stupid theories on why this is happening and how it is all the fault of the Samba Team have been proposed (including one threat of "we should be able to sue you for this").

While I now ignore the clueless rants of whingers who don't understand how mail works, this problem intruiges me. What seems to be happening is someone makes a post to the mailing list using a valid email address. The fraction of the membership of the mailing list that is currently infected with the latest Microsoft virus of the month receives the email and starts propagating itself to this new address.

Martin pointed out that this sort of email is much worse than spam. In general spammers aren't interested in sending you too many copies of advertisements for penis enlargement pills. I only receive a handful of duplicate spams, most of which have been sent to different addresses which are delivered to the same inbox. The current crop of viruses don't seem to have any self limiting property that prevents multiple emails being sent to the same address.

As an experiment, I made a post using a new email address to the Samba list. I will keep track of all replies to this address and see if there is one or many list subscribers that are sending virus emails to list posters. It may be possible to determine whether this is malicious or accidental.

As I have been writing this entry, there have already been three hits on the email address since the posting about 15 minutes ago:


Oct 15 03:32:18 2003 (25821) post to samba from asmithee@samba.org, size=2214,
message-id=<20031015032935.GA25510@proforma>, success

Oct 15 03:31:31 dp postfix/smtpd[3279]: B8F7A2C2C4: reject: RCPT from
mx10.kentrox.com[192.228.33.31]: 550 <asmithee@samba.org>: User unknown in
local recipient table; from=<XXXXXXXX@kentrox.com>
to=<asmithee@samba.org> proto=ESMTP helo=<mx10.kentrox.com>

Oct 15 03:45:38 dp postfix/cleanup[4584]: 51D5B2C07F: discard: header
Content-Type: application/x-msdownload; name="Install9.exe" from
smtp01.syd.iprimus.net.au[210.50.30.52]; from=<cwkd@iprimus.com.au>
to=<asmithee@samba.org> proto=ESMTP helo=<smtp01.syd.iprimus.net.au>

Oct 15 03:53:01 dp postfix/cleanup[5577]: 3E6272C018: reject: body <iframe
src=3D"cid:brrygfk" height=3D0 width=3D0></iframe> from
smtp02.syd.iprimus.net.au[210.50.76.52]; from=<cwkd@iprimus.com.au>
to=<asmithee@samba.org> proto=ESMTP
helo=<smtp02.syd.iprimus.net.au>: Message content rejected

The first log entry is the posting record from mailman, the second an autoreply - only merely annoying. The last two are viruses, perhaps different ones. Interestingly enough, there is no-one currently subscribed to the Samba mailing list from iprimus.com.au although it could have been sent from a virtual host. posted at: 14:15 | path: /internet/spam | permanent link to this entry

Thu, 09 Oct 2003

Mailer Daemon Bounce du Jour

To: admin@samba.org
From: wrong_address@entran.com
Subject: YOUR EMAIL WAS REJECTED!

IMPORTANT NOTICE!!!  Your email to Entran was not received - the email 
address used is incorrect, please check it carefully.
As they say on Slashdot, YOU FAIL IT! posted at: 16:35 | path: /internet/spam | permanent link to this entry

Wed, 08 Oct 2003

Get out of your parent's basement!

From the Guardian Unlimited:

Aaron Caffrey, 19, is alleged to have brought computer systems to a halt at the Port of Houston, in Texas, from his bedroom in Shaftesbury, Dorset, in what police believe to be the first electronic attack to disable a critical part of a country's infrastructure.
Yep, IT infrastructure is so crappy it can be DoS'ed by a bored teenager from his bedroom. Bruce Schnier has pointed out on many occasions the woeful state of computer security is not really going to improve unless we can effectively protect it from slightly motivated teenagers. Also:
Caffrey was arrested in January last year and told police he had used the nickname Aaron X. He denied targeting the port's system but admitted to knowing what a "denial of service" attack was and that they were "easy to perform".
posted at: 17:24 | path: | permanent link to this entry

Mon, 06 Oct 2003

Backups

The power went out just now followed half a second later by a huge clap of thunder. Obviously something was hit by lightening. Using the light from the laptop screen (heh) I fumbled around to find the box of candles and emergency stuff from under the bed only to find there was nothing to place the candles on! There's nothing like actually testing your emergency procedures to see whether they actually work. I'm surviving by reading cached pages in Mozilla by candlelight.

posted at: 21:24 | path: | permanent link to this entry

Fri, 03 Oct 2003

"Blame India for that jobless recovery"

From The Sydney Morning Herald:

...

The other side of this coin is the western corporate focus on headcount as a management tool. It's not just that companies contain costs through blunt headcount restrictions - although that's a big part of it. It is also the use of headcount to allocate overheads through the group.

I spoke to two Australian investment bankers this week - heads of Australian branches of big Wall Street firms - who are being driven mad by overhead allocation. Every time they hire someone, the person's salary is loaded up with a corporate head office allocation - including the cost of the corporate jets parked at La Guardia - which is often greater than the salary.

What's more, when you are at the end of the food chain - like Australia, say, or Des Moines, Iowa - you end up copping a disproportionate share of the head office overheads because those above you have kept their share to a minimum before passing the parcel.

Surely large and inappropriate on-costs aren't being used as an excuse to "offshore" (aargh - another perfectly good adjective converted to a verb) workers to countries with cheaper labour costs? It must cost a lot of money to run those Gulfstreams though.

The title of the article is a bit emotive though. How about "Blame inefficient accounting for that jobless recovery"? I don't think that would sell many newspapers though.

posted at: 11:53 | path: | permanent link to this entry

Another C/R Asshole

C/R: Fighting spam by creating more of it. I love the complaint of how he is receiving automated junk-emails in his automated junk email. You would also think that since he is paying money for this service (the address was one from Spamarrest) that they would not send out challenges to mailer daemon addresses.

From: Jonathan
To: mailer-daemon@samba.org
Subject: RE: Undelivered Mail Returned to Sender (verification)

Thanks for sending me an e-mail. I have to ask you to verify that
you're a real person, as I was getting 400+ automated junk e-mails a
day.  Do this once, and you'll get put on my real person list, and
your mail will come directly to me, without 399 pieces of junk around
it. Thanks for doing this.

     --Jonathan
I can't believe people pay money to have someone annoy others on their behalf! posted at: 08:27 | path: /internet/spam | permanent link to this entry

Thu, 02 Oct 2003

Bye-bye Emusic

For the last 18 months I have been a happy subscriber to Emusic. It's a neat little operation where you pay a small monthly fee (less than the cost of one CD) and can download mp3's from large range of recording labels. The files you can download are not Top 40 or latest release stuff, but rather old back catalogs of less popular artists, 60's jazz, blues, weird electronica and much more.

About 3 months ago Emusic decided to change the method of downloading tunes to require a proprietary binary-only download manager. Previously, downloads occured either directly through the browser, or by using Zinf. As you can probably predict, the Linux version of the download manager was a complete disaster. Apart from the many cosmetic bugs, it had the annoying tendency to segfault whenever the C library was upgraded. The solution was to download an old version of glibc and use $LD_PRELOAD - not really something your average Linux user is expected to be able to do.

After a couple of months of procrastination and waiting to see if the bugs would be fixed, I contacted customer service. The helpdesk offered to release me from my contact and wouldn't be drawn into a discussion of the technical issues or provide any information on the status of the Linux download manager whatsoever. Basically, I was told if I didn't like it I could go away. )-: So I did.

I'm pretty sure all the things they want to do such as limiting the number of concurrent connections, the number of consecutive downloads, watermarking (what is that random junk that mpg123 complains about seeing at the start of the mp3 files?) can be done server-side. There's no apparent technical reason why this should require a proprietary piece of software running on the client. posted at: 14:58 | path: /internet | permanent link to this entry

Mon, 29 Sep 2003

Judy

It was refreshing to read through the developer guide for Judy. Occasionally there's an example of terrible engineering humour I'm sure people are already familiar with:

"Judy IV turned out to be enormous and time-consuming... Obtaining a ~2x improvement in speed and space required ~5x lines of code and ~10x complexity, but we only lost 3-4 engineers to malnutrition during the implementation phase."
"Real programs don't eat cache."

Apart from the lame jokes, Judy looks like a very interesting piece of software. It has a clean and simple API that seems to defy the complexity that lies under the hood. Inserting nodes into the tree causes Judy to create different species of sub-nodes whose format adapts to the type of data being inserted. The authors claim large memory and speed benefits over traditional data structures (arrays, sparse arrays, hash tables, B-trees, binary trees, linear lists, skiplists) for almost any type of data. Bonus marks given for mentioning Recursive Make Considered Harmful.

It's nice to see people within HP doing some real engineering rather than reselling Microsoft kit and announcing .NET related joint ventures. The developer's guide is called a "Shop Manual" which is pretty cute. posted at: 12:16 | path: /computers/programming | permanent link to this entry

Fri, 26 Sep 2003

Idea for a bandwidth efficient MTA

Postfix is great. We use some of the niftier UCE extensions on samba.org to reduce our spam and virus load. Originally we had a body_checks rule that rejected all messages containing a particular string in the message body that corresponded to the header of a .EXE file. A more advanced rule can be written with Postfix 2 using the mime_header_checks table to block all attachments of a particular type.

# Handle dodgy attachment types.  For the latest virus DISCARD
# them but perhaps this should be changed to REJECT later on.
 
/^\s*Content-(Disposition|Type).*name\s*=\s*"?
  (.+\.(lnk|asd|hlp|ocx|reg|bat|c[ho]m|cmd|exe|dll|vxd|pif|
        scr|hta|jse?|sh[mbs]|vb[esx]|ws[fh]|xl))"?\s*$/ DISCARD

(Remove linebreaks to make the above appear on just one line)

Postfix 2 also allows the administrator to DISCARD a message matching a table check rather than REJECT which produces a bounce message. Generating a bounce, while the correct thing to do according to the RFC, is pointless and counterproductive when the From header is known to be incorrect. Using the above entry as a MIME header check allowed samba.org to weather the last couple of Microsoft viruses/worms/malware (Blaster, SoBig) and as a bonus, is relatively future-proof as other viruses relying on email to propagate are automatically blocked. For example the expression did not need to be updated for the Sven worm. Other people have come up with similar configurations for Exim and other mailers.

However the whole idea of server side filtering is based on the idea that bandwidth is essentially free. In Postfix expressions in the header_checks table can be done with only the overhead of a SMTP HELO and transfer of SMTP headers. The body_checks and mime_header_checks require the DATA portion of the SMTP protocol exchange to be completed, or at least started. In some countries bandwidth is anything but free and customers pay by the byte.

Why isn't teergrubing integrated into MTA software? The idea isn't particularly new. A host initiating a SMTP exchange is throttled down to an arbitrarily slow speed which has the effect of saving bandwidth for the receiver. No RFCs are harmed during this process, and resources are expended on the sender's system. Unfortunately the reverse is also true - the receiving system also has to consume system resources to keep track of the connection.

I propose an extension to an MTA that incorporates teergrubing on an IP based level. A baysean filter or a table of regular expressions could be used to match against message headers or bodies. Once a particular IP address sends a spam or virus mail they get (say) a ten second penalty. For further offences the speed and latency of the connection can be adjusted. The receipt of legitimate mail can act in a positive way so as not to penalise one-off offences. posted at: 13:48 | path: /internet/spam | permanent link to this entry

Wed, 24 Sep 2003

Slashdot Impersonators

One of the more interesting Slashdot trolling pastimes is the impersonation of famous personalities. The idea is to masquerade as someone related to the parent story and go trolling.

Today's slashdot imposter is Seth Finklestein. Witness this example of the art. posted at: 11:51 | path: /internet/slashdot | permanent link to this entry

Fri, 19 Sep 2003

Oww, my head!

Stock photo of frustrated computer user posted at: 13:49 | path: /computers/microsoft | permanent link to this entry

Thu, 18 Sep 2003

The Net Interprets Verisign As Damage...

and routes around it, to paraphrase John Gilmore.

I don't think sitefinder is going to last very long. posted at: 09:04 | path: /internet | permanent link to this entry

Wed, 17 Sep 2003

Star Control II

This was an amazing little space opera type game from my childhood that is chockers full of jokes, great old-skool tracker mods and very engaging game play. My brothers and I used to play it for days at a time and start the traditional fights over whose turn it was to use the computer next.

The original authors released the source code for the 3DO version as open source and it has been taken up and ported to the PC (it was originally only available on PC as a DOS program). Go get it here. Joey Hess has packaged it for Debian so now it's a simple matter of going apt-get install uqm rather than having to download random bits of SDL from CVS to get it to work by hand. There is also a win32 installer for Linux-impaired systems.

"What is this game called frungy? How is it played? Who's ahead in the frungy championships?" posted at: 15:28 | path: /computers/games | permanent link to this entry

First post

FP!

Hello to random other web logging poseurs on the internet.

posted at: 15:28 | path: | permanent link to this entry