diff --git a/lib/server/socket.js b/lib/server/socket.js index 095b7be2..32fa379c 100644 --- a/lib/server/socket.js +++ b/lib/server/socket.js @@ -120,7 +120,7 @@ function onMessage(pConnNum, pSocket) { return function(pCommand) { var lMsg, lJSON, lWinCommand, lExec_func, lDir, - lHome, lError, lRet, lExecSymbols; + lHome, lError, lRet, lExecSymbols, isContain; Util.log('#' + pConnNum + ': ' + pCommand); @@ -191,11 +191,11 @@ if(!ClientFuncs[pConnNum]) ClientFuncs[pConnNum] = getExec(pSocket, pConnNum); - lExec_func = ClientFuncs[pConnNum]; + lExec_func = ClientFuncs[pConnNum]; + lExecSymbols = ['*','#', '&', '{', '}', '|', '\'', '"']; + isContain = Util.isContainStr(pCommand, lExecSymbols); - lExecSymbols = ['*','#', '&', '{', '}', '|', '\'', '"']; - - if (Util.isContainStr(pCommand, lExecSymbols)) + if (pCommand[0] === ' ' || isContain) exec(pCommand, lExec_func); else getSpawn(pSocket, pConnNum, pCommand);