Commit 91525dee856951ace940c78b6254a1c7344b4803 fixed Issue 477 but broke
"gnt-cluster info".

This commit offers a solution to both problems, by changing the permission
of the socket instead of changing the permission the confd process is run
with.

Signed-off-by: Michele Tartara <[email protected]>
---
 daemons/daemon-util.in |    2 +-
 src/Ganeti/Luxi.hs     |    2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/daemons/daemon-util.in b/daemons/daemon-util.in
index 2b3d24d..2bb0b9d 100644
--- a/daemons/daemon-util.in
+++ b/daemons/daemon-util.in
@@ -80,7 +80,7 @@ _daemon_usergroup() {
       echo "@GNTMASTERUSER@:@GNTMASTERDGROUP@"
       ;;
     confd)
-      echo "@GNTCONFDUSER@:@GNTDAEMONSGROUP@"
+      echo "@GNTCONFDUSER@:@GNTCONFDGROUP@"
       ;;
     rapi)
       echo "@GNTRAPIUSER@:@GNTRAPIGROUP@"
diff --git a/src/Ganeti/Luxi.hs b/src/Ganeti/Luxi.hs
index 9e5b337..4ac2e24 100644
--- a/src/Ganeti/Luxi.hs
+++ b/src/Ganeti/Luxi.hs
@@ -79,6 +79,7 @@ import Ganeti.OpCodes
 import qualified Ganeti.Query.Language as Qlang
 import Ganeti.THH
 import Ganeti.Types
+import Ganeti.Utils
 
 -- * Utility functions
 
@@ -222,6 +223,7 @@ getServer path = do
   s <- S.socket S.AF_UNIX S.Stream S.defaultProtocol
   S.bindSocket s (S.SockAddrUnix path)
   S.listen s 5 -- 5 is the max backlog
+  setOwnerAndGroupFromNames path confdUser daemonsGroup
   return s
 
 -- | Closes a server endpoint.
-- 
1.7.10.4

Reply via email to