getUserEntryForName weirdness

Is anyone else seeing this on his system? getUserEntryForName [] >>= print . userName "wasabi" "wasabi" happens to be the last entry in the /etc/passwd file, and that is what I get every time I query for an user that doesn't exist. The source code promises an exception, but I don't get one. Peter

On 2004-10-29 at 18:29+0200 Peter Simons wrote:
Is anyone else seeing this on his system?
getUserEntryForName [] >>= print . userName "wasabi"
"wasabi" happens to be the last entry in the /etc/passwd file, and that is what I get every time I query for an user that doesn't exist. The source code promises an exception, but I don't get one.
Same here with ghc 6.2.1. The haddocks don't say anything about what should happen. BTW, the relevant library is System.Posix.User and a similar effect is observed with getGroupEntryForName Jón -- Jón Fairbairn Jon.Fairbairn@cl.cam.ac.uk

On Fri, 29 Oct 2004, Peter Simons wrote:
Is anyone else seeing this on his system?
getUserEntryForName [] >>= print . userName "wasabi"
On Solaris I get the following results (GHC 6.2.2, GHC 6.2.1 exits with Illegal Instruction): Prelude System.Posix.User> getUserEntryForName "undefined user" >>= print . userName "" Prelude System.Posix.User> getUserEntryForName "" >>= print . userName "\208\ACK" Prelude System.Posix.User> getUserEntryForName "foo" >>= print . userName "\208\ACK" Prelude System.Posix.User> getUserEntryForName "foo " >>= print . userName Segmentation Fault /NAD

On Fri, Oct 29, 2004 at 06:29:52PM +0200, Peter Simons wrote:
Is anyone else seeing this on his system?
getUserEntryForName [] >>= print . userName "wasabi"
"wasabi" happens to be the last entry in the /etc/passwd file, and that is what I get every time I query for an user that doesn't exist. The source code promises an exception, but I don't get one.
Peter
Prelude System.Posix.User> getUserEntryForName [] >>= print . userName *** Exception: getUserEntryForName: does not exist (No such file or directory) linux 2.4.26, ghc 6.2.1, compiled with gcc 3.4.1 IIRC. Groeten, Remi -- Nobody can be exactly like me. Even I have trouble doing it.

Peter Simons writes:
getUserEntryForName [] >>= print . userName "wasabi"
I've updated the latest CVS HEAD (you never know) and tried it again. Some problem. In case it helps: http://peti.cryp.to/strace-getuserentry (8kb) Peter

In gmane.comp.lang.haskell.glasgow.user, you wrote:
Is anyone else seeing this on his system? getUserEntryForName [] >>= print . userName "wasabi"
Fixed in CVS -- I was only able to test this on SunOS where your example would segfault. -- http://www-i2.informatik.rwth-aachen.de/stolz/ *** PGP *** S/MIME
participants (5)
-
Jon Fairbairn
-
Nils Anders Danielsson
-
Peter Simons
-
Remi Turk
-
Volker Stolz