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
dfbd4730
Unverified
Commit
dfbd4730
authored
Jul 30, 2018
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
conf: mount devpts without "max" on EINVAL
The "max" option to devpts got introduced in kernel 3.4. Closes #2490. Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
646b1be9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
conf.c
src/lxc/conf.c
+14
-3
No files found.
src/lxc/conf.c
View file @
dfbd4730
...
@@ -1612,7 +1612,7 @@ static const struct id_map *find_mapped_nsid_entry(struct lxc_conf *conf, unsign
...
@@ -1612,7 +1612,7 @@ static const struct id_map *find_mapped_nsid_entry(struct lxc_conf *conf, unsign
static
int
lxc_setup_devpts
(
struct
lxc_conf
*
conf
)
static
int
lxc_setup_devpts
(
struct
lxc_conf
*
conf
)
{
{
int
ret
;
int
ret
;
c
onst
char
*
default_devpts_mntopts
=
"gid=5,newinstance,ptmxmode=0666,mode=0620"
;
c
har
default_devpts_mntopts
[]
=
"gid=5,newinstance,ptmxmode=0666,mode=0620"
;
char
devpts_mntopts
[
256
];
char
devpts_mntopts
[
256
];
if
(
conf
->
pty_max
<=
0
)
{
if
(
conf
->
pty_max
<=
0
)
{
...
@@ -1642,9 +1642,20 @@ static int lxc_setup_devpts(struct lxc_conf *conf)
...
@@ -1642,9 +1642,20 @@ static int lxc_setup_devpts(struct lxc_conf *conf)
/* mount new devpts instance */
/* mount new devpts instance */
ret
=
mount
(
"devpts"
,
"/dev/pts"
,
"devpts"
,
MS_NOSUID
|
MS_NOEXEC
,
devpts_mntopts
);
ret
=
mount
(
"devpts"
,
"/dev/pts"
,
"devpts"
,
MS_NOSUID
|
MS_NOEXEC
,
devpts_mntopts
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
/* try mounting without "max" */
if
(
errno
==
EINVAL
)
{
devpts_mntopts
[
sizeof
(
default_devpts_mntopts
)
-
1
]
=
'\0'
;
ret
=
mount
(
"devpts"
,
"/dev/pts"
,
"devpts"
,
MS_NOSUID
|
MS_NOEXEC
,
devpts_mntopts
);
if
(
ret
<
0
)
{
SYSERROR
(
"Failed to mount new devpts instance"
);
return
-
1
;
}
}
/* try mounting without gid=5 */
/* try mounting without gid=5 */
ret
=
mount
(
"devpts"
,
"/dev/pts"
,
"devpts"
,
ret
=
mount
(
"devpts"
,
"/dev/pts"
,
"devpts"
,
MS_NOSUID
|
MS_NOEXEC
,
MS_NOSUID
|
MS_NOEXEC
,
devpts_mntopts
+
sizeof
(
"gid=5"
));
devpts_mntopts
+
sizeof
(
"gid=5"
));
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
SYSERROR
(
"Failed to mount new devpts instance"
);
SYSERROR
(
"Failed to mount new devpts instance"
);
return
-
1
;
return
-
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