aboutsummaryrefslogtreecommitdiff
path: root/cmd/fscrypt/setup.go
diff options
context:
space:
mode:
authorJoseph Richey <joerichey94@gmail.com>2017-10-19 03:37:54 -0700
committerJoseph Richey <joerichey94@gmail.com>2017-10-19 03:54:50 -0700
commit3269bc539e52cdced8c03a628e4fdf22942ece4b (patch)
tree062792c21fe6751e14f827616bf454e62210a1dc /cmd/fscrypt/setup.go
parentfe76f6f1cc71c75bc1124f4fe3171c679c06aa1c (diff)
util: Add CheckIfRoot
Replace IsUserRoot with CheckIfRoot. This allows all functions to use the same error handling when a user is not root.
Diffstat (limited to 'cmd/fscrypt/setup.go')
-rw-r--r--cmd/fscrypt/setup.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd/fscrypt/setup.go b/cmd/fscrypt/setup.go
index 72dfbdb..ac32484 100644
--- a/cmd/fscrypt/setup.go
+++ b/cmd/fscrypt/setup.go
@@ -31,8 +31,8 @@ import (
// createGlobalConfig creates (or overwrites) the global config file
func createGlobalConfig(w io.Writer, path string) error {
- if !util.IsUserRoot() {
- return ErrMustBeRoot
+ if err := util.CheckIfRoot(); err != nil {
+ return err
}
// Ask to create or replace the config file