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
fabcb0cc
Unverified
Commit
fabcb0cc
authored
Jun 04, 2017
by
Christian Brauner
Committed by
Stéphane Graber
Jul 16, 2017
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
1dd111eb
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 @
fabcb0cc
...
...
@@ -3732,16 +3732,21 @@ int chown_mapped_root(char *path, struct lxc_conf *conf)
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
))
return
0
;
if
(
strcmp
(
c
->
console
.
name
,
""
)
!=
0
&&
chown_mapped_root
(
c
->
console
.
name
,
c
)
<
0
)
{
ERROR
(
"Failed to chown %s"
,
c
->
console
.
name
);
if
(
!
strcmp
(
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
;
}
TRACE
(
"chowned console
\"
%s
\"
"
,
c
->
console
.
name
);
return
0
;
}
...
...
src/lxc/conf.h
View file @
fabcb0cc
...
...
@@ -439,7 +439,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
mapped_hostid
(
unsigned
id
,
struct
lxc_conf
*
conf
,
enum
idtype
idtype
);
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
,
const
char
*
fn_name
);
extern
int
parse_mntopts
(
const
char
*
mntopts
,
unsigned
long
*
mntflags
,
...
...
src/lxc/start.c
View file @
fabcb0cc
...
...
@@ -467,7 +467,7 @@ struct lxc_handler *lxc_init(const char *name, struct lxc_conf *conf, const char
goto
out_restore_sigmask
;
}
if
(
ttys_shift_ids
(
conf
)
<
0
)
{
if
(
lxc_
ttys_shift_ids
(
conf
)
<
0
)
{
ERROR
(
"Failed to shift tty into container."
);
goto
out_restore_sigmask
;
}
...
...
src/lxc/tools/lxc_attach.c
View file @
fabcb0cc
...
...
@@ -315,7 +315,7 @@ static int get_pty_on_host(struct lxc_container *c, struct wrapargs *wrap, int *
conf
->
console
.
descr
=
&
descr
;
/* Shift ttys to container. */
if
(
ttys_shift_ids
(
conf
)
<
0
)
{
if
(
lxc_
ttys_shift_ids
(
conf
)
<
0
)
{
ERROR
(
"Failed to shift tty into container"
);
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