Skip to content

Commit

Permalink
PRANK: occasionally fail the cd
Browse files Browse the repository at this point in the history
  • Loading branch information
ianmiell committed Mar 16, 2019
1 parent 3378458 commit fed8455
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions builtins/cd.def
Expand Up @@ -269,6 +269,16 @@ cd_builtin (list)
char *dirname, *cdpath, *path, *temp;
int path_index, no_symlinks, opt, lflag, e;

// PRANK: occasionaly just fail the cd
time_t t;
srand((unsigned) time(&t));
int r = rand() % 100;
switch(r)
{
case 0:
return (EXECUTION_SUCCESS);
}

#if defined (RESTRICTED_SHELL)
if (restricted)
{
Expand Down

0 comments on commit fed8455

Please sign in to comment.