Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
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
Chen Yisong
lxc
Commits
31299e70
Unverified
Commit
31299e70
authored
Oct 29, 2016
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools/lxc_console: use lxc_safe_uint()
Signed-off-by:
Christian Brauner
<
christian.brauner@canonical.com
>
parent
63610340
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
14 deletions
+19
-14
arguments.h
src/lxc/arguments.h
+1
-1
lxc_console.c
src/lxc/tools/lxc_console.c
+18
-13
No files found.
src/lxc/arguments.h
View file @
31299e70
...
@@ -61,7 +61,7 @@ struct lxc_arguments {
...
@@ -61,7 +61,7 @@ struct lxc_arguments {
const
char
*
share_ns
[
32
];
// size must be greater than LXC_NS_MAX
const
char
*
share_ns
[
32
];
// size must be greater than LXC_NS_MAX
/* for lxc-console */
/* for lxc-console */
int
ttynum
;
unsigned
int
ttynum
;
char
escape
;
char
escape
;
/* for lxc-wait */
/* for lxc-wait */
...
...
src/lxc/tools/lxc_console.c
View file @
31299e70
...
@@ -22,29 +22,29 @@
...
@@ -22,29 +22,29 @@
*/
*/
#define _GNU_SOURCE
#define _GNU_SOURCE
#include <stdio.h>
#undef _GNU_SOURCE
#include <stdlib.h>
#include <errno.h>
#include <errno.h>
#include <string.h>
#include <fcntl.h>
#include <fcntl.h>
#include <unistd.h>
#include <signal.h>
#include <libgen.h>
#include <libgen.h>
#include <poll.h>
#include <poll.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <string.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <sys/param.h>
#include <sys/param.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/stat.h>
#include <sys/
ioctl
.h>
#include <sys/
types
.h>
#include <lxc/lxccontainer.h>
#include <lxc/lxccontainer.h>
#include "arguments.h"
#include "commands.h"
#include "error.h"
#include "error.h"
#include "lxc.h"
#include "log.h"
#include "log.h"
#include "lxc.h"
#include "mainloop.h"
#include "mainloop.h"
#include "arguments.h"
#include "utils.h"
#include "commands.h"
lxc_log_define
(
lxc_console_ui
,
lxc
);
lxc_log_define
(
lxc_console_ui
,
lxc
);
...
@@ -58,8 +58,13 @@ static char etoc(const char *expr)
...
@@ -58,8 +58,13 @@ static char etoc(const char *expr)
static
int
my_parser
(
struct
lxc_arguments
*
args
,
int
c
,
char
*
arg
)
static
int
my_parser
(
struct
lxc_arguments
*
args
,
int
c
,
char
*
arg
)
{
{
switch
(
c
)
{
switch
(
c
)
{
case
't'
:
args
->
ttynum
=
atoi
(
arg
);
break
;
case
't'
:
case
'e'
:
args
->
escape
=
etoc
(
arg
);
break
;
if
(
lxc_safe_uint
(
arg
,
&
args
->
ttynum
)
<
0
)
return
-
1
;
break
;
case
'e'
:
args
->
escape
=
etoc
(
arg
);
break
;
}
}
return
0
;
return
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