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
801e1da4
Unverified
Commit
801e1da4
authored
Feb 22, 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
640dfcdc
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
conf.c
src/lxc/conf.c
+7
-9
No files found.
src/lxc/conf.c
View file @
801e1da4
...
@@ -4547,7 +4547,7 @@ static char *getgname(void)
...
@@ -4547,7 +4547,7 @@ static char *getgname(void)
void
suggest_default_idmap
(
void
)
void
suggest_default_idmap
(
void
)
{
{
__do_free
char
*
gname
=
NULL
,
*
line
=
NULL
,
*
uname
=
NULL
;
__do_free
char
*
gname
=
NULL
,
*
line
=
NULL
,
*
uname
=
NULL
;
FILE
*
f
;
__do_fclose
FILE
*
subuid_f
=
NULL
,
*
subgid_f
=
NULL
;
unsigned
int
uid
=
0
,
urange
=
0
,
gid
=
0
,
grange
=
0
;
unsigned
int
uid
=
0
,
urange
=
0
,
gid
=
0
,
grange
=
0
;
size_t
len
=
0
;
size_t
len
=
0
;
...
@@ -4559,13 +4559,13 @@ void suggest_default_idmap(void)
...
@@ -4559,13 +4559,13 @@ void suggest_default_idmap(void)
if
(
!
gname
)
if
(
!
gname
)
return
;
return
;
f
=
fopen
(
subuidfile
,
"r"
);
subuid_
f
=
fopen
(
subuidfile
,
"r"
);
if
(
!
f
)
{
if
(
!
subuid_
f
)
{
ERROR
(
"Your system is not configured with subuids"
);
ERROR
(
"Your system is not configured with subuids"
);
return
;
return
;
}
}
while
(
getline
(
&
line
,
&
len
,
f
)
!=
-
1
)
{
while
(
getline
(
&
line
,
&
len
,
subuid_
f
)
!=
-
1
)
{
char
*
p
,
*
p2
;
char
*
p
,
*
p2
;
size_t
no_newline
=
0
;
size_t
no_newline
=
0
;
...
@@ -4595,15 +4595,14 @@ void suggest_default_idmap(void)
...
@@ -4595,15 +4595,14 @@ void suggest_default_idmap(void)
if
(
lxc_safe_uint
(
p2
,
&
urange
)
<
0
)
if
(
lxc_safe_uint
(
p2
,
&
urange
)
<
0
)
WARN
(
"Could not parse UID range"
);
WARN
(
"Could not parse UID range"
);
}
}
fclose
(
f
);
f
=
fopen
(
subgidfile
,
"r"
);
subgid_
f
=
fopen
(
subgidfile
,
"r"
);
if
(
!
f
)
{
if
(
!
subgid_
f
)
{
ERROR
(
"Your system is not configured with subgids"
);
ERROR
(
"Your system is not configured with subgids"
);
return
;
return
;
}
}
while
(
getline
(
&
line
,
&
len
,
f
)
!=
-
1
)
{
while
(
getline
(
&
line
,
&
len
,
subgid_
f
)
!=
-
1
)
{
char
*
p
,
*
p2
;
char
*
p
,
*
p2
;
size_t
no_newline
=
0
;
size_t
no_newline
=
0
;
...
@@ -4633,7 +4632,6 @@ void suggest_default_idmap(void)
...
@@ -4633,7 +4632,6 @@ void suggest_default_idmap(void)
if
(
lxc_safe_uint
(
p2
,
&
grange
)
<
0
)
if
(
lxc_safe_uint
(
p2
,
&
grange
)
<
0
)
WARN
(
"Could not parse GID range"
);
WARN
(
"Could not parse GID range"
);
}
}
fclose
(
f
);
if
(
!
urange
||
!
grange
)
{
if
(
!
urange
||
!
grange
)
{
ERROR
(
"You do not have subuids or subgids allocated"
);
ERROR
(
"You do not have subuids or subgids allocated"
);
...
...
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