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
d62177e9
Unverified
Commit
d62177e9
authored
Feb 13, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
confile: convert to strequal()
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
71528742
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
82 additions
and
84 deletions
+82
-84
confile.c
src/lxc/confile.c
+82
-84
No files found.
src/lxc/confile.c
View file @
d62177e9
...
@@ -287,7 +287,7 @@ struct lxc_config_t *lxc_get_config_exact(const char *key)
...
@@ -287,7 +287,7 @@ struct lxc_config_t *lxc_get_config_exact(const char *key)
size_t
i
;
size_t
i
;
for
(
i
=
0
;
i
<
config_jump_table_size
;
i
++
)
for
(
i
=
0
;
i
<
config_jump_table_size
;
i
++
)
if
(
!
strcmp
(
config_jump_table
[
i
].
name
,
key
))
if
(
strequal
(
config_jump_table
[
i
].
name
,
key
))
return
&
config_jump_table
[
i
];
return
&
config_jump_table
[
i
];
return
NULL
;
return
NULL
;
...
@@ -327,30 +327,30 @@ static int set_config_net_type(const char *key, const char *value,
...
@@ -327,30 +327,30 @@ static int set_config_net_type(const char *key, const char *value,
if
(
!
netdev
)
if
(
!
netdev
)
return
ret_errno
(
EINVAL
);
return
ret_errno
(
EINVAL
);
if
(
str
cmp
(
value
,
"veth"
)
==
0
)
{
if
(
str
equal
(
value
,
"veth"
)
)
{
netdev
->
type
=
LXC_NET_VETH
;
netdev
->
type
=
LXC_NET_VETH
;
lxc_list_init
(
&
netdev
->
priv
.
veth_attr
.
ipv4_routes
);
lxc_list_init
(
&
netdev
->
priv
.
veth_attr
.
ipv4_routes
);
lxc_list_init
(
&
netdev
->
priv
.
veth_attr
.
ipv6_routes
);
lxc_list_init
(
&
netdev
->
priv
.
veth_attr
.
ipv6_routes
);
lxc_list_init
(
&
netdev
->
priv
.
veth_attr
.
vlan_tagged_ids
);
lxc_list_init
(
&
netdev
->
priv
.
veth_attr
.
vlan_tagged_ids
);
if
(
!
lxc_veth_flag_to_mode
(
netdev
->
priv
.
veth_attr
.
mode
))
if
(
!
lxc_veth_flag_to_mode
(
netdev
->
priv
.
veth_attr
.
mode
))
lxc_veth_mode_to_flag
(
&
netdev
->
priv
.
veth_attr
.
mode
,
"bridge"
);
lxc_veth_mode_to_flag
(
&
netdev
->
priv
.
veth_attr
.
mode
,
"bridge"
);
}
else
if
(
str
cmp
(
value
,
"macvlan"
)
==
0
)
{
}
else
if
(
str
equal
(
value
,
"macvlan"
)
)
{
netdev
->
type
=
LXC_NET_MACVLAN
;
netdev
->
type
=
LXC_NET_MACVLAN
;
if
(
!
lxc_macvlan_flag_to_mode
(
netdev
->
priv
.
veth_attr
.
mode
))
if
(
!
lxc_macvlan_flag_to_mode
(
netdev
->
priv
.
veth_attr
.
mode
))
lxc_macvlan_mode_to_flag
(
&
netdev
->
priv
.
macvlan_attr
.
mode
,
"private"
);
lxc_macvlan_mode_to_flag
(
&
netdev
->
priv
.
macvlan_attr
.
mode
,
"private"
);
}
else
if
(
str
cmp
(
value
,
"ipvlan"
)
==
0
)
{
}
else
if
(
str
equal
(
value
,
"ipvlan"
)
)
{
netdev
->
type
=
LXC_NET_IPVLAN
;
netdev
->
type
=
LXC_NET_IPVLAN
;
if
(
!
lxc_ipvlan_flag_to_mode
(
netdev
->
priv
.
ipvlan_attr
.
mode
))
if
(
!
lxc_ipvlan_flag_to_mode
(
netdev
->
priv
.
ipvlan_attr
.
mode
))
lxc_ipvlan_mode_to_flag
(
&
netdev
->
priv
.
ipvlan_attr
.
mode
,
"l3"
);
lxc_ipvlan_mode_to_flag
(
&
netdev
->
priv
.
ipvlan_attr
.
mode
,
"l3"
);
if
(
!
lxc_ipvlan_flag_to_isolation
(
netdev
->
priv
.
ipvlan_attr
.
isolation
))
if
(
!
lxc_ipvlan_flag_to_isolation
(
netdev
->
priv
.
ipvlan_attr
.
isolation
))
lxc_ipvlan_isolation_to_flag
(
&
netdev
->
priv
.
ipvlan_attr
.
isolation
,
"bridge"
);
lxc_ipvlan_isolation_to_flag
(
&
netdev
->
priv
.
ipvlan_attr
.
isolation
,
"bridge"
);
}
else
if
(
str
cmp
(
value
,
"vlan"
)
==
0
)
{
}
else
if
(
str
equal
(
value
,
"vlan"
)
)
{
netdev
->
type
=
LXC_NET_VLAN
;
netdev
->
type
=
LXC_NET_VLAN
;
}
else
if
(
str
cmp
(
value
,
"phys"
)
==
0
)
{
}
else
if
(
str
equal
(
value
,
"phys"
)
)
{
netdev
->
type
=
LXC_NET_PHYS
;
netdev
->
type
=
LXC_NET_PHYS
;
}
else
if
(
str
cmp
(
value
,
"empty"
)
==
0
)
{
}
else
if
(
str
equal
(
value
,
"empty"
)
)
{
netdev
->
type
=
LXC_NET_EMPTY
;
netdev
->
type
=
LXC_NET_EMPTY
;
}
else
if
(
str
cmp
(
value
,
"none"
)
==
0
)
{
}
else
if
(
str
equal
(
value
,
"none"
)
)
{
netdev
->
type
=
LXC_NET_NONE
;
netdev
->
type
=
LXC_NET_NONE
;
}
else
{
}
else
{
return
log_error
(
-
1
,
"Invalid network type %s"
,
value
);
return
log_error
(
-
1
,
"Invalid network type %s"
,
value
);
...
@@ -521,7 +521,7 @@ static int set_config_net_veth_vlan_id(const char *key, const char *value,
...
@@ -521,7 +521,7 @@ static int set_config_net_veth_vlan_id(const char *key, const char *value,
if
(
lxc_config_value_empty
(
value
))
if
(
lxc_config_value_empty
(
value
))
return
clr_config_net_veth_vlan_id
(
key
,
lxc_conf
,
data
);
return
clr_config_net_veth_vlan_id
(
key
,
lxc_conf
,
data
);
if
(
str
cmp
(
value
,
"none"
)
==
0
)
{
if
(
str
equal
(
value
,
"none"
)
)
{
netdev
->
priv
.
veth_attr
.
vlan_id
=
BRIDGE_VLAN_NONE
;
netdev
->
priv
.
veth_attr
.
vlan_id
=
BRIDGE_VLAN_NONE
;
}
else
{
}
else
{
unsigned
short
vlan_id
;
unsigned
short
vlan_id
;
...
@@ -779,10 +779,10 @@ static int set_config_net_ipv4_gateway(const char *key, const char *value,
...
@@ -779,10 +779,10 @@ static int set_config_net_ipv4_gateway(const char *key, const char *value,
free
(
netdev
->
ipv4_gateway
);
free
(
netdev
->
ipv4_gateway
);
if
(
str
cmp
(
value
,
"auto"
)
==
0
)
{
if
(
str
equal
(
value
,
"auto"
)
)
{
netdev
->
ipv4_gateway
=
NULL
;
netdev
->
ipv4_gateway
=
NULL
;
netdev
->
ipv4_gateway_auto
=
true
;
netdev
->
ipv4_gateway_auto
=
true
;
}
else
if
(
str
cmp
(
value
,
"dev"
)
==
0
)
{
}
else
if
(
str
equal
(
value
,
"dev"
)
)
{
netdev
->
ipv4_gateway
=
NULL
;
netdev
->
ipv4_gateway
=
NULL
;
netdev
->
ipv4_gateway_auto
=
false
;
netdev
->
ipv4_gateway_auto
=
false
;
netdev
->
ipv4_gateway_dev
=
true
;
netdev
->
ipv4_gateway_dev
=
true
;
...
@@ -935,10 +935,10 @@ static int set_config_net_ipv6_gateway(const char *key, const char *value,
...
@@ -935,10 +935,10 @@ static int set_config_net_ipv6_gateway(const char *key, const char *value,
free
(
netdev
->
ipv6_gateway
);
free
(
netdev
->
ipv6_gateway
);
if
(
str
cmp
(
value
,
"auto"
)
==
0
)
{
if
(
str
equal
(
value
,
"auto"
)
)
{
netdev
->
ipv6_gateway
=
NULL
;
netdev
->
ipv6_gateway
=
NULL
;
netdev
->
ipv6_gateway_auto
=
true
;
netdev
->
ipv6_gateway_auto
=
true
;
}
else
if
(
str
cmp
(
value
,
"dev"
)
==
0
)
{
}
else
if
(
str
equal
(
value
,
"dev"
)
)
{
netdev
->
ipv6_gateway
=
NULL
;
netdev
->
ipv6_gateway
=
NULL
;
netdev
->
ipv6_gateway_auto
=
false
;
netdev
->
ipv6_gateway_auto
=
false
;
netdev
->
ipv6_gateway_dev
=
true
;
netdev
->
ipv6_gateway_dev
=
true
;
...
@@ -1246,32 +1246,32 @@ static int set_config_hooks(const char *key, const char *value,
...
@@ -1246,32 +1246,32 @@ static int set_config_hooks(const char *key, const char *value,
if
(
lxc_config_value_empty
(
value
))
if
(
lxc_config_value_empty
(
value
))
return
lxc_clear_hooks
(
lxc_conf
,
key
);
return
lxc_clear_hooks
(
lxc_conf
,
key
);
if
(
str
cmp
(
key
+
4
,
"hook"
)
==
0
)
if
(
str
equal
(
key
+
4
,
"hook"
)
)
return
log_error_errno
(
-
EINVAL
,
EINVAL
,
"lxc.hook must not have a value"
);
return
log_error_errno
(
-
EINVAL
,
EINVAL
,
"lxc.hook must not have a value"
);
copy
=
strdup
(
value
);
copy
=
strdup
(
value
);
if
(
!
copy
)
if
(
!
copy
)
return
ret_errno
(
ENOMEM
);
return
ret_errno
(
ENOMEM
);
if
(
str
cmp
(
key
+
9
,
"pre-start"
)
==
0
)
if
(
str
equal
(
key
+
9
,
"pre-start"
)
)
return
add_hook
(
lxc_conf
,
LXCHOOK_PRESTART
,
move_ptr
(
copy
));
return
add_hook
(
lxc_conf
,
LXCHOOK_PRESTART
,
move_ptr
(
copy
));
else
if
(
str
cmp
(
key
+
9
,
"start-host"
)
==
0
)
else
if
(
str
equal
(
key
+
9
,
"start-host"
)
)
return
add_hook
(
lxc_conf
,
LXCHOOK_START_HOST
,
move_ptr
(
copy
));
return
add_hook
(
lxc_conf
,
LXCHOOK_START_HOST
,
move_ptr
(
copy
));
else
if
(
str
cmp
(
key
+
9
,
"pre-mount"
)
==
0
)
else
if
(
str
equal
(
key
+
9
,
"pre-mount"
)
)
return
add_hook
(
lxc_conf
,
LXCHOOK_PREMOUNT
,
move_ptr
(
copy
));
return
add_hook
(
lxc_conf
,
LXCHOOK_PREMOUNT
,
move_ptr
(
copy
));
else
if
(
str
cmp
(
key
+
9
,
"autodev"
)
==
0
)
else
if
(
str
equal
(
key
+
9
,
"autodev"
)
)
return
add_hook
(
lxc_conf
,
LXCHOOK_AUTODEV
,
move_ptr
(
copy
));
return
add_hook
(
lxc_conf
,
LXCHOOK_AUTODEV
,
move_ptr
(
copy
));
else
if
(
str
cmp
(
key
+
9
,
"mount"
)
==
0
)
else
if
(
str
equal
(
key
+
9
,
"mount"
)
)
return
add_hook
(
lxc_conf
,
LXCHOOK_MOUNT
,
move_ptr
(
copy
));
return
add_hook
(
lxc_conf
,
LXCHOOK_MOUNT
,
move_ptr
(
copy
));
else
if
(
str
cmp
(
key
+
9
,
"start"
)
==
0
)
else
if
(
str
equal
(
key
+
9
,
"start"
)
)
return
add_hook
(
lxc_conf
,
LXCHOOK_START
,
move_ptr
(
copy
));
return
add_hook
(
lxc_conf
,
LXCHOOK_START
,
move_ptr
(
copy
));
else
if
(
str
cmp
(
key
+
9
,
"stop"
)
==
0
)
else
if
(
str
equal
(
key
+
9
,
"stop"
)
)
return
add_hook
(
lxc_conf
,
LXCHOOK_STOP
,
move_ptr
(
copy
));
return
add_hook
(
lxc_conf
,
LXCHOOK_STOP
,
move_ptr
(
copy
));
else
if
(
str
cmp
(
key
+
9
,
"post-stop"
)
==
0
)
else
if
(
str
equal
(
key
+
9
,
"post-stop"
)
)
return
add_hook
(
lxc_conf
,
LXCHOOK_POSTSTOP
,
move_ptr
(
copy
));
return
add_hook
(
lxc_conf
,
LXCHOOK_POSTSTOP
,
move_ptr
(
copy
));
else
if
(
str
cmp
(
key
+
9
,
"clone"
)
==
0
)
else
if
(
str
equal
(
key
+
9
,
"clone"
)
)
return
add_hook
(
lxc_conf
,
LXCHOOK_CLONE
,
move_ptr
(
copy
));
return
add_hook
(
lxc_conf
,
LXCHOOK_CLONE
,
move_ptr
(
copy
));
else
if
(
str
cmp
(
key
+
9
,
"destroy"
)
==
0
)
else
if
(
str
equal
(
key
+
9
,
"destroy"
)
)
return
add_hook
(
lxc_conf
,
LXCHOOK_DESTROY
,
move_ptr
(
copy
));
return
add_hook
(
lxc_conf
,
LXCHOOK_DESTROY
,
move_ptr
(
copy
));
return
ret_errno
(
EINVAL
);
return
ret_errno
(
EINVAL
);
...
@@ -1387,7 +1387,7 @@ static int set_config_monitor(const char *key, const char *value,
...
@@ -1387,7 +1387,7 @@ static int set_config_monitor(const char *key, const char *value,
return
0
;
return
0
;
}
}
if
(
str
cmp
(
key
+
12
,
"unshare"
)
==
0
)
if
(
str
equal
(
key
+
12
,
"unshare"
)
)
return
lxc_safe_uint
(
value
,
&
lxc_conf
->
monitor_unshare
);
return
lxc_safe_uint
(
value
,
&
lxc_conf
->
monitor_unshare
);
return
ret_errno
(
EINVAL
);
return
ret_errno
(
EINVAL
);
...
@@ -1401,7 +1401,7 @@ static int set_config_monitor_signal_pdeath(const char *key, const char *value,
...
@@ -1401,7 +1401,7 @@ static int set_config_monitor_signal_pdeath(const char *key, const char *value,
return
0
;
return
0
;
}
}
if
(
str
cmp
(
key
+
12
,
"signal.pdeath"
)
==
0
)
{
if
(
str
equal
(
key
+
12
,
"signal.pdeath"
)
)
{
int
sig_n
;
int
sig_n
;
sig_n
=
sig_parse
(
value
);
sig_n
=
sig_parse
(
value
);
...
@@ -1819,7 +1819,7 @@ static int set_config_cgroup2_controller(const char *key, const char *value,
...
@@ -1819,7 +1819,7 @@ static int set_config_cgroup2_controller(const char *key, const char *value,
static
int
set_config_cgroup_dir
(
const
char
*
key
,
const
char
*
value
,
static
int
set_config_cgroup_dir
(
const
char
*
key
,
const
char
*
value
,
struct
lxc_conf
*
lxc_conf
,
void
*
data
)
struct
lxc_conf
*
lxc_conf
,
void
*
data
)
{
{
if
(
strcmp
(
key
,
"lxc.cgroup.dir"
)
!=
0
)
if
(
!
strequal
(
key
,
"lxc.cgroup.dir"
)
)
return
ret_errno
(
EINVAL
);
return
ret_errno
(
EINVAL
);
if
(
lxc_config_value_empty
(
value
))
if
(
lxc_config_value_empty
(
value
))
...
@@ -1867,9 +1867,7 @@ static int set_config_cgroup_container_inner_dir(const char *key,
...
@@ -1867,9 +1867,7 @@ static int set_config_cgroup_container_inner_dir(const char *key,
if
(
lxc_config_value_empty
(
value
))
if
(
lxc_config_value_empty
(
value
))
return
clr_config_cgroup_container_inner_dir
(
key
,
lxc_conf
,
NULL
);
return
clr_config_cgroup_container_inner_dir
(
key
,
lxc_conf
,
NULL
);
if
(
strchr
(
value
,
'/'
)
||
if
(
strchr
(
value
,
'/'
)
||
strequal
(
value
,
"."
)
||
strequal
(
value
,
".."
))
strcmp
(
value
,
"."
)
==
0
||
strcmp
(
value
,
".."
)
==
0
)
return
log_error_errno
(
-
EINVAL
,
EINVAL
,
"lxc.cgroup.dir.container.inner must be a single directory name"
);
return
log_error_errno
(
-
EINVAL
,
EINVAL
,
"lxc.cgroup.dir.container.inner must be a single directory name"
);
return
set_config_string_item
(
&
lxc_conf
->
cgroup_meta
.
namespace_dir
,
value
);
return
set_config_string_item
(
&
lxc_conf
->
cgroup_meta
.
namespace_dir
,
value
);
...
@@ -1977,7 +1975,7 @@ static int set_config_prlimit(const char *key, const char *value,
...
@@ -1977,7 +1975,7 @@ static int set_config_prlimit(const char *key, const char *value,
/* find existing list element */
/* find existing list element */
lxc_list_for_each
(
iter
,
&
lxc_conf
->
limits
)
{
lxc_list_for_each
(
iter
,
&
lxc_conf
->
limits
)
{
limelem
=
iter
->
elem
;
limelem
=
iter
->
elem
;
if
(
!
strcmp
(
key
,
limelem
->
resource
))
{
if
(
strequal
(
key
,
limelem
->
resource
))
{
limelem
->
limit
=
limit
;
limelem
->
limit
=
limit
;
return
0
;
return
0
;
}
}
...
@@ -2025,7 +2023,7 @@ static int set_config_sysctl(const char *key, const char *value,
...
@@ -2025,7 +2023,7 @@ static int set_config_sysctl(const char *key, const char *value,
sysctl_elem
=
iter
->
elem
;
sysctl_elem
=
iter
->
elem
;
if
(
strcmp
(
key
,
sysctl_elem
->
key
)
!=
0
)
if
(
!
strequal
(
key
,
sysctl_elem
->
key
)
)
continue
;
continue
;
replace_value
=
strdup
(
value
);
replace_value
=
strdup
(
value
);
...
@@ -2222,10 +2220,10 @@ static int set_config_mount_auto(const char *key, const char *value,
...
@@ -2222,10 +2220,10 @@ static int set_config_mount_auto(const char *key, const char *value,
bool
is_shmounts
=
false
;
bool
is_shmounts
=
false
;
for
(
i
=
0
;
allowed_auto_mounts
[
i
].
token
;
i
++
)
{
for
(
i
=
0
;
allowed_auto_mounts
[
i
].
token
;
i
++
)
{
if
(
!
strcmp
(
allowed_auto_mounts
[
i
].
token
,
token
))
if
(
strequal
(
allowed_auto_mounts
[
i
].
token
,
token
))
break
;
break
;
if
(
str
cmp
(
"shmounts:"
,
allowed_auto_mounts
[
i
].
token
)
==
0
&&
if
(
str
equal
(
"shmounts:"
,
allowed_auto_mounts
[
i
].
token
)
&&
strncmp
(
"shmounts:"
,
token
,
STRLITERALLEN
(
"shmounts:"
))
==
0
)
{
strncmp
(
"shmounts:"
,
token
,
STRLITERALLEN
(
"shmounts:"
))
==
0
)
{
is_shmounts
=
true
;
is_shmounts
=
true
;
break
;
break
;
...
@@ -2313,7 +2311,7 @@ static int set_config_cap_keep(const char *key, const char *value,
...
@@ -2313,7 +2311,7 @@ static int set_config_cap_keep(const char *key, const char *value,
* split these caps in a single element for the list.
* split these caps in a single element for the list.
*/
*/
lxc_iterate_parts
(
token
,
keepcaps
,
"
\t
"
)
{
lxc_iterate_parts
(
token
,
keepcaps
,
"
\t
"
)
{
if
(
!
strcmp
(
token
,
"none"
))
if
(
strequal
(
token
,
"none"
))
lxc_clear_config_keepcaps
(
lxc_conf
);
lxc_clear_config_keepcaps
(
lxc_conf
);
keeplist
=
malloc
(
sizeof
(
*
keeplist
));
keeplist
=
malloc
(
sizeof
(
*
keeplist
));
...
@@ -2407,7 +2405,7 @@ static int set_config_console_buffer_size(const char *key, const char *value,
...
@@ -2407,7 +2405,7 @@ static int set_config_console_buffer_size(const char *key, const char *value,
}
}
/* If the user specified "auto" the default log size is 2^17 = 128 Kib */
/* If the user specified "auto" the default log size is 2^17 = 128 Kib */
if
(
!
strcmp
(
value
,
"auto"
))
{
if
(
strequal
(
value
,
"auto"
))
{
lxc_conf
->
console
.
buffer_size
=
1
<<
17
;
lxc_conf
->
console
.
buffer_size
=
1
<<
17
;
return
0
;
return
0
;
}
}
...
@@ -2452,7 +2450,7 @@ static int set_config_console_size(const char *key, const char *value,
...
@@ -2452,7 +2450,7 @@ static int set_config_console_size(const char *key, const char *value,
}
}
/* If the user specified "auto" the default log size is 2^17 = 128 Kib */
/* If the user specified "auto" the default log size is 2^17 = 128 Kib */
if
(
!
strcmp
(
value
,
"auto"
))
{
if
(
strequal
(
value
,
"auto"
))
{
lxc_conf
->
console
.
log_size
=
1
<<
17
;
lxc_conf
->
console
.
log_size
=
1
<<
17
;
return
0
;
return
0
;
}
}
...
@@ -2564,10 +2562,10 @@ static int do_includedir(const char *dirp, struct lxc_conf *lxc_conf)
...
@@ -2564,10 +2562,10 @@ static int do_includedir(const char *dirp, struct lxc_conf *lxc_conf)
char
path
[
PATH_MAX
];
char
path
[
PATH_MAX
];
fnam
=
direntp
->
d_name
;
fnam
=
direntp
->
d_name
;
if
(
!
strcmp
(
fnam
,
"."
))
if
(
strequal
(
fnam
,
"."
))
continue
;
continue
;
if
(
!
strcmp
(
fnam
,
".."
))
if
(
strequal
(
fnam
,
".."
))
continue
;
continue
;
len
=
strlen
(
fnam
);
len
=
strlen
(
fnam
);
...
@@ -2776,21 +2774,21 @@ static int set_config_time_offset_boot(const char *key, const char *value,
...
@@ -2776,21 +2774,21 @@ static int set_config_time_offset_boot(const char *key, const char *value,
return
ret
;
return
ret
;
unit
=
lxc_trim_whitespace_in_place
(
buf
);
unit
=
lxc_trim_whitespace_in_place
(
buf
);
if
(
str
cmp
(
unit
,
"h"
)
==
0
)
{
if
(
str
equal
(
unit
,
"h"
)
)
{
if
(
!
multiply_overflow
(
offset
,
3600
,
&
lxc_conf
->
timens
.
s_boot
))
if
(
!
multiply_overflow
(
offset
,
3600
,
&
lxc_conf
->
timens
.
s_boot
))
return
ret_errno
(
EOVERFLOW
);
return
ret_errno
(
EOVERFLOW
);
}
else
if
(
str
cmp
(
unit
,
"m"
)
==
0
)
{
}
else
if
(
str
equal
(
unit
,
"m"
)
)
{
if
(
!
multiply_overflow
(
offset
,
60
,
&
lxc_conf
->
timens
.
s_boot
))
if
(
!
multiply_overflow
(
offset
,
60
,
&
lxc_conf
->
timens
.
s_boot
))
return
ret_errno
(
EOVERFLOW
);
return
ret_errno
(
EOVERFLOW
);
}
else
if
(
str
cmp
(
unit
,
"s"
)
==
0
)
{
}
else
if
(
str
equal
(
unit
,
"s"
)
)
{
lxc_conf
->
timens
.
s_boot
=
offset
;
lxc_conf
->
timens
.
s_boot
=
offset
;
}
else
if
(
str
cmp
(
unit
,
"ms"
)
==
0
)
{
}
else
if
(
str
equal
(
unit
,
"ms"
)
)
{
if
(
!
multiply_overflow
(
offset
,
1000000
,
&
lxc_conf
->
timens
.
ns_boot
))
if
(
!
multiply_overflow
(
offset
,
1000000
,
&
lxc_conf
->
timens
.
ns_boot
))
return
ret_errno
(
EOVERFLOW
);
return
ret_errno
(
EOVERFLOW
);
}
else
if
(
str
cmp
(
unit
,
"us"
)
==
0
)
{
}
else
if
(
str
equal
(
unit
,
"us"
)
)
{
if
(
!
multiply_overflow
(
offset
,
1000
,
&
lxc_conf
->
timens
.
ns_boot
))
if
(
!
multiply_overflow
(
offset
,
1000
,
&
lxc_conf
->
timens
.
ns_boot
))
return
ret_errno
(
EOVERFLOW
);
return
ret_errno
(
EOVERFLOW
);
}
else
if
(
str
cmp
(
unit
,
"ns"
)
==
0
)
{
}
else
if
(
str
equal
(
unit
,
"ns"
)
)
{
lxc_conf
->
timens
.
ns_boot
=
offset
;
lxc_conf
->
timens
.
ns_boot
=
offset
;
}
else
{
}
else
{
return
ret_errno
(
EINVAL
);
return
ret_errno
(
EINVAL
);
...
@@ -2815,21 +2813,21 @@ static int set_config_time_offset_monotonic(const char *key, const char *value,
...
@@ -2815,21 +2813,21 @@ static int set_config_time_offset_monotonic(const char *key, const char *value,
return
ret
;
return
ret
;
unit
=
lxc_trim_whitespace_in_place
(
buf
);
unit
=
lxc_trim_whitespace_in_place
(
buf
);
if
(
str
cmp
(
unit
,
"h"
)
==
0
)
{
if
(
str
equal
(
unit
,
"h"
)
)
{
if
(
!
multiply_overflow
(
offset
,
3600
,
&
lxc_conf
->
timens
.
s_monotonic
))
if
(
!
multiply_overflow
(
offset
,
3600
,
&
lxc_conf
->
timens
.
s_monotonic
))
return
ret_errno
(
EOVERFLOW
);
return
ret_errno
(
EOVERFLOW
);
}
else
if
(
str
cmp
(
unit
,
"m"
)
==
0
)
{
}
else
if
(
str
equal
(
unit
,
"m"
)
)
{
if
(
!
multiply_overflow
(
offset
,
60
,
&
lxc_conf
->
timens
.
s_monotonic
))
if
(
!
multiply_overflow
(
offset
,
60
,
&
lxc_conf
->
timens
.
s_monotonic
))
return
ret_errno
(
EOVERFLOW
);
return
ret_errno
(
EOVERFLOW
);
}
else
if
(
str
cmp
(
unit
,
"s"
)
==
0
)
{
}
else
if
(
str
equal
(
unit
,
"s"
)
)
{
lxc_conf
->
timens
.
s_monotonic
=
offset
;
lxc_conf
->
timens
.
s_monotonic
=
offset
;
}
else
if
(
str
cmp
(
unit
,
"ms"
)
==
0
)
{
}
else
if
(
str
equal
(
unit
,
"ms"
)
)
{
if
(
!
multiply_overflow
(
offset
,
1000000
,
&
lxc_conf
->
timens
.
ns_monotonic
))
if
(
!
multiply_overflow
(
offset
,
1000000
,
&
lxc_conf
->
timens
.
ns_monotonic
))
return
ret_errno
(
EOVERFLOW
);
return
ret_errno
(
EOVERFLOW
);
}
else
if
(
str
cmp
(
unit
,
"us"
)
==
0
)
{
}
else
if
(
str
equal
(
unit
,
"us"
)
)
{
if
(
!
multiply_overflow
(
offset
,
1000
,
&
lxc_conf
->
timens
.
ns_monotonic
))
if
(
!
multiply_overflow
(
offset
,
1000
,
&
lxc_conf
->
timens
.
ns_monotonic
))
return
ret_errno
(
EOVERFLOW
);
return
ret_errno
(
EOVERFLOW
);
}
else
if
(
str
cmp
(
unit
,
"ns"
)
==
0
)
{
}
else
if
(
str
equal
(
unit
,
"ns"
)
)
{
lxc_conf
->
timens
.
ns_monotonic
=
offset
;
lxc_conf
->
timens
.
ns_monotonic
=
offset
;
}
else
{
}
else
{
return
ret_errno
(
EINVAL
);
return
ret_errno
(
EINVAL
);
...
@@ -3087,7 +3085,7 @@ signed long lxc_config_parse_arch(const char *arch)
...
@@ -3087,7 +3085,7 @@ signed long lxc_config_parse_arch(const char *arch)
size_t
len
=
sizeof
(
pername
)
/
sizeof
(
pername
[
0
]);
size_t
len
=
sizeof
(
pername
)
/
sizeof
(
pername
[
0
]);
for
(
int
i
=
0
;
i
<
len
;
i
++
)
for
(
int
i
=
0
;
i
<
len
;
i
++
)
if
(
!
strcmp
(
pername
[
i
].
name
,
arch
))
if
(
strequal
(
pername
[
i
].
name
,
arch
))
return
pername
[
i
].
per
;
return
pername
[
i
].
per
;
#endif
#endif
...
@@ -3122,7 +3120,7 @@ int lxc_fill_elevated_privileges(char *flaglist, int *flags)
...
@@ -3122,7 +3120,7 @@ int lxc_fill_elevated_privileges(char *flaglist, int *flags)
aflag
=
-
1
;
aflag
=
-
1
;
for
(
i
=
0
;
all_privs
[
i
].
token
;
i
++
)
for
(
i
=
0
;
all_privs
[
i
].
token
;
i
++
)
if
(
!
strcmp
(
all_privs
[
i
].
token
,
token
))
if
(
strequal
(
all_privs
[
i
].
token
,
token
))
aflag
=
all_privs
[
i
].
flag
;
aflag
=
all_privs
[
i
].
flag
;
if
(
aflag
<
0
)
if
(
aflag
<
0
)
...
@@ -3705,7 +3703,7 @@ static int __get_config_cgroup_controller(const char *key, char *retv,
...
@@ -3705,7 +3703,7 @@ static int __get_config_cgroup_controller(const char *key, char *retv,
return
ret_errno
(
EINVAL
);
return
ret_errno
(
EINVAL
);
}
}
if
(
str
cmp
(
key
,
global_token
)
==
0
)
if
(
str
equal
(
key
,
global_token
)
)
get_all
=
true
;
get_all
=
true
;
else
if
(
strncmp
(
key
,
namespaced_token
,
namespaced_token_len
)
==
0
)
else
if
(
strncmp
(
key
,
namespaced_token
,
namespaced_token_len
)
==
0
)
key
+=
namespaced_token_len
;
key
+=
namespaced_token_len
;
...
@@ -3721,7 +3719,7 @@ static int __get_config_cgroup_controller(const char *key, char *retv,
...
@@ -3721,7 +3719,7 @@ static int __get_config_cgroup_controller(const char *key, char *retv,
strprint
(
retv
,
inlen
,
"%s.%s = %s
\n
"
,
global_token
,
strprint
(
retv
,
inlen
,
"%s.%s = %s
\n
"
,
global_token
,
cg
->
subsystem
,
cg
->
value
);
cg
->
subsystem
,
cg
->
value
);
}
else
if
(
str
cmp
(
cg
->
subsystem
,
key
)
==
0
)
{
}
else
if
(
str
equal
(
cg
->
subsystem
,
key
)
)
{
strprint
(
retv
,
inlen
,
"%s
\n
"
,
cg
->
value
);
strprint
(
retv
,
inlen
,
"%s
\n
"
,
cg
->
value
);
}
}
}
}
...
@@ -3749,7 +3747,7 @@ static int get_config_cgroup_dir(const char *key, char *retv, int inlen,
...
@@ -3749,7 +3747,7 @@ static int get_config_cgroup_dir(const char *key, char *retv, int inlen,
int
len
;
int
len
;
int
fulllen
=
0
;
int
fulllen
=
0
;
if
(
strcmp
(
key
,
"lxc.cgroup.dir"
)
!=
0
)
if
(
!
strequal
(
key
,
"lxc.cgroup.dir"
)
)
return
ret_errno
(
EINVAL
);
return
ret_errno
(
EINVAL
);
if
(
!
retv
)
if
(
!
retv
)
...
@@ -4053,7 +4051,7 @@ static int get_config_hooks(const char *key, char *retv, int inlen,
...
@@ -4053,7 +4051,7 @@ static int get_config_hooks(const char *key, char *retv, int inlen,
return
ret_errno
(
EINVAL
);
return
ret_errno
(
EINVAL
);
for
(
i
=
0
;
i
<
NUM_LXC_HOOKS
;
i
++
)
{
for
(
i
=
0
;
i
<
NUM_LXC_HOOKS
;
i
++
)
{
if
(
str
cmp
(
lxchook_names
[
i
],
subkey
)
==
0
)
{
if
(
str
equal
(
lxchook_names
[
i
],
subkey
)
)
{
found
=
i
;
found
=
i
;
break
;
break
;
}
}
...
@@ -4241,11 +4239,11 @@ static int get_config_signal_stop(const char *key, char *retv, int inlen,
...
@@ -4241,11 +4239,11 @@ static int get_config_signal_stop(const char *key, char *retv, int inlen,
static
int
get_config_start
(
const
char
*
key
,
char
*
retv
,
int
inlen
,
static
int
get_config_start
(
const
char
*
key
,
char
*
retv
,
int
inlen
,
struct
lxc_conf
*
c
,
void
*
data
)
struct
lxc_conf
*
c
,
void
*
data
)
{
{
if
(
str
cmp
(
key
+
10
,
"auto"
)
==
0
)
if
(
str
equal
(
key
+
10
,
"auto"
)
)
return
lxc_get_conf_int
(
c
,
retv
,
inlen
,
c
->
start_auto
);
return
lxc_get_conf_int
(
c
,
retv
,
inlen
,
c
->
start_auto
);
else
if
(
str
cmp
(
key
+
10
,
"delay"
)
==
0
)
else
if
(
str
equal
(
key
+
10
,
"delay"
)
)
return
lxc_get_conf_int
(
c
,
retv
,
inlen
,
c
->
start_delay
);
return
lxc_get_conf_int
(
c
,
retv
,
inlen
,
c
->
start_delay
);
else
if
(
str
cmp
(
key
+
10
,
"order"
)
==
0
)
else
if
(
str
equal
(
key
+
10
,
"order"
)
)
return
lxc_get_conf_int
(
c
,
retv
,
inlen
,
c
->
start_order
);
return
lxc_get_conf_int
(
c
,
retv
,
inlen
,
c
->
start_order
);
return
-
1
;
return
-
1
;
...
@@ -4384,7 +4382,7 @@ static int get_config_prlimit(const char *key, char *retv, int inlen,
...
@@ -4384,7 +4382,7 @@ static int get_config_prlimit(const char *key, char *retv, int inlen,
else
else
memset
(
retv
,
0
,
inlen
);
memset
(
retv
,
0
,
inlen
);
if
(
!
strcmp
(
key
,
"lxc.prlimit"
))
if
(
strequal
(
key
,
"lxc.prlimit"
))
get_all
=
true
;
get_all
=
true
;
else
if
(
strncmp
(
key
,
"lxc.prlimit."
,
12
)
==
0
)
else
if
(
strncmp
(
key
,
"lxc.prlimit."
,
12
)
==
0
)
key
+=
12
;
key
+=
12
;
...
@@ -4417,7 +4415,7 @@ static int get_config_prlimit(const char *key, char *retv, int inlen,
...
@@ -4417,7 +4415,7 @@ static int get_config_prlimit(const char *key, char *retv, int inlen,
if
(
get_all
)
{
if
(
get_all
)
{
strprint
(
retv
,
inlen
,
"lxc.prlimit.%s = %s
\n
"
,
strprint
(
retv
,
inlen
,
"lxc.prlimit.%s = %s
\n
"
,
lim
->
resource
,
buf
);
lim
->
resource
,
buf
);
}
else
if
(
str
cmp
(
lim
->
resource
,
key
)
==
0
)
{
}
else
if
(
str
equal
(
lim
->
resource
,
key
)
)
{
strprint
(
retv
,
inlen
,
"%s"
,
buf
);
strprint
(
retv
,
inlen
,
"%s"
,
buf
);
}
}
}
}
...
@@ -4442,7 +4440,7 @@ static int get_config_sysctl(const char *key, char *retv, int inlen,
...
@@ -4442,7 +4440,7 @@ static int get_config_sysctl(const char *key, char *retv, int inlen,
else
else
memset
(
retv
,
0
,
inlen
);
memset
(
retv
,
0
,
inlen
);
if
(
str
cmp
(
key
,
"lxc.sysctl"
)
==
0
)
if
(
str
equal
(
key
,
"lxc.sysctl"
)
)
get_all
=
true
;
get_all
=
true
;
else
if
(
strncmp
(
key
,
"lxc.sysctl."
,
STRLITERALLEN
(
"lxc.sysctl."
))
==
0
)
else
if
(
strncmp
(
key
,
"lxc.sysctl."
,
STRLITERALLEN
(
"lxc.sysctl."
))
==
0
)
key
+=
STRLITERALLEN
(
"lxc.sysctl."
);
key
+=
STRLITERALLEN
(
"lxc.sysctl."
);
...
@@ -4454,7 +4452,7 @@ static int get_config_sysctl(const char *key, char *retv, int inlen,
...
@@ -4454,7 +4452,7 @@ static int get_config_sysctl(const char *key, char *retv, int inlen,
if
(
get_all
)
{
if
(
get_all
)
{
strprint
(
retv
,
inlen
,
"lxc.sysctl.%s = %s
\n
"
,
elem
->
key
,
strprint
(
retv
,
inlen
,
"lxc.sysctl.%s = %s
\n
"
,
elem
->
key
,
elem
->
value
);
elem
->
value
);
}
else
if
(
str
cmp
(
elem
->
key
,
key
)
==
0
)
{
}
else
if
(
str
equal
(
elem
->
key
,
key
)
)
{
strprint
(
retv
,
inlen
,
"%s"
,
elem
->
value
);
strprint
(
retv
,
inlen
,
"%s"
,
elem
->
value
);
}
}
}
}
...
@@ -4475,7 +4473,7 @@ static int get_config_proc(const char *key, char *retv, int inlen,
...
@@ -4475,7 +4473,7 @@ static int get_config_proc(const char *key, char *retv, int inlen,
else
else
memset
(
retv
,
0
,
inlen
);
memset
(
retv
,
0
,
inlen
);
if
(
str
cmp
(
key
,
"lxc.proc"
)
==
0
)
if
(
str
equal
(
key
,
"lxc.proc"
)
)
get_all
=
true
;
get_all
=
true
;
else
if
(
strncmp
(
key
,
"lxc.proc."
,
STRLITERALLEN
(
"lxc.proc."
))
==
0
)
else
if
(
strncmp
(
key
,
"lxc.proc."
,
STRLITERALLEN
(
"lxc.proc."
))
==
0
)
key
+=
STRLITERALLEN
(
"lxc.proc."
);
key
+=
STRLITERALLEN
(
"lxc.proc."
);
...
@@ -4488,7 +4486,7 @@ static int get_config_proc(const char *key, char *retv, int inlen,
...
@@ -4488,7 +4486,7 @@ static int get_config_proc(const char *key, char *retv, int inlen,
if
(
get_all
)
{
if
(
get_all
)
{
strprint
(
retv
,
inlen
,
"lxc.proc.%s = %s
\n
"
,
strprint
(
retv
,
inlen
,
"lxc.proc.%s = %s
\n
"
,
proc
->
filename
,
proc
->
value
);
proc
->
filename
,
proc
->
value
);
}
else
if
(
str
cmp
(
proc
->
filename
,
key
)
==
0
)
{
}
else
if
(
str
equal
(
proc
->
filename
,
key
)
)
{
strprint
(
retv
,
inlen
,
"%s"
,
proc
->
value
);
strprint
(
retv
,
inlen
,
"%s"
,
proc
->
value
);
}
}
}
}
...
@@ -4691,7 +4689,7 @@ static inline int clr_config_cgroup2_controller(const char *key,
...
@@ -4691,7 +4689,7 @@ static inline int clr_config_cgroup2_controller(const char *key,
static
int
clr_config_cgroup_dir
(
const
char
*
key
,
struct
lxc_conf
*
lxc_conf
,
static
int
clr_config_cgroup_dir
(
const
char
*
key
,
struct
lxc_conf
*
lxc_conf
,
void
*
data
)
void
*
data
)
{
{
if
(
strcmp
(
key
,
"lxc.cgroup.dir"
)
!=
0
)
if
(
!
strequal
(
key
,
"lxc.cgroup.dir"
)
)
return
ret_errno
(
EINVAL
);
return
ret_errno
(
EINVAL
);
if
(
lxc_conf
->
cgroup_meta
.
dir
)
if
(
lxc_conf
->
cgroup_meta
.
dir
)
...
@@ -4964,11 +4962,11 @@ static inline int clr_config_signal_stop(const char *key, struct lxc_conf *c,
...
@@ -4964,11 +4962,11 @@ static inline int clr_config_signal_stop(const char *key, struct lxc_conf *c,
static
inline
int
clr_config_start
(
const
char
*
key
,
struct
lxc_conf
*
c
,
static
inline
int
clr_config_start
(
const
char
*
key
,
struct
lxc_conf
*
c
,
void
*
data
)
void
*
data
)
{
{
if
(
str
cmp
(
key
+
10
,
"auto"
)
==
0
)
if
(
str
equal
(
key
+
10
,
"auto"
)
)
c
->
start_auto
=
0
;
c
->
start_auto
=
0
;
else
if
(
str
cmp
(
key
+
10
,
"delay"
)
==
0
)
else
if
(
str
equal
(
key
+
10
,
"delay"
)
)
c
->
start_delay
=
0
;
c
->
start_delay
=
0
;
else
if
(
str
cmp
(
key
+
10
,
"order"
)
==
0
)
else
if
(
str
equal
(
key
+
10
,
"order"
)
)
c
->
start_order
=
0
;
c
->
start_order
=
0
;
return
0
;
return
0
;
...
@@ -6302,27 +6300,27 @@ int lxc_list_subkeys(struct lxc_conf *conf, const char *key, char *retv,
...
@@ -6302,27 +6300,27 @@ int lxc_list_subkeys(struct lxc_conf *conf, const char *key, char *retv,
else
else
memset
(
retv
,
0
,
inlen
);
memset
(
retv
,
0
,
inlen
);
if
(
!
strcmp
(
key
,
"lxc.apparmor"
))
{
if
(
strequal
(
key
,
"lxc.apparmor"
))
{
strprint
(
retv
,
inlen
,
"allow_incomplete
\n
"
);
strprint
(
retv
,
inlen
,
"allow_incomplete
\n
"
);
strprint
(
retv
,
inlen
,
"allow_nesting
\n
"
);
strprint
(
retv
,
inlen
,
"allow_nesting
\n
"
);
strprint
(
retv
,
inlen
,
"profile
\n
"
);
strprint
(
retv
,
inlen
,
"profile
\n
"
);
strprint
(
retv
,
inlen
,
"raw
\n
"
);
strprint
(
retv
,
inlen
,
"raw
\n
"
);
}
else
if
(
!
strcmp
(
key
,
"lxc.cgroup"
))
{
}
else
if
(
strequal
(
key
,
"lxc.cgroup"
))
{
strprint
(
retv
,
inlen
,
"dir
\n
"
);
strprint
(
retv
,
inlen
,
"dir
\n
"
);
}
else
if
(
!
strcmp
(
key
,
"lxc.selinux"
))
{
}
else
if
(
strequal
(
key
,
"lxc.selinux"
))
{
strprint
(
retv
,
inlen
,
"context
\n
"
);
strprint
(
retv
,
inlen
,
"context
\n
"
);
strprint
(
retv
,
inlen
,
"context.keyring
\n
"
);
strprint
(
retv
,
inlen
,
"context.keyring
\n
"
);
}
else
if
(
!
strcmp
(
key
,
"lxc.mount"
))
{
}
else
if
(
strequal
(
key
,
"lxc.mount"
))
{
strprint
(
retv
,
inlen
,
"auto
\n
"
);
strprint
(
retv
,
inlen
,
"auto
\n
"
);
strprint
(
retv
,
inlen
,
"entry
\n
"
);
strprint
(
retv
,
inlen
,
"entry
\n
"
);
strprint
(
retv
,
inlen
,
"fstab
\n
"
);
strprint
(
retv
,
inlen
,
"fstab
\n
"
);
}
else
if
(
!
strcmp
(
key
,
"lxc.rootfs"
))
{
}
else
if
(
strequal
(
key
,
"lxc.rootfs"
))
{
strprint
(
retv
,
inlen
,
"mount
\n
"
);
strprint
(
retv
,
inlen
,
"mount
\n
"
);
strprint
(
retv
,
inlen
,
"options
\n
"
);
strprint
(
retv
,
inlen
,
"options
\n
"
);
strprint
(
retv
,
inlen
,
"path
\n
"
);
strprint
(
retv
,
inlen
,
"path
\n
"
);
}
else
if
(
!
strcmp
(
key
,
"lxc.uts"
))
{
}
else
if
(
strequal
(
key
,
"lxc.uts"
))
{
strprint
(
retv
,
inlen
,
"name
\n
"
);
strprint
(
retv
,
inlen
,
"name
\n
"
);
}
else
if
(
!
strcmp
(
key
,
"lxc.hook"
))
{
}
else
if
(
strequal
(
key
,
"lxc.hook"
))
{
strprint
(
retv
,
inlen
,
"autodev
\n
"
);
strprint
(
retv
,
inlen
,
"autodev
\n
"
);
strprint
(
retv
,
inlen
,
"autodevtmpfssize
\n
"
);
strprint
(
retv
,
inlen
,
"autodevtmpfssize
\n
"
);
strprint
(
retv
,
inlen
,
"clone
\n
"
);
strprint
(
retv
,
inlen
,
"clone
\n
"
);
...
@@ -6334,25 +6332,25 @@ int lxc_list_subkeys(struct lxc_conf *conf, const char *key, char *retv,
...
@@ -6334,25 +6332,25 @@ int lxc_list_subkeys(struct lxc_conf *conf, const char *key, char *retv,
strprint
(
retv
,
inlen
,
"start-host
\n
"
);
strprint
(
retv
,
inlen
,
"start-host
\n
"
);
strprint
(
retv
,
inlen
,
"start
\n
"
);
strprint
(
retv
,
inlen
,
"start
\n
"
);
strprint
(
retv
,
inlen
,
"stop
\n
"
);
strprint
(
retv
,
inlen
,
"stop
\n
"
);
}
else
if
(
!
strcmp
(
key
,
"lxc.cap"
))
{
}
else
if
(
strequal
(
key
,
"lxc.cap"
))
{
strprint
(
retv
,
inlen
,
"drop
\n
"
);
strprint
(
retv
,
inlen
,
"drop
\n
"
);
strprint
(
retv
,
inlen
,
"keep
\n
"
);
strprint
(
retv
,
inlen
,
"keep
\n
"
);
}
else
if
(
!
strcmp
(
key
,
"lxc.console"
))
{
}
else
if
(
strequal
(
key
,
"lxc.console"
))
{
strprint
(
retv
,
inlen
,
"logfile
\n
"
);
strprint
(
retv
,
inlen
,
"logfile
\n
"
);
strprint
(
retv
,
inlen
,
"path
\n
"
);
strprint
(
retv
,
inlen
,
"path
\n
"
);
}
else
if
(
!
strcmp
(
key
,
"lxc.seccomp"
))
{
}
else
if
(
strequal
(
key
,
"lxc.seccomp"
))
{
strprint
(
retv
,
inlen
,
"profile
\n
"
);
strprint
(
retv
,
inlen
,
"profile
\n
"
);
}
else
if
(
!
strcmp
(
key
,
"lxc.signal"
))
{
}
else
if
(
strequal
(
key
,
"lxc.signal"
))
{
strprint
(
retv
,
inlen
,
"halt
\n
"
);
strprint
(
retv
,
inlen
,
"halt
\n
"
);
strprint
(
retv
,
inlen
,
"reboot
\n
"
);
strprint
(
retv
,
inlen
,
"reboot
\n
"
);
strprint
(
retv
,
inlen
,
"stop
\n
"
);
strprint
(
retv
,
inlen
,
"stop
\n
"
);
}
else
if
(
!
strcmp
(
key
,
"lxc.start"
))
{
}
else
if
(
strequal
(
key
,
"lxc.start"
))
{
strprint
(
retv
,
inlen
,
"auto
\n
"
);
strprint
(
retv
,
inlen
,
"auto
\n
"
);
strprint
(
retv
,
inlen
,
"delay
\n
"
);
strprint
(
retv
,
inlen
,
"delay
\n
"
);
strprint
(
retv
,
inlen
,
"order
\n
"
);
strprint
(
retv
,
inlen
,
"order
\n
"
);
}
else
if
(
!
strcmp
(
key
,
"lxc.monitor"
))
{
}
else
if
(
strequal
(
key
,
"lxc.monitor"
))
{
strprint
(
retv
,
inlen
,
"unshare
\n
"
);
strprint
(
retv
,
inlen
,
"unshare
\n
"
);
}
else
if
(
!
strcmp
(
key
,
"lxc.keyring"
))
{
}
else
if
(
strequal
(
key
,
"lxc.keyring"
))
{
strprint
(
retv
,
inlen
,
"session
\n
"
);
strprint
(
retv
,
inlen
,
"session
\n
"
);
}
else
{
}
else
{
fulllen
=
ret_errno
(
EINVAL
);
fulllen
=
ret_errno
(
EINVAL
);
...
...
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