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
e3d404cb
Unverified
Commit
e3d404cb
authored
Apr 22, 2021
by
Stéphane Graber
Committed by
GitHub
Apr 22, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3805 from brauner/2021-04-22.fixes.3
mntopt fixes
parents
5a65643b
2e5c468a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
11 deletions
+13
-11
conf.c
src/lxc/conf.c
+13
-11
No files found.
src/lxc/conf.c
View file @
e3d404cb
...
...
@@ -2131,10 +2131,10 @@ int parse_lxc_mntopts(struct lxc_mount_options *opts, char *mnt_opts)
__do_close
int
fd_userns
=
-
EBADF
;
const
char
*
opt_name
=
lxc_mount_options_info
[
i
];
size_t
len
;
char
*
idmap_path
,
*
p
,
*
p2
;
char
*
idmap_path
,
*
opt
,
*
opt_next
;
p
=
strstr
(
mnt_opts
,
opt_name
);
if
(
!
p
)
opt
=
strstr
(
mnt_opts
,
opt_name
);
if
(
!
opt
)
continue
;
switch
(
i
)
{
...
...
@@ -2151,14 +2151,16 @@ int parse_lxc_mntopts(struct lxc_mount_options *opts, char *mnt_opts)
opts
->
relative
=
1
;
break
;
case
LXC_MOUNT_IDMAP
:
p2
=
p
;
p2
+=
STRLITERALLEN
(
"idmap="
);
idmap_path
=
strchrnul
(
p2
,
','
);
opt_next
=
opt
;
opt_next
+=
STRLITERALLEN
(
"idmap="
);
idmap_path
=
strchrnul
(
opt_next
,
','
);
len
=
idmap_path
-
opt_next
+
1
;
len
=
strlcpy
(
opts
->
userns_path
,
p2
,
idmap_path
-
p2
+
1
);
if
(
len
>=
sizeof
(
opts
->
userns_path
))
return
syserror_set
(
-
EIO
,
"Excessive idmap path length for
\"
idmap=<path>
\"
LXC specific mount option"
);
memcpy
(
opts
->
userns_path
,
opt_next
,
len
);
if
(
is_empty_string
(
opts
->
userns_path
))
return
syserror_set
(
-
EINVAL
,
"Missing idmap path for
\"
idmap=<path>
\"
LXC specific mount option"
);
...
...
@@ -2172,11 +2174,11 @@ int parse_lxc_mntopts(struct lxc_mount_options *opts, char *mnt_opts)
return
syserror_set
(
-
EINVAL
,
"Unknown LXC specific mount option"
);
}
p2
=
strchr
(
p
,
','
);
if
(
!
p2
)
*
p
=
'\0'
;
/* no more mntopts, so just chop it here */
opt_next
=
strchr
(
opt
,
','
);
if
(
!
opt_next
)
*
opt
=
'\0'
;
/* no more mntopts, so just chop it here */
else
memmove
(
p
,
p2
+
1
,
strlen
(
p2
+
1
)
+
1
);
memmove
(
opt
,
opt_next
+
1
,
strlen
(
opt_next
+
1
)
+
1
);
}
return
0
;
...
...
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