X-Git-Url: https://code.grnet.gr/git/ganeti-local/blobdiff_plain/e34f46e67b6553cc7b43059099ae6a1e9ed8ea94..c486fb6cc69da18fea383f2194dacb5ef6f8b94a:/src/Ganeti/Luxi.hs diff --git a/src/Ganeti/Luxi.hs b/src/Ganeti/Luxi.hs index 570992f..033fd69 100644 --- a/src/Ganeti/Luxi.hs +++ b/src/Ganeti/Luxi.hs @@ -67,6 +67,7 @@ import Text.JSON.Types import System.Directory (removeFile) import System.IO (hClose, hFlush, hWaitForInput, Handle, IOMode(..)) import System.IO.Error (isEOFError) +import System.Posix.Files import System.Timeout import qualified Network.Socket as S @@ -233,8 +234,9 @@ getServer :: Bool -> FilePath -> IO S.Socket getServer setOwner path = do s <- S.socket S.AF_UNIX S.Stream S.defaultProtocol S.bindSocket s (S.SockAddrUnix path) - when setOwner . setOwnerAndGroupFromNames path GanetiLuxid $ - ExtraGroup DaemonsGroup + when setOwner $ do + setOwnerAndGroupFromNames path GanetiLuxid $ ExtraGroup DaemonsGroup + setFileMode path $ fromIntegral luxiSocketPerms S.listen s 5 -- 5 is the max backlog return s