diff --git a/pp_sys.c b/pp_sys.c index 251527785ee5..fb3fd9e6929c 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -5509,7 +5509,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);