[libvirt] [PATCH 1/3] Implementation deficiency in virInitctlSetRunLevel v2

Reco recoverym4n at gmail.com
Thu Dec 19 16:07:39 UTC 2013


 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




More information about the libvir-list mailing list