From: Sebastian Harl Date: Tue, 17 Jun 2008 17:59:14 +0000 (+0200) Subject: email plugin: Don't unlink the socket file on startup. X-Git-Tag: collectd-4.4.2~4^2~4 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d00449bdc71bb7e97e23fc42579a42855afc9492;p=collectd.git email plugin: Don't unlink the socket file on startup. Usually, collectd runs as user root, thus making it an unsafe operation to unconditionally remove the file even though one should be able to assume that it "belongs" to collectd. Signed-off-by: Sebastian Harl Signed-off-by: Florian Forster --- diff --git a/src/email.c b/src/email.c index b718cf5c..c78d7614 100644 --- a/src/email.c +++ b/src/email.c @@ -513,7 +513,6 @@ static void *open_connection (void *arg) strncpy (addr.sun_path, sock_file, (size_t)(UNIX_PATH_MAX - 1)); addr.sun_path[UNIX_PATH_MAX - 1] = '\0'; - unlink (addr.sun_path); errno = 0; if (-1 == bind (connector_socket, (struct sockaddr *)&addr,