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
436253a7
Unverified
Commit
436253a7
authored
Jun 05, 2019
by
Paul Romlow
Committed by
Christian Brauner
Jun 13, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
proposed fix for #2892 - fix lxcbasename in lxc/lxccontainer.c
Signed-off-by:
Paul Romlow
<
paul@romlow.com
>
parent
925bcb12
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 @
436253a7
...
@@ -1298,12 +1298,13 @@ static struct lxc_storage *do_storage_create(struct lxc_container *c,
...
@@ -1298,12 +1298,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
;
...
@@ -1429,7 +1430,7 @@ static bool create_run_template(struct lxc_container *c, char *tpath,
...
@@ -1429,7 +1430,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