Skip to content

Commit

Permalink
disable some environment settings with fuzzing
Browse files Browse the repository at this point in the history
  • Loading branch information
plusun committed Jun 20, 2018
1 parent 3fe4285 commit 61a2c9e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bin/sh/var.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,10 @@ INIT {
* START_TIME belongs only to this shell.
* LINENO is simply magic...
*/
#ifndef ENABLE_FUZZER
snprintf(buf, sizeof(buf), "%d", (int)getppid());
setvar("PPID", buf, VREADONLY);
#endif
setvar("IFS", ifs_default, VTEXTFIXED);
setvar("PSc", (geteuid() == 0 ? "#" : "$"), VTEXTFIXED);

Expand All @@ -245,6 +247,7 @@ INIT {
setvar("START_TIME", buf, VTEXTFIXED);
#endif

#ifndef ENABLE_FUZZER
setvar("NETBSD_SHELL", NETBSD_SHELL
#ifdef BUILD_DATE
" BUILD:" BUILD_DATE
Expand Down Expand Up @@ -277,7 +280,7 @@ INIT {
" BOGUS_NOT"
#endif
, VTEXTFIXED|VREADONLY|VNOEXPORT);

#endif
setvar("LINENO", "1", VTEXTFIXED);
}
#endif
Expand Down

0 comments on commit 61a2c9e

Please sign in to comment.