We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 032639c commit 2aed681Copy full SHA for 2aed681
pp_sys.c
@@ -5436,6 +5436,9 @@ PP(pp_gpwent)
5436
I32 which = PL_op->op_type;
5437
SV *sv;
5438
struct passwd *pwent = NULL;
5439
+#ifdef __linux__
5440
+ const Uid_t euid = geteuid();
5441
+#endif
5442
/*
5443
* We currently support only the SysV getsp* shadow password interface.
5444
* The interface is declared in <shadow.h> and often one needs to link
@@ -5562,7 +5565,11 @@ PP(pp_gpwent)
5562
5565
* --jhi */
5563
5566
/* Some AIX setups falsely(?) detect some getspnam(), which
5564
5567
* has a different API than the Solaris/IRIX one. */
5568
+
5569
# if defined(HAS_GETSPNAM) && !defined(_AIX)
5570
+# ifdef __linux__
5571
+ if (!PerlProc_geteuid())
5572
+# endif
5573
{
5574
dSAVE_ERRNO;
5575
const struct spwd * const spwent = getspnam(pwent->pw_name);
0 commit comments