Skip to content

Commit

Permalink
Fixed: Missing chdir() and umask() calls
Browse files Browse the repository at this point in the history
Fixed: STDIN, STDOUT and STDERR must be redirected to /dev/null
Updated: Version to 1.2.5
[ci skip]
  • Loading branch information
nuxwin committed Mar 2, 2016
1 parent f0414fe commit 6f5854d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ CONFIG
Added: imscp_panel.service systemd unit file
Added: OpenSSL configuration template file for self-signed SSL certificates

DAEMON
Fixed: Missing chdir() and umask() calls
Fixed: STDIN, STDOUT and STDERR must be redirected to /dev/null
Updated: Version to 1.2.5

DATABASE
Added: Default value for the domain.external_mail_dns_ids field
Added: Default value for the domain_aliasses.external_mail_dns_ids field
Expand Down
4 changes: 3 additions & 1 deletion daemon/daemon_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
void daemonInit(char *pidfile)
{
/* daemonize */
if(daemon(1, 1) > 1) {
if(daemon(0, 0) > 1) {
exit(errno);
}

umask(0);

/* open log */
openlog(message(MSG_DAEMON_NAME), LOG_PID, SYSLOG_FACILITY);

Expand Down
2 changes: 2 additions & 0 deletions daemon/daemon_init.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <syslog.h>
#include <errno.h>
#include "defs.h"
Expand Down
4 changes: 2 additions & 2 deletions daemon/defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
#define MSG_MAX_COUNT 20

#define MSG_WELCOME 101
#define MSG_WELCOME_TXT "i-MSCP Daemon v1.2.4\n"
#define MSG_WELCOME_TXT "i-MSCP Daemon v1.2.5\n"
#define MSG_DAEMON_STARTED 102
#define MSG_DAEMON_STARTED_TXT "i-MSCP daemon v1.2.4 started."
#define MSG_DAEMON_STARTED_TXT "i-MSCP daemon v1.2.5 started."
#define MSG_DAEMON_NAME 103
#define MSG_DAEMON_NAME_TXT "imscp_daemon"
#define MSG_ERROR_LISTEN 104
Expand Down

0 comments on commit 6f5854d

Please sign in to comment.