/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/mandos-client.c

  • Committer: Teddy Hogeborn
  • Date: 2016-02-28 15:11:35 UTC
  • mto: This revision was merged to the branch mainline in revision 809.
  • Revision ID: teddy@recompile.se-20160228151135-2c001gcl4cgtbbwt
Tags: version-1.7.2-1
* Makefile (version): Changed to "1.7.2".
* NEWS (Version 1.7.2): New entry.
* debian/changelog (1.7.2-1): - '' -
* debian/control (Package: mandos/Depends): Remove duplicate
  "python-dbus".

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
 * "browse_callback", and parts of "main".
10
10
 * 
11
11
 * Everything else is
12
 
 * Copyright © 2008-2015 Teddy Hogeborn
13
 
 * Copyright © 2008-2015 Björn Påhlsson
 
12
 * Copyright © 2008-2016 Teddy Hogeborn
 
13
 * Copyright © 2008-2016 Björn Påhlsson
14
14
 * 
15
15
 * This program is free software: you can redistribute it and/or
16
16
 * modify it under the terms of the GNU General Public License as
47
47
                                   strtof(), abort() */
48
48
#include <stdbool.h>            /* bool, false, true */
49
49
#include <string.h>             /* strcmp(), strlen(), strerror(),
50
 
                                   asprintf(), strcpy() */
 
50
                                   asprintf(), strncpy() */
51
51
#include <sys/ioctl.h>          /* ioctl */
52
52
#include <sys/types.h>          /* socket(), inet_pton(), sockaddr,
53
53
                                   sockaddr_in6, PF_INET6,
1223
1223
                    sizeof(struct sockaddr_in));
1224
1224
    }
1225
1225
    if(ret < 0){
1226
 
      if(errno == ENETUNREACH
 
1226
      if(((errno == ENETUNREACH) or (errno == EHOSTUNREACH))
1227
1227
         and if_index != AVAHI_IF_UNSPEC
1228
1228
         and connect_to == NULL
1229
1229
         and not route_added and
1637
1637
    errno = ret_errno;
1638
1638
    return false;
1639
1639
  }
1640
 
  strcpy(ifr->ifr_name, ifname);
 
1640
  strncpy(ifr->ifr_name, ifname, IF_NAMESIZE);
 
1641
  ifr->ifr_name[IF_NAMESIZE-1] = '\0'; /* NUL terminate */
1641
1642
  ret = ioctl(s, SIOCGIFFLAGS, ifr);
1642
1643
  if(ret == -1){
1643
1644
    if(debug){
2288
2289
 
2289
2290
int main(int argc, char *argv[]){
2290
2291
  mandos_context mc = { .server = NULL, .dh_bits = 0,
2291
 
                        .priority = "SECURE256:!CTYPE-X.509:"
2292
 
                        "+CTYPE-OPENPGP:!RSA", .current_server = NULL,
2293
 
                        .interfaces = NULL, .interfaces_size = 0 };
 
2292
                        .priority = "SECURE256:!CTYPE-X.509"
 
2293
                        ":+CTYPE-OPENPGP:!RSA:+SIGN-DSA-SHA256",
 
2294
                        .current_server = NULL, .interfaces = NULL,
 
2295
                        .interfaces_size = 0 };
2294
2296
  AvahiSServiceBrowser *sb = NULL;
2295
2297
  error_t ret_errno;
2296
2298
  int ret;