=== modified file 'initramfs-tools-hook' --- initramfs-tools-hook 2008-08-14 02:24:59 +0000 +++ initramfs-tools-hook 2008-08-24 23:18:18 +0000 @@ -93,10 +93,10 @@ cp --archive --sparse=always "$file" "${DESTDIR}${CONFDIR}" done # Create key ring files -gpg --no-random-seed-file --quiet --batch --no-tty \ - --no-default-keyring --no-options \ +gpg --no-random-seed-file --quiet --batch --no-tty --armor \ + --no-default-keyring --no-options --enable-dsa2 \ --homedir "${DESTDIR}${CONFDIR}" --no-permission-warning \ - --import-options import-minimal \ + --trust-model always --import-options import-minimal \ --import "${DESTDIR}${CONFDIR}/seckey.txt" chown nobody "${DESTDIR}${CONFDIR}/secring.gpg" === modified file 'plugin-runner.c' --- plugin-runner.c 2008-08-24 23:13:57 +0000 +++ plugin-runner.c 2008-08-24 23:40:11 +0000 @@ -56,7 +56,8 @@ #include /* struct argp_option, struct argp_state, struct argp, argp_parse(), ARGP_ERR_UNKNOWN, - ARGP_KEY_END, ARGP_KEY_ARG, error_t */ + ARGP_KEY_END, ARGP_KEY_ARG, + error_t */ #include /* struct sigaction, sigemptyset(), sigaddset(), sigaction(), sigprocmask(), SIG_BLOCK, SIGCHLD, @@ -78,8 +79,8 @@ size_t buffer_size; size_t buffer_length; bool eof; - bool completed; - int status; + volatile bool completed; + volatile int status; struct process *next; } process; @@ -199,23 +200,26 @@ process *process_list = NULL; -/* Mark processes as completed when it exits, and save its exit +/* Mark processes as completed when they exit, and save their exit status. */ void handle_sigchld(__attribute__((unused)) int sig){ - process *proc = process_list; while(true){ + process *proc = process_list; int status; pid_t pid = waitpid(-1, &status, WNOHANG); if(pid == 0){ + /* Only still running child processes */ break; } if(pid == -1){ if (errno != ECHILD){ perror("waitpid"); } - return; + /* No child processes */ + break; } + /* A child exited, find it in process_list */ while(proc != NULL and proc->pid != pid){ proc = proc->next; } @@ -843,7 +847,7 @@ /* Remove the plugin */ FD_CLR(proc->fd, &rfds_all); /* Block signal while modifying process_list */ - ret = sigprocmask (SIG_BLOCK, &sigchld_action.sa_mask, NULL); + ret = sigprocmask(SIG_BLOCK, &sigchld_action.sa_mask, NULL); if(ret < 0){ perror("sigprocmask"); exitstatus = EXIT_FAILURE; @@ -877,7 +881,8 @@ } /* This process exited nicely, so print its buffer */ - bool bret = print_out_password(proc->buffer, proc->buffer_length); + bool bret = print_out_password(proc->buffer, + proc->buffer_length); if(not bret){ perror("print_out_password"); exitstatus = EXIT_FAILURE; @@ -920,7 +925,8 @@ fallback: if(process_list == NULL or exitstatus != EXIT_SUCCESS){ - /* Fallback if all plugins failed, none are found or an error occured */ + /* Fallback if all plugins failed, none are found or an error + occured */ bool bret; fprintf(stderr, "Going to fallback mode using getpass(3)\n"); char *passwordbuffer = getpass("Password: ");