Skip to content

System.Posix.User.getGroupEntryForName incorrect error for non-existent group

The following program:

  import System.Posix.User
  main :: IO ()
  main = getGroupEntryForName "monkeys" >> return ()

gives the following output (on a system without a "monkeys" group):

  *** Exception: getGroupEntryForName: failed (Success)

The "(Success)" part is obviously wrong.

The problem is that the getGroupEntryForName implementation throws errno if getgrnam_r wrote NULL to the pointer pointed to by its last parameter, while the getgrnam_r specification makes no guarantees about errno being set in that case.

Trac metadata
Trac field Value
Version 6.6.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component libraries/unix
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information