=== modified file 'TODO' --- TODO 2008-08-11 16:09:41 +0000 +++ TODO 2008-08-11 16:35:32 +0000 @@ -25,7 +25,6 @@ Text needed *** SEE ALSO Explaining test on what you can read -** [#A] Fallback on error ** Use asprintf instead of malloc and strcat? ** use strsep instead of strtok? ** use config file in addition to arguments === modified file 'mandos-client.c' --- mandos-client.c 2008-08-11 07:41:40 +0000 +++ mandos-client.c 2008-08-11 16:35:32 +0000 @@ -202,6 +202,8 @@ .sa_flags = SA_NOCLDSTOP }; char *plus_options = NULL; char **plus_argv = NULL; + + errno = 0; /* Establish a signal handler */ sigemptyset(&sigchld_action.sa_mask); @@ -708,8 +710,12 @@ } } } + + + end: - if(process_list == NULL){ + if(process_list == NULL or exitstatus != EXIT_SUCCESS){ + /* Fallback if all plugins failed or an error occured */ bool bret; fprintf(stderr, "Going to fallback mode using getpass(3)\n"); char *passwordbuffer = getpass("Password: "); @@ -720,8 +726,6 @@ goto end; } } - - end: /* Restore old signal handler */ sigaction(SIGCHLD, &old_sigchld_action, NULL); === modified file 'plugins.d/password-request.c' --- plugins.d/password-request.c 2008-08-11 16:07:39 +0000 +++ plugins.d/password-request.c 2008-08-11 16:35:32 +0000 @@ -881,12 +881,14 @@ seckeyfile = combinepath(keydir, seckeyfile); if (seckeyfile == NULL){ perror("combinepath"); + exitcode = EXIT_FAILURE; goto end; } ret = init_gnutls_global(&mc, pubkeyfile, seckeyfile); if (ret == -1){ - fprintf(stderr, "init_gnutls_global\n"); + fprintf(stderr, "init_gnutls_global failed\n"); + exitcode = EXIT_FAILURE; goto end; } else { gnutls_initalized = true;