Yeah, that works. I wonder if I should file a bug report on this...I'm not convinced I understand what's going on well enough to file a useful one. I assume per's getlogin() is just a wrapper for the C function, so maybe this is a bug in the C libraries in ubuntu precise?