/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 plugin-runner.c

  • Committer: Teddy Hogeborn
  • Date: 2009-09-16 23:28:39 UTC
  • Revision ID: teddy@fukt.bsnet.se-20090916232839-3o7i8qmcdcz5j1ya
* init.d-mandos (Required-Start, Required-Stop): Bug fix: Added
                 "$syslog", thanks to Petter Reinholdtsen
                 <pere@hungry.com> (Debian bug #546928).

* initramfs-tools-script: Removed erroneous comment.

* plugins.d/askpass-fifo.c: Removed TEMP_FAILURE_RETRY since it is
                            not needed.

* plugins.d/mandos-client.c (main): Bug fix: Initialize
                                    "old_sigterm_action".

* plugins.d/splashy.c (main): Bug fix: really check return value from
                              "sigaddset".  Fix some warnings on
                              64-bit systems.

* plugins.d/usplash.c (termination_handler, main): Save received
                                                   signal and
                                                   re-raise it on
                                                   exit.
  (usplash_write): Do not close FIFO, instead, take an additional file
                   descriptor pointer to it and open only when needed
                   (all callers changed).  Abort immediately on EINTR.
                   Bug fix:  Add NUL byte on single-word commands.
                   Ignore "interrupted_by_signal".
  (makeprompt, find_usplash): New; broken out from "main()".
  (find_usplash): Bug fix: close /proc/<pid>/cmdline FD on error.
  (main): Reorganized to jump to a new "failure" label on any error.
          Bug fix: check return values from sigaddset.
          New variable "usplash_accessed" to flag if usplash(8) needs
          to be killed and restarted.  Removed the "an_error_occured"
          variable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
#include <fcntl.h>              /* fcntl(), F_GETFD, F_SETFD,
55
55
                                   FD_CLOEXEC */
56
56
#include <string.h>             /* strsep, strlen(), asprintf(),
57
 
                                   strsignal(), strcmp(), strncmp() */
 
57
                                   strsignal() */
58
58
#include <errno.h>              /* errno */
59
59
#include <argp.h>               /* struct argp_option, struct
60
60
                                   argp_state, struct argp,
771
771
      for(const char **suf = bad_suffixes; *suf != NULL; suf++){
772
772
        size_t suf_len = strlen(*suf);
773
773
        if((d_name_len >= suf_len)
774
 
           and (strcmp((dirst->d_name) + d_name_len-suf_len, *suf)
 
774
           and (strcmp((dirst->d_name)+d_name_len-suf_len, *suf)
775
775
                == 0)){
776
776
          if(debug){
777
777
            fprintf(stderr, "Ignoring plugin dir entry \"%s\""
968
968
      goto fallback;
969
969
    }
970
970
    
971
 
    FD_SET(new_plugin->fd, &rfds_all); /* Spurious warning from
972
 
                                          -Wconversion */
 
971
    FD_SET(new_plugin->fd, &rfds_all);
973
972
    
974
973
    if(maxfd < new_plugin->fd){
975
974
      maxfd = new_plugin->fd;
1029
1028
          }
1030
1029
          
1031
1030
          /* Remove the plugin */
1032
 
          FD_CLR(proc->fd, &rfds_all); /* Spurious warning from
1033
 
                                          -Wconversion */
 
1031
          FD_CLR(proc->fd, &rfds_all);
1034
1032
          
1035
1033
          /* Block signal while modifying process_list */
1036
1034
          ret = (int)TEMP_FAILURE_RETRY(sigprocmask
1076
1074
      }
1077
1075
      
1078
1076
      /* This process has not completed.  Does it have any output? */
1079
 
      if(proc->eof or not FD_ISSET(proc->fd, &rfds)){ /* Spurious
1080
 
                                                         warning from
1081
 
                                                         -Wconversion */
 
1077
      if(proc->eof or not FD_ISSET(proc->fd, &rfds)){
1082
1078
        /* This process had nothing to say at this time */
1083
1079
        proc = proc->next;
1084
1080
        continue;