We’ve all been there, I’m sure: you wake up, peel the keyboard off one side of your face and the pizza off the other then, about 5 minutes later, face some difficult question such as “where the hell is my root partition?”
That is in many respects not the worst outcome, because if your computer were bootable you might find you’re now running the HURD, or a Chinese version of Vista, or that you felt rewriting your window manager in a blend of Scheme/Haskell/Assembler was a great idea.
To be honest, though, I’m always a little bit relieved to find one of the above. What I dread is finding everything is apparently normal, Thunderbird still opens, and has new mails titled Order Confirmation, Your Order Has Dispatched.
Oh god, not again.
Anyway, the thought occurs (while I’m sober) that some kind of technological mitigation of this problem must be possible. Googling for USB breathalysers will soon reveal that such things do exist: Breathalyser with a USB connection. So, all we need is some Linux drivers and a PAM module; let’s call it pam_pissed. A bit of:
auth required pam_pissed max_BAC=0.0005
in the right places should sort most of the above problems out. But noes! Firefox and friends don’t go through PAM… However, I think it shouldn’t be too hard to hook a PAM call into the about-to-go-secure code. Since it would be really annoying to breathalyse yourself every time you went to an HTTPS site, it would probably be prudent to combine this with pam_time:
auth sufficient pam_time auth required pam_pissed max_BAC=0.0005
That will bypass the pam_pissed check if the pam_time check passes, so you will only be asked for a breath sample in your usual drinking hours.