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. --- security/keyring.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'security/keyring.go') diff --git a/security/keyring.go b/security/keyring.go index ab65631..7ce163e 100644 --- a/security/keyring.go +++ b/security/keyring.go @@ -114,7 +114,7 @@ func UserKeyringID(target *user.User, checkSession bool) (int, error) { return 0, errors.Wrap(ErrAccessUserKeyring, err.Error()) } - if !util.IsUserRoot() { + if util.CurrentUserID() != 0 { // Make sure the returned keyring will be accessible by checking // that it is in the session keyring. if checkSession && !isUserKeyringInSession(uid) { -- cgit v1.2.3