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
3a6e3bf5
Unverified
Commit
3a6e3bf5
authored
Feb 19, 2019
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
conf: cleanup macros suggest_default_idmap
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
4f410b2a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
16 deletions
+2
-16
conf.c
src/lxc/conf.c
+2
-16
No files found.
src/lxc/conf.c
View file @
3a6e3bf5
...
...
@@ -4655,27 +4655,22 @@ static char *getgname(void)
/* not thread-safe, do not use from api without first forking */
void
suggest_default_idmap
(
void
)
{
char
*
uname
,
*
gname
;
__do_free
char
*
gname
=
NULL
,
*
line
=
NULL
,
*
uname
=
NULL
;
FILE
*
f
;
unsigned
int
uid
=
0
,
urange
=
0
,
gid
=
0
,
grange
=
0
;
size_t
len
=
0
;
char
*
line
=
NULL
;
uname
=
getuname
();
if
(
!
uname
)
return
;
gname
=
getgname
();
if
(
!
gname
)
{
free
(
uname
);
if
(
!
gname
)
return
;
}
f
=
fopen
(
subuidfile
,
"r"
);
if
(
!
f
)
{
ERROR
(
"Your system is not configured with subuids"
);
free
(
gname
);
free
(
uname
);
return
;
}
...
...
@@ -4714,8 +4709,6 @@ void suggest_default_idmap(void)
f
=
fopen
(
subgidfile
,
"r"
);
if
(
!
f
)
{
ERROR
(
"Your system is not configured with subgids"
);
free
(
gname
);
free
(
uname
);
return
;
}
...
...
@@ -4751,13 +4744,9 @@ void suggest_default_idmap(void)
}
fclose
(
f
);
free
(
line
);
if
(
!
urange
||
!
grange
)
{
ERROR
(
"You do not have subuids or subgids allocated"
);
ERROR
(
"Unprivileged containers require subuids and subgids"
);
free
(
uname
);
free
(
gname
);
return
;
}
...
...
@@ -4767,9 +4756,6 @@ void suggest_default_idmap(void)
ERROR
(
"lxc.include = %s"
,
LXC_DEFAULT_CONFIG
);
ERROR
(
"lxc.idmap = u 0 %u %u"
,
uid
,
urange
);
ERROR
(
"lxc.idmap = g 0 %u %u"
,
gid
,
grange
);
free
(
gname
);
free
(
uname
);
}
static
void
free_cgroup_settings
(
struct
lxc_list
*
result
)
...
...
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