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.
master
Nicolas Favre-Felix 2 years ago
parent 08f0d5d7cf
commit 7c66f69b21
No known key found for this signature in database
GPG Key ID: C04E7AA8B6F73372

@ -200,7 +200,7 @@ server_daemonize(struct server *s, const char *pidfile) {
/* write pidfile */ /* write pidfile */
if(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) { if(pid_fd > 0) {
char pid_buffer[(CHAR_BIT * sizeof(int) / 3) + 3]; /* max length for int */ 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()); int pid_sz = snprintf(pid_buffer, sizeof(pid_buffer), "%d\n", (int)getpid());

Loading…
Cancel
Save