mirror of
https://github.com/rwinkhart/libmutton.git
synced 2026-08-28 04:46:42 -04:00
Rename all occurrences of "passphrase" to "password"
This commit is contained in:
+7
-7
@@ -14,8 +14,8 @@ import (
|
||||
)
|
||||
|
||||
// LibmuttonInit creates the libmutton config structure based on user input.
|
||||
// rcwPassphrase and clientSpecificIniData can be left blank if not needed.
|
||||
func LibmuttonInit(inputCB func(prompt string) string, clientSpecificIniData [][3]string, rcwPassphrase []byte, preserveOldConfigDir bool) error {
|
||||
// rcwPassword and clientSpecificIniData can be left blank if not needed.
|
||||
func LibmuttonInit(inputCB func(prompt string) string, clientSpecificIniData [][3]string, rcwPassword []byte, preserveOldConfigDir bool) error {
|
||||
r := strings.ToLower(inputCB("Configure SSH settings (for synchronization)? (Y/n)"))
|
||||
if len(r) > 0 && r[0] == 'n' {
|
||||
// initialize libmutton directories
|
||||
@@ -35,7 +35,7 @@ func LibmuttonInit(inputCB func(prompt string) string, clientSpecificIniData [][
|
||||
} else {
|
||||
// ensure ssh key file exists (and is a file)
|
||||
fallbackSSHKey := back.Home + global.PathSeparator + ".ssh" + global.PathSeparator + "id_ed25519"
|
||||
sshKeyPath := cmp.Or(back.ExpandPathWithHome(inputCB(back.AnsiBold+"Note:"+back.AnsiReset+" Only key-based authentication is supported (keys may optionally be passphrase-protected).\n The remote server must already be in your ~"+global.PathSeparator+".ssh"+global.PathSeparator+"known_hosts file.\n\nSSH private identity file path (falls back to \""+fallbackSSHKey+"\"):")), fallbackSSHKey)
|
||||
sshKeyPath := cmp.Or(back.ExpandPathWithHome(inputCB(back.AnsiBold+"Note:"+back.AnsiReset+" Only key-based authentication is supported (keys may optionally be password-protected).\n The remote server must already be in your ~"+global.PathSeparator+".ssh"+global.PathSeparator+"known_hosts file.\n\nSSH private identity file path (falls back to \""+fallbackSSHKey+"\"):")), fallbackSSHKey)
|
||||
_, err := back.TargetIsFile(sshKeyPath, true)
|
||||
if err != nil {
|
||||
return errors.New("unable to find SSH identity file: " + err.Error())
|
||||
@@ -84,8 +84,8 @@ func LibmuttonInit(inputCB func(prompt string) string, clientSpecificIniData [][
|
||||
}
|
||||
}
|
||||
// generate rcw sanity check file (if requested)
|
||||
if len(rcwPassphrase) > 0 {
|
||||
err := RCWSanityCheckGen(rcwPassphrase)
|
||||
if len(rcwPassword) > 0 {
|
||||
err := RCWSanityCheckGen(rcwPassword)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -94,8 +94,8 @@ func LibmuttonInit(inputCB func(prompt string) string, clientSpecificIniData [][
|
||||
}
|
||||
|
||||
// RCWSanityCheckGen generates the RCW sanity check file for libmutton.
|
||||
func RCWSanityCheckGen(passphrase []byte) error {
|
||||
err := wrappers.GenSanityCheck(global.ConfigDir+global.PathSeparator+"sanity.rcw", passphrase)
|
||||
func RCWSanityCheckGen(password []byte) error {
|
||||
err := wrappers.GenSanityCheck(global.ConfigDir+global.PathSeparator+"sanity.rcw", password)
|
||||
if err != nil {
|
||||
return errors.New("unable to generate sanity check file: " + err.Error())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user