/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 plugin-runner.c

  • Committer: teddy at recompile
  • Date: 2011-12-31 13:25:58 UTC
  • mto: (237.7.89 trunk)
  • mto: This revision was merged to the branch mainline in revision 290.
  • Revision ID: teddy@recompile.se-20111231132558-z0dh7qgofgctmgri
* network-hooks.s/bridge: Don't use interface names directly; search
                          for interface names using their address.
  (addrtoif): New function.
* network-hooks.s/bridge.conf (PORTS): Removed.
  (PORT_ADDRESSES): New.
* network-hooks.s/wireless: Don't use interface names directly; search
                            for interface names using their address.
  (addrtoif): New function.
* network-hooks.s/wireless.conf: Specify address.

Show diffs side-by-side

added added

removed removed

Lines of Context:
171
171
}
172
172
 
173
173
/* Helper function for add_argument and add_environment */
 
174
__attribute__((nonnull))
174
175
static bool add_to_char_array(const char *new, char ***array,
175
176
                              int *len){
176
177
  /* Resize the pointed-to array to hold one more pointer */
199
200
}
200
201
 
201
202
/* Add to a plugin's argument vector */
 
203
__attribute__((nonnull(2)))
202
204
static bool add_argument(plugin *p, const char *arg){
203
205
  if(p == NULL){
204
206
    return false;
207
209
}
208
210
 
209
211
/* Add to a plugin's environment */
 
212
__attribute__((nonnull(2)))
210
213
static bool add_environment(plugin *p, const char *def, bool replace){
211
214
  if(p == NULL){
212
215
    return false;
286
289
}
287
290
 
288
291
/* Prints out a password to stdout */
 
292
__attribute__((nonnull))
289
293
static bool print_out_password(const char *buffer, size_t length){
290
294
  ssize_t ret;
291
295
  for(size_t written = 0; written < length; written += (size_t)ret){
299
303
}
300
304
 
301
305
/* Removes and free a plugin from the plugin list */
 
306
__attribute__((nonnull))
302
307
static void free_plugin(plugin *plugin_node){
303
308
  
304
309
  for(char **arg = plugin_node->argv; *arg != NULL; arg++){
416
421
    { .name = NULL }
417
422
  };
418
423
  
 
424
  __attribute__((nonnull(3)))
419
425
  error_t parse_opt(int key, char *arg, struct argp_state *state){
420
426
    errno = 0;
421
427
    switch(key){
742
748
    }
743
749
  }
744
750
  
745
 
  {
 
751
  if(getuid() == 0){
746
752
    /* Work around Debian bug #633582:
747
753
       <http://bugs.debian.org/633582> */
748
754
    int plugindir_fd = open(/* plugindir or */ PDIR, O_RDONLY);