2
0

Support for passing the master password non-interactively for testing.

This commit is contained in:
Maarten Billemont 2015-01-19 21:20:25 -05:00
parent b34f7377da
commit d5ff215da2

View File

@ -112,11 +112,16 @@ int main(int argc, char *const argv[]) {
ftl( "Invalid %s: %s\n", MP_env_algorithm, algorithmVersionString ); ftl( "Invalid %s: %s\n", MP_env_algorithm, algorithmVersionString );
// Read the options. // Read the options.
for (int opt; (opt = getopt( argc, argv, "u:t:c:v:V:C:h" )) != -1;) for (int opt; (opt = getopt( argc, argv, "u:P:t:c:v:V:C:h" )) != -1;)
switch (opt) { switch (opt) {
case 'u': case 'u':
fullName = optarg; fullName = optarg;
break; break;
case 'P':
// Do not use this. Passing your master password via the command-line
// is insecure. This is here for non-interactive testing purposes only.
masterPassword = strcpy( malloc( strlen( optarg ) + 1 ), optarg );
break;
case 't': case 't':
siteTypeString = optarg; siteTypeString = optarg;
break; break;