From 8093dd640eb2c1dac952984d76f08cef0f81edea Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 6 Dec 2015 00:09:08 -0400 Subject: check for changes to sasldb2 --- src/Propellor/Property/Postfix.hs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Propellor/Property/Postfix.hs b/src/Propellor/Property/Postfix.hs index bc46ac21..91a02927 100644 --- a/src/Propellor/Property/Postfix.hs +++ b/src/Propellor/Property/Postfix.hs @@ -170,15 +170,17 @@ saslAuthdInstalled = setupdaemon -- -- The password is taken from the privdata. saslPasswdSet :: Domain -> User -> Property HasInfo -saslPasswdSet domain (User user) = withPrivData src ctx $ \getpw -> trivial $ - property ("sasl password for " ++ uatd) $ getpw $ \pw -> makeChange $ - withHandle StdinHandle createProcessSuccess p $ \h -> do - hPutStrLn h (privDataVal pw) - hClose h +saslPasswdSet domain (User user) = go `changesFile` "/etc/sasldb2" where + go = withPrivData src ctx $ \getpw -> + property desc $ getpw $ \pw -> liftIO $ + withHandle StdinHandle createProcessSuccess p $ \h -> do + hPutStrLn h (privDataVal pw) + hClose h + return NoChange + desc = "sasl password for " ++ uatd uatd = user ++ "@" ++ domain ps = ["-p", "-c", "-u", domain, user] p = proc "saslpasswd2" ps ctx = Context "sasl" src = PrivDataSource (Password uatd) "enter password" - trivial = flip assume NoChange -- cgit v1.2.3