/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: 2009-01-26 23:47:44 UTC
  • Revision ID: teddy@fukt.bsnet.se-20090126234744-c19lb7zn1qsrcwmv
* debian/control (mandos/Depends): Added "python-gobject".

Show diffs side-by-side

added added

removed removed

Lines of Context:
154
154
  
155
155
  
156
156
  /*
157
 
   * Helper function to insert pub and seckey to the engine keyring.
 
157
   * Helper function to insert pub and seckey to the enigne keyring.
158
158
   */
159
159
  bool import_key(const char *filename){
160
160
    int fd;
832
832
    gid_t gid;
833
833
    char *connect_to = NULL;
834
834
    char tempdir[] = "/tmp/mandosXXXXXX";
835
 
    bool tempdir_created = false;
836
835
    AvahiIfIndex if_index = AVAHI_IF_UNSPEC;
837
836
    const char *seckey = PATHDIR "/" SECKEY;
838
837
    const char *pubkey = PATHDIR "/" PUBKEY;
982
981
    
983
982
    if(mkdtemp(tempdir) == NULL){
984
983
      perror("mkdtemp");
 
984
      tempdir[0] = '\0';
985
985
      goto end;
986
986
    }
987
 
    tempdir_created = true;
988
987
    
989
988
    if(not init_gpgme(&mc, pubkey, seckey, tempdir)){
990
989
      fprintf(stderr, "init_gpgme failed\n");
997
996
    if_index = (AvahiIfIndex) if_nametoindex(interface);
998
997
    if(if_index == 0){
999
998
      fprintf(stderr, "No such interface: \"%s\"\n", interface);
1000
 
      exitcode = EXIT_FAILURE;
1001
 
      goto end;
 
999
      exit(EXIT_FAILURE);
1002
1000
    }
1003
1001
    
1004
1002
    if(connect_to != NULL){
1119
1117
    }
1120
1118
    
1121
1119
    /* Removes the temp directory used by GPGME */
1122
 
    if(tempdir_created){
 
1120
    if(tempdir[0] != '\0'){
1123
1121
      DIR *d;
1124
1122
      struct dirent *direntry;
1125
1123
      d = opendir(tempdir);