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
390d8952
Commit
390d8952
authored
Aug 27, 2015
by
Stéphane Graber
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #639 from schiele/stable-1.1
check for NULL pointers before calling setenv()
parents
b6e1320d
eec49e00
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
lxccontainer.c
src/lxc/lxccontainer.c
+5
-5
start.c
src/lxc/start.c
+4
-4
No files found.
src/lxc/lxccontainer.c
View file @
390d8952
...
...
@@ -2710,19 +2710,19 @@ static int clone_update_rootfs(struct clone_update_data *data)
if
(
!
lxc_list_empty
(
&
conf
->
hooks
[
LXCHOOK_CLONE
]))
{
/* Start of environment variable setup for hooks */
if
(
setenv
(
"LXC_SRC_NAME"
,
c0
->
name
,
1
))
{
if
(
c0
->
name
&&
setenv
(
"LXC_SRC_NAME"
,
c0
->
name
,
1
))
{
SYSERROR
(
"failed to set environment variable for source container name"
);
}
if
(
setenv
(
"LXC_NAME"
,
c
->
name
,
1
))
{
if
(
c
->
name
&&
setenv
(
"LXC_NAME"
,
c
->
name
,
1
))
{
SYSERROR
(
"failed to set environment variable for container name"
);
}
if
(
setenv
(
"LXC_CONFIG_FILE"
,
conf
->
rcfile
,
1
))
{
if
(
conf
->
rcfile
&&
setenv
(
"LXC_CONFIG_FILE"
,
conf
->
rcfile
,
1
))
{
SYSERROR
(
"failed to set environment variable for config path"
);
}
if
(
setenv
(
"LXC_ROOTFS_MOUNT"
,
bdev
->
dest
,
1
))
{
if
(
bdev
->
dest
&&
setenv
(
"LXC_ROOTFS_MOUNT"
,
bdev
->
dest
,
1
))
{
SYSERROR
(
"failed to set environment variable for rootfs mount"
);
}
if
(
setenv
(
"LXC_ROOTFS_PATH"
,
conf
->
rootfs
.
path
,
1
))
{
if
(
conf
->
rootfs
.
path
&&
setenv
(
"LXC_ROOTFS_PATH"
,
conf
->
rootfs
.
path
,
1
))
{
SYSERROR
(
"failed to set environment variable for rootfs mount"
);
}
...
...
src/lxc/start.c
View file @
390d8952
...
...
@@ -406,16 +406,16 @@ struct lxc_handler *lxc_init(const char *name, struct lxc_conf *conf, const char
}
/* Start of environment variable setup for hooks */
if
(
setenv
(
"LXC_NAME"
,
name
,
1
))
{
if
(
name
&&
setenv
(
"LXC_NAME"
,
name
,
1
))
{
SYSERROR
(
"failed to set environment variable for container name"
);
}
if
(
setenv
(
"LXC_CONFIG_FILE"
,
conf
->
rcfile
,
1
))
{
if
(
conf
->
rcfile
&&
setenv
(
"LXC_CONFIG_FILE"
,
conf
->
rcfile
,
1
))
{
SYSERROR
(
"failed to set environment variable for config path"
);
}
if
(
setenv
(
"LXC_ROOTFS_MOUNT"
,
conf
->
rootfs
.
mount
,
1
))
{
if
(
conf
->
rootfs
.
mount
&&
setenv
(
"LXC_ROOTFS_MOUNT"
,
conf
->
rootfs
.
mount
,
1
))
{
SYSERROR
(
"failed to set environment variable for rootfs mount"
);
}
if
(
setenv
(
"LXC_ROOTFS_PATH"
,
conf
->
rootfs
.
path
,
1
))
{
if
(
conf
->
rootfs
.
path
&&
setenv
(
"LXC_ROOTFS_PATH"
,
conf
->
rootfs
.
path
,
1
))
{
SYSERROR
(
"failed to set environment variable for rootfs mount"
);
}
if
(
conf
->
console
.
path
&&
setenv
(
"LXC_CONSOLE"
,
conf
->
console
.
path
,
1
))
{
...
...
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