/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: 2016-02-28 14:22:10 UTC
  • mto: (237.7.594 trunk)
  • mto: This revision was merged to the branch mainline in revision 331.
  • Revision ID: teddy@recompile.se-20160228142210-2df89dih7mzxxr0h
Update copyright year.

* DBUS-API: Update copyright year.
* debian/copyright: - '' -
* intro.xml (COPYRIGHT): - '' -
* mandos: - '' -
* mandos-clients.conf.xml (COPYRIGHT): - '' -
* mandos-ctl: - '' -
* mandos-ctl.xml (COPYRIGHT): - '' -
* mandos-keygen: - '' -
* mandos-keygen.xml (COPYRIGHT): - '' -
* mandos-monitor: - '' -
* mandos-monitor.xml (COPYRIGHT): - '' -
* mandos.conf.xml (COPYRIGHT): - '' -
* mandos.xml (COPYRIGHT): - '' -
* plugin-helpers/mandos-client-iprouteadddel.c: - '' -
* plugin-runner.c: - '' -
* plugin-runner.xml (COPYRIGHT): - '' -
* plugins.d/askpass-fifo.c: - '' -
* plugins.d/askpass-fifo.xml (COPYRIGHT): - '' -
* plugins.d/mandos-client.c: - '' -
* plugins.d/mandos-client.xml (COPYRIGHT): - '' -
* plugins.d/password-prompt.c: - '' -
* plugins.d/password-prompt.xml (COPYRIGHT): - ''
* plugins.d/plymouth.c: - '' -
* plugins.d/plymouth.xml (COPYRIGHT): - '' -
* plugins.d/splashy.c: - '' -
* plugins.d/splashy.xml (COPYRIGHT): - '' -
* plugins.d/usplash.c: - '' -
* plugins.d/usplash.xml (COPYRIGHT): - '' -

Show diffs side-by-side

added added

removed removed

Lines of Context:
513
513
  fprintf_plus(stderr, "GnuTLS: %s", string);
514
514
}
515
515
 
516
 
__attribute__((nonnull(1, 2, 4), warn_unused_result))
 
516
__attribute__((nonnull, warn_unused_result))
517
517
static int init_gnutls_global(const char *pubkeyfilename,
518
518
                              const char *seckeyfilename,
519
519
                              const char *dhparamsfilename,
525
525
    fprintf_plus(stderr, "Initializing GnuTLS\n");
526
526
  }
527
527
  
 
528
  ret = gnutls_global_init();
 
529
  if(ret != GNUTLS_E_SUCCESS){
 
530
    fprintf_plus(stderr, "GnuTLS global_init: %s\n",
 
531
                 safer_gnutls_strerror(ret));
 
532
    return -1;
 
533
  }
 
534
  
528
535
  if(debug){
529
536
    /* "Use a log level over 10 to enable all debugging options."
530
537
     * - GnuTLS manual
538
545
  if(ret != GNUTLS_E_SUCCESS){
539
546
    fprintf_plus(stderr, "GnuTLS memory error: %s\n",
540
547
                 safer_gnutls_strerror(ret));
 
548
    gnutls_global_deinit();
541
549
    return -1;
542
550
  }
543
551
  
747
755
 globalfail:
748
756
  
749
757
  gnutls_certificate_free_credentials(mc->cred);
 
758
  gnutls_global_deinit();
750
759
  gnutls_dh_params_deinit(mc->dh_params);
751
760
  return -1;
752
761
}
1905
1914
      return;
1906
1915
    }
1907
1916
  }
 
1917
#ifdef __GLIBC__
 
1918
#if __GLIBC_PREREQ(2, 15)
1908
1919
  int numhooks = scandirat(hookdir_fd, ".", &direntries,
1909
1920
                           runnable_hook, alphasort);
 
1921
#else  /* not __GLIBC_PREREQ(2, 15) */
 
1922
  int numhooks = scandir(hookdir, &direntries, runnable_hook,
 
1923
                         alphasort);
 
1924
#endif  /* not __GLIBC_PREREQ(2, 15) */
 
1925
#else   /* not __GLIBC__ */
 
1926
  int numhooks = scandir(hookdir, &direntries, runnable_hook,
 
1927
                         alphasort);
 
1928
#endif  /* not __GLIBC__ */
1910
1929
  if(numhooks == -1){
1911
1930
    perror_plus("scandir");
1912
1931
    return;
2957
2976
  
2958
2977
  if(gnutls_initialized){
2959
2978
    gnutls_certificate_free_credentials(mc.cred);
 
2979
    gnutls_global_deinit();
2960
2980
    gnutls_dh_params_deinit(mc.dh_params);
2961
2981
  }
2962
2982
  
3034
3054
    if(tempdir_fd == -1){
3035
3055
      perror_plus("open");
3036
3056
    } else {
 
3057
#ifdef __GLIBC__
 
3058
#if __GLIBC_PREREQ(2, 15)
3037
3059
      int numentries = scandirat(tempdir_fd, ".", &direntries,
3038
3060
                                 notdotentries, alphasort);
 
3061
#else  /* not __GLIBC_PREREQ(2, 15) */
 
3062
      int numentries = scandir(tempdir, &direntries, notdotentries,
 
3063
                               alphasort);
 
3064
#endif  /* not __GLIBC_PREREQ(2, 15) */
 
3065
#else   /* not __GLIBC__ */
 
3066
      int numentries = scandir(tempdir, &direntries, notdotentries,
 
3067
                               alphasort);
 
3068
#endif  /* not __GLIBC__ */
3039
3069
      if(numentries >= 0){
3040
3070
        for(int i = 0; i < numentries; i++){
3041
3071
          ret = unlinkat(tempdir_fd, direntries[i]->d_name, 0);