From b514afdd4b7527370651474d952bddc41fcdf8b8 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Thu, 24 Mar 2016 11:06:41 +0000 Subject: [PATCH] noip.c (create_sockdir): Make sure the socket directory isn't a symlink. Oh, dear. This is a long-standing bug, and a bad one for systems which don't set per-user $TMPDIR directories. --- noip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/noip.c b/noip.c index 9c5cd68..72baaee 100644 --- a/noip.c +++ b/noip.c @@ -1436,13 +1436,13 @@ static void create_sockdir(void) { struct stat st; - if (stat(sockdir, &st)) { + if (lstat(sockdir, &st)) { if (errno == ENOENT) { if (mkdir(sockdir, 0700)) { perror("noip: creating socketdir"); exit(127); } - if (!stat(sockdir, &st)) + if (!lstat(sockdir, &st)) goto check; } perror("noip: checking socketdir"); -- 2.11.0