On Thu, Jul 18, 2013 at 9:51 AM, Klaus Aehlig <[email protected]> wrote:

> > One of the haskell tests allocates a Luxi socket. Given that the tests
> are
> > run as the local user, setting the owner and group was failing for
> missing
> > permissions.
> >
> > (Sorry for not noticing this before)
> >
> > So, here is the interdiff fixing the problem, by introducing a new
> boolean
> > parameter in getServer, determining whether the owner and group of the
> > socket are actually modified or not.
> >
> > diff --git a/src/Ganeti/Luxi.hs b/src/Ganeti/Luxi.hs
> > index 1042bb7..b75f320 100644
> > --- a/src/Ganeti/Luxi.hs
> > +++ b/src/Ganeti/Luxi.hs
> > @@ -224,11 +224,12 @@ getClient path = do
> >    return Client { socket=h, rbuf=rf }
> >
> >  -- | Creates and returns a server endpoint.
> > -getServer :: FilePath -> IO S.Socket
> > -getServer path = do
> > +getServer :: FilePath -> Bool -> IO S.Socket
> > +getServer path setOwner = do
>
> Generally, it's more usefull to have the extra flags as
> first arguments. In that way, 'getSever True' could act
> as a drop-in replacement for the old getServer.
>

Good point!
I'll resend it with that modification.


>
> But even as is...
>
> >    s <- S.socket S.AF_UNIX S.Stream S.defaultProtocol
> >    S.bindSocket s (S.SockAddrUnix path)
> > -  setOwnerAndGroupFromNames path GanetiConfd $ ExtraGroup DaemonsGroup
> > +  when setOwner . setOwnerAndGroupFromNames path GanetiConfd $
> > +    ExtraGroup DaemonsGroup
> >    S.listen s 5 -- 5 is the max backlog
> >    return s
> > [...]
>
>
> LGTM
>
>
> --
> Klaus Aehlig
> Google Germany GmbH, Dienerstr. 12, 80331 Muenchen
> Registergericht und -nummer: Hamburg, HRB 86891
> Sitz der Gesellschaft: Hamburg
> Geschaeftsfuehrer: Graham Law, Christine Elizabeth Flores
>

Thanks,
Michele

-- 
Google Germany GmbH
Dienerstr. 12
80331 München

Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Graham Law, Christine Elizabeth Flores

Reply via email to