diff options
author | whitequark <whitequark@whitequark.org> | 2020-04-30 17:05:49 +0000 |
---|---|---|
committer | Eddie Hung <eddie@fpgeh.com> | 2020-05-01 08:25:53 -0700 |
commit | eea20ff4667abf36f28679520b06f4b1a6fcacea (patch) | |
tree | 16caa0e95d0c9311fb1f4b68ff0a7c822f80af33 /src/base/cmd | |
parent | 09607e9055381f6e330a054ee600e7bd7117bb76 (diff) | |
download | abc-eea20ff4667abf36f28679520b06f4b1a6fcacea.tar.gz abc-eea20ff4667abf36f28679520b06f4b1a6fcacea.tar.bz2 abc-eea20ff4667abf36f28679520b06f4b1a6fcacea.zip |
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.
Diffstat (limited to 'src/base/cmd')
-rw-r--r-- | src/base/cmd/cmdUtils.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/base/cmd/cmdUtils.c b/src/base/cmd/cmdUtils.c index 3409543f..c10e9134 100644 --- a/src/base/cmd/cmdUtils.c +++ b/src/base/cmd/cmdUtils.c @@ -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 |