mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zkey: Make confirmation prompts more user friendly
Show '[y/N]' on all user confirmation prompts to give the user a hint what to reply. Also indicate that the operation was aborted on a negative confirmation. Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
94227b44d5
commit
139dff3525
+3
-1
@@ -3072,7 +3072,8 @@ static int _keystore_prompt_for_remove(struct keystore *keystore,
|
||||
_keystore_msg_for_volumes(msg, key_prop, VOLUME_TYPE_PLAIN);
|
||||
free(msg);
|
||||
|
||||
printf("%s: Remove key '%s'? ", program_invocation_short_name, name);
|
||||
printf("%s: Remove key '%s' [y/N]? ", program_invocation_short_name,
|
||||
name);
|
||||
if (fgets(str, sizeof(str), stdin) == NULL) {
|
||||
rc = -EIO;
|
||||
goto out;
|
||||
@@ -3081,6 +3082,7 @@ static int _keystore_prompt_for_remove(struct keystore *keystore,
|
||||
str[strlen(str) - 1] = '\0';
|
||||
pr_verbose(keystore, "Prompt reply: '%s'", str);
|
||||
if (strcasecmp(str, "y") != 0 && strcasecmp(str, "yes") != 0) {
|
||||
warnx("Operation aborted");
|
||||
rc = -ECANCELED;
|
||||
goto out;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user