aboutsummaryrefslogtreecommitdiff
path: root/cmd/fscrypt/prompt.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/fscrypt/prompt.go')
-rw-r--r--cmd/fscrypt/prompt.go29
1 files changed, 0 insertions, 29 deletions
diff --git a/cmd/fscrypt/prompt.go b/cmd/fscrypt/prompt.go
index bccf534..57d0fc7 100644
--- a/cmd/fscrypt/prompt.go
+++ b/cmd/fscrypt/prompt.go
@@ -23,22 +23,13 @@ import (
"fmt"
"log"
"os"
- "os/user"
"strconv"
- "github.com/pkg/errors"
-
"github.com/google/fscrypt/actions"
"github.com/google/fscrypt/metadata"
"github.com/google/fscrypt/util"
)
-const (
- // Suffixes for questions with a yes or no default
- defaultYesSuffix = " [Y/n] "
- defaultNoSuffix = " [y/N] "
-)
-
// Descriptions for each of the protector sources
var sourceDescriptions = map[metadata.SourceType]string{
metadata.SourceType_pam_passphrase: "Your login passphrase",
@@ -46,26 +37,6 @@ var sourceDescriptions = map[metadata.SourceType]string{
metadata.SourceType_raw_key: "A raw 256-bit key",
}
-// usernameFromID returns the username for the provided UID. If the UID does not
-// correspond to a user or the username is blank, an error is returned.
-func usernameFromID(uid int64) (string, error) {
- u, err := user.LookupId(strconv.Itoa(int(uid)))
- if err != nil || u.Username == "" {
- return "", errors.Wrapf(ErrUnknownUser, "uid %d", uid)
- }
- return u.Username, nil
-}
-
-// formatUsername either returns the username for the provided UID, or a string
-// containing the error for unknown UIDs.
-func formatUsername(uid int64) string {
- username, err := usernameFromID(uid)
- if err != nil {
- return fmt.Sprintf("[%v]", err)
- }
- return username
-}
-
// formatInfo gives a string description of metadata.ProtectorData.
func formatInfo(data actions.ProtectorInfo) string {
switch data.Source() {