@@ -25,6 +25,7 @@ exports.execFile = function(file /* args, options, callback */) {
2525 timeout : 0 ,
2626 maxBuffer : 200 * 1024 ,
2727 killSignal : 'SIGTERM' ,
28+ setsid : false ,
2829 cwd : null ,
2930 env : null } ;
3031 var args , optionArg , callback ;
@@ -184,19 +185,21 @@ ChildProcess.prototype.kill = function(sig) {
184185ChildProcess . prototype . spawn = function ( path , args , options , customFds ) {
185186 args = args || [ ] ;
186187
187- var cwd , env ;
188+ var cwd , env , setuid ;
188189 if ( ! options || options . cwd === undefined &&
189190 options . env === undefined &&
190191 options . customFds === undefined ) {
191192 // Deprecated API: (path, args, options, env, customFds)
192193 cwd = '' ;
193194 env = options || process . env ;
194195 customFds = customFds || [ - 1 , - 1 , - 1 ] ;
196+ setuid = false ;
195197 } else {
196198 // Recommended API: (path, args, options)
197199 cwd = options . cwd || '' ;
198200 env = options . env || process . env ;
199201 customFds = options . customFds || [ - 1 , - 1 , - 1 ] ;
202+ setuid = options . setuid ? true : false ;
200203 }
201204
202205 var envPairs = [ ] ;
@@ -206,7 +209,12 @@ ChildProcess.prototype.spawn = function(path, args, options, customFds) {
206209 envPairs . push ( key + '=' + env [ key ] ) ;
207210 }
208211
209- var fds = this . _internal . spawn ( path , args , cwd , envPairs , customFds ) ;
212+ var fds = this . _internal . spawn ( path ,
213+ args ,
214+ cwd ,
215+ envPairs ,
216+ customFds ,
217+ setuid ) ;
210218 this . fds = fds ;
211219
212220 if ( customFds [ 0 ] === - 1 || customFds [ 0 ] === undefined ) {
0 commit comments