Commit ba4ea3ef authored by Valentin Reis's avatar Valentin Reis

Stack change to reflect SUDO passing.

parent 7e2ff501
Pipeline #5136 passed with stage
in 2 minutes and 26 seconds
...@@ -24,6 +24,7 @@ import Control.Monad as CM ...@@ -24,6 +24,7 @@ import Control.Monad as CM
import Data.Maybe import Data.Maybe
import Control.Foldl as Fold import Control.Foldl as Fold
import Text.Show.Pretty import Text.Show.Pretty
import System.Environment
cleanLeftovers :: WorkingDirectory -> Shell () cleanLeftovers :: WorkingDirectory -> Shell ()
cleanLeftovers (WorkingDirectory wd) = do cleanLeftovers (WorkingDirectory wd) = do
...@@ -52,11 +53,12 @@ prepareDaemon out stdErr test = do ...@@ -52,11 +53,12 @@ prepareDaemon out stdErr test = do
cp confPath confPath' cp confPath confPath'
printInfo $ format ("Copied the configurator to " % fp) confPath' printInfo $ format ("Copied the configurator to " % fp) confPath'
printInfo $ format "Trying to sudo chown and chmod argo_nodeos_config" printInfo $ format "Trying to sudo chown and chmod argo_nodeos_config"
verboseShell (format ("sudo chown root:root " % fp) confPath') empty >>= \case sudoPath <- liftIO $ pack <$> getEnv "SUDO"
verboseShell (format (s%" chown root:root " % fp) sudoPath confPath') empty >>= \case
ExitSuccess -> printInfo "Chowned argo_nodeos_config to root:root." ExitSuccess -> printInfo "Chowned argo_nodeos_config to root:root."
ExitFailure n -> ExitFailure n ->
die ("Failed to set argo_nodeos_config permissions " <> repr n) die ("Failed to set argo_nodeos_config permissions " <> repr n)
verboseShell (format ("sudo chmod u+sw " % fp) confPath') empty >>= \case verboseShell (format (s%" chmod u+sw " % fp) sudoPath confPath') empty >>= \case
ExitSuccess -> printInfo "Set the suid bit." ExitSuccess -> printInfo "Set the suid bit."
ExitFailure n -> die ("Setting suid bit failed with exit code " <> repr n) ExitFailure n -> die ("Setting suid bit failed with exit code " <> repr n)
cleanContainers confPath' 1 2 cleanContainers confPath' 1 2
......
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