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
78d44e5a
Unverified
Commit
78d44e5a
authored
Feb 24, 2018
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lxccontainer: do_create_container_dir()
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
9f52e331
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
10 deletions
+16
-10
lxccontainer.c
src/lxc/lxccontainer.c
+16
-10
No files found.
src/lxc/lxccontainer.c
View file @
78d44e5a
...
@@ -1159,26 +1159,32 @@ WRAP_API(bool, lxcapi_stop)
...
@@ -1159,26 +1159,32 @@ WRAP_API(bool, lxcapi_stop)
static
int
do_create_container_dir
(
const
char
*
path
,
struct
lxc_conf
*
conf
)
static
int
do_create_container_dir
(
const
char
*
path
,
struct
lxc_conf
*
conf
)
{
{
int
ret
=
-
1
,
lasterr
;
int
lasterr
;
char
*
p
=
alloca
(
strlen
(
path
)
+
1
);
size_t
len
;
char
*
p
;
int
ret
=
-
1
;
mode_t
mask
=
umask
(
0002
);
mode_t
mask
=
umask
(
0002
);
ret
=
mkdir
(
path
,
0770
);
ret
=
mkdir
(
path
,
0770
);
lasterr
=
errno
;
lasterr
=
errno
;
umask
(
mask
);
umask
(
mask
);
errno
=
lasterr
;
errno
=
lasterr
;
if
(
ret
)
{
if
(
ret
)
{
if
(
errno
==
EEXIST
)
if
(
errno
!=
EEXIST
)
ret
=
0
;
else
{
SYSERROR
(
"failed to create container path %s"
,
path
);
return
-
1
;
return
-
1
;
}
ret
=
0
;
}
}
len
=
strlen
(
path
);
p
=
alloca
(
len
+
1
);
strcpy
(
p
,
path
);
strcpy
(
p
,
path
);
if
(
!
lxc_list_empty
(
&
conf
->
id_map
)
&&
chown_mapped_root
(
p
,
conf
)
!=
0
)
{
if
(
!
lxc_list_empty
(
&
conf
->
id_map
))
{
ERROR
(
"Failed to chown container dir"
);
ret
=
chown_mapped_root
(
p
,
conf
);
ret
=
-
1
;
if
(
ret
<
0
)
ret
=
-
1
;
}
}
return
ret
;
return
ret
;
}
}
...
...
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