aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/errors.go11
-rw-r--r--cmd/fscrypt/fscrypt.go4
-rw-r--r--cmd/fscrypt/setup.go2
3 files changed, 3 insertions, 14 deletions
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 {
diff --git a/cmd/fscrypt/fscrypt.go b/cmd/fscrypt/fscrypt.go
index 2054193..c696545 100644
--- a/cmd/fscrypt/fscrypt.go
+++ b/cmd/fscrypt/fscrypt.go
@@ -63,7 +63,7 @@ var baseFlags = []cmd.Flag{cmd.VerboseFlag, cmd.QuietFlag, cmd.HelpFlag}
var fscryptCommand = cmd.Command{
Title: "manage linux filesystem encryption",
UsageLines: []string{
- fmt.Sprintf("<command> [arguments] [options] [%s|%s]",
+ fmt.Sprintf("<command> [arguments] [options] [%s | %s]",
cmd.VerboseFlag, cmd.QuietFlag),
cmd.VersionUsage,
},
@@ -77,7 +77,7 @@ var setupCommand = &cmd.Command{
Name: "setup",
Title: "setup a system/filesystem to use fscrypt",
UsageLines: []string{
- fmt.Sprintf("[options]"),
+ fmt.Sprintf("[%s] [%]"),
fmt.Sprintf("%s [%s]", unusedMountpointArg, cmd.ForceFlag),
},
Arguments: []*cmd.Argument{unusedMountpointArg},
diff --git a/cmd/fscrypt/setup.go b/cmd/fscrypt/setup.go
index a421783..9620c88 100644
--- a/cmd/fscrypt/setup.go
+++ b/cmd/fscrypt/setup.go
@@ -49,7 +49,7 @@ func createGlobalConfig(path string) error {
return err
}
- fmt.Fprintln(cmd.Output, "Customizing passphrase hashing difficulty for this system...")
+ fmt.Fprintln(cmd.Output, "Customizing passphrase hashing difficulty for this system ...")
err = actions.CreateConfigFile(timeTargetFlag.Value, legacyFlag.Value)
if err != nil {
return err