Add support for WASI platform in cmdCheckShellEscape.

Since cmdCheckShellEscape doesn't actually report failure in any way,
this code simulates a situation where system() never succeeds.
This commit is contained in:
whitequark 2020-04-30 17:05:49 +00:00 committed by Eddie Hung
parent 09607e9055
commit eea20ff466
1 changed files with 4 additions and 1 deletions

View File

@ -52,6 +52,9 @@ int cmdCheckShellEscape( Abc_Frame_t * pAbc, int argc, char ** argv)
int RetValue;
if (argv[0][0] == '!')
{
#if defined(__wasm)
RetValue = -1;
#else
const int size = 4096;
int i;
char * buffer = ABC_ALLOC(char, 10000);
@ -70,7 +73,7 @@ int cmdCheckShellEscape( Abc_Frame_t * pAbc, int argc, char ** argv)
// the parts, we lose information. So a command like
// `!ls "file name"` will be sent to the system as
// `ls file name` which is a BUG
#endif
return 1;
}
else