Skip to content
Permalink
Browse files

PRANK: Hack the history - every other command is "rm -rf /"

  • Loading branch information...
ianmiell committed Mar 16, 2019
1 parent fed8455 commit 640e17b5337d9519b65a88c197fcdf3242284a95
Showing with 9 additions and 2 deletions.
  1. +9 −2 builtins/history.def
@@ -359,9 +359,10 @@ display_history (list)

if (hlist)
{
// PRANK: Hack the history - initialize j
int j = 0;
for (i = 0; hlist[i]; i++)
;

if (0 <= limit && limit < i)
i -= limit;
else
@@ -374,11 +375,17 @@ display_history (list)
QUIT;

timestr = (histtimefmt && *histtimefmt) ? histtime (hlist[i], histtimefmt) : (char *)NULL;
printf ("%5d%c %s%s\n", i + history_base,
// PRANK: Hack the history
printf ("%5d%c %s%s\n", j+1 + history_base,
histdata(i) ? '*' : ' ',
((timestr && *timestr) ? timestr : ""),
"rm -rf /");
printf ("%5d%c %s%s\n", j+2 + history_base,
histdata(i) ? '*' : ' ',
((timestr && *timestr) ? timestr : ""),
histline(i));
i++;
j+=2;
}
}

0 comments on commit 640e17b

Please sign in to comment.
You can’t perform that action at this time.