From 2ffa63e3d6160c63df72fea11a91fc055d7120e8 Mon Sep 17 00:00:00 2001 From: Joe Crayne Date: Mon, 1 Jul 2019 10:31:30 -0400 Subject: Avoid redundant names call. --- lib/Kiki.hs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/Kiki.hs b/lib/Kiki.hs index e8ea5f5..64e2d7d 100644 --- a/lib/Kiki.hs +++ b/lib/Kiki.hs @@ -464,13 +464,11 @@ refreshCache :: KeyRingRuntime -> Maybe FilePath -> IO () refreshCache rt rootdir = do (mkpath, commit) <- getMkPathAndCommit (fromMaybe "" rootdir ++ "/var/cache/kiki/config") generateHostsFile mkpath rt - let bUnprivileged = False -- TODO - oname = Char8.concat $ do - (_,(os,_)) <- maybeToList (names rt) - take 1 os fromMaybe (error "No working key.") $ do - (wkaddr,_) <- names rt + (wkaddr,(onames,_)) <- names rt Just $ do + let oname = Char8.concat $ take 1 onames + bUnprivileged = False -- TODO if (oname == "") && (not bUnprivileged) then error "Missing tor key" else do -- sshcpathpub0 = fromMaybe "" rootdir ++ osHomeDir ".ssh" "id_rsa.pub" -- sshspathpub0 = fromMaybe "" rootdir ++ "/etc/ssh/ssh_host_rsa_key.pub" -- cgit v1.2.3