Improve scripting in mu pop shell.
* mu/pop.c (com_apop, com_pass): Require password in non-interactive mode.
Showing
1 changed file
with
10 additions
and
0 deletions
... | @@ -308,6 +308,11 @@ com_apop (int argc, char **argv) | ... | @@ -308,6 +308,11 @@ com_apop (int argc, char **argv) |
308 | 308 | ||
309 | if (argc == 3) | 309 | if (argc == 3) |
310 | pwd = argv[2]; | 310 | pwd = argv[2]; |
311 | else if (!mutool_shell_interactive) | ||
312 | { | ||
313 | mu_error (_("apop: password required")); | ||
314 | return 1; | ||
315 | } | ||
311 | else | 316 | else |
312 | { | 317 | { |
313 | status = mu_getpass (mustrin, mustrout, "Password:", &passbuf); | 318 | status = mu_getpass (mustrin, mustrout, "Password:", &passbuf); |
... | @@ -474,6 +479,11 @@ com_pass (int argc, char **argv) | ... | @@ -474,6 +479,11 @@ com_pass (int argc, char **argv) |
474 | 479 | ||
475 | if (argc == 1) | 480 | if (argc == 1) |
476 | { | 481 | { |
482 | if (!mutool_shell_interactive) | ||
483 | { | ||
484 | mu_error (_("pass: password required")); | ||
485 | return 1; | ||
486 | } | ||
477 | status = mu_getpass (mustrin, mustrout, "Password:", &passbuf); | 487 | status = mu_getpass (mustrin, mustrout, "Password:", &passbuf); |
478 | if (status) | 488 | if (status) |
479 | return status; | 489 | return status; | ... | ... |
-
Please register or sign in to post a comment