security: label the slic_table

Add support for the slic_table to the security drivers.
This commit is contained in:
Ján Tomko 2016-05-13 16:16:55 +02:00
parent ea04d1a659
commit 5da23bbedf
3 changed files with 14 additions and 0 deletions

View File

@ -1218,6 +1218,11 @@ virSecurityDACSetAllLabel(virSecurityManagerPtr mgr,
def->os.dtb, user, group) < 0) def->os.dtb, user, group) < 0)
return -1; return -1;
if (def->os.slic_table &&
virSecurityDACSetOwnership(priv, NULL,
def->os.slic_table, user, group) < 0)
return -1;
return 0; return 0;
} }

View File

@ -2444,6 +2444,11 @@ virSecuritySELinuxSetAllLabel(virSecurityManagerPtr mgr,
data->content_context) < 0) data->content_context) < 0)
return -1; return -1;
if (def->os.slic_table &&
virSecuritySELinuxSetFilecon(mgr, def->os.slic_table,
data->content_context) < 0)
return -1;
if (stdin_path && if (stdin_path &&
virSecuritySELinuxSetFilecon(mgr, stdin_path, virSecuritySELinuxSetFilecon(mgr, stdin_path,
data->content_context) < 0) data->content_context) < 0)

View File

@ -993,6 +993,10 @@ get_files(vahControl * ctl)
if (vah_add_file(&buf, ctl->def->os.dtb, "r") != 0) if (vah_add_file(&buf, ctl->def->os.dtb, "r") != 0)
goto cleanup; goto cleanup;
if (ctl->def->os.slic_table)
if (vah_add_file(&buf, ctl->def->os.slic_table, "r") != 0)
goto cleanup;
if (ctl->def->os.loader && ctl->def->os.loader->path) if (ctl->def->os.loader && ctl->def->os.loader->path)
if (vah_add_file(&buf, ctl->def->os.loader->path, "r") != 0) if (vah_add_file(&buf, ctl->def->os.loader->path, "r") != 0)
goto cleanup; goto cleanup;