summaryrefslogtreecommitdiff
path: root/src/Propellor/PrivData.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Propellor/PrivData.hs')
-rw-r--r--src/Propellor/PrivData.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Propellor/PrivData.hs b/src/Propellor/PrivData.hs
index e59f42c3..6b77f782 100644
--- a/src/Propellor/PrivData.hs
+++ b/src/Propellor/PrivData.hs
@@ -54,6 +54,8 @@ import Utility.FileMode
import Utility.Env
import Utility.Table
import Utility.FileSystemEncoding
+import Utility.ConcurrentOutput
+import Utility.Process
-- | Allows a Property to access the value of a specific PrivDataField,
-- for use in a specific Context or HostContext.
@@ -192,7 +194,8 @@ editPrivData field context = do
hClose th
maybe noop (\p -> writeFileProtected' f (`L.hPut` privDataByteString p)) v
editor <- getEnvDefault "EDITOR" "vi"
- unlessM (boolSystem editor [File f]) $
+ (_, _, _, p) <- createProcessForeground $ proc editor [f]
+ unlessM (checkSuccessProcess p) $
error "Editor failed; aborting."
PrivData <$> readFile f
setPrivDataTo field context v'