summaryrefslogtreecommitdiff
path: root/Presence/LocalPeerCred.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Presence/LocalPeerCred.hs')
-rw-r--r--Presence/LocalPeerCred.hs4
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
104unmap6mapped4 addr@(SockAddrInet6 port _ (0,0,0xFFFF,a) _) = SockAddrInet port (toBE32 a) 104unmap6mapped4 addr@(SockAddrInet6 port _ (0,0,0xFFFF,a) _) = SockAddrInet port (toBE32 a)
105unmap6mapped4 addr = addr 105unmap6mapped4 addr = addr
106 106
107identifyTTY ::
108 [(W8.ByteString, ProcessID)]
109 -> UserID -> W8.ByteString -> IO (Maybe W8.ByteString, Maybe CPid)
107identifyTTY tty_pids uid inode = do 110identifyTTY 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
128ttyToXorgs :: Show a => [(t, a)] -> IO [([Char], t)]
125ttyToXorgs tty_pids = do 129ttyToXorgs 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"