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
bb9f9ced
Unverified
Commit
bb9f9ced
authored
Jun 29, 2018
by
Stéphane Graber
Committed by
GitHub
Jun 29, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2438 from brauner/2018-06-29/linux-v4.18
autodev: adapt to changes in Linux 4.18
parents
4c08bd46
3e04a608
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
conf.c
src/lxc/conf.c
+10
-3
No files found.
src/lxc/conf.c
View file @
bb9f9ced
...
@@ -1238,6 +1238,7 @@ struct lxc_device_node {
...
@@ -1238,6 +1238,7 @@ struct lxc_device_node {
};
};
static
const
struct
lxc_device_node
lxc_devices
[]
=
{
static
const
struct
lxc_device_node
lxc_devices
[]
=
{
{
"console"
,
S_IFCHR
|
S_IRWXU
|
S_IRWXG
|
S_IRWXO
,
1
,
5
},
{
"full"
,
S_IFCHR
|
S_IRWXU
|
S_IRWXG
|
S_IRWXO
,
1
,
7
},
{
"full"
,
S_IFCHR
|
S_IRWXU
|
S_IRWXG
|
S_IRWXO
,
1
,
7
},
{
"null"
,
S_IFCHR
|
S_IRWXU
|
S_IRWXG
|
S_IRWXO
,
1
,
3
},
{
"null"
,
S_IFCHR
|
S_IRWXU
|
S_IRWXG
|
S_IRWXO
,
1
,
3
},
{
"random"
,
S_IFCHR
|
S_IRWXU
|
S_IRWXG
|
S_IRWXO
,
1
,
8
},
{
"random"
,
S_IFCHR
|
S_IRWXU
|
S_IRWXG
|
S_IRWXO
,
1
,
8
},
...
@@ -1251,7 +1252,7 @@ static int lxc_fill_autodev(const struct lxc_rootfs *rootfs)
...
@@ -1251,7 +1252,7 @@ static int lxc_fill_autodev(const struct lxc_rootfs *rootfs)
int
i
,
ret
;
int
i
,
ret
;
char
path
[
MAXPATHLEN
];
char
path
[
MAXPATHLEN
];
mode_t
cmask
;
mode_t
cmask
;
bool
can_mknod
=
true
;
int
can_mknod
=
1
;
ret
=
snprintf
(
path
,
MAXPATHLEN
,
"%s/dev"
,
ret
=
snprintf
(
path
,
MAXPATHLEN
,
"%s/dev"
,
rootfs
->
path
?
rootfs
->
mount
:
""
);
rootfs
->
path
?
rootfs
->
mount
:
""
);
...
@@ -1274,7 +1275,11 @@ static int lxc_fill_autodev(const struct lxc_rootfs *rootfs)
...
@@ -1274,7 +1275,11 @@ static int lxc_fill_autodev(const struct lxc_rootfs *rootfs)
if
(
ret
<
0
||
ret
>=
MAXPATHLEN
)
if
(
ret
<
0
||
ret
>=
MAXPATHLEN
)
return
-
1
;
return
-
1
;
if
(
can_mknod
)
{
/* See
* - https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=55956b59df336f6738da916dbb520b6e37df9fbd
* - https://lists.linuxfoundation.org/pipermail/containers/2018-June/039176.html
*/
if
(
can_mknod
==
2
||
(
can_mknod
==
1
&&
!
am_host_unpriv
()))
{
ret
=
mknod
(
path
,
device
->
mode
,
makedev
(
device
->
maj
,
device
->
min
));
ret
=
mknod
(
path
,
device
->
mode
,
makedev
(
device
->
maj
,
device
->
min
));
if
(
ret
==
0
||
(
ret
<
0
&&
errno
==
EEXIST
))
{
if
(
ret
==
0
||
(
ret
<
0
&&
errno
==
EEXIST
))
{
DEBUG
(
"Created device node
\"
%s
\"
"
,
path
);
DEBUG
(
"Created device node
\"
%s
\"
"
,
path
);
...
@@ -1289,7 +1294,9 @@ static int lxc_fill_autodev(const struct lxc_rootfs *rootfs)
...
@@ -1289,7 +1294,9 @@ static int lxc_fill_autodev(const struct lxc_rootfs *rootfs)
/* This can e.g. happen when the container is
/* This can e.g. happen when the container is
* unprivileged or CAP_MKNOD has been dropped.
* unprivileged or CAP_MKNOD has been dropped.
*/
*/
can_mknod
=
false
;
can_mknod
=
2
;
}
else
{
can_mknod
=
0
;
}
}
ret
=
mknod
(
path
,
S_IFREG
,
0
);
ret
=
mknod
(
path
,
S_IFREG
,
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