diff options
author | stolz <unknown> | 2004-11-05 14:59:33 +0000 |
---|---|---|
committer | stolz <unknown> | 2004-11-05 14:59:33 +0000 |
commit | 03d7d528fbc352a016395cb5adaf47f2bb625808 (patch) | |
tree | 48c9749a467626636380a86003ab773e75352c19 /System | |
parent | 27196355eace8901dc6d805a8ec159d47081e6ef (diff) |
[project @ 2004-11-05 14:59:33 by stolz]
Fix getpwnam_r-handling: getpwnam_r returns (always?) 0, you have
to check result* (pppw[0])!
Truss-log from querying first "root", then "" on SunOS 5.9:
<- libc:__posix_getpwnam_r() = 0
"root"
-> libc:__posix_getpwnam_r(0xff1bf8a8, 0xff1bf460, 0xff1bf490, 0x400)
<- libc:__posix_getpwnam_r() = 0
Yes, that's 0 in both cases. (I wasn't even able to elicit an ERANGE btw.)
Reported by: Peter Simons
Diffstat (limited to 'System')
-rw-r--r-- | System/Posix/User.hsc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/System/Posix/User.hsc b/System/Posix/User.hsc index ed5adfb..7b0db2a 100644 --- a/System/Posix/User.hsc +++ b/System/Posix/User.hsc @@ -240,6 +240,8 @@ getUserEntryForName name = do withCString name $ \ pstr -> do throwErrorIfNonZero_ "getUserEntryForName" $ c_getpwnam_r pstr ppw pbuf (fromIntegral pwBufSize) pppw + throwErrnoIfNull "getUserEntryForName" $ + peekElemOff pppw 0 unpackUserEntry ppw foreign import ccall unsafe "getpwnam_r" |