mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
Open /proc/PID/ns/* read-only to avoid getting permission denied
lxc-enter-namespace stopped working on recent kernels (at least 3.19+) due to /proc/PID/ns/* file descriptors being opened RW. From outside the namespace these can only be opened RO.
This commit is contained in:
parent
9e7b1e646d
commit
cc21badc5c
@ -628,7 +628,7 @@ int virProcessGetNamespaces(pid_t pid,
|
||||
ns[i]) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if ((fd = open(nsfile, O_RDWR)) >= 0) {
|
||||
if ((fd = open(nsfile, O_RDONLY)) >= 0) {
|
||||
if (VIR_EXPAND_N(*fdlist, *nfdlist, 1) < 0) {
|
||||
VIR_FORCE_CLOSE(fd);
|
||||
goto cleanup;
|
||||
|
Loading…
x
Reference in New Issue
Block a user