Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-devel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
116
Issues
116
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
emulab
emulab-devel
Commits
749a51b9
Commit
749a51b9
authored
Feb 07, 2019
by
Leigh Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor addition for escaping shell arguments.
parent
3c5e82d6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
emutil.pm.in
db/emutil.pm.in
+15
-0
No files found.
db/emutil.pm.in
View file @
749a51b9
...
...
@@ -1151,5 +1151,20 @@ sub ClearNoDelete($)
return ($? ? -1 : 0);
}
sub escapeshellarg($)
{
my ($str) = @_;
my @chars = split('', $str);
my $result = "";
foreach my $ch (@chars) {
if ($ch eq '
\
''
)
{
$
result
=
$
result
.
"\'
\\
\'"
;
}
$
result
=
$
result
.
"$ch"
;
}
return
"'$result'"
;
}
#
_Always_
make
sure
that
this
1
is
at
the
end
of
the
file
...
1
;
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