Replaced direct calls to posix_getpwuid and posix_getgrgid with safer alternatives.