/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 plugins.d/password-prompt.c

  • Committer: Teddy Hogeborn
  • Date: 2014-03-06 02:26:04 UTC
  • mto: (237.7.272 trunk)
  • mto: This revision was merged to the branch mainline in revision 311.
  • Revision ID: teddy@recompile.se-20140306022604-4uc43taz25cflgi3
Bug fix: Free all memory and give better messages when memory is full.

* plugin-runner.c (add_to_char_array): Bug fix: If realloc fails, do
                                       not change old array pointer.
  (add_environment): Bug fix: If realloc fails, do not change old
                     environment pointer.  Also rename "e" to "envdef"
                     for clarity.
  (main): Bug fix: If realloc fails, do not change old pointers.  Also
          wrap "#pragma GCC" with "#ifdef ___GNUC___".
* plugins.d/mandos-client.c (incbuffer): Bug fix: if realloc fails,
                                         free old buffer.
  (run_network_hooks): Moved variables "directory" and "ret" to their
                       innermost possible scope.
  (take_down_interface): Moved variables "sd", "ret_errno", and
                         "ret_setflags" to their innermost possible
                         scope.
  (main): Removed variable "interfaces_hooks_size".  Also, if argz_add
          fails when adding all found interfaces, the error message
          will now be correct.  Also print error message if, after
          having taken up an interface, argz_add fails to add
          interface to list of interfaces to be taken down.
* plugins.d/mandos-client.xml (OPTIONS): Explain better what "none"
                                         means as argument to
                                         "--interface" by negating
                                         sense.
* plugins.d/password-prompt.c (fprintf_plus): Removed (unused).

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
/*
3
3
 * Password-prompt - Read a password from the terminal and print it
4
4
 * 
5
 
 * Copyright © 2008-2016 Teddy Hogeborn
6
 
 * Copyright © 2008-2016 Björn Påhlsson
 
5
 * Copyright © 2008-2013 Teddy Hogeborn
 
6
 * Copyright © 2008-2013 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
82
82
  
83
83
  va_start(ap, formatstring);
84
84
  ret = vasprintf(&text, formatstring, ap);
85
 
  if(ret == -1){
 
85
  if (ret == -1){
86
86
    fprintf(stderr, "Mandos plugin %s: ",
87
87
            program_invocation_short_name);
88
88
    vfprintf(stderr, formatstring, ap);
212
212
  struct dirent **direntries = NULL;
213
213
  int ret;
214
214
  ret = scandir("/proc", &direntries, is_plymouth, alphasort);
215
 
  if(ret == -1){
 
215
  if (ret == -1){
216
216
    error_plus(1, errno, "scandir");
217
217
  }
218
218
  free(direntries);
303
303
    fprintf(stderr, "Starting %s\n", argv[0]);
304
304
  }
305
305
 
306
 
  if(conflict_detection()){
 
306
  if (conflict_detection()){
307
307
    if(debug){
308
308
      fprintf(stderr, "Stopping %s because of conflict\n", argv[0]);
309
309
    }