[PATCH 1/3] Implementation deficiency in virInitctlSetRunLevel v2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 Hello, list.

Refuse following symlinks in virInitctlSetRunLevel.
A reasonable fallback for the next two patches, which apply fork-setns
technique recommended on this list.

---
 src/util/virinitctl.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/virinitctl.c b/src/util/virinitctl.c
index 64bc23a..5cea992 100644
--- a/src/util/virinitctl.c
+++ b/src/util/virinitctl.c
@@ -139,7 +139,7 @@ int virInitctlSetRunLevel(virInitctlRunLevel level,
             return -1;
     }
 
-    if ((fd = open(path, O_WRONLY|O_NONBLOCK|O_CLOEXEC|O_NOCTTY)) < 0) 
{
+    if ((fd = open(path, O_WRONLY|O_NONBLOCK|O_CLOEXEC|O_NOCTTY|O_NOFOLLOW)) < 0) {
         if (errno == ENOENT) {
             ret = 0;
             goto cleanup;
-- 
1.7.10.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]