/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: 2011-07-13 01:11:12 UTC
  • Revision ID: teddy@fukt.bsnet.se-20110713011112-bgf3tenqq60uoyyb
* Makefile (plugins.d/mandos-client): Bug fix: Put $^ before all
                                      libraries.  Remove "$(COMMON)".
                                      Thanks to Angel Abad
                                      <angelabad@ubuntu.com>.
* initramfs-tools-script: Work around change in initramfs-tools,
                          Debian bug #633582.
* plugins.d/mandos-client.c (init_gnutls_global): Bug fix: check for
                errors from gnutls_certificate_allocate_credentials().

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
#include <unistd.h>             /* close(), SEEK_SET, off_t, write(),
74
74
                                   getuid(), getgid(), seteuid(),
75
75
                                   setgid(), pause() */
76
 
#include <arpa/inet.h>          /* inet_pton(), htons */
 
76
#include <arpa/inet.h>          /* inet_pton(), htons, inet_ntop() */
77
77
#include <iso646.h>             /* not, or, and */
78
78
#include <argp.h>               /* struct argp_option, error_t, struct
79
79
                                   argp_state, struct argp,
423
423
  }
424
424
  
425
425
  /* OpenPGP credentials */
426
 
  gnutls_certificate_allocate_credentials(&mc.cred);
 
426
  ret = gnutls_certificate_allocate_credentials(&mc.cred);
427
427
  if(ret != GNUTLS_E_SUCCESS){
428
 
    fprintf(stderr, "GnuTLS memory error: %s\n", /* Spurious warning
429
 
                                                    from
430
 
                                                    -Wunreachable-code
431
 
                                                 */
 
428
    fprintf(stderr, "GnuTLS memory error: %s\n",
432
429
            safer_gnutls_strerror(ret));
433
430
    gnutls_global_deinit();
434
431
    return -1;
1050
1047
  free(flagname);
1051
1048
  typedef short ifreq_flags;    /* ifreq.ifr_flags in netdevice(7) */
1052
1049
  /* read line from flags_fd */
1053
 
  ssize_t to_read = (sizeof(ifreq_flags)*2)+3; /* "0x1003\n" */
 
1050
  ssize_t to_read = 2+(sizeof(ifreq_flags)*2)+1; /* "0x1003\n" */
1054
1051
  char *flagstring = malloc((size_t)to_read+1); /* +1 for final \0 */
1055
1052
  flagstring[(size_t)to_read] = '\0';
1056
1053
  if(flagstring == NULL){