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
75b38416
Commit
75b38416
authored
Mar 11, 2016
by
Stéphane Graber
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #892 from hallyn/2016-03-10/tasks
cgfsng: chmod the tasks and procns files
parents
87297f60
e2db2a89
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
cgfsng.c
src/lxc/cgfsng.c
+14
-4
No files found.
src/lxc/cgfsng.c
View file @
75b38416
...
@@ -1009,7 +1009,7 @@ static void cgfsng_destroy(void *hdata, struct lxc_conf *conf)
...
@@ -1009,7 +1009,7 @@ static void cgfsng_destroy(void *hdata, struct lxc_conf *conf)
int
i
;
int
i
;
for
(
i
=
0
;
d
->
hierarchies
[
i
];
i
++
)
{
for
(
i
=
0
;
d
->
hierarchies
[
i
];
i
++
)
{
struct
hierarchy
*
h
=
d
->
hierarchies
[
i
];
struct
hierarchy
*
h
=
d
->
hierarchies
[
i
];
if
(
!
h
->
fullcgpath
)
{
if
(
h
->
fullcgpath
)
{
recursive_destroy
(
h
->
fullcgpath
,
conf
);
recursive_destroy
(
h
->
fullcgpath
,
conf
);
free
(
h
->
fullcgpath
);
free
(
h
->
fullcgpath
);
h
->
fullcgpath
=
NULL
;
h
->
fullcgpath
=
NULL
;
...
@@ -1167,24 +1167,34 @@ static int chown_cgroup_wrapper(void *data)
...
@@ -1167,24 +1167,34 @@ static int chown_cgroup_wrapper(void *data)
char
*
fullpath
,
*
path
=
d
->
hierarchies
[
i
]
->
fullcgpath
;
char
*
fullpath
,
*
path
=
d
->
hierarchies
[
i
]
->
fullcgpath
;
if
(
chown
(
path
,
destuid
,
0
)
<
0
)
{
if
(
chown
(
path
,
destuid
,
0
)
<
0
)
{
SYSERROR
(
"Error chowning %s to %d
: %m
"
,
path
,
(
int
)
destuid
);
SYSERROR
(
"Error chowning %s to %d"
,
path
,
(
int
)
destuid
);
return
-
1
;
return
-
1
;
}
}
if
(
chmod
(
path
,
0775
)
<
0
)
{
if
(
chmod
(
path
,
0775
)
<
0
)
{
SYSERROR
(
"Error chmoding %s
: %m
"
,
path
);
SYSERROR
(
"Error chmoding %s"
,
path
);
return
-
1
;
return
-
1
;
}
}
/* Failures to chown these are inconvenient but not detrimental */
/*
* Failures to chown these are inconvenient but not detrimental
* We leave these owned by the container launcher, so that container
* root can write to the files to attach. We chmod them 664 so that
* container systemd can write to the files (which systemd in wily
* insists on doing)
*/
fullpath
=
must_make_path
(
path
,
"tasks"
,
NULL
);
fullpath
=
must_make_path
(
path
,
"tasks"
,
NULL
);
if
(
chown
(
fullpath
,
destuid
,
0
)
<
0
&&
errno
!=
ENOENT
)
if
(
chown
(
fullpath
,
destuid
,
0
)
<
0
&&
errno
!=
ENOENT
)
WARN
(
"Failed chowning %s to %d: %m"
,
fullpath
,
(
int
)
destuid
);
WARN
(
"Failed chowning %s to %d: %m"
,
fullpath
,
(
int
)
destuid
);
if
(
chmod
(
fullpath
,
0664
)
<
0
)
WARN
(
"Error chmoding %s: %m"
,
path
);
free
(
fullpath
);
free
(
fullpath
);
fullpath
=
must_make_path
(
path
,
"cgroup.procs"
,
NULL
);
fullpath
=
must_make_path
(
path
,
"cgroup.procs"
,
NULL
);
if
(
chown
(
fullpath
,
destuid
,
0
)
<
0
&&
errno
!=
ENOENT
)
if
(
chown
(
fullpath
,
destuid
,
0
)
<
0
&&
errno
!=
ENOENT
)
WARN
(
"Failed chowning %s to %d: %m"
,
fullpath
,
(
int
)
destuid
);
WARN
(
"Failed chowning %s to %d: %m"
,
fullpath
,
(
int
)
destuid
);
if
(
chmod
(
fullpath
,
0664
)
<
0
)
WARN
(
"Error chmoding %s: %m"
,
path
);
free
(
fullpath
);
free
(
fullpath
);
}
}
...
...
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