From 5fefb161c388f72fa598c238295ce1f051cc0029 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 22 Nov 2014 22:37:25 -0400 Subject: propellor spin --- src/Propellor/Property/Chroot/Util.hs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/Propellor/Property/Chroot/Util.hs (limited to 'src/Propellor/Property/Chroot') diff --git a/src/Propellor/Property/Chroot/Util.hs b/src/Propellor/Property/Chroot/Util.hs new file mode 100644 index 00000000..feb71d01 --- /dev/null +++ b/src/Propellor/Property/Chroot/Util.hs @@ -0,0 +1,15 @@ +module Propellor.Property.Chroot.Util where + +import Utility.Env +import Control.Applicative + +-- When chrooting, it's useful to ensure that PATH has all the standard +-- directories in it. This adds those directories to whatever PATH is +-- already set. +standardPathEnv :: IO [(String, String)] +standardPathEnv = do + path <- getEnvDefault "PATH" "/bin" + addEntry "PATH" (path ++ std) + <$> getEnvironment + where + std = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" -- cgit v1.2.3