/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

* Makefile (run-client): Add "--network-hook-dir" option.
* plugin-runner.c (main): Only try to work around Debian bug #633582
                          if started as root.
* plugins.d/mandos-client.c (run_network_hooks): Bug fix: Run all
                                                 network hooks, not
                                                 just the first one.
                                                 Also add debug output.
  (main): Only try to work around Debian bug #633582 or run network
          hooks as root if started as root.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1301
1301
    }
1302
1302
    return 0;
1303
1303
  }
1304
 
  if(debug){
1305
 
    fprintf_plus(stderr, "Hook \"%s\" is acceptable\n",
1306
 
                 direntry->d_name);
1307
 
  }
1308
1304
  return 1;
1309
1305
}
1310
1306
 
1473
1469
        }
1474
1470
      }
1475
1471
      free(fullname);
1476
 
      if(debug){
1477
 
        fprintf_plus(stderr, "Network hook \"%s\" ran successfully\n",
1478
 
                     direntry->d_name);
 
1472
      if(quit_now){
 
1473
        break;
1479
1474
      }
1480
1475
    }
1481
1476
    close(devnull);
2205
2200
  if(gpgme_initialized){
2206
2201
    gpgme_release(mc.ctx);
2207
2202
  }
2208
 
  
 
2203
 
2209
2204
  /* Cleans up the circular linked list of Mandos servers the client
2210
2205
     has seen */
2211
2206
  if(mc.current_server != NULL){
2226
2221
        perror_plus("seteuid");
2227
2222
      }
2228
2223
    }
2229
 
    
2230
2224
    /* Run network hooks */
2231
 
    run_network_hooks("stop", interface, delay);
 
2225
    if(not run_network_hooks("stop", interface, delay)){
 
2226
      goto end;
 
2227
    }
2232
2228
    
2233
2229
    /* Take down the network interface */
2234
2230
    if(take_down_interface and geteuid() == 0){