diff options
author | Daniel Mueller <deso@posteo.net> | 2019-01-20 13:56:48 -0800 |
---|---|---|
committer | Daniel Mueller <deso@posteo.net> | 2019-01-20 13:56:48 -0800 |
commit | 37f7800766fe12af43d0cdba13aea9545cbe7755 (patch) | |
tree | ea621deaf425db10494cb8af59ac3a8806c52e8b /nitrocli/src/main.rs | |
parent | c3f1761ae147e562ec3565c7ba8a9cb1834759c2 (diff) | |
download | nitrocli-37f7800766fe12af43d0cdba13aea9545cbe7755.tar.gz nitrocli-37f7800766fe12af43d0cdba13aea9545cbe7755.tar.bz2 |
Add test for storage hidden subcommand
This change adds a test for the creation, opening, and closing of a
hidden subvolume. In order to support that in a non-interactive fashion,
we introduce and honor the NITROCLI_PASSWORD environment variable, that
prevents an interactive password query.
Diffstat (limited to 'nitrocli/src/main.rs')
-rw-r--r-- | nitrocli/src/main.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/nitrocli/src/main.rs b/nitrocli/src/main.rs index ff6db0f..58d0628 100644 --- a/nitrocli/src/main.rs +++ b/nitrocli/src/main.rs @@ -102,6 +102,7 @@ const NITROCLI_ADMIN_PIN: &str = "NITROCLI_ADMIN_PIN"; const NITROCLI_USER_PIN: &str = "NITROCLI_USER_PIN"; const NITROCLI_NEW_ADMIN_PIN: &str = "NITROCLI_NEW_ADMIN_PIN"; const NITROCLI_NEW_USER_PIN: &str = "NITROCLI_NEW_USER_PIN"; +const NITROCLI_PASSWORD: &str = "NITROCLI_PASSWORD"; /// The context used when running the program. pub(crate) struct RunCtx<'io> { @@ -121,6 +122,8 @@ pub(crate) struct RunCtx<'io> { /// /// This variable is only used by commands that change the user PIN. pub new_user_pin: Option<ffi::OsString>, + /// A password used by some commands, if provided through an environment variable. + pub password: Option<ffi::OsString>, } fn run<'ctx, 'io: 'ctx>(ctx: &'ctx mut RunCtx<'io>, args: Vec<String>) -> i32 { @@ -154,6 +157,7 @@ fn main() { user_pin: env::var_os(NITROCLI_USER_PIN), new_admin_pin: env::var_os(NITROCLI_NEW_ADMIN_PIN), new_user_pin: env::var_os(NITROCLI_NEW_USER_PIN), + password: env::var_os(NITROCLI_PASSWORD), }; let rc = run(ctx, args); |