System.Posix.User is inadequate

There are several problems with this module: 1) There is no way to get all users/groups on the system (getpwent) 2) The UserEntry type does not reflect the Gecos field (pw_gecos) 3) The UserEntry type does not reflect the password field (pw_passwd) 4) The GroupEntry type does not reflect the gr_passwd field This renders is unfortunately useless for some very basic Unix tasks. Is there still time to fix this for 6.6?

John Goerzen wrote:
There are several problems with this module:
1) There is no way to get all users/groups on the system (getpwent)
2) The UserEntry type does not reflect the Gecos field (pw_gecos)
3) The UserEntry type does not reflect the password field (pw_passwd)
4) The GroupEntry type does not reflect the gr_passwd field
This renders is unfortunately useless for some very basic Unix tasks.
Is there still time to fix this for 6.6?
Maybe, if you send a patch today... Cheers, Simon

On 2006-08-30, John Goerzen
On 2006-08-24, Simon Marlow
wrote: Maybe, if you send a patch today...
Well, it's a little late, but I've sent a patch along. I'll be working on getpwent/getgrent yet and should send a patch for that shortly.
FWIW: I have tried to test the new code, but can't, because I'm getting this when I run ghci -package unix: Loading package base-1.0 ... linking ... done. Loading package unix-1.0 ... linking ... ghc-6.4.2: /tmp/lib/unix-1.0/ghc-6.4.2/HSunix-1.0.o: unknown symbol `lstat' ghc-6.4.2: unable to load package `unix-1.0' This is on GHC 6.4.2, so I'm not sure what's going on. -- John

John Goerzen wrote:
On 2006-08-30, John Goerzen
wrote: On 2006-08-24, Simon Marlow
wrote: Maybe, if you send a patch today...
Well, it's a little late, but I've sent a patch along. I'll be working on getpwent/getgrent yet and should send a patch for that shortly.
FWIW: I have tried to test the new code, but can't, because I'm getting this when I run ghci -package unix:
Loading package base-1.0 ... linking ... done. Loading package unix-1.0 ... linking ... ghc-6.4.2: /tmp/lib/unix-1.0/ghc-6.4.2/HSunix-1.0.o: unknown symbol `lstat' ghc-6.4.2: unable to load package `unix-1.0'
This is on GHC 6.4.2, so I'm not sure what's going on.
Interesting, I don't know why that might happen, but I do recally someone else reporting the same thing. I don't have any references to 'lstat' from my HSunix.o. Did you compile up this package using Cabal? I wonder if it is perhaps because it wasn't compiled with -fvia-C, or something. Cheers, Simon

On Thu, Aug 31, 2006 at 03:03:21PM +0100, Simon Marlow wrote:
John Goerzen wrote:
Loading package base-1.0 ... linking ... done. Loading package unix-1.0 ... linking ... ghc-6.4.2: /tmp/lib/unix-1.0/ghc-6.4.2/HSunix-1.0.o: unknown symbol `lstat' ghc-6.4.2: unable to load package `unix-1.0'
This is on GHC 6.4.2, so I'm not sure what's going on.
Interesting, I don't know why that might happen, but I do recally someone else reporting the same thing.
I don't have any references to 'lstat' from my HSunix.o.
it's in System/Posix/Files.hsc, getSymbolicLinkStatus. However there may be some header file magic going on, as that function is often converted to lstat64 or something depending on what macros are defined.
Did you compile up this package using Cabal? I wonder if it is perhaps because it wasn't compiled with -fvia-C, or something.
Yes. Ian Lynagh, in trying to solve a different problem, suggested I try using ghc instead of ghci. I thought he was talking about this problem, and magically it worked. So I will go ahead and do my testing. Maybe we are just being lucky because I don't need to test getSymbolicLinkStatus, but hey, that's good enough for me. -- John

On 2006-08-30, John Goerzen
On 2006-08-30, John Goerzen
wrote: On 2006-08-24, Simon Marlow
wrote: Maybe, if you send a patch today...
Well, it's a little late, but I've sent a patch along. I'll be working on getpwent/getgrent yet and should send a patch for that shortly.
FWIW: I have tried to test the new code, but can't, because I'm getting this when I run ghci -package unix:
And to followup, I've now tested it and it all works fine. -- John
participants (2)
-
John Goerzen
-
Simon Marlow