úÎX!TÌ*      !"#$%&'( )  Safe-Inferredcalls ** but will remove the target and retry if * raises EEXIST.None246M<FIXME: We should really get this value from the mount table.»Return the device represented by a device node, such as /dev/sda2. Returns Nothing if there is an exception trying to stat the node, or if the node turns out not to be a special device.+7Removable devices, such as USB keys, are in this group.,LTraverse a directory and return a list of all the (path, fileStatus) pairs. -./ 01+23,45   .-/ 01+23,45 Safe-Inferred# - 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: ithere is a one-to-one correspondence between the entries in /proc/mounts and the actual mounts, and©every 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: 66?umountSucceeded - predicated suitable for filtering results of 770 - unescape function for strings in /proc/mounts88$ - /proc/mount stytle string escaperP - 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/mtabLazy (umount -l flag) if truecanonicalised, absolute pathTpaths that we attempted to umount, and the responding output from the umount command678678NoneDeprecated: Use UData.ByteString.Lazy.Char8.readFile path >>= return . show . Data.Digest.Pure.MD5.md5Deprecated: Use aData.ByteString.Lazy.Char8.readFile path >>= Data.ByteString.Lazy.Char8.writeFile (path ++ ".gz") Safe-InferredMOKill the processes whose working directory is in or under the given directory. Safe-Inferred GConcatenate two paths, making sure there is exactly one path separator.Use dropFileNameUse takeFileNameresolve all references to ., .., extra slashes, and symlinks99 Safe-Inferred M LTraverse a directory and return a list of all the (path, fileStatus) pairs.:ÿ¬Traverse 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.!ÿMRecursively 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 procBmounts, which is ambiguous or wrong when you are inside a chroot."°Like 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.#\Rename src to dst, and if dst already exists move it to dst~. If dst~ exists it is removed.$Htemporarily change the working directory to |dir| while running |action|%ÿ]create 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 ; :!"#$%& !"#$%& !"#$%& ; :!"#$%&(c) 2010BSD3jeremy@seereason.com provisionalnon-portable (requires POSIX) Safe-Inferred 'calls crypt(3) <'keysaltencrypted password''<'  Safe-Inferred = chroot 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(ÿ'fchroot 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)¿The 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.>?@=()()()>?@=()A     !"#$%&'()*+,-./01 2 3456789:;<=>?@ABCDEFGH I J K LMUnixutils-1.52.4System.Unix.FilesSystem.Unix.SpecialDeviceSystem.Unix.MountSystem.Unix.MiscSystem.Unix.KillByCwdSystem.Unix.FilePathSystem.Unix.DirectorySystem.Unix.CryptSystem.Unix.ChrootforceSymbolicLink SpecialDevice sysMountPointofPathrootPartofNode ofNodeStatus ofSysName ofSysPath ofMajorMinorofDevNotoDevnonodenodes splitPart diskOfPartsysNamesysDir getAllDisksgetAllPartitions getAllCdromsgetAllRemovable umountBelowumount isMountPointmd5sumgzip killByCwd<++>dirNamebaseNamerealpathfindremoveRecursiveSafelyunmountRecursiveSafelyrenameFileWithBackupwithWorkingDirectorywithTemporaryDirectorymkdtempcryptfchrootuseEnv unix-2.7.0.1System.Posix.FilescreateSymbolicLink floppyGroupdirectory_findCharacterDevice BlockDeviceparseSysDevFile diskGroup cdromGroupgetDisksInGroupisPartdirnamebasenameumountSucceededunescapeescape c_realpathtraverse c_mkdtempc_cryptchrootc_chroot forceList forceList'