Skip to content
Snippets Groups Projects
Commit 72ce6a06 authored by Morris Jette's avatar Morris Jette
Browse files

Add needed headers

Also remove group/other write access to PID file
parent db73f1f5
No related branches found
No related tags found
No related merge requests found
...@@ -44,6 +44,8 @@ ...@@ -44,6 +44,8 @@
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h> #include <unistd.h>
#include <sys/resource.h> #include <sys/resource.h>
#include <sys/stat.h>
#include <sys/types.h>
#include "src/common/daemonize.h" #include "src/common/daemonize.h"
#include "src/common/fd.h" #include "src/common/fd.h"
...@@ -164,8 +166,7 @@ create_pidfile(const char *pidfile, uid_t uid) ...@@ -164,8 +166,7 @@ create_pidfile(const char *pidfile, uid_t uid)
xassert(pidfile != NULL); xassert(pidfile != NULL);
xassert(pidfile[0] == '/'); xassert(pidfile[0] == '/');
fd = creat_cloexec(pidfile, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP fd = creat_cloexec(pidfile, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
| S_IROTH | S_IWOTH);
if (fd < 0) { if (fd < 0) {
error("Unable to open pidfile `%s': %m", pidfile); error("Unable to open pidfile `%s': %m", pidfile);
return -1; return -1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment