/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-15 17:18:34 UTC
  • Revision ID: teddy@recompile.se-20120615171834-gzzgknth003j903u
* plugins.d/mandos-client.c (main): Bug fix: Set DEVICE environment
                                    variable correctly for network
                                    hooks.  Also, don't call
                                    run_network_hooks() with NULL
                                    value.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2021
2021
  
2022
2022
  /* Run network hooks */
2023
2023
  {
2024
 
    ret_errno = argz_append(&interfaces_hooks, &interfaces_hooks_size,
2025
 
                            interfaces, interfaces_size);
2026
 
    if(ret_errno != 0){
2027
 
      errno = ret_errno;
2028
 
      perror_plus("argz_append");
2029
 
      goto end;
 
2024
    
 
2025
    if(interfaces != NULL){
 
2026
      interfaces_hooks = malloc(interfaces_size);
 
2027
      if(interfaces_hooks == NULL){
 
2028
        perror_plus("malloc");
 
2029
        goto end;
 
2030
      }
 
2031
      memcpy(interfaces_hooks, interfaces, interfaces_size);
 
2032
      interfaces_hooks_size = interfaces_size;
 
2033
      argz_stringify(interfaces_hooks, interfaces_hooks_size,
 
2034
                     (int)',');
2030
2035
    }
2031
 
    argz_stringify(interfaces_hooks, interfaces_hooks_size, (int)',');
2032
 
    if(not run_network_hooks("start", interfaces_hooks, delay)){
 
2036
    if(not run_network_hooks("start", interfaces_hooks != NULL ?
 
2037
                             interfaces_hooks : "", delay)){
2033
2038
      goto end;
2034
2039
    }
2035
2040
  }
2390
2395
    raise_privileges();
2391
2396
    
2392
2397
    /* Run network hooks */
2393
 
    run_network_hooks("stop", interfaces_hooks, delay);
 
2398
    run_network_hooks("stop", interfaces_hooks != NULL ?
 
2399
                      interfaces_hooks : "", delay);
2394
2400
    
2395
2401
    /* Take down the network interfaces which were brought up */
2396
2402
    {