diff options
Diffstat (limited to 'Presence/LocalPeerCred.hs')
-rw-r--r-- | Presence/LocalPeerCred.hs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Presence/LocalPeerCred.hs b/Presence/LocalPeerCred.hs index 14f5234a..f66421f8 100644 --- a/Presence/LocalPeerCred.hs +++ b/Presence/LocalPeerCred.hs | |||
@@ -104,6 +104,9 @@ parseProcNet port host h = do | |||
104 | unmap6mapped4 addr@(SockAddrInet6 port _ (0,0,0xFFFF,a) _) = SockAddrInet port (toBE32 a) | 104 | unmap6mapped4 addr@(SockAddrInet6 port _ (0,0,0xFFFF,a) _) = SockAddrInet port (toBE32 a) |
105 | unmap6mapped4 addr = addr | 105 | unmap6mapped4 addr = addr |
106 | 106 | ||
107 | identifyTTY :: | ||
108 | [(W8.ByteString, ProcessID)] | ||
109 | -> UserID -> W8.ByteString -> IO (Maybe W8.ByteString, Maybe CPid) | ||
107 | identifyTTY tty_pids uid inode = do | 110 | identifyTTY tty_pids uid inode = do |
108 | pid <- scanProc (show uid) (L.unpack inode) | 111 | pid <- scanProc (show uid) (L.unpack inode) |
109 | -- putStrLn $ "scanProc --> "++show pid | 112 | -- putStrLn $ "scanProc --> "++show pid |
@@ -122,6 +125,7 @@ identifyTTY tty_pids uid inode = do | |||
122 | parseTty :: String -> Float | 125 | parseTty :: String -> Float |
123 | parseTty = read . tail . dropWhile (/=':') | 126 | parseTty = read . tail . dropWhile (/=':') |
124 | 127 | ||
128 | ttyToXorgs :: Show a => [(t, a)] -> IO [([Char], t)] | ||
125 | ttyToXorgs tty_pids = do | 129 | ttyToXorgs tty_pids = do |
126 | dts' <- flip mapM tty_pids $ \(tty,pid) -> do | 130 | dts' <- flip mapM tty_pids $ \(tty,pid) -> do |
127 | cmd' <- readFile $ "/proc/"++show pid++"/cmdline" | 131 | cmd' <- readFile $ "/proc/"++show pid++"/cmdline" |