mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 17:34:18 +03:00
e4e69e899e
Add a new virDomainLxcEnterSecurityLabel() function as a counterpart to virDomainLxcEnterNamespaces(), which can change the current calling process to have a new security context. This call runs client side, not in libvirtd so we can't use the security driver infrastructure. When entering a namespace, the process spawned from virsh will default to running with the security label of virsh. The actual desired behaviour is to run with the security label of the container most of the time. So this changes virsh lxc-enter-namespace command to invoke the virDomainLxcEnterSecurityLabel method. The current behaviour is: LABEL PID TTY TIME CMD system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 1 pts/0 00:00:00 systemd system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 3 pts/1 00:00:00 sh system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 24 ? 00:00:00 systemd-journal system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 29 ? 00:00:00 dhclient staff_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 47 ? 00:00:00 ps Note the ps command is running as unconfined_t, After this patch, The new behaviour is this: virsh -c lxc:/// lxc-enter-namespace dan -- /bin/ps -eZ LABEL PID TTY TIME CMD system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 1 pts/0 00:00:00 systemd system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 3 pts/1 00:00:00 sh system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 24 ? 00:00:00 systemd-journal system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 32 ? 00:00:00 dhclient system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 38 ? 00:00:00 ps The '--noseclabel' flag can be used to skip security labelling. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> |
||
---|---|---|
.. | ||
af.po | ||
am.po | ||
ar.po | ||
as.po | ||
be.po | ||
bg.po | ||
bn_IN.po | ||
bn.po | ||
bs.po | ||
ca.po | ||
cs.po | ||
cy.po | ||
da.po | ||
de.po | ||
el.po | ||
en_GB.po | ||
es.po | ||
et.po | ||
eu_ES.po | ||
fa.po | ||
fi.po | ||
fr.po | ||
gl.po | ||
gu.po | ||
he.po | ||
hi.po | ||
hr.po | ||
hu.po | ||
hy.po | ||
id.po | ||
is.po | ||
it.po | ||
ja.po | ||
ka.po | ||
kn.po | ||
ko.po | ||
ku.po | ||
libvirt.pot | ||
lo.po | ||
lt.po | ||
lv.po | ||
mk.po | ||
ml.po | ||
mr.po | ||
ms.po | ||
my.po | ||
nb.po | ||
nl.po | ||
nn.po | ||
nso.po | ||
or.po | ||
pa.po | ||
pl.po | ||
POTFILES.in | ||
pt_BR.po | ||
pt.po | ||
ro.po | ||
ru.po | ||
si.po | ||
sk.po | ||
sl.po | ||
sq.po | ||
sr.po | ||
sr@latin.po | ||
sv.po | ||
ta.po | ||
te.po | ||
th.po | ||
tr.po | ||
uk.po | ||
ur.po | ||
vi_VN.po | ||
vi.po | ||
zh_CN.po | ||
zh_TW.po | ||
zu.po |