Ticket #1655 (closed bug: fixed)
System.Posix.User.getGroupEntryForName incorrect error for non-existent group
| Reported by: | Eelis | Owned by: | igloo |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.8.2 |
| Component: | libraries/unix | Version: | 6.6.1 |
| Keywords: | Cc: | ||
| Operating System: | Linux | Architecture: | x86_64 (amd64) |
| Type of failure: | Difficulty: | Easy (less than 1 hour) | |
| Test Case: | getGroupEntryForName | Blocked By: | |
| Blocking: | Related Tickets: |
Description
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.
Change History
Note: See
TracTickets for help on using
tickets.
