/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to plugins.d/passprompt.c

  • Committer: Teddy Hogeborn
  • Date: 2008-08-02 10:48:24 UTC
  • Revision ID: teddy@fukt.bsnet.se-20080802104824-fx0miwp9o4g9r31e
* plugbasedclient.c (struct process): New fields "eof", "completed",
                                      and "status".
  (handle_sigchld): New function.
  (main): Initialize "dir" to NULL to only closedir() it if necessary.
          Move "process_list" to be a global variable to be accessible
          by "handle_sigchld".  Make "handle_sigchld" handle SIGCHLD.
          Remove redundant check for NULL "dir".  Free "filename" when
          no longer used.  Block SIGCHLD around fork()/exec().
          Restore normal signals in child.  Only loop while running
          processes exist.  Print process buffer when the process is
          done and it has emitted EOF, not when it only emits EOF.
          Remove processes from list which exit non-cleanly.  In
          cleaning up, closedir() if necessary.  Bug fix: set next
          pointer correctly when freeing process list.

* plugins.d/passprompt.c (main): Do not ignore SIGQUIT.

Show diffs side-by-side

added added

removed removed

Lines of Context:
102
102
  
103
103
  sigemptyset(&new_action.sa_mask);
104
104
  sigaddset(&new_action.sa_mask, SIGINT);
105
 
  sigaddset(&new_action.sa_mask, SIGQUIT);
106
105
  sigaddset(&new_action.sa_mask, SIGHUP);
107
106
  sigaddset(&new_action.sa_mask, SIGTERM);
108
107
  sigaction(SIGINT, NULL, &old_action);
109
108
  if (old_action.sa_handler != SIG_IGN)
110
109
    sigaction(SIGINT, &new_action, NULL);
111
 
  sigaction(SIGQUIT, NULL, &old_action);
112
 
  if (old_action.sa_handler != SIG_IGN)
113
 
    sigaction(SIGQUIT, &new_action, NULL);
114
110
  sigaction(SIGHUP, NULL, &old_action);
115
111
  if (old_action.sa_handler != SIG_IGN)
116
112
    sigaction(SIGHUP, &new_action, NULL);