aboutsummaryrefslogtreecommitdiff
path: root/cmd/fscrypt/fscrypt.go
diff options
context:
space:
mode:
authorJoseph Richey <joerichey@google.com>2017-08-31 14:51:55 -0700
committerGitHub <noreply@github.com>2017-08-31 14:51:55 -0700
commitb04d7ef31dc2e21f055b1b656efb9511e72db6c6 (patch)
tree04daee42d94ddda55d956e72f44bafec0ef6dde1 /cmd/fscrypt/fscrypt.go
parent5285a8c451ef660f932e9f1823ad7da52ad25b74 (diff)
parentf1bd511fff8e411687001bd8e76e8a41c9f5ff41 (diff)
Merge pull request #52 from google/keyrings
Changes to the keyrings interface, corresponding UI changes, and misc changes
Diffstat (limited to 'cmd/fscrypt/fscrypt.go')
-rw-r--r--cmd/fscrypt/fscrypt.go25
1 files changed, 0 insertions, 25 deletions
diff --git a/cmd/fscrypt/fscrypt.go b/cmd/fscrypt/fscrypt.go
index 93df341..d6162f6 100644
--- a/cmd/fscrypt/fscrypt.go
+++ b/cmd/fscrypt/fscrypt.go
@@ -31,12 +31,8 @@ import (
"io/ioutil"
"log"
"os"
- "strconv"
"time"
- "golang.org/x/sys/unix"
-
- "github.com/google/fscrypt/security"
"github.com/urfave/cli"
)
@@ -130,27 +126,6 @@ func setupBefore(c *cli.Context) error {
if !quietFlag.Value {
c.App.Writer = os.Stdout
}
-
- if unix.Geteuid() != 0 {
- return nil // Must be root to setup links
- }
- euid, err := strconv.Atoi(os.Getenv("SUDO_UID"))
- if err != nil {
- return nil // Must be running with sudo
- }
- egid, err := strconv.Atoi(os.Getenv("SUDO_GID"))
- if err != nil {
- return nil // Must be running with sudo
- }
-
- // Dropping and raising privileges checks the needed keyring link.
- privs, err := security.DropThreadPrivileges(euid, egid)
- if err != nil {
- return newExitError(c, err)
- }
- if err := security.RaiseThreadPrivileges(privs); err != nil {
- return newExitError(c, err)
- }
return nil
}