I had a machine that would immediatly logout after logging in, however, I could logon in safe mode, unlike most people with this issue. There are hundreds of sites detailing a fix for a different issue with similar symptoms. This is the result of some malware called BlazeFind. There is a good writeup here: http://www.winxptutor.com/wsaremove.htm
My issue was not related to BlazeFind and userinit.exe problems. It turns out there is a company called Tenebril that makes several programs that may cause you to logoff right after logging in. I can confirm that on this particular machine, a program called GhostSurf was at fault. I have also seen reports of a program by the same company called SpyCatcher that also caused the same issue.