aboutsummaryrefslogtreecommitdiff
path: root/nDPIsrvd.c
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2022-11-05 23:30:53 +0100
committerToni Uhlig <matzeton@googlemail.com>2022-11-06 12:58:55 +0100
commit7515c8aeec3f6e60aa7e97e6903f6306ca7af34e (patch)
tree2583c254db17121facfd4b6b43cfe44abc064c55 /nDPIsrvd.c
parent25f4ef74acb73340bd7cba7a7d45ab7191232283 (diff)
Experimental systemd support.
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'nDPIsrvd.c')
-rw-r--r--nDPIsrvd.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/nDPIsrvd.c b/nDPIsrvd.c
index 891080f23..81e0d7c44 100644
--- a/nDPIsrvd.c
+++ b/nDPIsrvd.c
@@ -95,7 +95,8 @@ static struct
int bufferbloat_fallback_to_blocking;
} nDPIsrvd_options = {.max_remote_descriptors = nDPIsrvd_MAX_REMOTE_DESCRIPTORS,
.max_write_buffers = nDPIsrvd_MAX_WRITE_BUFFERS,
- .bufferbloat_fallback_to_blocking = 1};
+ .bufferbloat_fallback_to_blocking = 1,
+ .user = "nobody"};
static void logger_nDPIsrvd(struct remote_desc const * const remote,
char const * const prefix,
@@ -1599,11 +1600,13 @@ int main(int argc, char ** argv)
}
errno = 0;
- if (nDPIsrvd_options.user != NULL && change_user_group(nDPIsrvd_options.user,
- nDPIsrvd_options.group,
- nDPIsrvd_options.pidfile,
- nDPIsrvd_options.collector_un_sockpath,
- nDPIsrvd_options.distributor_un_sockpath) != 0)
+ if (nDPIsrvd_options.user != NULL &&
+ change_user_group(nDPIsrvd_options.user,
+ nDPIsrvd_options.group,
+ nDPIsrvd_options.pidfile,
+ nDPIsrvd_options.collector_un_sockpath,
+ nDPIsrvd_options.distributor_un_sockpath) != 0 &&
+ errno != EPERM)
{
if (errno != 0)
{