aboutsummaryrefslogtreecommitdiffhomepage
path: root/System/Posix/User.hsc
diff options
context:
space:
mode:
authorGravatar John Goerzen <jgoerzen@complete.org>2006-08-29 18:50:51 +0000
committerGravatar John Goerzen <jgoerzen@complete.org>2006-08-29 18:50:51 +0000
commitcf446bc47400b5615b9816b27eb76dc66919aa2c (patch)
tree7c73353d0a0e5799f8eb3ff7efc51a06113af12b /System/Posix/User.hsc
parent83e5c6190359654fe717b9cb9ee75bf721d65634 (diff)
Added pw_passwd and pw_gecos fields to UserEntry structure
System.Posix.User was missing pw_gecos and pw_passwd in UserEntry. I have added them, so now the full struct passwd is represented.
Diffstat (limited to 'System/Posix/User.hsc')
-rw-r--r--System/Posix/User.hsc6
1 files changed, 5 insertions, 1 deletions
diff --git a/System/Posix/User.hsc b/System/Posix/User.hsc
index ecd57e5..82334d8 100644
--- a/System/Posix/User.hsc
+++ b/System/Posix/User.hsc
@@ -220,8 +220,10 @@ unpackGroupEntry ptr = do
data UserEntry =
UserEntry {
userName :: String,
+ userPassword :: String,
userID :: UserID,
userGroupID :: GroupID,
+ userGecos :: String, -- | Usually the real name for the user
homeDirectory :: String,
userShell :: String
}
@@ -316,11 +318,13 @@ foreign import ccall unsafe "sysconf"
unpackUserEntry :: Ptr CPasswd -> IO UserEntry
unpackUserEntry ptr = do
name <- (#peek struct passwd, pw_name) ptr >>= peekCString
+ passwd <- (#peek struct passwd, pw_passwd) ptr >>= peekCString
uid <- (#peek struct passwd, pw_uid) ptr
gid <- (#peek struct passwd, pw_gid) ptr
+ gecos <- (#peek struct passwd, pw_gecos) ptr >>= peekCString
dir <- (#peek struct passwd, pw_dir) ptr >>= peekCString
shell <- (#peek struct passwd, pw_shell) ptr >>= peekCString
- return (UserEntry name uid gid dir shell)
+ return (UserEntry name passwd uid gid gecos dir shell)
-- Used when calling re-entrant system calls that signal their 'errno'
-- directly through the return value.