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
c4a4578f
Commit
c4a4578f
authored
Apr 16, 2018
by
Jonathan Calmels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pam-cgfs: ignore the system umask when creating the cgroup hierarchy
Fixes: #2277 Signed-off-by:
Jonathan Calmels
<
jcalmels@nvidia.com
>
parent
5dfc9186
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
pam_cgfs.c
src/lxc/pam/pam_cgfs.c
+16
-2
No files found.
src/lxc/pam/pam_cgfs.c
View file @
c4a4578f
...
@@ -223,6 +223,20 @@ static bool cgv2_prune_empty_cgroups(const char *user);
...
@@ -223,6 +223,20 @@ static bool cgv2_prune_empty_cgroups(const char *user);
static
bool
cgv2_remove
(
const
char
*
cgroup
);
static
bool
cgv2_remove
(
const
char
*
cgroup
);
static
bool
is_cgv2
(
char
*
line
);
static
bool
is_cgv2
(
char
*
line
);
static
int
do_mkdir
(
const
char
*
path
,
mode_t
mode
)
{
int
saved_errno
;
mode_t
mask
;
int
r
;
mask
=
umask
(
0
);
r
=
mkdir
(
path
,
mode
);
saved_errno
=
errno
;
umask
(
mask
);
errno
=
saved_errno
;
return
(
r
);
}
/* Create directory and (if necessary) its parents. */
/* Create directory and (if necessary) its parents. */
static
bool
mkdir_parent
(
const
char
*
root
,
char
*
path
)
static
bool
mkdir_parent
(
const
char
*
root
,
char
*
path
)
{
{
...
@@ -252,7 +266,7 @@ static bool mkdir_parent(const char *root, char *path)
...
@@ -252,7 +266,7 @@ static bool mkdir_parent(const char *root, char *path)
if
(
file_exists
(
path
))
if
(
file_exists
(
path
))
goto
next
;
goto
next
;
if
(
mkdir
(
path
,
0755
)
<
0
)
{
if
(
do_
mkdir
(
path
,
0755
)
<
0
)
{
pam_cgfs_debug
(
"Failed to create %s: %s.
\n
"
,
path
,
strerror
(
errno
));
pam_cgfs_debug
(
"Failed to create %s: %s.
\n
"
,
path
,
strerror
(
errno
));
return
false
;
return
false
;
}
}
...
@@ -1963,7 +1977,7 @@ static bool cgv1_handle_cpuset_hierarchy(struct cgv1_hierarchy *h,
...
@@ -1963,7 +1977,7 @@ static bool cgv1_handle_cpuset_hierarchy(struct cgv1_hierarchy *h,
cgpath
=
must_make_path
(
h
->
mountpoint
,
h
->
base_cgroup
,
cgroup
,
NULL
);
cgpath
=
must_make_path
(
h
->
mountpoint
,
h
->
base_cgroup
,
cgroup
,
NULL
);
if
(
slash
)
if
(
slash
)
*
slash
=
'/'
;
*
slash
=
'/'
;
if
(
mkdir
(
cgpath
,
0755
)
<
0
&&
errno
!=
EEXIST
)
{
if
(
do_
mkdir
(
cgpath
,
0755
)
<
0
&&
errno
!=
EEXIST
)
{
pam_cgfs_debug
(
"Failed to create '%s'"
,
cgpath
);
pam_cgfs_debug
(
"Failed to create '%s'"
,
cgpath
);
free
(
cgpath
);
free
(
cgpath
);
return
false
;
return
false
;
...
...
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