src: do not run IsWindowsBatchFile on non-windows · nodejs/node@231fe7b · GitHub
Skip to content

Commit 231fe7b

Browse files
anonrigruyadorno
authored andcommitted
src: do not run IsWindowsBatchFile on non-windows
PR-URL: #55560 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com>
1 parent 655e560 commit 231fe7b

3 files changed

Lines changed: 17 additions & 17 deletions

File tree

src/process_wrap.cc

Lines changed: 2 additions & 0 deletions

src/spawn_sync.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,8 +769,10 @@ Maybe<int> SyncProcessRunner::ParseOptions(Local<Value> js_value) {
769769
// batch files directly but is potentially insecure because arguments
770770
// are not escaped (and sometimes cannot be unambiguously escaped),
771771
// hence why they are rejected here.
772+
#ifdef _WIN32
772773
if (IsWindowsBatchFile(uv_process_options_.file))
773774
return Just<int>(UV_EINVAL);
775+
#endif
774776

775777
Local<Value> js_args =
776778
js_options->Get(context, env()->args_string()).ToLocalChecked();

src/util-inl.h

Lines changed: 13 additions & 17 deletions

0 commit comments

Comments
 (0)