/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-03-17 18:28:22 UTC
  • Revision ID: teddy@fukt.bsnet.se-20110317182822-miiq4c3eaexy0yo4
* plugins.d/askpass-fifo.c (main): Don't print message if FIFO exists.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1032
1032
int good_interface(const struct dirent *if_entry){
1033
1033
  ssize_t ssret;
1034
1034
  char *flagname = NULL;
1035
 
  if(if_entry->d_name[0] == '.'){
1036
 
    return 0;
1037
 
  }
1038
1035
  int ret = asprintf(&flagname, "%s/%s/flags", sys_class_net,
1039
1036
                     if_entry->d_name);
1040
1037
  if(ret < 0){
1041
1038
    perror("asprintf");
1042
1039
    return 0;
1043
1040
  }
 
1041
  if(if_entry->d_name[0] == '.'){
 
1042
    return 0;
 
1043
  }
1044
1044
  int flags_fd = (int)TEMP_FAILURE_RETRY(open(flagname, O_RDONLY));
1045
1045
  if(flags_fd == -1){
1046
1046
    perror("open");
1047
 
    free(flagname);
1048
1047
    return 0;
1049
1048
  }
1050
 
  free(flagname);
1051
1049
  typedef short ifreq_flags;    /* ifreq.ifr_flags in netdevice(7) */
1052
1050
  /* read line from flags_fd */
1053
1051
  ssize_t to_read = (sizeof(ifreq_flags)*2)+3; /* "0x1003\n" */
1113
1111
    }
1114
1112
    return 0;
1115
1113
  }
1116
 
  /* Reject non-ARP interfaces (including dummy interfaces) */
1117
 
  if(flags & IFF_NOARP){
1118
 
    if(debug){
1119
 
      fprintf(stderr, "Rejecting non-ARP interface \"%s\"\n",
1120
 
              if_entry->d_name);
1121
 
    }
1122
 
    return 0;
1123
 
  }
1124
1114
  /* Accept this device */
1125
1115
  if(debug){
1126
1116
    fprintf(stderr, "Interface \"%s\" is acceptable\n",