diff mbox series

[PATH] forgoten set $PPID readonly

Message ID be7ceb79-c721-740a-7f5a-b65b15d4da24@simtreas.ru (mailing list archive)
State Rejected
Delegated to: Herbert Xu
Headers show
Series [PATH] forgoten set $PPID readonly | expand

Commit Message

Vladimir N. Oleynik Feb. 3, 2021, 12:54 p.m. UTC
Hello.

You probably forgot to specify the readonly flag for $PPID.
Micro patch attached.


--w
vodz

Comments

Herbert Xu April 5, 2024, 8:41 a.m. UTC | #1
On Wed, Feb 03, 2021 at 04:54:24PM +0400, Vladimir N. Oleynik wrote:
> 
> You probably forgot to specify the readonly flag for $PPID.
> Micro patch attached.

This is not defined by POSIX.  In fact there seems to be no consensus
amongst other shells.

Thanks,
diff mbox series

Patch

--- var.c~	2021-01-31 12:30:38.000000000 +0400
+++ var.c	2021-02-03 16:46:34.657412861 +0400
@@ -139,7 +139,7 @@ 
 	setvareq(defoptindvar, VTEXTFIXED);
 
 	fmtstr(ppid + 5, sizeof(ppid) - 5, "%ld", (long) getppid());
-	setvareq(ppid, VTEXTFIXED);
+	setvareq(ppid, VTEXTFIXED|VREADONLY);
 
 	p = lookupvar("PWD");
 	if (p)