h&[7      ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6  Safe-Inferred7 Unixutilschroot changes the root directory to filepath NOTE: it does not change the working directory, just the root directory NOTE: will throw IOError if chroot fails Unixutilsfchroot runs an IO action inside a chroot fchroot performs a chroot, runs the action, and then restores the original root and working directory. This probably affects the chroot and working directory of all the threads in the process, so... NOTE: will throw IOError if internal chroot fails UnixutilsThe ssh inside of the chroot needs to be able to talk to the running ssh-agent. Therefore we mount --bind the ssh agent socket dir inside the chroot (and umount it when we exit the chroot.(c) 2010BSD3jeremy@seereason.com provisionalnon-portable (requires POSIX) Safe-Inferred Unixutilscalls crypt(3) Unixutilskey Unixutilssalt Unixutilsencrypted password Safe-Inferred  UnixutilsTraverse a directory and return a list of all the (path, fileStatus) pairs.8 UnixutilsTraverse a file system directory applying D to every directory, F to every non-directory file, and M to every mount point. NOTE: It is tempting to use the "find" function to returns a list of the elements of the directory and then map that list over an "unmount and remove" function. However, because we are unmounting as we traverse, the contents of the file list may change in ways that could confuse the find function. UnixutilsRecursively remove a directory contents on a single file system. The adjective "Safely" refers to these features: 1. It will not follow symlinks 2. If it finds a directory that seems to be a mount point, it will attempt to unmount it up to five times. If it still seems to be a mount point it gives up 3. It doesn't use procmounts, which is ambiguous or wrong when you are inside a chroot. UnixutilsLike removeRecursiveSafely but doesn't remove any files, just unmounts anything it finds mounted. Note that this can be much slower than Mount.umountBelow, use that instead. UnixutilsRename src to dst, and if dst already exists move it to dst~. If dst~ exists it is removed. Unixutilstemporarily change the working directory to |dir| while running |action| Unixutilscreate a temporary directory, run the action, remove the temporary directory the first argument is a template for the temporary directory name the directory will be created as a subdirectory of the directory returned by getTemporaryDirectory the temporary directory will be automatically removed afterwards. your working directory is not altered   Safe-Inferred   UnixutilsConcatenate two paths, making sure there is exactly one path separator.  UnixutilsUse dropFileName  UnixutilsUse takeFileName  Unixutilsresolve all references to ., .., extra slashes, and symlinks   Safe-Inferred > Unixutilscalls 9* but will remove the target and retry if 9 raises EEXIST. Safe-Inferred  UnixutilsKill the processes whose working directory is in or under the given directory. Safe-Inferred UnixutilsDeprecated: Use Data.ByteString.Lazy.Char8.readFile path >>= return . show . Data.Digest.Pure.MD5.md5 UnixutilsDeprecated: Use Data.ByteString.Lazy.Char8.readFile path >>= Data.ByteString.Lazy.Char8.writeFile (path ++ ".gz") Safe-Inferred0  Unixutils!Monad transformer to ensure that  proc and &sys are mounted during a computation. Unixutils# - unmounts all mount points below  belowPath /proc/mounts must be present and readable. Because of the way linux handles changeroots, we can't trust everything we see in /proc/mounts. However, we make the following assumptions: there is a one-to-one correspondence between the entries in /proc/mounts and the actual mounts, andevery mount point we might encounter is a suffix of one of the mount points listed in /proc/mounts (because being in a a chroot doesn't affect /proc/mounts.)So we can search /proc/mounts for an entry has the mount point we are looking for as a substring, then add the extra text on the right to our path and try to unmount that. Then we start again since nested mounts might have been revealed.For example, suppose we are chrooted into /home/david/environments/sid and we call "umountBelow /proc". We might see the mount point /home/david/environments/sid/proc/bus/usb in /proc/mounts, which means we need to run "umount /proc/bus/usb". See also: :: Unixutils?umountSucceeded - predicated suitable for filtering results of ; Unixutils;0 - unescape function for strings in /proc/mounts< Unixutils<# - /proc/mount style string escaper Unixutils - run umount with the specified args NOTE: this function uses exec, so you do not need to shell-escape NOTE: we don't use the umount system call because the system call is not smart enough to update /etc/mtab UnixutilsDo an IO task with a file system remounted using mount --bind. This was written to set up a build environment. UnixutilsMount  proc and sys in the specified build root and execute a task. Typically, the task would start with a chroot into the build root. If the build root given is "/" it is assumed that the file systems are already mounted, no mounting or unmounting is done. UnixutilsDo an IO task with /tmp remounted. This could be used to share /tmp with a build root. UnixutilsLazy (umount -l flag) if true Unixutilscanonicalised, absolute path Unixutilspaths that we attempted to umount, and the responding output from the umount command  Safe-Inferred-  Unixutils UnixutilsTraverse a directory and return a list of all the (path, fileStatus) pairs. !"#$%&'()*+,-./0123 #$!"(%&)'*+.,/-0123?     !"#$%&'( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ABCDEFGH I J'Unixutils-1.54.3-Agxdp79F6vf5Ujnihi50bUSystem.Unix.ChrootSystem.Unix.CryptSystem.Unix.DirectorySystem.Unix.FilePathSystem.Unix.FilesSystem.Unix.KillByCwdSystem.Unix.MiscSystem.Unix.MountSystem.Unix.SpecialDevicefchrootuseEnvcryptfindremoveRecursiveSafelyunmountRecursiveSafelyrenameFileWithBackupwithWorkingDirectorywithTemporaryDirectorymkdtemp<++>dirNamebaseNamerealpathforceSymbolicLink killByCwdmd5sumgzipWithProcAndSysrunWithProcAndSys umountBelowumount isMountPoint withMountwithProcAndSyswithTmp$fMonadIOWithProcAndSys$fMonadTransWithProcAndSys$fFunctorWithProcAndSys$fMonadWithProcAndSys$fApplicativeWithProcAndSys SpecialDevice sysMountPointofPathrootPartofNode ofNodeStatus ofSysName ofSysPath ofMajorMinorofDevNotoDevnonodenodes splitPart diskOfPartsysNamesysDir getAllDisksgetAllPartitions getAllCdromsgetAllRemovable$fShowSpecialDevice$fOrdSpecialDevice$fEqSpecialDevicechroottraverse unix-2.7.2.2System.Posix.FilescreateSymbolicLinkumountSucceededunescapeescape floppyGroupdirectory_find