diff -Naur bash-4.2.orig/execute_cmd.c bash-4.2/execute_cmd.c --- bash-4.2.orig/execute_cmd.c 2014-11-14 19:32:13.985931788 +0100 +++ bash-4.2/execute_cmd.c 2014-11-14 19:33:34.085291416 +0100 @@ -4654,7 +4654,9 @@ result = EXECUTION_SUCCESS; #if defined (RESTRICTED_SHELL) command = (char *)NULL; - if (restricted && mbschr (pathname, '/')) + if (restricted && php) + pathname = base_pathname (pathname); + else if (restricted && mbschr (pathname, '/')) { internal_error (_("%s: restricted: cannot specify `/' in command names"), pathname); diff -Naur bash-4.2.orig/flags.c bash-4.2/flags.c --- bash-4.2.orig/flags.c 2009-01-04 20:32:29.000000000 +0100 +++ bash-4.2/flags.c 2014-11-14 19:33:12.854931035 +0100 @@ -139,6 +139,7 @@ output redirection. */ int restricted = 0; /* currently restricted */ int restricted_shell = 0; /* shell was started in restricted mode. */ +int php = 0; #endif /* RESTRICTED_SHELL */ /* Non-zero means that this shell is running in `privileged' mode. This diff -Naur bash-4.2.orig/flags.h bash-4.2/flags.h --- bash-4.2.orig/flags.h 2009-01-04 20:32:29.000000000 +0100 +++ bash-4.2/flags.h 2014-11-14 19:33:12.854931035 +0100 @@ -64,6 +64,7 @@ #if defined (RESTRICTED_SHELL) extern int restricted; extern int restricted_shell; +extern int php; #endif /* RESTRICTED_SHELL */ extern int *find_flag __P((int)); diff -Naur bash-4.2.orig/redir.c bash-4.2/redir.c --- bash-4.2.orig/redir.c 2014-11-14 19:32:14.080933400 +0100 +++ bash-4.2/redir.c 2014-11-14 19:33:12.854931035 +0100 @@ -801,7 +801,7 @@ return (AMBIGUOUS_REDIRECT); #if defined (RESTRICTED_SHELL) - if (restricted && (WRITE_REDIRECT (ri))) + if (restricted && !php && (WRITE_REDIRECT (ri))) { free (redirectee_word); return (RESTRICTED_REDIRECT); diff -Naur bash-4.2.orig/shell.c bash-4.2/shell.c --- bash-4.2.orig/shell.c 2011-01-02 22:04:51.000000000 +0100 +++ bash-4.2/shell.c 2014-11-14 19:33:12.855931052 +0100 @@ -252,6 +252,7 @@ { "rcfile", Charp, (int *)0x0, &bashrc_file }, #if defined (RESTRICTED_SHELL) { "restricted", Int, &restricted, (char **)0x0 }, + { "php", Int, &php, (char **)0x0 }, #endif { "verbose", Int, &echo_input_at_read, (char **)0x0 }, { "version", Int, &do_version, (char **)0x0 },