=== modified file 'plugins.d/mandos-client.c' --- plugins.d/mandos-client.c 2014-03-29 02:38:15 +0000 +++ plugins.d/mandos-client.c 2014-03-29 05:16:37 +0000 @@ -136,8 +136,8 @@ bool debug = false; static const char mandos_protocol_version[] = "1"; -const char * argp_program_version = "mandos-client " VERSION; -const char * argp_program_bug_address = ""; +const char *argp_program_version = "mandos-client " VERSION; +const char *argp_program_bug_address = ""; static const char sys_class_net[] = "/sys/class/net"; char *connect_to = NULL; const char *hookdir = HOOKDIR; @@ -1715,12 +1715,13 @@ /* Raise privileges */ ret_errno = raise_privileges(); + if(ret_errno != 0){ + perror_plus("Failed to raise privileges"); + } + +#ifdef __linux__ + int ret_linux; bool restore_loglevel = false; - if(ret_errno != 0){ - perror_plus("Failed to raise privileges"); - } -#ifdef __linux__ - int ret_linux; if(ret_errno == 0){ /* Lower kernel loglevel to KERN_NOTICE to avoid KERN_INFO messages about the network interface to mess up the prompt */ @@ -1826,6 +1827,7 @@ if(ret_errno != 0){ perror_plus("Failed to raise privileges"); } + int ret_setflags = ioctl(sd, SIOCSIFFLAGS, &network); ioctl_errno = errno; @@ -2560,6 +2562,7 @@ } } } + ret_errno = lower_privileges_permanently(); if(ret_errno != 0){ perror_plus("Failed to lower privileges permanently");