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
31283a46
Unverified
Commit
31283a46
authored
Apr 23, 2018
by
Christian Brauner
Committed by
GitHub
Apr 23, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2284 from 3XX0/pamcgfs-ignore-umask
pam-cgfs: ignore the system umask when creating the cgroup hierarchy
parents
5dfc9186
c4a4578f
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 @
31283a46
...
...
@@ -223,6 +223,20 @@ static bool cgv2_prune_empty_cgroups(const char *user);
static
bool
cgv2_remove
(
const
char
*
cgroup
);
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. */
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
))
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
));
return
false
;
}
...
...
@@ -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
);
if
(
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
);
free
(
cgpath
);
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