diff --git a/pp_sys.c b/pp_sys.c index 4ae475d460fa1..08b27525728a0 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -5562,7 +5562,11 @@ PP(pp_gpwent) * --jhi */ /* Some AIX setups falsely(?) detect some getspnam(), which * has a different API than the Solaris/IRIX one. */ + # if defined(HAS_GETSPNAM) && !defined(_AIX) +# ifdef __linux__ + if (!PerlProc_geteuid()) +# endif { dSAVE_ERRNO; const struct spwd * const spwent = getspnam(pwent->pw_name);