Skip to content

System.Posix.GetAllGroupEntries returns 0 groups for 2nd and subsequent calls

This is on 6.10.4, could someone check whether still a bug on 6.12?

 #haskell Jan 11 2010: 

<patch-tag> liftM length System.Posix.getAllGroupEntries

<patch-tag> 1819

<patch-tag> Prelude System.Posix Control.Monad> liftM length 

<patch-tag> 0

lispy/cale confirmed behavior, and cale suggested fix:

 <lispy> patch-tag:  http://www.haskell.org/ghc/docs/6.10.4/html/libraries/unix/src/System-Posix-User.html#getAllGroupEntries


<Cale> getAllUserEntries =

<Cale>     withMVar lock $ \_ -> bracket_ c_setpwent c_endpwent $ worker []

<Cale> getAllUserEntries is properly bracketed

<Cale> getAllGroupEntries = withMVar lock $ \_ -> worker []

<lispy> http://linux.about.com/library/cmd/blcmdl3_getgrent.htm 

function has changed from 6.10.4 to 6.12 but I'm not sure if this fixed the bug:

Edited by Simon Marlow
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information