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

Change "fukt.bsnet.se" to "recompile.se" throughout.

* README: - '' -
* debian/control: - '' -
* debian/copyright: - '' -
* debian/mandos-client.README.Debian: - '' - and some rewriting.
* debian/mandos.README.Debian: - '' -
* debian/watch: Change "fukt.bsnet.se" to "recompile.se".
* init.d-mandos: - '' -
* intro.xml: - '' -
* mandos: - '' -
* mandos-clients.conf.xml: - '' -
* mandos-ctl: - '' -
* mandos-ctl.xml: - '' -
* mandos-keygen: - '' -
* mandos-keygen.xml: - '' -
* mandos-monitor: - '' -
* mandos-monitor.xml: - '' -
* mandos.conf.xml: - '' -
* mandos.lsm: - '' -
* mandos.xml: - '' -
* plugin-runner.c: - '' -
* plugin-runner.xml: - '' -
* plugins.d/askpass-fifo.c: - '' -
* plugins.d/askpass-fifo.xml: - '' -
* plugins.d/mandos-client.c: - '' -
* plugins.d/mandos-client.xml: - '' -
* plugins.d/password-prompt.c: - '' -
* plugins.d/password-prompt.xml: - '' -
* plugins.d/plymouth.c: - '' -
* plugins.d/plymouth.xml: - '' -
* plugins.d/splashy.c: - '' -
* plugins.d/splashy.xml: - '' -
* plugins.d/usplash.c: - '' -
* plugins.d/usplash.xml: - '' -

Show diffs side-by-side

added added

removed removed

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