Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
af1963ae
Commit
af1963ae
authored
Jan 05, 2006
by
Kirk Webb
Browse files
Avoid starting an intermediate shell when executing commands.
parent
7c075e72
Changes
1
Hide whitespace changes
Inline
Side-by-side
tbsetup/plab/libplab.py.in
View file @
af1963ae
...
...
@@ -28,6 +28,7 @@ import httplib
import
xml.parsers.expat
import
re
import
calendar
import
shlex
from
popen2
import
Popen4
from
warnings
import
warn
...
...
@@ -1259,7 +1260,10 @@ class Node:
"""
Executes the given command, optionally squelching the output.
"""
cmdobj
=
Popen4
(
command
)
# Split up the command into a list to exec (avoid
# intermediate shell invocation).
cmdlist
=
shlex
.
split
(
command
)
cmdobj
=
Popen4
(
cmdlist
)
cmdout
=
cmdobj
.
fromchild
.
read
()
cmdstatus
=
cmdobj
.
wait
()
if
(
not
quiet
)
and
cmdout
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment