Commit c7cc3f56 authored by Valentin Reis's avatar Valentin Reis

Added a check for the output directory not being mounted with nosuid.

parent 3da201bc
Pipeline #4739 passed with stage
in 44 seconds
{-# LANGUAGE ScopedTypeVariables,
{-# LANGUAGE
ScopedTypeVariables,
LambdaCase,
RecordWildCards,
OverloadedStrings,
......@@ -36,6 +37,7 @@ import Data.ByteString.Char8 as C8
hiding ( empty )
import Control.Exception.Base
import Data.Maybe
import Control.Foldl as Fold
cleanLeftoverProcesses :: Shell ()
......@@ -69,10 +71,22 @@ cleanLeftovers StackArgs {..} = do
printInfo "Cleaning leftover sockets.\n"
CM.mapM_ cleanSocket ["/tmp/nrm-downstream-in", "/tmp/nrm-upstream-in"]
checkFsAttributes :: StackArgs -> Shell ()
checkFsAttributes StackArgs {..} = do
let x = case toText workingDirectory of
Left x -> x
Right x -> x
let findmnt = inproc "findmnt" ["-T", x, "-o", "OPTIONS"] empty
b <- liftIO $ Turtle.Shell.fold (grep (has "nosuid") findmnt) Fold.length
when (b > 0) $ dieRed $ format
("The output directory, " % fp % ", must not mounted with \"nosuid\"")
workingDirectory
prepareDaemon
:: StackArgs -> Shell (IO (Either PatternMatched (ExitCode, (), ())))
prepareDaemon StackArgs {..} = do
prepareDaemon sa@StackArgs {..} = do
mktree workingDirectory
checkFsAttributes sa
cd workingDirectory
myWhich "daemon"
confPath <- myWhich "argo_nodeos_config"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment