Improved OpenWrt UCI/Initscript

* c-analysed: chuser()/chgroup()

Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
This commit is contained in:
Toni Uhlig
2022-10-06 06:54:01 +02:00
parent ac46f3841f
commit b7a17d62c7
3 changed files with 243 additions and 9 deletions

View File

@@ -557,6 +557,20 @@ int main(int argc, char ** argv)
}
openlog("nDPIsrvd-analyzed", LOG_CONS, LOG_DAEMON);
errno = 0;
if (user != NULL && change_user_group(user, group, pidfile, csv_outfile /* :D */, NULL) != 0)
{
if (errno != 0)
{
syslog(LOG_DAEMON | LOG_ERR, "Change user/group failed: %s", strerror(errno));
}
else
{
syslog(LOG_DAEMON | LOG_ERR, "Change user/group failed.");
}
return 1;
}
if (nDPIsrvd_set_read_timeout(sock, 180, 0) != 0)
{
return 1;