/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

merge

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))
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);