Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
criu
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhul
criu
Commits
55c8f3cc
Commit
55c8f3cc
authored
May 08, 2013
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crtools: Sanitize "action" (argv[1]) parsing
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
6e5c568a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
34 deletions
+18
-34
crtools.c
crtools.c
+18
-34
No files found.
crtools.c
View file @
55c8f3cc
...
@@ -299,50 +299,34 @@ int main(int argc, char *argv[])
...
@@ -299,50 +299,34 @@ int main(int argc, char *argv[])
if
(
optind
>=
argc
)
if
(
optind
>=
argc
)
goto
usage
;
goto
usage
;
if
(
strcmp
(
argv
[
optind
],
"dump"
)
&&
if
(
!
strcmp
(
argv
[
optind
],
"dump"
))
{
strcmp
(
argv
[
optind
],
"restore"
)
&&
strcmp
(
argv
[
optind
],
"show"
)
&&
strcmp
(
argv
[
optind
],
"check"
)
&&
strcmp
(
argv
[
optind
],
"page-server"
)
&&
strcmp
(
argv
[
optind
],
"exec"
))
{
pr_err
(
"Unknown command %s
\n
"
,
argv
[
optind
]);
goto
usage
;
}
switch
(
argv
[
optind
][
0
])
{
case
'd'
:
if
(
!
tree_id
)
if
(
!
tree_id
)
goto
opt_pid_missing
;
goto
opt_pid_missing
;
ret
=
cr_dump_tasks
(
tree_id
,
&
opts
);
return
cr_dump_tasks
(
tree_id
,
&
opts
);
break
;
}
case
'r'
:
if
(
!
strcmp
(
argv
[
optind
],
"restore"
))
{
if
(
tree_id
)
if
(
tree_id
)
pr_warn
(
"Using -t with criu restore is obsoleted
\n
"
);
pr_warn
(
"Using -t with criu restore is obsoleted
\n
"
);
ret
=
cr_restore_tasks
(
&
opts
);
return
cr_restore_tasks
(
&
opts
);
break
;
}
case
's'
:
ret
=
cr_show
(
&
opts
,
pid
);
if
(
!
strcmp
(
argv
[
optind
],
"show"
))
break
;
return
cr_show
(
&
opts
,
pid
);
case
'c'
:
ret
=
cr_check
();
if
(
!
strcmp
(
argv
[
optind
],
"check"
))
break
;
return
cr_check
();
case
'e'
:
if
(
!
strcmp
(
argv
[
optind
],
"exec"
))
{
if
(
!
pid
)
if
(
!
pid
)
pid
=
tree_id
;
/* old usage */
pid
=
tree_id
;
/* old usage */
if
(
!
pid
)
if
(
!
pid
)
goto
opt_pid_missing
;
goto
opt_pid_missing
;
ret
=
cr_exec
(
pid
,
argv
+
optind
+
1
);
return
cr_exec
(
pid
,
argv
+
optind
+
1
);
break
;
case
'p'
:
ret
=
cr_page_server
();
break
;
default:
goto
usage
;
break
;
}
}
return
ret
;
if
(
!
strcmp
(
argv
[
optind
],
"page-server"
))
return
cr_page_server
();
usage:
usage:
pr_msg
(
"
\n
Usage:
\n
"
);
pr_msg
(
"
\n
Usage:
\n
"
);
pr_msg
(
" %s dump -t PID [<options>]
\n
"
,
argv
[
0
]);
pr_msg
(
" %s dump -t PID [<options>]
\n
"
,
argv
[
0
]);
...
...
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