summaryrefslogtreecommitdiff
path: root/src/Propellor
diff options
context:
space:
mode:
authorJoey Hess2015-12-06 00:09:08 -0400
committerJoey Hess2015-12-06 00:09:08 -0400
commit8093dd640eb2c1dac952984d76f08cef0f81edea (patch)
treebeaef3d41374ab76fab59dd07e3925349139dc4e /src/Propellor
parent54f086238c4fb20490e8369c99c910991b0d5be8 (diff)
check for changes to sasldb2
Diffstat (limited to 'src/Propellor')
-rw-r--r--src/Propellor/Property/Postfix.hs14
1 files 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