/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-01-10 02:39:56 UTC
  • mfrom: (257.1.2 mandos)
  • Revision ID: teddy@fukt.bsnet.se-20090110023956-o7f5r8af28fmgahw
Fixed warnings on AMD64, thanks to Mooie <mooie@cow.se> for the patch.

* plugins.d/askpass-fifo.c (main): Cast value from TEMP_FAILURE_RETRY
                                   to int, the value the inner
                                   function returns.
* plugins.d/mandos-client.c (init_gpgme): - '' -
  (start_mandos_communication): New variable "ssize_t sret"; used to
                                store return value from
                                "gnutls_record_recv".  Also cast value
                                from TEMP_FAILURE_RETRY as above.
* plugins.d/usplash.c (usplash_write): New variable "ssize_t sret";
                                       used to store return value from
                                       "write".

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
/*
3
3
 * Mandos plugin runner - Run Mandos plugins
4
4
 *
5
 
 * Copyright © 2008 Teddy Hogeborn & Björn Påhlsson
 
5
 * Copyright © 2008,2009 Teddy Hogeborn
 
6
 * Copyright © 2008,2009 Björn Påhlsson
6
7
 * 
7
8
 * This program is free software: you can redistribute it and/or
8
9
 * modify it under the terms of the GNU General Public License as
308
309
  struct stat st;
309
310
  fd_set rfds_all;
310
311
  int ret, maxfd = 0;
 
312
  ssize_t sret;
311
313
  uid_t uid = 65534;
312
314
  gid_t gid = 65534;
313
315
  bool debug = false;
545
547
    char *org_line = NULL;
546
548
    char *p, *arg, *new_arg, *line;
547
549
    size_t size = 0;
548
 
    ssize_t sret;
549
550
    const char whitespace_delims[] = " \r\t\f\v\n";
550
551
    const char comment_delim[] = "#";
551
552
 
700
701
      
701
702
      const char const *bad_suffixes[] = { "~", "#", ".dpkg-new",
702
703
                                           ".dpkg-old",
 
704
                                           ".dpkg-bak",
703
705
                                           ".dpkg-divert", NULL };
704
706
      for(const char **pre = bad_prefixes; *pre != NULL; pre++){
705
707
        size_t pre_len = strlen(*pre);
1017
1019
        proc->buffer_size += BUFFER_SIZE;
1018
1020
      }
1019
1021
      /* Read from the process */
1020
 
      ret = read(proc->fd, proc->buffer + proc->buffer_length,
1021
 
                 BUFFER_SIZE);
1022
 
      if(ret < 0){
 
1022
      sret = read(proc->fd, proc->buffer + proc->buffer_length,
 
1023
                  BUFFER_SIZE);
 
1024
      if(sret < 0){
1023
1025
        /* Read error from this process; ignore the error */
1024
1026
        proc = proc->next;
1025
1027
        continue;
1026
1028
      }
1027
 
      if(ret == 0){
 
1029
      if(sret == 0){
1028
1030
        /* got EOF */
1029
1031
        proc->eof = true;
1030
1032
      } else {
1031
 
        proc->buffer_length += (size_t) ret;
 
1033
        proc->buffer_length += (size_t) sret;
1032
1034
      }
1033
1035
    }
1034
1036
  }