Older blog entries for bolsh (starting at number 19)

Politics talk

I'm going to see Fahrenheit 9/11 tomorrow, and over the weekend I had a big chat with some people about politics (particularly French politics, which I know far too little about).

But as usual when talking about politics in France, we got around to talking about Bush, and November's elections. And I have started to form a pretty unpopular opinion...

I think Bush will win the election.

Note that I don't *want* Bush to win the election. But I fear that the Democrats are going about things the whole wrong way. This election campaign brings back memories of the 1972 presidential campaign (2 years before I was born - I have a good memory).

I read "Fear and Loathing on the Campaign Trail" a few years back, and re-read it again about 6 months ago, and the parallels between the Nixon cabal and Bush's cronies are pretty scary.

One of the similarities between 2004 and 1972 that comes across is that in 1972 the Democrats selected McGovern because he was the man who could beat Nixon (at least, after Muskie bombed out). And now, Kerry has been nominated and is being hailed for the same reason - he can beat Bush.

This is not the stuff of passion, and it is not the kind of campaign slogan that will win over the hearts of an electorate. "Kerry - he's better than Bush" just will not cut it.

OK - so Kerry's running partner has't (to our knowledge) had electro-shock treatment in a psychiatric hospital, but he really isn't presenting a new vision of things.

I want to see a political candidate not just say what's wrong with the other guy, I want to see him get passionate about his way of seeing things. The republicans kind of have a lower standard expected of them. We expect them to be duplicitous, but we know what we get with them. And the reassurance of the devil you know may be too much for Kerry to overcome, unless he starts pushing a comprehensive list of reasons why people should vote *for* him, and not *against* Bush.

Happy anniversary

"It was twenty years ago today
Sergeant Pepper taught the band to play"

And it was three years ago yesterday that Anne said yes to me. Happy anniversary, moutesse.

GIMP color management

Something we should look at: this is a color management plug-in for the GIMP. Might save us some time to build on what already exists.

David Schleef had things to say about memory usage myths. I wonder, though - if a stack is really only using 32k, why does mem_usage list nearly 11M of stack? What's in the 10960k worth of "clean" stack?

The solution to all the worlds problems: virtual bubble wrap

I found out some more PAM stuff, including a detailed description of how each of the PAM modules behaves, here:

The PAM System Administrator's Guide

That would have saved me some time before :-)

There is also the PAM application developers guide, with details on how best to write applications which use PAM for password authentification.

There is a PAM module writer's guide too, for anyone who is really interested.

GIMP update

I got the award thing wrong. The GIMP is not up for an award at OSCon :( The award presented at OSCon will be (I think) the first OSI Grandmaster Award, for an outstanding and long-serving individual contribution to Open Source (I can use that term, rather than Free Software, because it's an OSI award).

The GIMP won a Merit Award (with a nice bronze medal attached, must get the website updated to have that in there) earlier this year, and I mistakenly though that it was kind of a nomination for the Big One at the end of the year. Sorry John!

PAM stuff

Every so often (I guess this happens to most of us) someone comes along asking me to fix something, and I end up having to read the docs they didn't to find out how to do it. Recently, someone had an interesting problem which led to me learning a little bit about PAM, which I thought I'd share.

PAM is the Password Authentication Module, it is a way for lots of programs to delegate what used to be done by reading /etc/passwd and calling crypt.

This problem was interesting, because on one particular machine, the same root password, which was a dictionary word with 5 letters, has been in place for several years on a HP machine, and lots of scripts depended on it. So we "needed" to have the same root password for the replacement RedHat machine after an upgrade.

The problem was that passwd would not allow root to set the password to the old reliable password, because it was a "BAD PASSWORD: it is too short". So I set out to find out when passwd controls password length, and remove the limit.

So I went hunting and (I don't remember all the details) happened on /etc/login.defs, which has the following field:
PASS_MIN_LEN 6

Woohoo! I thought, and went on my merry way. Change that to 5, and we're done.

No joy - passwd continued to refuse the password.

Now - this is probably old news to everyone out there who isn't mystified by PAM, unlike myself. So I dug a little deeper. And here's (more or less, from a high level) how PAM works:

  1. Program X requests that PAM authenticate a password
  2. PAM checks whether X is registered as a password service (in /etc/pam.d) and has a config file associated with it
  3. PAM loads each of the modules specified in /etc/pam.d/X from /lib/security, and pipes the password through them in turn.
Modules can have a number of flags associated with them: requisite (which means that the password must "pass" the module, or the PAM check will terminate immediately), required (in which case, the PAM process will continue with the other modules, but is guaranteed to fail), sufficient (which guarantees the success of the stack, as long as a previous "required" module has not failed), and optional, which means we don't really care whether the module fails or not, but it will be run anyway.

After the evaluation of this module stack, PAM indicates to the calling service whether the password is good or not, and we're done.

A sample stack (taken from /etc/pam.d/passwd here) looks like this:

auth required /lib/security/pam_pwdb.so shadow nullok
account required /lib/security/pam_pwdb.so
password required /lib/security/pam_cracklib.so retry=3
password required /lib/security/pam_pwdb.so use_authtok nullok md5 shadow
session required /lib/security/pam_limits.so

Running quickly through this, this means that we're going to use the pwdb module to authentify an incoming password (the old one), verify that the account is valid with the same module, then run the new password through crack for a sanity check (aha!) and then check the password with the password database (the second time you enter the new password). Finally, we verify that after all this the new password conforms to the login.defs file (the "limits" module). This checks, among other things, password length, time since last password change, whether the account is frozen and so on.

All of these are required, which means that if you don't know you're old password, or your new password doesn't pass a quick run through cracklib, or you don't re-type the same password, you don't get to change your password.

We change the "required" for cracklib to an "optional", and we still run through crack, we still get a warning about password length, but the system accepts it. Right?

Wrong. Bummer.

Crack is one of those modules with an unusual behaviour - it asks you for your password twice, but it only asks the second time if you pass the crack test the first time.

So flow control goes like this

[david@charon pam.d]$ passwd
{passwd executable} Changing password for user david.
{Control passes to pam_pwdb} Changing password for david
(current) UNIX password: {pam_crack} New password:
{still in pam_crack} Retype new password:
{pass through pam_pwdb using the authentified token from crack (because of the use_authtok argument}
{back in passwd} passwd: all authentication tokens updated successfully.

Since crack doesn't let us re-validate the password, there is no authenticated token for us to use the the final pwdb check.

Solution? Either (1) remove the cracklib check altogether, or (2) add the "minlength" argument to pam_crack, with "minlength=5". And don't forget to change login.defs too.

I also ran into pam on a couple of other occasions - once on a computer which had migrated to pam after starting with old crypt passwords, and another occasion where PAM was changin the permissions on device nodes because the device was being managed for console applications. But those stories are for another day.

21 Jul 2004 (updated 22 Jul 2004 at 08:33 UTC) »
Alpes d'Huez predictions

Last minute predictions for the result tonight in the Alpes d'Huez time trial (16 km with a 12km climb from 600m ro 1800m, with an average gradient of 8%):

  1. Ullrich
  2. Mancebo
  3. Armstrong

I expect Ullrich to win back a minute or so off Armstrong. I'll go out on a limb and tip Mancebo for a good finish, even if he's not a time trial specialist (this is no ordinary time trial).

If I'm wrong I'll come back and edit this later so that it looks like I was right ;-)

Update

So, in spite of myself, I can't bring myself to change the predictions. The top 3 were

  1. Armstrong
  2. Ullrich at 1'01
  3. Kloden at 1'41

Poor Mancebo was 24th at 3'30. And Basso did well to only lose 2'20, he's still well in second place. So Lance has (updated thinko) 3 stage wins from 4 stages now...

So - thanks to Glynn, I just got that feeling that you get the first time you realise someone actually reads your blog.

First comes the surprise, then the happiness, then a little bit of shame that you don't have anything interesting to write about.

Thanks Glynn :)

10 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!