aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2020-01-28 01:57:46 -0800
committerJoseph Richey <joerichey@google.com>2020-01-28 01:57:46 -0800
commit2c57ab18375a8d0b4df9c4b6d9f3692d14edfee7 (patch)
tree6757f54a0267c678287e8b67323cf49e2f4f41a4
parentd5b8bdcfba528c0c0e9f8052a705e454b26cb28f (diff)
cmd/fscrypt/setup: don't prompt to create /etc/fscrypt.conf (#190)
When 'fscrypt setup' sees that /etc/fscrypt.conf doesn't exist, don't ask for confirmation before creating it. Just do it. This is the normal use, and there's not a good reason to ask the user to confirm it.
-rw-r--r--README.md1
-rw-r--r--cmd/fscrypt/setup.go4
2 files changed, 2 insertions, 3 deletions
diff --git a/README.md b/README.md
index 64d8028..7a0b9da 100644
--- a/README.md
+++ b/README.md
@@ -339,7 +339,6 @@ MOUNTPOINT DEVICE FILESYSTEM ENCRYPTION FSCRYPT
# Create the global configuration file. Nothing else necessarily needs root.
>>>>> sudo fscrypt setup
-Create "/etc/fscrypt.conf"? [Y/n] y
Customizing passphrase hashing difficulty for this system...
Created global config file at "/etc/fscrypt.conf".
Metadata directories created at "/.fscrypt".
diff --git a/cmd/fscrypt/setup.go b/cmd/fscrypt/setup.go
index 2bb15ef..69787bb 100644
--- a/cmd/fscrypt/setup.go
+++ b/cmd/fscrypt/setup.go
@@ -35,7 +35,7 @@ func createGlobalConfig(w io.Writer, path string) error {
return ErrMustBeRoot
}
- // Ask to create or replace the config file
+ // If the config file already exists, ask to replace it
_, err := os.Stat(path)
switch {
case err == nil:
@@ -44,7 +44,7 @@ func createGlobalConfig(w io.Writer, path string) error {
err = os.Remove(path)
}
case os.IsNotExist(err):
- err = askConfirmation(fmt.Sprintf("Create %q?", path), true, "")
+ err = nil
}
if err != nil {
return err