/mandos/release

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

« back to all changes in this revision

Viewing changes to plugins.d/mandos-client.c

  • Committer: Teddy Hogeborn
  • Date: 2015-07-20 00:06:05 UTC
  • mto: (237.7.594 trunk)
  • mto: This revision was merged to the branch mainline in revision 325.
  • Revision ID: teddy@recompile.se-20150720000605-244crrgqx254i3bs
Don't use TEMP_FAILURE_RETRY around close().

* plugin-runner.c: Don't use TEMP_FAILURE_RETRY around close().
* plugins.d/mandos-client.c: - '' -
* plugins.d/usplash.c: - '' -

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
                                   strtof(), abort() */
48
48
#include <stdbool.h>            /* bool, false, true */
49
49
#include <string.h>             /* strcmp(), strlen(), strerror(),
50
 
                                   asprintf(), strncpy() */
 
50
                                   asprintf(), strcpy() */
51
51
#include <sys/ioctl.h>          /* ioctl */
52
52
#include <sys/types.h>          /* socket(), inet_pton(), sockaddr,
53
53
                                   sockaddr_in6, PF_INET6,
954
954
                                                   helper, O_RDONLY));
955
955
    if(helper_fd == -1){
956
956
      perror_plus("openat");
957
 
      close(helperdir_fd);
958
957
      _exit(EX_UNAVAILABLE);
959
958
    }
960
959
    close(helperdir_fd);
1223
1222
                    sizeof(struct sockaddr_in));
1224
1223
    }
1225
1224
    if(ret < 0){
1226
 
      if(((errno == ENETUNREACH) or (errno == EHOSTUNREACH))
 
1225
      if(errno == ENETUNREACH
1227
1226
         and if_index != AVAHI_IF_UNSPEC
1228
1227
         and connect_to == NULL
1229
1228
         and not route_added and
1637
1636
    errno = ret_errno;
1638
1637
    return false;
1639
1638
  }
1640
 
  strncpy(ifr->ifr_name, ifname, IF_NAMESIZE);
1641
 
  ifr->ifr_name[IF_NAMESIZE-1] = '\0'; /* NUL terminate */
 
1639
  strcpy(ifr->ifr_name, ifname);
1642
1640
  ret = ioctl(s, SIOCGIFFLAGS, ifr);
1643
1641
  if(ret == -1){
1644
1642
    if(debug){
2289
2287
 
2290
2288
int main(int argc, char *argv[]){
2291
2289
  mandos_context mc = { .server = NULL, .dh_bits = 0,
2292
 
                        .priority = "SECURE256:!CTYPE-X.509"
2293
 
                        ":+CTYPE-OPENPGP:!RSA:+SIGN-DSA-SHA256",
2294
 
                        .current_server = NULL, .interfaces = NULL,
2295
 
                        .interfaces_size = 0 };
 
2290
                        .priority = "SECURE256:!CTYPE-X.509:"
 
2291
                        "+CTYPE-OPENPGP:!RSA", .current_server = NULL,
 
2292
                        .interfaces = NULL, .interfaces_size = 0 };
2296
2293
  AvahiSServiceBrowser *sb = NULL;
2297
2294
  error_t ret_errno;
2298
2295
  int ret;
2550
2547
        }
2551
2548
      }
2552
2549
      
2553
 
      if(dh_params_file != NULL
2554
 
         and strcmp(dh_params_file, PATHDIR "/dhparams.pem" ) == 0){
 
2550
      if(strcmp(dh_params_file, PATHDIR "/dhparams.pem" ) == 0){
2555
2551
        int dhparams_fd = open(dh_params_file, O_RDONLY);
2556
2552
        if(dhparams_fd == -1){
2557
2553
          perror_plus("open");