lxc: Cleaner fix for compilation without SELinux
Just a cleanup of commit 32f881c6c42f94da70a3782fe20a058fe3dc39cc.
This commit is contained in:
parent
0531377076
commit
6ba4b300b0
@ -449,8 +449,6 @@ static int lxcContainerMountBasicFS(const char *srcprefix, bool pivotRoot)
|
|||||||
char *opts = NULL;
|
char *opts = NULL;
|
||||||
#if HAVE_SELINUX
|
#if HAVE_SELINUX
|
||||||
security_context_t con;
|
security_context_t con;
|
||||||
#else
|
|
||||||
bool con = false;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
VIR_DEBUG("Mounting basic filesystems %s pivotRoot=%d", NULLSTR(srcprefix), pivotRoot);
|
VIR_DEBUG("Mounting basic filesystems %s pivotRoot=%d", NULLSTR(srcprefix), pivotRoot);
|
||||||
@ -511,10 +509,17 @@ static int lxcContainerMountBasicFS(const char *srcprefix, bool pivotRoot)
|
|||||||
* tmpfs is limited to 64kb, since we only have device nodes in there
|
* tmpfs is limited to 64kb, since we only have device nodes in there
|
||||||
* and don't want to DOS the entire OS RAM usage
|
* and don't want to DOS the entire OS RAM usage
|
||||||
*/
|
*/
|
||||||
if (virAsprintf(&opts, "mode=755,size=65536%s%s%s",
|
|
||||||
con ? ",context=\"" : "",
|
#if HAVE_SELINUX
|
||||||
con ? (const char *)con : "",
|
if (con)
|
||||||
con ? "\"" : "") < 0) {
|
ignore_value(virAsprintf(&opts,
|
||||||
|
"mode=755,size=65536,context=\"%s\"",
|
||||||
|
(const char *)con));
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
opts = strdup("mode=755,size=65536");
|
||||||
|
|
||||||
|
if (!opts) {
|
||||||
virReportOOMError();
|
virReportOOMError();
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user