Changed func getlogin() to getpwuid(getuid())