/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/usplash.c

* network-hooks.d: New directory.
* network-hooks.d/bridge: New example hook.
* network-hooks.d/bridge.conf: Config file for bridge example hook.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 * along with this program.  If not, see
20
20
 * <http://www.gnu.org/licenses/>.
21
21
 * 
22
 
 * Contact the authors at <mandos@fukt.bsnet.se>.
 
22
 * Contact the authors at <mandos@recompile.se>.
23
23
 */
24
24
 
25
25
#define _GNU_SOURCE             /* asprintf(), TEMP_FAILURE_RETRY() */
36
36
                                   dirent */
37
37
#include <stddef.h>             /* NULL */
38
38
#include <string.h>             /* strlen(), memcmp(), strerror() */
39
 
#include <stdio.h>              /* asprintf(), vasprintf(), vprintf(), fprintf() */
 
39
#include <stdio.h>              /* asprintf(), vasprintf(), vprintf(),
 
40
                                   fprintf() */
40
41
#include <unistd.h>             /* close(), write(), readlink(),
41
42
                                   read(), STDOUT_FILENO, sleep(),
42
43
                                   fork(), setuid(), geteuid(),
57
58
const char usplash_name[] = "/sbin/usplash";
58
59
 
59
60
/* Function to use when printing errors */
60
 
void error_plus(int status, int errnum, const char *formatstring, ...){
 
61
void error_plus(int status, int errnum, const char *formatstring,
 
62
                ...){
61
63
  va_list ap;
62
64
  char *text;
63
65
  int ret;
65
67
  va_start(ap, formatstring);
66
68
  ret = vasprintf(&text, formatstring, ap);
67
69
  if (ret == -1){
68
 
    fprintf(stderr, "Mandos plugin %s: ", program_invocation_short_name);
 
70
    fprintf(stderr, "Mandos plugin %s: ",
 
71
            program_invocation_short_name);
69
72
    vfprintf(stderr, formatstring, ap);
70
73
    fprintf(stderr, ": ");
71
74
    fprintf(stderr, "%s\n", strerror(errnum));