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
e9ab177d
Unverified
Commit
e9ab177d
authored
Jun 07, 2019
by
Christian Brauner
Committed by
GitHub
Jun 07, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3032 from promlow/lxcbasename_fix
proposed fix for #2892 - fix lxcbasename in lxc/lxccontainer.c
parents
20a64b0b
85e02f56
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
lxccontainer.c
src/lxc/lxccontainer.c
+5
-4
No files found.
src/lxc/lxccontainer.c
View file @
e9ab177d
...
@@ -1320,12 +1320,13 @@ static struct lxc_storage *do_storage_create(struct lxc_container *c,
...
@@ -1320,12 +1320,13 @@ static struct lxc_storage *do_storage_create(struct lxc_container *c,
return
bdev
;
return
bdev
;
}
}
static
char
*
lxcbasename
(
char
*
path
)
/* Strip path and return name of file for argv[0] passed to execvp */
static
char
*
lxctemplatefilename
(
char
*
tpath
)
{
{
char
*
p
;
char
*
p
;
p
=
path
+
strlen
(
path
)
-
1
;
p
=
tpath
+
strlen
(
t
path
)
-
1
;
while
(
*
p
!=
'/'
&&
p
>
path
)
while
(
(
p
-
1
)
>=
tpath
&&
*
(
p
-
1
)
!=
'/'
)
p
--
;
p
--
;
return
p
;
return
p
;
...
@@ -1451,7 +1452,7 @@ static bool create_run_template(struct lxc_container *c, char *tpath,
...
@@ -1451,7 +1452,7 @@ static bool create_run_template(struct lxc_container *c, char *tpath,
newargv
=
malloc
(
nargs
*
sizeof
(
*
newargv
));
newargv
=
malloc
(
nargs
*
sizeof
(
*
newargv
));
if
(
!
newargv
)
if
(
!
newargv
)
_exit
(
EXIT_FAILURE
);
_exit
(
EXIT_FAILURE
);
newargv
[
0
]
=
lxc
bas
ename
(
tpath
);
newargv
[
0
]
=
lxc
templatefil
ename
(
tpath
);
/* --path */
/* --path */
len
=
strlen
(
c
->
config_path
)
+
strlen
(
c
->
name
)
+
strlen
(
"--path="
)
+
2
;
len
=
strlen
(
c
->
config_path
)
+
strlen
(
c
->
name
)
+
strlen
(
"--path="
)
+
2
;
...
...
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