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
05cd29da
Unverified
Commit
05cd29da
authored
May 10, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
confile: convert AppArmor and SELinux confile parsing from errors to warnings
Fixes:
https://github.com/lxc/lxc/issues/3765#issuecomment-836792820
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
aedfce1f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
18 deletions
+36
-18
confile.c
src/lxc/confile.c
+36
-18
No files found.
src/lxc/confile.c
View file @
05cd29da
...
@@ -1456,7 +1456,8 @@ static int set_config_apparmor_profile(const char *key, const char *value,
...
@@ -1456,7 +1456,8 @@ static int set_config_apparmor_profile(const char *key, const char *value,
#if HAVE_APPARMOR
#if HAVE_APPARMOR
return
set_config_string_item
(
&
lxc_conf
->
lsm_aa_profile
,
value
);
return
set_config_string_item
(
&
lxc_conf
->
lsm_aa_profile
,
value
);
#else
#else
return
syserror_set
(
-
EINVAL
,
"Built without AppArmor support"
);
SYSWARN
(
"Built without AppArmor support"
);
return
0
;
#endif
#endif
}
}
...
@@ -1482,7 +1483,8 @@ static int set_config_apparmor_allow_incomplete(const char *key,
...
@@ -1482,7 +1483,8 @@ static int set_config_apparmor_allow_incomplete(const char *key,
return
0
;
return
0
;
#else
#else
return
syserror_set
(
-
EINVAL
,
"Built without AppArmor support"
);
SYSWARN
(
"Built without AppArmor support"
);
return
0
;
#endif
#endif
}
}
...
@@ -1506,7 +1508,8 @@ static int set_config_apparmor_allow_nesting(const char *key,
...
@@ -1506,7 +1508,8 @@ static int set_config_apparmor_allow_nesting(const char *key,
return
0
;
return
0
;
#else
#else
return
syserror_set
(
-
EINVAL
,
"Built without AppArmor support"
);
SYSWARN
(
"Built without AppArmor support"
);
return
0
;
#endif
#endif
}
}
...
@@ -1535,7 +1538,8 @@ static int set_config_apparmor_raw(const char *key,
...
@@ -1535,7 +1538,8 @@ static int set_config_apparmor_raw(const char *key,
return
0
;
return
0
;
#else
#else
return
syserror_set
(
-
EINVAL
,
"Built without AppArmor support"
);
SYSWARN
(
"Built without AppArmor support"
);
return
0
;
#endif
#endif
}
}
...
@@ -1545,7 +1549,8 @@ static int set_config_selinux_context(const char *key, const char *value,
...
@@ -1545,7 +1549,8 @@ static int set_config_selinux_context(const char *key, const char *value,
#if HAVE_SELINUX
#if HAVE_SELINUX
return
set_config_string_item
(
&
lxc_conf
->
lsm_se_context
,
value
);
return
set_config_string_item
(
&
lxc_conf
->
lsm_se_context
,
value
);
#else
#else
return
syserror_set
(
-
EINVAL
,
"Built without SELinux support"
);
SYSWARN
(
"Built without SELinux support"
);
return
0
;
#endif
#endif
}
}
...
@@ -1555,7 +1560,8 @@ static int set_config_selinux_context_keyring(const char *key, const char *value
...
@@ -1555,7 +1560,8 @@ static int set_config_selinux_context_keyring(const char *key, const char *value
#if HAVE_SELINUX
#if HAVE_SELINUX
return
set_config_string_item
(
&
lxc_conf
->
lsm_se_keyring_context
,
value
);
return
set_config_string_item
(
&
lxc_conf
->
lsm_se_keyring_context
,
value
);
#else
#else
return
syserror_set
(
-
EINVAL
,
"Built without SELinux support"
);
SYSWARN
(
"Built without SELinux support"
);
return
0
;
#endif
#endif
}
}
...
@@ -3485,7 +3491,8 @@ static int get_config_apparmor_profile(const char *key, char *retv, int inlen,
...
@@ -3485,7 +3491,8 @@ static int get_config_apparmor_profile(const char *key, char *retv, int inlen,
#if HAVE_APPARMOR
#if HAVE_APPARMOR
return
lxc_get_conf_str
(
retv
,
inlen
,
c
->
lsm_aa_profile
);
return
lxc_get_conf_str
(
retv
,
inlen
,
c
->
lsm_aa_profile
);
#else
#else
return
syserror_set
(
-
EINVAL
,
"Built without AppArmor support"
);
SYSWARN
(
"Built without AppArmor support"
);
return
0
;
#endif
#endif
}
}
...
@@ -3496,7 +3503,8 @@ static int get_config_apparmor_allow_incomplete(const char *key, char *retv,
...
@@ -3496,7 +3503,8 @@ static int get_config_apparmor_allow_incomplete(const char *key, char *retv,
#if HAVE_APPARMOR
#if HAVE_APPARMOR
return
lxc_get_conf_int
(
c
,
retv
,
inlen
,
c
->
lsm_aa_allow_incomplete
);
return
lxc_get_conf_int
(
c
,
retv
,
inlen
,
c
->
lsm_aa_allow_incomplete
);
#else
#else
return
syserror_set
(
-
EINVAL
,
"Built without AppArmor support"
);
SYSWARN
(
"Built without AppArmor support"
);
return
0
;
#endif
#endif
}
}
...
@@ -3507,7 +3515,8 @@ static int get_config_apparmor_allow_nesting(const char *key, char *retv,
...
@@ -3507,7 +3515,8 @@ static int get_config_apparmor_allow_nesting(const char *key, char *retv,
#if HAVE_APPARMOR
#if HAVE_APPARMOR
return
lxc_get_conf_int
(
c
,
retv
,
inlen
,
c
->
lsm_aa_allow_nesting
);
return
lxc_get_conf_int
(
c
,
retv
,
inlen
,
c
->
lsm_aa_allow_nesting
);
#else
#else
return
syserror_set
(
-
EINVAL
,
"Built without AppArmor support"
);
SYSWARN
(
"Built without AppArmor support"
);
return
0
;
#endif
#endif
}
}
...
@@ -3531,7 +3540,8 @@ static int get_config_apparmor_raw(const char *key, char *retv,
...
@@ -3531,7 +3540,8 @@ static int get_config_apparmor_raw(const char *key, char *retv,
return
fulllen
;
return
fulllen
;
#else
#else
return
syserror_set
(
-
EINVAL
,
"Built without AppArmor support"
);
SYSWARN
(
"Built without AppArmor support"
);
return
0
;
#endif
#endif
}
}
...
@@ -3541,7 +3551,8 @@ static int get_config_selinux_context(const char *key, char *retv, int inlen,
...
@@ -3541,7 +3551,8 @@ static int get_config_selinux_context(const char *key, char *retv, int inlen,
#if HAVE_SELINUX
#if HAVE_SELINUX
return
lxc_get_conf_str
(
retv
,
inlen
,
c
->
lsm_se_context
);
return
lxc_get_conf_str
(
retv
,
inlen
,
c
->
lsm_se_context
);
#else
#else
return
syserror_set
(
-
EINVAL
,
"Built without SELinux support"
);
SYSWARN
(
"Built without SELinux support"
);
return
0
;
#endif
#endif
}
}
...
@@ -3551,7 +3562,8 @@ static int get_config_selinux_context_keyring(const char *key, char *retv, int i
...
@@ -3551,7 +3562,8 @@ static int get_config_selinux_context_keyring(const char *key, char *retv, int i
#if HAVE_SELINUX
#if HAVE_SELINUX
return
lxc_get_conf_str
(
retv
,
inlen
,
c
->
lsm_se_keyring_context
);
return
lxc_get_conf_str
(
retv
,
inlen
,
c
->
lsm_se_keyring_context
);
#else
#else
return
syserror_set
(
-
EINVAL
,
"Built without SELinux support"
);
SYSWARN
(
"Built without SELinux support"
);
return
0
;
#endif
#endif
}
}
...
@@ -4400,7 +4412,8 @@ static inline int clr_config_apparmor_profile(const char *key,
...
@@ -4400,7 +4412,8 @@ static inline int clr_config_apparmor_profile(const char *key,
free_disarm
(
c
->
lsm_aa_profile
);
free_disarm
(
c
->
lsm_aa_profile
);
return
0
;
return
0
;
#else
#else
return
syserror_set
(
-
EINVAL
,
"Built without AppArmor support"
);
SYSWARN
(
"Built without AppArmor support"
);
return
0
;
#endif
#endif
}
}
...
@@ -4412,7 +4425,8 @@ static inline int clr_config_apparmor_allow_incomplete(const char *key,
...
@@ -4412,7 +4425,8 @@ static inline int clr_config_apparmor_allow_incomplete(const char *key,
c
->
lsm_aa_allow_incomplete
=
0
;
c
->
lsm_aa_allow_incomplete
=
0
;
return
0
;
return
0
;
#else
#else
return
syserror_set
(
-
EINVAL
,
"Built without AppArmor support"
);
SYSWARN
(
"Built without AppArmor support"
);
return
0
;
#endif
#endif
}
}
...
@@ -4424,7 +4438,8 @@ static inline int clr_config_apparmor_allow_nesting(const char *key,
...
@@ -4424,7 +4438,8 @@ static inline int clr_config_apparmor_allow_nesting(const char *key,
c
->
lsm_aa_allow_nesting
=
0
;
c
->
lsm_aa_allow_nesting
=
0
;
return
0
;
return
0
;
#else
#else
return
syserror_set
(
-
EINVAL
,
"Built without AppArmor support"
);
SYSWARN
(
"Built without AppArmor support"
);
return
0
;
#endif
#endif
}
}
...
@@ -4435,7 +4450,8 @@ static inline int clr_config_apparmor_raw(const char *key,
...
@@ -4435,7 +4450,8 @@ static inline int clr_config_apparmor_raw(const char *key,
#if HAVE_APPARMOR
#if HAVE_APPARMOR
return
lxc_clear_apparmor_raw
(
c
);
return
lxc_clear_apparmor_raw
(
c
);
#else
#else
return
syserror_set
(
-
EINVAL
,
"Built without AppArmor support"
);
SYSWARN
(
"Built without AppArmor support"
);
return
0
;
#endif
#endif
}
}
...
@@ -4446,7 +4462,8 @@ static inline int clr_config_selinux_context(const char *key,
...
@@ -4446,7 +4462,8 @@ static inline int clr_config_selinux_context(const char *key,
free_disarm
(
c
->
lsm_se_context
);
free_disarm
(
c
->
lsm_se_context
);
return
0
;
return
0
;
#else
#else
return
syserror_set
(
-
EINVAL
,
"Built without SELinux support"
);
SYSWARN
(
"Built without SELinux support"
);
return
0
;
#endif
#endif
}
}
...
@@ -4457,7 +4474,8 @@ static inline int clr_config_selinux_context_keyring(const char *key,
...
@@ -4457,7 +4474,8 @@ static inline int clr_config_selinux_context_keyring(const char *key,
free_disarm
(
c
->
lsm_se_keyring_context
);
free_disarm
(
c
->
lsm_se_keyring_context
);
return
0
;
return
0
;
#else
#else
return
syserror_set
(
-
EINVAL
,
"Built without SELinux support"
);
SYSWARN
(
"Built without SELinux support"
);
return
0
;
#endif
#endif
}
}
...
...
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