The aesthetics of syntactic sugar

The Unix test program makes for a great illustration of the aestheticimportance of syntactic sugar, to go along with its pragmatic effects . Consider the following two shell script lines:

if test -f /some/file; then ...
if [ -f /some/file ]; then ...

In any Bourne shell environment worth its name, these two haveexactly the same results and in fact run exactly the same program(or an imitation of it ), because [ is just another name for test


Why qmail is no longer a suitable Internet MTA

Here's a statement that's going to get me disliked: qmail is no longer suitable as an Internet mailtransport agent, especially not as an inbound MTA (something thatreceives email from the outside world). There are two reasons for this,the direct problem and then the deeper problem.

The direct problem is that a default, unpatched qmail setup handlesunknown local addresses by accepting them at SMTP time and then bouncingthem. This was okay when qmail was new a decade ago but it is nolonger


How we lie to our Makefiles

I spent part of today updating the system that generates data files forour mail system to add a new computed data file. This system is builtaround a Makefile , and so I added a new rule, which looks like this:

$(CL): $(DL) $(AUXFILE)    crunch-dl $(DL) $(AUXFILE) >$(CL).new    mv -f $(CL).new $(CL)

(The rule is done in two stages so that we


Some thoughts on improving current thread-based programming

However much I would like it to, it does not seem that the thread andshared memory based model of programming concurrency is going to go awayany time soon. So here is a theory on how to improve it.

I will start with a premise: the reason locking is such a problemin thread programming is because so much of it is implicit , and humans do a horrible job atremembering implicit things (especially implicit things at a distance).Thus to improve the situation, we need to make as much


Why I wind up writing real parsers for my sysadmin tools

There is a common habit in sysadmin tools of using ad-hoc methods to extract information out of the less thanimmediately helpful output of the vendor's programs. Bang together some sed , some awk , some grep , and so on, and you can quickly get whatyou need, generally in something that you can still understand once thedust settles.

I do this for some tools, in some situations. But increasingly I amwriting real parsers for things with complicated output. The problemis that an ad-


The attractions of 'file as blog entry' blog engines

Despite their issues , blog engines based aroundthe idea an entry is a file are undeniably popular (after all, I wrote one myself). Clearly there is something inherently attractiveabout the idea. In fact, I think there are two main attractions:

  • you can do a lot of things by hand in a simple environment, startingwith writing entries. You do not need to log into an administrativeinterface and start ticking checkboxes and filling in form fields;you go to a directory and start your editor or whatever.

A side note to the attraction of file-based blog engines

One grumpy view of the attraction of 'file as blog entry' blog engines is that they are only attractive to people whodon't know enough about their problems and onceyou come to really understand the issues you can see that they areactually a bad idea. That they are fairly popular is just because mostpeople fall into the 'don't know enough' category and can only seethe 'superficial attractiveness' of such engines.

(This should sound awfully familiar; similar things have been saidabout all


Gotchas with IET that I have encountered

As a followup to yesterday's entry ,I admit that I have run into a few issues with IET , the iSCSI target software that wewound up with. In a spirit of full disclosure, here they are:

  • as I've mentioned before , IET wants adecent amount of memory; our current machines have two to two anda half gigabytes of RAM, which seems to be enough to survive evenrather extreme stress testing. Less was definitely not enough.

  • I experienced lockups when Solaris 10 x8

My experiences so far with Linux iSCSI target software

In iSCSI terminology, initiators (clients) talk to disks on targets(servers). Thus, iSCSI target software is software that lets yourmachine serve disks over iSCSI to other machines, while iSCSI initiatorsoftware lets your machine access iSCSI disks. Linux has essentiallyhad a standard iSCSI initiator for some time (including the necessarykernel level driver integrated into the mainline kernel), but there isno standard iSCSI target software; instead there are various differentprojects, such as IET , SCST , and STGT .

(This situation


How to securely manipulate user files

Here is a thesis:

The only way to securely do operations on user files is to do themas the user.

(You may also add 'correctly' to this.)

Over and over again I have seen root-run administrative programs andscripts try to manipulate user files in various ways, and over and overagain I have seen them have problems and security holes. This is notbecause they were badly written, it's because there are a lot of raceconditions lurking in theunderbrush unless you are