/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

* plugins.d/mandos-client.c (pgp_packet_decrypt): Remove redundant
                                                 "if" statement.

Show diffs side-by-side

added added

removed removed

Lines of Context:
899
899
  int exitcode = EXIT_SUCCESS;
900
900
  const char *interface = "eth0";
901
901
  struct ifreq network;
902
 
  int sd = -1;
903
 
  bool interface_taken_up = false;
 
902
  int sd;
904
903
  uid_t uid;
905
904
  gid_t gid;
906
905
  char *connect_to = NULL;
1114
1113
#endif  /* __linux__ */
1115
1114
        goto end;
1116
1115
      }
1117
 
      interface_taken_up = true;
1118
1116
    }
1119
1117
    /* sleep checking until interface is running */
1120
1118
    for(int i=0; i < delay * 4; i++){
1130
1128
        perror("nanosleep");
1131
1129
      }
1132
1130
    }
1133
 
    if(not interface_taken_up){
1134
 
      ret = (int)TEMP_FAILURE_RETRY(close(sd));
1135
 
      if(ret == -1){
1136
 
        perror("close");
1137
 
      }
 
1131
    ret = (int)TEMP_FAILURE_RETRY(close(sd));
 
1132
    if(ret == -1){
 
1133
      perror("close");
1138
1134
    }
1139
1135
#ifdef __linux__
1140
1136
    if(restore_loglevel){
1301
1297
    gpgme_release(mc.ctx);
1302
1298
  }
1303
1299
  
1304
 
  /* Take down the network interface */
1305
 
  if(interface_taken_up){
1306
 
    ret = ioctl(sd, SIOCGIFFLAGS, &network);
1307
 
    if(ret == -1){
1308
 
      perror("ioctl SIOCGIFFLAGS");
1309
 
    } else if(network.ifr_flags & IFF_UP) {
1310
 
      network.ifr_flags &= ~IFF_UP; /* clear flag */
1311
 
      ret = ioctl(sd, SIOCSIFFLAGS, &network);
1312
 
      if(ret == -1){
1313
 
        perror("ioctl SIOCSIFFLAGS");
1314
 
      }
1315
 
    }
1316
 
    ret = (int)TEMP_FAILURE_RETRY(close(sd));
1317
 
    if(ret == -1){
1318
 
      perror("close");
1319
 
    }
1320
 
  }
1321
 
  
1322
1300
  /* Removes the temp directory used by GPGME */
1323
1301
  if(tempdir_created){
1324
1302
    DIR *d;