From 0d4d11af2883bac66ecc427cdde37aa995b93ca8 Mon Sep 17 00:00:00 2001 From: Joseph Richey Date: Thu, 19 Oct 2017 02:21:08 -0700 Subject: Random changes --- cmd/errors.go | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'cmd/errors.go') diff --git a/cmd/errors.go b/cmd/errors.go index c67c0f1..6c78912 100644 --- a/cmd/errors.go +++ b/cmd/errors.go @@ -24,8 +24,6 @@ import ( "os" "github.com/pkg/errors" - - "github.com/google/fscrypt/util" ) // Common errors used across tools @@ -33,7 +31,6 @@ var ( ErrUnknownVersion = errors.New("unknown version (missing version tag)") ErrCanceled = errors.New("operation canceled by user") ErrMustForce = errors.New("operation must be forced") - ErrNotRoot = errors.New("operation must be run as root") ) // Error return codes @@ -73,14 +70,6 @@ func CheckExpectedArgs(ctx *Context, expectedArgs int, atMost bool) error { return UsageError(message) } -// CheckIfRoot returns an error if the current user is not the root user. -func CheckIfRoot() error { - if id := util.CurrentUserID(); id != 0 { - return errors.Wrapf(ErrNotRoot, "user %s", util.GetUser(id).Username) - } - return nil -} - // CheckRequiredFlags returns a UsageError if all of the required flags are not // set. Only StringFlags are currently supported. func CheckRequiredFlags(flags []*StringFlag) error { -- cgit v1.2.3