/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: 2012-06-17 02:30:59 UTC
  • Revision ID: teddy@recompile.se-20120617023059-em4nfnxg1tsn64xj
* plugins.d/mandos-client (start_mandos_communication): Bug fix; skip
                                                        non-specified
                                                        interfaces.
  (main): Use lower_privileges() consistently.  Bug fix: Don't remove
          "none" from list of interfaces.  Make --interface=none work
          again by not bringing up interfaces specified after "none".
* plugins.d/mandos-client.xml (OPTIONS): Document new meaning of
                                         specifying --interface=none
                                         together with other
                                         interface names,

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 © 2008-2013 Teddy Hogeborn
13
 
 * Copyright © 2008-2013 Björn Påhlsson
 
12
 * Copyright © 2008-2012 Teddy Hogeborn
 
13
 * Copyright © 2008-2012 Björn Påhlsson
14
14
 * 
15
15
 * This program is free software: you can redistribute it and/or
16
16
 * modify it under the terms of the GNU General Public License as
187
187
  
188
188
  TEMP_FAILURE_RETRY(fprintf(stream, "Mandos plugin %s: ",
189
189
                             program_invocation_short_name));
190
 
  return (int)TEMP_FAILURE_RETRY(vfprintf(stream, format, ap));
 
190
  return TEMP_FAILURE_RETRY(vfprintf(stream, format, ap));
191
191
}
192
192
 
193
193
/*
659
659
    return -1;
660
660
  }
661
661
  
662
 
  /* If the interface is specified and we have a list of interfaces */
663
662
  if(if_index != AVAHI_IF_UNSPEC and mc->interfaces != NULL){
664
663
    /* Check if the interface is one of the interfaces we are using */
665
664
    bool match = false;
674
673
      }
675
674
    }
676
675
    if(not match){
677
 
      /* This interface does not match any in the list, so we don't
678
 
         connect to the server */
679
676
      if(debug){
680
677
        char interface[IF_NAMESIZE];
681
678
        if(if_indextoname((unsigned int)if_index, interface) == NULL){
2184
2181
    }
2185
2182
  }
2186
2183
  
2187
 
  /* Bring up interfaces which are down, and remove any "none"s */
 
2184
  /* Bring up interfaces which are down */
2188
2185
  {
2189
2186
    char *interface = NULL;
2190
2187
    while((interface = argz_next(mc.interfaces, mc.interfaces_size,
2331
2328
        fprintf_plus(stderr, "Retrying in %d seconds\n",
2332
2329
                     (int)retry_interval);
2333
2330
      }
2334
 
      sleep((unsigned int)retry_interval);
 
2331
      sleep((int)retry_interval);
2335
2332
    }
2336
2333
    
2337
2334
    if (not quit_now){