diff options
| author | Joey Hess <joeyh@joeyh.name> | 2015-09-03 08:53:40 -0700 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2015-09-03 08:54:06 -0700 |
| commit | 43a67e310740e58707d0a7908237641ef46f5ae6 (patch) | |
| tree | 89df6bbb593bc85f8a443316c16dd4cd893f97d1 /src/Propellor/Property/Chroot/Util.hs | |
| parent | f158d1cf81c2fe4ece5320dd725496043e5b953d (diff) | |
| parent | 776b4dc3b24f8d30fa0fe56254c16e613d8e0bbe (diff) | |
Merge branch 'joeyconfig'
Diffstat (limited to 'src/Propellor/Property/Chroot/Util.hs')
| -rw-r--r-- | src/Propellor/Property/Chroot/Util.hs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Propellor/Property/Chroot/Util.hs b/src/Propellor/Property/Chroot/Util.hs index 382fbab7..ea0df780 100644 --- a/src/Propellor/Property/Chroot/Util.hs +++ b/src/Propellor/Property/Chroot/Util.hs @@ -1,7 +1,10 @@ module Propellor.Property.Chroot.Util where +import Propellor.Property.Mount + import Utility.Env import Control.Applicative +import System.Directory -- When chrooting, it's useful to ensure that PATH has all the standard -- directories in it. This adds those directories to whatever PATH is @@ -14,3 +17,10 @@ standardPathEnv = do stdPATH :: String stdPATH = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + +-- Removes the contents of a chroot. First, unmounts any filesystems +-- mounted within it. +removeChroot :: FilePath -> IO () +removeChroot c = do + unmountBelow c + removeDirectoryRecursive c |
