remove root check

This commit is contained in:
Anand Babu (AB) Periasamy
2015-10-22 00:13:32 -07:00
parent 3473c88e95
commit 3d6b19f833
+5 -17
View File
@@ -19,7 +19,6 @@ package main
import (
"fmt"
"os"
"os/user"
"runtime"
"strconv"
@@ -31,18 +30,6 @@ import (
"github.com/olekukonko/ts"
)
// Check for the user id erarly on and gracefully report.
func checkUser() {
_, e := user.Current()
fatalIf(probe.NewError(e), "Unable to determine current user.")
if runtime.GOOS != "windows" {
if os.Geteuid() == 0 {
fatalIf(errDummy().Trace(), "Please run as a normal user, running as root is disallowed")
}
}
}
// Check for sane config environment early on and gracefully report.
func checkConfig() {
// Ensures config file is sane
@@ -93,15 +80,16 @@ func registerBefore(ctx *cli.Context) error {
console.NoDebugPrint = false
}
// Set theme.
setMainPalette(ctx.GlobalString("colors"))
// check if mc is being run as root
checkUser()
// verify golang runtime
// Verify golang runtime
verifyMCRuntime()
// Migrate any old version of config / state files to newer format.
migrate()
// checkConfig if it can be read
// Checkconfig if it can be read
checkConfig()
return nil
}