/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: 2008-12-29 02:44:54 UTC
  • Revision ID: teddy@fukt.bsnet.se-20081229024454-nbsei556dwy5azr1
* mandos (Client.timeout, Client.interval): Changed from being a
                                            property to be a normal
                                            attribute.
  (Client._timeout, Client._interval): Removed.
  (Client._timeout_milliseconds): Changed from being an attribute to
                                  be a method "timeout_milliseconds".
                                  All users changed.
  (Client._interval_milliseconds): Changed from being an attribute to
                                   be method "interval_milliseconds".
                                   All users changed.
  (Client.__init__): Take additional "use_dbus" keyword argument.
                     Only provide D-Bus interface if "use_dbus" is
                     True.
  (Client.use_dbus): New attribute.
  (Client.dbus_object_path): Changed to only be set if "self.use_dbus"
                             is True.
  (Client.enable, Client.disable, Client.checker_callback,
  Client.bump_timeout, Client.start_checker, Client.stop_checker):
  Only emit D-Bus signals if "self.use_dbus".
  (Client.SetChecker, Client.SetHost, Client.Enable): Bug fix: Emit
                                                      D-Bus signals.
  (Client.SetInterval, Client.SetTimeout): Changed to emit D-Bus
                                           signals.

  (main): Remove deprecated "default" keyword argument to "--check"
          option.  Added new "--no-dbus" option.  Added corresponding
          "use_dbus" server configuration option.  Only provide D-Bus
          interface and emit D-Bus signals if "use_dbus".  Pass
          "use_dbus" on to Client constructor.

* mandos-options.xml ([@id="dbus"]): New option.

* mandos.conf (use_dbus): New option.

* mandos.conf.xml (OPTIONS): New option "use_dbus".
  (EXAMPLE): - '' -

* mandos.xml (SYNOPSIS): New option "--no-dbus".
  (D-BUS INTERFACE): New section.

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 © 2007-2008 Teddy Hogeborn & Björn Påhlsson
 
12
 * Copyright © 2008 Teddy Hogeborn
 
13
 * Copyright © 2008 Björn Påhlsson
13
14
 * 
14
15
 * This program is free software: you can redistribute it and/or
15
16
 * modify it under the terms of the GNU General Public License as
101
102
 
102
103
#define BUFFER_SIZE 256
103
104
 
104
 
/*
105
 
  #define PATHDIR "/conf/conf.d/mandos"
106
 
*/
107
 
 
108
105
#define PATHDIR "/conf/conf.d/mandos"
109
106
#define SECKEY "seckey.txt"
110
107
#define PUBKEY "pubkey.txt"
111
108
 
112
109
bool debug = false;
113
110
static const char mandos_protocol_version[] = "1";
114
 
const char *argp_program_version = "mandos-client 1.0";
 
111
const char *argp_program_version = "mandos-client " VERSION;
115
112
const char *argp_program_bug_address = "<mandos@fukt.bsnet.se>";
116
113
 
117
114
/* Used for passing in values through the Avahi callback functions */
315
312
  
316
313
  /* Seek back to the beginning of the GPGME plaintext data buffer */
317
314
  if (gpgme_data_seek(dh_plain, (off_t) 0, SEEK_SET) == -1){
318
 
    perror("pgpme_data_seek");
 
315
    perror("gpgme_data_seek");
319
316
    plaintext_length = -1;
320
317
    goto decrypt_end;
321
318
  }
451
448
  
452
449
  gnutls_certificate_free_credentials(mc->cred);
453
450
  gnutls_global_deinit();
 
451
  gnutls_dh_params_deinit(mc->dh_params);
454
452
  return -1;
455
453
}
456
454
 
830
828
                          .dh_bits = 1024, .priority = "SECURE256"
831
829
                          ":!CTYPE-X.509:+CTYPE-OPENPGP" };
832
830
    bool gnutls_initalized = false;
833
 
    bool pgpme_initalized = false;
 
831
    bool gpgme_initalized = false;
834
832
    
835
833
    {
836
834
      struct argp_option options[] = {
977
975
    }
978
976
    
979
977
    if(not init_gpgme(&mc, pubkey, seckey, tempdir)){
980
 
      fprintf(stderr, "pgpme_initalized failed\n");
 
978
      fprintf(stderr, "gpgme_initalized failed\n");
981
979
      exitcode = EXIT_FAILURE;
982
980
      goto end;
983
981
    } else {
984
 
      pgpme_initalized = true;
 
982
      gpgme_initalized = true;
985
983
    }
986
984
    
987
985
    if_index = (AvahiIfIndex) if_nametoindex(interface);
1098
1096
    if (gnutls_initalized){
1099
1097
      gnutls_certificate_free_credentials(mc.cred);
1100
1098
      gnutls_global_deinit ();
 
1099
      gnutls_dh_params_deinit(mc.dh_params);
1101
1100
    }
1102
1101
    
1103
 
    if(pgpme_initalized){
 
1102
    if(gpgme_initalized){
1104
1103
      gpgme_release(mc.ctx);
1105
1104
    }
1106
1105
    
1133
1132
            free(fullname);
1134
1133
          }
1135
1134
        }
 
1135
        closedir(d);
1136
1136
      }
1137
1137
      ret = rmdir(tempdir);
1138
1138
      if(ret == -1){