From 3269bc539e52cdced8c03a628e4fdf22942ece4b Mon Sep 17 00:00:00 2001 From: Joseph Richey Date: Thu, 19 Oct 2017 03:37:54 -0700 Subject: util: Add CheckIfRoot Replace IsUserRoot with CheckIfRoot. This allows all functions to use the same error handling when a user is not root. --- cmd/fscrypt/commands.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd/fscrypt/commands.go') diff --git a/cmd/fscrypt/commands.go b/cmd/fscrypt/commands.go index 2f23a0f..2733890 100644 --- a/cmd/fscrypt/commands.go +++ b/cmd/fscrypt/commands.go @@ -353,7 +353,7 @@ func purgeAction(c *cli.Context) error { } if dropCachesFlag.Value { - if !util.IsUserRoot() { + if util.CurrentUserID() != 0 { return newExitError(c, ErrDropCachesPerm) } } -- cgit v1.2.3