diff options
author | joe <joe@jerkface.net> | 2013-06-17 13:28:07 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2013-06-17 13:28:07 -0400 |
commit | 5982df9112b7e5fe7bcab62434771f1ca979e14d (patch) | |
tree | c3f752969cf444157dddd67abf09d26343884818 /Presence/LocalPeerCred.hs | |
parent | 57a7a887adb443c516230ac23602b52e1d94d240 (diff) |
Now determines username for session.
Diffstat (limited to 'Presence/LocalPeerCred.hs')
-rw-r--r-- | Presence/LocalPeerCred.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Presence/LocalPeerCred.hs b/Presence/LocalPeerCred.hs index c58fe288..990975ee 100644 --- a/Presence/LocalPeerCred.hs +++ b/Presence/LocalPeerCred.hs | |||
@@ -49,9 +49,11 @@ getLocalPeerCred sock = do | |||
49 | addr <- getPeerName sock | 49 | addr <- getPeerName sock |
50 | muid <- getLocalPeerCred' addr | 50 | muid <- getLocalPeerCred' addr |
51 | case muid of | 51 | case muid of |
52 | Just uid -> return uid | 52 | Just uid -> return (Just uid) |
53 | Nothing -> return undefined -- trace "proc failed." $ fmap (CUid . fromIntegral . sndOf3) (getPeerCred sock) | 53 | Nothing -> trace "proc failed." $ fmap (validate . CUid . fromIntegral . sndOf3) (getPeerCred sock) |
54 | where sndOf3 (pid,uid,gid) = uid | 54 | where sndOf3 (pid,uid,gid) = uid |
55 | where | ||
56 | validate uid = Just uid -- TODO | ||
55 | 57 | ||
56 | from16 :: Word16 -> Int | 58 | from16 :: Word16 -> Int |
57 | from16 = fromEnum | 59 | from16 = fromEnum |