App wrapper to spawn shells9/19/2023 ![]() ![]() Then they'll come find this bug, and go back and fix their code.Ī non-replacement "exec" exists in the windows APIs for this purpose (as far as I know, exec-replace doesn't exist on windows). The initshell() function detects the operating system with the platform module and returns an object that’s an abstraction around the system-specific shell. Every consumer of the process.exec/spawn API is going to eventually run into this quoting issue when a user of theirs has the program in a path with a space. This is problematic because the execFile/spawn call accepts "args" arguments: why would one need to quote the executable in the "command" parameter to prevent it from being arg split, if there exists an args parameter? I expected that the executable path is the simply the "command" parameter, and the "args" to contain the arguments. What we need is having a way to launch a process without having to worry about quoting the executable (something that did not work for me, but I'll try again). Not exactly, process replacement isn't the issue. It's unlikely that the name will change anytime soon. I expect to have to quote args in C "system", but I do not expect that for "exec". For example, if you only allow tunnel, then any attempt from clients to shell into the server will auto disconnect them. Restrict to tunnel only: hypershell-server -protocol tunnel. The confusion is understandable when they're not analogous to behavior of POSIX functions, because they're named after mismatched POSIX counterparts. Or only allow file upload and/or download: hypershell-server -protocol upload -protocol download. Citing that as the reason for their behavior. You indicated that this is the expected behavior of "system" which is named after the system C call which is different from the exec C call. ![]() bin/sh: /Applications/My: No such file or directoryĪpplications/My Application.app/Contents/tools/myScript.sh failed: Error: Exit with error code: 127 Additional information The shell script is executed properly What do you see instead? Yes, the child_process module should be properly escaping commands that have spaces in them since we cannot control where the user installs the application. then ( ) How often does it reproduce? Is there a required condition?Įvery single time. Async function executeChildProcess ( executable, argList ) executeChildProcess ( '/Applications/My Application.app/Contents/tools/myScript.sh', ). ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |