aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/os/exec
AgeCommit message (Collapse)Author
2014-09-08build: move package sources from src/pkg to srcRuss Cox
Preparation was in CL 134570043. This CL contains only the effect of 'hg mv src/pkg/* src'. For more about the move, see golang.org/s/go14nopkg.
2014-07-16src, misc: applied gofmt -s -wRobert Griesemer
Pending CL 113120043. LGTM=dave R=golang-codereviews, dave CC=golang-codereviews https://golang.org/cl/112290043
2014-05-20build: make nacl passRuss Cox
Add nacl.bash, the NaCl version of all.bash. It's a separate script because it builds a variant of package syscall with a large zip file embedded in it, containing all the input files needed for tests. Disable various tests new since the last round, mostly the ones using os/exec. Fixes #7945. LGTM=dave R=golang-codereviews, remyoudompheng, dave, bradfitz CC=golang-codereviews https://golang.org/cl/100590044
2014-04-22os/exec: deflake a test on LinuxBrad Fitzpatrick
Work around buggy(?) Linux /proc filesystem. Fixes #7808 LGTM=iant R=golang-codereviews, iant CC=adg, golang-codereviews https://golang.org/cl/90400044
2014-04-15os/exec: make TestPipeLookPathLeak more verbose when it failsBrad Fitzpatrick
Trying to understand the linux-386-387 failures: http://build.golang.org/log/78a91da173c11e986b4e623527c2d0b746f4e814 Also modernize the closeOnce code with a method value, while I was looking. LGTM=adg R=golang-codereviews, adg CC=golang-codereviews, iant https://golang.org/cl/87950044
2014-04-14os/exec: quiet distracting log output during testBrad Fitzpatrick
TLS handshake failures didn't use to log, but do in Go 1.3. Shut it up so the actual failure can be seen in e.g. http://build.golang.org/log/ede7e12362a941d93bf1fe21db9208a3e298029e LGTM=adg R=adg CC=golang-codereviews https://golang.org/cl/87870043
2014-04-04os/exec: always try appropriate command extensions during Cmd.Start on windowsAlex Brainman
Update #7362 Fixes #7377 Fixes #7570 LGTM=rsc R=golang-codereviews, rsc CC=golang-codereviews https://golang.org/cl/83020043
2014-02-25all: merge NaCl branch (part 1)Dave Cheney
See golang.org/s/go13nacl for design overview. This CL is the mostly mechanical changes from rsc's Go 1.2 based NaCl branch, specifically 39cb35750369 to 500771b477cf from https://code.google.com/r/rsc-go13nacl. This CL does not include working NaCl support, there are probably two or three more large merges to come. CL 15750044 is not included as it involves more invasive changes to the linker which will need to be merged separately. The exact change lists included are 15050047: syscall: support for Native Client 15360044: syscall: unzip implementation for Native Client 15370044: syscall: Native Client SRPC implementation 15400047: cmd/dist, cmd/go, go/build, test: support for Native Client 15410048: runtime: support for Native Client 15410049: syscall: file descriptor table for Native Client 15410050: syscall: in-memory file system for Native Client 15440048: all: update +build lines for Native Client port 15540045: cmd/6g, cmd/8g, cmd/gc: support for Native Client 15570045: os: support for Native Client 15680044: crypto/..., hash/crc32, reflect, sync/atomic: support for amd64p32 15690044: net: support for Native Client 15690048: runtime: support for fake time like on Go Playground 15690051: build: disable various tests on Native Client LGTM=rsc R=rsc CC=golang-codereviews https://golang.org/cl/68150047
2014-02-23os/exec: explicitly mention Cmd.Wait() has to be called eventuallyPatrick Mézard
LGTM=minux.ma, r R=golang-codereviews, minux.ma, r CC=golang-codereviews https://golang.org/cl/67280043
2014-02-07os/exec: use filepath.Base in CommandAlex Brainman
filepath.Base covers all scenarios (for example paths like d:hello.txt) on windows LGTM=iant, bradfitz R=golang-codereviews, iant, bradfitz CC=golang-codereviews https://golang.org/cl/59740050
2014-02-03os/exec: fix Command with relative pathsBrad Fitzpatrick
Command was (and is) documented like: "If name contains no path separators, Command uses LookPath to resolve the path to a complete name if possible. Otherwise it uses name directly." But that wasn't true. It always did LookPath, and then set a sticky error that the user couldn't unset. And then if cmd.Dir was changed, Start would still fail due to the earlier sticky error being set. This keeps LookPath in the same place as before (so no user visible changes in cmd.Path after Command), but only does it when the documentation says it will happen. Also, clarify the docs about a relative Dir path. No change in any existing behavior, except using Command is now possible with relative paths. Previously it only worked if you built the *Cmd by hand. Fixes #7228 LGTM=iant R=iant CC=adg, golang-codereviews https://golang.org/cl/59580044
2014-01-13os/exec: disable fd check in TestHelperProcess on Plan 9David du Colombier
On Plan 9, we can observe the following open file descriptors: 0 r c 0 (000000000000000a 0 00) 0 0 /dev/null 1 rw | 0 (0000000001df6742 0 00) 65536 54 #|/data1 2 rw | 0 (0000000001df6782 0 00) 65536 0 #|/data1 3 rw M 1956 (0000000000d66dd2 0 00) 8192 12 /tmp/333163398 4 r c 0 (0000000000000001 0 00) 0 528 /dev/bintime 5 r M 1956 (0000000000d66dd1 854 00) 8192 0 /tmp/go-build843954301/os/exec/_test/exec.test 6 r M 1956 (0000000000d66dd1 854 00) 8192 0 /tmp/go-build843954301/os/exec/_test/exec.test 7 r M 1956 (0000000000d66dd1 854 00) 8192 0 /tmp/go-build843954301/os/exec/_test/exec.test 8 r M 1956 (0000000000d66dd1 854 00) 8192 0 /tmp/go-build843954301/os/exec/_test/exec.test 9 r M 1956 (0000000000d66dd1 854 00) 8192 0 /tmp/go-build843954301/os/exec/_test/exec.test 10 r M 1956 (0000000000d66dd1 854 00) 8192 0 /tmp/go-build843954301/os/exec/_test/exec.test 11 r c 0 (000000000000000f 0 00) 0 32 /dev/random 12 r M 1956 (0000000000d66dd1 854 00) 8192 0 /tmp/go-build843954301/os/exec/_test/exec.test 13 r c 0 (000000000000000a 0 00) 0 0 /dev/null 14 rw | 0 (0000000001df6801 0 00) 65536 0 #|/data 15 rw | 0 (0000000001df6802 0 00) 65536 1275 #|/data1 R=rsc, bradfitz, aram CC=golang-codereviews https://golang.org/cl/51420044
2014-01-10os, os/exec, os/user: add support for GOOS=solarisAram Hăvărneanu
R=golang-codereviews, dave, minux.ma, gobot, jsing CC=golang-codereviews https://golang.org/cl/36020043
2013-12-18crypto/x509: add non-cgo darwin system anchor certsJosh Bleecher Snyder
The set of certs fetched via exec'ing `security` is not quite identical to the certs fetched via the cgo call. The cgo fetch includes any trusted root certs that the user may have added; exec does not. The exec fetch includes an Apple-specific root cert; the cgo fetch does not. Other than that, they appear to be the same. Unfortunately, os/exec depends on crypto/x509, via net/http. Break the circular dependency by moving the exec tests to their own package. This will not work in iOS; we'll cross that bridge when we get to it. R=golang-dev, minux.ma, agl CC=golang-dev https://golang.org/cl/22020045
2013-09-13os/exec: add more caveats to StdoutPipe, StderrPipeRuss Cox
(StdinPipe was taken care of by CL 13329043.) Fixes #6008. R=golang-dev, iant CC=golang-dev https://golang.org/cl/13606046
2013-09-10os/exec: change windows LookPath so it works like cmd.exeAlex Brainman
Fixes #6224 R=golang-dev, hcwfrichter, bradfitz CC=golang-dev https://golang.org/cl/13410045
2013-08-29os/exec: return idempotent Closer from StdinPipeAndrew Gerrand
Before this fix, it was always an error to use the Close method on the io.WriteCloser obtained from Cmd.StdinPipe, as it would race with the Close performed by Cmd.Wait. Fixes #6270. R=golang-dev, r, remyoudompheng, bradfitz, dsymonds CC=golang-dev https://golang.org/cl/13329043
2013-08-23os/exec: remove flaky TestExtraFilesFDShuffle testCarl Shapiro
Update #5780 R=golang-dev, cshapiro, dave, bradfitz CC=golang-dev https://golang.org/cl/12869049
2013-08-24os: dragonfly supportJoel Sing
Make the os package build and work on dragonfly. R=bradfitz CC=golang-dev https://golang.org/cl/13183044
2013-08-15os/exec: document that LookPath's result may be a relative pathRob Pike
Fixes #3622 R=golang-dev, alex.brainman CC=golang-dev https://golang.org/cl/12971043
2013-06-18os/exec: make exec_test.go:TestExtraFilesFDShuffle portable.Cosmos Nicolaou
R=golang-dev, minux.ma CC=golang-dev https://golang.org/cl/9103045
2013-05-28os/exec: fix test hangDmitriy Vyukov
Currently the test closes random files descriptors, which leads to hang (in particular if netpoll fd is closed). Try to open only fd 3, since the parent process expects it to be fd 3 anyway. Fixes #5571. R=golang-dev, r CC=golang-dev https://golang.org/cl/9778048
2013-04-30os/exec: disable TestExtraFilesFDShuffleRob Pike
It's too hard to make portable just now. R=golang-dev, iant CC=golang-dev https://golang.org/cl/9057043
2013-04-30syscall: fix a bug in the shuffling of file descriptors in StartProcess on ↵Cosmos Nicolaou
Linux. R=iant, iant, r, bradfitz CC=golang-dev https://golang.org/cl/8334044
2013-03-30os/exec, syscall: fix tests to pass when GOGCTRACE=1 is setAlbert Strasheim
R=golang-dev, bradfitz, minux.ma CC=golang-dev https://golang.org/cl/8193043
2013-03-18os/exec: fix fd leak with Std*Pipe + LookPathBrad Fitzpatrick
If LookPath in Command fails, sets a sticky error, and then StdinPipe, StdoutPipe, or StderrPipe were called, those pipe fds were never cleaned up. Fixes #5071 R=golang-dev, rogpeppe CC=golang-dev https://golang.org/cl/7799046
2013-02-28net, os, syscall: Plan 9: adjust error handlingAkshat Kumar
syscall: Use NewError for all system errors and introduce some new errors for compatibility with other packages and proper error handling in net. Also introduce Temporary and Timeout methods on ErrorString. net: Make errors from dial, accept, listen functions follow the OpError standard and discern whether the underlying error came from syscall. Since Plan 9 uses a correspondence between file and network operations, all system error reporting happens through the underlying file operation. In Go code, we go through package os for file operations, so there is another level of indirection in error types. This change allows us to compare the errors with those in package syscall, when appropriate. os: Just use the error string already present in package os, instead of calling out to package syscall. R=rsc, ality, rminnich, bradfitz CC=golang-dev https://golang.org/cl/7398054
2013-02-26os/exec: Pass tests on Plan 9Akshat Kumar
Adjust the exit status string for Plan 9. Upon allocating >100 file descriptors, Plan 9 raises a warning. Moreover, the Go runtime for 32-bit version of Plan 9 keeps /dev/bintime open for its implementation of runtime.nanotime(). This change accounts for these things in TestExtraFiles. R=rsc, rminnich, ality, bradfitz CC=golang-dev https://golang.org/cl/7363056
2013-02-20path/filepath, os/exec: unquote PATH elements on WindowsPéter Surányi
On Windows, directory names in PATH can be fully or partially quoted in double quotes ('"'), but the path names as used by most APIs must be unquoted. In addition, quoted names can contain the semicolon (';') character, which is otherwise used as ListSeparator. This CL changes SplitList in path/filepath and LookPath in os/exec to only treat unquoted semicolons as separators, and to unquote the separated elements. (In addition, fix harmless test bug I introduced for LookPath on Unix.) Related discussion thread: https://groups.google.com/d/msg/golang-nuts/PXCr10DsRb4/sawZBM7scYgJ R=rsc, minux.ma, mccoyst, alex.brainman, iant CC=golang-dev https://golang.org/cl/7181047
2013-02-07os/exec: LookPath on Unix shouldn't look in cwd when PATH is emptyPéter Surányi
R=golang-dev, dave, bradfitz CC=golang-dev https://golang.org/cl/7305053
2013-01-27all: make tests able to run multiple times.Rémy Oudompheng
It is now possible to run "go test -cpu=1,2,4 std" successfully. Fixes #3185. R=golang-dev, dave, minux.ma, bradfitz CC=golang-dev https://golang.org/cl/7196052
2013-01-24all: use t.Skip{,f}Dave Cheney
Replace various t.Log{,f} ; return checks with t.Skip{,f}. R=golang-dev, n13m3y3r, bradfitz, adg, mikioh.mikioh CC=golang-dev https://golang.org/cl/7193044
2012-10-30gofmt: apply gofmt -w src miscRobert Griesemer
Remove trailing whitespace in comments. No other changes. R=r CC=golang-dev https://golang.org/cl/6815053
2012-09-14os/exec: don't crash when out of fdsBrad Fitzpatrick
Command.Start could crash before if no fds were available because a nil *os.File of /dev/null was added to the cleanup list, which crashed before returning the proper error. R=golang-dev, iant CC=golang-dev https://golang.org/cl/6514043
2012-09-04net: fix {FileConn, FileListener, FilePacketConn} fd leak to child process.Sébastien Paolacci
All of them call `newFileFD' which must properly restore close-on-exec on duplicated fds. R=golang-dev, bradfitz, mikioh.mikioh CC=golang-dev https://golang.org/cl/6445081
2012-08-16os/exec: disable additional file descriptor test on netbsdJoel Sing
This currently fails on NetBSD due to the cloned file descriptors that result from opening /dev/urandom. Disable the additional checking until this is investigated and properly fixed. R=golang-dev, minux.ma CC=golang-dev https://golang.org/cl/6443129
2012-08-06net: fix TCPListener file leak to child processesBrad Fitzpatrick
Hold ForkLock during dup of fd + cloexec in the net pkg, per the locking policy documented in syscall/exec_unix.go. R=golang-dev, dsymonds, adg CC=golang-dev https://golang.org/cl/6457080
2012-07-09pkg: Removing duplicated words ("of of", etc.), mostly from comments.David G. Andersen
Ran 'double.pl' on the pkg tree to identify doubled words. One change to an error string return in x509; the rest are in comments. Thanks to Matt Jibson for the idea. R=golang-dev, bsiegert CC=golang-dev https://golang.org/cl/6344089
2012-04-27os/exec: close all internal descriptors when Cmd.Start() fails.Brian Dellisanti
This closes any internal descriptors (pipes, etc) that Cmd.Start() had opened before it failed. Fixes #3468. R=golang-dev, iant, bradfitz CC=golang-dev https://golang.org/cl/5986044
2012-03-12os/exec: fix typo in documentationFazlul Shahriar
R=golang-dev, gri CC=golang-dev https://golang.org/cl/5797073
2012-02-21os: replace non-portable Waitmsg with portable ProcessStateRob Pike
Use methods for key questions. Provide access to non-portable pieces through portable methods. Windows and Plan 9 updated. R=golang-dev, bradfitz, bradfitz, r, dsymonds, rsc, iant, iant CC=golang-dev https://golang.org/cl/5673077
2012-02-20os: drop the Wait function and the options to Process.WaitRob Pike
They are portability problems and the options are almost always zero in practice anyway. R=golang-dev, dsymonds, r, bradfitz CC=golang-dev https://golang.org/cl/5688046
2012-02-17net, os, syscall: delete os.EPLAN9Mikio Hara
Also fixes plan9 cross-build. R=rsc, r CC=golang-dev https://golang.org/cl/5675073
2012-02-17os: delete os.EINVAL and so onRob Pike
The set of errors forwarded by the os package varied with system and was therefore non-portable. Three helpers added for portable error checking: IsExist, IsNotExist, and IsPermission. One or two more may need to come, but let's keep the set very small to discourage thinking about errors that way. R=mikioh.mikioh, gustavo, r, rsc CC=golang-dev https://golang.org/cl/5672047
2012-02-15os/exec: add some examplesBrad Fitzpatrick
R=golang-dev, adg, r, bradfitz CC=golang-dev https://golang.org/cl/5675054
2012-02-11os,syscall: fix windows buildBrad Fitzpatrick
make syscall.ProcAttr.Files be []uintptr all.bash passes on Linux. things seem to compile on GOOS={darwin,windows} R=golang-dev, mattn.jp, alex.brainman, rsc CC=golang-dev https://golang.org/cl/5653055
2012-02-10os/exec: add Cmd.Waitmsg, fix a misleading commentBrad Fitzpatrick
Fixes #2948 R=golang-dev, r CC=golang-dev https://golang.org/cl/5655048
2012-02-10os: delete Exec, NewFile takes uintptr, rename ShellExpand, doc fixesBrad Fitzpatrick
Delete O_NDELAY, O_NONBLOCK, O_NOCTTY, O_ASYNC. Clean up some docs. Rename ShellExpand -> ExpandEnv. Make NewFile take a uintptr; change File.Fd to return one. (for API compatibility between Unix and Windows) Fixes #2947 R=golang-dev, r CC=golang-dev https://golang.org/cl/5655045
2012-02-01os/exec: make sure file is not closed early in leaked fd testIan Lance Taylor
Without this change, fd3 can be collected by the garbage collector and finalized, which causes the file descriptor to be closed, which causes the call to os.Open to return 3 rather than the expected descriptor number. R=golang-dev, gri, bradfitz, bradfitz, iant CC=golang-dev https://golang.org/cl/5607056
2012-01-31os/exec: TestExtraFiles - close any leaked file descriptorsJoel Sing
Ensure that file descriptors have not already been leaked into our environment - close any that are open at the start of the TestExtraFiles test. Also use the appropriate command for listing open files. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/5574062