Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Reis
argotest
Commits
c7cc3f56
Commit
c7cc3f56
authored
Dec 20, 2018
by
Valentin Reis
Browse files
Added a check for the output directory not being mounted with nosuid.
parent
3da201bc
Pipeline
#4739
passed with stage
in 44 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
argo/src/Argo/Stack.hs
View file @
c7cc3f56
{-# 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"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment