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
54117de5
Unverified
Commit
54117de5
authored
Jun 04, 2017
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
conf: improve tty shifting function
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
a5b18cb1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
6 deletions
+11
-6
conf.c
src/lxc/conf.c
+8
-3
conf.h
src/lxc/conf.h
+1
-1
start.c
src/lxc/start.c
+1
-1
lxc_attach.c
src/lxc/tools/lxc_attach.c
+1
-1
No files found.
src/lxc/conf.c
View file @
54117de5
...
@@ -3831,16 +3831,21 @@ int chown_mapped_root(char *path, struct lxc_conf *conf)
...
@@ -3831,16 +3831,21 @@ int chown_mapped_root(char *path, struct lxc_conf *conf)
return
ret
;
return
ret
;
}
}
int
ttys_shift_ids
(
struct
lxc_conf
*
c
)
int
lxc_
ttys_shift_ids
(
struct
lxc_conf
*
c
)
{
{
if
(
lxc_list_empty
(
&
c
->
id_map
))
if
(
lxc_list_empty
(
&
c
->
id_map
))
return
0
;
return
0
;
if
(
strcmp
(
c
->
console
.
name
,
""
)
!=
0
&&
chown_mapped_root
(
c
->
console
.
name
,
c
)
<
0
)
{
if
(
!
strcmp
(
c
->
console
.
name
,
""
))
ERROR
(
"Failed to chown %s"
,
c
->
console
.
name
);
return
0
;
if
(
chown_mapped_root
(
c
->
console
.
name
,
c
)
<
0
)
{
ERROR
(
"failed to chown console
\"
%s
\"
"
,
c
->
console
.
name
);
return
-
1
;
return
-
1
;
}
}
TRACE
(
"chowned console
\"
%s
\"
"
,
c
->
console
.
name
);
return
0
;
return
0
;
}
}
...
...
src/lxc/conf.h
View file @
54117de5
...
@@ -472,7 +472,7 @@ extern void lxc_restore_phys_nics_to_netns(int netnsfd, struct lxc_conf *conf);
...
@@ -472,7 +472,7 @@ extern void lxc_restore_phys_nics_to_netns(int netnsfd, struct lxc_conf *conf);
extern
int
find_unmapped_nsid
(
struct
lxc_conf
*
conf
,
enum
idtype
idtype
);
extern
int
find_unmapped_nsid
(
struct
lxc_conf
*
conf
,
enum
idtype
idtype
);
extern
int
mapped_hostid
(
unsigned
id
,
struct
lxc_conf
*
conf
,
enum
idtype
idtype
);
extern
int
mapped_hostid
(
unsigned
id
,
struct
lxc_conf
*
conf
,
enum
idtype
idtype
);
extern
int
chown_mapped_root
(
char
*
path
,
struct
lxc_conf
*
conf
);
extern
int
chown_mapped_root
(
char
*
path
,
struct
lxc_conf
*
conf
);
extern
int
ttys_shift_ids
(
struct
lxc_conf
*
c
);
extern
int
lxc_
ttys_shift_ids
(
struct
lxc_conf
*
c
);
extern
int
userns_exec_1
(
struct
lxc_conf
*
conf
,
int
(
*
fn
)(
void
*
),
void
*
data
,
extern
int
userns_exec_1
(
struct
lxc_conf
*
conf
,
int
(
*
fn
)(
void
*
),
void
*
data
,
const
char
*
fn_name
);
const
char
*
fn_name
);
extern
int
parse_mntopts
(
const
char
*
mntopts
,
unsigned
long
*
mntflags
,
extern
int
parse_mntopts
(
const
char
*
mntopts
,
unsigned
long
*
mntflags
,
...
...
src/lxc/start.c
View file @
54117de5
...
@@ -481,7 +481,7 @@ struct lxc_handler *lxc_init(const char *name, struct lxc_conf *conf, const char
...
@@ -481,7 +481,7 @@ struct lxc_handler *lxc_init(const char *name, struct lxc_conf *conf, const char
goto
out_restore_sigmask
;
goto
out_restore_sigmask
;
}
}
if
(
ttys_shift_ids
(
conf
)
<
0
)
{
if
(
lxc_
ttys_shift_ids
(
conf
)
<
0
)
{
ERROR
(
"Failed to shift tty into container."
);
ERROR
(
"Failed to shift tty into container."
);
goto
out_restore_sigmask
;
goto
out_restore_sigmask
;
}
}
...
...
src/lxc/tools/lxc_attach.c
View file @
54117de5
...
@@ -315,7 +315,7 @@ static int get_pty_on_host(struct lxc_container *c, struct wrapargs *wrap, int *
...
@@ -315,7 +315,7 @@ static int get_pty_on_host(struct lxc_container *c, struct wrapargs *wrap, int *
conf
->
console
.
descr
=
&
descr
;
conf
->
console
.
descr
=
&
descr
;
/* Shift ttys to container. */
/* Shift ttys to container. */
if
(
ttys_shift_ids
(
conf
)
<
0
)
{
if
(
lxc_
ttys_shift_ids
(
conf
)
<
0
)
{
ERROR
(
"Failed to shift tty into container"
);
ERROR
(
"Failed to shift tty into container"
);
goto
err1
;
goto
err1
;
}
}
...
...
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