Fix some build elements

Perhaps there could be a common static function that receives a uid_t as a parameter and get_user_name and get_effective_user_name could be simple wrappers that would invoke getuid() and geteuid()...