From 7c66f69b21a15d9692951902690a4c732fb6ea14 Mon Sep 17 00:00:00 2001 From: Nicolas Favre-Felix Date: Thu, 23 Feb 2023 07:04:16 -0800 Subject: [PATCH] Remove O_NOFOLLOW from src/server.c This was unnecessarily limiting, since users could legitimately want to use a symlink for the config file. It is also unsupported on some platforms; this was discovered when attempting to build Webdis on CentOS 7. --- src/server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server.c b/src/server.c index 03fa3b9..be39792 100644 --- a/src/server.c +++ b/src/server.c @@ -200,7 +200,7 @@ server_daemonize(struct server *s, const char *pidfile) { /* write pidfile */ if(pidfile) { - int pid_fd = open(pidfile, O_WRONLY | O_CREAT | O_TRUNC | O_NOFOLLOW, 0600); + int pid_fd = open(pidfile, O_WRONLY | O_CREAT | O_TRUNC, 0600); if(pid_fd > 0) { char pid_buffer[(CHAR_BIT * sizeof(int) / 3) + 3]; /* max length for int */ int pid_sz = snprintf(pid_buffer, sizeof(pid_buffer), "%d\n", (int)getpid());