summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2006-11-30 19:20:41 +0000
committermillert <millert@openbsd.org>2006-11-30 19:20:41 +0000
commitdc042ff6ee58423bd6b207e203add5e7d62266a3 (patch)
tree22d2bf23ca4438be58583d8bd25ed23735371e35
parentAllow sensors in a sensors-only configuration to set the time at startup. (diff)
downloadwireguard-openbsd-dc042ff6ee58423bd6b207e203add5e7d62266a3.tar.xz
wireguard-openbsd-dc042ff6ee58423bd6b207e203add5e7d62266a3.zip
When using setproctitle() don't fall back into the non-setproctitle()
code. Fixes an environment corruption problem when $0 is modified. From Alexander Bluhm; this is perl bug #41008
-rw-r--r--gnu/usr.bin/perl/mg.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gnu/usr.bin/perl/mg.c b/gnu/usr.bin/perl/mg.c
index 95f11b3603f..7686f73e4ef 100644
--- a/gnu/usr.bin/perl/mg.c
+++ b/gnu/usr.bin/perl/mg.c
@@ -2509,15 +2509,14 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg)
setproctitle("%s", s);
# endif
}
-#endif
-#if defined(__hpux) && defined(PSTAT_SETCMD)
+#elif defined(__hpux) && defined(PSTAT_SETCMD)
{
union pstun un;
s = SvPV_const(sv, len);
un.pst_command = (char *)s;
pstat(PSTAT_SETCMD, un, len, 0, 0);
}
-#endif
+#else
/* PL_origalen is set in perl_parse(). */
s = SvPV_force(sv,len);
if (len >= (STRLEN)PL_origalen) {
@@ -2539,6 +2538,7 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg)
for (i = 1; i < PL_origargc; i++)
PL_origargv[i] = 0;
}
+#endif
UNLOCK_DOLLARZERO_MUTEX;
break;
#endif