xjasonlyu / tun2socks

tun2socks - powered by gVisor TCP/IP stack
https://github.com/xjasonlyu/tun2socks/wiki
GNU General Public License v3.0
2.84k stars 403 forks source link

Fix: safely split command strings #340

Closed xjasonlyu closed 4 months ago

xjasonlyu commented 4 months ago

For tun-pre-up and tun-post-up options, this PR fixes the issue that would cut quoted args into multiple args.

e.g. before cutting sh -c 'ls /':

["sh", "-c", "'ls", "/'"]

after:

["sh", "-c", "ls /"]