use temporary args_info for parsing if auth is needed
This commit is contained in:
@@ -951,6 +951,7 @@ out:
|
|||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
struct gengetopt_args_info args_info;
|
struct gengetopt_args_info args_info;
|
||||||
|
struct gengetopt_args_info args_info_tmp;
|
||||||
ykpiv_state *state;
|
ykpiv_state *state;
|
||||||
int verbosity;
|
int verbosity;
|
||||||
enum enum_action action;
|
enum enum_action action;
|
||||||
@@ -961,6 +962,8 @@ int main(int argc, char *argv[]) {
|
|||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
args_info_tmp = args_info;
|
||||||
|
|
||||||
verbosity = args_info.verbose_arg + (int)args_info.verbose_given;
|
verbosity = args_info.verbose_arg + (int)args_info.verbose_given;
|
||||||
|
|
||||||
if(ykpiv_init(&state, verbosity) != YKPIV_OK) {
|
if(ykpiv_init(&state, verbosity) != YKPIV_OK) {
|
||||||
@@ -973,9 +976,9 @@ int main(int argc, char *argv[]) {
|
|||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(i = 0; i < args_info.action_given; i++) {
|
for(i = 0; i < args_info_tmp.action_given; i++) {
|
||||||
bool needs_auth = false;
|
bool needs_auth = false;
|
||||||
action = *args_info.action_arg++;
|
action = *args_info_tmp.action_arg++;
|
||||||
switch(action) {
|
switch(action) {
|
||||||
case action_arg_generate:
|
case action_arg_generate:
|
||||||
case action_arg_setMINUS_mgmMINUS_key:
|
case action_arg_setMINUS_mgmMINUS_key:
|
||||||
|
|||||||
Reference in New Issue
Block a user